@meetelise/chat 1.12.10 → 1.12.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/public/demo/index.html
CHANGED
package/public/dist/index.js
CHANGED
|
@@ -430,7 +430,7 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
|
|
|
430
430
|
.option.active {
|
|
431
431
|
background-color: var(--active-option-color);
|
|
432
432
|
}
|
|
433
|
-
`,Gt([oe({attribute:!1})],$t.prototype,"options",void 0),Gt([oe({type:String})],$t.prototype,"placeholder",void 0),Gt([oe({type:String})],$t.prototype,"value",void 0),Gt([ae()],$t.prototype,"activeOption",void 0),Gt([ae()],$t.prototype,"isOpen",void 0),Gt([se("#select",!0)],$t.prototype,"meSelect",void 0),$t=Gt([ne("me-select")],$t),Math.pow(10,8);var Vt=36e5,Xt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Qt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Yt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Kt(e){var t,i={},n=e.split(Xt.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?t=n[0]:(i.date=n[0],t=n[1],Xt.timeZoneDelimiter.test(i.date)&&(i.date=e.split(Xt.timeZoneDelimiter)[0],t=e.substr(i.date.length,e.length))),t){var r=Xt.timezone.exec(t);r?(i.time=t.replace(r[1],""),i.timezone=r[1]):i.time=t}return i}function ei(e,t){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(i);if(!n)return{year:NaN,restDateString:""};var r=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((n[1]||n[2]).length)}}function ti(e,t){if(null===t)return new Date(NaN);var i=e.match(Qt);if(!i)return new Date(NaN);var n=!!i[4],r=ii(i[1]),o=ii(i[2])-1,a=ii(i[3]),s=ii(i[4]),l=ii(i[5])-1;if(n)return function(e,t,i){return t>=1&&t<=53&&i>=0&&i<=6}(0,s,l)?function(e,t,i){var n=new Date(0);n.setUTCFullYear(e,0,4);var r=7*(t-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+r),n}(t,s,l):new Date(NaN);var u=new Date(0);return function(e,t,i){return t>=0&&t<=11&&i>=1&&i<=(ai[t]||(si(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(si(e)?366:365)}(t,r)?(u.setUTCFullYear(t,o,Math.max(r,a)),u):new Date(NaN)}function ii(e){return e?parseInt(e):1}function ni(e){var t=e.match(Zt);if(!t)return NaN;var i=ri(t[1]),n=ri(t[2]),r=ri(t[3]);return function(e,t,i){return 24===e?0===t&&0===i:i>=0&&i<60&&t>=0&&t<60&&e>=0&&e<25}(i,n,r)?i*Vt+6e4*n+1e3*r:NaN}function ri(e){return e&&parseFloat(e.replace(",","."))||0}function oi(e){if("Z"===e)return 0;var t=e.match(Yt);if(!t)return 0;var i="+"===t[1]?-1:1,n=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?i*(n*Vt+6e4*r):NaN}var ai=[31,null,31,30,31,30,31,31,30,31,30,31];function si(e){return e%400==0||e%4==0&&e%100!=0}var li=i(9669),ui=i.n(li),di=i(7739),ci=i.n(di);const pi={},fi=async e=>{if(pi[e])return pi[e];const t=function(e){_e(1,arguments);var t=Fe(e);return t.setHours(0,0,0,0),t}(Date.now()),i=zt(function(e){_e(1,arguments);var t=Fe(e);return t.setHours(23,59,59,999),t}(function(e,t){_e(2,arguments);var i=Fe(e),n=Ve(t);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}(t,30))),n=`https://app.meetelise.com/api/pub/v1/buildings/${e}/tour/availabilities?startTime=${zt(t)}&endTime=${i}`,r=await ui().get(n);return pi[e]=r.data,r.data},mi=async e=>(async(e,t)=>{var i;const n=await(async(e,t)=>{var i,n,r;const o=await fi(e),a=(null===(i=o.availability)||void 0===i?void 0:i[t])?null===(r=null===(n=o.availability)||void 0===n?void 0:n[t].availableTourStartTimes)||void 0===r?void 0:r.map((e=>function(e,t){_e(1,arguments);var i=t||{},n=null==i.additionalDigits?2:Ve(i.additionalDigits);if(2!==n&&1!==n&&0!==n)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=Kt(e);if(o.date){var a=ei(o.date,n);r=ti(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,l=r.getTime(),u=0;if(o.time&&(u=ni(o.time),isNaN(u)))return new Date(NaN);if(!o.timezone){var d=new Date(l+u),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=oi(o.timezone),isNaN(s)?new Date(NaN):new Date(l+u+s)}(e))):[];return o.availability?{...o.availability[t],availableTourStartTimes:a}:null})(e,t);return n?ci()(null!==(i=n.availableTourStartTimes)&&void 0!==i?i:[],(e=>Pt(e,"yyyy-MM-dd"))):{}})(Object.keys(pi).map(Number)[0],e);var hi=i(9991);i(7294);const vi=()=>window.matchMedia("(max-width: 767px)").matches;var gi=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let yi=class extends te{constructor(){super(...arguments),this.layoutOptions=[],this.tourTypeOptions=[],this.buildingId=0,this.tourType=wi.Guided,this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.tourIsBooked=!1,this.firstUpdated=async()=>{this.availabilitiesGroupedByDay=await mi(Si[this.tourType])},this.willUpdate=async e=>{e.has("tourType")&&(this.availabilitiesGroupedByDay=await mi(Si[this.tourType]))},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const i=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,n=this.phoneNumber.slice(0,i).replace(/\D/g,""),r=this.phoneNumber.slice(i).replace(/\D/g,""),o=`${n.slice(0,-1)}${r}`;this.phoneNumber=Ie(o),this.phoneInput.value=this.phoneNumber;const a=i-(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,i).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,n=i-e>-1?i-e:0;this.phoneInput.setSelectionRange(n,n)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(i).split(/\d+/)[0].length||0)+1,t=i+e<this.phoneNumber.length?i+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,i)+e.key+this.phoneNumber.slice(i);this.phoneNumber=Ie(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const i=this.phoneInput.selectionStart,n=i?this.phoneInput.value.slice(i).replace(/\D/g,""):"";this.phoneNumber=Ie(this.phoneInput.value);let r=0,o=n.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:()=>!isNaN(this.tourType),dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t;return!!(null===(e=this.nameInput)||void 0===e?void 0:e.value)&&(null===(t=this.emailInput)||void 0===t?void 0:t.value.includes("@"))&&!!this.phoneNumber&&14===this.phoneNumber.length}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo(),this.timeStringToHoursAndMinutes=e=>{const[t,i]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(i)]},this.submit=async()=>{var e;if(!this.selectedDate||!this.selectedTime)return;const[t,i]=this.timeStringToHoursAndMinutes(this.selectedTime),n=new Date(this.selectedDate.getTime());n.setHours(t,i);const r=n.toISOString(),o={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.nameInput.value.split(" ")[0],last_name:this.nameInput.value.split(" ").slice(1).join(" "),tour_type:bi[this.tourType],tour_time:r};200===(await ui().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",o)).status&&(this.tourIsBooked=!0)},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:"Schedule tour",nextButtonAction:this.submit,render:()=>D`${this.userInfoAndLayoutMenu()}`}]}tourTypeMenu(){return D`<h2 id="tourType">Tour Type</h2>
|
|
433
|
+
`,Gt([oe({attribute:!1})],$t.prototype,"options",void 0),Gt([oe({type:String})],$t.prototype,"placeholder",void 0),Gt([oe({type:String})],$t.prototype,"value",void 0),Gt([ae()],$t.prototype,"activeOption",void 0),Gt([ae()],$t.prototype,"isOpen",void 0),Gt([se("#select",!0)],$t.prototype,"meSelect",void 0),$t=Gt([ne("me-select")],$t),Math.pow(10,8);var Vt=36e5,Xt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Qt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Yt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Kt(e){var t,i={},n=e.split(Xt.dateTimeDelimiter);if(n.length>2)return i;if(/:/.test(n[0])?t=n[0]:(i.date=n[0],t=n[1],Xt.timeZoneDelimiter.test(i.date)&&(i.date=e.split(Xt.timeZoneDelimiter)[0],t=e.substr(i.date.length,e.length))),t){var r=Xt.timezone.exec(t);r?(i.time=t.replace(r[1],""),i.timezone=r[1]):i.time=t}return i}function ei(e,t){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(i);if(!n)return{year:NaN,restDateString:""};var r=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((n[1]||n[2]).length)}}function ti(e,t){if(null===t)return new Date(NaN);var i=e.match(Qt);if(!i)return new Date(NaN);var n=!!i[4],r=ii(i[1]),o=ii(i[2])-1,a=ii(i[3]),s=ii(i[4]),l=ii(i[5])-1;if(n)return function(e,t,i){return t>=1&&t<=53&&i>=0&&i<=6}(0,s,l)?function(e,t,i){var n=new Date(0);n.setUTCFullYear(e,0,4);var r=7*(t-1)+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+r),n}(t,s,l):new Date(NaN);var u=new Date(0);return function(e,t,i){return t>=0&&t<=11&&i>=1&&i<=(ai[t]||(si(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(si(e)?366:365)}(t,r)?(u.setUTCFullYear(t,o,Math.max(r,a)),u):new Date(NaN)}function ii(e){return e?parseInt(e):1}function ni(e){var t=e.match(Zt);if(!t)return NaN;var i=ri(t[1]),n=ri(t[2]),r=ri(t[3]);return function(e,t,i){return 24===e?0===t&&0===i:i>=0&&i<60&&t>=0&&t<60&&e>=0&&e<25}(i,n,r)?i*Vt+6e4*n+1e3*r:NaN}function ri(e){return e&&parseFloat(e.replace(",","."))||0}function oi(e){if("Z"===e)return 0;var t=e.match(Yt);if(!t)return 0;var i="+"===t[1]?-1:1,n=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,r)?i*(n*Vt+6e4*r):NaN}var ai=[31,null,31,30,31,30,31,31,30,31,30,31];function si(e){return e%400==0||e%4==0&&e%100!=0}var li=i(9669),ui=i.n(li),di=i(7739),ci=i.n(di);const pi={},fi=async e=>{if(pi[e])return pi[e];const t=function(e){_e(1,arguments);var t=Fe(e);return t.setHours(0,0,0,0),t}(Date.now()),i=zt(function(e){_e(1,arguments);var t=Fe(e);return t.setHours(23,59,59,999),t}(function(e,t){_e(2,arguments);var i=Fe(e),n=Ve(t);return isNaN(n)?new Date(NaN):n?(i.setDate(i.getDate()+n),i):i}(t,30))),n=`https://app.meetelise.com/api/pub/v1/buildings/${e}/tour/availabilities?startTime=${zt(t)}&endTime=${i}`,r=await ui().get(n);return pi[e]=r.data,r.data},mi=async e=>(async(e,t)=>{var i;const n=await(async(e,t)=>{var i,n,r;const o=await fi(e),a=(null===(i=o.availability)||void 0===i?void 0:i[t])?null===(r=null===(n=o.availability)||void 0===n?void 0:n[t].availableTourStartTimes)||void 0===r?void 0:r.map((e=>function(e,t){_e(1,arguments);var i=t||{},n=null==i.additionalDigits?2:Ve(i.additionalDigits);if(2!==n&&1!==n&&0!==n)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=Kt(e);if(o.date){var a=ei(o.date,n);r=ti(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,l=r.getTime(),u=0;if(o.time&&(u=ni(o.time),isNaN(u)))return new Date(NaN);if(!o.timezone){var d=new Date(l+u),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=oi(o.timezone),isNaN(s)?new Date(NaN):new Date(l+u+s)}(e))):[];return o.availability?{...o.availability[t],availableTourStartTimes:a}:null})(e,t);return n?ci()(null!==(i=n.availableTourStartTimes)&&void 0!==i?i:[],(e=>Pt(e,"yyyy-MM-dd"))):{}})(Object.keys(pi).map(Number)[0],e);var hi=i(9991);i(7294);const vi=()=>window.matchMedia("(max-width: 767px)").matches;var gi=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let yi=class extends te{constructor(){super(...arguments),this.layoutOptions=[],this.tourTypeOptions=[],this.buildingId=0,this.tourType=wi.Guided,this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.tourIsBooked=!1,this.firstUpdated=async()=>{this.availabilitiesGroupedByDay=await mi(Si[this.tourType])},this.willUpdate=async e=>{e.has("tourType")&&(this.availabilitiesGroupedByDay=await mi(Si[this.tourType]))},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const i=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,n=this.phoneNumber.slice(0,i).replace(/\D/g,""),r=this.phoneNumber.slice(i).replace(/\D/g,""),o=`${n.slice(0,-1)}${r}`;this.phoneNumber=Ie(o),this.phoneInput.value=this.phoneNumber;const a=i-(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,i).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,n=i-e>-1?i-e:0;this.phoneInput.setSelectionRange(n,n)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(i).split(/\d+/)[0].length||0)+1,t=i+e<this.phoneNumber.length?i+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,i)+e.key+this.phoneNumber.slice(i);this.phoneNumber=Ie(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const i=this.phoneInput.selectionStart,n=i?this.phoneInput.value.slice(i).replace(/\D/g,""):"";this.phoneNumber=Ie(this.phoneInput.value);let r=0,o=n.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:()=>!isNaN(this.tourType),dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t;return!!(null===(e=this.nameInput)||void 0===e?void 0:e.value)&&(null===(t=this.emailInput)||void 0===t?void 0:t.value.includes("@"))&&!!this.phoneNumber&&14===this.phoneNumber.length}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo(),this.timeStringToHoursAndMinutes=e=>{const[t,i]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(i)]},this.submit=async()=>{var e;if(!this.selectedDate||!this.selectedTime)return;const[t,i]=this.timeStringToHoursAndMinutes(this.selectedTime),n=new Date(this.selectedDate.getTime());n.setHours(t,i);const r=n.toISOString(),o={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.nameInput.value.split(" ")[0],last_name:this.nameInput.value.split(" ").slice(1).join(" "),tour_type:bi[this.tourType],tour_time:r};200===(await ui().post("https://app.meetelise.com/platformApi/state/create/scheduleMe",o,{headers:{"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG"}})).status&&(this.tourIsBooked=!0)},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:"Schedule tour",nextButtonAction:this.submit,render:()=>D`${this.userInfoAndLayoutMenu()}`}]}tourTypeMenu(){return D`<h2 id="tourType">Tour Type</h2>
|
|
434
434
|
<div id="tourTypeMenu">
|
|
435
435
|
${this.tourTypeOptions.map((e=>e.value)).includes("WITH_AGENT")?D` <tour-type-option
|
|
436
436
|
tourtype="guided"
|
|
@@ -1738,7 +1738,7 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
|
|
|
1738
1738
|
.call-us-window__open-times {
|
|
1739
1739
|
text-transform: lowercase;
|
|
1740
1740
|
}
|
|
1741
|
-
`],sn([oe({attribute:!1})],ln.prototype,"onCloseClicked",void 0),sn([oe()],ln.prototype,"phoneNumber",void 0),sn([oe({attribute:!1})],ln.prototype,"buildingId",void 0),sn([oe({attribute:!1})],ln.prototype,"officeHoursTextInfo",void 0),ln=sn([ne("call-us-window")],ln);const un={};var dn=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let cn=class extends te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.phoneNumber="",this.buildingId=0,this.hasEmailEnabled=!0,this.hasSSTEnabled=!
|
|
1741
|
+
`],sn([oe({attribute:!1})],ln.prototype,"onCloseClicked",void 0),sn([oe()],ln.prototype,"phoneNumber",void 0),sn([oe({attribute:!1})],ln.prototype,"buildingId",void 0),sn([oe({attribute:!1})],ln.prototype,"officeHoursTextInfo",void 0),ln=sn([ne("call-us-window")],ln);const un={};var dn=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let cn=class extends te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.phoneNumber="",this.buildingId=0,this.hasEmailEnabled=!0,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.launcherStyles={},this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=Se(),this.textUsWindowRef=Se(),this.tourSchedulerRef=Se(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(un[e])return un[e];const t=`http://ivr.internal-meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,i=await ui().get(t);return un[e]=i.data,i.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&4895!==this.buildingId}},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToTextUsWindow=()=>{const e=this.textUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseTextUsWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.renderEmailOption=()=>{const e=this.getNumCallToActions()>2?"Email":"Email us";return D`
|
|
1742
1742
|
<div
|
|
1743
1743
|
@click=${this.onClickEmailOption}
|
|
1744
1744
|
class="launcher__call-to-action-option"
|
|
@@ -1764,7 +1764,8 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
|
|
|
1764
1764
|
${this.hasEmailEnabled?this.renderEmailOption():""}
|
|
1765
1765
|
${this.phoneNumber?this.renderCallUsOption():""}
|
|
1766
1766
|
${this.hasTextUsEnabled?this.renderTextUsOption():""}
|
|
1767
|
-
|
|
1767
|
+
<!-- TODO: re-enable -->
|
|
1768
|
+
<!-- ${this.hasSSTEnabled?this.renderSSTOption():""} -->
|
|
1768
1769
|
</div>
|
|
1769
1770
|
`,this.isCallToActionWindowOpen=()=>1===[this.isEmailWindowOpen,this.isCallUsWindowOpen,this.isSSTWindowOpen,this.isTextUsWindowOpen].filter((e=>e)).length,this.renderMiniOption=(e,t,i)=>D`
|
|
1770
1771
|
<div class="launcher__mini-option-wrapper">
|
|
@@ -1776,7 +1777,10 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
|
|
|
1776
1777
|
</div>
|
|
1777
1778
|
</div>
|
|
1778
1779
|
`,this.renderMiniLauncher=()=>D`
|
|
1779
|
-
<div
|
|
1780
|
+
<div
|
|
1781
|
+
class="launcher__mini-launcher-wrapper"
|
|
1782
|
+
style=${zi(this.launcherStyles)}
|
|
1783
|
+
>
|
|
1780
1784
|
${this.isEmailWindowOpen?D`<div class="launcher__window-wrapper">
|
|
1781
1785
|
<email-us-window
|
|
1782
1786
|
${xe(this.emailUsWindowRef)}
|
|
@@ -1834,7 +1838,8 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
|
|
|
1834
1838
|
/>
|
|
1835
1839
|
</svg>
|
|
1836
1840
|
`,this.onClickEmailOption,!0):""}
|
|
1837
|
-
|
|
1841
|
+
<!-- TODO: re-enable -->
|
|
1842
|
+
<!-- ${this.hasSSTEnabled&&!this.isCallToActionWindowOpen()?this.renderMiniOption(D`
|
|
1838
1843
|
<svg
|
|
1839
1844
|
width="18"
|
|
1840
1845
|
height="18"
|
|
@@ -1847,7 +1852,7 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
|
|
|
1847
1852
|
fill="#1E1E1E"
|
|
1848
1853
|
/>
|
|
1849
1854
|
</svg>
|
|
1850
|
-
`,this.onClickSSTOption,!0):""}
|
|
1855
|
+
`,this.onClickSSTOption,!0):""} -->
|
|
1851
1856
|
${this.phoneNumber&&!this.isCallToActionWindowOpen()?this.renderMiniOption(D`
|
|
1852
1857
|
<svg
|
|
1853
1858
|
width="18"
|
|
@@ -1951,7 +1956,7 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
|
|
|
1951
1956
|
</div>
|
|
1952
1957
|
`}
|
|
1953
1958
|
</div>
|
|
1954
|
-
`}};cn.styles=Hi,dn([oe({type:Boolean})],cn.prototype,"isMobile",void 0),dn([oe({type:Boolean})],cn.prototype,"isFirstMount",void 0),dn([oe()],cn.prototype,"backgroundColor",void 0),dn([oe()],cn.prototype,"textColor",void 0),dn([oe({type:Boolean})],cn.prototype,"isMini",void 0),dn([oe()],cn.prototype,"phoneNumber",void 0),dn([oe({attribute:!1})],cn.prototype,"buildingId",void 0),dn([oe({type:Boolean})],cn.prototype,"hasEmailEnabled",void 0),dn([oe({type:Boolean})],cn.prototype,"hasSSTEnabled",void 0),dn([oe({type:Boolean})],cn.prototype,"hasTextUsEnabled",void 0),dn([oe({attribute:!1})],cn.prototype,"layoutOptions",void 0),dn([oe({attribute:!1})],cn.prototype,"tourTypeOptions",void 0),dn([oe({attribute:!1})],cn.prototype,"onChatTapped",void 0),dn([ae()],cn.prototype,"isEmailWindowOpen",void 0),dn([ae()],cn.prototype,"isCallUsWindowOpen",void 0),dn([ae()],cn.prototype,"isSSTWindowOpen",void 0),dn([ae()],cn.prototype,"isTextUsWindowOpen",void 0),cn=dn([ne("meetelise-launcher")],cn);var pn=i(3379),fn=i.n(pn),mn=i(7795),hn=i.n(mn),vn=i(569),gn=i.n(vn),yn=i(3565),wn=i.n(yn),Sn=i(9216),bn=i.n(Sn),Tn=i(4589),xn=i.n(Tn),On=i(3631),In={};In.styleTagTransform=xn(),In.setAttributes=wn(),In.insert=gn().bind(null,"head"),In.domAPI=hn(),In.insertStyleElement=bn(),fn()(On.Z,In),On.Z&&On.Z.locals&&On.Z.locals;var Rn,Nn=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Cn=Rn=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.popup=null,this.theme=ki(),this.chatId="",this.analytics=null,this.isMobile=vi(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=Se(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const i=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,n=await fetch(i);return await n.json()}(this.orgSlug,this.buildingSlug),fi(this.building.id),this.chatId=function(e,t){const i=Fi(e,t),n=localStorage.getItem(i);return n&&!function(e,t){const i=Mi(e,t),n=localStorage.getItem(i)||_i(e,t),r=new Date(new Date(n).getTime()+864e5);return new Date>r}(e,t)?n:Ei(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=ki(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId))},this.initializeLaunchJS=async()=>{if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[e,t,i,n]=await Promise.all([this.building,this.theme,this.avatarSrc,Rn.session]);if(e.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(e,t,n,i),this.configureLauncherElement(),this.yardiDNIScriptInterval=setInterval((()=>this.pollForYardiCampaignSource()),1e3),setTimeout(clearInterval,15e3,this.yardiDNIScriptInterval)},this.configureLauncherElement=()=>{this.popup&&this.launcherRef.value&&(this.launcher=this.launcherRef.value)},this.configureTalkJSPopup=async(e,t,i,n)=>{const r=i.createPopup(Li(i,e,t,n||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),null===(e=this.analytics)||void 0===e||e.ping("open"),this.hideLauncher=!0,this.hasMounted=!0)})}}pollForYardiCampaignSource(){var e,t,i;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(i=this.analytics)||void 0===i||i.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.theme&&this.popup&&Rn.session))return;this.chatId=Ei(this.orgSlug,this.buildingSlug);const e=await Rn.session;this.analytics.chatId=this.chatId,this.popup.select(Li(e,this.building,this.theme,this.avatarSrc||this.building.avatarSrc,this.chatId,this.isMobile))}remove(){var e;null===(e=this.popup)||void 0===e||e.destroy()}open(){var e;null===(e=this.popup)||void 0===e||e.show()}close(){var e;null===(e=this.popup)||void 0===e||e.hide()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}render(){var e,t,i,n,r,o,a,s;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",cn),D`
|
|
1959
|
+
`}};cn.styles=Hi,dn([oe({type:Boolean})],cn.prototype,"isMobile",void 0),dn([oe({type:Boolean})],cn.prototype,"isFirstMount",void 0),dn([oe()],cn.prototype,"backgroundColor",void 0),dn([oe()],cn.prototype,"textColor",void 0),dn([oe({type:Boolean})],cn.prototype,"isMini",void 0),dn([oe()],cn.prototype,"phoneNumber",void 0),dn([oe({attribute:!1})],cn.prototype,"buildingId",void 0),dn([oe({type:Boolean})],cn.prototype,"hasEmailEnabled",void 0),dn([oe({type:Boolean})],cn.prototype,"hasSSTEnabled",void 0),dn([oe({type:Boolean})],cn.prototype,"hasTextUsEnabled",void 0),dn([oe({attribute:!1})],cn.prototype,"layoutOptions",void 0),dn([oe({attribute:!1})],cn.prototype,"tourTypeOptions",void 0),dn([oe({attribute:!1})],cn.prototype,"onChatTapped",void 0),dn([oe()],cn.prototype,"launcherStyles",void 0),dn([ae()],cn.prototype,"isEmailWindowOpen",void 0),dn([ae()],cn.prototype,"isCallUsWindowOpen",void 0),dn([ae()],cn.prototype,"isSSTWindowOpen",void 0),dn([ae()],cn.prototype,"isTextUsWindowOpen",void 0),cn=dn([ne("meetelise-launcher")],cn);var pn=i(3379),fn=i.n(pn),mn=i(7795),hn=i.n(mn),vn=i(569),gn=i.n(vn),yn=i(3565),wn=i.n(yn),Sn=i(9216),bn=i.n(Sn),Tn=i(4589),xn=i.n(Tn),On=i(3631),In={};In.styleTagTransform=xn(),In.setAttributes=wn(),In.insert=gn().bind(null,"head"),In.domAPI=hn(),In.insertStyleElement=bn(),fn()(On.Z,In),On.Z&&On.Z.locals&&On.Z.locals;var Rn,Nn=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Cn=Rn=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=ki(),this.chatId="",this.analytics=null,this.isMobile=vi(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=Se(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const i=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,n=await fetch(i);return await n.json()}(this.orgSlug,this.buildingSlug),fi(this.building.id),this.chatId=function(e,t){const i=Fi(e,t),n=localStorage.getItem(i);return n&&!function(e,t){const i=Mi(e,t),n=localStorage.getItem(i)||_i(e,t),r=new Date(new Date(n).getTime()+864e5);return new Date>r}(e,t)?n:Ei(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=ki(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId))},this.initializeLaunchJS=async()=>{if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[e,t,i,n]=await Promise.all([this.building,this.theme,this.avatarSrc,Rn.session]);if(e.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(e,t,n,i),this.configureLauncherElement(),this.yardiDNIScriptInterval=setInterval((()=>this.pollForYardiCampaignSource()),1e3),setTimeout(clearInterval,15e3,this.yardiDNIScriptInterval)},this.configureLauncherElement=()=>{this.popup&&this.launcherRef.value&&(this.launcher=this.launcherRef.value)},this.configureTalkJSPopup=async(e,t,i,n)=>{const r=i.createPopup(Li(i,e,t,n||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),null===(e=this.analytics)||void 0===e||e.ping("open"),this.hideLauncher=!0,this.hasMounted=!0)})}}pollForYardiCampaignSource(){var e,t,i;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(i=this.analytics)||void 0===i||i.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.theme&&this.popup&&Rn.session))return;this.chatId=Ei(this.orgSlug,this.buildingSlug);const e=await Rn.session;this.analytics.chatId=this.chatId,this.popup.select(Li(e,this.building,this.theme,this.avatarSrc||this.building.avatarSrc,this.chatId,this.isMobile))}remove(){var e;null===(e=this.popup)||void 0===e||e.destroy()}open(){var e;null===(e=this.popup)||void 0===e||e.show()}close(){var e;null===(e=this.popup)||void 0===e||e.hide()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}render(){var e,t,i,n,r,o,a,s;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",cn),D`
|
|
1955
1960
|
<div
|
|
1956
1961
|
class=${ce({launcherContainer:!0,launcher__mobile:this.isMobile,launcher__desktop:!this.isMobile,"meetelise-chat":!0,launcher:!0,shouldBeVisible:!0})}
|
|
1957
1962
|
>
|
|
@@ -1963,6 +1968,7 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
|
|
|
1963
1968
|
.buildingId=${null!==(t=null===(e=this.building)||void 0===e?void 0:e.id)&&void 0!==t?t:0}
|
|
1964
1969
|
.layoutOptions=${null!==(n=null===(i=this.building)||void 0===i?void 0:i.layoutOptions)&&void 0!==n?n:[]}
|
|
1965
1970
|
.tourTypeOptions=${null!==(o=null===(r=this.building)||void 0===r?void 0:r.tourTypeOptions)&&void 0!==o?o:[]}
|
|
1971
|
+
.launcherStyles=${this.launcherStyles}
|
|
1966
1972
|
phoneNumber="${null!==(s=null===(a=this.building)||void 0===a?void 0:a.phoneNumber)&&void 0!==s?s:""}"
|
|
1967
1973
|
textColor="${this.theme.chatHeader.textColor}"
|
|
1968
1974
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|
|
@@ -1983,4 +1989,4 @@ var e={8005:function(e,t,i){var n,r=this&&this.__extends||(n=function(e,t){retur
|
|
|
1983
1989
|
width: 100%;
|
|
1984
1990
|
height: 100px;
|
|
1985
1991
|
}
|
|
1986
|
-
`,Cn.session=Oe.ready.then((()=>{const e=new Oe.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Oe.Session({appId:"ogKIvCor",me:e})})),Nn([oe({type:String})],Cn.prototype,"buildingSlug",void 0),Nn([oe({type:String})],Cn.prototype,"orgSlug",void 0),Nn([oe({type:String})],Cn.prototype,"themeId",void 0),Nn([oe({attribute:!1})],Cn.prototype,"avatarSrc",void 0),Nn([oe({type:Boolean})],Cn.prototype,"useMiniWidget",void 0),Nn([ae()],Cn.prototype,"popup",void 0),Nn([ae()],Cn.prototype,"theme",void 0),Nn([ae()],Cn.prototype,"chatId",void 0),Nn([ae()],Cn.prototype,"analytics",void 0),Nn([ae()],Cn.prototype,"isMobile",void 0),Nn([ae()],Cn.prototype,"launcher",void 0),Nn([ae()],Cn.prototype,"building",void 0),Nn([ae()],Cn.prototype,"hasMounted",void 0),Nn([ae()],Cn.prototype,"hideLauncher",void 0),Cn=Rn=Nn([ne("me-chat")],Cn);class An{static start(e){En();const t=document.createElement("me-chat");t.setAttribute("orgSlug",e.organization),t.setAttribute("buildingSlug",e.building),e.themeId&&t.setAttribute("themeId",e.themeId),e.avatarSrc&&t.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(t.useMiniWidget=e.mini),document.body.appendChild(t),An.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}}An.meChat=null;const En=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href","https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap"),document.head.appendChild(e)}})();var r=n.Z;export{r as default};
|
|
1992
|
+
`,Cn.session=Oe.ready.then((()=>{const e=new Oe.User({id:"anonymous",name:"Me",email:null,role:"Default"});return new Oe.Session({appId:"ogKIvCor",me:e})})),Nn([oe({type:String})],Cn.prototype,"buildingSlug",void 0),Nn([oe({type:String})],Cn.prototype,"orgSlug",void 0),Nn([oe({type:String})],Cn.prototype,"themeId",void 0),Nn([oe({attribute:!1})],Cn.prototype,"avatarSrc",void 0),Nn([oe({type:Boolean})],Cn.prototype,"useMiniWidget",void 0),Nn([oe()],Cn.prototype,"launcherStyles",void 0),Nn([ae()],Cn.prototype,"popup",void 0),Nn([ae()],Cn.prototype,"theme",void 0),Nn([ae()],Cn.prototype,"chatId",void 0),Nn([ae()],Cn.prototype,"analytics",void 0),Nn([ae()],Cn.prototype,"isMobile",void 0),Nn([ae()],Cn.prototype,"launcher",void 0),Nn([ae()],Cn.prototype,"building",void 0),Nn([ae()],Cn.prototype,"hasMounted",void 0),Nn([ae()],Cn.prototype,"hideLauncher",void 0),Cn=Rn=Nn([ne("me-chat")],Cn);class An{static start(e){En();const t=document.createElement("me-chat");t.setAttribute("orgSlug",e.organization),t.setAttribute("buildingSlug",e.building),t.setAttribute("class","meetelise-chat"),e.themeId&&t.setAttribute("themeId",e.themeId),e.avatarSrc&&t.setAttribute("avatarSrc",e.avatarSrc),void 0!==e.mini&&(t.useMiniWidget=e.mini),e.launcherStyles&&(t.launcherStyles=e.launcherStyles),document.body.appendChild(t),An.meChat=t}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}}An.meChat=null;const En=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href","https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap"),document.head.appendChild(e)}})();var r=n.Z;export{r as default};
|
package/src/MEChat.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StyleInfo } from "lit/directives/style-map";
|
|
1
2
|
import { ThemeIdString } from "./themes";
|
|
2
3
|
import "./WebComponent/me-chat";
|
|
3
4
|
import { MEChat as MEChatLitElement } from "./WebComponent/me-chat";
|
|
@@ -22,6 +23,7 @@ export default class MEChat {
|
|
|
22
23
|
const meChat = document.createElement("me-chat");
|
|
23
24
|
meChat.setAttribute("orgSlug", opts.organization);
|
|
24
25
|
meChat.setAttribute("buildingSlug", opts.building);
|
|
26
|
+
meChat.setAttribute("class", "meetelise-chat");
|
|
25
27
|
if (opts.themeId) {
|
|
26
28
|
meChat.setAttribute("themeId", opts.themeId);
|
|
27
29
|
}
|
|
@@ -31,6 +33,9 @@ export default class MEChat {
|
|
|
31
33
|
if (opts.mini !== undefined) {
|
|
32
34
|
meChat.useMiniWidget = opts.mini;
|
|
33
35
|
}
|
|
36
|
+
if (opts.launcherStyles) {
|
|
37
|
+
meChat.launcherStyles = opts.launcherStyles;
|
|
38
|
+
}
|
|
34
39
|
document.body.appendChild(meChat);
|
|
35
40
|
MEChat.meChat = meChat;
|
|
36
41
|
}
|
|
@@ -49,6 +54,7 @@ export interface Options {
|
|
|
49
54
|
themeId?: ThemeIdString;
|
|
50
55
|
avatarSrc?: string;
|
|
51
56
|
mini?: boolean;
|
|
57
|
+
launcherStyles?: StyleInfo;
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
/** You can't install a font from CSS in a shadow DOM, so we use JS to do it here in the regular DOM. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// TODO: remove this when sst fixed
|
|
2
|
+
/* eslint-disable lit/binding-positions */
|
|
1
3
|
import classnames from "classnames";
|
|
2
4
|
import { html, LitElement, TemplateResult } from "lit";
|
|
3
5
|
import { customElement, property, state } from "lit/decorators.js";
|
|
@@ -6,7 +8,7 @@ import { glowBarMp4, glowBarWebm } from "../assetUrls";
|
|
|
6
8
|
import { launcherStyles } from "./launcherStyles";
|
|
7
9
|
import { EmailUsWindow, installEmailUsWindow } from "./actions/email-us-window";
|
|
8
10
|
import { installTextUsWindow, TextUsWindow } from "./actions/text-us-window";
|
|
9
|
-
import { styleMap } from "lit/directives/style-map.js";
|
|
11
|
+
import { StyleInfo, styleMap } from "lit/directives/style-map.js";
|
|
10
12
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
13
|
import { installCallUsWindow } from "./actions/call-us-window";
|
|
12
14
|
import { getRegisteredPhoneNumbers } from "../getRegisteredPhoneNumbers";
|
|
@@ -39,7 +41,9 @@ export class Launcher extends LitElement {
|
|
|
39
41
|
@property({ type: Boolean })
|
|
40
42
|
hasEmailEnabled = true;
|
|
41
43
|
@property({ type: Boolean })
|
|
42
|
-
|
|
44
|
+
// TODO: re-enable
|
|
45
|
+
// hasSSTEnabled = true;
|
|
46
|
+
hasSSTEnabled = false;
|
|
43
47
|
@property({ type: Boolean })
|
|
44
48
|
hasTextUsEnabled = false;
|
|
45
49
|
@property({ attribute: false })
|
|
@@ -50,6 +54,8 @@ export class Launcher extends LitElement {
|
|
|
50
54
|
onChatTapped: () => void = () => {
|
|
51
55
|
return;
|
|
52
56
|
};
|
|
57
|
+
@property()
|
|
58
|
+
launcherStyles: StyleInfo = {};
|
|
53
59
|
|
|
54
60
|
@state()
|
|
55
61
|
isEmailWindowOpen = false;
|
|
@@ -64,7 +70,8 @@ export class Launcher extends LitElement {
|
|
|
64
70
|
return [
|
|
65
71
|
this.hasEmailEnabled,
|
|
66
72
|
!!this.phoneNumber,
|
|
67
|
-
|
|
73
|
+
// TODO: re-enable
|
|
74
|
+
// this.hasSSTEnabled,
|
|
68
75
|
this.hasTextUsEnabled,
|
|
69
76
|
].filter((v) => v).length;
|
|
70
77
|
};
|
|
@@ -200,7 +207,8 @@ export class Launcher extends LitElement {
|
|
|
200
207
|
${this.hasEmailEnabled ? this.renderEmailOption() : ""}
|
|
201
208
|
${this.phoneNumber ? this.renderCallUsOption() : ""}
|
|
202
209
|
${this.hasTextUsEnabled ? this.renderTextUsOption() : ""}
|
|
203
|
-
|
|
210
|
+
<!-- TODO: re-enable -->
|
|
211
|
+
<!-- ${this.hasSSTEnabled ? this.renderSSTOption() : ""} -->
|
|
204
212
|
</div>
|
|
205
213
|
`;
|
|
206
214
|
};
|
|
@@ -238,7 +246,10 @@ export class Launcher extends LitElement {
|
|
|
238
246
|
|
|
239
247
|
renderMiniLauncher = (): TemplateResult => {
|
|
240
248
|
return html`
|
|
241
|
-
<div
|
|
249
|
+
<div
|
|
250
|
+
class="launcher__mini-launcher-wrapper"
|
|
251
|
+
style=${styleMap(this.launcherStyles)}
|
|
252
|
+
>
|
|
242
253
|
${this.isEmailWindowOpen
|
|
243
254
|
? html`<div class="launcher__window-wrapper">
|
|
244
255
|
<email-us-window
|
|
@@ -315,7 +326,8 @@ export class Launcher extends LitElement {
|
|
|
315
326
|
true
|
|
316
327
|
)
|
|
317
328
|
: ""}
|
|
318
|
-
|
|
329
|
+
<!-- TODO: re-enable -->
|
|
330
|
+
<!-- ${this.hasSSTEnabled && !this.isCallToActionWindowOpen()
|
|
319
331
|
? this.renderMiniOption(
|
|
320
332
|
html`
|
|
321
333
|
<svg
|
|
@@ -334,7 +346,7 @@ export class Launcher extends LitElement {
|
|
|
334
346
|
this.onClickSSTOption,
|
|
335
347
|
true
|
|
336
348
|
)
|
|
337
|
-
: ""}
|
|
349
|
+
: ""} -->
|
|
338
350
|
${this.phoneNumber && !this.isCallToActionWindowOpen()
|
|
339
351
|
? this.renderMiniOption(
|
|
340
352
|
html`
|
|
@@ -273,7 +273,9 @@ export class TourScheduler extends LitElement {
|
|
|
273
273
|
tour_time: tourTimeString,
|
|
274
274
|
};
|
|
275
275
|
const url = `https://app.meetelise.com/platformApi/state/create/scheduleMe`;
|
|
276
|
-
const response = await axios.post(url, data
|
|
276
|
+
const response = await axios.post(url, data, {
|
|
277
|
+
headers: { ["X-SecurityKey"]: "JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG" },
|
|
278
|
+
});
|
|
277
279
|
if (response.status === 200) {
|
|
278
280
|
this.tourIsBooked = true;
|
|
279
281
|
}
|
|
@@ -15,6 +15,7 @@ import { installLauncher } from "./Launcher";
|
|
|
15
15
|
|
|
16
16
|
import "./MEChat.css";
|
|
17
17
|
import { getRawAvailabilities } from "../getAvailabilities";
|
|
18
|
+
import { StyleInfo } from "lit/directives/style-map";
|
|
18
19
|
|
|
19
20
|
export interface Options {
|
|
20
21
|
building: string;
|
|
@@ -62,6 +63,8 @@ export class MEChat extends LitElement {
|
|
|
62
63
|
private avatarSrc?: string | null;
|
|
63
64
|
@property({ type: Boolean })
|
|
64
65
|
useMiniWidget = true;
|
|
66
|
+
@property()
|
|
67
|
+
launcherStyles: StyleInfo = {};
|
|
65
68
|
|
|
66
69
|
@state()
|
|
67
70
|
private popup: Talk.Popup | null = null;
|
|
@@ -277,6 +280,7 @@ export class MEChat extends LitElement {
|
|
|
277
280
|
.buildingId=${this.building?.id ?? 0}
|
|
278
281
|
.layoutOptions=${this.building?.layoutOptions ?? []}
|
|
279
282
|
.tourTypeOptions=${this.building?.tourTypeOptions ?? []}
|
|
283
|
+
.launcherStyles=${this.launcherStyles}
|
|
280
284
|
phoneNumber="${this.building?.phoneNumber ?? ""}"
|
|
281
285
|
textColor="${this.theme.chatHeader.textColor}"
|
|
282
286
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|