@meetelise/chat 1.73.0 → 1.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +6 -0
- package/dist/src/WebComponent/SchedulerV2/community-picker.d.ts +6 -0
- package/dist/src/WebComponent/SchedulerV2/contact-form.d.ts +8 -3
- package/dist/src/WebComponent/SchedulerV2/scheduler-popover.d.ts +9 -1
- package/dist/src/WebComponent/SchedulerV2/tour-scheduler-v2.d.ts +2 -5
- package/package.json +1 -1
- package/public/dist/index.js +222 -201
- package/src/WebComponent/Scheduler/tour-scheduler.ts +60 -9
- package/src/WebComponent/SchedulerV2/community-picker.ts +19 -2
- package/src/WebComponent/SchedulerV2/contact-form.ts +54 -22
- package/src/WebComponent/SchedulerV2/scheduler-popover.ts +17 -1
- package/src/WebComponent/SchedulerV2/tour-scheduler-v2.ts +29 -15
- package/src/existingTourReschedulePrompt.test.ts +97 -0
- package/src/tourSchedulerV2Booking.test.ts +103 -7
package/public/dist/index.js
CHANGED
|
@@ -1792,7 +1792,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
1792
1792
|
d="M0.833252 30.1666C0.833252 27.1608 2.0273 24.2782 4.15271 22.1527C6.27812 20.0273 9.1608 18.8333 12.1666 18.8333C15.1724 18.8333 18.0551 20.0273 20.1805 22.1527C22.3059 24.2782 23.4999 27.1608 23.4999 30.1666H0.833252ZM12.1666 17.4166C7.47034 17.4166 3.66659 13.6129 3.66659 8.91663C3.66659 4.22038 7.47034 0.416626 12.1666 0.416626C16.8628 0.416626 20.6666 4.22038 20.6666 8.91663C20.6666 13.6129 16.8628 17.4166 12.1666 17.4166ZM22.5975 20.58C24.7645 21.137 26.7006 22.3634 28.13 24.0846C29.5595 25.8059 30.4096 27.9342 30.5592 30.1666H26.3333C26.3333 26.4691 24.9166 23.1031 22.5975 20.58ZM19.7316 17.3557C20.9187 16.2939 21.8681 14.9932 22.5175 13.5388C23.167 12.0845 23.5017 10.5094 23.4999 8.91663C23.5029 6.9807 23.0078 5.07657 22.062 3.38738C23.6666 3.70979 25.11 4.5779 26.1469 5.84415C27.1838 7.1104 27.7502 8.69666 27.7499 10.3333C27.7503 11.3426 27.5349 12.3404 27.1182 13.2597C26.7016 14.179 26.0932 14.9986 25.3339 15.6636C24.5746 16.3285 23.6819 16.8236 22.7157 17.1154C21.7495 17.4072 20.7321 17.4892 19.7316 17.3557V17.3557Z"
|
|
1793
1793
|
fill="${e}"
|
|
1794
1794
|
/>
|
|
1795
|
-
</svg>`;var ma,ba,ya;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(ma||(ma={})),function(e){e.UNKNOWN="UNKNOWN",e.SELF_GUIDED="SELF_GUIDED",e.VIRTUAL_SHOWING="VIRTUAL_SHOWING",e.WITH_AGENT="WITH_AGENT",e.MEDIA_TOUR="MEDIA_TOUR",e.OPEN_HOUSE_STUDIO="OPEN_HOUSE_STUDIO",e.OPEN_HOUSE_1BR="OPEN_HOUSE_1BR",e.OPEN_HOUSE_2BR="OPEN_HOUSE_2BR",e.OPEN_HOUSE_3BR="OPEN_HOUSE_3BR",e.OPEN_HOUSE_4BR="OPEN_HOUSE_4BR",e.OPEN_HOUSE_5BR="OPEN_HOUSE_5BR"}(ba||(ba={})),function(e){e.LINK="link",e.CLIENT_SCHEDULED="client_scheduled",e.SCHEDULED_BY_ME_MANAGED_BY_ME="scheduled_by_ME_managed_by_ME",e.SCHEDULED_BY_ME_MANAGED_BY_CLIENT="scheduled_by_ME_managed_by_client",e.SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE="scheduled_by_ME_managed_by_concierge"}(ya||(ya={}));const va=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function wa(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,i=await r().get(n);return Ca(i.data)}const Ca=e=>{var t;try{e.welcomeMessage=xa(null!==(t=e.welcomeMessage)&&void 0!==t?t:"",e.userFirstName)}catch(e){}return e},xa=(e,t)=>e.replace(/elise/gi,t);var $a=n(7035),Sa=n(6353);function ka(e,t,n){var i=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return i.formatToParts?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value}(i,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(i,t)}function Aa(e,t){var n=function(e){if(!Ea[e]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"06/25/2014 00:00:00"===t;Ea[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return Ea[e]}(t);return n.formatToParts?function(e,t){try{for(var n=e.formatToParts(t),i=[],r=0;r<n.length;r++){var o=Ta[n[r].type];o>=0&&(i[o]=parseInt(n[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[i[3],i[1],i[2],i[4],i[5],i[6]]}(n,e)}var Ta={year:0,month:1,day:2,hour:3,minute:4,second:5};var Ea={};function _a(e,t,n,i,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,r,o,a),s}var Oa=36e5,Pa={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ia(e,t,n){var i,r,o;if(!e)return 0;if(i=Pa.timezoneZ.exec(e))return 0;if(i=Pa.timezoneHH.exec(e))return Ma(o=parseInt(i[1],10))?-o*Oa:NaN;if(i=Pa.timezoneHHMM.exec(e)){o=parseInt(i[2],10);var a=parseInt(i[3],10);return Ma(o,a)?(r=Math.abs(o)*Oa+6e4*a,"+"===i[1]?-r:r):NaN}if(function(e){if(Da[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Da[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return _a(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=Na(s,e),u=n?l:function(e,t,n){var i=e.getTime(),r=i-t,o=Na(new Date(r),n);if(t===o)return t;r-=o-t;var a=Na(new Date(r),n);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function Na(e,t){var n=Aa(e,t),i=_a(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),r=e.getTime(),o=r%1e3;return i-(r-=o>=0?o:1e3+o)}function Ma(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var Da={};var La={X:function(e,t,n,i){var r=Ra(i.timeZone,e);if(0===r)return"Z";switch(t){case"X":return ja(r);case"XXXX":case"XX":return Ua(r);default:return Ua(r,":")}},x:function(e,t,n,i){var r=Ra(i.timeZone,e);switch(t){case"x":return ja(r);case"xxxx":case"xx":return Ua(r);default:return Ua(r,":")}},O:function(e,t,n,i){var r=Ra(i.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=t||"";return n+String(r)+a+Ba(o,2)}(r,":");default:return"GMT"+Ua(r,":")}},z:function(e,t,n,i){switch(t){case"z":case"zz":case"zzz":return ka("short",e,i);default:return ka("long",e,i)}}};function Ra(e,t){var n=e?Ia(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Ba(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function Ua(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e);return i+Ba(Math.floor(r/60),2)+n+Ba(Math.floor(r%60),2)}function ja(e,t){return e%60==0?(e>0?"-":"+")+Ba(Math.abs(e)/60,2):Ua(e,t)}const Fa=La;var Ha=n(9784),za=n(9720);var Ga=36e5,Va=6e4,Wa={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function Qa(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=t||{},i=null==n.additionalDigits?2:Ha(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r=function(e){var t,n={},i=Wa.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=Wa.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var r=Wa.timeZone.exec(t);r?(n.time=t.replace(r[1],""),n.timeZone=r[1].trim()):n.time=t}return n}(e),o=function(e,t){var n,i=Wa.YYY[t],r=Wa.YYYYY[t];if(n=Wa.YYYY.exec(e)||r.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=Wa.YY.exec(e)||i.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,i),a=o.year,s=function(e,t){if(null===t)return null;var n,i,r,o;if(0===e.length)return(i=new Date(0)).setUTCFullYear(t),i;if(n=Wa.MM.exec(e))return i=new Date(0),Za(t,r=parseInt(n[1],10)-1)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(n=Wa.DDD.exec(e)){i=new Date(0);var a=parseInt(n[1],10);return function(e,t){if(t<1)return!1;var n=Xa(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,a)?(i.setUTCFullYear(t,0,a),i):new Date(NaN)}if(n=Wa.MMDD.exec(e)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return Za(t,r,s)?(i.setUTCFullYear(t,r,s),i):new Date(NaN)}if(n=Wa.Www.exec(e))return Ja(t,o=parseInt(n[1],10)-1)?qa(t,o):new Date(NaN);if(n=Wa.WwwD.exec(e)){o=parseInt(n[1],10)-1;var l=parseInt(n[2],10)-1;return Ja(t,o,l)?qa(t,o,l):new Date(NaN)}return null}(o.restDateString,a);if(isNaN(s))return new Date(NaN);if(s){var l,u=s.getTime(),d=0;if(r.time&&(d=function(e){var t,n,i;if(t=Wa.HH.exec(e))return es(n=parseFloat(t[1].replace(",",".")))?n%24*Ga:NaN;if(t=Wa.HHMM.exec(e))return es(n=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")))?n%24*Ga+i*Va:NaN;if(t=Wa.HHMMSS.exec(e)){n=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return es(n,i,r)?n%24*Ga+i*Va+1e3*r:NaN}return null}(r.time),isNaN(d)))return new Date(NaN);if(r.timeZone||n.timeZone){if(l=Ia(r.timeZone||n.timeZone,new Date(u+d)),isNaN(l))return new Date(NaN)}else l=za(new Date(u+d)),l=za(new Date(u+d+l));return new Date(u+d+l)}return new Date(NaN)}function qa(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}var Ya=[31,28,31,30,31,30,31,31,30,31,30,31],Ka=[31,29,31,30,31,30,31,31,30,31,30,31];function Xa(e){return e%400==0||e%4==0&&e%100!=0}function Za(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=Xa(e);if(i&&n>Ka[t])return!1;if(!i&&n>Ya[t])return!1}return!0}function Ja(e,t,n){return!(t<0||t>52)&&(null==n||!(n<0||n>6))}function es(e,t,n){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var ts=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ns(e,t,n,i){var r=$a(i);return r.timeZone=t,r.originalDate=e,function(e,t,n){var i=String(t),r=n||{},o=i.match(ts);if(o){var a=Qa(r.originalDate||e,r);i=o.reduce(function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),i="'"===e[n-1],o=e.replace(t,"'"+Fa[t[0]](a,t,null,r)+"'");return i?o.substring(0,n-1)+o.substring(n+1):o},i)}return Sa(e,i,r)}(function(e,t,n){var i=Qa(e,n),r=Ia(t,i,!0),o=new Date(i.getTime()-r),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}(e,t),n,r)}const is="com.eliseai.webchat.googlereserve.referral",rs=()=>{var e;try{const t=JSON.parse(null!==(e=localStorage.getItem(is))&&void 0!==e?e:"null");return(null==t?void 0:t.rwgToken)&&Date.now()<t.expiresAt?t:null}catch{return null}},os=async({buildingSlug:e})=>{try{const t=await r().get(`${Eo}/platformApi/webchat/${e}/units/summary`);if(t.data)return Er(t.data)}catch(t){Ao({logType:ko.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS_SUMMARY]",logData:{error:t},error:t})}return[]};var as,ss=n(8805),ls=n.n(ss),us=new Uint8Array(16);function ds(){if(!as&&!(as="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 as(us)}const cs=/^(?:[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;const hs=function(e){return"string"==typeof e&&cs.test(e)};for(var ps=[],fs=0;fs<256;++fs)ps.push((fs+256).toString(16).substr(1));const gs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(ps[e[t+0]]+ps[e[t+1]]+ps[e[t+2]]+ps[e[t+3]]+"-"+ps[e[t+4]]+ps[e[t+5]]+"-"+ps[e[t+6]]+ps[e[t+7]]+"-"+ps[e[t+8]]+ps[e[t+9]]+"-"+ps[e[t+10]]+ps[e[t+11]]+ps[e[t+12]]+ps[e[t+13]]+ps[e[t+14]]+ps[e[t+15]]).toLowerCase();if(!hs(n))throw TypeError("Stringified UUID is invalid");return n};const ms=function(e,t,n){var i=(e=e||{}).random||(e.rng||ds)();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 gs(i)},bs=e=>localStorage.removeItem("com.elise.webchat.slug="+e),ys=(e,t,n)=>{const i=Fr(new Date),r=n||`lead_${ms()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Yr(i),buildingSlug:e,initiatedChat:t}},vs=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if(ws(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},ws=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if(Tr(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!Mr(t.timestamp,24)},Cs=e=>e.startsWith("https://app.meetelise.com/settings/widgets")||e.startsWith("https://app.meetelise.com/settings/marketing/webchat")||e.includes("demo/utilities"),xs="com.elise.webchat.reopenAfterNavigation",$s=e=>{try{const t=new URL(e);return`${t.origin}${t.pathname}`}catch{return""}},Ss=e=>{const t={pageUrl:$s(window.location.href),pageTitle:document.title};return"number"==typeof e&&Number.isInteger(e)&&e>0&&(t.declaredBuildingId=e),t},ks=(e,t=e=>window.location.assign(e))=>{(()=>{try{sessionStorage.setItem(xs,"true")}catch{}})(),t(e.url)};var As;!function(e){e.noReply="no-reply",e.text="text",e.media="media",e.navigation="navigation"}(As||(As={}));const Ts=e=>e.type===Os.text,Es=e=>e.type===Os.media,_s=e=>e.type===Os.navigation;var Os;!function(e){e.text="text",e.media="media",e.navigation="navigation"}(Os||(Os={}));const Ps=class{constructor(e,t,n,i=null,r,o,a=null,s=Sp.Default){this.apiHost="https://app.meetelise.com",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingWebchatView=null,this.eliseResponseTimeout=null,this.isWaitingForStreamingMessages=!1,this.firedScheduledTourConfirmationIds=new Set,this.widgetType=Sp.Default,this.centralConvo=!1,this.declaredBuildingId=null,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.sessionToken=null,this.isCurrentlyStreamingMessage=!1,this.chatListener=null,this.rawPubnubMessages=[],this.simpleChatMessages=[],this.listenerParams={message:e=>{var t,n;const i={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,i],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==As.noReply),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),this.checkAndHandleDelayStreamingMessages();const r="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;if(null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:r}),!r&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=r,"ai_message"===e.message.customType){const t=e.message.stream_id,i=null!=t?t:String(+e.timetoken);(t?this.reconstructStreamText(t):null!==(n=e.message.text)&&void 0!==n?n:"").includes("confirmed for your")&&this.fireScheduledTourEventOnce(i,e.message)}this.checkAndHandleGTMForLeadEmail(e)}},this.isLoadingMessages=!1,this.isFirstChatMessageSent=!1,this.streamingMessageTimeout=null,this.checkAndHandleDelayStreamingMessages=({delayToFetchHistoryInMs:e=1e4}={})=>{this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null);const t=new Map;this.rawPubnubMessages.forEach(e=>{var n;const i=e.message.stream_id;i&&t.set(i,[...null!==(n=t.get(i))&&void 0!==n?n:[],e])});const n=[...t.entries()].filter(([,e])=>!this.isStreamComplete(e)).map(([e])=>e);n.length>0&&(this.streamingMessageTimeout=setTimeout(()=>{Ao({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory().then(()=>n.forEach(e=>this.checkAndFireTourConfirmationForStream(e)))},e))},this.isStreamComplete=e=>{var t;const n=e.find(e=>e.message.is_done);if(!n)return!1;const i=new Set(e.map(e=>{var t;return null!==(t=e.message.order)&&void 0!==t?t:0}));for(let e=0;e<=(null!==(t=n.message.order)&&void 0!==t?t:0);e++)if(!i.has(e))return!1;return!0},this.getStreamChunks=e=>this.removeDuplicatedRawPubnubMessages(this.rawPubnubMessages).filter(t=>t.message.stream_id===e).sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),this.reconstructStreamText=e=>this.getStreamChunks(e).map(e=>e.message.text).join(""),this.fireScheduledTourEventOnce=(e,t)=>{var n;this.firedScheduledTourConfirmationIds.has(e)||(this.firedScheduledTourConfirmationIds.add(e),Lo("scheduledTourEvent",{tourDetails:t,buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))},this.checkAndFireTourConfirmationForStream=e=>{var t;if(this.reconstructStreamText(e).includes("confirmed for your")){const n=this.getStreamChunks(e);this.fireScheduledTourEventOnce(e,null===(t=n[n.length-1])||void 0===t?void 0:t.message)}},this.checkAndHandleGTMForLeadEmail=e=>{var t;try{if("lead_message"!==e.message.customType)return;if(!(e=>{try{return/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/.test(e)}catch(e){return!1}})(e.message.text))return;Lo("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,n;for(let i=e.length-1;i>=0;i--){const r=null===(t=e[i])||void 0===t?void 0:t.message,o=i>0&&(null===(n=e[i-1])||void 0===n?void 0:n.message);(null==r?void 0:r.messageType)===As.noReply&&o&&(o.is_done=!0)}},this.checkMessageChunkValid=e=>{try{return!!e.message&&!!e.message.text&&e.message.text.length>0&&!!e.message.customType}catch(e){return!1}},this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null),this.removeChatListeners()},this.removeChatListeners=()=>{this.pubnub&&this.channel&&(this.pubnub.unsubscribe({channels:[this.channel]}),this.pubnub.removeListener(this.listenerParams))},this.sendMessage=async e=>{if(e){if(!this.pubnub){const e=ys(this.chatStorageSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,u,d;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})},9e4),0===this.simpleChatMessages.length&&(null===(t=this.leadSourceClient)||void 0===t||t.checkAndHandleForLogLeadSource({webchatAction:"chat",stateId:null})),this.widgetType===Sp.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:Cs(location.href),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,userId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.userId,leadSource:this.leadSource,trackingParams:l(this.orgSlug),widgetType:this.widgetType,isDevState:Cs(location.href),...Ss(this.declaredBuildingId),lead_sources_with_timestamps:(null!==(o=null===(r=this.leadSourceMultitouchClient)||void 0===r?void 0:r.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null}))&&void 0!==o?o:[]).map(e=>_r({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||(Lo("firstChatMessageSent",{message:e,buildingId:null===(u=this.buildingWebchatView)||void 0===u?void 0:u.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}),this.isFirstChatMessageSent=!0),Lo("chatMessageSent",{message:e,buildingId:null===(d=this.buildingWebchatView)||void 0===d?void 0:d.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))}),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.removeDuplicatedRawPubnubMessages=e=>{const t=new Set;return e.filter(e=>{if("lead_message"===e.message.customType||!e.message.stream_id||!e.message.order)return!0;const n=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(n)?(Ao({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(n),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],n={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var i;if(e.message.messageType===As.navigation){const n=(e=>{if(!e||"object"!=typeof e)return null;const{url:t,label:n}=e;if("string"!=typeof t||"string"!=typeof n)return null;if(!n.trim())return null;try{const e=new URL(t,window.location.href);return"http:"!==e.protocol&&"https:"!==e.protocol?null:{url:e.href,label:n.trim()}}catch{return null}})(e.message.navigation);n&&t.push({timestamp:e.timetoken,navigation:n,isLeadMessage:!1,type:Os.navigation})}else if("media"===e.message.messageType)t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:Os.media});else{if("string"!=typeof e.message.text)return;!e.message.stream_id||e.message.is_done&&0===e.message.order?t.push({timestamp:e.timetoken,message:e.message.text,isLeadMessage:this.isLeadMessage(e),chunks:[{text:e.message.text,order:0,isDone:!0}],type:Os.text}):n[e.message.stream_id]?n[e.message.stream_id].push(e):n[e.message.stream_id]=[e]}}),Object.keys(n).forEach(e=>{const i=n[e],r=this.getConsecutiveChunks(i.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)})),o=r.map(e=>e.message.text).join(""),a=r[0],s={timestamp:a.timetoken,message:o,isLeadMessage:this.isLeadMessage(a),chunks:r.map(e=>{var t,n;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(n=e.message.is_done)&&void 0!==n&&n}}),type:Os.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,n;const i=e.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),r=[];let o=null!==(t=i[0].message.order)&&void 0!==t?t:0;for(const e of i){if((null!==(n=e.message.order)&&void 0!==n?n:-1)!==o)break;r.push(e),o++}return r},this.isMessageStillStreamingChunks=e=>{const t=e.find(e=>e.message.is_done);return!t||e.length===t.message.order},this.buildingSlug=e,this.chatStorageSlug=e,this.buildingWebchatView=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}getSessionToken(){return this.sessionToken}async initSession(e,t,n){try{const i={building_slug:e,org_slug:t};this.centralConvo&&(i.central_convo=!0),n&&(i.lead_id=n);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,i);return this.sessionToken=o.data.session_token,this.leadUserId=o.data.lead_id,this.channel=o.data.channel,o.data}catch(e){return this.buildingWebchatView&&Ao({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e}),null}}adoptBuilding(e,t){this.buildingSlug=e,this.buildingWebchatView=t}addChatListener(e){this.chatListener=e}async initializePubnub(e){if(!e.leadId)return;this.leadUserId=e.leadId;const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(ls())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token,origin:"meetelise.pubnubapi.com"}),this.withAuthToken(()=>new Promise(()=>this.handleChatListeners())),await this.withAuthToken(()=>this.getChannelHistory()),this.pubnub):void 0}async fetchToken(e,t){try{if(this.sessionToken){const e="healthcare"===this.widgetType?"?industry=health_care":"";return(await r().get(`${this.apiHost}/platformApi/webchat/pn/v2/request-token${e}`,{headers:{"X-Session-Token":this.sessionToken}})).data}if(this.centralConvo)return null;return(await r().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${t}&${"healthcare"===this.widgetType?"industry=health_care":""}`)).data}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return null}async fetchChannelExists(e){try{return(await r().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof i.AxiosError&&t&&t.response&&403===t.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const t=await this.fetchToken(this.leadUserId,this.channel);if(!t)return;this.pubnub.setAuthKey(t.auth.result.token),await e()}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}}async getChannelHistory(e=1500){var t;try{let n=[],i=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((n,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=i?i:void 0},(e,t)=>{e.error?o(e):n(t)})}),a=o.channels[this.channel];if(!a)break;if(a.sort((e,t)=>+e.timetoken-+t.timetoken),!a||0===a.length)break;if(this.channel&&0!==Object.keys(o.channels).length){const e=o.channels[this.channel],t=[];e.forEach(e=>{e.uuid&&t.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})}),this.markEveryPreviousNoReplyMessageDone(t),n=n.concat(t.filter(e=>e.message.messageType!==As.noReply))}if(i=a[0].timetoken,n.length>=e||a.length<r)break}this.rawPubnubMessages=n.slice(0,e),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:!1})}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}},Is=p`
|
|
1795
|
+
</svg>`;var ma,ba,ya;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(ma||(ma={})),function(e){e.UNKNOWN="UNKNOWN",e.SELF_GUIDED="SELF_GUIDED",e.VIRTUAL_SHOWING="VIRTUAL_SHOWING",e.WITH_AGENT="WITH_AGENT",e.MEDIA_TOUR="MEDIA_TOUR",e.OPEN_HOUSE_STUDIO="OPEN_HOUSE_STUDIO",e.OPEN_HOUSE_1BR="OPEN_HOUSE_1BR",e.OPEN_HOUSE_2BR="OPEN_HOUSE_2BR",e.OPEN_HOUSE_3BR="OPEN_HOUSE_3BR",e.OPEN_HOUSE_4BR="OPEN_HOUSE_4BR",e.OPEN_HOUSE_5BR="OPEN_HOUSE_5BR"}(ba||(ba={})),function(e){e.LINK="link",e.CLIENT_SCHEDULED="client_scheduled",e.SCHEDULED_BY_ME_MANAGED_BY_ME="scheduled_by_ME_managed_by_ME",e.SCHEDULED_BY_ME_MANAGED_BY_CLIENT="scheduled_by_ME_managed_by_client",e.SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE="scheduled_by_ME_managed_by_concierge"}(ya||(ya={}));const va=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function wa(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,i=await r().get(n);return Ca(i.data)}const Ca=e=>{var t;try{e.welcomeMessage=xa(null!==(t=e.welcomeMessage)&&void 0!==t?t:"",e.userFirstName)}catch(e){}return e},xa=(e,t)=>e.replace(/elise/gi,t);var $a=n(7035),Sa=n(6353);function ka(e,t,n){var i=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return i.formatToParts?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value}(i,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(i,t)}function Aa(e,t){var n=function(e){if(!Ea[e]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"06/25/2014 00:00:00"===t;Ea[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return Ea[e]}(t);return n.formatToParts?function(e,t){try{for(var n=e.formatToParts(t),i=[],r=0;r<n.length;r++){var o=Ta[n[r].type];o>=0&&(i[o]=parseInt(n[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[i[3],i[1],i[2],i[4],i[5],i[6]]}(n,e)}var Ta={year:0,month:1,day:2,hour:3,minute:4,second:5};var Ea={};function _a(e,t,n,i,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,r,o,a),s}var Oa=36e5,Pa={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ia(e,t,n){var i,r,o;if(!e)return 0;if(i=Pa.timezoneZ.exec(e))return 0;if(i=Pa.timezoneHH.exec(e))return Ma(o=parseInt(i[1],10))?-o*Oa:NaN;if(i=Pa.timezoneHHMM.exec(e)){o=parseInt(i[2],10);var a=parseInt(i[3],10);return Ma(o,a)?(r=Math.abs(o)*Oa+6e4*a,"+"===i[1]?-r:r):NaN}if(function(e){if(Da[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Da[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return _a(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=Na(s,e),u=n?l:function(e,t,n){var i=e.getTime(),r=i-t,o=Na(new Date(r),n);if(t===o)return t;r-=o-t;var a=Na(new Date(r),n);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function Na(e,t){var n=Aa(e,t),i=_a(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),r=e.getTime(),o=r%1e3;return i-(r-=o>=0?o:1e3+o)}function Ma(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var Da={};var La={X:function(e,t,n,i){var r=Ra(i.timeZone,e);if(0===r)return"Z";switch(t){case"X":return ja(r);case"XXXX":case"XX":return Ua(r);default:return Ua(r,":")}},x:function(e,t,n,i){var r=Ra(i.timeZone,e);switch(t){case"x":return ja(r);case"xxxx":case"xx":return Ua(r);default:return Ua(r,":")}},O:function(e,t,n,i){var r=Ra(i.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=t||"";return n+String(r)+a+Ba(o,2)}(r,":");default:return"GMT"+Ua(r,":")}},z:function(e,t,n,i){switch(t){case"z":case"zz":case"zzz":return ka("short",e,i);default:return ka("long",e,i)}}};function Ra(e,t){var n=e?Ia(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Ba(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function Ua(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e);return i+Ba(Math.floor(r/60),2)+n+Ba(Math.floor(r%60),2)}function ja(e,t){return e%60==0?(e>0?"-":"+")+Ba(Math.abs(e)/60,2):Ua(e,t)}const Fa=La;var Ha=n(9784),za=n(9720);var Ga=36e5,Va=6e4,Wa={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function Qa(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=t||{},i=null==n.additionalDigits?2:Ha(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r=function(e){var t,n={},i=Wa.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=Wa.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var r=Wa.timeZone.exec(t);r?(n.time=t.replace(r[1],""),n.timeZone=r[1].trim()):n.time=t}return n}(e),o=function(e,t){var n,i=Wa.YYY[t],r=Wa.YYYYY[t];if(n=Wa.YYYY.exec(e)||r.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=Wa.YY.exec(e)||i.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,i),a=o.year,s=function(e,t){if(null===t)return null;var n,i,r,o;if(0===e.length)return(i=new Date(0)).setUTCFullYear(t),i;if(n=Wa.MM.exec(e))return i=new Date(0),Za(t,r=parseInt(n[1],10)-1)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(n=Wa.DDD.exec(e)){i=new Date(0);var a=parseInt(n[1],10);return function(e,t){if(t<1)return!1;var n=Xa(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,a)?(i.setUTCFullYear(t,0,a),i):new Date(NaN)}if(n=Wa.MMDD.exec(e)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return Za(t,r,s)?(i.setUTCFullYear(t,r,s),i):new Date(NaN)}if(n=Wa.Www.exec(e))return Ja(t,o=parseInt(n[1],10)-1)?qa(t,o):new Date(NaN);if(n=Wa.WwwD.exec(e)){o=parseInt(n[1],10)-1;var l=parseInt(n[2],10)-1;return Ja(t,o,l)?qa(t,o,l):new Date(NaN)}return null}(o.restDateString,a);if(isNaN(s))return new Date(NaN);if(s){var l,u=s.getTime(),d=0;if(r.time&&(d=function(e){var t,n,i;if(t=Wa.HH.exec(e))return es(n=parseFloat(t[1].replace(",",".")))?n%24*Ga:NaN;if(t=Wa.HHMM.exec(e))return es(n=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")))?n%24*Ga+i*Va:NaN;if(t=Wa.HHMMSS.exec(e)){n=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return es(n,i,r)?n%24*Ga+i*Va+1e3*r:NaN}return null}(r.time),isNaN(d)))return new Date(NaN);if(r.timeZone||n.timeZone){if(l=Ia(r.timeZone||n.timeZone,new Date(u+d)),isNaN(l))return new Date(NaN)}else l=za(new Date(u+d)),l=za(new Date(u+d+l));return new Date(u+d+l)}return new Date(NaN)}function qa(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}var Ya=[31,28,31,30,31,30,31,31,30,31,30,31],Ka=[31,29,31,30,31,30,31,31,30,31,30,31];function Xa(e){return e%400==0||e%4==0&&e%100!=0}function Za(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=Xa(e);if(i&&n>Ka[t])return!1;if(!i&&n>Ya[t])return!1}return!0}function Ja(e,t,n){return!(t<0||t>52)&&(null==n||!(n<0||n>6))}function es(e,t,n){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var ts=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ns(e,t,n,i){var r=$a(i);return r.timeZone=t,r.originalDate=e,function(e,t,n){var i=String(t),r=n||{},o=i.match(ts);if(o){var a=Qa(r.originalDate||e,r);i=o.reduce(function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),i="'"===e[n-1],o=e.replace(t,"'"+Fa[t[0]](a,t,null,r)+"'");return i?o.substring(0,n-1)+o.substring(n+1):o},i)}return Sa(e,i,r)}(function(e,t,n){var i=Qa(e,n),r=Ia(t,i,!0),o=new Date(i.getTime()-r),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}(e,t),n,r)}const is="com.eliseai.webchat.googlereserve.referral",rs=()=>{var e;try{const t=JSON.parse(null!==(e=localStorage.getItem(is))&&void 0!==e?e:"null");return(null==t?void 0:t.rwgToken)&&Date.now()<t.expiresAt?t:null}catch{return null}},os=async({buildingSlug:e})=>{try{const t=await r().get(`${Eo}/platformApi/webchat/${e}/units/summary`);if(t.data)return Er(t.data)}catch(t){Ao({logType:ko.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS_SUMMARY]",logData:{error:t},error:t})}return[]};var as,ss=n(8805),ls=n.n(ss),us=new Uint8Array(16);function ds(){if(!as&&!(as="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 as(us)}const cs=/^(?:[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;const hs=function(e){return"string"==typeof e&&cs.test(e)};for(var ps=[],fs=0;fs<256;++fs)ps.push((fs+256).toString(16).substr(1));const gs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(ps[e[t+0]]+ps[e[t+1]]+ps[e[t+2]]+ps[e[t+3]]+"-"+ps[e[t+4]]+ps[e[t+5]]+"-"+ps[e[t+6]]+ps[e[t+7]]+"-"+ps[e[t+8]]+ps[e[t+9]]+"-"+ps[e[t+10]]+ps[e[t+11]]+ps[e[t+12]]+ps[e[t+13]]+ps[e[t+14]]+ps[e[t+15]]).toLowerCase();if(!hs(n))throw TypeError("Stringified UUID is invalid");return n};const ms=function(e,t,n){var i=(e=e||{}).random||(e.rng||ds)();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 gs(i)},bs=e=>localStorage.removeItem("com.elise.webchat.slug="+e),ys=(e,t,n)=>{const i=Fr(new Date),r=n||`lead_${ms()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Yr(i),buildingSlug:e,initiatedChat:t}},vs=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if(ws(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},ws=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if(Tr(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!Mr(t.timestamp,24)},Cs=e=>e.startsWith("https://app.meetelise.com/settings/widgets")||e.startsWith("https://app.meetelise.com/settings/marketing/webchat")||e.includes("demo/utilities"),xs="com.elise.webchat.reopenAfterNavigation",$s=e=>{try{const t=new URL(e);return`${t.origin}${t.pathname}`}catch{return""}},Ss=e=>{const t={pageUrl:$s(window.location.href),pageTitle:document.title};return"number"==typeof e&&Number.isInteger(e)&&e>0&&(t.declaredBuildingId=e),t},ks=(e,t=e=>window.location.assign(e))=>{(()=>{try{sessionStorage.setItem(xs,"true")}catch{}})(),t(e.url)};var As;!function(e){e.noReply="no-reply",e.text="text",e.media="media",e.navigation="navigation"}(As||(As={}));const Ts=e=>e.type===Os.text,Es=e=>e.type===Os.media,_s=e=>e.type===Os.navigation;var Os;!function(e){e.text="text",e.media="media",e.navigation="navigation"}(Os||(Os={}));const Ps=class{constructor(e,t,n,i=null,r,o,a=null,s=Ap.Default){this.apiHost="https://app.meetelise.com",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingWebchatView=null,this.eliseResponseTimeout=null,this.isWaitingForStreamingMessages=!1,this.firedScheduledTourConfirmationIds=new Set,this.widgetType=Ap.Default,this.centralConvo=!1,this.declaredBuildingId=null,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.sessionToken=null,this.isCurrentlyStreamingMessage=!1,this.chatListener=null,this.rawPubnubMessages=[],this.simpleChatMessages=[],this.listenerParams={message:e=>{var t,n;const i={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,i],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==As.noReply),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),this.checkAndHandleDelayStreamingMessages();const r="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;if(null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:r}),!r&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=r,"ai_message"===e.message.customType){const t=e.message.stream_id,i=null!=t?t:String(+e.timetoken);(t?this.reconstructStreamText(t):null!==(n=e.message.text)&&void 0!==n?n:"").includes("confirmed for your")&&this.fireScheduledTourEventOnce(i,e.message)}this.checkAndHandleGTMForLeadEmail(e)}},this.isLoadingMessages=!1,this.isFirstChatMessageSent=!1,this.streamingMessageTimeout=null,this.checkAndHandleDelayStreamingMessages=({delayToFetchHistoryInMs:e=1e4}={})=>{this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null);const t=new Map;this.rawPubnubMessages.forEach(e=>{var n;const i=e.message.stream_id;i&&t.set(i,[...null!==(n=t.get(i))&&void 0!==n?n:[],e])});const n=[...t.entries()].filter(([,e])=>!this.isStreamComplete(e)).map(([e])=>e);n.length>0&&(this.streamingMessageTimeout=setTimeout(()=>{Ao({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory().then(()=>n.forEach(e=>this.checkAndFireTourConfirmationForStream(e)))},e))},this.isStreamComplete=e=>{var t;const n=e.find(e=>e.message.is_done);if(!n)return!1;const i=new Set(e.map(e=>{var t;return null!==(t=e.message.order)&&void 0!==t?t:0}));for(let e=0;e<=(null!==(t=n.message.order)&&void 0!==t?t:0);e++)if(!i.has(e))return!1;return!0},this.getStreamChunks=e=>this.removeDuplicatedRawPubnubMessages(this.rawPubnubMessages).filter(t=>t.message.stream_id===e).sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),this.reconstructStreamText=e=>this.getStreamChunks(e).map(e=>e.message.text).join(""),this.fireScheduledTourEventOnce=(e,t)=>{var n;this.firedScheduledTourConfirmationIds.has(e)||(this.firedScheduledTourConfirmationIds.add(e),Lo("scheduledTourEvent",{tourDetails:t,buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))},this.checkAndFireTourConfirmationForStream=e=>{var t;if(this.reconstructStreamText(e).includes("confirmed for your")){const n=this.getStreamChunks(e);this.fireScheduledTourEventOnce(e,null===(t=n[n.length-1])||void 0===t?void 0:t.message)}},this.checkAndHandleGTMForLeadEmail=e=>{var t;try{if("lead_message"!==e.message.customType)return;if(!(e=>{try{return/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/.test(e)}catch(e){return!1}})(e.message.text))return;Lo("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,n;for(let i=e.length-1;i>=0;i--){const r=null===(t=e[i])||void 0===t?void 0:t.message,o=i>0&&(null===(n=e[i-1])||void 0===n?void 0:n.message);(null==r?void 0:r.messageType)===As.noReply&&o&&(o.is_done=!0)}},this.checkMessageChunkValid=e=>{try{return!!e.message&&!!e.message.text&&e.message.text.length>0&&!!e.message.customType}catch(e){return!1}},this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null),this.removeChatListeners()},this.removeChatListeners=()=>{this.pubnub&&this.channel&&(this.pubnub.unsubscribe({channels:[this.channel]}),this.pubnub.removeListener(this.listenerParams))},this.sendMessage=async e=>{if(e){if(!this.pubnub){const e=ys(this.chatStorageSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,u,d;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})},9e4),0===this.simpleChatMessages.length&&(null===(t=this.leadSourceClient)||void 0===t||t.checkAndHandleForLogLeadSource({webchatAction:"chat",stateId:null})),this.widgetType===Ap.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:Cs(location.href),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,userId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.userId,leadSource:this.leadSource,trackingParams:l(this.orgSlug),widgetType:this.widgetType,isDevState:Cs(location.href),...Ss(this.declaredBuildingId),lead_sources_with_timestamps:(null!==(o=null===(r=this.leadSourceMultitouchClient)||void 0===r?void 0:r.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null}))&&void 0!==o?o:[]).map(e=>_r({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||(Lo("firstChatMessageSent",{message:e,buildingId:null===(u=this.buildingWebchatView)||void 0===u?void 0:u.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}),this.isFirstChatMessageSent=!0),Lo("chatMessageSent",{message:e,buildingId:null===(d=this.buildingWebchatView)||void 0===d?void 0:d.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))}),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.removeDuplicatedRawPubnubMessages=e=>{const t=new Set;return e.filter(e=>{if("lead_message"===e.message.customType||!e.message.stream_id||!e.message.order)return!0;const n=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(n)?(Ao({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(n),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],n={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var i;if(e.message.messageType===As.navigation){const n=(e=>{if(!e||"object"!=typeof e)return null;const{url:t,label:n}=e;if("string"!=typeof t||"string"!=typeof n)return null;if(!n.trim())return null;try{const e=new URL(t,window.location.href);return"http:"!==e.protocol&&"https:"!==e.protocol?null:{url:e.href,label:n.trim()}}catch{return null}})(e.message.navigation);n&&t.push({timestamp:e.timetoken,navigation:n,isLeadMessage:!1,type:Os.navigation})}else if("media"===e.message.messageType)t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:Os.media});else{if("string"!=typeof e.message.text)return;!e.message.stream_id||e.message.is_done&&0===e.message.order?t.push({timestamp:e.timetoken,message:e.message.text,isLeadMessage:this.isLeadMessage(e),chunks:[{text:e.message.text,order:0,isDone:!0}],type:Os.text}):n[e.message.stream_id]?n[e.message.stream_id].push(e):n[e.message.stream_id]=[e]}}),Object.keys(n).forEach(e=>{const i=n[e],r=this.getConsecutiveChunks(i.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)})),o=r.map(e=>e.message.text).join(""),a=r[0],s={timestamp:a.timetoken,message:o,isLeadMessage:this.isLeadMessage(a),chunks:r.map(e=>{var t,n;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(n=e.message.is_done)&&void 0!==n&&n}}),type:Os.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,n;const i=e.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),r=[];let o=null!==(t=i[0].message.order)&&void 0!==t?t:0;for(const e of i){if((null!==(n=e.message.order)&&void 0!==n?n:-1)!==o)break;r.push(e),o++}return r},this.isMessageStillStreamingChunks=e=>{const t=e.find(e=>e.message.is_done);return!t||e.length===t.message.order},this.buildingSlug=e,this.chatStorageSlug=e,this.buildingWebchatView=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}getSessionToken(){return this.sessionToken}async initSession(e,t,n){try{const i={building_slug:e,org_slug:t};this.centralConvo&&(i.central_convo=!0),n&&(i.lead_id=n);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,i);return this.sessionToken=o.data.session_token,this.leadUserId=o.data.lead_id,this.channel=o.data.channel,o.data}catch(e){return this.buildingWebchatView&&Ao({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e}),null}}adoptBuilding(e,t){this.buildingSlug=e,this.buildingWebchatView=t}addChatListener(e){this.chatListener=e}async initializePubnub(e){if(!e.leadId)return;this.leadUserId=e.leadId;const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(ls())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token,origin:"meetelise.pubnubapi.com"}),this.withAuthToken(()=>new Promise(()=>this.handleChatListeners())),await this.withAuthToken(()=>this.getChannelHistory()),this.pubnub):void 0}async fetchToken(e,t){try{if(this.sessionToken){const e="healthcare"===this.widgetType?"?industry=health_care":"";return(await r().get(`${this.apiHost}/platformApi/webchat/pn/v2/request-token${e}`,{headers:{"X-Session-Token":this.sessionToken}})).data}if(this.centralConvo)return null;return(await r().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${t}&${"healthcare"===this.widgetType?"industry=health_care":""}`)).data}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return null}async fetchChannelExists(e){try{return(await r().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof i.AxiosError&&t&&t.response&&403===t.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const t=await this.fetchToken(this.leadUserId,this.channel);if(!t)return;this.pubnub.setAuthKey(t.auth.result.token),await e()}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}}async getChannelHistory(e=1500){var t;try{let n=[],i=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((n,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=i?i:void 0},(e,t)=>{e.error?o(e):n(t)})}),a=o.channels[this.channel];if(!a)break;if(a.sort((e,t)=>+e.timetoken-+t.timetoken),!a||0===a.length)break;if(this.channel&&0!==Object.keys(o.channels).length){const e=o.channels[this.channel],t=[];e.forEach(e=>{e.uuid&&t.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})}),this.markEveryPreviousNoReplyMessageDone(t),n=n.concat(t.filter(e=>e.message.messageType!==As.noReply))}if(i=a[0].timetoken,n.length>=e||a.length<r)break}this.rawPubnubMessages=n.slice(0,e),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:!1})}catch(e){this.buildingWebchatView&&Ao({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}},Is=p`
|
|
1796
1796
|
#healthchat-container {
|
|
1797
1797
|
position: fixed;
|
|
1798
1798
|
|
|
@@ -2298,7 +2298,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2298
2298
|
transform: rotate(360deg);
|
|
2299
2299
|
}
|
|
2300
2300
|
}
|
|
2301
|
-
`,jl([pe({type:Number})],Fl.prototype,"spinSpeed",void 0),Fl=jl([ce("mini-loader")],Fl);var Hl=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 zl=class extends ue{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isLeadMessage=!1,this.widgetType=
|
|
2301
|
+
`,jl([pe({type:Number})],Fl.prototype,"spinSpeed",void 0),Fl=jl([ce("mini-loader")],Fl);var Hl=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 zl=class extends ue{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isLeadMessage=!1,this.widgetType=Ap.Default}isMessageStillStreamingChunks(){if(!this.message)return!1;const e=this.message.chunks.find(e=>e.isDone);return!e||this.message.chunks.length===e.order}updated(e){if(this.onMount(),!e.has("message"))return;if(!this.message)return;const{hyperlinks:t,markedText:n}=this.mapAndMarkHyperLinks(this.message.message),i=/(https?:\/\/[^\s]+)/g,r=[],o=[];this.parsedMessage=H`${n.trim().split("\n").map(e=>{const n=this.sanitizeMarkdownText(e),a=this.preserveHTMLTags(n);return a?H`${a.map(e=>{const n=t.filter(t=>e.includes(t.id));if(n.length){let t=e;return n.forEach(e=>{o.push({redirectTo:e.link,source:e.link}),t=t.replace(e.id,this.hyperlinkHTML(e.link,e.hyperlink))}),H`${Bo(Ul.sanitize(t,{ADD_ATTR:["target"]}))} `}if(i.test(e)){const t=this.removeTrailingPunctuation(e);return r.push(this.getLinkData(t)),H`<a
|
|
2302
2302
|
class="redirect-link"
|
|
2303
2303
|
href="${t}"
|
|
2304
2304
|
target="_blank"
|
|
@@ -2307,7 +2307,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2307
2307
|
</a>`}return H`${Bo(Ul.sanitize(e))} `})}<br />`:H``})}`,this.imagesToDisplay=o,Promise.all(r).then(e=>{this.websitePreviewInfo=e})}hyperlinkHTML(e,t){const n=document.createElement("a");return n.className="redirect-link",n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.textContent=t,n.outerHTML}preserveHTMLTags(e){var t;const n=e.match(/(<\/?[a-z][^>]*>[^<]*<\/?[a-z]*>|[^\s]+[.,?!]?|\S)/gi);return null!==(t=null==n?void 0:n.filter(e=>""!==e.trim()))&&void 0!==t?t:[]}sanitizeMarkdownText(e){return e.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/gim,"<b>$1</b>").replace(/\*(.*?)\*/gim,"<i>$1</i>").trim()}removeTrailingPunctuation(e){return[".",",","!","?",":",";"].includes(e[e.length-1])?this.removeTrailingPunctuation(e.slice(0,-1)):e}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>|<a href="[^"]+"(?: target="[^"]*")?>[^<]+<\/a>|\[.*?\]\([^)]*\.[^)]*\)/g)),n=[],i=t.map(t=>{const n=t[0];if(void 0===t.index)return;const i=e[t.index-1],r=e[t.index+n.length];if(n.startsWith("<https")||n.startsWith("<http"))return{matchedLink:n,link:n.split("|")[0].replace("<",""),hyperlink:n.split("|")[1].replace(">",""),addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)};if(n.startsWith("<a href=")){const e=n.match(/href="([^"]+)"/),t=n.match(/>[^<]+</);return{matchedLink:n,link:e?e[1]:"",hyperlink:t?t[0].slice(1,-1):"",addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)}}{const[e,t]=n.split("](");return{matchedLink:n,link:t?t.slice(0,-1):"",hyperlink:e?e.slice(1):"",addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)}}});return i.forEach(t=>{if(t&&t.link&&t.hyperlink){const i=ms().replace(/-/g,"");n.push({link:this.removeTrailingPunctuation(t.link),hyperlink:this.removeTrailingPunctuation(t.hyperlink),mark:t.matchedLink,id:i}),e=e.replace(t.matchedLink,`${t.addSpaceBefore?" ":""}${i}${t.addSpaceAfter?" ":""}`)}}),{hyperlinks:n,markedText:e}}async getLinkData(e){var t,n,i,o;try{const a=(await r().get(e)).data,s=(new DOMParser).parseFromString(a,"text/html");return s?{title:null!==(n=null===(t=s.querySelector("title"))||void 0===t?void 0:t.textContent)&&void 0!==n?n:null,description:(null===(i=s.querySelector('meta[name="description"]'))||void 0===i?void 0:i.getAttribute("content"))||null,image:(null===(o=s.querySelector('meta[property="og:image"]'))||void 0===o?void 0:o.getAttribute("content"))||null,favicon:null,link:e}:{title:null,description:null,image:null,favicon:null,link:e}}catch(t){return{title:null,description:null,image:null,favicon:null,link:e}}}render(){return this.message?H`<div class="message-inner-body">
|
|
2308
2308
|
${this.isMessageStillStreamingChunks()?H`<div class="message-loader"><mini-loader></mini-loader></div>`:""}
|
|
2309
2309
|
<p
|
|
2310
|
-
class=${Ce({"message-text":this.widgetType!==
|
|
2310
|
+
class=${Ce({"message-text":this.widgetType!==Ap.Utilities,"message-text-large":this.widgetType===Ap.Utilities,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}
|
|
2311
2311
|
>
|
|
2312
2312
|
${this.parsedMessage}
|
|
2313
2313
|
</p>
|
|
@@ -2338,9 +2338,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2338
2338
|
/>`:""}
|
|
2339
2339
|
|
|
2340
2340
|
<div class="website-preview-body">
|
|
2341
|
-
<p class=${Ce({"message-text":this.widgetType!==
|
|
2341
|
+
<p class=${Ce({"message-text":this.widgetType!==Ap.Utilities,"message-text-large":this.widgetType===Ap.Utilities,"website-preview-title":!0,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}>${e.title}</p>
|
|
2342
2342
|
${e.description?H`<p
|
|
2343
|
-
class=${Ce({"message-text":this.widgetType!==
|
|
2343
|
+
class=${Ce({"message-text":this.widgetType!==Ap.Utilities,"message-text-large":this.widgetType===Ap.Utilities,"website-preview-description":!0,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}
|
|
2344
2344
|
>
|
|
2345
2345
|
${e.description}
|
|
2346
2346
|
</p>`:""}
|
|
@@ -2629,7 +2629,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2629
2629
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 0C17.7614 0 20 2.23858 20 5V15C20 17.7614 17.7614 20 15 20H5C2.23858 20 0 17.7614 0 15V5C0 2.23858 2.23858 0 5 0H15ZM18 5C18 3.34315 16.6569 2 15 2H5C3.34315 2 2 3.34315 2 5V15C2 16.6569 3.34315 18 5 18H15C16.6569 18 18 16.6569 18 15V5Z" fill="${e}"/>
|
|
2630
2630
|
<path d="M12.1893 9.25L10.4697 7.53033C10.1768 7.23744 10.1768 6.76256 10.4697 6.46967C10.7626 6.17678 11.2374 6.17678 11.5303 6.46967L13.8232 8.76256C14.5066 9.44598 14.5066 10.554 13.8232 11.2374L11.5303 13.5303C11.2374 13.8232 10.7626 13.8232 10.4697 13.5303C10.1768 13.2374 10.1768 12.7626 10.4697 12.4697L12.1893 10.75L6 10.75C5.58579 10.75 5.25 10.4142 5.25 10C5.25 9.58579 5.58579 9.25 6 9.25L12.1893 9.25Z" fill="${e}"/>
|
|
2631
2631
|
</svg>
|
|
2632
|
-
`,eu=new WeakMap,tu=e=>!!e.hasAttribute("inert")||!0===e.inert,nu=(e,t)=>{const n=e;if(t)return e.setAttribute("inert",""),void(n.inert=!0);e.removeAttribute("inert"),n.inert=!1},iu=e=>{e.setAttribute("aria-hidden","true"),nu(e,!0)},ru=e=>{null===e.ariaHidden?e.element.removeAttribute("aria-hidden"):e.element.setAttribute("aria-hidden",e.ariaHidden),nu(e.element,e.hadInert)},ou=e=>{const t={element:e,ariaHidden:e.getAttribute("aria-hidden"),hadInert:tu(e)};return iu(e),t};var au,su=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 lu=au=class extends ue{constructor(){super(...arguments),this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.onMount=()=>({}),this.isHealthChat=!1,this.centralConvo=!1,this.widgetType=
|
|
2632
|
+
`,eu=new WeakMap,tu=e=>!!e.hasAttribute("inert")||!0===e.inert,nu=(e,t)=>{const n=e;if(t)return e.setAttribute("inert",""),void(n.inert=!0);e.removeAttribute("inert"),n.inert=!1},iu=e=>{e.setAttribute("aria-hidden","true"),nu(e,!0)},ru=e=>{null===e.ariaHidden?e.element.removeAttribute("aria-hidden"):e.element.setAttribute("aria-hidden",e.ariaHidden),nu(e.element,e.hadInert)},ou=e=>{const t={element:e,ariaHidden:e.getAttribute("aria-hidden"),hadInert:tu(e)};return iu(e),t};var au,su=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 lu=au=class extends ue{constructor(){super(...arguments),this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.onMount=()=>({}),this.isHealthChat=!1,this.centralConvo=!1,this.widgetType=Ap.Default,this.primaryColor=Zn,this.backgroundColor=Jn,this.onClickExit=()=>{localStorage.setItem("isChatOpen","false")},this.requiresConsent=!1,this._isMobile=Ir(),this.shouldAutoScroll=!0,this.messages=[],this.isLoadingMessages=!1,this.hasReceivedConsent=!1,this._replyAnnouncement="",this.announcedReplyKeys=new Set,this.hasReplySnapshot=!1,this.holdMessageFieldFocus=!1,this.sendInFlight=!1,this.releaseFocusHoldQueued=!1,this.hostPageLock=null,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.websitePreviewMapping={},this.sendMessage=async e=>{var t,n;if(0!==e.length)if(this.sendInFlight||(null===(t=this.myPubnub)||void 0===t?void 0:t.isCurrentlyStreamingMessage))this.holdMessageFieldFocus&&this.focusMessageField();else{this.sendInFlight=!0;try{this.shouldAutoScroll=!0,this.holdMessageFieldFocus=!0,this.focusMessageField(),this.messageInput.value="",this.autoResizeMessageInput(),0===this.messages.length&&(this.messages=[{timestamp:0,message:e,isLeadMessage:!0,chunks:[{text:e,order:0,isDone:!0}],type:Os.text}]),await(null===(n=this.myPubnub)||void 0===n?void 0:n.sendMessage(e))}finally{this.sendInFlight=!1,this.focusMessageField(),await this.updateComplete,this.restoreMessageFieldFocus()}}},this.scrollToChatBottom=()=>{this.shouldAutoScroll&&this.messageBody.scrollTo({top:this.messageBody.scrollHeight-this.messageBody.clientHeight,behavior:"auto"})},this.handleConversationScroll=e=>{const t=e.currentTarget,n=t.scrollHeight-t.clientHeight-t.scrollTop;this.shouldAutoScroll=n<=au.AUTO_SCROLL_THRESHOLD_PX},this.autoResizeMessageInput=()=>{this.messageInput.style.height="auto",this.messageInput.style.height=this.messageInput.scrollHeight+"px"},this.needsConsent=()=>this.requiresConsent&&!this.hasReceivedConsent}get consentKey(){return`${this.orgSlug}Consent`}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=Nr(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),this.releaseHostPage(),super.disconnectedCallback()}firstUpdated(){var e,t;this.messages=(null===(e=this.myPubnub)||void 0===e?void 0:e.simpleChatMessages)||[],null===(t=this.myPubnub)||void 0===t||t.addChatListener(e=>{this.messages=e.messages,this.isLoadingMessages=e.isLoading}),this.onMount();const n=localStorage.getItem(this.consentKey);if(!n)return void(this.hasReceivedConsent=!1);const i=JSON.parse(n),{timestamp:r,consentId:o}=i;Yl(new Date,new Date(r))<7&&o===Zo?this.hasReceivedConsent=!0:(this.hasReceivedConsent=!1,localStorage.removeItem(this.consentKey))}willUpdate(){this.syncReplyAnnouncement()}syncReplyAnnouncement(){var e;const t=(null===(e=this.building)||void 0===e?void 0:e.userFirstName)||"Elise",n=this.messages.flatMap(e=>{const n=mu(e,t);return n?[{key:gu(e),announcement:n}]:[]});if(!this.hasReplySnapshot){if(0===this.messages.length)return;return n.forEach(({key:e})=>this.announcedReplyKeys.add(e)),void(this.hasReplySnapshot=!0)}const i=n.filter(({key:e})=>!this.announcedReplyKeys.has(e));if(0===i.length)return;i.forEach(({key:e})=>this.announcedReplyKeys.add(e));const r=i.map(({announcement:e})=>e).join(" "),o=this._replyAnnouncement.replace(/\u200b/g,"");this._replyAnnouncement=r!==o||this._replyAnnouncement.endsWith("")?r:`${r}`}renderReplyAnnouncer(){return H`<div
|
|
2633
2633
|
id="reply-announcer"
|
|
2634
2634
|
class="sr-only"
|
|
2635
2635
|
role="status"
|
|
@@ -2642,7 +2642,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2642
2642
|
for="message-input"
|
|
2643
2643
|
style=${Xn({color:e})}
|
|
2644
2644
|
>${"Message"}</label
|
|
2645
|
-
>`}focusMessageField(){const e=this.shadowRoot,t=null==e?void 0:e.getElementById("message-input");return!!(t instanceof HTMLTextAreaElement&&e)&&(0!==t.getClientRects().length&&(e.activeElement!==t&&t.focus({preventScroll:!0}),e.activeElement===t))}trapTabInMobileDialog(e){var t;if(!this._isMobile)return;const n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat-container");n&&cu(e,n)}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$;if(!this.buildingSlug&&!this.centralConvo)return H``;const S=(null===(e=this.building)||void 0===e?void 0:e.userFirstName)||"Elise",k=null===(t=this.building)||void 0===t?void 0:t.id;let A={};if(A=this._isMobile?{top:void 0,bottom:0,left:void 0,right:0}:{top:void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:void 0===this.bottom||isNaN(this.bottom)?"130px":`${this.bottom}px`,left:void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:void 0===this.right||isNaN(this.right)?"18px":`${this.right}px`},22320===k&&(A={...A,fontFamily:'"Helvetica Neue", Arial'}),this.widgetType===
|
|
2645
|
+
>`}focusMessageField(){const e=this.shadowRoot,t=null==e?void 0:e.getElementById("message-input");return!!(t instanceof HTMLTextAreaElement&&e)&&(0!==t.getClientRects().length&&(e.activeElement!==t&&t.focus({preventScroll:!0}),e.activeElement===t))}trapTabInMobileDialog(e){var t;if(!this._isMobile)return;const n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat-container");n&&cu(e,n)}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$;if(!this.buildingSlug&&!this.centralConvo)return H``;const S=(null===(e=this.building)||void 0===e?void 0:e.userFirstName)||"Elise",k=null===(t=this.building)||void 0===t?void 0:t.id;let A={};if(A=this._isMobile?{top:void 0,bottom:0,left:void 0,right:0}:{top:void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:void 0===this.bottom||isNaN(this.bottom)?"130px":`${this.bottom}px`,left:void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:void 0===this.right||isNaN(this.right)?"18px":`${this.right}px`},22320===k&&(A={...A,fontFamily:'"Helvetica Neue", Arial'}),this.widgetType===Ap.Utilities)return H`
|
|
2646
2646
|
<div
|
|
2647
2647
|
id="utilities-container"
|
|
2648
2648
|
class=${Ce({"pubnub-container__mobile":this._isMobile,"utilities-container__desktop":!this._isMobile})}
|
|
@@ -2755,7 +2755,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2755
2755
|
</div>
|
|
2756
2756
|
</div>
|
|
2757
2757
|
</div>
|
|
2758
|
-
`;if(this.widgetType===
|
|
2758
|
+
`;if(this.widgetType===Ap.Healthcare)return H`
|
|
2759
2759
|
<div
|
|
2760
2760
|
id="healthchat-container"
|
|
2761
2761
|
class=${Ce({"pubnub-container__mobile":this._isMobile,"healthchat-container__desktop":!this._isMobile})}
|
|
@@ -2990,7 +2990,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2990
2990
|
</button>
|
|
2991
2991
|
</div>
|
|
2992
2992
|
</div>
|
|
2993
|
-
`}};function uu(e){const t=pu(e)[0];return!!t&&(t.focus(),!0)}function du(e,t){const n=hu(e);return!(!n||n===e)||(!(!t||!uu(t))||uu(e))}function cu(e,t){if("Tab"!==e.key)return;const n=hu(t);if(!n)return;const i=pu(t);if(0===i.length)return void e.preventDefault();const r=i.indexOf(n),o=0===r,a=r===i.length-1;if(e.shiftKey&&(n===t||o))return e.preventDefault(),void i[i.length-1].focus();e.shiftKey||n!==t&&!a||(e.preventDefault(),i[0].focus())}function hu(e){var t;let n=document.activeElement;for(;null===(t=null==n?void 0:n.shadowRoot)||void 0===t?void 0:t.activeElement;)n=n.shadowRoot.activeElement;if(!(n instanceof HTMLElement))return null;let i=n;for(;i;){if(i===e)return n;i=i instanceof ShadowRoot?i.host:i.parentNode}return null}function pu(e){const t=[],n=e=>{e instanceof Element&&e.shadowRoot&&n(e.shadowRoot),e.querySelectorAll("*").forEach(e=>{(function(e){if("-1"===e.getAttribute("tabindex"))return!1;if("disabled"in e&&e.disabled)return!1;const t="BUTTON"===e.tagName||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||"A"===e.tagName&&e.hasAttribute("href")||e.hasAttribute("tabindex");return t&&e.getClientRects().length>0})(e)&&t.push(e),e.shadowRoot&&n(e.shadowRoot)})};return n(e),t}lu.AUTO_SCROLL_THRESHOLD_PX=32,lu.styles=[Me,Ms,Ns,Is,Kl],su([pe({type:Number})],lu.prototype,"right",void 0),su([pe({type:Number})],lu.prototype,"bottom",void 0),su([pe({type:Number})],lu.prototype,"top",void 0),su([pe({type:Number})],lu.prototype,"left",void 0),su([pe({attribute:!0})],lu.prototype,"onMount",void 0),su([pe({attribute:!0})],lu.prototype,"channel",void 0),su([pe({attribute:!0})],lu.prototype,"isHealthChat",void 0),su([pe({attribute:!0})],lu.prototype,"myPubnub",void 0),su([pe({attribute:!0})],lu.prototype,"orgSlug",void 0),su([pe({attribute:!0})],lu.prototype,"buildingSlug",void 0),su([pe({attribute:!0})],lu.prototype,"centralConvo",void 0),su([pe({attribute:!0})],lu.prototype,"widgetType",void 0),su([pe({attribute:!0})],lu.prototype,"building",void 0),su([pe({attribute:!0})],lu.prototype,"primaryColor",void 0),su([pe({attribute:!0})],lu.prototype,"backgroundColor",void 0),su([pe({attribute:!0})],lu.prototype,"onClickExit",void 0),su([pe({attribute:!0})],lu.prototype,"requiresConsent",void 0),su([ge("#message-input",!0)],lu.prototype,"messageInput",void 0),su([ge("#conversation-body",!0)],lu.prototype,"messageBody",void 0),su([fe()],lu.prototype,"_isMobile",void 0),su([fe()],lu.prototype,"messages",void 0),su([fe()],lu.prototype,"isLoadingMessages",void 0),su([fe()],lu.prototype,"hasReceivedConsent",void 0),su([fe()],lu.prototype,"_replyAnnouncement",void 0),su([fe()],lu.prototype,"sendInFlight",void 0),su([fe()],lu.prototype,"privacyPolicyUrl",void 0),su([fe()],lu.prototype,"websitePreviewMapping",void 0),lu=au=su([ce("pubnub-chat")],lu);const fu=e=>Ts(e)?e.message:_s(e)?`Take me to ${e.navigation.label}`:"Media message",gu=e=>`${e.type}:${e.timestamp}`,mu=(e,t)=>e.isLeadMessage||Ts(e)&&(e=>{const t=e.chunks.find(e=>e.isDone);return!t||e.chunks.length===t.order})(e)?null:`${t}: ${fu(e)}`;var bu=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 yu=class extends ue{constructor(){super(...arguments),this.tourTypeOptions=[],this.layoutOptions=[],this.chatId="",this.buildingId=0,this.orgId=0,this.leadSourceParams=null,this.buildingSlug="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.selfGuidedTourEnabled=!1,this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.orgSlug="",this.hasDynamicSchedulingEnabled=!1,this.bedroomPreferenceRequired=!1,this.brokerIntakeEnabled=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingName="",this.trapOverlayTab=e=>{cu(e,this)},this.movedFocusInside=!1,this.tourType=null,this.shouldShowTourType={[vu.Guided]:!0,[vu.Self]:!0,[vu.Virtual]:!0},this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1,this.availabilitiesGroupedByDay={},this.calendarTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.shouldAllowScheduling=!1,this.shouldAllowScheduleLoading=!0,this.promptForReschedule=!1,this.canceledReschedule=!1,this.isBrokerReferral=!1,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerFirmName="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneCountry=null,this.brokerPhoneIsValid=!1,this.brokerPhoneHasBlurred=!1,this.leadSources=[],this.orgLegalName="",this.country=null,this.buildingState=null,this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.firstNameInputValue="",this.lastNameInputValue="",this.leadSourceInputValue="",this.selectedLayoutValue="",this.floorplanOptions=[],this.selectedFloorplanName="",this.selectedUnitValue="",this.units=[],this.allowOccupiedUnitTours=!1,this.errorGettingAvailabilities=!1,this.centralConvoBuildings=[],this.isGeneralBuilding=!1,this.statusMessage="",this.useCoastalCustomTourTypes=!1,this.tourTypeOrder=$u,this._setAvailabilities=async()=>{try{const[e,t]=await Promise.all([ha(this.buildingId,this.hasDynamicSchedulingEnabled),lo()]);this.shouldAllowScheduling=e,this.shouldAllowScheduleLoading=!1,this.calendarTimeZone=await(async e=>{var t;return null!==(t=(await ao(e)).calendarTimeZone)&&void 0!==t?t:Intl.DateTimeFormat().resolvedOptions().timeZone})(this.buildingId),Ao({logTitle:"AVAILABILITIES_EXIST_FOR_TOUR_TYPE",logData:t,logType:ko.info,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});const n=Object.values(t).every(e=>!1===e),i=!this.sgtUrl&&!this.escortedToursLink&&!this.virtualToursLink;if(n&&i)return this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,void Ao({logTitle:"NO_AVAILABILITIES_EXIST",logData:null,logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.shouldShowTourType={[vu.Guided]:this.tourTypeOptions.map(e=>e.value).includes("WITH_AGENT")&&(t[vu.Guided]||!!this.escortedToursLink),[vu.Self]:this.tourTypeOptions.map(e=>e.value).includes("SELF_GUIDED")&&(t[vu.Self]||!!this.sgtUrl),[vu.Virtual]:this.tourTypeOptions.map(e=>e.value).includes("VIRTUAL_SHOWING")&&(t[vu.Virtual]||!!this.virtualToursLink)};const r=1===Object.values(this.shouldShowTourType).reduce((e,t)=>!0===t?e+1:e,0);if(this._setDefaultSelectedDateAndTimes(),r&&(this.tourType=Object.keys(this.shouldShowTourType).find(e=>this.shouldShowTourType[e])),null===this.tourType)return void(this.waitingForAvailabilities=!1);this.availabilitiesGroupedByDay=await uo(wu[this.tourType]),this.waitingForAvailabilities=!1}catch(e){this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,Ao({logTitle:"ERROR_LOADING_AVAILABILITIES",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this._setDefaultSelectedDateAndTimes=async(e,t)=>{var n,i,r;const o=await ao(this.buildingId),a=null!=e?e:this._getHighestRankedTourType(o),s=a?null===(r=null===(i=null===(n=o.availability)||void 0===n?void 0:n[a])||void 0===i?void 0:i.availableTourStartTimes)||void 0===r?void 0:r.filter(e=>{if(!t)return!0;return ur("string"==typeof e?Yr(e):e,t)}):[],l=null==s?void 0:s[0];a&&l&&a!==Gr.Unknown&&a!==Gr.MediaTour&&(this.selectedDate=lr("string"==typeof l?Yr(l):l),this.tourType=Cu[a],this.selectedTime="string"==typeof l?co(l):(e=>({datetime:ir(e,"yyyy-MM-dd'T'HH:mm:ss"),offset:ir(e,"xxx")}))(l))},this._getHighestRankedTourType=e=>{var t;const n=(null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]).map(t=>{var n,i;return{tourType:t,availabilities:null===(i=null===(n=e.availability)||void 0===n?void 0:n[t])||void 0===i?void 0:i.availableTourStartTimes}}).filter(e=>{if(e.tourType===Gr.Unknown||e.tourType===Gr.MediaTour)return!1;const t=Cu[e.tourType],n=this._getTourTypeOffered(t);return!!n&&(!va(0,n)&&e.availabilities&&e.availabilities.length>0)}),i=n[0];return i?i.tourType:null},this._getTourTypeOffered=e=>e===vu.Guided?this.escortedToursTypeOffered:e===vu.Self?this.selfGuidedToursTypeOffered:e===vu.Virtual?this.virtualToursTypeOffered:null,this._getUnitOptions=()=>{const e=this.selectedLayoutValue?this.units.filter(e=>Au(10*e.numberOfBedrooms)===this.selectedLayoutValue):this.units,t=e.map(e=>({label:e.unitNumber,value:e.unitNumber}));return t},this._fetchUnits=async()=>{if(this.buildingSlug)try{this.units=await os({buildingSlug:this.buildingSlug})}catch(e){this.units=[],Ao({logTitle:"ERROR_LOADING_UNITS_FOR_TOUR_SCHEDULER",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this.firstUpdated=async()=>{if(await this._fetchCentralConvoBuildings(),this.isGeneralBuilding)return this.waitingForAvailabilities=!1,this.shouldAllowScheduleLoading=!1,void(this.statusMessage="Please select a building to see tour availabilities.");await this._loadForCurrentBuilding()},this._loadForCurrentBuilding=async()=>{const e=async function(e){if(!e)return!1;try{return!0===(await r().get(vo(e),{params:{rollout_name:"coastal_custom_tour_types",default_value:!1},timeout:3e3})).data}catch(e){return!1}}(this.buildingSlug),t=_o(this.buildingSlug);this.tourTypeOrder=function(e){const t=e.flatMap(e=>$u.filter(t=>wu[t]===e));let n=0;return $u.map(e=>t.includes(e)?t[n++]:e)}(await ao(this.buildingId).then(e=>{var t;return null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]},()=>[])),this.useCoastalCustomTourTypes=await e,this.floorplanOptions=await t,await Promise.all([this._setAvailabilities().then(async()=>{try{const e=await ao(this.buildingId);this.allowOccupiedUnitTours=!!e.allowOccupiedUnitTours}catch(e){this.allowOccupiedUnitTours=!1}}),this._fetchUnits()])},this._fetchCentralConvoBuildings=async()=>{if(this.orgSlug&&this.buildingSlug)try{const e=await async function(e,t){var n,i;const o=(await r().get("https://app.meetelise.com/platformApi/webchat/central-convo-buildings-v2",{headers:{"building-slug":t,"org-slug":e}})).data;return{is_general_building:null!==(n=null==o?void 0:o.is_general_building)&&void 0!==n&&n,buildings:null!==(i=null==o?void 0:o.buildings)&&void 0!==i?i:[]}}(this.orgSlug,this.buildingSlug);this.centralConvoBuildings=e.buildings,this.isGeneralBuilding=e.is_general_building}catch(e){this.centralConvoBuildings=[],this.isGeneralBuilding=!1}},this._onBuildingChange=async()=>{var e;const t=null===(e=this.selectedBuildingEl)||void 0===e?void 0:e.value;if(!t||t===this.buildingSlug)return;const n=this.centralConvoBuildings.find(e=>e.slug===t);if(n){this.isGeneralBuilding=!1,this.waitingForAvailabilities=!0,this.errorGettingAvailabilities=!1,this.tourType=null,this.selectedDate=void 0,this.selectedTime=void 0,this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.units=[],this.selectedLayoutValue="",this.floorplanOptions=[],this.selectedFloorplanName="",this.selectedUnitValue="",this.buildingId=n.building_id,this.buildingSlug=n.slug,this.buildingName=n.name,this.statusMessage=`Loading tours for ${n.name}…`,Lo("tourBuildingSelected",{buildingId:n.building_id});try{const e=await wa(this.orgSlug,n.slug);this.sgtUrl=e.sgtUrl,this.selfGuidedToursTypeOffered=e.selfGuidedToursTypeOffered,this.selfGuidedTourEnabled=e.isSelfGuidedTourEnabled,this.escortedToursLink=e.escortedToursLink,this.escortedToursTypeOffered=e.escortedToursTypeOffered,this.virtualToursLink=e.virtualToursLink,this.virtualToursTypeOffered=e.virtualToursTypeOffered,this.tourTypeOptions=e.tourTypeOptions.map(e=>({label:e.label,value:e.value})),this.hasDynamicSchedulingEnabled=e.usesDynamicScheduling}catch(e){}if(await this._loadForCurrentBuilding(),!this.shouldAllowScheduling||this.errorGettingAvailabilities)this.statusMessage=`No tour availabilities for ${n.name}.`;else{const e=Object.values(this.shouldShowTourType).filter(Boolean).length;this.statusMessage=`Showing tours for ${n.name}. ${e} tour type${1===e?"":"s"} available.`}}},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await uo(wu[this.tourType]))},this.onChangePhoneNumber=e=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country,this.phoneNumberIsValid=e.detail.isValid},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangeBrokerPhone=e=>{this.brokerPhone=e.detail.formattedValue,this.brokerPhoneE164=e.detail.e164,this.brokerPhoneCountry=e.detail.country,this.brokerPhoneIsValid=e.detail.isValid},this.onToggleBrokerReferral=e=>{const t=e.target.checked,n=!(this.brokerFirstName||this.brokerLastName||this.brokerEmail||this.brokerPhone),i=!(this.firstNameInputValue||this.lastNameInputValue||this.email||this.phoneNumber);t&&n?(this.brokerFirstName=this.firstNameInputValue,this.brokerLastName=this.lastNameInputValue,this.brokerEmail=this.email,this.brokerPhone=this.phoneNumber,this.brokerPhoneE164=this.phoneNumberE164,this.brokerPhoneCountry=this.phoneCountry,this.brokerPhoneIsValid=this.phoneNumberIsValid,this.brokerPhoneHasBlurred=this.phoneNumberHasBlurred,this.firstNameInputValue="",this.lastNameInputValue="",this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1):!t&&i&&(this.firstNameInputValue=this.brokerFirstName,this.lastNameInputValue=this.brokerLastName,this.email=this.brokerEmail,this.phoneNumber=this.brokerPhone,this.phoneNumberE164=this.brokerPhoneE164,this.phoneCountry=this.brokerPhoneCountry,this.phoneNumberIsValid=this.brokerPhoneIsValid,this.phoneNumberHasBlurred=this.brokerPhoneHasBlurred,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneIsValid=!1,this.brokerPhoneHasBlurred=!1),this.isBrokerReferral=t},this.brokerReferral=()=>{var e;return this.brokerIntakeEnabled&&this.isBrokerReferral?ra(this.brokerFirstName,this.brokerLastName,this.brokerEmail,this.brokerFirmName,null!==(e=this.brokerPhoneE164)&&void 0!==e?e:""):null},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n,i;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&Lr(null!==(i=null===(n=this.emailInput)||void 0===n?void 0:n.value)&&void 0!==i?i:"")&&!!this.phoneNumber&&!!this.phoneNumberE164},layout:()=>!this.bedroomPreferenceRequired||!!this.selectedLayoutValue||!!this.selectedFloorplanName,broker:()=>{const e=this.brokerReferral();return!e||!oa(e)&&!aa(e,this.email)&&(!this.brokerPhone||this.brokerPhoneIsValid)}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo()&&this.validators.layout()&&this.validators.broker(),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,t,n,i,o,a,s,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const k=this.phoneNumberE164;if(!k)return void(this.phoneNumberIsValid=!1);if(!this.validators.broker())return;const A=this.brokerReferral(),T=new URLSearchParams(window.location.search);let E=null;E=this.selectedLeadSource&&this.selectedLeadSource.value&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:this.leadSourceInputValue&&this.leadSourceInputValue.length>0?this.leadSourceInputValue:this.currentLeadSource;const _=[...new Set(E?[E,"property-website"]:["property-website"])];this.firstNameInput&&(this.firstNameInputValue=this.firstNameInput.value),this.lastNameInput&&(this.lastNameInputValue=this.lastNameInput.value),this.leadSourceInputValue=E;const O=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||this.selectedLayoutValue||null,P=(null===(t=this.selectedUnitEl)||void 0===t?void 0:t.value)||this.selectedUnitValue||null;Lo("scheduleTourSubmitted",{email:this.email,phone:k,firstName:null!==(i=null===(n=this.firstNameInput)||void 0===n?void 0:n.value)&&void 0!==i?i:this.firstNameInputValue,lastName:null!==(a=null===(o=this.lastNameInput)||void 0===o?void 0:o.value)&&void 0!==a?a:this.lastNameInputValue,tourType:ku[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,originatingSource:_.find(e=>"property-website"!==e)||null,layout:O,unit:P,conversationTrackingId:null!==(u=null===(s=this.leadSourceClient)||void 0===s?void 0:s.chatId)&&void 0!==u?u:null,...A?{isBrokerReferral:!0}:{}});const I=rs(),N={referrer:document.referrer,email_address:this.email,phone_number:k,building_id:this.buildingId,tracking_params:l(this.orgSlug),first_name:null!==(c=null===(d=this.firstNameInput)||void 0===d?void 0:d.value)&&void 0!==c?c:this.firstNameInputValue,last_name:null!==(p=null===(h=this.lastNameInput)||void 0===h?void 0:h.value)&&void 0!==p?p:this.lastNameInputValue,tour_type:ku[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,cancel_existing_tours:this.promptForReschedule,lead_sources:[...new Set(E?[E,da(this.orgSlug)]:[da(this.orgSlug)])],query_params:Object.fromEntries(T.entries()),conversation_tracking_id:null===(f=this.leadSourceClient)||void 0===f?void 0:f.chatId,layouts:O?[O]:void 0,floorplans:this.selectedFloorplanName?[this.selectedFloorplanName]:void 0,unit_numbers:P?[P]:void 0,lead_sources_with_timestamps:(null!==(b=null===(g=this.leadSourceMultitouchClient)||void 0===g?void 0:g.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(m=this.selectedLeadSource)||void 0===m?void 0:m.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}))&&void 0!==b?b:[]).map(e=>_r({...e})),google_rwg_token:null==I?void 0:I.rwgToken,google_referral_building_id:null==I?void 0:I.buildingId,google_environment:null==I?void 0:I.environment,...sa(A)};this.isSubmitting=!0;try{await r().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",N,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE","org-slug":this.orgSlug}}),null===(y=this.leadSourceClient)||void 0===y||y.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(v=this.leadSourceClient)||void 0===v||v.resetLeadSource(),null===(w=this.leadSourceMultitouchClient)||void 0===w||w.resetLeadSourceTouchpoints(),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e,n=(null===(x=null===(C=t.response)||void 0===C?void 0:C.data)||void 0===x?void 0:x.detail)||"Failed to book tour";if(t.response&&t.response.headers&&t.response.headers["funnel-prospect-conflicting-appointment-error"]){if(this.selectedDate&&this.selectedTime){const e=this.availabilitiesGroupedByDay[ir(this.selectedDate,"yyyy-MM-dd")];e&&(this.availabilitiesGroupedByDay[ir(this.selectedDate,"yyyy-MM-dd")]=e.filter(e=>e!==this.selectedTime))}}else{if(409===(null===($=t.response)||void 0===$?void 0:$.status)&&!this.promptForReschedule&&"User already has a tour scheduled for this building"===n)return this.promptForReschedule=!0,this.isSubmitting=!1,void(this.tourIsBooked=!1);if(409===(null===(S=t.response)||void 0===S?void 0:S.status)&&!this.promptForReschedule)return this.isSubmitting=!1,this.tourIsBooked=!1,oo(),this.availabilitiesGroupedByDay=await uo(wu[this.tourType],this.buildingId),void alert("This timeslot is no longer available. Please select a different time.")}alert(n),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>H`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>H`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo()&&this.validators.broker(),nextButtonText:null,renderNextButton:()=>H` <action-confirm-button
|
|
2993
|
+
`}};function uu(e){const t=pu(e)[0];return!!t&&(t.focus(),!0)}function du(e,t){const n=hu(e);return!(!n||n===e)||(!(!t||!uu(t))||uu(e))}function cu(e,t){if("Tab"!==e.key)return;const n=hu(t);if(!n)return;const i=pu(t);if(0===i.length)return void e.preventDefault();const r=i.indexOf(n),o=0===r,a=r===i.length-1;if(e.shiftKey&&(n===t||o))return e.preventDefault(),void i[i.length-1].focus();e.shiftKey||n!==t&&!a||(e.preventDefault(),i[0].focus())}function hu(e){var t;let n=document.activeElement;for(;null===(t=null==n?void 0:n.shadowRoot)||void 0===t?void 0:t.activeElement;)n=n.shadowRoot.activeElement;if(!(n instanceof HTMLElement))return null;let i=n;for(;i;){if(i===e)return n;i=i instanceof ShadowRoot?i.host:i.parentNode}return null}function pu(e){const t=[],n=e=>{e instanceof Element&&e.shadowRoot&&n(e.shadowRoot),e.querySelectorAll("*").forEach(e=>{(function(e){if("-1"===e.getAttribute("tabindex"))return!1;if("disabled"in e&&e.disabled)return!1;const t="BUTTON"===e.tagName||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||"A"===e.tagName&&e.hasAttribute("href")||e.hasAttribute("tabindex");return t&&e.getClientRects().length>0})(e)&&t.push(e),e.shadowRoot&&n(e.shadowRoot)})};return n(e),t}lu.AUTO_SCROLL_THRESHOLD_PX=32,lu.styles=[Me,Ms,Ns,Is,Kl],su([pe({type:Number})],lu.prototype,"right",void 0),su([pe({type:Number})],lu.prototype,"bottom",void 0),su([pe({type:Number})],lu.prototype,"top",void 0),su([pe({type:Number})],lu.prototype,"left",void 0),su([pe({attribute:!0})],lu.prototype,"onMount",void 0),su([pe({attribute:!0})],lu.prototype,"channel",void 0),su([pe({attribute:!0})],lu.prototype,"isHealthChat",void 0),su([pe({attribute:!0})],lu.prototype,"myPubnub",void 0),su([pe({attribute:!0})],lu.prototype,"orgSlug",void 0),su([pe({attribute:!0})],lu.prototype,"buildingSlug",void 0),su([pe({attribute:!0})],lu.prototype,"centralConvo",void 0),su([pe({attribute:!0})],lu.prototype,"widgetType",void 0),su([pe({attribute:!0})],lu.prototype,"building",void 0),su([pe({attribute:!0})],lu.prototype,"primaryColor",void 0),su([pe({attribute:!0})],lu.prototype,"backgroundColor",void 0),su([pe({attribute:!0})],lu.prototype,"onClickExit",void 0),su([pe({attribute:!0})],lu.prototype,"requiresConsent",void 0),su([ge("#message-input",!0)],lu.prototype,"messageInput",void 0),su([ge("#conversation-body",!0)],lu.prototype,"messageBody",void 0),su([fe()],lu.prototype,"_isMobile",void 0),su([fe()],lu.prototype,"messages",void 0),su([fe()],lu.prototype,"isLoadingMessages",void 0),su([fe()],lu.prototype,"hasReceivedConsent",void 0),su([fe()],lu.prototype,"_replyAnnouncement",void 0),su([fe()],lu.prototype,"sendInFlight",void 0),su([fe()],lu.prototype,"privacyPolicyUrl",void 0),su([fe()],lu.prototype,"websitePreviewMapping",void 0),lu=au=su([ce("pubnub-chat")],lu);const fu=e=>Ts(e)?e.message:_s(e)?`Take me to ${e.navigation.label}`:"Media message",gu=e=>`${e.type}:${e.timestamp}`,mu=(e,t)=>e.isLeadMessage||Ts(e)&&(e=>{const t=e.chunks.find(e=>e.isDone);return!t||e.chunks.length===t.order})(e)?null:`${t}: ${fu(e)}`;var bu=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 yu=class extends ue{constructor(){super(...arguments),this.tourTypeOptions=[],this.layoutOptions=[],this.chatId="",this.buildingId=0,this.orgId=0,this.leadSourceParams=null,this.buildingSlug="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.selfGuidedTourEnabled=!1,this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.orgSlug="",this.hasDynamicSchedulingEnabled=!1,this.bedroomPreferenceRequired=!1,this.brokerIntakeEnabled=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingName="",this.trapOverlayTab=e=>{cu(e,this)},this.movedFocusInside=!1,this.tourType=null,this.shouldShowTourType={[vu.Guided]:!0,[vu.Self]:!0,[vu.Virtual]:!0},this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1,this.availabilitiesGroupedByDay={},this.calendarTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.shouldAllowScheduling=!1,this.shouldAllowScheduleLoading=!0,this.promptForReschedule=!1,this.canceledReschedule=!1,this.isBrokerReferral=!1,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerFirmName="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneCountry=null,this.brokerPhoneIsValid=!1,this.brokerPhoneHasBlurred=!1,this.leadSources=[],this.orgLegalName="",this.country=null,this.buildingState=null,this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.firstNameInputValue="",this.lastNameInputValue="",this.leadSourceInputValue="",this.selectedLayoutValue="",this.floorplanOptions=[],this.selectedFloorplanName="",this.selectedUnitValue="",this.units=[],this.allowOccupiedUnitTours=!1,this.errorGettingAvailabilities=!1,this.centralConvoBuildings=[],this.isGeneralBuilding=!1,this.statusMessage="",this.useCoastalCustomTourTypes=!1,this.tourTypeOrder=$u,this._setAvailabilities=async()=>{try{const[e,t]=await Promise.all([ha(this.buildingId,this.hasDynamicSchedulingEnabled),lo()]);this.shouldAllowScheduling=e,this.shouldAllowScheduleLoading=!1,this.calendarTimeZone=await(async e=>{var t;return null!==(t=(await ao(e)).calendarTimeZone)&&void 0!==t?t:Intl.DateTimeFormat().resolvedOptions().timeZone})(this.buildingId),Ao({logTitle:"AVAILABILITIES_EXIST_FOR_TOUR_TYPE",logData:t,logType:ko.info,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});const n=Object.values(t).every(e=>!1===e),i=!this.sgtUrl&&!this.escortedToursLink&&!this.virtualToursLink;if(n&&i)return this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,void Ao({logTitle:"NO_AVAILABILITIES_EXIST",logData:null,logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.shouldShowTourType={[vu.Guided]:this.tourTypeOptions.map(e=>e.value).includes("WITH_AGENT")&&(t[vu.Guided]||!!this.escortedToursLink),[vu.Self]:this.tourTypeOptions.map(e=>e.value).includes("SELF_GUIDED")&&(t[vu.Self]||!!this.sgtUrl),[vu.Virtual]:this.tourTypeOptions.map(e=>e.value).includes("VIRTUAL_SHOWING")&&(t[vu.Virtual]||!!this.virtualToursLink)};const r=1===Object.values(this.shouldShowTourType).reduce((e,t)=>!0===t?e+1:e,0);if(this._setDefaultSelectedDateAndTimes(),r&&(this.tourType=Object.keys(this.shouldShowTourType).find(e=>this.shouldShowTourType[e])),null===this.tourType)return void(this.waitingForAvailabilities=!1);this.availabilitiesGroupedByDay=await uo(wu[this.tourType]),this.waitingForAvailabilities=!1}catch(e){this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,Ao({logTitle:"ERROR_LOADING_AVAILABILITIES",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this._setDefaultSelectedDateAndTimes=async(e,t)=>{var n,i,r;const o=await ao(this.buildingId),a=null!=e?e:this._getHighestRankedTourType(o),s=a?null===(r=null===(i=null===(n=o.availability)||void 0===n?void 0:n[a])||void 0===i?void 0:i.availableTourStartTimes)||void 0===r?void 0:r.filter(e=>{if(!t)return!0;return ur("string"==typeof e?Yr(e):e,t)}):[],l=null==s?void 0:s[0];a&&l&&a!==Gr.Unknown&&a!==Gr.MediaTour&&(this.selectedDate=lr("string"==typeof l?Yr(l):l),this.tourType=Cu[a],this.selectedTime="string"==typeof l?co(l):(e=>({datetime:ir(e,"yyyy-MM-dd'T'HH:mm:ss"),offset:ir(e,"xxx")}))(l))},this._getHighestRankedTourType=e=>{var t;const n=(null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]).map(t=>{var n,i;return{tourType:t,availabilities:null===(i=null===(n=e.availability)||void 0===n?void 0:n[t])||void 0===i?void 0:i.availableTourStartTimes}}).filter(e=>{if(e.tourType===Gr.Unknown||e.tourType===Gr.MediaTour)return!1;const t=Cu[e.tourType],n=this._getTourTypeOffered(t);return!!n&&(!va(0,n)&&e.availabilities&&e.availabilities.length>0)}),i=n[0];return i?i.tourType:null},this._getTourTypeOffered=e=>e===vu.Guided?this.escortedToursTypeOffered:e===vu.Self?this.selfGuidedToursTypeOffered:e===vu.Virtual?this.virtualToursTypeOffered:null,this._getUnitOptions=()=>{const e=this.selectedLayoutValue?this.units.filter(e=>Tu(10*e.numberOfBedrooms)===this.selectedLayoutValue):this.units,t=e.map(e=>({label:e.unitNumber,value:e.unitNumber}));return t},this._fetchUnits=async()=>{if(this.buildingSlug)try{this.units=await os({buildingSlug:this.buildingSlug})}catch(e){this.units=[],Ao({logTitle:"ERROR_LOADING_UNITS_FOR_TOUR_SCHEDULER",logData:{error:e},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this.firstUpdated=async()=>{if(await this._fetchCentralConvoBuildings(),this.isGeneralBuilding)return this.waitingForAvailabilities=!1,this.shouldAllowScheduleLoading=!1,void(this.statusMessage="Please select a building to see tour availabilities.");await this._loadForCurrentBuilding()},this._loadForCurrentBuilding=async()=>{const e=async function(e){if(!e)return!1;try{return!0===(await r().get(vo(e),{params:{rollout_name:"coastal_custom_tour_types",default_value:!1},timeout:3e3})).data}catch(e){return!1}}(this.buildingSlug),t=_o(this.buildingSlug);this.tourTypeOrder=function(e){const t=e.flatMap(e=>$u.filter(t=>wu[t]===e));let n=0;return $u.map(e=>t.includes(e)?t[n++]:e)}(await ao(this.buildingId).then(e=>{var t;return null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]},()=>[])),this.useCoastalCustomTourTypes=await e,this.floorplanOptions=await t,await Promise.all([this._setAvailabilities().then(async()=>{try{const e=await ao(this.buildingId);this.allowOccupiedUnitTours=!!e.allowOccupiedUnitTours}catch(e){this.allowOccupiedUnitTours=!1}}),this._fetchUnits()])},this._fetchCentralConvoBuildings=async()=>{if(this.orgSlug&&this.buildingSlug)try{const e=await async function(e,t){var n,i;const o=(await r().get("https://app.meetelise.com/platformApi/webchat/central-convo-buildings-v2",{headers:{"building-slug":t,"org-slug":e}})).data;return{is_general_building:null!==(n=null==o?void 0:o.is_general_building)&&void 0!==n&&n,buildings:null!==(i=null==o?void 0:o.buildings)&&void 0!==i?i:[]}}(this.orgSlug,this.buildingSlug);this.centralConvoBuildings=e.buildings,this.isGeneralBuilding=e.is_general_building}catch(e){this.centralConvoBuildings=[],this.isGeneralBuilding=!1}},this._onBuildingChange=async()=>{var e;const t=null===(e=this.selectedBuildingEl)||void 0===e?void 0:e.value;if(!t||t===this.buildingSlug)return;const n=this.centralConvoBuildings.find(e=>e.slug===t);if(n){this.isGeneralBuilding=!1,this.waitingForAvailabilities=!0,this.errorGettingAvailabilities=!1,this.tourType=null,this.selectedDate=void 0,this.selectedTime=void 0,this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.units=[],this.selectedLayoutValue="",this.floorplanOptions=[],this.selectedFloorplanName="",this.selectedUnitValue="",this.buildingId=n.building_id,this.buildingSlug=n.slug,this.buildingName=n.name,this.statusMessage=`Loading tours for ${n.name}…`,Lo("tourBuildingSelected",{buildingId:n.building_id});try{const e=await wa(this.orgSlug,n.slug);this.sgtUrl=e.sgtUrl,this.selfGuidedToursTypeOffered=e.selfGuidedToursTypeOffered,this.selfGuidedTourEnabled=e.isSelfGuidedTourEnabled,this.escortedToursLink=e.escortedToursLink,this.escortedToursTypeOffered=e.escortedToursTypeOffered,this.virtualToursLink=e.virtualToursLink,this.virtualToursTypeOffered=e.virtualToursTypeOffered,this.tourTypeOptions=e.tourTypeOptions.map(e=>({label:e.label,value:e.value})),this.hasDynamicSchedulingEnabled=e.usesDynamicScheduling}catch(e){}if(await this._loadForCurrentBuilding(),!this.shouldAllowScheduling||this.errorGettingAvailabilities)this.statusMessage=`No tour availabilities for ${n.name}.`;else{const e=Object.values(this.shouldShowTourType).filter(Boolean).length;this.statusMessage=`Showing tours for ${n.name}. ${e} tour type${1===e?"":"s"} available.`}}},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await uo(wu[this.tourType]))},this.onChangePhoneNumber=e=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country,this.phoneNumberIsValid=e.detail.isValid},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangeBrokerPhone=e=>{this.brokerPhone=e.detail.formattedValue,this.brokerPhoneE164=e.detail.e164,this.brokerPhoneCountry=e.detail.country,this.brokerPhoneIsValid=e.detail.isValid},this.onToggleBrokerReferral=e=>{const t=e.target.checked,n=!(this.brokerFirstName||this.brokerLastName||this.brokerEmail||this.brokerPhone),i=!(this.firstNameInputValue||this.lastNameInputValue||this.email||this.phoneNumber);t&&n?(this.brokerFirstName=this.firstNameInputValue,this.brokerLastName=this.lastNameInputValue,this.brokerEmail=this.email,this.brokerPhone=this.phoneNumber,this.brokerPhoneE164=this.phoneNumberE164,this.brokerPhoneCountry=this.phoneCountry,this.brokerPhoneIsValid=this.phoneNumberIsValid,this.brokerPhoneHasBlurred=this.phoneNumberHasBlurred,this.firstNameInputValue="",this.lastNameInputValue="",this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1):!t&&i&&(this.firstNameInputValue=this.brokerFirstName,this.lastNameInputValue=this.brokerLastName,this.email=this.brokerEmail,this.phoneNumber=this.brokerPhone,this.phoneNumberE164=this.brokerPhoneE164,this.phoneCountry=this.brokerPhoneCountry,this.phoneNumberIsValid=this.brokerPhoneIsValid,this.phoneNumberHasBlurred=this.brokerPhoneHasBlurred,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneIsValid=!1,this.brokerPhoneHasBlurred=!1),this.isBrokerReferral=t},this.brokerReferral=()=>{var e;return this.brokerIntakeEnabled&&this.isBrokerReferral?ra(this.brokerFirstName,this.brokerLastName,this.brokerEmail,this.brokerFirmName,null!==(e=this.brokerPhoneE164)&&void 0!==e?e:""):null},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n,i;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&Lr(null!==(i=null===(n=this.emailInput)||void 0===n?void 0:n.value)&&void 0!==i?i:"")&&!!this.phoneNumber&&!!this.phoneNumberE164},layout:()=>!this.bedroomPreferenceRequired||!!this.selectedLayoutValue||!!this.selectedFloorplanName,broker:()=>{const e=this.brokerReferral();return!e||!oa(e)&&!aa(e,this.email)&&(!this.brokerPhone||this.brokerPhoneIsValid)}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo()&&this.validators.layout()&&this.validators.broker(),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,t,n,i,o,a,s,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const k=this.phoneNumberE164;if(!k)return void(this.phoneNumberIsValid=!1);if(!this.validators.broker())return;const A=this.brokerReferral(),T=new URLSearchParams(window.location.search);let E=null;E=this.selectedLeadSource&&this.selectedLeadSource.value&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:this.leadSourceInputValue&&this.leadSourceInputValue.length>0?this.leadSourceInputValue:this.currentLeadSource;const _=[...new Set(E?[E,"property-website"]:["property-website"])];this.firstNameInput&&(this.firstNameInputValue=this.firstNameInput.value),this.lastNameInput&&(this.lastNameInputValue=this.lastNameInput.value),this.leadSourceInputValue=E;const O=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||this.selectedLayoutValue||null,P=(null===(t=this.selectedUnitEl)||void 0===t?void 0:t.value)||this.selectedUnitValue||null;Lo("scheduleTourSubmitted",{email:this.email,phone:k,firstName:null!==(i=null===(n=this.firstNameInput)||void 0===n?void 0:n.value)&&void 0!==i?i:this.firstNameInputValue,lastName:null!==(a=null===(o=this.lastNameInput)||void 0===o?void 0:o.value)&&void 0!==a?a:this.lastNameInputValue,tourType:ku[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,originatingSource:_.find(e=>"property-website"!==e)||null,layout:O,unit:P,conversationTrackingId:null!==(u=null===(s=this.leadSourceClient)||void 0===s?void 0:s.chatId)&&void 0!==u?u:null,...A?{isBrokerReferral:!0}:{}});const I=rs(),N={referrer:document.referrer,email_address:this.email,phone_number:k,building_id:this.buildingId,tracking_params:l(this.orgSlug),first_name:null!==(c=null===(d=this.firstNameInput)||void 0===d?void 0:d.value)&&void 0!==c?c:this.firstNameInputValue,last_name:null!==(p=null===(h=this.lastNameInput)||void 0===h?void 0:h.value)&&void 0!==p?p:this.lastNameInputValue,tour_type:ku[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,cancel_existing_tours:this.promptForReschedule,lead_sources:[...new Set(E?[E,da(this.orgSlug)]:[da(this.orgSlug)])],query_params:Object.fromEntries(T.entries()),conversation_tracking_id:null===(f=this.leadSourceClient)||void 0===f?void 0:f.chatId,layouts:O?[O]:void 0,floorplans:this.selectedFloorplanName?[this.selectedFloorplanName]:void 0,unit_numbers:P?[P]:void 0,lead_sources_with_timestamps:(null!==(b=null===(g=this.leadSourceMultitouchClient)||void 0===g?void 0:g.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(m=this.selectedLeadSource)||void 0===m?void 0:m.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}))&&void 0!==b?b:[]).map(e=>_r({...e})),google_rwg_token:null==I?void 0:I.rwgToken,google_referral_building_id:null==I?void 0:I.buildingId,google_environment:null==I?void 0:I.environment,...sa(A)};this.isSubmitting=!0;try{await r().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",N,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE","org-slug":this.orgSlug}}),null===(y=this.leadSourceClient)||void 0===y||y.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(v=this.leadSourceClient)||void 0===v||v.resetLeadSource(),null===(w=this.leadSourceMultitouchClient)||void 0===w||w.resetLeadSourceTouchpoints(),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e,n=(null===(x=null===(C=t.response)||void 0===C?void 0:C.data)||void 0===x?void 0:x.detail)||"Failed to book tour";if(t.response&&t.response.headers&&t.response.headers["funnel-prospect-conflicting-appointment-error"]){if(this.selectedDate&&this.selectedTime){const e=this.availabilitiesGroupedByDay[ir(this.selectedDate,"yyyy-MM-dd")];e&&(this.availabilitiesGroupedByDay[ir(this.selectedDate,"yyyy-MM-dd")]=e.filter(e=>e!==this.selectedTime))}}else{if(409===(null===($=t.response)||void 0===$?void 0:$.status)&&!this.promptForReschedule&&"User already has a tour scheduled for this building"===n){const e=t.response.headers;return this.existingTourBuildingName=function(e){if(!e)return;try{return decodeURIComponent(e)||void 0}catch{return}}(e["existing-tour-building-name"]),this.existingTourStartTime=function(e){var t;const n=null===(t=null==e?void 0:e.match(/(Z|[+-]\d{2}:\d{2})$/))||void 0===t?void 0:t[1];return e&&n&&di(Yr(e))?Au(e,n):void 0}(e["existing-tour-start-time"]),this.promptForReschedule=!0,this.isSubmitting=!1,void(this.tourIsBooked=!1)}if(409===(null===(S=t.response)||void 0===S?void 0:S.status)&&!this.promptForReschedule)return this.isSubmitting=!1,this.tourIsBooked=!1,oo(),this.availabilitiesGroupedByDay=await uo(wu[this.tourType],this.buildingId),void alert("This timeslot is no longer available. Please select a different time.")}alert(n),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>H`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>H`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo()&&this.validators.broker(),nextButtonText:null,renderNextButton:()=>H` <action-confirm-button
|
|
2994
2994
|
id="schedule-bttn"
|
|
2995
2995
|
.onClick=${this.submit}
|
|
2996
2996
|
.isLoading=${this.isSubmitting}
|
|
@@ -3010,7 +3010,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3010
3010
|
@change=${this.onToggleBrokerReferral}
|
|
3011
3011
|
/>
|
|
3012
3012
|
</label>
|
|
3013
|
-
`,this.selectLayout=e=>{if(this.selectedLayoutValue=e,e&&this.selectedUnitValue){const t=this.units.find(e=>e.unitNumber===this.selectedUnitValue);t&&
|
|
3013
|
+
`,this.selectLayout=e=>{if(this.selectedLayoutValue=e,e&&this.selectedUnitValue){const t=this.units.find(e=>e.unitNumber===this.selectedUnitValue);t&&Tu(10*t.numberOfBedrooms)!==e&&(this.selectedUnitValue="",this.selectedUnitEl&&(this.selectedUnitEl.value=void 0))}e&&Lo("tourLayoutSelected",{layout:e,buildingId:this.buildingId})}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab),this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("aria-modal")||this.setAttribute("aria-modal","true"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Schedule a Tour")}openSelfGuidedTour(){const e=52===this.orgId?Po(this.sgtUrl,Oo()):this.sgtUrl;window.open(e,"_blank")}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}updated(){this.movedFocusInside||(du(this)?this.movedFocusInside=!0:(this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),this.matches(":focus")||this.focus({preventScroll:!0})))}coastalTourLabel(e){return this.useCoastalCustomTourTypes?xu[e]:void 0}confirmationTourName(e){var t;return null!==(t=this.coastalTourLabel(e))&&void 0!==t?t:Su[e]}buildingSelectMenu(){return H`<me-select
|
|
3014
3014
|
id="building"
|
|
3015
3015
|
placeholder="Select a property"
|
|
3016
3016
|
.value=${this.isGeneralBuilding?"":this.buildingSlug}
|
|
@@ -3230,12 +3230,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3230
3230
|
placeholder=${this.bedroomPreferenceRequired?"Floor plan preference":"Floor plan preference (optional)"}
|
|
3231
3231
|
.value=${this.selectedFloorplanName}
|
|
3232
3232
|
.options="${this.floorplanOptions.map(e=>({label:e.name,value:e.name}))}"
|
|
3233
|
-
@change=${()=>{var e,t;const n=(null===(e=this.selectedFloorplanEl)||void 0===e?void 0:e.value)||"",i=null===(t=this.floorplanOptions.find(e=>e.name===n))||void 0===t?void 0:t.bedrooms;this.selectedFloorplanName=n,this.selectLayout(null==i?"":
|
|
3233
|
+
@change=${()=>{var e,t;const n=(null===(e=this.selectedFloorplanEl)||void 0===e?void 0:e.value)||"",i=null===(t=this.floorplanOptions.find(e=>e.name===n))||void 0===t?void 0:t.bedrooms;this.selectedFloorplanName=n,this.selectLayout(null==i?"":Tu(10*i))}}
|
|
3234
3234
|
>
|
|
3235
3235
|
</me-select>`:this.layoutOptions.length>0?H` <me-select
|
|
3236
3236
|
id="layout"
|
|
3237
3237
|
placeholder=${this.bedroomPreferenceRequired?"Bedroom preference":"Bedroom preference (optional)"}
|
|
3238
|
-
.options="${this.layoutOptions.map(e=>({label:e.label,value:
|
|
3238
|
+
.options="${this.layoutOptions.map(e=>({label:e.label,value:Tu(e.value)}))}"
|
|
3239
3239
|
@change=${()=>{var e;return this.selectLayout((null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||"")}}
|
|
3240
3240
|
>
|
|
3241
3241
|
</me-select>`:""}
|
|
@@ -3255,7 +3255,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3255
3255
|
@change=${()=>{var e;(null===(e=this.selectedLeadSource)||void 0===e?void 0:e.value)&&Lo("tourLeadSourceSelected",{leadSource:this.selectedLeadSource.value,buildingId:this.buildingId}),this.requestUpdate()}}
|
|
3256
3256
|
>
|
|
3257
3257
|
</me-select>`:""}
|
|
3258
|
-
</div> `}confirmationMessage(){if(!this.selectedDate||!this.selectedTime||null===this.tourType)return H``;const e=
|
|
3258
|
+
</div> `}confirmationMessage(){if(!this.selectedDate||!this.selectedTime||null===this.tourType)return H``;const e=Au(`${this.selectedTime.datetime}${this.selectedTime.offset}`,this.calendarTimeZone);return this.canceledReschedule?H`
|
|
3259
3259
|
<div id="confirmationMessage">
|
|
3260
3260
|
<svg
|
|
3261
3261
|
aria-hidden="true"
|
|
@@ -3303,7 +3303,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3303
3303
|
You can make changes at any time, just reply to the email.
|
|
3304
3304
|
</p>`}
|
|
3305
3305
|
</div>
|
|
3306
|
-
`}
|
|
3306
|
+
`}rescheduleExplanation(){return this.existingTourBuildingName&&this.existingTourStartTime?H`You already have a tour scheduled at one of our communities,
|
|
3307
|
+
${this.existingTourBuildingName}, on ${this.existingTourStartTime}. Would
|
|
3308
|
+
you like to reschedule?`:H`You already have a tour scheduled. Would you like to reschedule?`}referralConfirmation(e){return null===this.tourType?H``:H`<p>Thank you for the referral!</p>
|
|
3307
3309
|
<p>
|
|
3308
3310
|
Your client's ${this.confirmationTourName(this.tourType)} is
|
|
3309
3311
|
${this.promptForReschedule?H`rescheduled`:H`scheduled`} for
|
|
@@ -3436,8 +3438,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3436
3438
|
<div>
|
|
3437
3439
|
<h2 class="journey-header">Reschedule Tour</h2>
|
|
3438
3440
|
<div class="explanation">
|
|
3439
|
-
|
|
3440
|
-
reschedule?
|
|
3441
|
+
${this.rescheduleExplanation()}
|
|
3441
3442
|
</div>
|
|
3442
3443
|
</div>
|
|
3443
3444
|
</div>
|
|
@@ -3494,8 +3495,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3494
3495
|
<div>
|
|
3495
3496
|
<h2 class="journey-header">Reschedule Tour</h2>
|
|
3496
3497
|
<div class="explanation">
|
|
3497
|
-
|
|
3498
|
-
reschedule?
|
|
3498
|
+
${this.rescheduleExplanation()}
|
|
3499
3499
|
</div>
|
|
3500
3500
|
</div>
|
|
3501
3501
|
</div>
|
|
@@ -3567,7 +3567,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3567
3567
|
</div>
|
|
3568
3568
|
`}
|
|
3569
3569
|
</div>
|
|
3570
|
-
`}};var vu;yu.styles=[ia,Me],bu([pe({attribute:!1})],yu.prototype,"tourTypeOptions",void 0),bu([pe({attribute:!1})],yu.prototype,"layoutOptions",void 0),bu([pe({attribute:!0})],yu.prototype,"chatId",void 0),bu([pe({type:Number})],yu.prototype,"buildingId",void 0),bu([pe({type:Number})],yu.prototype,"orgId",void 0),bu([pe({attribute:!1})],yu.prototype,"leadSourceParams",void 0),bu([pe({attribute:!0})],yu.prototype,"buildingSlug",void 0),bu([pe({attribute:!0})],yu.prototype,"sgtUrl",void 0),bu([pe({attribute:!0})],yu.prototype,"selfGuidedToursTypeOffered",void 0),bu([pe({attribute:!0})],yu.prototype,"selfGuidedTourEnabled",void 0),bu([pe({attribute:!0})],yu.prototype,"escortedToursLink",void 0),bu([pe({attribute:!0})],yu.prototype,"escortedToursTypeOffered",void 0),bu([pe({attribute:!0})],yu.prototype,"virtualToursLink",void 0),bu([pe({attribute:!0})],yu.prototype,"virtualToursTypeOffered",void 0),bu([pe({attribute:!0})],yu.prototype,"orgSlug",void 0),bu([pe({attribute:!0})],yu.prototype,"hasDynamicSchedulingEnabled",void 0),bu([pe({attribute:!0})],yu.prototype,"bedroomPreferenceRequired",void 0),bu([pe({attribute:!1})],yu.prototype,"brokerIntakeEnabled",void 0),bu([pe({attribute:!0})],yu.prototype,"leadSourceClient",void 0),bu([pe({attribute:!0})],yu.prototype,"leadSourceMultitouchClient",void 0),bu([pe({attribute:!0})],yu.prototype,"buildingName",void 0),bu([fe()],yu.prototype,"tourType",void 0),bu([fe()],yu.prototype,"shouldShowTourType",void 0),bu([fe()],yu.prototype,"email",void 0),bu([fe()],yu.prototype,"phoneNumber",void 0),bu([fe()],yu.prototype,"phoneNumberE164",void 0),bu([fe()],yu.prototype,"phoneCountry",void 0),bu([fe()],yu.prototype,"phoneNumberIsValid",void 0),bu([fe()],yu.prototype,"phoneNumberHasBlurred",void 0),bu([fe()],yu.prototype,"availabilitiesGroupedByDay",void 0),bu([fe()],yu.prototype,"calendarTimeZone",void 0),bu([fe()],yu.prototype,"waitingForAvailabilities",void 0),bu([fe()],yu.prototype,"selectedDate",void 0),bu([fe()],yu.prototype,"selectedTime",void 0),bu([fe()],yu.prototype,"mobilePageIndex",void 0),bu([fe()],yu.prototype,"isSubmitting",void 0),bu([fe()],yu.prototype,"tourIsBooked",void 0),bu([fe()],yu.prototype,"shouldAllowScheduling",void 0),bu([fe()],yu.prototype,"shouldAllowScheduleLoading",void 0),bu([fe()],yu.prototype,"promptForReschedule",void 0),bu([fe()],yu.prototype,"canceledReschedule",void 0),bu([fe()],yu.prototype,"isBrokerReferral",void 0),bu([fe()],yu.prototype,"brokerFirstName",void 0),bu([fe()],yu.prototype,"brokerLastName",void 0),bu([fe()],yu.prototype,"brokerEmail",void 0),bu([fe()],yu.prototype,"brokerFirmName",void 0),bu([fe()],yu.prototype,"brokerPhone",void 0),bu([fe()],yu.prototype,"brokerPhoneE164",void 0),bu([fe()],yu.prototype,"brokerPhoneCountry",void 0),bu([fe()],yu.prototype,"brokerPhoneIsValid",void 0),bu([fe()],yu.prototype,"brokerPhoneHasBlurred",void 0),bu([pe({attribute:!1})],yu.prototype,"leadSources",void 0),bu([pe({attribute:!0})],yu.prototype,"orgLegalName",void 0),bu([pe({attribute:!1})],yu.prototype,"country",void 0),bu([pe({attribute:!1})],yu.prototype,"buildingState",void 0),bu([pe({attribute:!0})],yu.prototype,"currentLeadSource",void 0),bu([pe({attribute:!0})],yu.prototype,"featureFlagShowDropdown",void 0),bu([pe({attribute:!0})],yu.prototype,"compactDesign",void 0),bu([pe({attribute:!0})],yu.prototype,"primaryColor",void 0),bu([pe({attribute:!0})],yu.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),bu([ge(".nameContainer#firstName input")],yu.prototype,"firstNameInput",void 0),bu([ge(".nameContainer#lastName input")],yu.prototype,"lastNameInput",void 0),bu([ge(".inputContainer#email input")],yu.prototype,"emailInput",void 0),bu([ge("me-select#leadSource")],yu.prototype,"selectedLeadSource",void 0),bu([ge("me-select#layout")],yu.prototype,"selectedLayoutEl",void 0),bu([ge("me-select#floorplan")],yu.prototype,"selectedFloorplanEl",void 0),bu([ge("me-select#unit")],yu.prototype,"selectedUnitEl",void 0),bu([fe()],yu.prototype,"firstNameInputValue",void 0),bu([fe()],yu.prototype,"lastNameInputValue",void 0),bu([fe()],yu.prototype,"leadSourceInputValue",void 0),bu([fe()],yu.prototype,"selectedLayoutValue",void 0),bu([fe()],yu.prototype,"floorplanOptions",void 0),bu([fe()],yu.prototype,"selectedFloorplanName",void 0),bu([fe()],yu.prototype,"selectedUnitValue",void 0),bu([fe()],yu.prototype,"units",void 0),bu([fe()],yu.prototype,"allowOccupiedUnitTours",void 0),bu([fe()],yu.prototype,"errorGettingAvailabilities",void 0),bu([fe()],yu.prototype,"centralConvoBuildings",void 0),bu([fe()],yu.prototype,"isGeneralBuilding",void 0),bu([ge("me-select#building")],yu.prototype,"selectedBuildingEl",void 0),bu([fe()],yu.prototype,"statusMessage",void 0),bu([fe()],yu.prototype,"useCoastalCustomTourTypes",void 0),bu([fe()],yu.prototype,"tourTypeOrder",void 0),yu=bu([ce("tour-scheduler")],yu),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(vu||(vu={}));const wu={[vu.Guided]:Gr.WithAgent,[vu.Self]:Gr.SelfGuided,[vu.Virtual]:Gr.VirtualShowing},Cu={[Gr.WithAgent]:vu.Guided,[Gr.SelfGuided]:vu.Self,[Gr.VirtualShowing]:vu.Virtual},xu={[vu.Guided]:"In-Person Tour",[vu.Self]:"VIP Hard Hat Tour"},$u=[vu.Guided,vu.Self,vu.Virtual];const Su={[vu.Guided]:"guided tour",[vu.Self]:"self-guided tour",[vu.Virtual]:"virtual tour"},ku={[vu.Guided]:"escorted-tour",[vu.Self]:"self-guided-tour",[vu.Virtual]:"live-virtual-tour"};function Au(e){const t=Math.round(e/10);return 0===t?"studio":`${t}br`}const
|
|
3570
|
+
`}};var vu;yu.styles=[ia,Me],bu([pe({attribute:!1})],yu.prototype,"tourTypeOptions",void 0),bu([pe({attribute:!1})],yu.prototype,"layoutOptions",void 0),bu([pe({attribute:!0})],yu.prototype,"chatId",void 0),bu([pe({type:Number})],yu.prototype,"buildingId",void 0),bu([pe({type:Number})],yu.prototype,"orgId",void 0),bu([pe({attribute:!1})],yu.prototype,"leadSourceParams",void 0),bu([pe({attribute:!0})],yu.prototype,"buildingSlug",void 0),bu([pe({attribute:!0})],yu.prototype,"sgtUrl",void 0),bu([pe({attribute:!0})],yu.prototype,"selfGuidedToursTypeOffered",void 0),bu([pe({attribute:!0})],yu.prototype,"selfGuidedTourEnabled",void 0),bu([pe({attribute:!0})],yu.prototype,"escortedToursLink",void 0),bu([pe({attribute:!0})],yu.prototype,"escortedToursTypeOffered",void 0),bu([pe({attribute:!0})],yu.prototype,"virtualToursLink",void 0),bu([pe({attribute:!0})],yu.prototype,"virtualToursTypeOffered",void 0),bu([pe({attribute:!0})],yu.prototype,"orgSlug",void 0),bu([pe({attribute:!0})],yu.prototype,"hasDynamicSchedulingEnabled",void 0),bu([pe({attribute:!0})],yu.prototype,"bedroomPreferenceRequired",void 0),bu([pe({attribute:!1})],yu.prototype,"brokerIntakeEnabled",void 0),bu([pe({attribute:!0})],yu.prototype,"leadSourceClient",void 0),bu([pe({attribute:!0})],yu.prototype,"leadSourceMultitouchClient",void 0),bu([pe({attribute:!0})],yu.prototype,"buildingName",void 0),bu([fe()],yu.prototype,"tourType",void 0),bu([fe()],yu.prototype,"shouldShowTourType",void 0),bu([fe()],yu.prototype,"email",void 0),bu([fe()],yu.prototype,"phoneNumber",void 0),bu([fe()],yu.prototype,"phoneNumberE164",void 0),bu([fe()],yu.prototype,"phoneCountry",void 0),bu([fe()],yu.prototype,"phoneNumberIsValid",void 0),bu([fe()],yu.prototype,"phoneNumberHasBlurred",void 0),bu([fe()],yu.prototype,"availabilitiesGroupedByDay",void 0),bu([fe()],yu.prototype,"calendarTimeZone",void 0),bu([fe()],yu.prototype,"waitingForAvailabilities",void 0),bu([fe()],yu.prototype,"selectedDate",void 0),bu([fe()],yu.prototype,"selectedTime",void 0),bu([fe()],yu.prototype,"mobilePageIndex",void 0),bu([fe()],yu.prototype,"isSubmitting",void 0),bu([fe()],yu.prototype,"tourIsBooked",void 0),bu([fe()],yu.prototype,"shouldAllowScheduling",void 0),bu([fe()],yu.prototype,"shouldAllowScheduleLoading",void 0),bu([fe()],yu.prototype,"promptForReschedule",void 0),bu([fe()],yu.prototype,"canceledReschedule",void 0),bu([fe()],yu.prototype,"existingTourBuildingName",void 0),bu([fe()],yu.prototype,"existingTourStartTime",void 0),bu([fe()],yu.prototype,"isBrokerReferral",void 0),bu([fe()],yu.prototype,"brokerFirstName",void 0),bu([fe()],yu.prototype,"brokerLastName",void 0),bu([fe()],yu.prototype,"brokerEmail",void 0),bu([fe()],yu.prototype,"brokerFirmName",void 0),bu([fe()],yu.prototype,"brokerPhone",void 0),bu([fe()],yu.prototype,"brokerPhoneE164",void 0),bu([fe()],yu.prototype,"brokerPhoneCountry",void 0),bu([fe()],yu.prototype,"brokerPhoneIsValid",void 0),bu([fe()],yu.prototype,"brokerPhoneHasBlurred",void 0),bu([pe({attribute:!1})],yu.prototype,"leadSources",void 0),bu([pe({attribute:!0})],yu.prototype,"orgLegalName",void 0),bu([pe({attribute:!1})],yu.prototype,"country",void 0),bu([pe({attribute:!1})],yu.prototype,"buildingState",void 0),bu([pe({attribute:!0})],yu.prototype,"currentLeadSource",void 0),bu([pe({attribute:!0})],yu.prototype,"featureFlagShowDropdown",void 0),bu([pe({attribute:!0})],yu.prototype,"compactDesign",void 0),bu([pe({attribute:!0})],yu.prototype,"primaryColor",void 0),bu([pe({attribute:!0})],yu.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),bu([ge(".nameContainer#firstName input")],yu.prototype,"firstNameInput",void 0),bu([ge(".nameContainer#lastName input")],yu.prototype,"lastNameInput",void 0),bu([ge(".inputContainer#email input")],yu.prototype,"emailInput",void 0),bu([ge("me-select#leadSource")],yu.prototype,"selectedLeadSource",void 0),bu([ge("me-select#layout")],yu.prototype,"selectedLayoutEl",void 0),bu([ge("me-select#floorplan")],yu.prototype,"selectedFloorplanEl",void 0),bu([ge("me-select#unit")],yu.prototype,"selectedUnitEl",void 0),bu([fe()],yu.prototype,"firstNameInputValue",void 0),bu([fe()],yu.prototype,"lastNameInputValue",void 0),bu([fe()],yu.prototype,"leadSourceInputValue",void 0),bu([fe()],yu.prototype,"selectedLayoutValue",void 0),bu([fe()],yu.prototype,"floorplanOptions",void 0),bu([fe()],yu.prototype,"selectedFloorplanName",void 0),bu([fe()],yu.prototype,"selectedUnitValue",void 0),bu([fe()],yu.prototype,"units",void 0),bu([fe()],yu.prototype,"allowOccupiedUnitTours",void 0),bu([fe()],yu.prototype,"errorGettingAvailabilities",void 0),bu([fe()],yu.prototype,"centralConvoBuildings",void 0),bu([fe()],yu.prototype,"isGeneralBuilding",void 0),bu([ge("me-select#building")],yu.prototype,"selectedBuildingEl",void 0),bu([fe()],yu.prototype,"statusMessage",void 0),bu([fe()],yu.prototype,"useCoastalCustomTourTypes",void 0),bu([fe()],yu.prototype,"tourTypeOrder",void 0),yu=bu([ce("tour-scheduler")],yu),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(vu||(vu={}));const wu={[vu.Guided]:Gr.WithAgent,[vu.Self]:Gr.SelfGuided,[vu.Virtual]:Gr.VirtualShowing},Cu={[Gr.WithAgent]:vu.Guided,[Gr.SelfGuided]:vu.Self,[Gr.VirtualShowing]:vu.Virtual},xu={[vu.Guided]:"In-Person Tour",[vu.Self]:"VIP Hard Hat Tour"},$u=[vu.Guided,vu.Self,vu.Virtual];const Su={[vu.Guided]:"guided tour",[vu.Self]:"self-guided tour",[vu.Virtual]:"virtual tour"},ku={[vu.Guided]:"escorted-tour",[vu.Self]:"self-guided-tour",[vu.Virtual]:"live-virtual-tour"};function Au(e,t){return ns(Yr(e),t,"MMM d 'at' h:mmaaa")}function Tu(e){const t=Math.round(e/10);return 0===t?"studio":`${t}br`}const Eu=(e,t,n=!0,i=!1,r,o=.01)=>To({params:{org_slug:e,building_slug:t,is_pixel_on_site:n,is_any_webchat_showing:i,extra_data:{webchat_no_show_reason:r}},sampleRate:o}),_u=async(e,t,n)=>{const i=.01;if(!e)return Eu(n,t,!0,!1,"building_does_not_exist",i),!1;if(!e.launchedDateTime)return Eu(n,t,!0,!1,"building_not_launched",i),!1;if(!e.active)return Eu(n,t,!0,!1,"building_not_active",i),!1;if(!e.webchatScopeConfigured)return Eu(n,t,!0,!1,"building_not_webchat_scope_configured",i),!1;const o=await async function(e){if(!e)return!1;try{return(await r().get(mo(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-leasing-in-maintenance-mode",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(t);return!o||(Eu(n,t,!0,!1,"building_in_maintenance_mode",i),!1)},Ou=p`
|
|
3571
3571
|
* {
|
|
3572
3572
|
font-family: "Helvetica Neue", Arial;
|
|
3573
3573
|
font-size: 14px;
|
|
@@ -4064,7 +4064,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4064
4064
|
width: 164px;
|
|
4065
4065
|
}
|
|
4066
4066
|
}
|
|
4067
|
-
`,
|
|
4067
|
+
`,Pu=p`
|
|
4068
4068
|
.type-hey__list {
|
|
4069
4069
|
width: 280px;
|
|
4070
4070
|
height: 300px;
|
|
@@ -4222,7 +4222,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4222
4222
|
.title-bold {
|
|
4223
4223
|
font-weight: 700;
|
|
4224
4224
|
}
|
|
4225
|
-
`,
|
|
4225
|
+
`,Iu=p`
|
|
4226
4226
|
.vertical-pill-list {
|
|
4227
4227
|
position: relative;
|
|
4228
4228
|
display: flex;
|
|
@@ -4295,7 +4295,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4295
4295
|
justify-content: center;
|
|
4296
4296
|
align-items: center;
|
|
4297
4297
|
}
|
|
4298
|
-
`;var
|
|
4298
|
+
`;var Nu=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 Mu=class extends ue{constructor(){super(...arguments),this.text="Submit",this.isLoading=!1,this.disabled=!1,this.height="initial",this.width="initial",this.focus=()=>{var e,t;null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===t||t.focus()},this.render=()=>H`<button
|
|
4299
4299
|
class=${go()("action-confirm-button",{loading:this.isLoading})}
|
|
4300
4300
|
@click=${this.isLoading?null:this.onClick}
|
|
4301
4301
|
?disabled=${this.disabled}
|
|
@@ -4307,7 +4307,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4307
4307
|
<div></div>
|
|
4308
4308
|
<div></div>
|
|
4309
4309
|
</div>`:this.text}
|
|
4310
|
-
</button>`}};
|
|
4310
|
+
</button>`}};Mu.shadowRootOptions={...ue.shadowRootOptions,delegatesFocus:!0},Mu.styles=[p`
|
|
4311
4311
|
.action-confirm-button {
|
|
4312
4312
|
display: flex;
|
|
4313
4313
|
justify-content: center;
|
|
@@ -4382,7 +4382,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4382
4382
|
transform: rotate(360deg);
|
|
4383
4383
|
}
|
|
4384
4384
|
}
|
|
4385
|
-
`],
|
|
4385
|
+
`],Nu([pe()],Mu.prototype,"onClick",void 0),Nu([pe()],Mu.prototype,"text",void 0),Nu([pe({attribute:!1})],Mu.prototype,"isLoading",void 0),Nu([pe({type:Boolean})],Mu.prototype,"disabled",void 0),Nu([pe({type:String})],Mu.prototype,"height",void 0),Nu([pe({type:String})],Mu.prototype,"width",void 0),Mu=Nu([ce("action-confirm-button")],Mu);var Du=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 Lu=class extends ue{constructor(){super(...arguments),this.height="425px",this.width="326px",this.useRoundedBorders=!0,this.headerText="",this.isMobileSized=Ir(),this.useGradientDesign=!1,this._onWindowResize=()=>this.fitAboveBottom()}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=Nr(e=>{this.isMobileSized=e}),window.addEventListener("resize",this._onWindowResize)}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}updated(){this.fitAboveBottom()}fitAboveBottom(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("details-window-inner");if(!t)return;const n=t.getBoundingClientRect().bottom,i=getComputedStyle(t),r=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),o=Math.min(window.innerHeight-40,n-16)-r;t.style.maxHeight=n>0?`${Math.max(200,o)}px`:""}render(){return H`
|
|
4386
4386
|
<div
|
|
4387
4387
|
id="details-window-inner"
|
|
4388
4388
|
class="details-window-wrapper"
|
|
@@ -4422,7 +4422,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4422
4422
|
</div>
|
|
4423
4423
|
<slot class="details-window__slot-content"></slot>
|
|
4424
4424
|
</div>
|
|
4425
|
-
`}};
|
|
4425
|
+
`}};Lu.styles=p`
|
|
4426
4426
|
.details-window-wrapper {
|
|
4427
4427
|
background: rgba(255, 255, 255, 0.9);
|
|
4428
4428
|
box-shadow: 0px 0px 14px 5px rgba(0, 0, 0, 0.25);
|
|
@@ -4490,7 +4490,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4490
4490
|
border-radius: 0px 0px 0px 0px;
|
|
4491
4491
|
}
|
|
4492
4492
|
}
|
|
4493
|
-
`,
|
|
4493
|
+
`,Du([pe({type:String})],Lu.prototype,"height",void 0),Du([pe({type:String})],Lu.prototype,"width",void 0),Du([pe({type:Boolean})],Lu.prototype,"useRoundedBorders",void 0),Du([pe({type:String})],Lu.prototype,"headerText",void 0),Du([pe({attribute:!1})],Lu.prototype,"onCloseClick",void 0),Du([fe()],Lu.prototype,"isMobileSized",void 0),Du([pe({attribute:!0})],Lu.prototype,"useGradientDesign",void 0),Lu=Du([ce("details-window")],Lu);var Ru=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 Bu=class extends ue{constructor(){super(...arguments),this.trapOverlayTab=e=>{cu(e,this)},this.leadSources=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.buildingName="",this.orgLegalName="",this.country=null,this.buildingState=null,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.featureFlagShowDropdown="",this.brokerIntakeEnabled=!1,this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.message="",this.isBrokerReferral=!1,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerFirmName="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneCountry=null,this.brokerPhoneIsValid=!1,this.hasBrokerPhoneError=!1,this.currentLeadSource="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasSubmittedForm=!1,this.isKnownBroker=!1,this.windowHeight=525,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangeFirstName=e=>{e.target&&(this.firstName=e.target.value)},this.onChangeLastName=e=>{e.target&&(this.lastName=e.target.value)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangePhoneNumber=e=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country},this.onChangeBrokerPhone=e=>{this.brokerPhone=e.detail.formattedValue,this.brokerPhoneE164=e.detail.e164,this.brokerPhoneCountry=e.detail.country,this.brokerPhoneIsValid=e.detail.isValid},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.onToggleBrokerReferral=e=>{const t=e.target.checked,n=!(this.brokerFirstName||this.brokerLastName||this.brokerEmail||this.brokerPhone);t&&n?(this.brokerFirstName=this.firstName,this.brokerLastName=this.lastName,this.brokerEmail=this.email,this.brokerPhone=this.phoneNumber,this.brokerPhoneE164=this.phoneNumberE164,this.brokerPhoneCountry=this.phoneCountry,this.brokerPhoneIsValid=!!this.phoneNumberE164,this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.phoneNumberE164=null):t||this.firstName||this.lastName||this.email||this.phoneNumber||(this.firstName=this.brokerFirstName,this.lastName=this.brokerLastName,this.email=this.brokerEmail,this.phoneNumber=this.brokerPhone,this.phoneNumberE164=this.brokerPhoneE164,this.phoneCountry=this.brokerPhoneCountry,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneIsValid=!1),this.isBrokerReferral=t,this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasBrokerPhoneError=!1,this.windowHeight=this.baseHeight()+30*this.getNumErrors()},this.onChangeBrokerField=e=>t=>{t.target&&(this[e]=t.target.value)},this.baseHeight=()=>525+(this.brokerIntakeEnabled&&this.isBrokerReferral?143:0),this.brokerReferral=()=>{var e;return this.brokerIntakeEnabled&&this.isBrokerReferral?ra(this.brokerFirstName,this.brokerLastName,this.brokerEmail,this.brokerFirmName,null!==(e=this.brokerPhoneE164)&&void 0!==e?e:""):null},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasBrokerPhoneError=!1;const e=this.brokerReferral();e&&(this.hasBrokerNameError=oa(e),this.brokerEmailError=aa(e,this.email),this.hasBrokerPhoneError=!!this.brokerPhone&&!this.brokerPhoneIsValid),this.firstName&&this.lastName||(this.hasNameError=!0),this.email&&Lr(this.email)||(this.hasEmailError=!0),this.phoneNumberE164||(this.hasPhoneNumberError=!0),this.windowHeight=this.baseHeight()+30*this.getNumErrors()},this.onClick=async()=>{var e,t,n,i,r,o;if(this.isSubmitting)return;if(this.validateFormFields(),this.hasNameError||this.hasEmailError||this.hasPhoneNumberError||this.hasMessageError||this.hasBrokerNameError||this.brokerEmailError||this.hasBrokerPhoneError)return;const a=this.phoneNumberE164;if(a)try{this.isSubmitting=!0,this.windowHeight=this.baseHeight()+60;const s=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource,{knownBroker:l}=await Uu(this.firstName,this.lastName,this.email,a,this.message,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(s?[s,da(this.orgSlug)]:[da(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(n=this.selectedLeadSource)||void 0===n?void 0:n.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}),this.brokerReferral());null===(i=this.leadSourceClient)||void 0===i||i.checkAndHandleForLogLeadSource({webchatAction:"email-us",stateId:null}),null===(r=this.leadSourceClient)||void 0===r||r.resetLeadSource(),null===(o=this.leadSourceMultitouchClient)||void 0===o||o.resetLeadSourceTouchpoints(),this.isKnownBroker=l,this.hasSubmittedForm=!0,this.isSubmitting=!1,this.windowHeight=this.baseHeight()}catch(e){this.hasSubmissionError=!0,this.isSubmitting=!1,this.windowHeight=this.baseHeight()}else this.hasPhoneNumberError=!0},this.getNumErrors=()=>[this.hasNameError,this.hasEmailError,this.hasPhoneNumberError,this.hasMessageError,this.hasSubmissionError,this.hasBrokerNameError,!!this.brokerEmailError,this.hasBrokerPhoneError].filter(e=>e).length,this.renderBrokerToggle=()=>H`
|
|
4494
4494
|
<label class="email-us__broker-toggle">
|
|
4495
4495
|
<span>Are you a broker or locator?</span>
|
|
4496
4496
|
<input
|
|
@@ -4563,7 +4563,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4563
4563
|
<div class="email-us__vertical-spacer"></div>
|
|
4564
4564
|
<div class="email-us__section-label">Your client</div>
|
|
4565
4565
|
`:""}
|
|
4566
|
-
`},this.render=()=>{var e;return window.customElements.get("details-window")||window.customElements.define("details-window",
|
|
4566
|
+
`},this.render=()=>{var e;return window.customElements.get("details-window")||window.customElements.define("details-window",Lu),window.customElements.get("action-confirm-button")||window.customElements.define("action-confirm-button",Mu),this.hasSubmittedForm?H`
|
|
4567
4567
|
<details-window
|
|
4568
4568
|
id="details-window"
|
|
4569
4569
|
headerText=""
|
|
@@ -4688,7 +4688,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4688
4688
|
|
|
4689
4689
|
${na({buildingName:this.buildingName,phoneNumberInput:this.phoneNumber,emailInput:this.email,orgLegalName:this.orgLegalName,orgSlug:this.orgSlug,country:this.country,buildingState:this.buildingState,clickingButtonText:"send"})}
|
|
4690
4690
|
</details-window>
|
|
4691
|
-
`}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab)}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}async firstUpdated(){var e;await(null===(e=this.renderRoot.querySelector("details-window"))||void 0===e?void 0:e.updateComplete),this.isConnected&&du(this,this.renderRoot.querySelector("#email-us-form"))}showLeadSourceSelect(){return!(this.brokerIntakeEnabled&&this.isBrokerReferral)&&this.leadSources.length>0&&(this.featureFlagShowDropdown===bo.always||this.featureFlagShowDropdown===bo.onAttributionFailure&&0===this.currentLeadSource.length)}};
|
|
4691
|
+
`}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab)}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}async firstUpdated(){var e;await(null===(e=this.renderRoot.querySelector("details-window"))||void 0===e?void 0:e.updateComplete),this.isConnected&&du(this,this.renderRoot.querySelector("#email-us-form"))}showLeadSourceSelect(){return!(this.brokerIntakeEnabled&&this.isBrokerReferral)&&this.leadSources.length>0&&(this.featureFlagShowDropdown===bo.always||this.featureFlagShowDropdown===bo.onAttributionFailure&&0===this.currentLeadSource.length)}};Bu.styles=[p`
|
|
4692
4692
|
.email-us__name-input,
|
|
4693
4693
|
.email-us__contact_input,
|
|
4694
4694
|
.email-us_message-input {
|
|
@@ -4829,11 +4829,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4829
4829
|
width: 50%;
|
|
4830
4830
|
}
|
|
4831
4831
|
}
|
|
4832
|
-
`,Me],
|
|
4832
|
+
`,Me],Ru([pe({attribute:!1})],Bu.prototype,"leadSources",void 0),Ru([pe({attribute:!1})],Bu.prototype,"onCloseClicked",void 0),Ru([pe({attribute:!0})],Bu.prototype,"chatId",void 0),Ru([pe({attribute:!1})],Bu.prototype,"buildingId",void 0),Ru([pe({attribute:!0})],Bu.prototype,"buildingSlug",void 0),Ru([pe({attribute:!0})],Bu.prototype,"orgSlug",void 0),Ru([pe({attribute:!0})],Bu.prototype,"buildingName",void 0),Ru([pe({attribute:!0})],Bu.prototype,"orgLegalName",void 0),Ru([pe({attribute:!1})],Bu.prototype,"country",void 0),Ru([pe({attribute:!1})],Bu.prototype,"buildingState",void 0),Ru([pe({attribute:!0})],Bu.prototype,"leadSourceClient",void 0),Ru([pe({attribute:!0})],Bu.prototype,"leadSourceMultitouchClient",void 0),Ru([pe({attribute:!0})],Bu.prototype,"featureFlagShowDropdown",void 0),Ru([pe({attribute:!1})],Bu.prototype,"brokerIntakeEnabled",void 0),Ru([pe()],Bu.prototype,"privatePolicyUrl",void 0),Ru([pe()],Bu.prototype,"termsOfServiceUrl",void 0),Ru([fe()],Bu.prototype,"firstName",void 0),Ru([fe()],Bu.prototype,"lastName",void 0),Ru([fe()],Bu.prototype,"email",void 0),Ru([fe()],Bu.prototype,"phoneNumber",void 0),Ru([fe()],Bu.prototype,"phoneNumberE164",void 0),Ru([fe()],Bu.prototype,"phoneCountry",void 0),Ru([fe()],Bu.prototype,"message",void 0),Ru([fe()],Bu.prototype,"isBrokerReferral",void 0),Ru([fe()],Bu.prototype,"brokerFirstName",void 0),Ru([fe()],Bu.prototype,"brokerLastName",void 0),Ru([fe()],Bu.prototype,"brokerEmail",void 0),Ru([fe()],Bu.prototype,"brokerFirmName",void 0),Ru([fe()],Bu.prototype,"brokerPhone",void 0),Ru([fe()],Bu.prototype,"brokerPhoneE164",void 0),Ru([fe()],Bu.prototype,"brokerPhoneCountry",void 0),Ru([fe()],Bu.prototype,"brokerPhoneIsValid",void 0),Ru([fe()],Bu.prototype,"hasBrokerPhoneError",void 0),Ru([ge("me-select#leadSource")],Bu.prototype,"selectedLeadSource",void 0),Ru([pe({attribute:!0})],Bu.prototype,"currentLeadSource",void 0),Ru([fe()],Bu.prototype,"hasNameError",void 0),Ru([fe()],Bu.prototype,"hasEmailError",void 0),Ru([fe()],Bu.prototype,"hasPhoneNumberError",void 0),Ru([fe()],Bu.prototype,"hasMessageError",void 0),Ru([fe()],Bu.prototype,"hasBrokerNameError",void 0),Ru([fe()],Bu.prototype,"brokerEmailError",void 0),Ru([fe()],Bu.prototype,"hasSubmittedForm",void 0),Ru([fe()],Bu.prototype,"isKnownBroker",void 0),Ru([fe()],Bu.prototype,"windowHeight",void 0),Ru([fe()],Bu.prototype,"hasSubmissionError",void 0),Ru([fe()],Bu.prototype,"isSubmitting",void 0),Bu=Ru([ce("email-us-window")],Bu);const Uu=async(e,t,n,i,o,a,s,u,d,c,h,p)=>{var f;const g=new URLSearchParams(window.location.search),m={email_address:n,building_id:a,lead_sources:d,first_message:o,first_name:e,last_name:t,phone_number:i,referrer:document.referrer,query_params:Object.fromEntries(g.entries()),conversation_tracking_id:c,tracking_params:l(s),lead_sources_with_timestamps:(null!=h?h:[]).map(e=>_r({...e})),...sa(p)};Lo("emailUsSubmitted",{firstName:e,lastName:t,email:n,phone:i,message:o,originatingSource:d.find(e=>"property-website"!==e)||null,conversationTrackingId:null!=c?c:null,...p?{isBrokerReferral:!0}:{}});return{knownBroker:!0===(null===(f=(await r().post("https://app.meetelise.com/platformApi/state/create/emailMe",m,{headers:{"building-slug":u,"org-slug":s,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})).data)||void 0===f?void 0:f.known_broker)}},ju=(e="white")=>z`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
|
|
4833
4833
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.95487 2.54301e-07H7.04513C8.51534 -1.22821e-05 9.67985 -2.22686e-05 10.5912 0.121084C11.5292 0.24572 12.2883 0.508324 12.887 1.10005C13.4857 1.69178 13.7514 2.44211 13.8775 3.36914C14 4.26992 14 5.42089 14 6.874V10.126C14 11.5791 14 12.7301 13.8775 13.6309C13.7514 14.5579 13.4857 15.3082 12.887 15.8999C12.2883 16.4917 11.5292 16.7543 10.5912 16.8789C9.67985 17 8.51534 17 7.04513 17H6.95487C5.48466 17 4.32015 17 3.40878 16.8789C2.47084 16.7543 1.71169 16.4917 1.11299 15.8999C0.514304 15.3082 0.248611 14.5579 0.122508 13.6309C-2.25306e-05 12.7301 -1.24266e-05 11.5791 2.57292e-07 10.126V6.87399C-1.24266e-05 5.42088 -2.25306e-05 4.26992 0.122508 3.36914C0.248611 2.44211 0.514304 1.69178 1.11299 1.10005C1.71169 0.508324 2.47084 0.24572 3.40878 0.121084C4.32015 -2.22686e-05 5.48466 -1.22821e-05 6.95487 2.54301e-07ZM2.85118 1.44157C2.45996 1.55714 2.18378 1.71904 1.96152 1.93871C1.62295 2.27335 1.42002 2.73167 1.31181 3.52718C1.20127 4.33975 1.2 5.41089 1.2 6.9186V10.0814C1.2 11.5891 1.20127 12.6602 1.31181 13.4728C1.42002 14.2683 1.62295 14.7267 1.96152 15.0613C2.30009 15.3959 2.76381 15.5965 3.56868 15.7034C4.39081 15.8127 5.47454 15.814 7 15.814C8.52546 15.814 9.60919 15.8127 10.4313 15.7034C11.2362 15.5965 11.6999 15.3959 12.0385 15.0613C12.377 14.7267 12.58 14.2683 12.6882 13.4728C12.7987 12.6602 12.8 11.5891 12.8 10.0814V6.9186C12.8 5.41089 12.7987 4.33975 12.6882 3.52718C12.58 2.73167 12.377 2.27335 12.0385 1.93871C11.8162 1.71905 11.54 1.55714 11.1488 1.44157C10.6194 2.22728 10.2493 2.77349 9.69896 3.1115C9.58916 3.17894 9.47507 3.23928 9.3574 3.29217C8.76366 3.55903 8.09363 3.55868 7.12834 3.55818C7.08613 3.55816 7.04336 3.55814 7 3.55814C6.95664 3.55814 6.91387 3.55816 6.87166 3.55818C5.90637 3.55868 5.23634 3.55903 4.6426 3.29217C4.52493 3.23928 4.41084 3.17894 4.30104 3.1115C3.75069 2.77349 3.38057 2.22729 2.85118 1.44157ZM4.16103 1.2383C4.51629 1.74715 4.70232 1.96157 4.9344 2.10411C5.00028 2.14457 5.06873 2.18078 5.13933 2.21251C5.46646 2.35954 5.85406 2.37209 7 2.37209C8.14594 2.37209 8.53354 2.35954 8.86066 2.21251C8.93127 2.18078 8.99972 2.14457 9.0656 2.10411C9.29768 1.96157 9.48371 1.74715 9.83897 1.2383C9.10278 1.18681 8.18457 1.18605 7 1.18605C5.81543 1.18605 4.89722 1.18681 4.16103 1.2383ZM4 14.0349C4 13.7074 4.26863 13.4419 4.6 13.4419H9.4C9.73137 13.4419 10 13.7074 10 14.0349C10 14.3624 9.73137 14.6279 9.4 14.6279H4.6C4.26863 14.6279 4 14.3624 4 14.0349Z" fill="${e}"/>
|
|
4834
|
-
</svg>`,
|
|
4834
|
+
</svg>`,Fu={},Hu=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],zu=async e=>{const t=await(async e=>{if(Fu[e])return Fu[e];const t=`https://app.meetelise.com/platformApi/connectors/talk_js/leasing_office_hours/${e}`,n=await r().get(t);return Fu[e]=n.data,n.data})(e);return Hu.map(e=>{const n=t[e];return n?{dayOfWeek:e,startTime:n.start,endTime:n.end}:e})};var Gu=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 Vu=class extends ue{constructor(){super(...arguments),this.trapOverlayTab=e=>{cu(e,this)},this.buildingSlug="",this.orgSlug="",this.phoneNumberToCall="",this.phoneNumberToText="",this.buildingId=0,this.buildingName="",this.chatCallUsHeader="",this.hasCallUsEnabled="",this.hasTextUsEnabled="",this.currentLeadSource="",this.orgLegalName="",this.country=null,this.buildingState=null,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.phoneNumberInputRef=Oe(),this.hasSubmittedForm=!1,this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.submittingTextUsOption=!1,this.officeHoursTextInfo=[],this.firstUpdated=async()=>{var e;await(null===(e=this.renderRoot.querySelector("details-window"))||void 0===e?void 0:e.updateComplete),this.isConnected&&du(this,this.renderRoot.querySelector("#call-us-window__content-wrapper")),this.buildingId&&this.hasCallUsEnabled&&(this.officeHoursTextInfo=await zu(this.buildingId))},this.getCallLink=e=>{const t=(e.match(/\d+/g)||[]).join(""),n=t.length<11?`1${t}`:t,i=`+${n[0]}-${n.slice(1,4)}-${n.slice(4,7)}-${n.slice(7)}`;return H`<a href="tel:${i}"
|
|
4835
4835
|
>${e}</a
|
|
4836
|
-
>`},this.enforcePhoneFormat=e=>{(e=>{const t=e.keyCode;return t>=48&&t<=57||t>=96&&t<=105})(e)||qn(e)||e.preventDefault()},this.onSubmitTextUs=async()=>{var e,t,n,i,r;if(this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.phoneNumberToText&&14===this.phoneNumberToText.length||(this.hasPhoneNumberError=!0),!this.hasPhoneNumberError)try{this.submittingTextUsOption=!0,await
|
|
4836
|
+
>`},this.enforcePhoneFormat=e=>{(e=>{const t=e.keyCode;return t>=48&&t<=57||t>=96&&t<=105})(e)||qn(e)||e.preventDefault()},this.onSubmitTextUs=async()=>{var e,t,n,i,r;if(this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.phoneNumberToText&&14===this.phoneNumberToText.length||(this.hasPhoneNumberError=!0),!this.hasPhoneNumberError)try{this.submittingTextUsOption=!0,await Wu(this.phoneNumberToText,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(this.currentLeadSource?[this.currentLeadSource,da(this.orgSlug)]:[da(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null})),null===(n=this.leadSourceClient)||void 0===n||n.checkAndHandleForLogLeadSource({webchatAction:"text-us",stateId:null}),null===(i=this.leadSourceClient)||void 0===i||i.resetLeadSource(),null===(r=this.leadSourceMultitouchClient)||void 0===r||r.resetLeadSourceTouchpoints(),this.hasSubmittedForm=!0,this.submittingTextUsOption=!1}catch(e){this.submittingTextUsOption=!1,this.hasSubmissionError=!0}},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(qn(e))return;const t=e.target;this.phoneNumberToText=Wn(t.value),this.phoneNumberInputRef.value.value=this.phoneNumberToText},this.renderFormTextUsOption=()=>H` <div class="text-us-wrapper">
|
|
4837
4837
|
<h1 class="text-us-window__header">Send Us a Text</h1>
|
|
4838
4838
|
<div class="text-us-window__input-container">
|
|
4839
4839
|
<input
|
|
@@ -4960,7 +4960,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4960
4960
|
Contact Our Leasing Team
|
|
4961
4961
|
</h1>
|
|
4962
4962
|
<div class="call-us-window__phone-redirect">
|
|
4963
|
-
${
|
|
4963
|
+
${ju("black")}
|
|
4964
4964
|
${this.getCallLink(this.phoneNumberToCall)}
|
|
4965
4965
|
</div>
|
|
4966
4966
|
<div class="call-us-window__office-hours-wrapper">
|
|
@@ -4986,7 +4986,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4986
4986
|
</div>`:""}
|
|
4987
4987
|
${this.hasTextUsEnabled?this.hasSubmittedForm?this.renderSubmittedTextUsOption():this.renderFormTextUsOption():""}
|
|
4988
4988
|
</details-window>
|
|
4989
|
-
`}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab)}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}};
|
|
4989
|
+
`}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab)}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}};Vu.styles=[Me,p`
|
|
4990
4990
|
#call-us-window__content-wrapper {
|
|
4991
4991
|
font-family: "Helvetica Neue", Arial;
|
|
4992
4992
|
font-style: normal;
|
|
@@ -5091,8 +5091,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5091
5091
|
.text-us-window__error {
|
|
5092
5092
|
color: rgb(255, 49, 3);
|
|
5093
5093
|
}
|
|
5094
|
-
`],
|
|
5095
|
-
<div class="panel" ?hidden=${!this.open}><slot></slot></div>`}};
|
|
5094
|
+
`],Gu([pe({attribute:!0})],Vu.prototype,"buildingSlug",void 0),Gu([pe({attribute:!0})],Vu.prototype,"orgSlug",void 0),Gu([pe({attribute:!1})],Vu.prototype,"onCloseClicked",void 0),Gu([pe()],Vu.prototype,"phoneNumberToCall",void 0),Gu([pe()],Vu.prototype,"phoneNumberToText",void 0),Gu([pe({attribute:!1})],Vu.prototype,"buildingId",void 0),Gu([pe({attribute:!1})],Vu.prototype,"buildingName",void 0),Gu([pe({attribute:!0})],Vu.prototype,"chatCallUsHeader",void 0),Gu([pe({attribute:!0})],Vu.prototype,"hasCallUsEnabled",void 0),Gu([pe({attribute:!0})],Vu.prototype,"hasTextUsEnabled",void 0),Gu([pe({attribute:!0})],Vu.prototype,"currentLeadSource",void 0),Gu([pe({attribute:!0})],Vu.prototype,"orgLegalName",void 0),Gu([pe({attribute:!1})],Vu.prototype,"country",void 0),Gu([pe({attribute:!1})],Vu.prototype,"buildingState",void 0),Gu([pe({attribute:!0})],Vu.prototype,"leadSourceClient",void 0),Gu([pe({attribute:!0})],Vu.prototype,"leadSourceMultitouchClient",void 0),Gu([fe()],Vu.prototype,"hasSubmittedForm",void 0),Gu([fe()],Vu.prototype,"hasPhoneNumberError",void 0),Gu([fe()],Vu.prototype,"hasSubmissionError",void 0),Gu([fe()],Vu.prototype,"submittingTextUsOption",void 0),Gu([pe({attribute:!1})],Vu.prototype,"officeHoursTextInfo",void 0),Vu=Gu([ce("call-us-window")],Vu);const Wu=async(e,t,n,i,o,a,s)=>{const u="+1"+e.replace("(","").replace(")","").replace(" ","").replace("-",""),d=new URLSearchParams(window.location.search),c={building_id:t,lead_sources:o,phone_number:u,referrer:document.referrer,query_params:Object.fromEntries(d.entries()),conversation_tracking_id:a,tracking_params:l(n),lead_sources_with_timestamps:(null!=s?s:[]).map(e=>_r({...e}))};Lo("textUsSubmitted",{phone:u,originatingSource:o.find(e=>"property-website"!==e)||null,conversationTrackingId:null!=a?a:null}),await r().post("https://app.meetelise.com/platformApi/state/create/textMe",c,{headers:{"building-slug":i,"org-slug":n,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})};var Qu=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 qu=class extends ue{constructor(){super(...arguments),this.open=!1,this.inline=!1,this.onDocumentClick=e=>{!this.open||this.inline||e.composedPath().includes(this)||this.requestClose()},this.onFocusout=e=>{const t=e.relatedTarget;this.open&&!this.inline&&t instanceof Node&&!this.contains(t)&&this.requestClose()},this.onKeydown=e=>{var t;this.open&&"Escape"===e.key&&!e.isComposing&&(e.preventDefault(),e.stopPropagation(),this.requestClose(),null===(t=this.querySelector('[slot="trigger"]'))||void 0===t||t.focus())}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick),this.addEventListener("keydown",this.onKeydown),this.addEventListener("focusout",this.onFocusout)}disconnectedCallback(){document.removeEventListener("click",this.onDocumentClick),this.removeEventListener("keydown",this.onKeydown),this.removeEventListener("focusout",this.onFocusout),super.disconnectedCallback()}requestClose(){this.dispatchEvent(new CustomEvent("popover-close"))}render(){return H`<slot name="trigger"></slot>
|
|
5095
|
+
<div class="panel" ?hidden=${!this.open}><slot></slot></div>`}};qu.styles=p`
|
|
5096
5096
|
/* New element, from me-select's list surface and the picker's card border. */
|
|
5097
5097
|
:host {
|
|
5098
5098
|
display: inline-block;
|
|
@@ -5133,7 +5133,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5133
5133
|
[hidden] {
|
|
5134
5134
|
display: none;
|
|
5135
5135
|
}
|
|
5136
|
-
`,
|
|
5136
|
+
`,Qu([pe({type:Boolean,reflect:!0})],qu.prototype,"open",void 0),Qu([pe({type:Boolean,reflect:!0})],qu.prototype,"inline",void 0),qu=Qu([ce("scheduler-popover")],qu);const Yu=p`
|
|
5137
5137
|
:host {
|
|
5138
5138
|
display: block;
|
|
5139
5139
|
}
|
|
@@ -5246,7 +5246,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5246
5246
|
margin-right: 8px;
|
|
5247
5247
|
}
|
|
5248
5248
|
}
|
|
5249
|
-
`,
|
|
5249
|
+
`,Ku=p`
|
|
5250
5250
|
:host {
|
|
5251
5251
|
display: block;
|
|
5252
5252
|
}
|
|
@@ -5423,12 +5423,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5423
5423
|
overflow-x: auto;
|
|
5424
5424
|
}
|
|
5425
5425
|
}
|
|
5426
|
-
`,
|
|
5426
|
+
`,Xu=e=>({building_id:e.building_id,name:e.name,address:e.address,timezone:e.timezone,bedrooms:e.bedrooms}),Zu=e=>e?[e.line1,e.city,e.state].filter(Boolean).join(", "):"";class Ju extends Error{constructor(e,t,n){super(n),this.status=e,this.code=t,this.name="TourApiError"}}const ed=({orgSlug:e,buildingSlug:t,getSessionToken:n,host:i="https://app.meetelise.com"})=>{const o=`${i}/platformApi/webchat`,a=()=>{var i;return{"X-Session-Token":null!==(i=n())&&void 0!==i?i:"","org-slug":e,"building-slug":t}},s=async e=>{try{return(await e()).data}catch(e){throw(e=>{var t,n,i,r,o;const a=e,s=null===(n=null===(t=a.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error;return new Ju(null!==(r=null===(i=a.response)||void 0===i?void 0:i.status)&&void 0!==r?r:0,null!==(o=null==s?void 0:s.code)&&void 0!==o?o:null,(null==s?void 0:s.message)||"Something went wrong. Please try again.")})(e)}};return{getCommunities:e=>s(()=>r().get(`${o}/tour-communities?${(e=>{const t=new URLSearchParams;return e.bedrooms.forEach(e=>t.append("bedrooms",String(e))),e.moveIn&&t.set("move_in",e.moveIn),null!==e.maxBudget&&t.set("max_budget",String(e.maxBudget)),e.extend&&(t.set("available_after",e.extend.availableAfter),t.set("tour_type",e.extend.tourType),t.set("near_building_id",String(e.extend.nearBuildingId)),e.extend.excludeBuildingIds.forEach(e=>t.append("exclude_building_ids",String(e)))),t})(e)}`,{headers:a()})),plan:e=>s(()=>r().post(`${o}/tour-itineraries/plan`,e,{headers:a()})),book:(e,t)=>s(()=>r().post(`${o}/tour-itineraries`,e,{headers:{...a(),"Idempotency-Key":t}}))}},td=e=>e.slice(0,10),nd=e=>e.slice(11,16),id=e=>{const[t,n]=e.split(":");return{hour:parseInt(t,10),minute:n}},rd=e=>e<12?"am":"pm",od=(e,t)=>`${e%12==0?12:e%12}:${t}`,ad=e=>{const{hour:t,minute:n}=id(e);return`${od(t,n)}${rd(t)}`},sd=e=>ad(nd(e)),ld=(e,t)=>{const n=id(nd(e)),i=id(nd(t));return`${rd(n.hour)===rd(i.hour)?od(n.hour,n.minute):ad(nd(e))}–${ad(nd(t))}`},ud=e=>{const[t,n,i]=e.split("-").map(e=>parseInt(e,10));return new Date(t,n-1,i)},dd=e=>ir(ud(e),"EEE, MMM d"),cd=e=>ir(ud(e),"MMM d"),hd=e=>ir(e,"yyyy-MM-dd"),pd={"escorted-tour":{heading:"Escorted Tour",subtitle:"With an agent",icon:ga},"live-virtual-tour":{heading:"Virtual Tour",subtitle:"Over video",icon:pa},"self-guided-tour":{heading:"Self-Guided Tour",subtitle:"On your own",icon:fa}},fd=["escorted-tour","live-virtual-tour","self-guided-tour"];var gd=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};const md={bedrooms:[],moveIn:null,maxBudget:null},bd=[{value:0,label:"Studio"},{value:1,label:"1 bd"},{value:2,label:"2 bd"},{value:3,label:"3+ bd"}],yd=["bedrooms","moveIn","budget"];let vd=class extends ue{constructor(){super(...arguments),this.variant="select",this.load=null,this.initial=null,this.selected=[],this.filters=md,this.openFilter=null,this.communities=[],this.loading=!1,this.error=null,this.mobile=Ir(),this.requestId=0}connectedCallback(){super.connectedCallback(),this.cleanupMobileListener=Nr(e=>this.mobile=e)}disconnectedCallback(){var e;null===(e=this.cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}get initialPage(){return yd.some(e=>this.isFilterActive(e))?null:this.initial}willUpdate(){const e=this.initialPage;!this.hasUpdated&&e&&(this.communities=e.communities)}firstUpdated(){this.initialPage||this.reload()}async reload(){if(!this.load)return;const e=++this.requestId;this.loading=!0,this.error=null;try{const t=await this.load(this.filters);if(e!==this.requestId)return;this.communities=t.communities}catch(t){if(e!==this.requestId)return;this.error=t.message}finally{e===this.requestId&&(this.loading=!1)}}setFilters(e){this.filters={...this.filters,...e},this.dispatchEvent(new CustomEvent("filters-change",{detail:{filters:this.filters},bubbles:!0,composed:!0})),this.reload()}isSelected(e){return this.selected.some(t=>t.building_id===e)}toggle(e){e.tourable&&this.emitSelection([Xu(e)])}emitSelection(e){this.dispatchEvent(new CustomEvent("selection-change",{detail:{communities:e},bubbles:!0,composed:!0}))}heading(){return"extend"===this.variant?"Add Nearby Communities to Your Tour":"Select a Community to Tour"}isFilterActive(e){const t=this.filters;return"bedrooms"===e?t.bedrooms.length>0:"moveIn"===e?!!t.moveIn:null!==t.maxBudget}filterLabel(e){const t=this.filters;return"bedrooms"===e?t.bedrooms.length?t.bedrooms.map(e=>{var t,n;return null!==(n=null===(t=bd.find(t=>t.value===e))||void 0===t?void 0:t.label)&&void 0!==n?n:`${e} bd`}).join(", "):"Bedrooms":"moveIn"===e?t.moveIn?`Move-in ${dd(t.moveIn)}`:"Move-In Date":null!==t.maxBudget?`Up to ${Br(t.maxBudget)}`:"Budget"}renderFilterPanel(e){var t;const n=this.filters;return"bedrooms"===e?H`<div
|
|
5427
5427
|
class="floor-plan-selector-badges"
|
|
5428
5428
|
role="group"
|
|
5429
5429
|
aria-label="Bedrooms"
|
|
5430
5430
|
>
|
|
5431
|
-
${
|
|
5431
|
+
${bd.map(e=>H`<button
|
|
5432
5432
|
class=${Ce({"floor-plan-badge":!0,selected:n.bedrooms.includes(e.value)})}
|
|
5433
5433
|
aria-pressed=${String(n.bedrooms.includes(e.value))}
|
|
5434
5434
|
@click=${()=>this.setFilters({bedrooms:n.bedrooms.includes(e.value)?n.bedrooms.filter(t=>t!==e.value):[...n.bedrooms,e.value].sort()})}
|
|
@@ -5441,7 +5441,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5441
5441
|
id="move-in"
|
|
5442
5442
|
type="date"
|
|
5443
5443
|
.value=${null!==(t=n.moveIn)&&void 0!==t?t:""}
|
|
5444
|
-
@change=${e=>{this.
|
|
5444
|
+
@change=${e=>{this.closeCommittedFilter("moveIn"),this.setFilters({moveIn:e.target.value||null})}}
|
|
5445
5445
|
/>
|
|
5446
5446
|
</div>`:H`<div class="date-field">
|
|
5447
5447
|
<label for="max-budget">Max monthly rent ($)</label>
|
|
@@ -5452,10 +5452,10 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5452
5452
|
min="0"
|
|
5453
5453
|
step="50"
|
|
5454
5454
|
.value=${null===n.maxBudget?"":String(n.maxBudget)}
|
|
5455
|
-
@change=${e=>{const t=parseInt(e.target.value,10);this.
|
|
5455
|
+
@change=${e=>{const t=parseInt(e.target.value,10);this.closeCommittedFilter("budget"),this.setFilters({maxBudget:Number.isFinite(t)&&t>0?t:null})}}
|
|
5456
5456
|
/>
|
|
5457
|
-
</div>`}renderFilters(){const e=this.openFilter;return H`<div class="picker-toolbar" role="group" aria-label="Filters">
|
|
5458
|
-
${
|
|
5457
|
+
</div>`}async closeCommittedFilter(e){var t,n;this.openFilter=null,await this.updateComplete,await new Promise(e=>setTimeout(e)),document.activeElement&&document.activeElement!==document.body||null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(`[aria-controls="filter-${e}"]`))||void 0===n||n.focus()}renderFilters(){const e=this.openFilter;return H`<div class="picker-toolbar" role="group" aria-label="Filters">
|
|
5458
|
+
${yd.map(t=>H`<scheduler-popover
|
|
5459
5459
|
?open=${e===t}
|
|
5460
5460
|
?inline=${this.mobile}
|
|
5461
5461
|
@popover-close=${()=>{this.openFilter===t&&(this.openFilter=null)}}
|
|
@@ -5473,9 +5473,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5473
5473
|
${e===t?this.renderFilterPanel(t):""}
|
|
5474
5474
|
</div>
|
|
5475
5475
|
</scheduler-popover>`)}
|
|
5476
|
-
${
|
|
5476
|
+
${yd.some(e=>this.isFilterActive(e))?H`<button
|
|
5477
5477
|
class="clear-filters"
|
|
5478
|
-
@click=${()=>{this.openFilter=null,this.setFilters(
|
|
5478
|
+
@click=${()=>{this.openFilter=null,this.setFilters(md)}}
|
|
5479
5479
|
>
|
|
5480
5480
|
Clear all
|
|
5481
5481
|
</button>`:""}
|
|
@@ -5498,10 +5498,10 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5498
5498
|
>`:""}
|
|
5499
5499
|
</span>`:""}
|
|
5500
5500
|
<span class="image-card-title">${e.name}</span>
|
|
5501
|
-
<span class="image-card-subtitle">${
|
|
5501
|
+
<span class="image-card-subtitle">${Zu(e.address)}</span>
|
|
5502
5502
|
${e.tourable?i?H`<span class="next-available"
|
|
5503
5503
|
>Next available:
|
|
5504
|
-
${
|
|
5504
|
+
${dd(i.date)}${"extend"===this.variant?` · ${ad(i.time)}`:""}</span
|
|
5505
5505
|
>`:"":H`<span class="image-card-subtitle"
|
|
5506
5506
|
>${null!==(t=e.unavailable_reason)&&void 0!==t?t:""}</span
|
|
5507
5507
|
>`}
|
|
@@ -5549,7 +5549,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5549
5549
|
${this.loading?"Loading communities":`${this.communities.length} communities`}
|
|
5550
5550
|
</span>
|
|
5551
5551
|
${this.renderList()}
|
|
5552
|
-
</div>`}};
|
|
5552
|
+
</div>`}};vd.styles=[ia,Me,Ku,Yu,p`
|
|
5553
5553
|
/* New layout only: the filter chips and the card grid. */
|
|
5554
5554
|
:host {
|
|
5555
5555
|
display: block;
|
|
@@ -5735,7 +5735,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5735
5735
|
border-top: 1px solid #e7e7e7;
|
|
5736
5736
|
padding-top: 24px;
|
|
5737
5737
|
}
|
|
5738
|
-
`],
|
|
5738
|
+
`],gd([pe({type:String})],vd.prototype,"variant",void 0),gd([pe({attribute:!1})],vd.prototype,"load",void 0),gd([pe({attribute:!1})],vd.prototype,"initial",void 0),gd([pe({attribute:!1})],vd.prototype,"selected",void 0),gd([pe({attribute:!1})],vd.prototype,"filters",void 0),gd([fe()],vd.prototype,"openFilter",void 0),gd([fe()],vd.prototype,"communities",void 0),gd([fe()],vd.prototype,"loading",void 0),gd([fe()],vd.prototype,"error",void 0),gd([fe()],vd.prototype,"mobile",void 0),vd=gd([ce("community-picker")],vd);const wd=p`
|
|
5739
5739
|
.stops {
|
|
5740
5740
|
list-style: none;
|
|
5741
5741
|
margin: 0 0 12px;
|
|
@@ -5772,7 +5772,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5772
5772
|
font-size: 0.9rem;
|
|
5773
5773
|
margin: 4px 0;
|
|
5774
5774
|
}
|
|
5775
|
-
`,
|
|
5775
|
+
`,Cd=(e="currentColor")=>z`<svg
|
|
5776
5776
|
aria-hidden="true"
|
|
5777
5777
|
focusable="false"
|
|
5778
5778
|
width="16"
|
|
@@ -5788,20 +5788,20 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5788
5788
|
stroke-linecap="round"
|
|
5789
5789
|
stroke-linejoin="round"
|
|
5790
5790
|
/>
|
|
5791
|
-
</svg>`;var
|
|
5791
|
+
</svg>`;var xd=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};const $d=e=>({displayTime:sd(e),displayTimeZoned:sd(e),dateWithTimeZoneOffset:{datetime:e.slice(0,19),offset:e.slice(19)}}),Sd=(e,t,n)=>{e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))};let kd=class extends ue{constructor(){super(...arguments),this.stops=[],this.communities=new Map,this.problems=[],this.tourTypes=[],this.tourType=null,this.bookableDates=[],this.date=null,this.single=!1,this.canEditCommunities=!1,this.stopsOnly=!1,this.canAddStop=!1,this.loading=!1,this.planned=!1,this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.editingTimeFor=null,this.dragIndex=null,this.dropIndex=null,this.refocusGripOf=null}get offersKnown(){return this.planned&&!this.loading}get selectedTypeOpensLink(){var e;return!!(null===(e=this.tourTypes.find(e=>e.id===this.tourType))||void 0===e?void 0:e.opensLink)}newStopIds(){return this.stops.filter(e=>!e.fixed).map(e=>e.building_id)}name(e){var t,n;return null!==(n=null===(t=this.communities.get(e))||void 0===t?void 0:t.name)&&void 0!==n?n:""}move(e,t){const n=this.newStopIds();if(t<0||t>=n.length||e===t)return;const[i]=n.splice(e,1);n.splice(t,0,i),Sd(this,"stops-reorder",{buildingIds:n})}newIndexAt(e){var t;const n=[...this.renderRoot.querySelectorAll(".stop-item[data-index]")],i=null!==(t=n.find(t=>e<t.getBoundingClientRect().bottom))&&void 0!==t?t:n[n.length-1];return i?Number(i.dataset.index):null}updated(e){var t;e.has("stops")&&null!==this.refocusGripOf&&(null===(t=this.renderRoot.querySelector(`.grip[data-building-id="${this.refocusGripOf}"]`))||void 0===t||t.focus(),this.refocusGripOf=null)}endDrag(e){e&&null!==this.dragIndex&&null!==this.dropIndex&&this.move(this.dragIndex,this.dropIndex),this.dragIndex=null,this.dropIndex=null}renderCommunity(){var e,t,n;if(!this.single)return"";const i=null===(e=this.stops.find(e=>!e.fixed))||void 0===e?void 0:e.building_id,r=void 0===i?void 0:this.communities.get(i);return H`<h2 class="journey-header">Community</h2>
|
|
5792
5792
|
<div class="floorplan-image-card community">
|
|
5793
5793
|
<div class="section-right">
|
|
5794
5794
|
<p class="image-card-title">${null!==(t=null==r?void 0:r.name)&&void 0!==t?t:""}</p>
|
|
5795
5795
|
<p class="image-card-subtitle">
|
|
5796
|
-
${
|
|
5796
|
+
${Zu(null!==(n=null==r?void 0:r.address)&&void 0!==n?n:null)}
|
|
5797
5797
|
</p>
|
|
5798
5798
|
</div>
|
|
5799
5799
|
${this.canEditCommunities?H`<button
|
|
5800
5800
|
class="icon-button change-community"
|
|
5801
5801
|
aria-label="Change community"
|
|
5802
|
-
@click=${()
|
|
5802
|
+
@click=${()=>Sd(this,"edit-communities",{})}
|
|
5803
5803
|
>
|
|
5804
|
-
${
|
|
5804
|
+
${Cd()}
|
|
5805
5805
|
</button>`:""}
|
|
5806
5806
|
</div> `}renderTourTypes(){return H`<h2 id="tour-type-heading" class="journey-header">Tour Type</h2>
|
|
5807
5807
|
<div
|
|
@@ -5809,17 +5809,17 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5809
5809
|
role="radiogroup"
|
|
5810
5810
|
aria-labelledby="tour-type-heading"
|
|
5811
5811
|
>
|
|
5812
|
-
${this.tourTypes.map(({id:e})=>{const t=e===this.tourType,n=()
|
|
5812
|
+
${this.tourTypes.map(({id:e})=>{const t=e===this.tourType,n=()=>Sd(this,"tour-type-change",{tourType:e});return H`<tour-type-option
|
|
5813
5813
|
outlined
|
|
5814
|
-
heading=${
|
|
5815
|
-
subtitle=${
|
|
5814
|
+
heading=${pd[e].heading}
|
|
5815
|
+
subtitle=${pd[e].subtitle}
|
|
5816
5816
|
.primaryColor=${this.primaryColor}
|
|
5817
5817
|
.foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
|
|
5818
5818
|
?selected=${t}
|
|
5819
5819
|
@click=${n}
|
|
5820
5820
|
@keydown=${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),n())}}
|
|
5821
5821
|
>
|
|
5822
|
-
${
|
|
5822
|
+
${pd[e].icon(t?this.primaryColor:oi)}
|
|
5823
5823
|
</tour-type-option>`})}
|
|
5824
5824
|
</div>
|
|
5825
5825
|
${0===this.tourTypes.length&&this.offersKnown?H`<p class="explanation">
|
|
@@ -5827,20 +5827,20 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5827
5827
|
</p>`:""}`}renderDatePicker(){var e;const t=null!==(e=this.date)&&void 0!==e?e:this.bookableDates[0];return H`<date-picker
|
|
5828
5828
|
outlined
|
|
5829
5829
|
.shownMonth=${null==t?void 0:t.slice(0,7)}
|
|
5830
|
-
.availabilities=${Object.fromEntries(this.bookableDates.map(e=>[e,[
|
|
5831
|
-
.defaultDate=${this.date?
|
|
5832
|
-
@change=${e=>{const t=e.target.selectedDate;t&&
|
|
5830
|
+
.availabilities=${Object.fromEntries(this.bookableDates.map(e=>[e,[ud(e)]]))}
|
|
5831
|
+
.defaultDate=${this.date?ud(this.date):void 0}
|
|
5832
|
+
@change=${e=>{const t=e.target.selectedDate;t&&hd(t)!==this.date&&Sd(this,"date-change",{date:hd(t)})}}
|
|
5833
5833
|
></date-picker>`}renderTimePicker(e){const t=[...new Set([e.start,...e.alternatives])].sort();return H`<time-picker
|
|
5834
5834
|
selecteddateexists
|
|
5835
5835
|
.timezone=${e.timezone}
|
|
5836
|
-
.options=${t.map(
|
|
5837
|
-
.defaultSelectedTime=${
|
|
5838
|
-
@change=${t=>{const n=t.target.selectedTime;if(!n)return void(t.target.defaultSelectedTime
|
|
5836
|
+
.options=${t.map($d)}
|
|
5837
|
+
.defaultSelectedTime=${$d(e.start)}
|
|
5838
|
+
@change=${t=>{const n=t.target.selectedTime;if(!n)return void(t.target.defaultSelectedTime=$d(e.start));const i=`${n.dateWithTimeZoneOffset.datetime}${n.dateWithTimeZoneOffset.offset}`;this.editingTimeFor=null,i!==e.start&&Sd(this,"stop-time-change",{buildingId:e.building_id,start:i})}}
|
|
5839
5839
|
></time-picker>`}renderLinkPrompt(){return H`<h2 class="journey-header">Date and Time</h2>
|
|
5840
5840
|
<div id="dateAndTimeMenu">
|
|
5841
5841
|
<button
|
|
5842
5842
|
id="self-guided-redirect-bttn"
|
|
5843
|
-
@click=${()
|
|
5843
|
+
@click=${()=>Sd(this,"open-tour-link",{})}
|
|
5844
5844
|
>
|
|
5845
5845
|
View Tour Times
|
|
5846
5846
|
</button>
|
|
@@ -5854,7 +5854,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5854
5854
|
${0===this.bookableDates.length&&this.offersKnown?"No tour times in the next 30 days.":""}
|
|
5855
5855
|
</p>`}
|
|
5856
5856
|
</div>
|
|
5857
|
-
</div>`}renderStop(e,t){var n,i,r,o,a;const s=this.communities.get(e.building_id),l=this.newStopIds(),u=l.indexOf(e.building_id),d=this.editingTimeFor===e.building_id,c=!e.fixed&&l.length>1,h=!e.fixed&&e.alternatives.some(t=>t!==e.start),p=`${
|
|
5857
|
+
</div>`}renderStop(e,t){var n,i,r,o,a;const s=this.communities.get(e.building_id),l=this.newStopIds(),u=l.indexOf(e.building_id),d=this.editingTimeFor===e.building_id,c=!e.fixed&&l.length>1,h=!e.fixed&&e.alternatives.some(t=>t!==e.start),p=`${cd(td(e.start))} · ${ld(e.start,e.end)}`,f=null!==this.dragIndex;return H`<li
|
|
5858
5858
|
class=${Ce({"stop-item":!0,dragging:f&&this.dragIndex===u,"drop-target":f&&this.dropIndex===u&&this.dragIndex!==u})}
|
|
5859
5859
|
data-index=${e.fixed?V:u}
|
|
5860
5860
|
>
|
|
@@ -5900,7 +5900,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5900
5900
|
${null!==(i=null==s?void 0:s.name)&&void 0!==i?i:""}
|
|
5901
5901
|
</p>
|
|
5902
5902
|
<p class="image-card-subtitle">
|
|
5903
|
-
${
|
|
5903
|
+
${Zu(null!==(r=null==s?void 0:s.address)&&void 0!==r?r:null)}
|
|
5904
5904
|
</p>
|
|
5905
5905
|
${h?H`<button
|
|
5906
5906
|
class="stop-time edit-time"
|
|
@@ -5908,7 +5908,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5908
5908
|
aria-label=${`Change the time at ${null!==(o=null==s?void 0:s.name)&&void 0!==o?o:""}`}
|
|
5909
5909
|
@click=${()=>this.editingTimeFor=d?null:e.building_id}
|
|
5910
5910
|
>
|
|
5911
|
-
${p} ${
|
|
5911
|
+
${p} ${Cd()}
|
|
5912
5912
|
</button>`:H`<p class="stop-time">
|
|
5913
5913
|
${p}
|
|
5914
5914
|
${e.fixed?H`<span class="floor-plan-badge selected">Booked</span>`:""}
|
|
@@ -5920,7 +5920,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5920
5920
|
</li>`}renderRemove(e,t){return H`<button
|
|
5921
5921
|
class="icon-button remove"
|
|
5922
5922
|
aria-label=${`Remove ${t}`}
|
|
5923
|
-
@click=${()
|
|
5923
|
+
@click=${()=>Sd(this,"stop-remove",{buildingId:e})}
|
|
5924
5924
|
>
|
|
5925
5925
|
${((e="currentColor")=>z`<svg
|
|
5926
5926
|
aria-hidden="true"
|
|
@@ -5961,7 +5961,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5961
5961
|
${this.renderStops()}`}render(){if(this.stopsOnly)return H`${this.renderStops()}
|
|
5962
5962
|
${this.canAddStop?H`<button
|
|
5963
5963
|
class="floor-plan-badge add-stop"
|
|
5964
|
-
@click=${()
|
|
5964
|
+
@click=${()=>Sd(this,"add-stop",{})}
|
|
5965
5965
|
>
|
|
5966
5966
|
+ Add another stop
|
|
5967
5967
|
</button>`:""}`;const e=!this.selectedTypeOpensLink&&!this.single;return H`<div id="tour-type-menu-outer-container">
|
|
@@ -5970,7 +5970,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5970
5970
|
</div>
|
|
5971
5971
|
<div id="date-and-time-menu-outer-container">
|
|
5972
5972
|
${this.selectedTypeOpensLink?this.renderLinkPrompt():this.single?this.renderSingleDateAndTime():this.renderItinerary()}
|
|
5973
|
-
</div>`}};
|
|
5973
|
+
</div>`}};kd.styles=[ia,Me,Ku,Yu,wd,p`
|
|
5974
5974
|
/* New layout only: the stop list and the community card's actions. */
|
|
5975
5975
|
:host {
|
|
5976
5976
|
display: contents;
|
|
@@ -6078,7 +6078,26 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6078
6078
|
font-size: 0.7rem;
|
|
6079
6079
|
padding: 2px 8px;
|
|
6080
6080
|
}
|
|
6081
|
-
`],
|
|
6081
|
+
`],xd([pe({attribute:!1})],kd.prototype,"stops",void 0),xd([pe({attribute:!1})],kd.prototype,"communities",void 0),xd([pe({attribute:!1})],kd.prototype,"problems",void 0),xd([pe({attribute:!1})],kd.prototype,"tourTypes",void 0),xd([pe({attribute:!1})],kd.prototype,"tourType",void 0),xd([pe({attribute:!1})],kd.prototype,"bookableDates",void 0),xd([pe({attribute:!1})],kd.prototype,"date",void 0),xd([pe({type:Boolean})],kd.prototype,"single",void 0),xd([pe({type:Boolean})],kd.prototype,"canEditCommunities",void 0),xd([pe({type:Boolean})],kd.prototype,"stopsOnly",void 0),xd([pe({type:Boolean})],kd.prototype,"canAddStop",void 0),xd([pe({type:Boolean})],kd.prototype,"loading",void 0),xd([pe({type:Boolean})],kd.prototype,"planned",void 0),xd([pe({attribute:!1})],kd.prototype,"primaryColor",void 0),xd([pe({attribute:!1})],kd.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),xd([fe()],kd.prototype,"editingTimeFor",void 0),xd([fe()],kd.prototype,"dragIndex",void 0),xd([fe()],kd.prototype,"dropIndex",void 0),kd=xd([ce("itinerary-editor")],kd);var Ad=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};const Td={firstName:"",lastName:"",email:"",phone:"",phoneE164:null,phoneCountry:null,layouts:[],moveIn:"",notes:"",leadSource:null};let Ed=class extends ue{constructor(){super(...arguments),this.values=Td,this.layoutOptions=[],this.bedroomsRequired=!1,this.leadSources=[],this.showLeadSourceDropdown=!1,this.currentLeadSource="",this.country=null,this.mobile=!1,this.phoneHasBlurred=!1}setValues(e){this.values={...this.values,...e},this.dispatchEvent(new CustomEvent("contact-change",{detail:{values:this.values},bubbles:!0,composed:!0}))}inputClasses(e={}){return Ce({"webchat-input":!0,"webchat-font__desktop":!this.mobile,"webchat-font__mobile":this.mobile,...e})}renderLayouts(){const e=this.values.layouts;return H`<div class="inputContainer">
|
|
6082
|
+
<span class="section-label" id="layout-label">
|
|
6083
|
+
Bedroom preferences${this.bedroomsRequired?"":" (optional)"}
|
|
6084
|
+
</span>
|
|
6085
|
+
<div
|
|
6086
|
+
id="layout"
|
|
6087
|
+
class="floor-plan-selector-badges"
|
|
6088
|
+
role="group"
|
|
6089
|
+
aria-labelledby="layout-label"
|
|
6090
|
+
>
|
|
6091
|
+
${this.layoutOptions.map(t=>{const n=e.includes(t.value);return H`<button
|
|
6092
|
+
type="button"
|
|
6093
|
+
class=${Ce({"floor-plan-badge":!0,selected:n})}
|
|
6094
|
+
aria-pressed=${String(n)}
|
|
6095
|
+
@click=${()=>this.setValues({layouts:this.layoutOptions.map(e=>e.value).filter(i=>i===t.value?!n:e.includes(i))})}
|
|
6096
|
+
>
|
|
6097
|
+
${t.label}
|
|
6098
|
+
</button>`})}
|
|
6099
|
+
</div>
|
|
6100
|
+
</div>`}render(){var e,t;const n=this.values,i=!!n.email&&!Lr(n.email.trim()),r=this.phoneHasBlurred&&!n.phoneE164;return H`<div id="user-info-and-layout-menu-outer-container">
|
|
6082
6101
|
<h2 class="journey-header">Your Information</h2>
|
|
6083
6102
|
<div id="yourInformationMenu">
|
|
6084
6103
|
<div class="namesWrapper">
|
|
@@ -6128,13 +6147,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6128
6147
|
></international-phone-input>
|
|
6129
6148
|
${r?H`<p class="error-message">Invalid phone number</p>`:""}
|
|
6130
6149
|
</div>
|
|
6131
|
-
${this.layoutOptions.length>0?
|
|
6132
|
-
id="layout"
|
|
6133
|
-
placeholder=${this.bedroomsRequired?"Bedroom preference":"Bedroom preference (optional)"}
|
|
6134
|
-
value=${null===n.layout?"":String(n.layout)}
|
|
6135
|
-
.options=${this.layoutOptions.map(e=>({label:e.label,value:String(e.value)}))}
|
|
6136
|
-
@change=${e=>{const t=e.target.value;this.setValues({layout:t?Number(t):null})}}
|
|
6137
|
-
></me-select>`:""}
|
|
6150
|
+
${this.layoutOptions.length>0?this.renderLayouts():""}
|
|
6138
6151
|
<div class="inputContainer">
|
|
6139
6152
|
<label class="section-label" for="move-in">
|
|
6140
6153
|
Move-in date (optional)
|
|
@@ -6165,7 +6178,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6165
6178
|
@change=${e=>{var t;const n=null!==(t=e.target.value)&&void 0!==t?t:"";this.setValues({leadSource:n||null}),n&&this.dispatchEvent(new CustomEvent("lead-source-selected",{detail:{leadSource:n},bubbles:!0,composed:!0}))}}
|
|
6166
6179
|
></me-select>`:""}
|
|
6167
6180
|
</div>
|
|
6168
|
-
</div>`}};
|
|
6181
|
+
</div>`}};Ed.styles=[ia,Me,Ku,p`
|
|
6169
6182
|
:host {
|
|
6170
6183
|
display: contents;
|
|
6171
6184
|
}
|
|
@@ -6176,11 +6189,19 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6176
6189
|
gap: 4px;
|
|
6177
6190
|
}
|
|
6178
6191
|
|
|
6192
|
+
/* The filters' chips, wrapping in the column rather than scrolling. */
|
|
6193
|
+
#layout {
|
|
6194
|
+
flex-wrap: wrap;
|
|
6195
|
+
margin: 0;
|
|
6196
|
+
max-width: none;
|
|
6197
|
+
overflow: visible;
|
|
6198
|
+
}
|
|
6199
|
+
|
|
6179
6200
|
textarea {
|
|
6180
6201
|
resize: vertical;
|
|
6181
6202
|
width: 100%;
|
|
6182
6203
|
}
|
|
6183
|
-
`],
|
|
6204
|
+
`],Ad([pe({attribute:!1})],Ed.prototype,"values",void 0),Ad([pe({attribute:!1})],Ed.prototype,"layoutOptions",void 0),Ad([pe({type:Boolean})],Ed.prototype,"bedroomsRequired",void 0),Ad([pe({attribute:!1})],Ed.prototype,"leadSources",void 0),Ad([pe({type:Boolean})],Ed.prototype,"showLeadSourceDropdown",void 0),Ad([pe({type:String})],Ed.prototype,"currentLeadSource",void 0),Ad([pe({attribute:!1})],Ed.prototype,"country",void 0),Ad([pe({type:Boolean})],Ed.prototype,"mobile",void 0),Ad([fe()],Ed.prototype,"phoneHasBlurred",void 0),Ed=Ad([ce("contact-form")],Ed);var _d=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 Od=class extends ue{constructor(){super(...arguments),this.stops=[],this.tourType=null,this.rescheduled=!1}heading(){const e=this.stops.filter(e=>"failed"!==e.status).length,t=this.rescheduled?"Rescheduled":"Booked";return 1===e?`Your Tour Is ${t}`:`Your Tours Are ${t}`}summary(){const e=this.stops.filter(e=>"failed"!==e.status),t=e[0];if(!t)return"";const n=[1===e.length?t.community.name:"",this.tourType?pd[this.tourType].heading:""];if(t.start){const i=t.community.timezone?` ${pr(t.community.timezone)}`:"";n.push(1===e.length?`${cd(td(t.start))} at ${sd(t.start)}${i}`:cd(td(t.start)))}return n.filter(Boolean).join(" · ")}renderStops(){return this.stops.length<2?"":H`<ol class="stops">
|
|
6184
6205
|
${this.stops.map((e,t)=>{var n;return H`<li>
|
|
6185
6206
|
${t>0?H`<p class="image-card-subtitle leg">
|
|
6186
6207
|
${null!==e.distanceFromPrevMi?H`${e.distanceFromPrevMi.toFixed(1)} mi<span
|
|
@@ -6197,14 +6218,14 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6197
6218
|
${e.community.name}
|
|
6198
6219
|
</p>
|
|
6199
6220
|
<p class="image-card-subtitle">
|
|
6200
|
-
${
|
|
6221
|
+
${Zu(e.community.address)}
|
|
6201
6222
|
</p>
|
|
6202
6223
|
${"failed"===e.status?H`<p class="error-message">
|
|
6203
6224
|
<span class="sr-only">Not booked:</span>
|
|
6204
6225
|
${null!==(n=e.error)&&void 0!==n?n:"This tour couldn't be booked."}
|
|
6205
6226
|
</p>`:e.start&&e.end?H`<p class="stop-time">
|
|
6206
|
-
${
|
|
6207
|
-
${
|
|
6227
|
+
${cd(td(e.start))} ·
|
|
6228
|
+
${ld(e.start,e.end)}
|
|
6208
6229
|
</p>`:""}
|
|
6209
6230
|
</div>
|
|
6210
6231
|
</div>
|
|
@@ -6240,7 +6261,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6240
6261
|
</p>
|
|
6241
6262
|
${this.renderStops()}
|
|
6242
6263
|
</div>
|
|
6243
|
-
<slot></slot>`}};
|
|
6264
|
+
<slot></slot>`}};Od.styles=[ia,Me,Yu,wd,p`
|
|
6244
6265
|
/* New layout only: the header and the list of stops. */
|
|
6245
6266
|
:host {
|
|
6246
6267
|
display: block;
|
|
@@ -6287,7 +6308,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6287
6308
|
align-items: center;
|
|
6288
6309
|
min-width: 0;
|
|
6289
6310
|
}
|
|
6290
|
-
`],
|
|
6311
|
+
`],_d([pe({attribute:!1})],Od.prototype,"stops",void 0),_d([pe({attribute:!1})],Od.prototype,"tourType",void 0),_d([pe({type:Boolean})],Od.prototype,"rescheduled",void 0),Od=_d([ce("booking-confirmation")],Od);var Pd=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 Id=class extends ue{constructor(){super(...arguments),this.size=64,this.spinSpeed=.8}updated(){this.style.setProperty("--mega-loader-size",`${this.size}px`),this.style.setProperty("--mega-loader-spin-speed",`${this.spinSpeed}s`)}render(){return H`<div class="spinner"></div>`}};Id.styles=p`
|
|
6291
6312
|
.spinner {
|
|
6292
6313
|
border: 4px solid rgba(0, 0, 0, 0.2);
|
|
6293
6314
|
border-top: 4px solid var(--primary-color, #c057ff);
|
|
@@ -6305,9 +6326,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6305
6326
|
transform: rotate(360deg);
|
|
6306
6327
|
}
|
|
6307
6328
|
}
|
|
6308
|
-
`,
|
|
6329
|
+
`,Pd([pe({type:Number})],Id.prototype,"size",void 0),Pd([pe({type:Number})],Id.prototype,"spinSpeed",void 0),Id=Pd([ce("mega-loader")],Id);const Nd=(e="white")=>z`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
|
|
6309
6330
|
<path d="M3.68188 7L0.681885 4L3.68188 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6310
|
-
</svg>`,Nd=e=>{const t=Object.fromEntries(e.buildingIds.slice(1).filter(t=>e.laterStarts[t]).map(t=>[String(t),e.laterStarts[t]])),n=e.existingEventIds[e.existingEventIds.length-1];return{building_ids:e.buildingIds,tour_type:e.tourType,date:e.date,start_time:e.firstStart,stop_starts:t,fixed_first:void 0===n?null:{calendar_event_id:n}}},Md=({orgSlug:e,selectedLeadSource:t,currentLeadSource:n,touchpoints:i,search:r,referrer:o,googleReferral:a})=>{var s,l,u;const d=t||n||null,c=da(e);return{lead_sources:[...new Set(d?[d,c]:[c])],lead_sources_with_timestamps:i.map(e=>_r({...e})),query_params:Object.fromEntries(new URLSearchParams(r).entries()),referrer:o,google_rwg_token:null!==(s=null==a?void 0:a.rwgToken)&&void 0!==s?s:null,google_referral_building_id:null!==(l=null==a?void 0:a.buildingId)&&void 0!==l?l:null,google_environment:null!==(u=null==a?void 0:a.environment)&&void 0!==u?u:null}},Dd=e=>0===e?0:Math.floor(e/10),Ld=["Studio","One bedroom","Two bedroom","Three bedroom","Four bedroom","Five bedroom"],Rd=e=>{var t;return{value:10*e,label:null!==(t=Ld[e])&&void 0!==t?t:`${e} bedroom`}};var Bd=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};const Ud={bedrooms:[],moveIn:null,maxBudget:null},jd={"escorted-tour":"WITH_AGENT","self-guided-tour":"SELF_GUIDED","live-virtual-tour":"VIRTUAL_SHOWING"};let Fd=class extends ue{constructor(){super(...arguments),this.orgSlug="",this.buildingSlug="",this.buildingId=0,this.orgId=0,this.buildingName="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.tourTypeOptions=[],this.layoutOptions=[],this.currentLeadSource="",this.leadSources=[],this.featureFlagShowDropdown="",this.bedroomPreferenceRequired=!1,this.orgLegalName="",this.country=null,this.buildingState=null,this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.compactDesign=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.getSessionToken=()=>null,this.api=null,this.step="loading",this.loadError=null,this.mobile=Ir(),this.group=null,this.communities=new Map,this.selectedIds=[],this.picks=[],this.addingStop=!1,this.existingEventIds=[],this.tourType="escorted-tour",this.linkTourType=null,this.date=null,this.firstStart=null,this.laterStarts={},this.plan=null,this.planLoading=!1,this.planError=null,this.notice=null,this.contact=Ad,this.preferences=Ud,this.submitting=!1,this.bookingError=null,this.reschedulePrompt=null,this.confirmed=[],this.bookedTourType=null,this.bookedEventIds=[],this.extendInitial=null,this.extendFrom=null,this.extending=!1,this.rescheduled=!1,this.rescheduleCanceled=!1,this.planRequestId=0,this.idempotency=null,this.onKeydown=e=>{cu(e,this),"Escape"!==e.key||e.defaultPrevented||e.isComposing||(e.stopPropagation(),this.close())},this.loadSelectCommunities=e=>this.client.getCommunities(e).then(this.rememberPage),this.loadExtendCommunities=e=>{const t=this.extendFrom;return t?this.client.getCommunities({...e,extend:t}).then(this.rememberPage):Promise.reject(new Error("No booking to extend"))},this.rememberPage=e=>(this.remember(e.communities),e),this.loadAddStopCommunities=e=>{const t=this.extendQueryFromPlan();return t?this.client.getCommunities({...e,extend:t}).then(this.rememberPage):Promise.reject(new Error("No stop to add after"))},this.onFiltersChange=e=>{this.preferences=e.detail.filters}}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("aria-modal")||this.setAttribute("aria-modal","true"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Schedule a Tour"),this.cleanupMobileListener=Nr(e=>this.mobile=e),this.addEventListener("keydown",this.onKeydown)}disconnectedCallback(){var e;null===(e=this.cleanupMobileListener)||void 0===e||e.call(this),this.removeEventListener("keydown",this.onKeydown),super.disconnectedCallback()}close(){var e;null===(e=this.onCloseClicked)||void 0===e||e.call(this,new MouseEvent("click"))}get client(){return this.api||(this.api=Ju({orgSlug:this.orgSlug,buildingSlug:this.buildingSlug,getSessionToken:()=>this.getSessionToken()})),this.api}willUpdate(e){if(e.has("primaryColor")||e.has("foregroundColorOnPrimaryBackgroundColor")){const e=this.primaryColor||Zn;this.style.setProperty("--primary-color",e),this.style.setProperty("--action-confirm-button-background",e),this.style.setProperty("--action-confirm-button-color",this.foregroundColorOnPrimaryBackgroundColor),this.style.setProperty("--on-primary-color",this.foregroundColorOnPrimaryBackgroundColor)}}firstUpdated(){this.start()}updated(e){var t;e.has("step")&&void 0===e.get("step")?uu(this):((e.has("step")||e.has("reschedulePrompt")||e.has("rescheduleCanceled"))&&(this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),this.focus({preventScroll:!0})),e.has("notice")&&this.notice&&(null===(t=this.renderRoot.querySelector(".notice"))||void 0===t||t.scrollIntoView({block:"nearest"})))}async start(){this.step="loading",this.loadError=null;try{const e=await this.client.getCommunities(Ud);if(this.group=e,this.remember(e.communities),e.anchor.is_general_building)return void this.goTo("pick");this.rememberOne({building_id:e.anchor.building_id,name:e.anchor.name,address:null,timezone:null}),this.startSchedule([e.anchor.building_id])}catch(e){if(e instanceof Zu&&"NOT_IN_GROUP"===e.code)return this.group=null,this.rememberOne({building_id:this.buildingId,name:this.buildingName,address:null,timezone:null}),void this.startSchedule([this.buildingId]);this.loadError=e.message,this.step="error",this.log("TOUR_SCHEDULER_V2_LOAD_ERROR",e)}}goTo(e){this.step=e,"pick"===e?this.picks=this.selectedIds.map(e=>this.communities.get(e)).filter(e=>!!e):"booked"===e&&(this.picks=[]),Lo("tourSchedulerStepViewed",{step:"schedule"===e&&this.extending?"extend-schedule":e,buildingId:this.buildingId})}remember(e){const t=new Map(this.communities);e.forEach(e=>t.set(e.building_id,Ku(e))),this.communities=t}rememberOne(e){const t=this.communities.get(e.building_id);(null==t?void 0:t.address)||(this.communities=new Map(this.communities).set(e.building_id,e))}startSchedule(e){this.selectedIds=e,this.plan=null,this.firstStart=null,this.laterStarts={},this.linkTourType=null,this.notice=null,this.bookingError=null,this.reschedulePrompt=null,this.goTo("schedule"),this.runPlan()}choice(){var e;return{buildingIds:this.selectedIds,tourType:this.tourType,date:null!==(e=this.date)&&void 0!==e?e:cd(new Date),firstStart:this.firstStart,laterStarts:this.laterStarts,existingEventIds:this.existingEventIds}}async runPlan(e=!1){if(this.addingStop=!1,0===this.selectedIds.length)return;const t=++this.planRequestId;this.planLoading=!0,this.planError=null,e||(this.notice=null);try{let e=this.choice(),n=await this.client.plan(Nd(e));for(let i=0;i<2&&t===this.planRequestId;i++){if(n.tour_types.includes(e.tourType)){if(!(n.bookable_dates.length>0)||n.bookable_dates.includes(e.date))break;this.date=n.bookable_dates[0]}else{if(0===n.tour_types.length)break;this.tourType=n.tour_types[0]}this.firstStart=null,this.laterStarts={},e=this.choice(),n=await this.client.plan(Nd(e))}if(t!==this.planRequestId)return;this.plan=n,n.bookable_dates.includes(e.date)&&(this.date=e.date),n.changed.length>0&&(this.notice=n.changed.map(e=>e.text).join(" "))}catch(e){if(t!==this.planRequestId)return;this.planError=e.message,this.log("TOUR_SCHEDULER_V2_PLAN_ERROR",e)}finally{t===this.planRequestId&&(this.planLoading=!1)}}tourLink(e){if(!this.tourTypeOptions.map(e=>e.value).includes(jd[e]))return null;const[t,n]={"self-guided-tour":[this.sgtUrl,this.selfGuidedToursTypeOffered],"escorted-tour":[this.escortedToursLink,this.escortedToursTypeOffered],"live-virtual-tour":[this.virtualToursLink,this.virtualToursTypeOffered]}[e];return t&&va(0,n)?t:null}get bookingOwnBuildingAlone(){return 0===this.existingEventIds.length&&1===this.selectedIds.length&&this.selectedIds[0]===this.buildingId}openTourLink(e){const t=this.tourLink(e);if(!t)return;const n="self-guided-tour"===e&&52===this.orgId?Po(t,Oo()):t;window.open(n,"_blank")}tourTypeChoices(){var e,t;const n=null!==(t=null===(e=this.plan)||void 0===e?void 0:e.tour_types)&&void 0!==t?t:[];return pd.filter(e=>n.includes(e)||this.bookingOwnBuildingAlone&&!!this.tourLink(e)).map(e=>({id:e,opensLink:this.bookingOwnBuildingAlone&&!!this.tourLink(e)}))}get shownTourType(){var e;return this.linkTourType?this.linkTourType:(null===(e=this.plan)||void 0===e?void 0:e.tour_types.includes(this.tourType))?this.tourType:null}get activeLinkType(){const e=this.shownTourType;return e&&this.bookingOwnBuildingAlone&&this.tourLink(e)?e:null}onTourType(e){if(Lo("tourTypeSelected",{tourType:e,buildingId:this.buildingId}),this.bookingOwnBuildingAlone&&this.tourLink(e))return this.linkTourType=e,void this.openTourLink(e);this.linkTourType=null,e!==this.tourType&&(this.tourType=e,this.firstStart=null,this.laterStarts={},this.runPlan())}onDate(e){e!==this.date&&(Lo("tourDateSelected",{tourType:this.tourType,buildingId:this.buildingId}),this.date=e,this.firstStart=null,this.laterStarts={},this.runPlan())}onStopTime(e,t){const n=this.selectedIds.indexOf(e);if(n<0)return;Lo("tourTimeSelected",{tourType:this.tourType,buildingId:this.buildingId,stopNumber:n+1});const i=this.selectedIds.slice(1,n);0===n?(this.firstStart=td(t),this.laterStarts={}):this.laterStarts={...Object.fromEntries(i.filter(e=>this.laterStarts[e]).map(e=>[e,this.laterStarts[e]])),[e]:t},this.runPlan()}onReorder(e){Lo("tourStopsReordered",{buildingId:this.buildingId,stopCount:e.length});const t=this.selectedIds.filter(t=>!e.includes(t));this.selectedIds=[...e,...t],this.firstStart=null,this.laterStarts={},this.runPlan()}onRemove(e){const t=this.selectedIds.filter(t=>t!==e);if(Lo("tourStopRemoved",{buildingId:this.buildingId,stopCount:t.length}),0===t.length)return this.selectedIds=[],this.plan=null,void this.goTo(this.extending?"booked":"pick");this.selectedIds[0]===e&&(this.firstStart=null),this.selectedIds=t,this.laterStarts={},this.runPlan()}onEditCommunities(){this.goTo("pick")}onCommunitiesSelected(e,t){var n;if(e.forEach(e=>this.rememberOne(e)),Lo("tourCommunitiesSelected",{buildingId:this.buildingId,count:e.length,mode:t}),this.extending="extend"===t,this.extending){this.existingEventIds=this.bookedEventIds,this.tourType=null!==(n=this.bookedTourType)&&void 0!==n?n:this.tourType;const e=this.confirmed.filter(e=>e.start).slice(-1)[0];this.date=(null==e?void 0:e.start)?ed(e.start):this.date}else this.existingEventIds=[];this.startSchedule(e.map(e=>e.building_id))}async submit(e=!1){var t,n,i,r,o,a;const s=this.plan;if(!s||this.submitting)return;const l=this.choice(),u=this.formValues,d=this.showLeadSourceDropdown()?u.leadSource:null,c=(({choice:e,plan:t,contact:n,attribution:i,conversationTrackingId:r,cancelExistingTours:o})=>({tour_type:e.tourType,stops:[...e.existingEventIds.map(e=>({existing_calendar_event_id:e})),...t.stops.filter(e=>!e.fixed).map(e=>({building_id:e.building_id,start:e.start}))],...n?{contact:n}:{},lead_sources:i,conversation_tracking_id:r,cancel_existing_tours:o}))({choice:l,plan:s,contact:this.extending?null:{first_name:u.firstName.trim(),last_name:u.lastName.trim(),email:u.email.trim(),phone_e164:null!==(t=u.phoneE164)&&void 0!==t?t:"",bedrooms:null===u.layout?[]:[Dd(u.layout)],move_in:u.moveIn||null,notes:u.notes.trim()},attribution:Md({orgSlug:this.orgSlug,selectedLeadSource:d,currentLeadSource:this.currentLeadSource,touchpoints:null!==(i=null===(n=this.leadSourceMultitouchClient)||void 0===n?void 0:n.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:d||null}))&&void 0!==i?i:[],search:window.location.search,referrer:document.referrer,googleReferral:rs()}),conversationTrackingId:null!==(o=null===(r=this.leadSourceClient)||void 0===r?void 0:r.chatId)&&void 0!==o?o:null,cancelExistingTours:e}),h=JSON.stringify({tour_type:c.tour_type,stops:c.stops,contact:c.contact,cancel_existing_tours:c.cancel_existing_tours});(null===(a=this.idempotency)||void 0===a?void 0:a.booking)!==h&&(this.idempotency={booking:h,key:ms()}),Lo("scheduleTourSubmitted",{tourType:l.tourType,stopCount:c.stops.length,buildingId:this.buildingId}),this.submitting=!0,this.bookingError=null;try{const t=await this.client.book(c,this.idempotency.key);this.idempotency=null,this.rescheduled=e,this.onBooked(t,l.tourType,s)}catch(e){this.onBookingError(e)}finally{this.submitting=!1}}onBooked(e,t,n){var i,r,o,a,s,l;if(this.reschedulePrompt=null,e.stops.every(e=>"failed"===e.status))return this.notice=null!==(o=null===(r=null===(i=e.stops.find(e=>e.error))||void 0===i?void 0:i.error)||void 0===r?void 0:r.message)&&void 0!==o?o:"We couldn't book your tour. Please pick another time.",this.log("TOUR_SCHEDULER_V2_BOOKING_ERROR",e.stops),void this.runPlan(!0);const u=new Map(n.stops.map(e=>[e.building_id,e]));this.confirmed=e.stops.map(e=>{var t,n,i,r,o,a,s,l;const d=null!==(t=this.communities.get(e.building_id))&&void 0!==t?t:{building_id:e.building_id,name:"",address:null,timezone:null},c=null!==(r=null!==(n=d.timezone)&&void 0!==n?n:null===(i=u.get(e.building_id))||void 0===i?void 0:i.timezone)&&void 0!==r?r:null;return{community:{...d,timezone:c},start:e.start,end:e.end,status:e.status,error:null!==(a=null===(o=e.error)||void 0===o?void 0:o.message)&&void 0!==a?a:null,distanceFromPrevMi:null!==(l=null===(s=u.get(e.building_id))||void 0===s?void 0:s.distance_from_prev_mi)&&void 0!==l?l:null}});const d=e.stops.filter(e=>"failed"!==e.status&&null!==e.calendar_event_id);this.bookedEventIds=d.map(e=>e.calendar_event_id),this.bookedTourType=t,this.extending=!1,this.extendInitial=null,Lo("tourItineraryBooked",{buildingId:this.buildingId,stopCount:d.length,failedCount:e.stops.length-d.length}),d.length>0&&(null===(a=this.leadSourceClient)||void 0===a||a.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(s=this.leadSourceClient)||void 0===s||s.resetLeadSource(),null===(l=this.leadSourceMultitouchClient)||void 0===l||l.resetLeadSourceTouchpoints()),this.goTo("booked"),this.loadExtension()}extendQueryFromBooking(){const e=this.confirmed.filter(e=>"failed"!==e.status),t=e[e.length-1];return(null==t?void 0:t.end)&&this.bookedTourType?{availableAfter:t.end,tourType:this.bookedTourType,nearBuildingId:t.community.building_id,excludeBuildingIds:e.map(e=>e.community.building_id)}:null}stopsRemaining(){return 3-this.bookedEventIds.length}get canAddStop(){var e,t;return!this.planLoading&&!this.planError&&this.stopsRemaining()>this.selectedIds.length&&(null!==(t=null===(e=this.plan)||void 0===e?void 0:e.stops.length)&&void 0!==t?t:0)>0}extendQueryFromPlan(){var e,t;const n=null!==(t=null===(e=this.plan)||void 0===e?void 0:e.stops)&&void 0!==t?t:[],i=n[n.length-1];return i&&this.extendFrom?{...this.extendFrom,availableAfter:i.end,nearBuildingId:i.building_id,excludeBuildingIds:[...this.extendFrom.excludeBuildingIds,...this.selectedIds]}:null}onStopAdded(e){const t=e[0];t&&(this.rememberOne(t),Lo("tourCommunitiesSelected",{buildingId:this.buildingId,count:1,mode:"extend"}),this.selectedIds=[...this.selectedIds,t.building_id],this.runPlan())}async loadExtension(){const e=this.extendQueryFromBooking();this.extendFrom=e;const t=this.stopsRemaining();if(this.group&&e&&!(t<=0))try{const n=await this.client.getCommunities({...Ud,extend:e});this.remember(n.communities),n.communities.some(e=>e.tourable)&&(this.extendInitial=n,Lo("tourExtensionOffered",{buildingId:this.buildingId,stopsRemaining:t}))}catch(e){this.log("TOUR_SCHEDULER_V2_EXTEND_LOAD_ERROR",e)}}onBookingError(e){const t=e instanceof Zu?e:new Zu(0,null,"Something went wrong. Please try again.");if("EXISTING_TOUR"!==t.code){if(this.reschedulePrompt=null,"SLOT_TAKEN"===t.code)return this.notice=t.message,void this.runPlan(!0);this.bookingError=t.message,this.log("TOUR_SCHEDULER_V2_BOOKING_ERROR",e)}else this.reschedulePrompt=t.message}showLeadSourceDropdown(){return this.featureFlagShowDropdown===bo.always||this.featureFlagShowDropdown===bo.onAttributionFailure&&0===this.currentLeadSource.length}log(e,t){Ao({logTitle:e,logData:{error:t},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:t})}backStep(){return this.rescheduleCanceled?null:"schedule"===this.step?this.extending?"booked":this.group?"pick":null:"pick"===this.step&&this.group&&!this.group.anchor.is_general_building&&this.plan&&this.selectedIds.length>0?"schedule":null}problems(){var e,t;return null!==(t=null===(e=this.plan)||void 0===e?void 0:e.unchainable)&&void 0!==t?t:[]}isMultiStop(){return this.selectedIds.length>1||this.existingEventIds.length>0}canSubmit(){const e=this.plan;return!!e&&!this.planLoading&&!this.planError&&e.stops.some(e=>!e.fixed)&&0===e.unchainable.length&&null===this.activeLinkType&&(this.extending||(t=this.formValues,n=this.bedroomsRequired,(!!t.firstName.trim()||!!t.lastName.trim())&&Lr(t.email.trim())&&!!t.phoneE164&&(!n||null!==t.layout)));var t,n}get bedroomOptions(){const e=new Set(this.selectedIds.flatMap(e=>{var t,n;return null!==(n=null===(t=this.communities.get(e))||void 0===t?void 0:t.bedrooms)&&void 0!==n?n:[]}));return e.size>0?[...e].sort((e,t)=>e-t).map(Rd):this.layoutOptions}get preferredLayout(){const e=this.bedroomOptions.filter(e=>this.preferences.bedrooms.includes(Dd(e.value)));return 1===e.length?e[0].value:null}get formValues(){var e;return{...this.contact,layout:this.preferredLayout,moveIn:null!==(e=this.preferences.moveIn)&&void 0!==e?e:""}}onContactChange(e){this.contact=e;const t=this.formValues;e.layout!==t.layout&&(this.preferences={...this.preferences,bedrooms:null===e.layout?[]:[Dd(e.layout)]}),e.moveIn!==t.moveIn&&(this.preferences={...this.preferences,moveIn:e.moveIn||null})}get bedroomsRequired(){return this.bedroomPreferenceRequired&&this.bedroomOptions.length>0}disclaimer(){return na({buildingName:this.buildingName,phoneNumberInput:this.contact.phone,emailInput:this.contact.email,orgLegalName:this.orgLegalName,orgSlug:this.orgSlug,country:this.country,buildingState:this.buildingState,clickingButtonText:"schedule tour"})}container(e){return H`<div
|
|
6331
|
+
</svg>`,Md=e=>{const t=Object.fromEntries(e.buildingIds.slice(1).filter(t=>e.laterStarts[t]).map(t=>[String(t),e.laterStarts[t]])),n=e.existingEventIds[e.existingEventIds.length-1];return{building_ids:e.buildingIds,tour_type:e.tourType,date:e.date,start_time:e.firstStart,stop_starts:t,fixed_first:void 0===n?null:{calendar_event_id:n}}},Dd=({orgSlug:e,selectedLeadSource:t,currentLeadSource:n,touchpoints:i,search:r,referrer:o,googleReferral:a})=>{var s,l,u;const d=t||n||null,c=da(e);return{lead_sources:[...new Set(d?[d,c]:[c])],lead_sources_with_timestamps:i.map(e=>_r({...e})),query_params:Object.fromEntries(new URLSearchParams(r).entries()),referrer:o,google_rwg_token:null!==(s=null==a?void 0:a.rwgToken)&&void 0!==s?s:null,google_referral_building_id:null!==(l=null==a?void 0:a.buildingId)&&void 0!==l?l:null,google_environment:null!==(u=null==a?void 0:a.environment)&&void 0!==u?u:null}},Ld=e=>0===e?0:Math.floor(e/10),Rd=["Studio","One bedroom","Two bedroom","Three bedroom","Four bedroom","Five bedroom"],Bd=e=>{var t;return{value:10*e,label:null!==(t=Rd[e])&&void 0!==t?t:`${e} bedroom`}};var Ud=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};const jd={bedrooms:[],moveIn:null,maxBudget:null},Fd=e=>[...new Set(e.map(Ld))],Hd={"escorted-tour":"WITH_AGENT","self-guided-tour":"SELF_GUIDED","live-virtual-tour":"VIRTUAL_SHOWING"};let zd=class extends ue{constructor(){super(...arguments),this.orgSlug="",this.buildingSlug="",this.buildingId=0,this.orgId=0,this.buildingName="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.tourTypeOptions=[],this.layoutOptions=[],this.currentLeadSource="",this.leadSources=[],this.featureFlagShowDropdown="",this.bedroomPreferenceRequired=!1,this.orgLegalName="",this.country=null,this.buildingState=null,this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.compactDesign=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.getSessionToken=()=>null,this.api=null,this.step="loading",this.loadError=null,this.mobile=Ir(),this.group=null,this.communities=new Map,this.selectedIds=[],this.picks=[],this.addingStop=!1,this.existingEventIds=[],this.tourType="escorted-tour",this.linkTourType=null,this.date=null,this.firstStart=null,this.laterStarts={},this.plan=null,this.planLoading=!1,this.planError=null,this.notice=null,this.contact=Td,this.preferences=jd,this.submitting=!1,this.bookingError=null,this.reschedulePrompt=null,this.confirmed=[],this.bookedTourType=null,this.bookedEventIds=[],this.extendInitial=null,this.extendFrom=null,this.extending=!1,this.rescheduled=!1,this.rescheduleCanceled=!1,this.planRequestId=0,this.idempotency=null,this.onKeydown=e=>{cu(e,this),"Escape"!==e.key||e.defaultPrevented||e.isComposing||(e.stopPropagation(),this.close())},this.loadSelectCommunities=e=>this.client.getCommunities(e).then(this.rememberPage),this.loadExtendCommunities=e=>{const t=this.extendFrom;return t?this.client.getCommunities({...e,extend:t}).then(this.rememberPage):Promise.reject(new Error("No booking to extend"))},this.rememberPage=e=>(this.remember(e.communities),e),this.loadAddStopCommunities=e=>{const t=this.extendQueryFromPlan();return t?this.client.getCommunities({...e,extend:t}).then(this.rememberPage):Promise.reject(new Error("No stop to add after"))},this.onFiltersChange=e=>{this.preferences=e.detail.filters}}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("aria-modal")||this.setAttribute("aria-modal","true"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Schedule a Tour"),this.cleanupMobileListener=Nr(e=>this.mobile=e),this.addEventListener("keydown",this.onKeydown)}disconnectedCallback(){var e;null===(e=this.cleanupMobileListener)||void 0===e||e.call(this),this.removeEventListener("keydown",this.onKeydown),super.disconnectedCallback()}close(){var e;null===(e=this.onCloseClicked)||void 0===e||e.call(this,new MouseEvent("click"))}get client(){return this.api||(this.api=ed({orgSlug:this.orgSlug,buildingSlug:this.buildingSlug,getSessionToken:()=>this.getSessionToken()})),this.api}willUpdate(e){if(e.has("primaryColor")||e.has("foregroundColorOnPrimaryBackgroundColor")){const e=this.primaryColor||Zn;this.style.setProperty("--primary-color",e),this.style.setProperty("--action-confirm-button-background",e),this.style.setProperty("--action-confirm-button-color",this.foregroundColorOnPrimaryBackgroundColor),this.style.setProperty("--on-primary-color",this.foregroundColorOnPrimaryBackgroundColor)}}firstUpdated(){this.start()}updated(e){var t;e.has("step")&&void 0===e.get("step")?uu(this):((e.has("step")||e.has("reschedulePrompt")||e.has("rescheduleCanceled"))&&(this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),this.focus({preventScroll:!0})),e.has("notice")&&this.notice&&(null===(t=this.renderRoot.querySelector(".notice"))||void 0===t||t.scrollIntoView({block:"nearest"})))}async start(){this.step="loading",this.loadError=null;try{const e=await this.client.getCommunities(jd);if(this.group=e,this.remember(e.communities),e.anchor.is_general_building)return void this.goTo("pick");this.rememberOne({building_id:e.anchor.building_id,name:e.anchor.name,address:null,timezone:null}),this.startSchedule([e.anchor.building_id])}catch(e){if(e instanceof Ju&&"NOT_IN_GROUP"===e.code)return this.group=null,this.rememberOne({building_id:this.buildingId,name:this.buildingName,address:null,timezone:null}),void this.startSchedule([this.buildingId]);this.loadError=e.message,this.step="error",this.log("TOUR_SCHEDULER_V2_LOAD_ERROR",e)}}goTo(e){this.step=e,"pick"===e?this.picks=this.selectedIds.map(e=>this.communities.get(e)).filter(e=>!!e):"booked"===e&&(this.picks=[]),Lo("tourSchedulerStepViewed",{step:"schedule"===e&&this.extending?"extend-schedule":e,buildingId:this.buildingId})}remember(e){const t=new Map(this.communities);e.forEach(e=>t.set(e.building_id,Xu(e))),this.communities=t}rememberOne(e){const t=this.communities.get(e.building_id);(null==t?void 0:t.address)||(this.communities=new Map(this.communities).set(e.building_id,e))}startSchedule(e){this.selectedIds=e,this.plan=null,this.firstStart=null,this.laterStarts={},this.linkTourType=null,this.notice=null,this.bookingError=null,this.reschedulePrompt=null,this.goTo("schedule"),this.runPlan()}choice(){var e;return{buildingIds:this.selectedIds,tourType:this.tourType,date:null!==(e=this.date)&&void 0!==e?e:hd(new Date),firstStart:this.firstStart,laterStarts:this.laterStarts,existingEventIds:this.existingEventIds}}async runPlan(e=!1){if(this.addingStop=!1,0===this.selectedIds.length)return;const t=++this.planRequestId;this.planLoading=!0,this.planError=null,e||(this.notice=null);try{let e=this.choice(),n=await this.client.plan(Md(e));for(let i=0;i<2&&t===this.planRequestId;i++){if(n.tour_types.includes(e.tourType)){if(!(n.bookable_dates.length>0)||n.bookable_dates.includes(e.date))break;this.date=n.bookable_dates[0]}else{if(0===n.tour_types.length)break;this.tourType=n.tour_types[0]}this.firstStart=null,this.laterStarts={},e=this.choice(),n=await this.client.plan(Md(e))}if(t!==this.planRequestId)return;this.plan=n,n.bookable_dates.includes(e.date)&&(this.date=e.date),n.changed.length>0&&(this.notice=n.changed.map(e=>e.text).join(" "))}catch(e){if(t!==this.planRequestId)return;this.planError=e.message,this.log("TOUR_SCHEDULER_V2_PLAN_ERROR",e)}finally{t===this.planRequestId&&(this.planLoading=!1)}}tourLink(e){if(!this.tourTypeOptions.map(e=>e.value).includes(Hd[e]))return null;const[t,n]={"self-guided-tour":[this.sgtUrl,this.selfGuidedToursTypeOffered],"escorted-tour":[this.escortedToursLink,this.escortedToursTypeOffered],"live-virtual-tour":[this.virtualToursLink,this.virtualToursTypeOffered]}[e];return t&&va(0,n)?t:null}get bookingOwnBuildingAlone(){return 0===this.existingEventIds.length&&1===this.selectedIds.length&&this.selectedIds[0]===this.buildingId}openTourLink(e){const t=this.tourLink(e);if(!t)return;const n="self-guided-tour"===e&&52===this.orgId?Po(t,Oo()):t;window.open(n,"_blank")}tourTypeChoices(){var e,t;const n=null!==(t=null===(e=this.plan)||void 0===e?void 0:e.tour_types)&&void 0!==t?t:[];return fd.filter(e=>n.includes(e)||this.bookingOwnBuildingAlone&&!!this.tourLink(e)).map(e=>({id:e,opensLink:this.bookingOwnBuildingAlone&&!!this.tourLink(e)}))}get shownTourType(){var e;return this.linkTourType?this.linkTourType:(null===(e=this.plan)||void 0===e?void 0:e.tour_types.includes(this.tourType))?this.tourType:null}get activeLinkType(){const e=this.shownTourType;return e&&this.bookingOwnBuildingAlone&&this.tourLink(e)?e:null}onTourType(e){if(Lo("tourTypeSelected",{tourType:e,buildingId:this.buildingId}),this.bookingOwnBuildingAlone&&this.tourLink(e))return this.linkTourType=e,void this.openTourLink(e);this.linkTourType=null,e!==this.tourType&&(this.tourType=e,this.firstStart=null,this.laterStarts={},this.runPlan())}onDate(e){e!==this.date&&(Lo("tourDateSelected",{tourType:this.tourType,buildingId:this.buildingId}),this.date=e,this.firstStart=null,this.laterStarts={},this.runPlan())}onStopTime(e,t){const n=this.selectedIds.indexOf(e);if(n<0)return;Lo("tourTimeSelected",{tourType:this.tourType,buildingId:this.buildingId,stopNumber:n+1});const i=this.selectedIds.slice(1,n);0===n?(this.firstStart=nd(t),this.laterStarts={}):this.laterStarts={...Object.fromEntries(i.filter(e=>this.laterStarts[e]).map(e=>[e,this.laterStarts[e]])),[e]:t},this.runPlan()}onReorder(e){Lo("tourStopsReordered",{buildingId:this.buildingId,stopCount:e.length});const t=this.selectedIds.filter(t=>!e.includes(t));this.selectedIds=[...e,...t],this.firstStart=null,this.laterStarts={},this.runPlan()}onRemove(e){const t=this.selectedIds.filter(t=>t!==e);if(Lo("tourStopRemoved",{buildingId:this.buildingId,stopCount:t.length}),0===t.length)return this.selectedIds=[],this.plan=null,void this.goTo(this.extending?"booked":"pick");this.selectedIds[0]===e&&(this.firstStart=null),this.selectedIds=t,this.laterStarts={},this.runPlan()}onEditCommunities(){this.goTo("pick")}onCommunitiesSelected(e,t){var n;if(e.forEach(e=>this.rememberOne(e)),Lo("tourCommunitiesSelected",{buildingId:this.buildingId,count:e.length,mode:t}),this.extending="extend"===t,this.extending){this.existingEventIds=this.bookedEventIds,this.tourType=null!==(n=this.bookedTourType)&&void 0!==n?n:this.tourType;const e=this.confirmed.filter(e=>e.start).slice(-1)[0];this.date=(null==e?void 0:e.start)?td(e.start):this.date}else this.existingEventIds=[];this.startSchedule(e.map(e=>e.building_id))}async submit(e=!1){var t,n,i,r,o,a;const s=this.plan;if(!s||this.submitting)return;const l=this.choice(),u=this.formValues,d=this.showLeadSourceDropdown()?u.leadSource:null,c=(({choice:e,plan:t,contact:n,attribution:i,conversationTrackingId:r,cancelExistingTours:o})=>({tour_type:e.tourType,stops:[...e.existingEventIds.map(e=>({existing_calendar_event_id:e})),...t.stops.filter(e=>!e.fixed).map(e=>({building_id:e.building_id,start:e.start}))],...n?{contact:n}:{},lead_sources:i,conversation_tracking_id:r,cancel_existing_tours:o}))({choice:l,plan:s,contact:this.extending?null:{first_name:u.firstName.trim(),last_name:u.lastName.trim(),email:u.email.trim(),phone_e164:null!==(t=u.phoneE164)&&void 0!==t?t:"",bedrooms:Fd(u.layouts),move_in:u.moveIn||null,notes:u.notes.trim()},attribution:Dd({orgSlug:this.orgSlug,selectedLeadSource:d,currentLeadSource:this.currentLeadSource,touchpoints:null!==(i=null===(n=this.leadSourceMultitouchClient)||void 0===n?void 0:n.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:d||null}))&&void 0!==i?i:[],search:window.location.search,referrer:document.referrer,googleReferral:rs()}),conversationTrackingId:null!==(o=null===(r=this.leadSourceClient)||void 0===r?void 0:r.chatId)&&void 0!==o?o:null,cancelExistingTours:e}),h=JSON.stringify({tour_type:c.tour_type,stops:c.stops,contact:c.contact,cancel_existing_tours:c.cancel_existing_tours});(null===(a=this.idempotency)||void 0===a?void 0:a.booking)!==h&&(this.idempotency={booking:h,key:ms()}),Lo("scheduleTourSubmitted",{tourType:l.tourType,stopCount:c.stops.length,buildingId:this.buildingId}),this.submitting=!0,this.bookingError=null;try{const t=await this.client.book(c,this.idempotency.key);this.idempotency=null,this.rescheduled=e,this.onBooked(t,l.tourType,s)}catch(e){this.onBookingError(e)}finally{this.submitting=!1}}onBooked(e,t,n){var i,r,o,a,s,l;if(this.reschedulePrompt=null,e.stops.every(e=>"failed"===e.status))return this.notice=null!==(o=null===(r=null===(i=e.stops.find(e=>e.error))||void 0===i?void 0:i.error)||void 0===r?void 0:r.message)&&void 0!==o?o:"We couldn't book your tour. Please pick another time.",this.log("TOUR_SCHEDULER_V2_BOOKING_ERROR",e.stops),void this.runPlan(!0);const u=new Map(n.stops.map(e=>[e.building_id,e]));this.confirmed=e.stops.map(e=>{var t,n,i,r,o,a,s,l;const d=null!==(t=this.communities.get(e.building_id))&&void 0!==t?t:{building_id:e.building_id,name:"",address:null,timezone:null},c=null!==(r=null!==(n=d.timezone)&&void 0!==n?n:null===(i=u.get(e.building_id))||void 0===i?void 0:i.timezone)&&void 0!==r?r:null;return{community:{...d,timezone:c},start:e.start,end:e.end,status:e.status,error:null!==(a=null===(o=e.error)||void 0===o?void 0:o.message)&&void 0!==a?a:null,distanceFromPrevMi:null!==(l=null===(s=u.get(e.building_id))||void 0===s?void 0:s.distance_from_prev_mi)&&void 0!==l?l:null}});const d=e.stops.filter(e=>"failed"!==e.status&&null!==e.calendar_event_id);this.bookedEventIds=d.map(e=>e.calendar_event_id),this.bookedTourType=t,this.extending=!1,this.extendInitial=null,Lo("tourItineraryBooked",{buildingId:this.buildingId,stopCount:d.length,failedCount:e.stops.length-d.length}),d.length>0&&(null===(a=this.leadSourceClient)||void 0===a||a.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(s=this.leadSourceClient)||void 0===s||s.resetLeadSource(),null===(l=this.leadSourceMultitouchClient)||void 0===l||l.resetLeadSourceTouchpoints()),this.goTo("booked"),this.loadExtension()}extendQueryFromBooking(){const e=this.confirmed.filter(e=>"failed"!==e.status),t=e[e.length-1];return(null==t?void 0:t.end)&&this.bookedTourType?{availableAfter:t.end,tourType:this.bookedTourType,nearBuildingId:t.community.building_id,excludeBuildingIds:e.map(e=>e.community.building_id)}:null}stopsRemaining(){return 3-this.bookedEventIds.length}get canAddStop(){var e,t;return!this.planLoading&&!this.planError&&this.stopsRemaining()>this.selectedIds.length&&(null!==(t=null===(e=this.plan)||void 0===e?void 0:e.stops.length)&&void 0!==t?t:0)>0}extendQueryFromPlan(){var e,t;const n=null!==(t=null===(e=this.plan)||void 0===e?void 0:e.stops)&&void 0!==t?t:[],i=n[n.length-1];return i&&this.extendFrom?{...this.extendFrom,availableAfter:i.end,nearBuildingId:i.building_id,excludeBuildingIds:[...this.extendFrom.excludeBuildingIds,...this.selectedIds]}:null}onStopAdded(e){const t=e[0];t&&(this.rememberOne(t),Lo("tourCommunitiesSelected",{buildingId:this.buildingId,count:1,mode:"extend"}),this.selectedIds=[...this.selectedIds,t.building_id],this.runPlan())}async loadExtension(){const e=this.extendQueryFromBooking();this.extendFrom=e;const t=this.stopsRemaining();if(this.group&&e&&!(t<=0))try{const n=await this.client.getCommunities({...jd,extend:e});this.remember(n.communities),n.communities.some(e=>e.tourable)&&(this.extendInitial=n,Lo("tourExtensionOffered",{buildingId:this.buildingId,stopsRemaining:t}))}catch(e){this.log("TOUR_SCHEDULER_V2_EXTEND_LOAD_ERROR",e)}}onBookingError(e){const t=e instanceof Ju?e:new Ju(0,null,"Something went wrong. Please try again.");if("EXISTING_TOUR"!==t.code){if(this.reschedulePrompt=null,"SLOT_TAKEN"===t.code)return this.notice=t.message,void this.runPlan(!0);this.bookingError=t.message,this.log("TOUR_SCHEDULER_V2_BOOKING_ERROR",e)}else this.reschedulePrompt=t.message}showLeadSourceDropdown(){return this.featureFlagShowDropdown===bo.always||this.featureFlagShowDropdown===bo.onAttributionFailure&&0===this.currentLeadSource.length}log(e,t){Ao({logTitle:e,logData:{error:t},logType:ko.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:t})}backStep(){return this.rescheduleCanceled?null:"schedule"===this.step?this.extending?"booked":this.group?"pick":null:"pick"===this.step&&this.group&&!this.group.anchor.is_general_building&&this.plan&&this.selectedIds.length>0?"schedule":null}problems(){var e,t;return null!==(t=null===(e=this.plan)||void 0===e?void 0:e.unchainable)&&void 0!==t?t:[]}isMultiStop(){return this.selectedIds.length>1||this.existingEventIds.length>0}canSubmit(){const e=this.plan;return!!e&&!this.planLoading&&!this.planError&&e.stops.some(e=>!e.fixed)&&0===e.unchainable.length&&null===this.activeLinkType&&(this.extending||(t=this.formValues,n=this.bedroomsRequired,(!!t.firstName.trim()||!!t.lastName.trim())&&Lr(t.email.trim())&&!!t.phoneE164&&(!n||t.layouts.length>0)));var t,n}get bedroomOptions(){const e=new Set(this.selectedIds.flatMap(e=>{var t,n;return null!==(n=null===(t=this.communities.get(e))||void 0===t?void 0:t.bedrooms)&&void 0!==n?n:[]}));return e.size>0?[...e].sort((e,t)=>e-t).map(Bd):this.layoutOptions}get preferredLayouts(){return this.bedroomOptions.map(e=>e.value).filter(e=>this.preferences.bedrooms.includes(Ld(e)))}get formValues(){var e;return{...this.contact,layouts:this.preferredLayouts,moveIn:null!==(e=this.preferences.moveIn)&&void 0!==e?e:""}}onContactChange(e){this.contact=e;const t=this.formValues,n=Fd(t.layouts.filter(t=>!e.layouts.includes(t))),i=Fd(e.layouts.filter(e=>!t.layouts.includes(e)));(n.length>0||i.length>0)&&(this.preferences={...this.preferences,bedrooms:[...new Set([...this.preferences.bedrooms.filter(e=>!n.includes(e)),...i])].sort((e,t)=>e-t)}),e.moveIn!==t.moveIn&&(this.preferences={...this.preferences,moveIn:e.moveIn||null})}get bedroomsRequired(){return this.bedroomPreferenceRequired&&this.bedroomOptions.length>0}disclaimer(){return na({buildingName:this.buildingName,phoneNumberInput:this.contact.phone,emailInput:this.contact.email,orgLegalName:this.orgLegalName,orgSlug:this.orgSlug,country:this.country,buildingState:this.buildingState,clickingButtonText:"schedule tour"})}container(e){return H`<div
|
|
6311
6332
|
id=${this.mobile?"mobile-body-container":"scheduler-container"}
|
|
6312
6333
|
>
|
|
6313
6334
|
${e}
|
|
@@ -6492,7 +6513,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6492
6513
|
aria-label="Back"
|
|
6493
6514
|
@click=${()=>this.goTo(e)}
|
|
6494
6515
|
>
|
|
6495
|
-
${
|
|
6516
|
+
${Nd("#202020")}
|
|
6496
6517
|
</button>`:""}
|
|
6497
6518
|
<h1 id="tour-header-title">Schedule a Tour</h1>
|
|
6498
6519
|
</div>
|
|
@@ -6505,7 +6526,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6505
6526
|
</button>
|
|
6506
6527
|
</div>
|
|
6507
6528
|
${this.renderBody()}
|
|
6508
|
-
</div>`}};
|
|
6529
|
+
</div>`}};zd.styles=[ia,Me,p`
|
|
6509
6530
|
/* New layout only: the back button beside the title. */
|
|
6510
6531
|
.title {
|
|
6511
6532
|
align-items: center;
|
|
@@ -6581,7 +6602,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6581
6602
|
font: inherit;
|
|
6582
6603
|
text-decoration: underline;
|
|
6583
6604
|
}
|
|
6584
|
-
`],
|
|
6605
|
+
`],Ud([pe({attribute:!0})],zd.prototype,"orgSlug",void 0),Ud([pe({attribute:!0})],zd.prototype,"buildingSlug",void 0),Ud([pe({type:Number})],zd.prototype,"buildingId",void 0),Ud([pe({type:Number})],zd.prototype,"orgId",void 0),Ud([pe({attribute:!1})],zd.prototype,"buildingName",void 0),Ud([pe({attribute:!0})],zd.prototype,"sgtUrl",void 0),Ud([pe({attribute:!0})],zd.prototype,"selfGuidedToursTypeOffered",void 0),Ud([pe({attribute:!0})],zd.prototype,"escortedToursLink",void 0),Ud([pe({attribute:!1})],zd.prototype,"escortedToursTypeOffered",void 0),Ud([pe({attribute:!0})],zd.prototype,"virtualToursLink",void 0),Ud([pe({attribute:!0})],zd.prototype,"virtualToursTypeOffered",void 0),Ud([pe({attribute:!1})],zd.prototype,"tourTypeOptions",void 0),Ud([pe({attribute:!1})],zd.prototype,"layoutOptions",void 0),Ud([pe({attribute:!0})],zd.prototype,"currentLeadSource",void 0),Ud([pe({attribute:!1})],zd.prototype,"leadSources",void 0),Ud([pe({attribute:!0})],zd.prototype,"featureFlagShowDropdown",void 0),Ud([pe({attribute:!1})],zd.prototype,"bedroomPreferenceRequired",void 0),Ud([pe({attribute:!1})],zd.prototype,"orgLegalName",void 0),Ud([pe({attribute:!1})],zd.prototype,"country",void 0),Ud([pe({attribute:!1})],zd.prototype,"buildingState",void 0),Ud([pe({attribute:!1})],zd.prototype,"primaryColor",void 0),Ud([pe({attribute:!1})],zd.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Ud([pe({attribute:!1})],zd.prototype,"compactDesign",void 0),Ud([pe({attribute:!1})],zd.prototype,"leadSourceClient",void 0),Ud([pe({attribute:!1})],zd.prototype,"leadSourceMultitouchClient",void 0),Ud([pe({attribute:!1})],zd.prototype,"getSessionToken",void 0),Ud([fe()],zd.prototype,"step",void 0),Ud([fe()],zd.prototype,"loadError",void 0),Ud([fe()],zd.prototype,"mobile",void 0),Ud([fe()],zd.prototype,"group",void 0),Ud([fe()],zd.prototype,"communities",void 0),Ud([fe()],zd.prototype,"selectedIds",void 0),Ud([fe()],zd.prototype,"picks",void 0),Ud([fe()],zd.prototype,"addingStop",void 0),Ud([fe()],zd.prototype,"existingEventIds",void 0),Ud([fe()],zd.prototype,"tourType",void 0),Ud([fe()],zd.prototype,"linkTourType",void 0),Ud([fe()],zd.prototype,"date",void 0),Ud([fe()],zd.prototype,"firstStart",void 0),Ud([fe()],zd.prototype,"laterStarts",void 0),Ud([fe()],zd.prototype,"plan",void 0),Ud([fe()],zd.prototype,"planLoading",void 0),Ud([fe()],zd.prototype,"planError",void 0),Ud([fe()],zd.prototype,"notice",void 0),Ud([fe()],zd.prototype,"contact",void 0),Ud([fe()],zd.prototype,"preferences",void 0),Ud([fe()],zd.prototype,"submitting",void 0),Ud([fe()],zd.prototype,"bookingError",void 0),Ud([fe()],zd.prototype,"reschedulePrompt",void 0),Ud([fe()],zd.prototype,"confirmed",void 0),Ud([fe()],zd.prototype,"bookedTourType",void 0),Ud([fe()],zd.prototype,"bookedEventIds",void 0),Ud([fe()],zd.prototype,"extendInitial",void 0),Ud([fe()],zd.prototype,"extendFrom",void 0),Ud([fe()],zd.prototype,"extending",void 0),Ud([fe()],zd.prototype,"rescheduled",void 0),Ud([fe()],zd.prototype,"rescheduleCanceled",void 0),zd=Ud([ce("tour-scheduler-v2")],zd);const Gd=p`
|
|
6585
6606
|
:host {
|
|
6586
6607
|
display: block;
|
|
6587
6608
|
position: relative;
|
|
@@ -6893,7 +6914,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6893
6914
|
margin: 2px 0;
|
|
6894
6915
|
}
|
|
6895
6916
|
}
|
|
6896
|
-
`;class
|
|
6917
|
+
`;class Vd{constructor(e={}){var t,n,i,r,o,a;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(n=e.description)&&void 0!==n?n:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(a=e.available)&&void 0!==a&&a,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class Wd{constructor(e={}){var t,n,i,r,o;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(n=e.type)&&void 0!==n?n:"",this.minAvailableItem=e.minAvailableItem?new Vd(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new Vd(e.maxAvailableItem):void 0,this.allItems=(null!==(i=e.allItems)&&void 0!==i?i:[]).map(e=>new Vd(e)),this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.priceDescription=null!==(o=e.priceDescription)&&void 0!==o?o:""}get displayName(){return this.description}get itemDescription(){return this.description}}var Qd,qd;!function(e){e.NEVER="NEVER",e.AS_NEEDED="AS_NEEDED",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(Qd||(Qd={})),function(e){e.Rent="Rent",e.Utility="Utility",e.ApplicationFee="ApplicationFee",e.Parking="Parking",e.Insurance="Insurance",e.Storage="Storage",e.PetFee="PetFee",e.PetRent="PetRent",e.PetDeposit="PetDeposit",e.SecurityDeposit="SecurityDeposit",e.MoveInFee="MoveInFee",e.Other="Other"}(qd||(qd={}));class Yd{constructor(e={}){var t,n,i,r,o,a,s,l,u,d;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.building_id=e.building_id,this.fee_name=null!==(n=e.fee_name)&&void 0!==n?n:"",this.amount=e.amount,this.amount_display=null!==(i=e.amount_display)&&void 0!==i?i:"",this.limit=null!==(r=e.limit)&&void 0!==r?r:null,this.min_estimate=e.min_estimate,this.max_estimate=e.max_estimate,this.percent_rent=e.percent_rent,this.percent_rent_min=e.percent_rent_min,this.percent_rent_max=e.percent_rent_max,this.frequency=null!==(o=e.frequency)&&void 0!==o?o:Qd.ONE_TIME,this.category=null!==(a=e.category)&&void 0!==a?a:qd.Other,this.description=e.description,this.additional_info=e.additional_info,this.refundable=null!==(s=e.refundable)&&void 0!==s&&s,this.hidden_reason=e.hidden_reason,this.unit_ids=e.unit_ids,this.layout_ids=e.layout_ids,this.public_facing=null===(l=e.public_facing)||void 0===l||l,this.per_applicant=null!==(u=e.per_applicant)&&void 0!==u&&u,this.required_for_quotes=null!==(d=e.required_for_quotes)&&void 0!==d&&d,this.charge_code=e.charge_code,this.bundle_key=e.bundle_key,this.external_key=e.external_key}get displayFrequency(){return this.frequency.replace(/_/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}get isOptional(){return!this.required_for_quotes}}const Kd=class{constructor(){this.params=new URLSearchParams}addSingle(e,t){return t?(this.params.append(e,t),this):this}addArray(e,t){return t?(t.forEach(t=>{t&&this.params.append(`${e}[]`,t)}),this):this}build(){return this.params.toString()?`?${this.params.toString()}`:""}},Xd=Eo,Zd=e=>new Yd(e),Jd=e=>new Wd(e),ec=async(e,t)=>{try{const n=(new Kd).addArray("layout_ids",null==t?void 0:t.map(e=>e.toString())),i=await r().get(`${Xd}/platformApi/webchat/${e}/marketable-fees?${n.build()}`);if(i.data){const e=Er(i.data);return{fees:e.fees.map(Zd),rentableItems:e.rentableItems.map(Jd),buildingIncentives:e.buildingIncentives}}}catch(t){Ao({logType:ko.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t},error:t})}return{fees:[],rentableItems:[],buildingIncentives:[]}},tc=-1,nc=Eo,ic=async({buildingSlug:e,unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a},s)=>{try{const l=await r().post(`${nc}/platformApi/webchat/${e}/quote/calculate`,_r({unitId:t,chargeInputs:n,rentableItems:i,...Number.isFinite(o)?{leaseTerm:o}:{},moveInDate:a}),{signal:s});if(l.data){return Er(l.data)}}catch(t){const n=t;"ERR_CANCELED"!==n.code&&Ao({logType:ko.error,buildingSlug:e,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:t},error:t});const i=(e=>{var t,n,i;const r=null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.detail;if(422!==(null===(i=e.response)||void 0===i?void 0:i.status)||!Array.isArray(r))return null;const o=r.map(e=>Er(e));return o.length>0&&o.every(e=>"number"==typeof e.limit)?o:null})(n);return{quote:null,error:i?{type:"feeLimit",violations:i}:{type:"unknown"}}}return{quote:null,error:{type:"unknown"}}};function rc(e){return ir(e,"yyyy-MM-dd")}function oc(){return rc(Hr())}const ac=Eo,sc=async({buildingSlug:e,numBedrooms:t,moveInDateString:n,leaseTerm:i})=>{try{const a=(({numBedrooms:e,moveInDateString:t,leaseTerm:n})=>{const i=new Kd;return i.addArray("num_bedrooms",null==e?void 0:e.map(e=>e.toString())).addSingle("move_in_date_earliest",t).addSingle("move_in_date_latest",t).addSingle("lease_term_min",Number.isFinite(n)?null==n?void 0:n.toString():void 0),i.build()})({numBedrooms:t,moveInDateString:n,leaseTerm:i}),s=await r().get(`${ac}/platformApi/webchat/${e}/units${a}`);if(s.data){const e=Er(s.data);return o=e.map(e=>({...e,id:parseInt(e.id.toString().substring(1))})),[...o].sort((e,t)=>e.startingPrice-t.startingPrice||e.id-t.id)}}catch(r){Ao({logType:ko.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS]",logData:{error:r,params:{numBedrooms:t,moveInDateString:n,leaseTerm:i}},error:r})}var o;return[]},lc=[qd.PetFee,qd.PetRent,qd.PetDeposit];function uc(e){return`Up to ${e} ${1===e?"pet":"pets"} allowed`}const dc=({color:e="#347FF7",size:t=24}={})=>z`
|
|
6897
6918
|
<svg aria-hidden="true" focusable="false" width="${t}" height="${t}" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6898
6919
|
<g id="Frame" clip-path="url(#clip0_18718_332018)">
|
|
6899
6920
|
<path id="Vector" d="M3 12.5C3 13.6819 3.23279 14.8522 3.68508 15.9442C4.13738 17.0361 4.80031 18.0282 5.63604 18.864C6.47177 19.6997 7.46392 20.3626 8.55585 20.8149C9.64778 21.2672 10.8181 21.5 12 21.5C13.1819 21.5 14.3522 21.2672 15.4442 20.8149C16.5361 20.3626 17.5282 19.6997 18.364 18.864C19.1997 18.0282 19.8626 17.0361 20.3149 15.9442C20.7672 14.8522 21 13.6819 21 12.5C21 11.3181 20.7672 10.1478 20.3149 9.05585C19.8626 7.96392 19.1997 6.97177 18.364 6.13604C17.5282 5.30031 16.5361 4.63738 15.4442 4.18508C14.3522 3.73279 13.1819 3.5 12 3.5C10.8181 3.5 9.64778 3.73279 8.55585 4.18508C7.46392 4.63738 6.47177 5.30031 5.63604 6.13604C4.80031 6.97177 4.13738 7.96392 3.68508 9.05585C3.23279 10.1478 3 11.3181 3 12.5Z" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -6906,7 +6927,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6906
6927
|
</clipPath>
|
|
6907
6928
|
</defs>
|
|
6908
6929
|
</svg>
|
|
6909
|
-
`,
|
|
6930
|
+
`,cc=p`
|
|
6910
6931
|
:host {
|
|
6911
6932
|
display: block;
|
|
6912
6933
|
margin-bottom: 20px;
|
|
@@ -6940,9 +6961,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6940
6961
|
color: #868e96;
|
|
6941
6962
|
font-size: 0.8rem;
|
|
6942
6963
|
}
|
|
6943
|
-
`;var
|
|
6964
|
+
`;var hc=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 pc=class extends ue{constructor(){super(...arguments),this.promoAmount="0",this.promoDescription="",this.promoValidity=""}render(){return H`
|
|
6944
6965
|
<div class="promo-card">
|
|
6945
|
-
<div class="icon-container">${
|
|
6966
|
+
<div class="icon-container">${dc()}</div>
|
|
6946
6967
|
<div class="content-container">
|
|
6947
6968
|
<h2 class="promo-heading">
|
|
6948
6969
|
${this.promoAmount} ${this.promoDescription}
|
|
@@ -6950,7 +6971,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6950
6971
|
<div class="promo-subtitle">${this.promoValidity}</div>
|
|
6951
6972
|
</div>
|
|
6952
6973
|
</div>
|
|
6953
|
-
`}};
|
|
6974
|
+
`}};pc.styles=cc,hc([pe({type:String})],pc.prototype,"promoAmount",void 0),hc([pe({type:String})],pc.prototype,"promoDescription",void 0),hc([pe({type:String})],pc.prototype,"promoValidity",void 0),pc=hc([ce("promo-card")],pc);var fc=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 gc=class extends ue{constructor(){super(...arguments),this.unit={},this.onUnitSelect=null,this.selected=!1}get bedAndBathText(){return`${0===this.unit.numberOfBedrooms?"studio":`${this.unit.numberOfBedrooms}bd`} | ${this.unit.numberOfBathrooms}ba`}get priceRange(){return this.unit.startingPrice===this.unit.maxPrice?`$${this.unit.startingPrice}`:`$${this.unit.startingPrice} - $${this.unit.maxPrice}`}handleOnUnitSelect(){var e;this.selected||(this.selected=!this.selected,null===(e=this.onUnitSelect)||void 0===e||e.call(this,this.unit))}handleOnImgClick(e){const t=e.target;window.open(t.src,"_blank")}render(){return H`
|
|
6954
6975
|
<div class="floorplan-image-card ${this.selected?"selected":""}">
|
|
6955
6976
|
<div class="section-left">
|
|
6956
6977
|
${this.unit.floorplanUrl?H`
|
|
@@ -6975,7 +6996,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6975
6996
|
</p>
|
|
6976
6997
|
</div>
|
|
6977
6998
|
</div>
|
|
6978
|
-
`}};
|
|
6999
|
+
`}};gc.styles=Yu,fc([pe({type:Object})],gc.prototype,"unit",void 0),fc([pe()],gc.prototype,"onUnitSelect",void 0),fc([pe({type:Boolean})],gc.prototype,"selected",void 0),gc=fc([ce("floorplan-image-card")],gc);var mc=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 bc=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.layoutOptions=[],this.selectedLayoutIds=[tc],this.units=[],this.isLoading=!1,this.isLoadingLayouts=!1,this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.moveInDate=Hr(),this.leaseTerm=12,this.selectedUnit=null,this.handleUnitSelect=e=>{var t;this.selectedUnit=e,null===(t=this.onUnitSelect)||void 0===t||t.call(this,e)},this.handleLayoutChange=e=>{var t;let n;e===tc?n=[tc]:this.selectedLayoutIds.includes(tc)?n=[e]:this.selectedLayoutIds.includes(e)?(n=this.selectedLayoutIds.filter(t=>t!==e),0===n.length&&(n=[tc])):n=[...this.selectedLayoutIds,e],this.selectedLayoutIds=n,null===(t=this.onSelectLayout)||void 0===t||t.call(this,this.selectedLayoutIds)},this.handleMoveInDateChange=e=>{var t;const n=e.target.value,i=Hr();if(n){const[e,t,r]=n.split("-").map(Number),o=new Date(e,t-1,r);if(Tr(o,i))return;this.moveInDate=o}else this.moveInDate=i;null===(t=this.onMoveInDateChange)||void 0===t||t.call(this,n||rc(i))},this.handleLeaseTermChange=e=>{var t;const n=parseInt(e.target.value);!Number.isInteger(n)||n<=0||(this.leaseTerm=n,null===(t=this.onLeaseTermChange)||void 0===t||t.call(this,this.leaseTerm))},this.renderUnitSelection=()=>{var e,t;return this.isLoading?H`
|
|
6979
7000
|
<div class="unit-selection">
|
|
6980
7001
|
<div class="image-carousel">
|
|
6981
7002
|
${Array.from({length:3},()=>H`<div class="unit-card-skeleton shimmer"></div>`)}
|
|
@@ -7013,7 +7034,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7013
7034
|
</div>
|
|
7014
7035
|
`)}
|
|
7015
7036
|
</div>
|
|
7016
|
-
`}get displayOptions(){const e=e=>{let t=e;return Object.entries({zero:"0",one:"1",two:"2",three:"3",four:"4",five:"5",six:"6",seven:"7",eight:"8",nine:"9",ten:"10",eleven:"11",twelve:"12"}).forEach(([e,n])=>{const i=new RegExp(`\\b${e}\\b`,"gi");t=t.replace(i,n)}),t};return[{value:
|
|
7037
|
+
`}get displayOptions(){const e=e=>{let t=e;return Object.entries({zero:"0",one:"1",two:"2",three:"3",four:"4",five:"5",six:"6",seven:"7",eight:"8",nine:"9",ten:"10",eleven:"11",twelve:"12"}).forEach(([e,n])=>{const i=new RegExp(`\\b${e}\\b`,"gi");t=t.replace(i,n)}),t};return[{value:tc,label:"All"},...this.layoutOptions].map(t=>({...t,label:e(t.label.replace(/bedroom/gi,"bd"))})).sort((e,t)=>e.value-t.value)}render(){return H`
|
|
7017
7038
|
<div class="floor-plan-selector">
|
|
7018
7039
|
<div class="floor-plan-selector-label">Select Floor Plan</div>
|
|
7019
7040
|
${this.renderBadges()}
|
|
@@ -7025,8 +7046,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7025
7046
|
<input
|
|
7026
7047
|
type="date"
|
|
7027
7048
|
placeholder="Select move in date"
|
|
7028
|
-
min=${
|
|
7029
|
-
.value=${this.moveInDate?
|
|
7049
|
+
min=${oc()}
|
|
7050
|
+
.value=${this.moveInDate?rc(this.moveInDate):""}
|
|
7030
7051
|
@input=${this.handleMoveInDateChange}
|
|
7031
7052
|
/>
|
|
7032
7053
|
</div>
|
|
@@ -7045,7 +7066,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7045
7066
|
${this.renderUnitSelection()}
|
|
7046
7067
|
</div>
|
|
7047
7068
|
</div>
|
|
7048
|
-
`}};
|
|
7069
|
+
`}};bc.styles=Ku,mc([pe({type:String})],bc.prototype,"buildingSlug",void 0),mc([pe({type:Array})],bc.prototype,"layoutOptions",void 0),mc([pe({type:Array})],bc.prototype,"selectedLayoutIds",void 0),mc([pe({type:Array})],bc.prototype,"units",void 0),mc([pe({type:Boolean})],bc.prototype,"isLoading",void 0),mc([pe({type:Boolean})],bc.prototype,"isLoadingLayouts",void 0),mc([pe()],bc.prototype,"onSelectLayout",void 0),mc([pe()],bc.prototype,"onUnitSelect",void 0),mc([pe()],bc.prototype,"onMoveInDateChange",void 0),mc([pe()],bc.prototype,"onLeaseTermChange",void 0),mc([fe()],bc.prototype,"moveInDate",void 0),mc([fe()],bc.prototype,"leaseTerm",void 0),mc([fe()],bc.prototype,"selectedUnit",void 0),bc=mc([ce("floor-plan-selector")],bc);const yc=p`
|
|
7049
7070
|
:host {
|
|
7050
7071
|
display: block;
|
|
7051
7072
|
width: 100%;
|
|
@@ -7091,7 +7112,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7091
7112
|
font-size: 1rem;
|
|
7092
7113
|
align-self: center;
|
|
7093
7114
|
}
|
|
7094
|
-
`;var
|
|
7115
|
+
`;var vc=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 wc=class extends ue{constructor(){super(...arguments),this.feeQuote=null}get name(){var e,t;if(null===(e=this.feeQuote)||void 0===e?void 0:e.sourceRentableItem)return Rr(this.feeQuote.sourceRentableItem.description||"");const n=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee;return(null==n?void 0:n.feeName)?Rr(n.feeName):""}get description(){var e,t,n,i;if(null===(e=this.feeQuote)||void 0===e?void 0:e.sourceRentableItem){return`${this.feeQuote.sourceRentableItem.id}`}return null!==(i=null===(n=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee)||void 0===n?void 0:n.description)&&void 0!==i?i:""}get additionalInfo(){var e,t,n;return null!==(n=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.additionalInfo)&&void 0!==n?n:""}get triggeredEvent(){var e,t;const n=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.triggeredByEvent;if(!n)return"";return{APPLICATION_SUBMISSION:"Due at Application Submission",APPLICATION_APPROVAL:"Due at Application Approval",LEASE_SIGNING:"Due at Lease Signing",MOVE_IN:"Due at Move-In"}[n]||n}get amount(){var e;if(!this.feeQuote)return null;const t=null!==(e=this.feeQuote.amountRange.fixedValue)&&void 0!==e?e:0;return 0===t?null:Br(t,2)}render(){return this.feeQuote&&this.amount?H`
|
|
7095
7116
|
<div class="fee-item">
|
|
7096
7117
|
<div class="fee-info">
|
|
7097
7118
|
<div class="fee-name">${this.name}</div>
|
|
@@ -7105,7 +7126,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7105
7126
|
</div>
|
|
7106
7127
|
<div class="fee-amount">${this.amount}</div>
|
|
7107
7128
|
</div>
|
|
7108
|
-
`:H``}};
|
|
7129
|
+
`:H``}};wc.styles=yc,vc([pe({type:Object})],wc.prototype,"feeQuote",void 0),wc=vc([ce("fee-item")],wc);var Cc=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 xc=class extends ue{constructor(){super(...arguments),this.feeQuotes=[]}get itemType(){const e=this.feeQuotes[0];return(null==e?void 0:e.sourceRentableItem)?Rr(e.sourceRentableItem.description||""):""}get priceGroups(){const e=new Map;return this.feeQuotes.forEach(t=>{var n;const i=null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0;e.set(i,(e.get(i)||0)+1)}),Array.from(e.entries()).map(([e,t])=>({price:e,count:t})).sort((e,t)=>e.price-t.price)}get totalAmount(){const e=this.feeQuotes.reduce((e,t)=>{var n;return e+(null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0)},0);return Br(e,2)}get priceBreakdown(){const e=this.priceGroups;if(0===e.length)return"";const t=this.getUnitName();return e.map(e=>{return`${e.count} ${n=t,i=e.count,1===i?n:`${n}s`} @ ${Br(e.price,2)}/month`;var n,i}).join(" + ")}getUnitName(){var e;const t=this.feeQuotes[0];return function(e){const t=e.toLowerCase();return t.includes("garage")||t.includes("parking")?"space":t.includes("storage")?"unit":t.includes("locker")?"locker":t.includes("bike")?"spot":"unit"}((null===(e=null==t?void 0:t.sourceRentableItem)||void 0===e?void 0:e.description)||"")}render(){return this.feeQuotes.length&&this.totalAmount!==Br(0,2)?H`
|
|
7109
7130
|
<div class="fee-item">
|
|
7110
7131
|
<div class="fee-info">
|
|
7111
7132
|
<div class="fee-name">${this.itemType}</div>
|
|
@@ -7113,7 +7134,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7113
7134
|
</div>
|
|
7114
7135
|
<div class="fee-amount">${this.totalAmount}</div>
|
|
7115
7136
|
</div>
|
|
7116
|
-
`:H``}};
|
|
7137
|
+
`:H``}};xc.styles=yc,Cc([pe({type:Array})],xc.prototype,"feeQuotes",void 0),xc=Cc([ce("grouped-rentable-item")],xc);const $c=p`
|
|
7117
7138
|
.fee-card-section-container {
|
|
7118
7139
|
margin: 0 12px;
|
|
7119
7140
|
border-radius: 4px;
|
|
@@ -7173,7 +7194,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7173
7194
|
margin: 12px;
|
|
7174
7195
|
justify-content: space-between;
|
|
7175
7196
|
}
|
|
7176
|
-
`;var
|
|
7197
|
+
`;var Sc=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 kc=class extends ue{constructor(){super(...arguments),this.title="Fees",this.fees=[],this.buildingFeesToQuantity={},this.handleQuantityChange=(e,t)=>{this.buildingFeesToQuantity[e]=t,this.requestUpdate()}}get totalAmount(){const e=this.fees.reduce((e,t)=>{var n;return e+(null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0)},0);return Br(e,2)}get groupedRentableItems(){const e=this.fees.filter(e=>e.sourceRentableItem);e.sort((e,t)=>{var n,i;const r=(null===(n=e.sourceRentableItem)||void 0===n?void 0:n.description)||"",o=(null===(i=t.sourceRentableItem)||void 0===i?void 0:i.description)||"";return r.localeCompare(o,navigator.language,{numeric:!0})});const t={};return e.forEach(e=>{var n;const i=(null===(n=e.sourceRentableItem)||void 0===n?void 0:n.description)||"unknown";t[i]||(t[i]=[]),t[i].push(e)}),t}get nonRentableItems(){return this.fees.filter(e=>!e.sourceRentableItem)}render(){return H`
|
|
7177
7198
|
<div class="fee-card-section-container">
|
|
7178
7199
|
<div class="fee-card-section-header">
|
|
7179
7200
|
<h1 class="section-title">${this.title}</h1>
|
|
@@ -7197,7 +7218,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7197
7218
|
</div>
|
|
7198
7219
|
</div>
|
|
7199
7220
|
</div>
|
|
7200
|
-
`}}
|
|
7221
|
+
`}};kc.styles=$c,Sc([pe({type:String})],kc.prototype,"title",void 0),Sc([pe({type:Array})],kc.prototype,"fees",void 0),Sc([fe()],kc.prototype,"buildingFeesToQuantity",void 0),kc=Sc([ce("fee-card")],kc);const Ac=p`
|
|
7201
7222
|
:host {
|
|
7202
7223
|
--transition-timing: 0.2s ease;
|
|
7203
7224
|
display: flex;
|
|
@@ -7406,7 +7427,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7406
7427
|
font-weight: bold;
|
|
7407
7428
|
color: #0066cc;
|
|
7408
7429
|
}
|
|
7409
|
-
`;var
|
|
7430
|
+
`;var Tc;!function(e){e.NEVER="NEVER",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(Tc||(Tc={}));var Ec=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};const _c=["num_cats","num_dogs","num_other_pets"];let Oc=class extends ue{constructor(){super(...arguments),this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1,num_cats:0,num_dogs:0,num_other_pets:0},this.onChargeInputsChange=null,this.disabled=!1,this.maxPets=null,this.rentableItems=[],this.selectedRentableItems=[],this.onRentableItemAdd=null,this.onRentableItemRemove=null,this.handleRentableItemToggle=e=>{var t,n;if(this.selectedRentableItems.some(t=>t.type===e.type)){const n=this.selectedRentableItems.find(t=>t.type===e.type);n&&(null===(t=this.onRentableItemRemove)||void 0===t||t.call(this,n))}else{const t=e.minAvailableItem||e.allItems[0];if(t){const i={id:t.id,type:e.type};null===(n=this.onRentableItemAdd)||void 0===n||n.call(this,i)}}}}get totalPets(){var e,t,n;return(null!==(e=this.chargeInputs.num_cats)&&void 0!==e?e:0)+(null!==(t=this.chargeInputs.num_dogs)&&void 0!==t?t:0)+(null!==(n=this.chargeInputs.num_other_pets)&&void 0!==n?n:0)}isAtPetLimit(e){return null!==this.maxPets&&_c.includes(e)&&this.totalPets>=this.maxPets}handleIncrement(e){var t,n;if(this.isAtPetLimit(e))return;const i=(null!==(t=this.chargeInputs[e])&&void 0!==t?t:0)+1;_c.includes(e)?this.updatePetCount({[e]:i}):null===(n=this.onChargeInputsChange)||void 0===n||n.call(this,{[e]:i})}handleDecrement(e){var t,n;const i=null!==(t=this.chargeInputs[e])&&void 0!==t?t:0,r="num_applicants"===e?1:0,o=Math.max(r,i-1);_c.includes(e)?this.updatePetCount({[e]:o}):null===(n=this.onChargeInputsChange)||void 0===n||n.call(this,{[e]:o})}updatePetCount(e){var t,n,i,r;const o={...this.chargeInputs,...e},a=(null!==(t=o.num_cats)&&void 0!==t?t:0)+(null!==(n=o.num_dogs)&&void 0!==n?n:0)+(null!==(i=o.num_other_pets)&&void 0!==i?i:0);null===(r=this.onChargeInputsChange)||void 0===r||r.call(this,{...e,num_pets:a})}getFieldLabel(e){return{base_rent:"Base Rent ($)",num_pets:"Pets",num_vehicles:"Vehicles",num_applicants:"Applicants",num_cats:"Cats",num_dogs:"Dogs",num_other_pets:"All Other Pets"}[e]||e}renderRentableItemRow(e){const t=this.selectedRentableItems.some(t=>t.type===e.type);return H`
|
|
7410
7431
|
<div class="rentable-item-row">
|
|
7411
7432
|
<div class="rentable-item-info">
|
|
7412
7433
|
<div class="rentable-item-label">${e.description}</div>
|
|
@@ -7455,7 +7476,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7455
7476
|
${["num_applicants","num_cats","num_dogs","num_other_pets"].map(e=>this.renderChargeInputRow(e))}
|
|
7456
7477
|
${null!==this.maxPets?H`
|
|
7457
7478
|
<div class="charge-input-note">
|
|
7458
|
-
${
|
|
7479
|
+
${uc(this.maxPets)}
|
|
7459
7480
|
</div>
|
|
7460
7481
|
`:""}
|
|
7461
7482
|
</div>
|
|
@@ -7467,7 +7488,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7467
7488
|
</div>
|
|
7468
7489
|
`:""}
|
|
7469
7490
|
</div>
|
|
7470
|
-
`}};
|
|
7491
|
+
`}};Oc.styles=p`
|
|
7471
7492
|
.charge-inputs-container {
|
|
7472
7493
|
background: white;
|
|
7473
7494
|
border-radius: 8px;
|
|
@@ -7601,7 +7622,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7601
7622
|
opacity: 0.5;
|
|
7602
7623
|
cursor: not-allowed;
|
|
7603
7624
|
}
|
|
7604
|
-
`,
|
|
7625
|
+
`,Ec([pe({type:Object})],Oc.prototype,"chargeInputs",void 0),Ec([pe()],Oc.prototype,"onChargeInputsChange",void 0),Ec([pe({type:Boolean})],Oc.prototype,"disabled",void 0),Ec([pe({type:Number})],Oc.prototype,"maxPets",void 0),Ec([pe({type:Array})],Oc.prototype,"rentableItems",void 0),Ec([pe({type:Array})],Oc.prototype,"selectedRentableItems",void 0),Ec([pe()],Oc.prototype,"onRentableItemAdd",void 0),Ec([pe()],Oc.prototype,"onRentableItemRemove",void 0),Oc=Ec([ce("charge-inputs")],Oc);const Pc=p`
|
|
7605
7626
|
:host {
|
|
7606
7627
|
--skeleton-bg-color: #eaeaea;
|
|
7607
7628
|
--skeleton-highlight-color: #f5f5f5;
|
|
@@ -7615,8 +7636,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7615
7636
|
background-position: 200px 0;
|
|
7616
7637
|
}
|
|
7617
7638
|
}
|
|
7618
|
-
`,
|
|
7619
|
-
${
|
|
7639
|
+
`,Ic=p`
|
|
7640
|
+
${Pc}
|
|
7620
7641
|
|
|
7621
7642
|
:host {
|
|
7622
7643
|
display: block;
|
|
@@ -7681,8 +7702,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7681
7702
|
margin-bottom: 10px;
|
|
7682
7703
|
}
|
|
7683
7704
|
}
|
|
7684
|
-
`,
|
|
7685
|
-
${
|
|
7705
|
+
`,Nc=p`
|
|
7706
|
+
${Pc}
|
|
7686
7707
|
|
|
7687
7708
|
:host {
|
|
7688
7709
|
display: block;
|
|
@@ -7704,23 +7725,23 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7704
7725
|
box-sizing: border-box;
|
|
7705
7726
|
}
|
|
7706
7727
|
}
|
|
7707
|
-
`;var
|
|
7728
|
+
`;var Mc=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 Dc=class extends ue{constructor(){super(...arguments),this.rows=2,this.header=!0}render(){return H`
|
|
7708
7729
|
<div class="skeleton-card">
|
|
7709
7730
|
${this.header?H`<div class="skeleton-header"></div>`:""}
|
|
7710
7731
|
${Array(this.rows).fill(0).map(()=>H`<div class="skeleton-row"></div>`)}
|
|
7711
7732
|
</div>
|
|
7712
|
-
`}};
|
|
7733
|
+
`}};Dc.styles=Ic,Mc([pe({type:Number})],Dc.prototype,"rows",void 0),Mc([pe({type:Boolean})],Dc.prototype,"header",void 0),Dc=Mc([ce("skeleton-card")],Dc);var Lc=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 Rc=class extends ue{constructor(){super(...arguments),this.cards=3,this.rowsPerCard=[3,2,1]}render(){return H`
|
|
7713
7734
|
<div class="skeleton-loader">
|
|
7714
7735
|
${Array.from({length:this.cards},(e,t)=>{const n=Array.isArray(this.rowsPerCard)?this.rowsPerCard[t]||2:this.rowsPerCard;return H`<skeleton-card .rows=${n}></skeleton-card>`})}
|
|
7715
7736
|
</div>
|
|
7716
|
-
`}};
|
|
7737
|
+
`}};Rc.styles=Nc,Lc([pe({type:Number})],Rc.prototype,"cards",void 0),Lc([pe({type:Array})],Rc.prototype,"rowsPerCard",void 0),Rc=Lc([ce("skeleton-loader")],Rc);var Bc=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 Uc=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.showSkeletonLoader=!1,this.selectedUnit=null,this.quote=null,this.quoteError=null,this.layoutOptions=[],this.selectedLayoutIds=[tc],this.groupedFees={[Qd.ONE_TIME]:[],[Qd.MONTHLY]:[],[Qd.WEEKLY]:[],[Qd.BI_WEEKLY]:[],[Qd.ANNUALLY]:[],[Qd.DAILY]:[],[Qd.AS_NEEDED]:[],[Qd.NEVER]:[]},this.rentableItems=[],this.units=[],this.isLoadingUnits=!1,this.isLoadingLayouts=!1,this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1},this.onChargeInputsChange=null,this.maxPets=null,this.selectedRentableItems=[],this.onRentableItemAdd=null,this.onRentableItemRemove=null}get rentAsFeeQuote(){var e,t;return(null===(e=this.quote)||void 0===e?void 0:e.rentCost)?{marketableFee:{id:"rent",buildingId:this.quote.buildingId||0,feeName:"Rent",amount:this.quote.rentCost,amountDisplay:Br(this.quote.rentCost,2),minEstimate:null,maxEstimate:null,percentRentMin:null,percentRentMax:null,percentRent:null,frequency:Tc.MONTHLY,category:"Rent",hiddenReason:null,description:`Unit ${null===(t=this.selectedUnit)||void 0===t?void 0:t.unitNumber}`,additionalInfo:null,refundable:!1,unitIds:null,layoutIds:null,startDate:null,endDate:null,triggeredByEvent:null,externalKey:null,chargeCode:null,bundleKey:null,source:null,publicFacing:!0,perApplicant:!1,prorated:null,syncActive:!0},amountRange:{fixedValue:this.quote.rentCost,minValue:null,maxValue:null},chargeInputs:{baseRent:this.quote.rentCost,numPets:0,numDogs:0,numCats:0,numOtherPets:0,numVehicles:0,numApplicants:1,unitId:this.quote.unitId,layoutId:null},isAddon:!1}:null}renderRecurringFeeSection(e,t){return(null==t?void 0:t.length)?H` <fee-card .fees=${t} title=${e}></fee-card> `:null}renderFeeSections(){var e,t;const n=[],i=[{freq:Tc.ANNUALLY,title:"Yearly Charges"},{freq:Tc.MONTHLY,title:"Monthly Charges"},{freq:Tc.BI_WEEKLY,title:"Bi-Weekly Charges"},{freq:Tc.WEEKLY,title:"Weekly Charges"},{freq:Tc.DAILY,title:"Daily Charges"},{freq:Tc.ONE_TIME,title:"One-Time"},{freq:Tc.NEVER,title:"No Charges"}],r=null===(e=this.quote)||void 0===e?void 0:e.feeQuotes;for(const{freq:e,title:o}of i){if(!(null==r?void 0:r.length)&&e!==Tc.MONTHLY)continue;let i=null!==(t=null==r?void 0:r.filter(t=>{var n,i;if((null===(n=t.marketableFee)||void 0===n?void 0:n.frequency)===e){if(e===Tc.ONE_TIME){return["APPLICATION_SUBMISSION","APPLICATION_APPROVAL","LEASE_SIGNING","MOVE_IN"].includes((null===(i=t.marketableFee)||void 0===i?void 0:i.triggeredByEvent)||"")}return!0}return!!t.sourceRentableItem&&("monthly"===t.sourceRentableItem.rentFrequency&&e===Tc.MONTHLY||"annually"===t.sourceRentableItem.rentFrequency&&e===Tc.ANNUALLY)}))&&void 0!==t?t:[];if(e===Tc.MONTHLY){const e=this.rentAsFeeQuote;e&&(i=[e,...i])}const a=this.renderRecurringFeeSection(o,i);a&&n.push(a)}return n}renderTotalCost(){var e;if(!(null===(e=this.quote)||void 0===e?void 0:e.totalMonthlyCost))return null;const t=this.quote.totalMonthlyCost.fixedValue;return t?H`
|
|
7717
7738
|
<div class="total-cost-section">
|
|
7718
7739
|
<div class="total-cost-row">
|
|
7719
7740
|
<span class="total-cost-label">Total Monthly Cost:</span>
|
|
7720
7741
|
<span class="total-cost-amount">${Br(t,2)}</span>
|
|
7721
7742
|
</div>
|
|
7722
7743
|
</div>
|
|
7723
|
-
`:null}getQuoteErrorMessage(e){if("feeLimit"===e.type){return`${
|
|
7744
|
+
`:null}getQuoteErrorMessage(e){if("feeLimit"===e.type){return`${uc(Math.min(...e.violations.map(e=>e.limit)))}. Remove a pet to see your estimate.`}return"We couldn't calculate an estimate. Please adjust your selections or try again later."}renderFeesContent(){return this.selectedUnit?this.quoteError&&!this.showSkeletonLoader?H`
|
|
7724
7745
|
<div class="fees-container empty-state" role="alert">
|
|
7725
7746
|
<p class="quote-error-message">
|
|
7726
7747
|
${this.getQuoteErrorMessage(this.quoteError)}
|
|
@@ -7776,7 +7797,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7776
7797
|
|
|
7777
7798
|
${this.renderFeesContent()}
|
|
7778
7799
|
</div>
|
|
7779
|
-
`}};
|
|
7800
|
+
`}};Uc.styles=Ac,Bc([pe({type:String})],Uc.prototype,"buildingSlug",void 0),Bc([pe({type:Boolean})],Uc.prototype,"showSkeletonLoader",void 0),Bc([pe({type:Object})],Uc.prototype,"selectedUnit",void 0),Bc([pe({type:Object})],Uc.prototype,"quote",void 0),Bc([pe({type:Object})],Uc.prototype,"quoteError",void 0),Bc([pe({type:Array})],Uc.prototype,"layoutOptions",void 0),Bc([pe({type:Array})],Uc.prototype,"selectedLayoutIds",void 0),Bc([pe({type:Object})],Uc.prototype,"groupedFees",void 0),Bc([pe({type:Array})],Uc.prototype,"rentableItems",void 0),Bc([pe({type:Array})],Uc.prototype,"units",void 0),Bc([pe({type:Boolean})],Uc.prototype,"isLoadingUnits",void 0),Bc([pe({type:Boolean})],Uc.prototype,"isLoadingLayouts",void 0),Bc([pe()],Uc.prototype,"onSelectLayout",void 0),Bc([pe()],Uc.prototype,"onUnitSelect",void 0),Bc([pe()],Uc.prototype,"onMoveInDateChange",void 0),Bc([pe()],Uc.prototype,"onLeaseTermChange",void 0),Bc([pe({type:Object})],Uc.prototype,"chargeInputs",void 0),Bc([pe()],Uc.prototype,"onChargeInputsChange",void 0),Bc([pe({type:Number})],Uc.prototype,"maxPets",void 0),Bc([pe({type:Array})],Uc.prototype,"selectedRentableItems",void 0),Bc([pe()],Uc.prototype,"onRentableItemAdd",void 0),Bc([pe()],Uc.prototype,"onRentableItemRemove",void 0),Uc=Bc([ce("fee-calculator-layout")],Uc);var jc,Fc,Hc,zc;!function(e){e.OneTime="OneTime",e.Daily="Daily",e.Weekly="Weekly",e.BiWeekly="BiWeekly",e.Monthly="Monthly",e.Yearly="Yearly",e.Unknown="Unknown"}(jc||(jc={})),function(e){e.Debit="Debit",e.Credit="Credit"}(Fc||(Fc={})),function(e){e.Fixed="Fixed",e.UsageBased="UsageBased",e.Varies="Varies"}(Hc||(Hc={})),function(e){e.AdminFee="AdminFee",e.ApplicationFee="ApplicationFee",e.Concession="Concession",e.Insurance="Insurance",e.LateFee="LateFee",e.Legal="Legal",e.NonSufficientFundFee="NSF",e.Other="Other",e.Parking="Parking",e.Penalty="Penalty",e.Pest="Pest",e.PetDeposit="PetDeposit",e.PetRent="PetRent",e.Refund="Refund",e.Relet="Relet",e.Rent="Rent",e.SecurityDeposit="SecurityDeposit",e.Storage="Storage",e.Trash="Trash",e.Utility="Utility",e.WaterSewer="WaterSewer"}(zc||(zc={}));const Gc=p`
|
|
7780
7801
|
:host {
|
|
7781
7802
|
display: block;
|
|
7782
7803
|
--table-header-bg: white;
|
|
@@ -7844,14 +7865,14 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7844
7865
|
color: #888;
|
|
7845
7866
|
font-style: italic;
|
|
7846
7867
|
}
|
|
7847
|
-
`;var
|
|
7868
|
+
`;var Vc=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 Wc=class extends ue{constructor(){super(...arguments),this.tooltip="",this.disabled=!1}render(){return H`
|
|
7848
7869
|
<div
|
|
7849
7870
|
class="tooltip-container ${this.disabled?"":"show-tooltip"}"
|
|
7850
7871
|
data-tooltip="${this.tooltip}"
|
|
7851
7872
|
>
|
|
7852
7873
|
<slot></slot>
|
|
7853
7874
|
</div>
|
|
7854
|
-
`}};
|
|
7875
|
+
`}};Wc.styles=p`
|
|
7855
7876
|
:host {
|
|
7856
7877
|
display: block;
|
|
7857
7878
|
position: relative;
|
|
@@ -7885,7 +7906,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7885
7906
|
opacity: 1;
|
|
7886
7907
|
visibility: visible;
|
|
7887
7908
|
}
|
|
7888
|
-
`,
|
|
7909
|
+
`,Vc([pe({type:String})],Wc.prototype,"tooltip",void 0),Vc([pe({type:Boolean,reflect:!0})],Wc.prototype,"disabled",void 0),Wc=Vc([ce("simple-tooltip")],Wc);const Qc=p`
|
|
7889
7910
|
:host {
|
|
7890
7911
|
display: inline-flex;
|
|
7891
7912
|
}
|
|
@@ -7944,7 +7965,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7944
7965
|
font-style: italic;
|
|
7945
7966
|
cursor: not-allowed;
|
|
7946
7967
|
}
|
|
7947
|
-
`;var
|
|
7968
|
+
`;var qc=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 Yc=class extends ue{constructor(){super(...arguments),this.feeItem=null,this._previousFeeItemId=null,this.onQuantityChange=null,this.disabled=!1,this.quantity=0}get maxQuantity(){var e,t;return null!==(t=null===(e=this.feeItem)||void 0===e?void 0:e.max_estimate)&&void 0!==t?t:10}updated(e){var t,n;if(!e.has("feeItem"))return;const i=null!==(n=null===(t=this.feeItem)||void 0===t?void 0:t.id)&&void 0!==n?n:null;i!==this._previousFeeItemId&&(this.quantity=0,this._previousFeeItemId=i)}handleIncrement(){this.disabled||this.quantity>=this.maxQuantity||(this.quantity+=1,this.notifyQuantityChange())}handleDecrement(){this.disabled||this.quantity<=0||(this.quantity=Math.max(0,this.quantity-1),this.notifyQuantityChange())}notifyQuantityChange(){this.onQuantityChange&&this.feeItem&&this.onQuantityChange({id:this.feeItem.id,quantities:[{itemType:this.feeItem.fee_name,quantity:this.quantity}]})}render(){return this.feeItem?H`
|
|
7948
7969
|
<div class="quantity-control ${this.disabled?"unavailable":""}">
|
|
7949
7970
|
<button
|
|
7950
7971
|
class="quantity-button"
|
|
@@ -7966,7 +7987,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7966
7987
|
<span class="operator-sign">+</span>
|
|
7967
7988
|
</button>
|
|
7968
7989
|
</div>
|
|
7969
|
-
`:H``}};
|
|
7990
|
+
`:H``}};Yc.styles=Qc,qc([pe({type:Object})],Yc.prototype,"feeItem",void 0),qc([pe()],Yc.prototype,"onQuantityChange",void 0),qc([pe({type:Boolean,reflect:!0})],Yc.prototype,"disabled",void 0),qc([pe({type:Number})],Yc.prototype,"quantity",void 0),Yc=qc([ce("table-addon-qty-selector")],Yc);let Kc=class extends ue{constructor(){super(...arguments),this.rentableItem=null,this._previousRentableItemType=null,this.onQuantityChange=null,this.disabled=!1,this.quantity=0,this.selectedItemIds=new Set}get totalAvailableItems(){var e,t,n;return null!==(n=null===(t=null===(e=this.rentableItem)||void 0===e?void 0:e.allItems)||void 0===t?void 0:t.filter(e=>e.available).length)&&void 0!==n?n:0}get maxSelectableItems(){return Math.min(this.totalAvailableItems,10)}get atMaxUnits(){return this.quantity>=this.maxSelectableItems}get atMinUnits(){return this.quantity<=0}updated(e){var t,n;if(e.has("rentableItem")){const e=null!==(n=null===(t=this.rentableItem)||void 0===t?void 0:t.type)&&void 0!==n?n:null;e!==this._previousRentableItemType&&(this.selectedItemIds=new Set,this._previousRentableItemType=e)}}handleIncrement(){this.disabled||this.atMaxUnits||this.emitChange(this.quantity+1)}handleDecrement(){this.disabled||this.atMinUnits||this.emitChange(Math.max(0,this.quantity-1))}emitChange(e){var t;this.rentableItem&&(null===(t=this.onQuantityChange)||void 0===t||t.call(this,{type:this.rentableItem.type,quantity:e}))}render(){if(!this.rentableItem)return H``;const e=this.totalAvailableItems>0,t=this.disabled||!e||this.atMaxUnits,n=this.disabled||this.quantity<=0;return H`
|
|
7970
7991
|
<div
|
|
7971
7992
|
class="quantity-control ${!e||this.disabled?"unavailable":""}"
|
|
7972
7993
|
>
|
|
@@ -7990,7 +8011,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7990
8011
|
<span class="operator-sign">+</span>
|
|
7991
8012
|
</button>
|
|
7992
8013
|
</div>
|
|
7993
|
-
`}};
|
|
8014
|
+
`}};Kc.styles=Qc,qc([pe({type:Object})],Kc.prototype,"rentableItem",void 0),qc([pe()],Kc.prototype,"onQuantityChange",void 0),qc([pe({type:Boolean,reflect:!0})],Kc.prototype,"disabled",void 0),qc([pe({type:Number})],Kc.prototype,"quantity",void 0),qc([pe({type:Set})],Kc.prototype,"selectedItemIds",void 0),Kc=qc([ce("table-rentable-item-qty-selector")],Kc);var Xc=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 Zc=class extends ue{constructor(){super(...arguments),this._addons=[],this.disabled=!1,this.onAddonSelect=null,this.onRentableItemAdd=null,this.onRentableItemRemove=null,this.quantities=new Map,this.selectedRentableItemIds=new Map,this.handleAddonQuantityChange=e=>{var t;const n=e.id;1!==e.quantities.length||Array.isArray(this.quantities.get(n))?this.quantities.set(n,e.quantities):this.quantities.set(n,e.quantities[0].quantity),this.requestUpdate("quantities"),null===(t=this.onAddonSelect)||void 0===t||t.call(this,e)},this.handleRentableItemQuantityChange=e=>{var t,n,i,r,o,a;const s=null!==(t=this.quantities.get(e.type))&&void 0!==t?t:0;this.quantities.set(e.type,e.quantity),this.requestUpdate("quantities");const l=this.addons.find(t=>t instanceof Wd&&t.type===e.type);if(!l)return;const u=null!==(n=this.selectedRentableItemIds.get(e.type))&&void 0!==n?n:new Set,d=(c=null!==(r=null===(i=l.allItems)||void 0===i?void 0:i.filter(e=>e.available))&&void 0!==r?r:[],[...c].sort((e,t)=>e.rent!==t.rent?e.rent-t.rent:e.id.localeCompare(t.id)));var c;if(e.quantity>s){const t=e.quantity-s;let n=0;const i=Math.min(d.length,10);if(u.size+t>i)return;for(const i of d){if(n>=t)break;u.has(i.id)||(u.add(i.id),null===(o=this.onRentableItemAdd)||void 0===o||o.call(this,{id:i.id,type:e.type}),n++)}}else if(e.quantity<s){const t=s-e.quantity;let n=0;const i=function(e){return[...e].sort((e,t)=>e.rent!==t.rent?t.rent-e.rent:t.id.localeCompare(e.id))}(d.filter(e=>u.has(e.id)));for(const r of i){if(n>=t)break;u.delete(r.id),null===(a=this.onRentableItemRemove)||void 0===a||a.call(this,{id:r.id,type:e.type}),n++}}this.selectedRentableItemIds.set(e.type,u),this.requestUpdate("selectedRentableItemIds")}}set addons(e){const t=this._addons;this._addons=e,e!==t&&this.initializeQuantities(),this.requestUpdate("addons",t)}get addons(){return this._addons}preserveExistingQuantity(e,t){const n=this.quantities.get(e);return null!=n?n:t}initializeRentableItemQuantity(e,t){const n=this.preserveExistingQuantity(e.type,0);t.set(e.type,n),this.selectedRentableItemIds.has(e.type)||this.selectedRentableItemIds.set(e.type,new Set)}initializeBuildingFeeQuantity(e,t){const n=e.id,i=this.preserveExistingQuantity(n,0);t.set(n,i)}initializeQuantities(){const e=new Map;this.addons.forEach(t=>{t instanceof Wd?this.initializeRentableItemQuantity(t,e):this.initializeBuildingFeeQuantity(t,e)}),this.quantities=e}getName(e){return e instanceof Wd?e.displayName:e.fee_name}getSortedAddons(){return[...this.addons].sort((e,t)=>{const n=this.getName(e),i=this.getName(t);return n.localeCompare(i,navigator.language,{numeric:!0})})}isRentableItemAvailable(e){var t,n;return!(e instanceof Wd)||(null!==(n=null===(t=e.allItems)||void 0===t?void 0:t.filter(e=>e.available).length)&&void 0!==n?n:0)>0}renderQtySelector(e){var t;if(e instanceof Wd){const n=null!==(t=this.quantities.get(e.type))&&void 0!==t?t:0;return H`
|
|
7994
8015
|
<table-rentable-item-qty-selector
|
|
7995
8016
|
.rentableItem=${e}
|
|
7996
8017
|
.quantity=${n}
|
|
@@ -8031,7 +8052,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8031
8052
|
</tbody>
|
|
8032
8053
|
</table>
|
|
8033
8054
|
</div>
|
|
8034
|
-
`:H`<div class="empty-state">No add-ons available</div> `}};
|
|
8055
|
+
`:H`<div class="empty-state">No add-ons available</div> `}};Zc.styles=Gc,Xc([pe({type:Array})],Zc.prototype,"addons",null),Xc([pe({type:Boolean})],Zc.prototype,"disabled",void 0),Xc([pe()],Zc.prototype,"onAddonSelect",void 0),Xc([pe({attribute:!1})],Zc.prototype,"onRentableItemAdd",void 0),Xc([pe({attribute:!1})],Zc.prototype,"onRentableItemRemove",void 0),Xc([fe()],Zc.prototype,"quantities",void 0),Xc([fe()],Zc.prototype,"selectedRentableItemIds",void 0),Zc=Xc([ce("addon-table")],Zc);var Jc=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 eh=class extends ue{constructor(){super(...arguments),this.id="",this.showChatAdditionalActions=!1,this.buildingWebchatView=null,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this.enabledChatWidgets={callDesktop:!1,chatDesktop:!1,emailDesktop:!1,textDesktop:!1,sstDesktop:!1},this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onClose=()=>{}}render(){var e,t,n;const i=this.primaryColor||Zn,r=this.backgroundColor||"#ffffff",o=this.buildingWebchatView&&ii(this.buildingWebchatView.orgId,this.buildingWebchatView.id)&&i!==Zn?ni(i,.6):"black";return H`
|
|
8035
8056
|
<style>
|
|
8036
8057
|
#${this.id}::after {
|
|
8037
8058
|
border-right-color: ${o} !important;
|
|
@@ -8063,7 +8084,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8063
8084
|
.onClick=${this.onClose}
|
|
8064
8085
|
></minimize-expand-button>
|
|
8065
8086
|
</div>
|
|
8066
|
-
`}};
|
|
8087
|
+
`}};eh.styles=p`
|
|
8067
8088
|
.hideTab {
|
|
8068
8089
|
display: none;
|
|
8069
8090
|
}
|
|
@@ -8073,7 +8094,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8073
8094
|
justify-content: space-between;
|
|
8074
8095
|
gap: 32px;
|
|
8075
8096
|
}
|
|
8076
|
-
`,
|
|
8097
|
+
`,Jc([pe({type:String})],eh.prototype,"id",void 0),Jc([pe({type:Boolean})],eh.prototype,"showChatAdditionalActions",void 0),Jc([pe({type:Object})],eh.prototype,"buildingWebchatView",void 0),Jc([pe({type:String})],eh.prototype,"primaryColor",void 0),Jc([pe({type:String})],eh.prototype,"backgroundColor",void 0),Jc([pe({type:String})],eh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Jc([pe({type:String})],eh.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Jc([pe({type:Object})],eh.prototype,"enabledChatWidgets",void 0),Jc([pe({attribute:!0})],eh.prototype,"onClickMinimize",void 0),Jc([pe({attribute:!0})],eh.prototype,"onClickEmailOption",void 0),Jc([pe({attribute:!0})],eh.prototype,"onClickPhoneOption",void 0),Jc([pe({attribute:!0})],eh.prototype,"onClickSSTOption",void 0),Jc([pe({attribute:!0})],eh.prototype,"onClose",void 0),eh=Jc([ce("chat-additional-actions")],eh);const th=p`
|
|
8077
8098
|
:host {
|
|
8078
8099
|
display: block;
|
|
8079
8100
|
}
|
|
@@ -8110,9 +8131,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8110
8131
|
font-size: 0.9rem;
|
|
8111
8132
|
opacity: 0.9;
|
|
8112
8133
|
}
|
|
8113
|
-
`;var
|
|
8134
|
+
`;var nh=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 ih=class extends ue{getFormattedEndDate(e){return new Date(e.endDate).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}render(){return this.incentive?H`
|
|
8114
8135
|
<div class="incentive-banner">
|
|
8115
|
-
<div class="incentive-icon">${
|
|
8136
|
+
<div class="incentive-icon">${dc({size:32})}</div>
|
|
8116
8137
|
<div class="incentive-content">
|
|
8117
8138
|
<h2 class="incentive-title">
|
|
8118
8139
|
${this.incentive.originalIncentiveString}
|
|
@@ -8123,7 +8144,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8123
8144
|
</p>
|
|
8124
8145
|
</div>
|
|
8125
8146
|
</div>
|
|
8126
|
-
`:H``}};
|
|
8147
|
+
`:H``}};ih.styles=th,nh([pe({type:Object})],ih.prototype,"incentive",void 0),ih=nh([ce("incentive-banner")],ih);var rh=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 oh=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=Zn,this.backgroundColor=Jn,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isCalculatingQuote=!1,this.isLoadingLayouts=!0,this.isExporting=!1,this.selectedLayoutIds=[tc],this.selectedUnit=null,this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1,num_cats:0,num_dogs:0,num_other_pets:0},this.desiredRentableItems=[],this.moveInDateString=oc(),this.leaseTerm=12,this.buildingWebchatView=null,this.incentives=[],this.quote=null,this.pdfUrl=null,this.quoteError=null,this.groupedFees={[Qd.ONE_TIME]:[],[Qd.MONTHLY]:[],[Qd.WEEKLY]:[],[Qd.BI_WEEKLY]:[],[Qd.ANNUALLY]:[],[Qd.DAILY]:[],[Qd.AS_NEEDED]:[],[Qd.NEVER]:[]},this.rentableItems=[],this.maxPets=null,this.units=[],this.isLoadingUnits=!0,this.quoteAbortController=null,this.quoteDebounceTimer=null,this.startQuoteApiCall=async()=>{var e;null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=new AbortController,this.isCalculatingQuote=!0,await this.performQuoteCalculation(this.quoteAbortController.signal)},this.firstUpdated=async()=>{this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor),await Promise.allSettled([this.setupCalculator(),this.fetchUnits()])},this.setupCalculator=async()=>{if(!this.buildingSlug||!this.orgSlug)return void(this.isLoadingLayouts=!1);const e=wa(this.orgSlug,this.buildingSlug).then(e=>{e&&(this.buildingWebchatView=e)}).finally(()=>{this.isLoadingLayouts=!1}),t=ec(this.buildingSlug).then(e=>{e&&(this.groupedFees=this.groupFees(e.fees),this.maxPets=function(e){const t=e.filter(e=>lc.includes(e.category)).map(e=>e.limit).filter(e=>"number"==typeof e);return t.length?Math.min(...t):null}(e.fees),this.rentableItems=e.rentableItems)});await Promise.allSettled([e,t])},this.requestQuoteCalculation=()=>{if(this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),!this.selectedUnit||!this.moveInDateString)return this.clearQuote(),void(this.isCalculatingQuote=!1);this.quoteDebounceTimer=window.setTimeout(()=>{this.startQuoteApiCall(),this.quoteDebounceTimer=null},1e3)},this.handleUnitSelect=e=>{const t=!this.selectedUnit;if(this.selectedUnit=e,t)return this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),this.isCalculatingQuote=!0,void this.startQuoteApiCall();this.requestQuoteCalculation()},this.handleMoveInDateChange=async e=>{this.moveInDateString=e,this.clearQuote(),await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleLeaseTermChange=async e=>{this.leaseTerm=e,this.clearQuote(),await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleChargeInputsChange=e=>{this.chargeInputs={...this.chargeInputs,...e},this.requestQuoteCalculation()},this.handleRentableItemAdd=e=>{this.desiredRentableItems.some(t=>t.id===e.id)||this.desiredRentableItems.push(e),this.requestQuoteCalculation()},this.handleRentableItemRemove=e=>{this.desiredRentableItems=this.desiredRentableItems.filter(t=>t.id!==e.id),this.requestQuoteCalculation()},this.groupFees=e=>e.reduce((e,t)=>{const n=t.frequency||Qd.ONE_TIME;return e[n]=[...e[n]||[],t],e},{}),this.handleClickEmailOption=e=>{this.handleClose(),this.onClickEmailOption&&this.onClickEmailOption(e)},this.handleClickPhoneOption=e=>{this.handleClose(),this.onClickPhoneOption&&this.onClickPhoneOption(e)},this.handleClickSSTOption=e=>{this.handleClose(),this.onClickSSTOption&&this.onClickSSTOption(e)},this.handleClickTextUsOption=e=>{this.handleClose(),this.onClickTextUsOption&&this.onClickTextUsOption(e)},this.handleClose=()=>{var e;null===(e=this.onCloseClicked)||void 0===e||e.call(this)},this.handleSelectLayout=async e=>{this.selectedLayoutIds=e,await this.fetchUnits()},this.handleShare=async()=>{var e,t;this.selectedUnit&&this.moveInDateString&&this.pdfUrl&&(Lo("feeCalculatorPdfDownloaded",{buildingSlug:this.buildingSlug,quoteId:null!==(t=null===(e=this.quote)||void 0===e?void 0:e.id)&&void 0!==t?t:null}),window.open(this.pdfUrl,"_blank"))},this.fetchUnits=async()=>{let e;this.isLoadingUnits=!0,this.selectedLayoutIds.includes(tc)||(e=this.selectedLayoutIds.map(e=>Ld(e)));try{if(this.units=await sc({buildingSlug:this.buildingSlug,moveInDateString:this.moveInDateString,...e?{numBedrooms:e}:{},leaseTerm:this.leaseTerm}),this.selectedUnit){this.units.some(e=>{var t;return e.id===(null===(t=this.selectedUnit)||void 0===t?void 0:t.id)})||(this.selectedUnit=null,this.clearQuote())}}finally{this.isLoadingUnits=!1}}}clearQuote(){this.quote=null,this.pdfUrl=null,this.quoteError=null}async performQuoteCalculation(e){var t;if(!this.selectedUnit||!this.moveInDateString)return this.clearQuote(),void(this.isCalculatingQuote=!1);const n=this.moveInDateString,i=this.selectedUnit.id,r=this.leaseTerm;try{const o=await ic({buildingSlug:this.buildingSlug,unitId:i,chargeInputs:this.chargeInputs,rentableItems:this.desiredRentableItems,leaseTerm:r,moveInDate:n},e);if(e.aborted)return;this.quote=o.quote,this.pdfUrl=o.pdfUrl||null,this.quoteError=null!==(t=o.error)&&void 0!==t?t:null,this.quote&&Lo("feeCalculatorQuoteGenerated",{buildingSlug:this.buildingSlug,unitId:i,leaseTerm:r})}catch(e){"AbortError"!==(null==e?void 0:e.name)&&(this.quote=null,this.pdfUrl=null,this.quoteError={type:"unknown"},this.isCalculatingQuote=!1,Ao({logType:ko.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:e},error:e}))}finally{e.aborted||(this.isCalculatingQuote=!1)}}get layouts(){var e,t;return null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.layoutOptions)&&void 0!==t?t:[]}updated(e){(e.has("primaryColor")||e.has("backgroundColor"))&&(this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor))}disconnectedCallback(){var e;super.disconnectedCallback(),this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=null}render(){var e,t;const n=this.isExporting||this.isCalculatingQuote||!this.selectedUnit||!this.moveInDateString||!this.pdfUrl;return H`
|
|
8127
8148
|
<div
|
|
8128
8149
|
class="fee-calculator-container"
|
|
8129
8150
|
@keydown=${e=>e.stopPropagation()}
|
|
@@ -8205,7 +8226,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8205
8226
|
</div>
|
|
8206
8227
|
`:""}
|
|
8207
8228
|
</div>
|
|
8208
|
-
`}};
|
|
8229
|
+
`}};oh.styles=Gd,rh([pe({attribute:!0})],oh.prototype,"buildingSlug",void 0),rh([pe({attribute:!0})],oh.prototype,"orgSlug",void 0),rh([pe({type:String})],oh.prototype,"primaryColor",void 0),rh([pe({type:String})],oh.prototype,"backgroundColor",void 0),rh([pe()],oh.prototype,"onCloseClicked",void 0),rh([pe()],oh.prototype,"onClickEmailOption",void 0),rh([pe()],oh.prototype,"onClickPhoneOption",void 0),rh([pe()],oh.prototype,"onClickSSTOption",void 0),rh([pe()],oh.prototype,"onClickTextUsOption",void 0),rh([fe()],oh.prototype,"isCalculatingQuote",void 0),rh([fe()],oh.prototype,"isLoadingLayouts",void 0),rh([fe()],oh.prototype,"isExporting",void 0),rh([fe()],oh.prototype,"selectedLayoutIds",void 0),rh([fe()],oh.prototype,"selectedUnit",void 0),rh([fe()],oh.prototype,"chargeInputs",void 0),rh([fe()],oh.prototype,"desiredRentableItems",void 0),rh([fe()],oh.prototype,"moveInDateString",void 0),rh([fe()],oh.prototype,"leaseTerm",void 0),rh([fe()],oh.prototype,"buildingWebchatView",void 0),rh([fe()],oh.prototype,"incentives",void 0),rh([fe()],oh.prototype,"quote",void 0),rh([fe()],oh.prototype,"pdfUrl",void 0),rh([fe()],oh.prototype,"quoteError",void 0),rh([fe()],oh.prototype,"groupedFees",void 0),rh([fe()],oh.prototype,"rentableItems",void 0),rh([fe()],oh.prototype,"maxPets",void 0),rh([fe()],oh.prototype,"units",void 0),rh([fe()],oh.prototype,"isLoadingUnits",void 0),oh=rh([ce("fee-calculator")],oh);const ah=p`
|
|
8209
8230
|
#minimize-mobile {
|
|
8210
8231
|
position: absolute;
|
|
8211
8232
|
top: -12px;
|
|
@@ -8254,9 +8275,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8254
8275
|
justify-content: center;
|
|
8255
8276
|
align-items: center;
|
|
8256
8277
|
}
|
|
8257
|
-
`,
|
|
8278
|
+
`,sh=(e="white")=>z`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 16 14" fill="none">
|
|
8258
8279
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.46964 0.488343H9.53036C10.898 0.488331 11.9813 0.488321 12.829 0.602304C13.7015 0.719609 14.4077 0.966767 14.9647 1.52369C15.5216 2.08061 15.7687 2.78681 15.886 3.65932C16 4.50711 16 5.59038 16 6.95802V7.04198C16 8.40962 16 9.49289 15.886 10.3407C15.7687 11.2132 15.5216 11.9194 14.9647 12.4763C14.4077 13.0332 13.7015 13.2804 12.829 13.3977C11.9813 13.5117 10.898 13.5117 9.53035 13.5117H6.46965C5.10201 13.5117 4.01875 13.5117 3.17096 13.3977C2.29846 13.2804 1.59227 13.0332 1.03534 12.4763C0.478423 11.9194 0.231266 11.2132 0.113961 10.3407C-2.09587e-05 9.49289 -1.15596e-05 8.40962 2.39342e-07 7.04198V6.95801C-1.15596e-05 5.59037 -2.09587e-05 4.50711 0.113961 3.65932C0.231266 2.78681 0.478423 2.08061 1.03534 1.52369C1.59227 0.966767 2.29846 0.719609 3.17096 0.602304C4.01875 0.488321 5.10201 0.488331 6.46964 0.488343ZM3.3197 1.70863C2.57098 1.8093 2.13962 1.99807 1.82467 2.31302C1.50973 2.62797 1.32095 3.05934 1.22029 3.80806C1.11746 4.57283 1.11628 5.58096 1.11628 7C1.11628 8.41903 1.11746 9.42716 1.22029 10.1919C1.32095 10.9407 1.50973 11.372 1.82467 11.687C2.13962 12.0019 2.57098 12.1907 3.3197 12.2914C4.08447 12.3942 5.0926 12.3954 6.51163 12.3954H9.48837C10.9074 12.3954 11.9155 12.3942 12.6803 12.2914C13.429 12.1907 13.8604 12.0019 14.1753 11.687C14.4903 11.372 14.6791 10.9407 14.7797 10.1919C14.8825 9.42716 14.8837 8.41903 14.8837 7C14.8837 5.58096 14.8825 4.57283 14.7797 3.80806C14.6791 3.05934 14.4903 2.62797 14.1753 2.31302C13.8604 1.99807 13.429 1.8093 12.6803 1.70863C11.9155 1.60581 10.9074 1.60463 9.48837 1.60463H6.51163C5.0926 1.60463 4.08448 1.60581 3.3197 1.70863ZM3.10611 3.66593C3.30345 3.42912 3.65539 3.39713 3.8922 3.59446L5.49882 4.93332C6.19311 5.5119 6.67515 5.9123 7.08211 6.17404C7.47605 6.42741 7.7432 6.51246 8 6.51246C8.2568 6.51246 8.52395 6.42741 8.91789 6.17404C9.32485 5.9123 9.80689 5.5119 10.5012 4.93332L12.1078 3.59446C12.3446 3.39713 12.6966 3.42912 12.8939 3.66593C13.0912 3.90273 13.0592 4.25468 12.8224 4.45202L11.1878 5.81419C10.5282 6.36389 9.99359 6.80943 9.52173 7.11291C9.0302 7.42904 8.5515 7.62875 8 7.62875C7.4485 7.62875 6.9698 7.42904 6.47827 7.11291C6.00641 6.80943 5.47179 6.36389 4.81218 5.81419L3.17757 4.45202C2.94077 4.25468 2.90877 3.90273 3.10611 3.66593Z" fill="${e}"/>
|
|
8259
|
-
</svg>`,
|
|
8280
|
+
</svg>`,lh=(e="black")=>z`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="18" viewBox="0 0 16 18" fill="none">
|
|
8260
8281
|
<path d="M15.6825 6.11855H0.00653076C0.0588276 4.00052 1.79117 2.30087 3.92226 2.30087H4.41255V3.6083C4.41255 3.88285 4.63481 4.09858 4.90283 4.09858C5.17085 4.09858 5.39311 3.88285 5.39311 3.6083V2.30087H10.2959V3.6083C10.2959 3.88285 10.5182 4.09858 10.7862 4.09858C11.0542 4.09858 11.2765 3.88285 11.2765 3.6083V2.30087H11.7668C13.8979 2.30087 15.6302 4.00052 15.6825 6.11855Z" fill="${e}"/>
|
|
8261
8282
|
<path d="M15.0641 7.39731V14.0677C15.0641 15.8922 13.5861 17.365 11.7668 17.365H3.92227C2.10298 17.365 0.625 15.8922 0.625 14.0677V7.39731H15.0641Z" fill="transparent" stroke="${e}" stroke-width="1.25"/>
|
|
8262
8283
|
<path d="M4.90283 1V2.30742" stroke="${e}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -8264,14 +8285,14 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8264
8285
|
<path d="M0 6.11862H0.00653352C-3.5908e-06 6.15131 0 6.19053 0 6.22322V6.11862Z" fill="white"/>
|
|
8265
8286
|
<path d="M15.689 6.11862V6.22322C15.689 6.19053 15.689 6.15131 15.6825 6.11862H15.689Z" fill="white"/>
|
|
8266
8287
|
<path d="M4.74594 11.9562L6.56326 13.7735C6.8182 14.0285 7.23004 14.0285 7.48499 13.7735L10.9366 10.3219" stroke="${e}" stroke-miterlimit="10" stroke-linecap="round"/>
|
|
8267
|
-
</svg>`,
|
|
8288
|
+
</svg>`,uh=(e="white")=>z`
|
|
8268
8289
|
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
8269
8290
|
<path
|
|
8270
8291
|
fill-rule="evenodd"
|
|
8271
8292
|
clip-rule="evenodd"
|
|
8272
8293
|
d="M6.64026 0.25H8.8598C10.0157 0.249995 10.9219 0.249992 11.6459 0.318826C12.3838 0.388987 12.988 0.534458 13.5206 0.860861C14.0784 1.20267 14.5474 1.67164 14.8892 2.22942C15.2156 2.76206 15.3611 3.36627 15.4312 4.10419C15.5001 4.82813 15.5001 5.73432 15.5001 6.89025V7.65964C15.5001 8.48243 15.5001 9.12755 15.4645 9.64868C15.4283 10.1789 15.3535 10.6202 15.1845 11.0283C14.7638 12.044 13.9568 12.851 12.9411 13.2717C12.3607 13.5121 11.6997 13.5654 10.7947 13.581C10.4782 13.5865 10.2777 13.5905 10.1248 13.6074C9.98202 13.6232 9.92665 13.6464 9.89426 13.6652C9.86008 13.6851 9.81351 13.7213 9.73267 13.8323C9.64518 13.9523 9.54632 14.1182 9.38955 14.3831L8.99874 15.0433C8.44104 15.9856 7.05899 15.9856 6.5013 15.0433L6.11048 14.3831C5.95371 14.1182 5.85485 13.9523 5.76736 13.8323C5.68652 13.7213 5.63995 13.6851 5.60577 13.6652C5.57338 13.6464 5.51801 13.6232 5.37519 13.6074C5.22235 13.5905 5.02184 13.5865 4.70528 13.581C3.80031 13.5654 3.13933 13.5121 2.559 13.2717C1.54327 12.851 0.736277 12.044 0.315547 11.0283C0.146515 10.6202 0.0717299 10.1789 0.0355529 9.64868C-4.05001e-06 9.12754 -2.20251e-06 8.48243 1.60891e-07 7.65963L7.4949e-08 6.89026C-4.52294e-06 5.73432 -8.08928e-06 4.82814 0.0688256 4.10419C0.138987 3.36627 0.284458 2.76206 0.610861 2.22942C0.95267 1.67164 1.42164 1.20267 1.97942 0.860861C2.51206 0.534458 3.11627 0.388987 3.85419 0.318826C4.57814 0.249992 5.48432 0.249995 6.64026 0.25ZM3.95654 1.39537C3.29779 1.458 2.87862 1.57812 2.54445 1.78291C2.13217 2.03555 1.78555 2.38217 1.53291 2.79445C1.32812 3.12862 1.208 3.54779 1.14537 4.20654C1.08197 4.87334 1.0814 5.7282 1.0814 6.91863V7.63956C1.0814 8.48674 1.08169 9.09505 1.11444 9.57507C1.14686 10.0502 1.20927 10.3601 1.31463 10.6144C1.6256 11.3652 2.22208 11.9617 2.97284 12.2726C3.34458 12.4266 3.81883 12.4842 4.72391 12.4998L4.74685 12.5002C5.03378 12.5051 5.28522 12.5094 5.49421 12.5326C5.71878 12.5574 5.9384 12.6077 6.14946 12.7304C6.35874 12.8522 6.50969 13.0148 6.64128 13.1953C6.76287 13.3622 6.88783 13.5733 7.02936 13.8124L7.4319 14.4925C7.57086 14.7273 7.92917 14.7273 8.06813 14.4925L8.47067 13.8124C8.6122 13.5733 8.73716 13.3622 8.85875 13.1953C8.99034 13.0148 9.14129 12.8522 9.35057 12.7304C9.56163 12.6077 9.78126 12.5574 10.0058 12.5326C10.2148 12.5094 10.4662 12.5051 10.7532 12.5002L10.7761 12.4998C11.6812 12.4842 12.1555 12.4266 12.5272 12.2726C13.278 11.9617 13.8745 11.3652 14.1854 10.6144C14.2908 10.3601 14.3532 10.0502 14.3856 9.57507C14.4184 9.09505 14.4187 8.48674 14.4187 7.63956V6.91863C14.4187 5.7282 14.4181 4.87334 14.3547 4.20654C14.2921 3.54779 14.1719 3.12862 13.9672 2.79445C13.7145 2.38217 13.3679 2.03555 12.9556 1.78291C12.6214 1.57812 12.2023 1.458 11.5435 1.39537C10.8767 1.33197 10.0219 1.3314 8.83143 1.3314H6.66863C5.4782 1.3314 4.62334 1.33197 3.95654 1.39537ZM7.75003 3.85467C8.04865 3.85467 8.29073 4.09674 8.29073 4.39536V10.1628C8.29073 10.4614 8.04865 10.7035 7.75003 10.7035C7.45141 10.7035 7.20933 10.4614 7.20933 10.1628V4.39536C7.20933 4.09674 7.45141 3.85467 7.75003 3.85467ZM4.8663 5.29653C5.16492 5.29653 5.407 5.53861 5.407 5.83723V8.72096C5.407 9.01958 5.16492 9.26166 4.8663 9.26166C4.56768 9.26166 4.3256 9.01958 4.3256 8.72096V5.83723C4.3256 5.53861 4.56768 5.29653 4.8663 5.29653ZM10.6338 5.29653C10.9324 5.29653 11.1745 5.53861 11.1745 5.83723V8.72096C11.1745 9.01958 10.9324 9.26166 10.6338 9.26166C10.3351 9.26166 10.0931 9.01958 10.0931 8.72096V5.83723C10.0931 5.53861 10.3351 5.29653 10.6338 5.29653Z"
|
|
8273
8294
|
fill="${e}"/>
|
|
8274
|
-
</svg>`,
|
|
8295
|
+
</svg>`,dh=(e="white")=>z`<svg aria-hidden="true" focusable="false" width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8275
8296
|
<g clip-path="url(#clip0_18382_27345)">
|
|
8276
8297
|
<g clip-path="url(#clip1_18382_27345)">
|
|
8277
8298
|
<path d="M9.91666 0.625V3.45833C9.91666 3.6462 9.99128 3.82636 10.1241 3.9592C10.257 4.09204 10.4371 4.16667 10.625 4.16667H13.4583" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -8288,7 +8309,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8288
8309
|
</clipPath>
|
|
8289
8310
|
</defs>
|
|
8290
8311
|
</svg>
|
|
8291
|
-
`,
|
|
8312
|
+
`,ch=(e="white",t=20,n=-2)=>z`
|
|
8292
8313
|
<svg
|
|
8293
8314
|
aria-hidden="true"
|
|
8294
8315
|
focusable="false"
|
|
@@ -8363,7 +8384,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8363
8384
|
</clipPath>
|
|
8364
8385
|
</defs>
|
|
8365
8386
|
</svg>
|
|
8366
|
-
`;var
|
|
8387
|
+
`;var hh=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 ph=class extends ue{constructor(){super(...arguments),this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onClickApplyNowOption=()=>{},this.onClickPriceCalculatorOption=()=>{},this.onChatTapped=()=>{},this.hideChat=!1,this.isMobileDesign=!1,this.primaryColor=Zn,this.backgroundColor=Jn,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasCallUsEnabled=!1,this.hasTextUsEnabled=!1,this.hasSSTEnabled=!1,this.hasApplyNowEnabled=!1,this.hasPricingCalculatorEnabled=!1,this.applicationLink="",this.overrideRentgrata=!1,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.renderListElement=(e,t,n,i)=>e?H` <li>
|
|
8367
8388
|
<button
|
|
8368
8389
|
@click=${t}
|
|
8369
8390
|
class="typeMobile-bttn"
|
|
@@ -8379,12 +8400,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8379
8400
|
</button>
|
|
8380
8401
|
</li>`:""}render(){return H`<div class="typeMobile-list">
|
|
8381
8402
|
<ul>
|
|
8382
|
-
${this.renderListElement(!(!this.hasApplyNowEnabled||!this.applicationLink),this.onClickApplyNowOption,
|
|
8383
|
-
${this.renderListElement(this.hasPricingCalculatorEnabled,this.onClickPriceCalculatorOption,
|
|
8384
|
-
${this.renderListElement(this.hasEmailEnabled,this.onClickEmailOption,
|
|
8385
|
-
${this.renderListElement(this.hasCallUsEnabled||this.hasTextUsEnabled,this.onClickPhoneOption,
|
|
8386
|
-
${this.renderListElement(this.hasSSTEnabled,this.onClickSSTOption,
|
|
8387
|
-
${this.renderListElement(this.hasChatEnabled&&!this.hideChat,this.onChatTapped,
|
|
8403
|
+
${this.renderListElement(!(!this.hasApplyNowEnabled||!this.applicationLink),this.onClickApplyNowOption,dh(this.foregroundColorOnSecondaryBackgroundColor),"Apply now")}
|
|
8404
|
+
${this.renderListElement(this.hasPricingCalculatorEnabled,this.onClickPriceCalculatorOption,ch(this.foregroundColorOnSecondaryBackgroundColor),"Price calculator")}
|
|
8405
|
+
${this.renderListElement(this.hasEmailEnabled,this.onClickEmailOption,sh(this.foregroundColorOnSecondaryBackgroundColor),"Email us")}
|
|
8406
|
+
${this.renderListElement(this.hasCallUsEnabled||this.hasTextUsEnabled,this.onClickPhoneOption,ju(this.foregroundColorOnSecondaryBackgroundColor),"Call or text us")}
|
|
8407
|
+
${this.renderListElement(this.hasSSTEnabled,this.onClickSSTOption,lh(this.foregroundColorOnSecondaryBackgroundColor),"Book a tour")}
|
|
8408
|
+
${this.renderListElement(this.hasChatEnabled&&!this.hideChat,this.onChatTapped,uh(this.foregroundColorOnSecondaryBackgroundColor),"Chat with us")}
|
|
8388
8409
|
${this.isMobileDesign||this.hideChat?"":H`
|
|
8389
8410
|
<li>
|
|
8390
8411
|
<minimize-expand-button
|
|
@@ -8396,18 +8417,18 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8396
8417
|
</li>
|
|
8397
8418
|
`}
|
|
8398
8419
|
</ul>
|
|
8399
|
-
</div>`}};
|
|
8420
|
+
</div>`}};ph.styles=[ah],hh([pe({attribute:!0})],ph.prototype,"onClickMinimize",void 0),hh([pe({attribute:!0})],ph.prototype,"onClickEmailOption",void 0),hh([pe({attribute:!0})],ph.prototype,"onClickPhoneOption",void 0),hh([pe({attribute:!0})],ph.prototype,"onClickSSTOption",void 0),hh([pe({attribute:!0})],ph.prototype,"onClickApplyNowOption",void 0),hh([pe({attribute:!0})],ph.prototype,"onClickPriceCalculatorOption",void 0),hh([pe({attribute:!0})],ph.prototype,"onChatTapped",void 0),hh([pe({attribute:!0})],ph.prototype,"hideChat",void 0),hh([pe({attribute:!0})],ph.prototype,"isMobileDesign",void 0),hh([pe({attribute:!0})],ph.prototype,"primaryColor",void 0),hh([pe({attribute:!0})],ph.prototype,"backgroundColor",void 0),hh([pe({attribute:!0})],ph.prototype,"hasChatEnabled",void 0),hh([pe({attribute:!0})],ph.prototype,"hasEmailEnabled",void 0),hh([pe({attribute:!0})],ph.prototype,"hasCallUsEnabled",void 0),hh([pe({attribute:!0})],ph.prototype,"hasTextUsEnabled",void 0),hh([pe({attribute:!0})],ph.prototype,"hasSSTEnabled",void 0),hh([pe({attribute:!0})],ph.prototype,"hasApplyNowEnabled",void 0),hh([pe({attribute:!0})],ph.prototype,"hasPricingCalculatorEnabled",void 0),hh([pe({attribute:!0})],ph.prototype,"applicationLink",void 0),hh([pe({attribute:!0})],ph.prototype,"overrideRentgrata",void 0),hh([pe({attribute:!0})],ph.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),hh([pe({attribute:!0})],ph.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),ph=hh([ce("mobile-launcher")],ph);const fh=(e="white")=>z`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
|
|
8400
8421
|
<path d="M1.31812 7L4.31812 4L1.31811 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8401
|
-
</svg>`;var
|
|
8422
|
+
</svg>`;var gh=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 mh=class extends ue{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Zn,this.toExpand=!1}render(){return H`
|
|
8402
8423
|
<div class=${"button-container"} @click=${this.onClick}>
|
|
8403
8424
|
<div
|
|
8404
8425
|
class="inner-container"
|
|
8405
8426
|
style=${Xn({background:this.primaryColor})}
|
|
8406
8427
|
>
|
|
8407
|
-
${this.toExpand?
|
|
8428
|
+
${this.toExpand?fh("black"):Nd("black")}
|
|
8408
8429
|
</div>
|
|
8409
8430
|
</div>
|
|
8410
|
-
`}};
|
|
8431
|
+
`}};mh.styles=[p`
|
|
8411
8432
|
.button-container {
|
|
8412
8433
|
width: 36px;
|
|
8413
8434
|
height: 36px;
|
|
@@ -8431,11 +8452,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8431
8452
|
.button-container:hover {
|
|
8432
8453
|
filter: brightness(90%);
|
|
8433
8454
|
}
|
|
8434
|
-
`],
|
|
8455
|
+
`],gh([pe({attribute:!0})],mh.prototype,"onClick",void 0),gh([pe({attribute:!0})],mh.prototype,"primaryColor",void 0),gh([pe({attribute:!0})],mh.prototype,"toExpand",void 0),mh=gh([ce("collapse-expand-button")],mh);const bh=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.openWidget()},yh=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.close()},vh=()=>!!window.rentgrata;var wh=n(3950),Ch=n.n(wh);const xh=(e="black")=>z`<svg aria-hidden="true" focusable="false" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8435
8456
|
<path d="M6 6C7.65685 6 9 4.65685 9 3C9 1.34315 7.65685 0 6 0C4.34315 0 3 1.34315 3 3C3 4.65685 4.34315 6 6 6ZM8 3C8 4.10457 7.10457 5 6 5C4.89543 5 4 4.10457 4 3C4 1.89543 4.89543 1 6 1C7.10457 1 8 1.89543 8 3Z" fill="${e}"/>
|
|
8436
8457
|
<path d="M12 11C12 12 11 12 11 12H1C1 12 0 12 0 11C0 10 1 7 6 7C11 7 12 10 12 11ZM11 10.9965C10.9986 10.7497 10.8462 10.0104 10.1679 9.33211C9.51563 8.67985 8.2891 8 5.99999 8C3.71088 8 2.48435 8.67985 1.8321 9.33211C1.15375 10.0104 1.00142 10.7497 1 10.9965H11Z" fill="${e}"/>
|
|
8437
8458
|
</svg>
|
|
8438
|
-
`;var
|
|
8459
|
+
`;var $h=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 Sh=class extends ue{constructor(){super(...arguments),this.isMinimized=!1,this.mobileStyles={},this.isFirstMount=!1,this.openSSTWindowOnLoad=!1,this.autoOpenChatWidget=!1,this.phoneNumber="",this.buildingName="",this.chatId="",this.orgLegalName="",this.country=null,this.buildingState=null,this.chatCallUsHeader="",this.buildingId=0,this.orgId=0,this.leadSourceParams=null,this.buildingSlug="",this.orgSlug="",this.sgtUrl="",this.selfGuidedTourEnabled=!1,this.selfGuidedToursTypeOffered="",this.designConcept="",this.featureFlagShowDropdown="",this.leadSources=[],this.currentLeadSource="",this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.hasChatEnabledDesktop=!1,this.hasChatEnabledMobile=!1,this.hasEmailEnabledDesktop=!1,this.hasEmailEnabledMobile=!1,this.hasApplyNowEnabledDesktop=!1,this.hasApplyNowEnabledMobile=!1,this.applicationLink="",this.hasCallUsEnabledDesktop=!1,this.hasCallUsEnabledMobile=!1,this.hasTextUsEnabledDesktop=!1,this.hasTextUsEnabledMobile=!1,this.hasSSTEnabledDesktop=!1,this.hasSSTEnabledMobile=!1,this.tourTypeOptions=[],this.layoutOptions=[],this.bedroomPreferenceRequired=!1,this.brokerIntakeEnabled=!1,this.tourSchedulerV2=!1,this.getSessionToken=()=>null,this.hasDynamicSchedulingEnabled=!1,this.hasPricingCalculatorEnabledDesktop=!1,this.hasPricingCalculatorEnabledMobile=!1,this.onExitChat=()=>{},this.hasHideMobileFeatures=!1,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.showTourNextToChat=!1,this.onChatTapped=()=>{},this.handleChatTapped=()=>{Lo("chatOpened",{buildingId:this.buildingId}),this.onChatTapped()},this.onClickMinimize=()=>{},this.onSstClose=Ch(),this.overrideRentgrata=!1,this.launcherStyles={},this.primaryColor=Zn,this.backgroundColor=Jn,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this._isMobile=Ir(),this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.isCalculatorWindowOpen=!1,this.isMobileFeaturesExpanded=!1,this.getNumCallToActions=()=>[this.hasEmailEnabledDesktop||this.hasEmailEnabledMobile,!!this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasCallUsEnabledMobile),this.hasSSTEnabledDesktop||this.hasSSTEnabledMobile,this.hasTextUsEnabledDesktop||this.hasTextUsEnabledMobile,this.hasApplyNowEnabledDesktop||this.hasApplyNowEnabledMobile,this.hasPricingCalculatorEnabledDesktop||this.hasPricingCalculatorEnabledMobile].filter(e=>e).length,this.emailUsWindowRef=Oe(),this.tourSchedulerRef=Oe(),this.tourSchedulerV2Ref=Oe(),this.sstWindowIsV2=!1,this.calculatorWindowRef=Oe(),this.updated=async()=>{this.attachOnClickToEmailUsWindow(),this.attachOnClickToSSTWindow(),this.attachOnClickToCalculatorWindow(),(this.isEmailWindowOpen||this.isCallUsWindowOpen)&&this.isSSTWindowOpen&&this.onCloseSSTWindow()},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerV2Ref.value;e&&(e.onCloseClicked=this.onCloseSSTWindow);const t=this.tourSchedulerRef.value;t&&(t.onCloseClicked=this.onCloseSSTWindow)},this.attachOnClickToCalculatorWindow=()=>{const e=this.calculatorWindowRef.value;e&&(e.onCloseClicked=this.onCloseCalculatorWindow,e.onClickEmailOption=this.onClickEmailOption,e.onClickPhoneOption=this.onClickPhoneOption,e.onClickSSTOption=this.onClickSSTOption,e.onClickTextUsOption=this.onClickTextUsOption)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),yh(),Lo("emailUsClicked",{buildingId:this.buildingId}),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.onClickPhoneOption=e=>{e.preventDefault(),e.stopPropagation(),yh(),Lo("callTextUsClicked",{buildingId:this.buildingId}),this.isCallUsWindowOpen=!0},this.onClickApplyNowOption=e=>{e.preventDefault(),e.stopPropagation(),yh(),Lo("applyNowClicked",{buildingId:this.buildingId,applicationLink:this.applicationLink}),window.open(this.applicationLink,"_blank")},this.onClickPriceCalculatorOption=e=>{e.preventDefault(),e.stopPropagation(),yh(),Lo("feeCalculatorOpened",{buildingId:this.buildingId}),this.isCalculatorWindowOpen=!0},this.onClosePhoneWindow=()=>{this.isCallUsWindowOpen=!1},this.onClickSSTOption=e=>{e.preventDefault(),e.stopPropagation(),yh(),Lo("bookTourClicked",{buildingId:this.buildingId}),this.tourSchedulerV2||(oo(),ao(this.buildingId)),this.isSSTWindowOpen=!0},this.onCloseSSTWindow=()=>{this.onSstClose(),this.isSSTWindowOpen=!1,this.showTourNextToChat&&this.dispatchEvent(new CustomEvent("closeShowTourNextToChat",{bubbles:!0}))},this.onCloseCalculatorWindow=()=>{this.isCalculatorWindowOpen=!1},this.onClickTextUsOption=e=>{e.preventDefault(),e.stopPropagation(),this.isTextUsWindowOpen=!0},this.isCallToActionWindowOpen=()=>1===[this.isEmailWindowOpen,this.isCallUsWindowOpen,this.isSSTWindowOpen,this.isTextUsWindowOpen,this.isCalculatorWindowOpen].filter(e=>e).length,this.toggleMobileFeatures=()=>{this.isMobileFeaturesExpanded=!this.isMobileFeaturesExpanded},this.renderActionPills=()=>this._isMobile||this.isMinimized||this.designConcept===ma.MINIMIZED?H` ${this.hasHideMobileFeatures&&this._isMobile?H`<collapse-expand-button
|
|
8439
8460
|
.toExpand=${this.isMobileFeaturesExpanded}
|
|
8440
8461
|
.primaryColor=${this.primaryColor}
|
|
8441
8462
|
.onClick=${this.toggleMobileFeatures}
|
|
@@ -8470,7 +8491,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8470
8491
|
>
|
|
8471
8492
|
<div class="type-hey__pill-left">
|
|
8472
8493
|
<div class="type-hey__icon">
|
|
8473
|
-
${
|
|
8494
|
+
${sh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8474
8495
|
</div>
|
|
8475
8496
|
<div
|
|
8476
8497
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -8479,7 +8500,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8479
8500
|
</div>
|
|
8480
8501
|
</div>
|
|
8481
8502
|
<div class="type-gradient__icon">
|
|
8482
|
-
${
|
|
8503
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8483
8504
|
</div>
|
|
8484
8505
|
</button>`:null},{pillKey:"SST",pill:this.hasSSTEnabledDesktop?H`
|
|
8485
8506
|
<button
|
|
@@ -8490,7 +8511,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8490
8511
|
>
|
|
8491
8512
|
<div class="type-hey__pill-left">
|
|
8492
8513
|
<div class="type-hey__icon">
|
|
8493
|
-
${
|
|
8514
|
+
${lh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8494
8515
|
</div>
|
|
8495
8516
|
<div
|
|
8496
8517
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -8499,7 +8520,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8499
8520
|
</div>
|
|
8500
8521
|
</div>
|
|
8501
8522
|
<div class="type-gradient__icon">
|
|
8502
|
-
${
|
|
8523
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8503
8524
|
</div>
|
|
8504
8525
|
</button>
|
|
8505
8526
|
`:null},{pillKey:"Phone",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?H`
|
|
@@ -8511,7 +8532,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8511
8532
|
>
|
|
8512
8533
|
<div class="type-hey__pill-left">
|
|
8513
8534
|
<div class="type-hey__icon">
|
|
8514
|
-
${
|
|
8535
|
+
${ju(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8515
8536
|
</div>
|
|
8516
8537
|
<div
|
|
8517
8538
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -8523,7 +8544,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8523
8544
|
</div>
|
|
8524
8545
|
</div>
|
|
8525
8546
|
<div class="type-gradient__icon">
|
|
8526
|
-
${
|
|
8547
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8527
8548
|
</div>
|
|
8528
8549
|
</button>
|
|
8529
8550
|
`:null},{pillKey:"Apply",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?H`
|
|
@@ -8535,7 +8556,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8535
8556
|
>
|
|
8536
8557
|
<div class="type-hey__pill-left">
|
|
8537
8558
|
<div class="type-hey__icon">
|
|
8538
|
-
${
|
|
8559
|
+
${dh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8539
8560
|
</div>
|
|
8540
8561
|
<div
|
|
8541
8562
|
class="vertical-pill-title"
|
|
@@ -8546,7 +8567,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8546
8567
|
</div>
|
|
8547
8568
|
</div>
|
|
8548
8569
|
<div class="type-gradient__icon">
|
|
8549
|
-
${
|
|
8570
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8550
8571
|
</div>
|
|
8551
8572
|
</button>
|
|
8552
8573
|
`:null},{pillKey:"Price Calculator",pill:this.hasPricingCalculatorEnabledDesktop?H`
|
|
@@ -8558,7 +8579,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8558
8579
|
>
|
|
8559
8580
|
<div class="type-hey__pill-left">
|
|
8560
8581
|
<div class="type-hey__icon">
|
|
8561
|
-
${
|
|
8582
|
+
${ch(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8562
8583
|
</div>
|
|
8563
8584
|
<div
|
|
8564
8585
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -8567,7 +8588,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8567
8588
|
</div>
|
|
8568
8589
|
</div>
|
|
8569
8590
|
<div class="type-gradient__icon">
|
|
8570
|
-
${
|
|
8591
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8571
8592
|
</div>
|
|
8572
8593
|
</button>
|
|
8573
8594
|
`:null}].filter(e=>!!e.pill);return H`
|
|
@@ -8609,7 +8630,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8609
8630
|
>
|
|
8610
8631
|
<div class="type-hey__pill-left">
|
|
8611
8632
|
<div class="type-hey__icon">
|
|
8612
|
-
${
|
|
8633
|
+
${uh(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8613
8634
|
</div>
|
|
8614
8635
|
<div
|
|
8615
8636
|
style=${Xn({color:this.foregroundColorOnPrimaryBackgroundColor})}
|
|
@@ -8618,7 +8639,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8618
8639
|
</div>
|
|
8619
8640
|
</div>
|
|
8620
8641
|
<div class="type-gradient__icon">
|
|
8621
|
-
${
|
|
8642
|
+
${fh(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8622
8643
|
</div>
|
|
8623
8644
|
</button>
|
|
8624
8645
|
`:""}
|
|
@@ -8630,15 +8651,15 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8630
8651
|
>
|
|
8631
8652
|
<div class="type-hey__botton-section-pills">
|
|
8632
8653
|
${e.map(e=>e.pill)}
|
|
8633
|
-
${this.overrideRentgrata&&
|
|
8654
|
+
${this.overrideRentgrata&&vh()?H` <button
|
|
8634
8655
|
class="type-hey__pill"
|
|
8635
|
-
@click=${()=>{
|
|
8656
|
+
@click=${()=>{bh()}}
|
|
8636
8657
|
style=${Xn({background:this.backgroundColor})}
|
|
8637
8658
|
aria-label="Contact a resident"
|
|
8638
8659
|
>
|
|
8639
8660
|
<div class="type-hey__pill-left">
|
|
8640
8661
|
<div class="type-hey__icon">
|
|
8641
|
-
${
|
|
8662
|
+
${xh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8642
8663
|
</div>
|
|
8643
8664
|
<div
|
|
8644
8665
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -8647,7 +8668,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8647
8668
|
</div>
|
|
8648
8669
|
</div>
|
|
8649
8670
|
<div class="type-gradient__icon">
|
|
8650
|
-
${
|
|
8671
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8651
8672
|
</div>
|
|
8652
8673
|
</button>`:""}
|
|
8653
8674
|
</div>
|
|
@@ -8669,7 +8690,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8669
8690
|
>
|
|
8670
8691
|
<div class="vertical-pill-left">
|
|
8671
8692
|
<div class="vertical-pill-icon">
|
|
8672
|
-
${
|
|
8693
|
+
${uh(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8673
8694
|
</div>
|
|
8674
8695
|
<div
|
|
8675
8696
|
class="vertical-pill-title"
|
|
@@ -8679,7 +8700,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8679
8700
|
</div>
|
|
8680
8701
|
</div>
|
|
8681
8702
|
<div class="chevron-right">
|
|
8682
|
-
${
|
|
8703
|
+
${fh(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8683
8704
|
</div>
|
|
8684
8705
|
</button>
|
|
8685
8706
|
`:null},{pillKey:"Price Calculator",pill:this.hasPricingCalculatorEnabledDesktop?H`
|
|
@@ -8691,7 +8712,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8691
8712
|
>
|
|
8692
8713
|
<div class="vertical-pill-left">
|
|
8693
8714
|
<div class="vertical-pill-icon">
|
|
8694
|
-
${
|
|
8715
|
+
${ch(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8695
8716
|
</div>
|
|
8696
8717
|
<div
|
|
8697
8718
|
class="vertical-pill-title"
|
|
@@ -8701,7 +8722,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8701
8722
|
</div>
|
|
8702
8723
|
</div>
|
|
8703
8724
|
<div class="chevron-right">
|
|
8704
|
-
${
|
|
8725
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8705
8726
|
</div>
|
|
8706
8727
|
</button>
|
|
8707
8728
|
`:null},{pillKey:"SST",pill:this.hasSSTEnabledDesktop?H`
|
|
@@ -8714,7 +8735,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8714
8735
|
>
|
|
8715
8736
|
<div class="vertical-pill-left">
|
|
8716
8737
|
<div class="vertical-pill-icon">
|
|
8717
|
-
${
|
|
8738
|
+
${lh(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8718
8739
|
</div>
|
|
8719
8740
|
<div
|
|
8720
8741
|
class="vertical-pill-title"
|
|
@@ -8725,7 +8746,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8725
8746
|
</div>
|
|
8726
8747
|
</div>
|
|
8727
8748
|
<div class="chevron-right">
|
|
8728
|
-
${
|
|
8749
|
+
${fh(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8729
8750
|
</div>
|
|
8730
8751
|
</button>
|
|
8731
8752
|
`:null},{pillKey:"Email",pill:this.hasEmailEnabledDesktop?H`
|
|
@@ -8737,7 +8758,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8737
8758
|
>
|
|
8738
8759
|
<div class="vertical-pill-left">
|
|
8739
8760
|
<div class="vertical-pill-icon">
|
|
8740
|
-
${
|
|
8761
|
+
${sh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8741
8762
|
</div>
|
|
8742
8763
|
<div
|
|
8743
8764
|
class="vertical-pill-title"
|
|
@@ -8748,7 +8769,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8748
8769
|
</div>
|
|
8749
8770
|
</div>
|
|
8750
8771
|
<div class="chevron-right">
|
|
8751
|
-
${
|
|
8772
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8752
8773
|
</div>
|
|
8753
8774
|
</button>
|
|
8754
8775
|
`:null},{pillKey:"Phone",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?H`
|
|
@@ -8760,7 +8781,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8760
8781
|
>
|
|
8761
8782
|
<div class="vertical-pill-left">
|
|
8762
8783
|
<div class="vertical-pill-icon">
|
|
8763
|
-
${
|
|
8784
|
+
${ju(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8764
8785
|
</div>
|
|
8765
8786
|
${this.hasCallUsEnabledDesktop&&this.hasTextUsEnabledDesktop?H`
|
|
8766
8787
|
<div
|
|
@@ -8789,7 +8810,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8789
8810
|
`:""}
|
|
8790
8811
|
</div>
|
|
8791
8812
|
<div class="chevron-right">
|
|
8792
|
-
${
|
|
8813
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8793
8814
|
</div>
|
|
8794
8815
|
</button>
|
|
8795
8816
|
`:null},{pillKey:"Apply",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?H`
|
|
@@ -8801,7 +8822,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8801
8822
|
>
|
|
8802
8823
|
<div class="vertical-pill-left">
|
|
8803
8824
|
<div class="vertical-pill-icon">
|
|
8804
|
-
${
|
|
8825
|
+
${dh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8805
8826
|
</div>
|
|
8806
8827
|
<div
|
|
8807
8828
|
class="vertical-pill-title"
|
|
@@ -8812,7 +8833,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8812
8833
|
</div>
|
|
8813
8834
|
</div>
|
|
8814
8835
|
<div class="chevron-right">
|
|
8815
|
-
${
|
|
8836
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8816
8837
|
</div>
|
|
8817
8838
|
</button>
|
|
8818
8839
|
`:null}].filter(e=>!!e.pill);if(e){const e=t.findIndex(e=>"SST"===e.pillKey);if(-1!==e){const[n]=t.splice(e,1);t.unshift(n)}}return H`
|
|
@@ -8820,16 +8841,16 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8820
8841
|
<nav aria-label="EliseAI options">
|
|
8821
8842
|
<ul class="vertical-pill-list__items" role="list">
|
|
8822
8843
|
${t.map(e=>H`<li>${e.pill}</li>`)}
|
|
8823
|
-
${this.overrideRentgrata&&
|
|
8844
|
+
${this.overrideRentgrata&&vh()?H`<li>
|
|
8824
8845
|
<button
|
|
8825
|
-
@click=${()=>{
|
|
8846
|
+
@click=${()=>{bh()}}
|
|
8826
8847
|
class="inner-pill-wrapper"
|
|
8827
8848
|
style=${Xn({background:this.backgroundColor})}
|
|
8828
8849
|
aria-label="Contact a resident"
|
|
8829
8850
|
>
|
|
8830
8851
|
<div class="vertical-pill-left">
|
|
8831
8852
|
<div class="vertical-pill-icon">
|
|
8832
|
-
${
|
|
8853
|
+
${xh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8833
8854
|
</div>
|
|
8834
8855
|
<div
|
|
8835
8856
|
class="vertical-pill-title"
|
|
@@ -8840,7 +8861,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8840
8861
|
</div>
|
|
8841
8862
|
</div>
|
|
8842
8863
|
<div class="chevron-right">
|
|
8843
|
-
${
|
|
8864
|
+
${fh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8844
8865
|
</div>
|
|
8845
8866
|
</button>
|
|
8846
8867
|
</li>`:""}
|
|
@@ -8851,10 +8872,10 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8851
8872
|
class="minimize-button"
|
|
8852
8873
|
aria-label="Minimize EliseAI widget"
|
|
8853
8874
|
>
|
|
8854
|
-
<div class="chevron-down">${
|
|
8875
|
+
<div class="chevron-down">${fh("black")}</div>
|
|
8855
8876
|
</button>`:""}
|
|
8856
8877
|
</div>
|
|
8857
|
-
`}}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=Nr(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}willUpdate(e){e.has("openSSTWindowOnLoad")&&this.openSSTWindowOnLoad&&(this.isSSTWindowOpen=!0),e.has("isSSTWindowOpen")&&this.isSSTWindowOpen&&(this.sstWindowIsV2=this.tourSchedulerV2)}render(){window.customElements.get("email-us-window")||window.customElements.define("email-us-window",
|
|
8878
|
+
`}}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=Nr(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}willUpdate(e){e.has("openSSTWindowOnLoad")&&this.openSSTWindowOnLoad&&(this.isSSTWindowOpen=!0),e.has("isSSTWindowOpen")&&this.isSSTWindowOpen&&(this.sstWindowIsV2=this.tourSchedulerV2)}render(){window.customElements.get("email-us-window")||window.customElements.define("email-us-window",Bu),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",Vu),window.eliseAi.onOpenSST=e=>{this.isSSTWindowOpen=!0,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,this.isCalculatorWindowOpen=!1,this.onExitChat(),e&&e()},(this.hasChatEnabledDesktop||this.hasChatEnabledMobile)&&(window.eliseAi.onOpenChat=e=>{this.handleChatTapped(),this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,this.isCalculatorWindowOpen=!1,e&&e()}),(this.hasCallUsEnabledDesktop||this.hasCallUsEnabledMobile)&&(window.eliseAi.onOpenCallUsWindow=e=>{this.isCallUsWindowOpen=!0,this.isSSTWindowOpen=!1,this.isEmailWindowOpen=!1,this.isCalculatorWindowOpen=!1,this.onExitChat(),e&&e()}),(this.hasEmailEnabledDesktop||this.hasEmailEnabledMobile)&&(window.eliseAi.onOpenEmailUsWindow=e=>{this.isEmailWindowOpen=!0,this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isCalculatorWindowOpen=!1,this.onExitChat(),e&&e()}),(this.hasPricingCalculatorEnabledDesktop||this.hasPricingCalculatorEnabledMobile)&&(window.eliseAi.onOpenPriceCalculatorWindow=e=>{this.isCalculatorWindowOpen=!0,this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,this.onExitChat(),e&&e()});const e={top:this._isMobile||void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:this._isMobile||void 0===this.bottom||isNaN(this.bottom)?void 0:`${this.bottom}px`,left:this._isMobile||void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:this._isMobile||void 0===this.right||isNaN(this.right)?void 0:`${this.right}px`};return H`
|
|
8858
8879
|
<div
|
|
8859
8880
|
class=${go()({"launcher__mobile-launcher-wrapper":this._isMobile||this.isMinimized,"launcher__mini-launcher-wrapper":!this._isMobile&&!this.isMinimized,"launcher__mini-elevated":"livcor"===this.orgSlug.toLowerCase()&&(this._isMobile||this.isMinimized)})}
|
|
8860
8881
|
style=${Xn({...this.launcherStyles,...this.mobileStyles,top:this._isMobile||void 0===this.top||isNaN(this.top)?void 0!==this.mobileStyles.top?`${this.mobileStyles.top}px`:void 0:this.top-700+"px",bottom:this._isMobile||void 0===this.bottom||isNaN(this.bottom)?void 0!==this.mobileStyles.bottom?`${this.mobileStyles.bottom}px`:"72px":`${this.bottom}px`,left:this._isMobile||void 0===this.left||isNaN(this.left)?void 0!==this.mobileStyles.left?`${this.mobileStyles.left}px`:void 0:`${this.left}px`,right:this._isMobile||void 0===this.right||isNaN(this.right)?void 0!==this.mobileStyles.right?`${this.mobileStyles.right}px`:"18px":`${this.right}px`})}
|
|
@@ -9003,11 +9024,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9003
9024
|
`:""}
|
|
9004
9025
|
${this.isCallToActionWindowOpen()||this.showTourNextToChat?"":this.renderActionPills()}
|
|
9005
9026
|
</div>
|
|
9006
|
-
`}};
|
|
9007
|
-
${_u}
|
|
9027
|
+
`}};Sh.styles=p`
|
|
9008
9028
|
${Ou}
|
|
9009
9029
|
${Pu}
|
|
9010
|
-
`,Ch([pe({attribute:!0})],xh.prototype,"isMinimized",void 0),Ch([pe()],xh.prototype,"mobileStyles",void 0),Ch([pe({type:Boolean})],xh.prototype,"isFirstMount",void 0),Ch([pe({attribute:!1})],xh.prototype,"openSSTWindowOnLoad",void 0),Ch([pe({attribute:!1})],xh.prototype,"autoOpenChatWidget",void 0),Ch([pe()],xh.prototype,"phoneNumber",void 0),Ch([pe({attribute:!0})],xh.prototype,"buildingName",void 0),Ch([pe({attribute:!0})],xh.prototype,"chatId",void 0),Ch([pe({attribute:!0})],xh.prototype,"orgLegalName",void 0),Ch([pe({attribute:!1})],xh.prototype,"country",void 0),Ch([pe({attribute:!1})],xh.prototype,"buildingState",void 0),Ch([pe({attribute:!0})],xh.prototype,"chatCallUsHeader",void 0),Ch([pe({attribute:!1})],xh.prototype,"buildingId",void 0),Ch([pe({type:Number})],xh.prototype,"orgId",void 0),Ch([pe({attribute:!1})],xh.prototype,"leadSourceParams",void 0),Ch([pe({attribute:!0})],xh.prototype,"buildingSlug",void 0),Ch([pe({attribute:!0})],xh.prototype,"orgSlug",void 0),Ch([pe({attribute:!0})],xh.prototype,"sgtUrl",void 0),Ch([pe({attribute:!0})],xh.prototype,"selfGuidedTourEnabled",void 0),Ch([pe({attribute:!0})],xh.prototype,"selfGuidedToursTypeOffered",void 0),Ch([pe({attribute:!0})],xh.prototype,"designConcept",void 0),Ch([pe({attribute:!0})],xh.prototype,"featureFlagShowDropdown",void 0),Ch([pe({attribute:!1})],xh.prototype,"leadSources",void 0),Ch([pe({attribute:!0})],xh.prototype,"currentLeadSource",void 0),Ch([pe({attribute:!0})],xh.prototype,"escortedToursLink",void 0),Ch([pe({attribute:!0})],xh.prototype,"escortedToursTypeOffered",void 0),Ch([pe({attribute:!0})],xh.prototype,"virtualToursLink",void 0),Ch([pe({attribute:!0})],xh.prototype,"virtualToursTypeOffered",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasChatEnabledDesktop",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasChatEnabledMobile",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasEmailEnabledDesktop",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasEmailEnabledMobile",void 0),Ch([pe({attribute:!0})],xh.prototype,"hasApplyNowEnabledDesktop",void 0),Ch([pe({attribute:!0})],xh.prototype,"hasApplyNowEnabledMobile",void 0),Ch([pe({attribute:!0})],xh.prototype,"applicationLink",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasCallUsEnabledDesktop",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasCallUsEnabledMobile",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasTextUsEnabledDesktop",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasTextUsEnabledMobile",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasSSTEnabledDesktop",void 0),Ch([pe({type:Boolean})],xh.prototype,"hasSSTEnabledMobile",void 0),Ch([pe({attribute:!1})],xh.prototype,"tourTypeOptions",void 0),Ch([pe({attribute:!1})],xh.prototype,"layoutOptions",void 0),Ch([pe({attribute:!0})],xh.prototype,"bedroomPreferenceRequired",void 0),Ch([pe({attribute:!1})],xh.prototype,"brokerIntakeEnabled",void 0),Ch([pe({attribute:!1})],xh.prototype,"tourSchedulerV2",void 0),Ch([pe({attribute:!1})],xh.prototype,"getSessionToken",void 0),Ch([pe({attribute:!0})],xh.prototype,"hasDynamicSchedulingEnabled",void 0),Ch([pe({attribute:!0})],xh.prototype,"hasPricingCalculatorEnabledDesktop",void 0),Ch([pe({attribute:!0})],xh.prototype,"hasPricingCalculatorEnabledMobile",void 0),Ch([pe({attribute:!1})],xh.prototype,"hasHideMobileFeatures",void 0),Ch([pe({type:Number})],xh.prototype,"right",void 0),Ch([pe({type:Number})],xh.prototype,"bottom",void 0),Ch([pe({type:Number})],xh.prototype,"top",void 0),Ch([pe({type:Number})],xh.prototype,"left",void 0),Ch([pe({attribute:!0})],xh.prototype,"showTourNextToChat",void 0),Ch([pe({attribute:!1})],xh.prototype,"onChatTapped",void 0),Ch([pe({attribute:!0})],xh.prototype,"onClickMinimize",void 0),Ch([pe({attribute:!0})],xh.prototype,"onSstClose",void 0),Ch([pe({attribute:!0})],xh.prototype,"overrideRentgrata",void 0),Ch([pe({attribute:!1})],xh.prototype,"launcherStyles",void 0),Ch([pe({attribute:!0})],xh.prototype,"primaryColor",void 0),Ch([pe({attribute:!0})],xh.prototype,"backgroundColor",void 0),Ch([pe({attribute:!0})],xh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Ch([pe({attribute:!0})],xh.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Ch([pe({attribute:!0})],xh.prototype,"leadSourceClient",void 0),Ch([fe()],xh.prototype,"leadSourceMultitouchClient",void 0),Ch([fe()],xh.prototype,"_isMobile",void 0),Ch([fe()],xh.prototype,"isEmailWindowOpen",void 0),Ch([fe()],xh.prototype,"isCallUsWindowOpen",void 0),Ch([fe()],xh.prototype,"isSSTWindowOpen",void 0),Ch([fe()],xh.prototype,"isTextUsWindowOpen",void 0),Ch([fe()],xh.prototype,"isCalculatorWindowOpen",void 0),Ch([fe()],xh.prototype,"isMobileFeaturesExpanded",void 0),xh=Ch([ce("meetelise-launcher")],xh);const $h=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",xh)},Sh=["app.meetelise.com","staging.eliseai.com","localhost"],kh={calculator:{desktop:"calcDesktop",mobile:"calcMobile"},email:{desktop:"emailDesktop",mobile:"emailMobile"},call:{desktop:"callDesktop",mobile:"callMobile"},text:{desktop:"textDesktop",mobile:"textMobile"},sst:{desktop:"sstDesktop",mobile:"sstMobile"}},Ah=e=>{const t=window.location.hostname;if(!Sh.includes(t))return e;const n=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&n in kh&&(e[n]="true"===i.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(n).length)return e;const i={...e};return Object.entries(n).forEach(([e,t])=>{const n=kh[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var Th=n(5072),Eh=n.n(Th),_h=n(7825),Oh=n.n(_h),Ph=n(7659),Ih=n.n(Ph),Nh=n(5056),Mh=n.n(Nh),Dh=n(540),Lh=n.n(Dh),Rh=n(1113),Bh=n.n(Rh),Uh=n(5541),jh={};jh.styleTagTransform=Bh(),jh.setAttributes=Mh(),jh.insert=Ih().bind(null,"head"),jh.domAPI=Oh(),jh.insertStyleElement=Lh();Eh()(Uh.A,jh);Uh.A&&Uh.A.locals&&Uh.A.locals;async function Fh(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(n.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return n.data.filter(t=>e.includes(t))}return Hh(n.data,t)}return[]}catch(e){return[]}}const Hh=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!n.map(e=>e.toLowerCase()).includes(t)})};async function zh(e){var t,n;if(!e)return!1;try{return null!==(n=null===(t=(await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/aip`)).data)||void 0===t?void 0:t.is_aip)&&void 0!==n&&n}catch(e){return!1}}const Gh=new Set(["8009855990","8338526262","8002221222","8006624357","8002738255","8007997233","8007874889","8006564673","8004224453","8883737888","8006213362","8009506264","8558272736","8008435678","8007862929","8008523836","8007849433","8007729100","8006699777","8006858470","8004322209","8003473735","8008778339","8009552232","8002255342","8009272891","8003049320","8007937724","8002382333","8003353863","8776858878","8003329227","8776554371","8772944357","8772944356","6092925760","6092926735","8007928339","8008329173","8882853036","6092921210","8007929773","8003561561","8003826717","8005727233","8009291040","8888958179","8006879512","8004262537","8773475463","8774149251","8005103102","8889372835","8007010710","8007010720","8774288844","8007929745","8003283838","6092927060","6092928319","8008527899","8662401347","8009923678","8776522873","8776527624","8003313937","8008435437","8776536783","8778392339","8003676274","8006896411"]),Vh=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return Gh.has(t)},Wh=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\([2-9]\d{2}\)[\s.-]?|[2-9]\d{2}[\s.-])[2-9]\d{2}[\s.-]?\d{4}/g,d=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,c=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},b=document.body.getElementsByTagName("*");let y=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<b.length;e++)if(b[e].nodeType===Node.ELEMENT_NODE&&!m(b[e])){if(1===b[e].childNodes.length&&b[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=b[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(Vh(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,b[e].textContent=n),y=!0,w||(w=!0)}if(b[e].hasAttribute("href")){const t=b[e].getAttribute("href");if(!t)continue;let n="",i=d;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=c):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,Vh(t))continue;const u=t.replace(i,n);if(b[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&b[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&Ao({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:ko.info,buildingSlug:n,orgSlug:t}),C&&Ao({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:ko.info,buildingSlug:n,orgSlug:t}),y||Ao({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:ko.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return Ao({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:ko.error,buildingSlug:n,orgSlug:t,error:e}),0}},Qh=(e,t,n,i)=>{document.querySelectorAll("a").forEach(function(r){const o=r.getAttribute("href");o&&o.startsWith("https://app.meetelise.com/")&&((e,t,n)=>{const[i,r,o,...a]=new URL(e).pathname.split("/").filter(Boolean).map(e=>e.toLowerCase());return 0===a.length&&"tour"===o&&i===t.toLowerCase()&&r===n.toLowerCase()})(o,t,n)&&r.addEventListener("click",t=>{i()&&(t.preventDefault(),e(t))})})};var qh=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 Yh=class extends ue{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return H`
|
|
9030
|
+
${Iu}
|
|
9031
|
+
`,$h([pe({attribute:!0})],Sh.prototype,"isMinimized",void 0),$h([pe()],Sh.prototype,"mobileStyles",void 0),$h([pe({type:Boolean})],Sh.prototype,"isFirstMount",void 0),$h([pe({attribute:!1})],Sh.prototype,"openSSTWindowOnLoad",void 0),$h([pe({attribute:!1})],Sh.prototype,"autoOpenChatWidget",void 0),$h([pe()],Sh.prototype,"phoneNumber",void 0),$h([pe({attribute:!0})],Sh.prototype,"buildingName",void 0),$h([pe({attribute:!0})],Sh.prototype,"chatId",void 0),$h([pe({attribute:!0})],Sh.prototype,"orgLegalName",void 0),$h([pe({attribute:!1})],Sh.prototype,"country",void 0),$h([pe({attribute:!1})],Sh.prototype,"buildingState",void 0),$h([pe({attribute:!0})],Sh.prototype,"chatCallUsHeader",void 0),$h([pe({attribute:!1})],Sh.prototype,"buildingId",void 0),$h([pe({type:Number})],Sh.prototype,"orgId",void 0),$h([pe({attribute:!1})],Sh.prototype,"leadSourceParams",void 0),$h([pe({attribute:!0})],Sh.prototype,"buildingSlug",void 0),$h([pe({attribute:!0})],Sh.prototype,"orgSlug",void 0),$h([pe({attribute:!0})],Sh.prototype,"sgtUrl",void 0),$h([pe({attribute:!0})],Sh.prototype,"selfGuidedTourEnabled",void 0),$h([pe({attribute:!0})],Sh.prototype,"selfGuidedToursTypeOffered",void 0),$h([pe({attribute:!0})],Sh.prototype,"designConcept",void 0),$h([pe({attribute:!0})],Sh.prototype,"featureFlagShowDropdown",void 0),$h([pe({attribute:!1})],Sh.prototype,"leadSources",void 0),$h([pe({attribute:!0})],Sh.prototype,"currentLeadSource",void 0),$h([pe({attribute:!0})],Sh.prototype,"escortedToursLink",void 0),$h([pe({attribute:!0})],Sh.prototype,"escortedToursTypeOffered",void 0),$h([pe({attribute:!0})],Sh.prototype,"virtualToursLink",void 0),$h([pe({attribute:!0})],Sh.prototype,"virtualToursTypeOffered",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasChatEnabledDesktop",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasChatEnabledMobile",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasEmailEnabledDesktop",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasEmailEnabledMobile",void 0),$h([pe({attribute:!0})],Sh.prototype,"hasApplyNowEnabledDesktop",void 0),$h([pe({attribute:!0})],Sh.prototype,"hasApplyNowEnabledMobile",void 0),$h([pe({attribute:!0})],Sh.prototype,"applicationLink",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasCallUsEnabledDesktop",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasCallUsEnabledMobile",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasTextUsEnabledDesktop",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasTextUsEnabledMobile",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasSSTEnabledDesktop",void 0),$h([pe({type:Boolean})],Sh.prototype,"hasSSTEnabledMobile",void 0),$h([pe({attribute:!1})],Sh.prototype,"tourTypeOptions",void 0),$h([pe({attribute:!1})],Sh.prototype,"layoutOptions",void 0),$h([pe({attribute:!0})],Sh.prototype,"bedroomPreferenceRequired",void 0),$h([pe({attribute:!1})],Sh.prototype,"brokerIntakeEnabled",void 0),$h([pe({attribute:!1})],Sh.prototype,"tourSchedulerV2",void 0),$h([pe({attribute:!1})],Sh.prototype,"getSessionToken",void 0),$h([pe({attribute:!0})],Sh.prototype,"hasDynamicSchedulingEnabled",void 0),$h([pe({attribute:!0})],Sh.prototype,"hasPricingCalculatorEnabledDesktop",void 0),$h([pe({attribute:!0})],Sh.prototype,"hasPricingCalculatorEnabledMobile",void 0),$h([pe({attribute:!1})],Sh.prototype,"hasHideMobileFeatures",void 0),$h([pe({type:Number})],Sh.prototype,"right",void 0),$h([pe({type:Number})],Sh.prototype,"bottom",void 0),$h([pe({type:Number})],Sh.prototype,"top",void 0),$h([pe({type:Number})],Sh.prototype,"left",void 0),$h([pe({attribute:!0})],Sh.prototype,"showTourNextToChat",void 0),$h([pe({attribute:!1})],Sh.prototype,"onChatTapped",void 0),$h([pe({attribute:!0})],Sh.prototype,"onClickMinimize",void 0),$h([pe({attribute:!0})],Sh.prototype,"onSstClose",void 0),$h([pe({attribute:!0})],Sh.prototype,"overrideRentgrata",void 0),$h([pe({attribute:!1})],Sh.prototype,"launcherStyles",void 0),$h([pe({attribute:!0})],Sh.prototype,"primaryColor",void 0),$h([pe({attribute:!0})],Sh.prototype,"backgroundColor",void 0),$h([pe({attribute:!0})],Sh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),$h([pe({attribute:!0})],Sh.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),$h([pe({attribute:!0})],Sh.prototype,"leadSourceClient",void 0),$h([fe()],Sh.prototype,"leadSourceMultitouchClient",void 0),$h([fe()],Sh.prototype,"_isMobile",void 0),$h([fe()],Sh.prototype,"isEmailWindowOpen",void 0),$h([fe()],Sh.prototype,"isCallUsWindowOpen",void 0),$h([fe()],Sh.prototype,"isSSTWindowOpen",void 0),$h([fe()],Sh.prototype,"isTextUsWindowOpen",void 0),$h([fe()],Sh.prototype,"isCalculatorWindowOpen",void 0),$h([fe()],Sh.prototype,"isMobileFeaturesExpanded",void 0),Sh=$h([ce("meetelise-launcher")],Sh);const kh=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Sh)},Ah=["app.meetelise.com","staging.eliseai.com","localhost"],Th={calculator:{desktop:"calcDesktop",mobile:"calcMobile"},email:{desktop:"emailDesktop",mobile:"emailMobile"},call:{desktop:"callDesktop",mobile:"callMobile"},text:{desktop:"textDesktop",mobile:"textMobile"},sst:{desktop:"sstDesktop",mobile:"sstMobile"}},Eh=e=>{const t=window.location.hostname;if(!Ah.includes(t))return e;const n=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&n in Th&&(e[n]="true"===i.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(n).length)return e;const i={...e};return Object.entries(n).forEach(([e,t])=>{const n=Th[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var _h=n(5072),Oh=n.n(_h),Ph=n(7825),Ih=n.n(Ph),Nh=n(7659),Mh=n.n(Nh),Dh=n(5056),Lh=n.n(Dh),Rh=n(540),Bh=n.n(Rh),Uh=n(1113),jh=n.n(Uh),Fh=n(5541),Hh={};Hh.styleTagTransform=jh(),Hh.setAttributes=Lh(),Hh.insert=Mh().bind(null,"head"),Hh.domAPI=Ih(),Hh.insertStyleElement=Bh();Oh()(Fh.A,Hh);Fh.A&&Fh.A.locals&&Fh.A.locals;async function zh(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(n.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return n.data.filter(t=>e.includes(t))}return Gh(n.data,t)}return[]}catch(e){return[]}}const Gh=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!n.map(e=>e.toLowerCase()).includes(t)})};async function Vh(e){var t,n;if(!e)return!1;try{return null!==(n=null===(t=(await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/aip`)).data)||void 0===t?void 0:t.is_aip)&&void 0!==n&&n}catch(e){return!1}}const Wh=new Set(["8009855990","8338526262","8002221222","8006624357","8002738255","8007997233","8007874889","8006564673","8004224453","8883737888","8006213362","8009506264","8558272736","8008435678","8007862929","8008523836","8007849433","8007729100","8006699777","8006858470","8004322209","8003473735","8008778339","8009552232","8002255342","8009272891","8003049320","8007937724","8002382333","8003353863","8776858878","8003329227","8776554371","8772944357","8772944356","6092925760","6092926735","8007928339","8008329173","8882853036","6092921210","8007929773","8003561561","8003826717","8005727233","8009291040","8888958179","8006879512","8004262537","8773475463","8774149251","8005103102","8889372835","8007010710","8007010720","8774288844","8007929745","8003283838","6092927060","6092928319","8008527899","8662401347","8009923678","8776522873","8776527624","8003313937","8008435437","8776536783","8778392339","8003676274","8006896411"]),Qh=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return Wh.has(t)},qh=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\([2-9]\d{2}\)[\s.-]?|[2-9]\d{2}[\s.-])[2-9]\d{2}[\s.-]?\d{4}/g,d=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,c=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},b=document.body.getElementsByTagName("*");let y=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<b.length;e++)if(b[e].nodeType===Node.ELEMENT_NODE&&!m(b[e])){if(1===b[e].childNodes.length&&b[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=b[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(Qh(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,b[e].textContent=n),y=!0,w||(w=!0)}if(b[e].hasAttribute("href")){const t=b[e].getAttribute("href");if(!t)continue;let n="",i=d;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=c):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,Qh(t))continue;const u=t.replace(i,n);if(b[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&b[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&Ao({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:ko.info,buildingSlug:n,orgSlug:t}),C&&Ao({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:ko.info,buildingSlug:n,orgSlug:t}),y||Ao({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:ko.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return Ao({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:ko.error,buildingSlug:n,orgSlug:t,error:e}),0}},Yh=(e,t,n,i)=>{document.querySelectorAll("a").forEach(function(r){const o=r.getAttribute("href");o&&o.startsWith("https://app.meetelise.com/")&&((e,t,n)=>{const[i,r,o,...a]=new URL(e).pathname.split("/").filter(Boolean).map(e=>e.toLowerCase());return 0===a.length&&"tour"===o&&i===t.toLowerCase()&&r===n.toLowerCase()})(o,t,n)&&r.addEventListener("click",t=>{i()&&(t.preventDefault(),e(t))})})};var Kh=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 Xh=class extends ue{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return H`
|
|
9011
9032
|
<button
|
|
9012
9033
|
class=${this.toExpand?"button-container mini":"button-container"}
|
|
9013
9034
|
@click=${this.onClick}
|
|
@@ -9018,13 +9039,13 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9018
9039
|
style=${Xn({background:this.primaryColor})}
|
|
9019
9040
|
>
|
|
9020
9041
|
${this.toExpand?H`<div class="chevron-up">
|
|
9021
|
-
${
|
|
9042
|
+
${fh(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
9022
9043
|
</div>`:H` <div class="x-icon">
|
|
9023
9044
|
${Xl(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
9024
9045
|
</div>`}
|
|
9025
9046
|
</div>
|
|
9026
9047
|
</button>
|
|
9027
|
-
`}};
|
|
9048
|
+
`}};Xh.styles=[p`
|
|
9028
9049
|
.button-container {
|
|
9029
9050
|
width: 56px;
|
|
9030
9051
|
height: 56px;
|
|
@@ -9074,7 +9095,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9074
9095
|
cursor: pointer;
|
|
9075
9096
|
filter: brightness(90%);
|
|
9076
9097
|
}
|
|
9077
|
-
`],qh([pe({attribute:!0})],Yh.prototype,"onClick",void 0),qh([pe({attribute:!0})],Yh.prototype,"primaryColor",void 0),qh([pe({attribute:!0})],Yh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),qh([pe({attribute:!0})],Yh.prototype,"toExpand",void 0),Yh=qh([ce("minimize-expand-button")],Yh);const Kh="cdn.skypack.dev/@meetelise/chat",Xh="cdn.eliseai.com/@meetelise/chat",Zh=async(e,t)=>{try{if(Math.random()>=.15)return;const n=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",n=t.textContent||"";if(e.includes(Kh)||n.includes(Kh))return"skypack";if(e.includes(Xh)||n.includes(Xh))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:n},{params:{cdn_version:n},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},Jh=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,ep={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},tp="https://applications.eliseai.com",np=["Check Availability","Apply Now"],ip=(e,t,n,i)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const n=e.getElementsByTagName("span");if(1!==n.length)return!1;const i=null===(t=n[0].textContent)||void 0===t?void 0:t.trim();return null!=i&&np.includes(i)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),Ao({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:ko.info,buildingSlug:i,orgSlug:n}),!0},rp=(e,t,n,i)=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.nodeType!==Node.ELEMENT_NODE)continue;const a=o;"A"===a.tagName&&ip(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)ip(s[e],t,n,i)}},op=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)ip(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)rp(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class ap{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Fr(zr(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=Oo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(So()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),n=this._generateLeadSourceLocalStorageKey();if(!t||this.isExpiredTimestamp(t.timestampExpires)){const t={timestampExpires:this._generateNewExpirationTimestamp(),leadSources:[{parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"touchpoint"}]};localStorage.setItem(n,JSON.stringify(t))}else{if(t.leadSources.find(t=>t.leadSourceValue===e))return;if(t.leadSources.length<this.maxSourcesNonPropertyWebsiteCount)return t.leadSources.push({parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));Ao({logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),n=da(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Fr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Yr(e.timestampInitiallyLogged).getTime()-Yr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Fr(new Date),r=[{timestampInitiallyLogged:i,leadSourceValue:n,type:"default"},...t.leadSources.map(e=>({timestampInitiallyLogged:e.timestampInitiallyLogged,leadSourceValue:e.leadSourceValue,type:e.type}))];return e&&r.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),r},this.getLocalStorageMultitouchValue=()=>{const e=this._generateLeadSourceLocalStorageKey(),t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t)},this.isExpiredTimestamp=e=>Yr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var sp=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 lp=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.centralConvo=!1,this.declaredBuildingSlug="",this.hostDeclaredBuildingId=void 0,this.orgLevel=!1,this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this._isMobile=Ir(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=bo.always,this.bedroomPreferenceRequired=!1,this.tourSchedulerV2=!1,this.brokerIntakeEnabled=!1,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.openTourSchedulerOnLoad=!1,this.displayPubnubChat=!1,this.launcherButton=null,this.focusChatOnMount=!1,this.myPubnub=null,this.getSessionToken=()=>{var e,t;return null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.getSessionToken())&&void 0!==t?t:null},this.LeadSourceClient=null,this.LeadSourceMultitouchClient=null,this.sampleRateToUse=.05,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.overrideRentgrata=!1,this.widgetType=Sp.Default,this.onWidgetLoaded=vh(),this.onSstClose=vh(),this.enabledChatWidgets={callDesktop:!1,callMobile:!1,chatMobile:!1,chatDesktop:!1,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,sstDesktop:!1,sstMobile:!1,calcDesktop:!1,calcMobile:!1},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.hideMobileFeatures=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=Oe(),this.dniNumber=null,this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{var e,t;if(!this.orgSlug)return;if(!this.centralConvo&&!this.buildingSlug)return;this.centralConvo&&!this.buildingSlug&&(this.orgLevel=!0);const n=this.centralConvo?await async function(e){const t=`https://app.meetelise.com/api/pub/v1/organization/${e}/webchat/v2`,n=await r().get(t);return Ca(n.data)}(this.orgSlug):await wa(this.orgSlug,this.buildingSlug);if(!this.isOrgMode()){if(Math.random()<.2)try{(async(e,t)=>{const n=window.rentgrata;if(!n)return;const i=n.Widget;if(!i)return;const o=i.config;if(!o)return;const a=o.widgetKey;a&&await r().post(`https://app.meetelise.com/platformApi/webchat/rentgrata?token=${a}`,{},{headers:{"Content-Type":"application/json","building-slug":null!=e?e:"","org-slug":null!=t?t:""}})})(this.buildingSlug,this.orgSlug)}catch(e){}try{Zh(this.orgSlug,this.buildingSlug)}catch(e){}}if(!await Eu(n,this.buildingSlug,this.orgSlug))return;To({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==n?void 0:n.launchedDateTime)?.01:.05}),this.buildingWebchatView=n;const i=(()=>{try{const e="true"===sessionStorage.getItem(xs);return sessionStorage.removeItem(xs),e}catch{return!1}})();await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),(e=>{const t=new URLSearchParams(window.location.search),n=t.get("rwg_token"),i=t.get("elise_google_env");if(!n||!i||!e)return;const r={rwgToken:n,environment:i,buildingId:e,expiresAt:Date.now()+2592e6};localStorage.setItem(is,JSON.stringify(r))})(null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.id)&&void 0!==t?t:0),i?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0):"tour"===new URLSearchParams(window.location.search).get("elise_open")&&(this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile)?this.openTourSchedulerOnLoad=!0:this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.rememberChatAutoOpenDismissed()):"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0),this.isLoading=!1},this.setBuildingDerivedInfo=async()=>{var e,t,n,i,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S,k,A,T,E,_,O,P,I,N,M,D,L,R,B,U,j,F,H,z,G,V,W,Q,q,Y,K,X;const Z=this.buildingWebchatView;if(!Z)return;Z&&this.orgSlug&&!this.orgLevel&&dp(this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.chatId)&&void 0!==t?t:null,this.sampleRateToUse,this.buildingSlug,null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null);const J=Z.featureFlagWebchatMarketingSourceDropdownConfiguration,ee=Z.featureFlagWebchatUseDniPhoneNumberBySource,te=Z.featureFlagInsertDniIntoWebsite,ne=Z.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var ie;ie=No.includes(Z.orgId),Do=ie;const[re,oe,ae,se,le,ue]=await Promise.all([this.isOrgMode()?Promise.resolve([]):Fh(this.orgSlug,this.buildingSlug),yo(this.buildingSlug),zh(this.buildingSlug),wo(this.buildingSlug),xo(this.buildingSlug),Co(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Qn(Z.phoneNumber),this.buildingWebchatView.isAip=ae),this.leadSources=re,this.featureFlagShowDropdown=J,this.bedroomPreferenceRequired=se,this.brokerIntakeEnabled=le,this.tourSchedulerV2=ue;const de=this.orgLevel?null:Z.textWithUsPhoneNumber?Z.textWithUsPhoneNumber:await(async e=>{try{const t="https://app.meetelise.com",n=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(n.data)return n.data}catch(t){return Ao({logType:ko.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t},error:t}),null}return null})(this.buildingSlug),ce=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,he=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,pe={callDesktop:null!==(d=null===(u=this.buildingWebchatView)||void 0===u?void 0:u.shouldShowPhoneDesktop)&&void 0!==d&&d,callMobile:null!==(h=null===(c=this.buildingWebchatView)||void 0===c?void 0:c.shouldShowPhoneMobile)&&void 0!==h&&h,chatDesktop:null!==(f=null===(p=this.buildingWebchatView)||void 0===p?void 0:p.shouldShowChatDesktop)&&void 0!==f&&f,chatMobile:null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.shouldShowChatMobile)&&void 0!==m&&m,emailDesktop:null!==(y=null===(b=this.buildingWebchatView)||void 0===b?void 0:b.shouldShowEmailDesktop)&&void 0!==y&&y,emailMobile:null!==(w=null===(v=this.buildingWebchatView)||void 0===v?void 0:v.shouldShowEmailMobile)&&void 0!==w&&w,textDesktop:null!==(x=(null===(C=this.buildingWebchatView)||void 0===C?void 0:C.shouldShowTextDesktop)&&!!de)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!de)&&void 0!==S&&S,sstDesktop:null!==(A=null===(k=this.buildingWebchatView)||void 0===k?void 0:k.shouldShowSstDesktop)&&void 0!==A&&A,sstMobile:null!==(E=null===(T=this.buildingWebchatView)||void 0===T?void 0:T.shouldShowSstMobile)&&void 0!==E&&E,calcDesktop:ce,calcMobile:he};var fe,ge;this.enabledChatWidgets=this.withOrgLevelContactOptions(Ah(pe),null!==(O=null===(_=this.buildingWebchatView)||void 0===_?void 0:_.phoneNumber)&&void 0!==O?O:""),this.orgLevel||(this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(Qh(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ne&&(ge=this.handleTourClicked,document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(e=>{e&&e.addEventListener("click",e=>{e.preventDefault(),ge(e)})})),"radco"===this.orgSlug&&(e=>{document.querySelectorAll('a[href^="#leaseleads-tour-open"]').forEach(t=>{var n;if(!t)return;const i=document.createElement("a");i.textContent=t.textContent,i.style.cursor="pointer",i.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(n=t.parentNode)||void 0===n||n.replaceChild(i,t)})})(this.handleTourClicked)):(null===(P=this.LeadSourceClient)||void 0===P?void 0:P.leadSource)&&(fe=null!==(N=null===(I=this.LeadSourceClient)||void 0===I?void 0:I.leadSource)&&void 0!==N?N:null,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(fe)}`)}}))),this.buildingWebchatView&&(this.primaryColor=null!==(M=this.buildingWebchatView.primaryColor)&&void 0!==M?M:null,this.backgroundColor=null!==(D=this.buildingWebchatView.secondaryColor)&&void 0!==D?D:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(L=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==L?L:null,this.foregroundColorOnSecondaryBackgroundColor=null!==(R=this.buildingWebchatView.foregroundColorOnSecondaryBackgroundColor)&&void 0!==R?R:null,this.webchatConfigHasAutoOpenChat=null!==(B=this.buildingWebchatView.autoOpenChat)&&void 0!==B&&B,this.requiresConsent=null!==(U=this.buildingWebchatView.requiresConsentForChat)&&void 0!==U&&U,this.hideMobileFeatures=null!==(j=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==j&&j,this.privacyPolicyUrl=null!==(F=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==F?F:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===ma.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===ma.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===ma.EMOJI&&(this.designConcept=ma.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Zn),null===this.backgroundColor&&(this.backgroundColor=Jn);const me=null!==(z=null===(H=this.buildingWebchatView)||void 0===H?void 0:H.phoneNumber)&&void 0!==z?z:"";let be=null;if(ee&&!this.orgLevel&&(be=await async function(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return n.data?{number:Qn(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(V=null===(G=this.LeadSourceClient)||void 0===G?void 0:G.leadSource)&&void 0!==V?V:null),be&&!be.isMatch&&(be.number=me)),te&&(null==be?void 0:be.number)){this.dniNumber=be.number;const e=Wh(be.number,this.orgSlug,this.buildingSlug);e>0&&To({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const ye=localStorage.getItem("eliseai_phone_number_devtest");ye&&(this.dniNumber=ye,Wh(ye,this.orgSlug,this.buildingSlug)),this.phoneNumberForSource=be||{number:me,isMatch:!1,isPropertyWebsiteCatchall:!0};const ve=null!==(Q=null===(W=this.LeadSourceClient)||void 0===W?void 0:W.leadSource)&&void 0!==Q?Q:null;ve&&(this.leadSources.includes(ve)||this.leadSources.push(ve)),this.isOrgMode()||ao(Z.id);if((oe||(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isAip))&&(null===(Y=this.buildingWebchatView)||void 0===Y?void 0:Y.isLiveOnApplications)&&this.buildingSlug&&!this.orgLevel){const e=((e,t,n)=>{var i;const r=[/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/content\/apply/,/\/apply-now/,/\/apply/,/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,/busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/],o=document.body.getElementsByTagName("a");let a=0;for(let s=0;s<o.length;s++){const l=o[s];if(l.nodeType===Node.ELEMENT_NODE&&r.some(e=>e.test(l.href))){const r=l.getAttribute("href"),o=(null===(i=l.textContent)||void 0===i?void 0:i.toLowerCase())||"",s=Jh(o,e);l.setAttribute("href",s),a++,Ao({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:ko.info,buildingSlug:n,orgSlug:t})}}return 0===a&&Ao({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:ko.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&To({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_application_link_replacement_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}if(this.buildingSlug&&this.orgSlug&&!this.orgLevel)try{(e=>{const t=ep[e];if(!t)return 0;const n=`${tp}/building/${t}/units`,i=`${tp}/building/${e}/units`,r=new RegExp(`https://applications\\.eliseai\\.com/building/${t}/units`,"g");let o=0;const a=document.body.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a[e],s=t.getAttribute("href");if(!s||!s.includes(n))continue;const l=s.replace(r,i);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(n))return;const a=t.replace(r,i);a!==t&&(e.setAttribute("onclick",a),o++)})})(this.buildingSlug)}catch{}this.buildingSlug&&!this.orgLevel&&(null===(K=this.buildingWebchatView)||void 0===K?void 0:K.isLiveOnApplications)&&(null===(X=this.buildingWebchatView)||void 0===X?void 0:X.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&op(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,n,i,r,o,a,s,l,u;if(!this.buildingWebchatView)return;const d=this.chatStorageSlug(),c=vs(d),h=ws(d,c),p=h?c:ys(d,!1);if(!p.leadId)throw new Error("Lead ID is null");if(this.LeadSourceClient=new ca,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new ap(this.orgSlug,this.buildingSlug),this.myPubnub=new Ps(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,p.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType),this.myPubnub.chatStorageSlug=d,this.centralConvo){const e=this.myPubnub;e.centralConvo=!0,void 0!==this.hostDeclaredBuildingId?e.declaredBuildingId=this.hostDeclaredBuildingId:this.fetchDeclaredBuildingId().then(t=>{void 0===this.hostDeclaredBuildingId&&(e.declaredBuildingId=t)})}else this.myPubnub.declaredBuildingId=this.buildingWebchatView.id;const f=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,h&&null!==(n=p.leadId)&&void 0!==n?n:void 0);f&&(ys(d,p.initiatedChat,f.lead_id),this.isOrgMode()&&f.building_slug&&await this.adoptBuilding(f.building_slug)),this.LeadSourceClient.chatId=this.myPubnub.channel;const g=await(null===(i=this.LeadSourceClient)||void 0===i?void 0:i.generateUserLeadSource({leadId:null!==(o=null===(r=this.myPubnub)||void 0===r?void 0:r.leadUserId)&&void 0!==o?o:"",orgSlug:this.orgSlug,buildingSlug:this.buildingSlug}));g&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(g),"property-website"!==da(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:da(this.orgSlug):this.myPubnub.leadSource=null!==(u=null===(l=this.LeadSourceClient)||void 0===l?void 0:l.leadSource)&&void 0!==u?u:null;const m=vs(d);m.initiatedChat&&await this.myPubnub.initializePubnub(m)},this.isOrgMode=()=>this.centralConvo&&!this.buildingSlug,this.chatStorageSlug=()=>this.orgLevel?"":this.buildingSlug,this.adoptBuilding=async e=>{var t;try{const n=await wa(this.orgSlug,e);if(!(null==n?void 0:n.id))return;this.buildingSlug=e,this.buildingWebchatView=n,null===(t=this.myPubnub)||void 0===t||t.adoptBuilding(e,n)}catch(e){}},this.withOrgLevelContactOptions=(e,t)=>this.orgLevel?{...e,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,callDesktop:e.callDesktop&&!!t,callMobile:e.callMobile&&!!t}:e,this.fetchDeclaredBuildingId=async()=>{if(!this.declaredBuildingSlug||!this.orgSlug)return null;try{const e=await wa(this.orgSlug,this.declaredBuildingSlug);return"number"==typeof(null==e?void 0:e.id)&&e.id>0?e.id:null}catch{return null}},this.chatAutoOpenDismissedStorageKey=()=>{const{orgSlug:e,buildingSlug:t}=this;return e&&t?`com.elise.webchat.autoOpenDismissed=${e}=${t}`:t?`com.elise.webchat.autoOpenDismissed=${t}`:e?`com.elise.webchat.autoOpenDismissed=${e}`:null},this.shouldAutoOpenChat=e=>{if(!e||Ir())return!1;const t=this.chatAutoOpenDismissedStorageKey();return!t||"true"!==localStorage.getItem(t)},this.rememberChatAutoOpenDismissed=()=>{const e=this.chatAutoOpenDismissedStorageKey();e&&localStorage.setItem(e,"true")},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.focusChatOnMount=!0,this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,localStorage.setItem("isChatOpen","true")},e.onExitChat=this.onExitChat)},this.onExitChat=()=>{this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,localStorage.setItem("isChatOpen","false"),this.rememberChatAutoOpenDismissed()},this.focusLauncherButton=()=>{var e,t;const n=(null===(e=this.launcherButton)||void 0===e?void 0:e.isConnected)?this.launcherButton:null;null===(t=null!=n?n:this.currentLauncherButton())||void 0===t||t.focus()},this.focusMessageFieldOnOpen=()=>{var e,t;const n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("pubnub-chat"),i=null==n?void 0:n.shadowRoot;n&&i&&(n.focusMessageField()||null===(t=i.getElementById("pubnub-chat-container"))||void 0===t||t.focus(),setTimeout(()=>{n.focusMessageField()},0))},this.closeChatAndRestoreFocus=()=>{this.onExitChat(),this.updateComplete.then(()=>{this.focusLauncherButton(),requestAnimationFrame(()=>this.focusLauncherButton())})}}reinsertDNIIntoWebsite(){this.dniNumber&&Wh(this.dniNumber,this.orgSlug,this.buildingSlug)}setDeclaredBuildingId(e){this.hostDeclaredBuildingId=e,this.myPubnub&&(this.myPubnub.declaredBuildingId=e)}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new $o(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),bs(this.chatStorageSlug()),this.orgLevel&&(this.buildingSlug=""),this.myPubnub=null,this.displayPubnubChat=!1,await this.setupWebchat(),this.hideLauncher=!1}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustPositionChatAdditionalActions),this._cleanupMobileListener=Nr(e=>{this._isMobile=e})}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}currentLauncherButton(){var e,t,n,i;const r=null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("meetelise-launcher"))||void 0===t?void 0:t.shadowRoot,o=null==r?void 0:r.querySelector("#type-hey__ask-prompt, button[aria-label='Chat with us']"),a=null===(i=null===(n=null==r?void 0:r.querySelector("mobile-launcher"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.querySelector("button[aria-label='Chat with us']");return o instanceof HTMLElement?o:a instanceof HTMLElement?a:null}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S,k,A,T,E,_,O,P,I,N,M,D,L,R,B,U,j,F,z,G,V,W,Q;$h();const q=this.hideLauncher&&!this.isLoading&&!this._isMobile;return H`
|
|
9098
|
+
`],Kh([pe({attribute:!0})],Xh.prototype,"onClick",void 0),Kh([pe({attribute:!0})],Xh.prototype,"primaryColor",void 0),Kh([pe({attribute:!0})],Xh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Kh([pe({attribute:!0})],Xh.prototype,"toExpand",void 0),Xh=Kh([ce("minimize-expand-button")],Xh);const Zh="cdn.skypack.dev/@meetelise/chat",Jh="cdn.eliseai.com/@meetelise/chat",ep=async(e,t)=>{try{if(Math.random()>=.15)return;const n=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",n=t.textContent||"";if(e.includes(Zh)||n.includes(Zh))return"skypack";if(e.includes(Jh)||n.includes(Jh))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:n},{params:{cdn_version:n},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},tp=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,np={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},ip="https://applications.eliseai.com",rp=["Check Availability","Apply Now"],op=(e,t,n,i)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const n=e.getElementsByTagName("span");if(1!==n.length)return!1;const i=null===(t=n[0].textContent)||void 0===t?void 0:t.trim();return null!=i&&rp.includes(i)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),Ao({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:ko.info,buildingSlug:i,orgSlug:n}),!0},ap=(e,t,n,i)=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.nodeType!==Node.ELEMENT_NODE)continue;const a=o;"A"===a.tagName&&op(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)op(s[e],t,n,i)}},sp=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)op(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)ap(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class lp{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Fr(zr(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=Oo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(So()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),n=this._generateLeadSourceLocalStorageKey();if(!t||this.isExpiredTimestamp(t.timestampExpires)){const t={timestampExpires:this._generateNewExpirationTimestamp(),leadSources:[{parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"touchpoint"}]};localStorage.setItem(n,JSON.stringify(t))}else{if(t.leadSources.find(t=>t.leadSourceValue===e))return;if(t.leadSources.length<this.maxSourcesNonPropertyWebsiteCount)return t.leadSources.push({parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));Ao({logType:ko.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),n=da(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Fr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Yr(e.timestampInitiallyLogged).getTime()-Yr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Fr(new Date),r=[{timestampInitiallyLogged:i,leadSourceValue:n,type:"default"},...t.leadSources.map(e=>({timestampInitiallyLogged:e.timestampInitiallyLogged,leadSourceValue:e.leadSourceValue,type:e.type}))];return e&&r.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),r},this.getLocalStorageMultitouchValue=()=>{const e=this._generateLeadSourceLocalStorageKey(),t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t)},this.isExpiredTimestamp=e=>Yr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var up=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 dp=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.centralConvo=!1,this.declaredBuildingSlug="",this.hostDeclaredBuildingId=void 0,this.orgLevel=!1,this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this._isMobile=Ir(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=bo.always,this.bedroomPreferenceRequired=!1,this.tourSchedulerV2=!1,this.brokerIntakeEnabled=!1,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.openTourSchedulerOnLoad=!1,this.displayPubnubChat=!1,this.launcherButton=null,this.focusChatOnMount=!1,this.myPubnub=null,this.getSessionToken=()=>{var e,t;return null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.getSessionToken())&&void 0!==t?t:null},this.LeadSourceClient=null,this.LeadSourceMultitouchClient=null,this.sampleRateToUse=.05,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.overrideRentgrata=!1,this.widgetType=Ap.Default,this.onWidgetLoaded=Ch(),this.onSstClose=Ch(),this.enabledChatWidgets={callDesktop:!1,callMobile:!1,chatMobile:!1,chatDesktop:!1,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,sstDesktop:!1,sstMobile:!1,calcDesktop:!1,calcMobile:!1},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.hideMobileFeatures=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=Oe(),this.dniNumber=null,this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{var e,t;if(!this.orgSlug)return;if(!this.centralConvo&&!this.buildingSlug)return;this.centralConvo&&!this.buildingSlug&&(this.orgLevel=!0);const n=this.centralConvo?await async function(e){const t=`https://app.meetelise.com/api/pub/v1/organization/${e}/webchat/v2`,n=await r().get(t);return Ca(n.data)}(this.orgSlug):await wa(this.orgSlug,this.buildingSlug);if(!this.isOrgMode()){if(Math.random()<.2)try{(async(e,t)=>{const n=window.rentgrata;if(!n)return;const i=n.Widget;if(!i)return;const o=i.config;if(!o)return;const a=o.widgetKey;a&&await r().post(`https://app.meetelise.com/platformApi/webchat/rentgrata?token=${a}`,{},{headers:{"Content-Type":"application/json","building-slug":null!=e?e:"","org-slug":null!=t?t:""}})})(this.buildingSlug,this.orgSlug)}catch(e){}try{ep(this.orgSlug,this.buildingSlug)}catch(e){}}if(!await _u(n,this.buildingSlug,this.orgSlug))return;To({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==n?void 0:n.launchedDateTime)?.01:.05}),this.buildingWebchatView=n;const i=(()=>{try{const e="true"===sessionStorage.getItem(xs);return sessionStorage.removeItem(xs),e}catch{return!1}})();await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),(e=>{const t=new URLSearchParams(window.location.search),n=t.get("rwg_token"),i=t.get("elise_google_env");if(!n||!i||!e)return;const r={rwgToken:n,environment:i,buildingId:e,expiresAt:Date.now()+2592e6};localStorage.setItem(is,JSON.stringify(r))})(null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.id)&&void 0!==t?t:0),i?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0):"tour"===new URLSearchParams(window.location.search).get("elise_open")&&(this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile)?this.openTourSchedulerOnLoad=!0:this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.rememberChatAutoOpenDismissed()):"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0),this.isLoading=!1},this.setBuildingDerivedInfo=async()=>{var e,t,n,i,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S,k,A,T,E,_,O,P,I,N,M,D,L,R,B,U,j,F,H,z,G,V,W,Q,q,Y,K,X;const Z=this.buildingWebchatView;if(!Z)return;Z&&this.orgSlug&&!this.orgLevel&&hp(this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.chatId)&&void 0!==t?t:null,this.sampleRateToUse,this.buildingSlug,null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null);const J=Z.featureFlagWebchatMarketingSourceDropdownConfiguration,ee=Z.featureFlagWebchatUseDniPhoneNumberBySource,te=Z.featureFlagInsertDniIntoWebsite,ne=Z.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var ie;ie=No.includes(Z.orgId),Do=ie;const[re,oe,ae,se,le,ue]=await Promise.all([this.isOrgMode()?Promise.resolve([]):zh(this.orgSlug,this.buildingSlug),yo(this.buildingSlug),Vh(this.buildingSlug),wo(this.buildingSlug),xo(this.buildingSlug),Co(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Qn(Z.phoneNumber),this.buildingWebchatView.isAip=ae),this.leadSources=re,this.featureFlagShowDropdown=J,this.bedroomPreferenceRequired=se,this.brokerIntakeEnabled=le,this.tourSchedulerV2=ue;const de=this.orgLevel?null:Z.textWithUsPhoneNumber?Z.textWithUsPhoneNumber:await(async e=>{try{const t="https://app.meetelise.com",n=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(n.data)return n.data}catch(t){return Ao({logType:ko.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t},error:t}),null}return null})(this.buildingSlug),ce=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,he=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,pe={callDesktop:null!==(d=null===(u=this.buildingWebchatView)||void 0===u?void 0:u.shouldShowPhoneDesktop)&&void 0!==d&&d,callMobile:null!==(h=null===(c=this.buildingWebchatView)||void 0===c?void 0:c.shouldShowPhoneMobile)&&void 0!==h&&h,chatDesktop:null!==(f=null===(p=this.buildingWebchatView)||void 0===p?void 0:p.shouldShowChatDesktop)&&void 0!==f&&f,chatMobile:null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.shouldShowChatMobile)&&void 0!==m&&m,emailDesktop:null!==(y=null===(b=this.buildingWebchatView)||void 0===b?void 0:b.shouldShowEmailDesktop)&&void 0!==y&&y,emailMobile:null!==(w=null===(v=this.buildingWebchatView)||void 0===v?void 0:v.shouldShowEmailMobile)&&void 0!==w&&w,textDesktop:null!==(x=(null===(C=this.buildingWebchatView)||void 0===C?void 0:C.shouldShowTextDesktop)&&!!de)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!de)&&void 0!==S&&S,sstDesktop:null!==(A=null===(k=this.buildingWebchatView)||void 0===k?void 0:k.shouldShowSstDesktop)&&void 0!==A&&A,sstMobile:null!==(E=null===(T=this.buildingWebchatView)||void 0===T?void 0:T.shouldShowSstMobile)&&void 0!==E&&E,calcDesktop:ce,calcMobile:he};var fe,ge;this.enabledChatWidgets=this.withOrgLevelContactOptions(Eh(pe),null!==(O=null===(_=this.buildingWebchatView)||void 0===_?void 0:_.phoneNumber)&&void 0!==O?O:""),this.orgLevel||(this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(Yh(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ne&&(ge=this.handleTourClicked,document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(e=>{e&&e.addEventListener("click",e=>{e.preventDefault(),ge(e)})})),"radco"===this.orgSlug&&(e=>{document.querySelectorAll('a[href^="#leaseleads-tour-open"]').forEach(t=>{var n;if(!t)return;const i=document.createElement("a");i.textContent=t.textContent,i.style.cursor="pointer",i.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(n=t.parentNode)||void 0===n||n.replaceChild(i,t)})})(this.handleTourClicked)):(null===(P=this.LeadSourceClient)||void 0===P?void 0:P.leadSource)&&(fe=null!==(N=null===(I=this.LeadSourceClient)||void 0===I?void 0:I.leadSource)&&void 0!==N?N:null,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(fe)}`)}}))),this.buildingWebchatView&&(this.primaryColor=null!==(M=this.buildingWebchatView.primaryColor)&&void 0!==M?M:null,this.backgroundColor=null!==(D=this.buildingWebchatView.secondaryColor)&&void 0!==D?D:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(L=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==L?L:null,this.foregroundColorOnSecondaryBackgroundColor=null!==(R=this.buildingWebchatView.foregroundColorOnSecondaryBackgroundColor)&&void 0!==R?R:null,this.webchatConfigHasAutoOpenChat=null!==(B=this.buildingWebchatView.autoOpenChat)&&void 0!==B&&B,this.requiresConsent=null!==(U=this.buildingWebchatView.requiresConsentForChat)&&void 0!==U&&U,this.hideMobileFeatures=null!==(j=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==j&&j,this.privacyPolicyUrl=null!==(F=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==F?F:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===ma.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===ma.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===ma.EMOJI&&(this.designConcept=ma.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Zn),null===this.backgroundColor&&(this.backgroundColor=Jn);const me=null!==(z=null===(H=this.buildingWebchatView)||void 0===H?void 0:H.phoneNumber)&&void 0!==z?z:"";let be=null;if(ee&&!this.orgLevel&&(be=await async function(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return n.data?{number:Qn(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(V=null===(G=this.LeadSourceClient)||void 0===G?void 0:G.leadSource)&&void 0!==V?V:null),be&&!be.isMatch&&(be.number=me)),te&&(null==be?void 0:be.number)){this.dniNumber=be.number;const e=qh(be.number,this.orgSlug,this.buildingSlug);e>0&&To({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const ye=localStorage.getItem("eliseai_phone_number_devtest");ye&&(this.dniNumber=ye,qh(ye,this.orgSlug,this.buildingSlug)),this.phoneNumberForSource=be||{number:me,isMatch:!1,isPropertyWebsiteCatchall:!0};const ve=null!==(Q=null===(W=this.LeadSourceClient)||void 0===W?void 0:W.leadSource)&&void 0!==Q?Q:null;ve&&(this.leadSources.includes(ve)||this.leadSources.push(ve)),this.isOrgMode()||ao(Z.id);if((oe||(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isAip))&&(null===(Y=this.buildingWebchatView)||void 0===Y?void 0:Y.isLiveOnApplications)&&this.buildingSlug&&!this.orgLevel){const e=((e,t,n)=>{var i;const r=[/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/content\/apply/,/\/apply-now/,/\/apply/,/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,/busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/],o=document.body.getElementsByTagName("a");let a=0;for(let s=0;s<o.length;s++){const l=o[s];if(l.nodeType===Node.ELEMENT_NODE&&r.some(e=>e.test(l.href))){const r=l.getAttribute("href"),o=(null===(i=l.textContent)||void 0===i?void 0:i.toLowerCase())||"",s=tp(o,e);l.setAttribute("href",s),a++,Ao({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:ko.info,buildingSlug:n,orgSlug:t})}}return 0===a&&Ao({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:ko.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&To({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_application_link_replacement_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}if(this.buildingSlug&&this.orgSlug&&!this.orgLevel)try{(e=>{const t=np[e];if(!t)return 0;const n=`${ip}/building/${t}/units`,i=`${ip}/building/${e}/units`,r=new RegExp(`https://applications\\.eliseai\\.com/building/${t}/units`,"g");let o=0;const a=document.body.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a[e],s=t.getAttribute("href");if(!s||!s.includes(n))continue;const l=s.replace(r,i);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(n))return;const a=t.replace(r,i);a!==t&&(e.setAttribute("onclick",a),o++)})})(this.buildingSlug)}catch{}this.buildingSlug&&!this.orgLevel&&(null===(K=this.buildingWebchatView)||void 0===K?void 0:K.isLiveOnApplications)&&(null===(X=this.buildingWebchatView)||void 0===X?void 0:X.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&sp(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,n,i,r,o,a,s,l,u;if(!this.buildingWebchatView)return;const d=this.chatStorageSlug(),c=vs(d),h=ws(d,c),p=h?c:ys(d,!1);if(!p.leadId)throw new Error("Lead ID is null");if(this.LeadSourceClient=new ca,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new lp(this.orgSlug,this.buildingSlug),this.myPubnub=new Ps(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,p.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType),this.myPubnub.chatStorageSlug=d,this.centralConvo){const e=this.myPubnub;e.centralConvo=!0,void 0!==this.hostDeclaredBuildingId?e.declaredBuildingId=this.hostDeclaredBuildingId:this.fetchDeclaredBuildingId().then(t=>{void 0===this.hostDeclaredBuildingId&&(e.declaredBuildingId=t)})}else this.myPubnub.declaredBuildingId=this.buildingWebchatView.id;const f=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,h&&null!==(n=p.leadId)&&void 0!==n?n:void 0);f&&(ys(d,p.initiatedChat,f.lead_id),this.isOrgMode()&&f.building_slug&&await this.adoptBuilding(f.building_slug)),this.LeadSourceClient.chatId=this.myPubnub.channel;const g=await(null===(i=this.LeadSourceClient)||void 0===i?void 0:i.generateUserLeadSource({leadId:null!==(o=null===(r=this.myPubnub)||void 0===r?void 0:r.leadUserId)&&void 0!==o?o:"",orgSlug:this.orgSlug,buildingSlug:this.buildingSlug}));g&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(g),"property-website"!==da(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:da(this.orgSlug):this.myPubnub.leadSource=null!==(u=null===(l=this.LeadSourceClient)||void 0===l?void 0:l.leadSource)&&void 0!==u?u:null;const m=vs(d);m.initiatedChat&&await this.myPubnub.initializePubnub(m)},this.isOrgMode=()=>this.centralConvo&&!this.buildingSlug,this.chatStorageSlug=()=>this.orgLevel?"":this.buildingSlug,this.adoptBuilding=async e=>{var t;try{const n=await wa(this.orgSlug,e);if(!(null==n?void 0:n.id))return;this.buildingSlug=e,this.buildingWebchatView=n,null===(t=this.myPubnub)||void 0===t||t.adoptBuilding(e,n)}catch(e){}},this.withOrgLevelContactOptions=(e,t)=>this.orgLevel?{...e,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,callDesktop:e.callDesktop&&!!t,callMobile:e.callMobile&&!!t}:e,this.fetchDeclaredBuildingId=async()=>{if(!this.declaredBuildingSlug||!this.orgSlug)return null;try{const e=await wa(this.orgSlug,this.declaredBuildingSlug);return"number"==typeof(null==e?void 0:e.id)&&e.id>0?e.id:null}catch{return null}},this.chatAutoOpenDismissedStorageKey=()=>{const{orgSlug:e,buildingSlug:t}=this;return e&&t?`com.elise.webchat.autoOpenDismissed=${e}=${t}`:t?`com.elise.webchat.autoOpenDismissed=${t}`:e?`com.elise.webchat.autoOpenDismissed=${e}`:null},this.shouldAutoOpenChat=e=>{if(!e||Ir())return!1;const t=this.chatAutoOpenDismissedStorageKey();return!t||"true"!==localStorage.getItem(t)},this.rememberChatAutoOpenDismissed=()=>{const e=this.chatAutoOpenDismissedStorageKey();e&&localStorage.setItem(e,"true")},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.focusChatOnMount=!0,this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,localStorage.setItem("isChatOpen","true")},e.onExitChat=this.onExitChat)},this.onExitChat=()=>{this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,localStorage.setItem("isChatOpen","false"),this.rememberChatAutoOpenDismissed()},this.focusLauncherButton=()=>{var e,t;const n=(null===(e=this.launcherButton)||void 0===e?void 0:e.isConnected)?this.launcherButton:null;null===(t=null!=n?n:this.currentLauncherButton())||void 0===t||t.focus()},this.focusMessageFieldOnOpen=()=>{var e,t;const n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("pubnub-chat"),i=null==n?void 0:n.shadowRoot;n&&i&&(n.focusMessageField()||null===(t=i.getElementById("pubnub-chat-container"))||void 0===t||t.focus(),setTimeout(()=>{n.focusMessageField()},0))},this.closeChatAndRestoreFocus=()=>{this.onExitChat(),this.updateComplete.then(()=>{this.focusLauncherButton(),requestAnimationFrame(()=>this.focusLauncherButton())})}}reinsertDNIIntoWebsite(){this.dniNumber&&qh(this.dniNumber,this.orgSlug,this.buildingSlug)}setDeclaredBuildingId(e){this.hostDeclaredBuildingId=e,this.myPubnub&&(this.myPubnub.declaredBuildingId=e)}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new $o(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),bs(this.chatStorageSlug()),this.orgLevel&&(this.buildingSlug=""),this.myPubnub=null,this.displayPubnubChat=!1,await this.setupWebchat(),this.hideLauncher=!1}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustPositionChatAdditionalActions),this._cleanupMobileListener=Nr(e=>{this._isMobile=e})}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}currentLauncherButton(){var e,t,n,i;const r=null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("meetelise-launcher"))||void 0===t?void 0:t.shadowRoot,o=null==r?void 0:r.querySelector("#type-hey__ask-prompt, button[aria-label='Chat with us']"),a=null===(i=null===(n=null==r?void 0:r.querySelector("mobile-launcher"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.querySelector("button[aria-label='Chat with us']");return o instanceof HTMLElement?o:a instanceof HTMLElement?a:null}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S,k,A,T,E,_,O,P,I,N,M,D,L,R,B,U,j,F,z,G,V,W,Q;kh();const q=this.hideLauncher&&!this.isLoading&&!this._isMobile;return H`
|
|
9078
9099
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9079
9100
|
${this.displayPubnubChat?H`
|
|
9080
9101
|
<pubnub-chat
|
|
@@ -9084,7 +9105,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9084
9105
|
.orgSlug=${this.orgSlug}
|
|
9085
9106
|
.buildingSlug=${this.buildingSlug}
|
|
9086
9107
|
.centralConvo=${this.centralConvo}
|
|
9087
|
-
.widgetType=${
|
|
9108
|
+
.widgetType=${Ap.Default}
|
|
9088
9109
|
.building=${this.buildingWebchatView}
|
|
9089
9110
|
.primaryColor=${this.primaryColor}
|
|
9090
9111
|
.backgroundColor=${this.backgroundColor}
|
|
@@ -9194,7 +9215,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9194
9215
|
</meetelise-launcher>`:""}
|
|
9195
9216
|
</div>
|
|
9196
9217
|
</meta>
|
|
9197
|
-
`}};
|
|
9218
|
+
`}};dp.styles=p`
|
|
9198
9219
|
:host {
|
|
9199
9220
|
all: initial;
|
|
9200
9221
|
}
|
|
@@ -9243,7 +9264,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9243
9264
|
position: fixed;
|
|
9244
9265
|
bottom: 0;
|
|
9245
9266
|
}
|
|
9246
|
-
`,
|
|
9267
|
+
`,up([pe({type:String})],dp.prototype,"buildingSlug",void 0),up([pe({type:String})],dp.prototype,"orgSlug",void 0),up([pe({type:Boolean})],dp.prototype,"centralConvo",void 0),up([pe({type:String})],dp.prototype,"declaredBuildingSlug",void 0),up([pe({type:Object})],dp.prototype,"launcherStyles",void 0),up([pe()],dp.prototype,"mobileStyles",void 0),up([pe({type:Boolean})],dp.prototype,"isMinimized",void 0),up([pe({type:String})],dp.prototype,"primaryColor",void 0),up([pe({type:String})],dp.prototype,"backgroundColor",void 0),up([pe({type:String})],dp.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),up([pe({type:String})],dp.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),up([fe()],dp.prototype,"_isMobile",void 0),up([fe()],dp.prototype,"chatId",void 0),up([fe()],dp.prototype,"analytics",void 0),up([fe()],dp.prototype,"launcher",void 0),up([fe()],dp.prototype,"buildingWebchatView",void 0),up([fe()],dp.prototype,"designConcept",void 0),up([fe()],dp.prototype,"leadSources",void 0),up([fe()],dp.prototype,"currentLeadSource",void 0),up([fe()],dp.prototype,"featureFlagShowDropdown",void 0),up([fe()],dp.prototype,"bedroomPreferenceRequired",void 0),up([fe()],dp.prototype,"tourSchedulerV2",void 0),up([fe()],dp.prototype,"brokerIntakeEnabled",void 0),up([fe()],dp.prototype,"phoneNumberForSource",void 0),up([fe()],dp.prototype,"hasMounted",void 0),up([fe()],dp.prototype,"hideLauncher",void 0),up([fe()],dp.prototype,"isLoading",void 0),up([fe()],dp.prototype,"showTourNextToChat",void 0),up([fe()],dp.prototype,"openTourSchedulerOnLoad",void 0),up([fe()],dp.prototype,"displayPubnubChat",void 0),up([fe()],dp.prototype,"myPubnub",void 0),up([fe()],dp.prototype,"LeadSourceClient",void 0),up([fe()],dp.prototype,"LeadSourceMultitouchClient",void 0),up([fe()],dp.prototype,"sampleRateToUse",void 0),up([pe({type:Number})],dp.prototype,"right",void 0),up([pe({type:Number})],dp.prototype,"bottom",void 0),up([pe({type:Number})],dp.prototype,"top",void 0),up([pe({type:Number})],dp.prototype,"left",void 0),up([pe({attribute:!0})],dp.prototype,"overrideRentgrata",void 0),up([pe({attribute:!0})],dp.prototype,"widgetType",void 0),up([pe()],dp.prototype,"onWidgetLoaded",void 0),up([pe({attribute:!0})],dp.prototype,"onSstClose",void 0),up([fe()],dp.prototype,"enabledChatWidgets",void 0),up([fe()],dp.prototype,"webchatConfigHasAutoOpenChat",void 0),up([fe()],dp.prototype,"requiresConsent",void 0),up([fe()],dp.prototype,"hideMobileFeatures",void 0),up([fe()],dp.prototype,"privacyPolicyUrl",void 0),dp=up([ce("me-chat")],dp);const cp=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},hp=async(e,t,n,i,o)=>{var a;if(!i||!e)return;const s=await async function(e){if(!e)return!1;try{return(await r().get(mo(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-override-contact-us-form",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(i);if(!s)return;const u=cp(["myContactForm","contactus","fpa-myContactForm"]);let d;if(!(u&&u instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&pp(i,e,"Could not find form",t?{id:t.id}:void 0))}try{if(u.parentElement&&"scheduleTourForm"===u.parentElement.id)return pp(i,e,"Form is apart of schedule tour form!")}catch(e){}for(let e=0;e<u.elements.length;e++){const t=u.elements[e];if("button"===t.tagName.toLowerCase()&&"fakebutton"===t.getAttribute("data-selenium-id")){d=t;break}if("fpa-contact-submit"===t.getAttribute("id")){d=t;break}}if(!d)return pp(i,e,"Could not find submit button");const c=()=>({firstName:cp(["firstname","txtName","fpa-firstname","Form_FirstName"]),lastName:cp(["lastname","txtName2","fpa-lastname","Form_LastName"]),email:cp(["email","txtEmail","fpa-email","Form_Email"]),phone:cp(["phonenumber","txtPhone","fpa-phonenumber","Form_Phone"]),message:cp(["message","txtComments","fpa-email","Form_Message"])});if(Object.values(c()).some(e=>null===e)){const t=Object.entries(c()).filter(([,e])=>null===e).map(([e])=>e);return pp(i,e,"Missing the following form elements: "+t.join(", "))}const h=d.textContent,p=d.cloneNode(!0);null===(a=d.parentNode)||void 0===a||a.replaceChild(p,d),p&&To({params:{chat_id:t,org_slug:e,building_slug:i,is_form_override_success:!0},sampleRate:n}),p.onclick=async function(t){if(Object.values(c()).forEach(e=>{"true"!==(null==e?void 0:e.getAttribute("aria-required"))||e.value||(e.className="form-control required is-invalid")}),!Object.values(c()).every(e=>null!==e&&!("true"===e.getAttribute("aria-required")&&!e.value)&&("email"!==e.id&&"phonenumber"!==e.id||"true"!==e.getAttribute("aria-invalid"))))return;t.preventDefault(),p.textContent="Processing request...",p.disabled=!0;const n={};Object.entries(c()).forEach(([e,t])=>n[e]=null==t?void 0:t.value);const r=await wa(e,i);if(!r)return pp(i,e,"Could not find building"),null;const a={email_address:n.email,first_name:n.firstName,last_name:n.lastName,phone_number:n.phone,first_message:n.message,building_id:r.id,is_external_form:!0,tracking_params:l(e),lead_sources:[...new Set(o?[o,da(e)]:[da(e)])]},s=JSON.stringify(a);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":i,"org-slug":e},body:s}).then(e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return u&&u.reset(),Object.values(c()).forEach(e=>{e&&(e.disabled=!0)}),p.textContent="Submitted",p.disabled=!0,e.json()}).catch(()=>{p.textContent=h})}},pp=(e,t,n,i)=>{const r=JSON.stringify({orgSlug:t,buildingSlug:e,reason:n,url:window.location.href,formIdInfo:i});fetch("https://app.meetelise.com/platformApi/webchat/form-override-error",{method:"POST",headers:{"Content-Type":"application/json","building-slug":e,"org-slug":t},body:r})},fp=p`
|
|
9247
9268
|
.chat-launcher {
|
|
9248
9269
|
position: fixed;
|
|
9249
9270
|
}
|
|
@@ -9274,7 +9295,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9274
9295
|
filter: brightness(1.1);
|
|
9275
9296
|
}
|
|
9276
9297
|
}
|
|
9277
|
-
`;var
|
|
9298
|
+
`;var gp=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 mp=class extends ue{constructor(){super(...arguments),this.right=0,this.bottom=0,this.top=0,this.left=0,this.isChatOpen=!1,this.onClickCloseChat=()=>({}),this.onClickOpenChat=()=>({})}render(){return this.isChatOpen?H`
|
|
9278
9299
|
<div
|
|
9279
9300
|
class="chat-launcher"
|
|
9280
9301
|
style=${Xn({top:Ir()||isNaN(this.top)?void 0:`${this.top+432}px`,bottom:Ir()||isNaN(this.bottom)?"72px":this.bottom-60+"px",left:Ir()||isNaN(this.left)?void 0:`${this.left}px`,right:Ir()||isNaN(this.right)?"18px":`${this.right}px`})}
|
|
@@ -9328,12 +9349,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9328
9349
|
/>
|
|
9329
9350
|
</svg>
|
|
9330
9351
|
</button>
|
|
9331
|
-
</div>`}};
|
|
9352
|
+
</div>`}};mp.styles=[fp],gp([pe({type:Number})],mp.prototype,"right",void 0),gp([pe({type:Number})],mp.prototype,"bottom",void 0),gp([pe({type:Number})],mp.prototype,"top",void 0),gp([pe({type:Number})],mp.prototype,"left",void 0),gp([pe({attribute:!0})],mp.prototype,"isChatOpen",void 0),gp([pe({attribute:!0})],mp.prototype,"onClickCloseChat",void 0),gp([pe({attribute:!0})],mp.prototype,"onClickOpenChat",void 0),mp=gp([ce("simple-launcher")],mp);var bp=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 yp=class extends ue{constructor(){super(...arguments),this.healthcareId="",this.right=0,this.bottom=0,this.top=0,this.left=0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=Oe(),this.firstUpdated=async()=>{await this.initializeChatVariables()},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=vs(this.healthcareId),t=ws(this.healthcareId,e)?e:ys(this.healthcareId,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Ps(this.healthcareId,null,"",this.currentLeadSource,t.leadId,null,null,Ap.Healthcare),t.initiatedChat&&await this.myPubnub.initializePubnub(e),Ir()||(this.displayPubnubChat=!0),this.attachOnClickToLauncher(),this.isLoading=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0})}}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),bs(this.healthcareId),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),super.disconnectedCallback()}render(){var e;return kh(),this.isLoading?H``:H`
|
|
9332
9353
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
9333
9354
|
${this.displayPubnubChat?H`
|
|
9334
9355
|
<pubnub-chat
|
|
9335
9356
|
id="pubnub-chat"
|
|
9336
|
-
.widgetType=${
|
|
9357
|
+
.widgetType=${Ap.Healthcare}
|
|
9337
9358
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
9338
9359
|
.myPubnub=${this.myPubnub}
|
|
9339
9360
|
.buildingSlug=${this.healthcareId}
|
|
@@ -9359,7 +9380,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9359
9380
|
></simple-launcher>
|
|
9360
9381
|
|
|
9361
9382
|
</meta>
|
|
9362
|
-
`}};
|
|
9383
|
+
`}};yp.styles=p`
|
|
9363
9384
|
:host {
|
|
9364
9385
|
all: initial;
|
|
9365
9386
|
}
|
|
@@ -9412,13 +9433,13 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9412
9433
|
line-height: 150%;
|
|
9413
9434
|
font-size: 16px;
|
|
9414
9435
|
}
|
|
9415
|
-
`,
|
|
9436
|
+
`,bp([pe({type:String})],yp.prototype,"healthcareId",void 0),bp([pe({type:Number})],yp.prototype,"right",void 0),bp([pe({type:Number})],yp.prototype,"bottom",void 0),bp([pe({type:Number})],yp.prototype,"top",void 0),bp([pe({type:Number})],yp.prototype,"left",void 0),bp([fe()],yp.prototype,"launcher",void 0),bp([fe()],yp.prototype,"currentLeadSource",void 0),bp([fe()],yp.prototype,"displayPubnubChat",void 0),bp([fe()],yp.prototype,"myPubnub",void 0),bp([fe()],yp.prototype,"requiresConsent",void 0),bp([fe()],yp.prototype,"privacyPolicyUrl",void 0),bp([fe()],yp.prototype,"isLoading",void 0),yp=bp([ce("health-chat")],yp);var vp=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 wp=class extends ue{constructor(){super(...arguments),this.orgSlug="",this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=Oe(),this.firstUpdated=async()=>{(await async function(e){if(!e)return!1;const t="e2e-test-yardi-building";try{return(await r().get(mo(t),{params:{building_slug:t,flag_type:"bool",feature_flag:"enable-show-utilities-webchat",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(this.orgSlug)||location.href.includes("demo/utilities"))&&await this.initializeChatVariables()},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=vs(this.orgSlug),t=ws(this.orgSlug,e)?e:ys(this.orgSlug,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Ps(this.orgSlug,null,this.orgSlug,this.currentLeadSource,t.leadId,null,null,Ap.Utilities),t.initiatedChat&&await this.myPubnub.initializePubnub(e),Ir()||(this.displayPubnubChat=!0),this.attachOnClickToLauncher(),this.isLoading=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0})}}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),bs(this.orgSlug),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),super.disconnectedCallback()}render(){var e;return kh(),this.isLoading?H``:H`
|
|
9416
9437
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
9417
9438
|
${this.displayPubnubChat?H`
|
|
9418
9439
|
<pubnub-chat
|
|
9419
9440
|
id="pubnub-chat"
|
|
9420
9441
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
9421
|
-
.widgetType=${
|
|
9442
|
+
.widgetType=${Ap.Utilities}
|
|
9422
9443
|
.myPubnub=${this.myPubnub}
|
|
9423
9444
|
.buildingSlug=${this.orgSlug}
|
|
9424
9445
|
.onClickExit=${()=>{this.displayPubnubChat=!1}}
|
|
@@ -9442,7 +9463,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9442
9463
|
|
|
9443
9464
|
></simple-launcher>
|
|
9444
9465
|
</meta>
|
|
9445
|
-
`}};
|
|
9466
|
+
`}};wp.styles=p`
|
|
9446
9467
|
:host {
|
|
9447
9468
|
all: initial;
|
|
9448
9469
|
}
|
|
@@ -9495,4 +9516,4 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9495
9516
|
line-height: 150%;
|
|
9496
9517
|
font-size: 16px;
|
|
9497
9518
|
}
|
|
9498
|
-
`,bp([pe({type:String})],yp.prototype,"orgSlug",void 0),bp([pe({type:Number})],yp.prototype,"right",void 0),bp([pe({type:Number})],yp.prototype,"bottom",void 0),bp([pe({type:Number})],yp.prototype,"top",void 0),bp([pe({type:Number})],yp.prototype,"left",void 0),bp([fe()],yp.prototype,"launcher",void 0),bp([fe()],yp.prototype,"currentLeadSource",void 0),bp([fe()],yp.prototype,"displayPubnubChat",void 0),bp([fe()],yp.prototype,"myPubnub",void 0),bp([fe()],yp.prototype,"requiresConsent",void 0),bp([fe()],yp.prototype,"privacyPolicyUrl",void 0),bp([fe()],yp.prototype,"isLoading",void 0),yp=bp([ce("utilities-chat")],yp);const vp=async e=>{const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&Ao({logType:i&&i.data?ko.info:ko.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),i.data},wp=async(e,t=5e3)=>new Promise((n,i)=>{const r=new MutationObserver((t,i)=>{const r=document.getElementById(e);r&&(i.disconnect(),n(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),i(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),n(a))});class Cp{static healthcareStart(e,t=!0){var n,i,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),kp();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","region"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(n=e.right)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("bottom",(null===(i=e.bottom)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),Cp.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;if(t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization||"",this.hasBuildingSlug=!!e.building,this.overridePlacement={right:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.right,bottom:null===(i=null==e?void 0:e.position)||void 0===i?void 0:i.bottom,top:null===(r=null==e?void 0:e.position)||void 0===r?void 0:r.top,left:null===(o=null==e?void 0:e.position)||void 0===o?void 0:o.left}),kp(),e.studio&&!e.building)return void this.handleStudioContext(e);let d=null;switch(e.widgetType){case Sp.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case Sp.Default:d=document.createElement("me-chat");break;case Sp.Utilities:d=document.createElement("utilities-chat");break;default:d=document.createElement("me-chat")}if(!d)throw new Error("Invalid widget type");d.setAttribute("orgSlug","Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization||""),d.setAttribute("widgetType",e.widgetType||Sp.Default),d.setAttribute("class","meetelise-chat"),d.setAttribute("role","region"),d.setAttribute("aria-label","EliseAI Widget"),e.brandColor&&(this.brandColor=e.brandColor,d.setAttribute("primaryColor",((e,t)=>{const n=ei(e),i=0,r=0,o=0,a={r:n.r+Math.round((i-n.r)*t),g:n.g+Math.round((r-n.g)*t),b:n.b+Math.round((o-n.b)*t)};return ti(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),d instanceof lp&&(e.centralConvo?(d.setAttribute("centralConvo","true"),e.building&&d.setAttribute("declaredBuildingSlug",e.building)):this.handleBuildingslug(d,e.organization,e.building,e),e.launcherStyles&&(d.launcherStyles=e.launcherStyles),e.mobileStyles&&(d.mobileStyles=e.mobileStyles),e.onWidgetLoaded&&(d.onWidgetLoaded=e.onWidgetLoaded),e.overrideRentgrata&&((async()=>{const e=await wp("rg-widget-compact");e&&e.setAttribute("style","display: none")})(),d.overrideRentgrata=!0),e.onSstClose&&(d.onSstClose=e.onSstClose)),e.position&&(d.setAttribute("right",(null===(a=e.position.right)||void 0===a?void 0:a.toString())||"unset"),d.setAttribute("bottom",(null===(s=e.position.bottom)||void 0===s?void 0:s.toString())||"unset"),d.setAttribute("top",(null===(l=e.position.top)||void 0===l?void 0:l.toString())||"unset"),d.setAttribute("left",(null===(u=e.position.left)||void 0===u?void 0:u.toString())||"unset")),window.eliseAi={},document.body.appendChild(d),d instanceof lp&&(Cp.meChat=d),d instanceof yp&&(Cp.utilitiesChat=d)}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.studioUpdateToken+=1,await this.removeWidget(),this.activeStudioOrgSlug="",this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey="",this.activeStudioOptions=null}static async removeWidget(){var e;if(!this.meChat)return;const t=this.meChat;await t.remove(),null===(e=t.parentNode)||void 0===e||e.removeChild(t),Cp.meChat===t&&(Cp.meChat=null)}static handleStudioContext(e){e.studio&&(this.activeStudioOptions=e)}static updateStudioContext(e){var t;const n=this.activeStudioOptions;if(!(null==n?void 0:n.studio))return;const i=++this.studioUpdateToken;if(e.siteId&&e.siteId!==n.studio.siteId)return void Ao({logType:ko.warn,logTitle:"[STUDIO_WEBCHAT_CONTEXT_SITE_MISMATCH]",logData:{activeSiteId:n.studio.siteId,contextSiteId:e.siteId,url:window.location.href}});if("org"===(null===(t=e.sessionScope)||void 0===t?void 0:t.type))return void this.updateStudioOrgContext(e,n,i);const r=xp(e.organization),o=xp(e.building);if(!r||!o)return void this.clearStudioContext({source:"elise_studio",reason:"missing_context",preserveCache:!0});const a=function(e,t){if(!(null==e?void 0:e.key))return`building:${t}`;return e.key}(e.sessionScope,o),s=$p(r);this.activeStudioOrgSlug!==s||this.activeStudioBuildingSlug!==o||this.activeStudioSessionScopeKey!==a?this.removeWidget().then(()=>{i===this.studioUpdateToken&&(this.activeStudioOrgSlug=s,this.activeStudioBuildingSlug=o,this.activeStudioSessionScopeKey=a,this.orgSlug=s,this.start({...n,organization:r,building:o},!1))}):requestAnimationFrame(()=>{var e;return null===(e=this.meChat)||void 0===e?void 0:e.reinsertDNIIntoWebsite()})}static updateStudioOrgContext(e,t,n){var i;const r=xp(e.organization);if(!r)return void this.clearStudioContext({source:"elise_studio",reason:"missing_context",preserveCache:!0});const o=$p(r),a=(null===(i=e.sessionScope)||void 0===i?void 0:i.key)||`org:${r}`,s=function(e){const t="string"==typeof e?Number(e):e;return"number"==typeof t&&Number.isInteger(t)&&t>0?t:null}(e.declaredBuildingId);!this.meChat||this.activeStudioOrgSlug!==o||this.activeStudioBuildingSlug||this.activeStudioSessionScopeKey!==a?this.removeWidget().then(()=>{var e;n===this.studioUpdateToken&&(this.activeStudioOrgSlug=o,this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey=a,this.orgSlug=o,this.start({...t,studio:void 0,organization:r,building:void 0,centralConvo:!0},!1),null===(e=this.meChat)||void 0===e||e.setDeclaredBuildingId(s))}):this.meChat.setDeclaredBuildingId(s)}static clearStudioContext(e){this.studioUpdateToken+=1,this.activeStudioOrgSlug="",this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey="",this.removeWidget()}static async handleBuildingslug(e,t,n,i){if(n)return void e.setAttribute("buildingSlug",n);if(this.mutationObserver)return;if(!t)return;const r=await vp(t);if(r){const e={...i,organization:t,building:r};this.start(e,!1)}this.previousUrl=window.location.href,document.body.addEventListener("click",()=>{requestAnimationFrame(()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,vp(t).then(e=>{if(!e)return;const n={...i,organization:t,building:e};this.start(n,!1)}))})},!0)}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,t=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,n=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&Ao({logType:n&&n.data?ko.info:ko.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),!n||!n.data)return;const i={organization:this.orgSlug,building:n.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(i,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&Ao({logType:i&&i.data===e?ko.info:ko.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i&&i.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:i&&i.data===e?null:i&&!i.data?"No match found":i&&i.data!==e?"Mismatch":"No match found"}}),i&&i.data}}function xp(e){return"string"!=typeof e?"":e.trim()}function $p(e){return"Pacific Urban Residential"===e?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e}var Sp;Cp.meChat=null,Cp.healthChat=null,Cp.utilitiesChat=null,Cp.orgSlug="",Cp.mutationObserver=null,Cp.previousUrl="",Cp.hasBuildingSlug=null,Cp.brandColor="",Cp.backgroundColor="",Cp.healthcareId="",Cp.activeStudioOrgSlug="",Cp.activeStudioBuildingSlug="",Cp.activeStudioSessionScopeKey="",Cp.activeStudioOptions=null,Cp.studioUpdateToken=0,Cp.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(Sp||(Sp={}));const kp=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{Sp as WidgetType,Cp as default};
|
|
9519
|
+
`,vp([pe({type:String})],wp.prototype,"orgSlug",void 0),vp([pe({type:Number})],wp.prototype,"right",void 0),vp([pe({type:Number})],wp.prototype,"bottom",void 0),vp([pe({type:Number})],wp.prototype,"top",void 0),vp([pe({type:Number})],wp.prototype,"left",void 0),vp([fe()],wp.prototype,"launcher",void 0),vp([fe()],wp.prototype,"currentLeadSource",void 0),vp([fe()],wp.prototype,"displayPubnubChat",void 0),vp([fe()],wp.prototype,"myPubnub",void 0),vp([fe()],wp.prototype,"requiresConsent",void 0),vp([fe()],wp.prototype,"privacyPolicyUrl",void 0),vp([fe()],wp.prototype,"isLoading",void 0),wp=vp([ce("utilities-chat")],wp);const Cp=async e=>{const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&Ao({logType:i&&i.data?ko.info:ko.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),i.data},xp=async(e,t=5e3)=>new Promise((n,i)=>{const r=new MutationObserver((t,i)=>{const r=document.getElementById(e);r&&(i.disconnect(),n(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),i(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),n(a))});class $p{static healthcareStart(e,t=!0){var n,i,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),Tp();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","region"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(n=e.right)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("bottom",(null===(i=e.bottom)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),$p.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;if(t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization||"",this.hasBuildingSlug=!!e.building,this.overridePlacement={right:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.right,bottom:null===(i=null==e?void 0:e.position)||void 0===i?void 0:i.bottom,top:null===(r=null==e?void 0:e.position)||void 0===r?void 0:r.top,left:null===(o=null==e?void 0:e.position)||void 0===o?void 0:o.left}),Tp(),e.studio&&!e.building)return void this.handleStudioContext(e);let d=null;switch(e.widgetType){case Ap.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case Ap.Default:d=document.createElement("me-chat");break;case Ap.Utilities:d=document.createElement("utilities-chat");break;default:d=document.createElement("me-chat")}if(!d)throw new Error("Invalid widget type");d.setAttribute("orgSlug","Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization||""),d.setAttribute("widgetType",e.widgetType||Ap.Default),d.setAttribute("class","meetelise-chat"),d.setAttribute("role","region"),d.setAttribute("aria-label","EliseAI Widget"),e.brandColor&&(this.brandColor=e.brandColor,d.setAttribute("primaryColor",((e,t)=>{const n=ei(e),i=0,r=0,o=0,a={r:n.r+Math.round((i-n.r)*t),g:n.g+Math.round((r-n.g)*t),b:n.b+Math.round((o-n.b)*t)};return ti(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),d instanceof dp&&(e.centralConvo?(d.setAttribute("centralConvo","true"),e.building&&d.setAttribute("declaredBuildingSlug",e.building)):this.handleBuildingslug(d,e.organization,e.building,e),e.launcherStyles&&(d.launcherStyles=e.launcherStyles),e.mobileStyles&&(d.mobileStyles=e.mobileStyles),e.onWidgetLoaded&&(d.onWidgetLoaded=e.onWidgetLoaded),e.overrideRentgrata&&((async()=>{const e=await xp("rg-widget-compact");e&&e.setAttribute("style","display: none")})(),d.overrideRentgrata=!0),e.onSstClose&&(d.onSstClose=e.onSstClose)),e.position&&(d.setAttribute("right",(null===(a=e.position.right)||void 0===a?void 0:a.toString())||"unset"),d.setAttribute("bottom",(null===(s=e.position.bottom)||void 0===s?void 0:s.toString())||"unset"),d.setAttribute("top",(null===(l=e.position.top)||void 0===l?void 0:l.toString())||"unset"),d.setAttribute("left",(null===(u=e.position.left)||void 0===u?void 0:u.toString())||"unset")),window.eliseAi={},document.body.appendChild(d),d instanceof dp&&($p.meChat=d),d instanceof wp&&($p.utilitiesChat=d)}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.studioUpdateToken+=1,await this.removeWidget(),this.activeStudioOrgSlug="",this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey="",this.activeStudioOptions=null}static async removeWidget(){var e;if(!this.meChat)return;const t=this.meChat;await t.remove(),null===(e=t.parentNode)||void 0===e||e.removeChild(t),$p.meChat===t&&($p.meChat=null)}static handleStudioContext(e){e.studio&&(this.activeStudioOptions=e)}static updateStudioContext(e){var t;const n=this.activeStudioOptions;if(!(null==n?void 0:n.studio))return;const i=++this.studioUpdateToken;if(e.siteId&&e.siteId!==n.studio.siteId)return void Ao({logType:ko.warn,logTitle:"[STUDIO_WEBCHAT_CONTEXT_SITE_MISMATCH]",logData:{activeSiteId:n.studio.siteId,contextSiteId:e.siteId,url:window.location.href}});if("org"===(null===(t=e.sessionScope)||void 0===t?void 0:t.type))return void this.updateStudioOrgContext(e,n,i);const r=Sp(e.organization),o=Sp(e.building);if(!r||!o)return void this.clearStudioContext({source:"elise_studio",reason:"missing_context",preserveCache:!0});const a=function(e,t){if(!(null==e?void 0:e.key))return`building:${t}`;return e.key}(e.sessionScope,o),s=kp(r);this.activeStudioOrgSlug!==s||this.activeStudioBuildingSlug!==o||this.activeStudioSessionScopeKey!==a?this.removeWidget().then(()=>{i===this.studioUpdateToken&&(this.activeStudioOrgSlug=s,this.activeStudioBuildingSlug=o,this.activeStudioSessionScopeKey=a,this.orgSlug=s,this.start({...n,organization:r,building:o},!1))}):requestAnimationFrame(()=>{var e;return null===(e=this.meChat)||void 0===e?void 0:e.reinsertDNIIntoWebsite()})}static updateStudioOrgContext(e,t,n){var i;const r=Sp(e.organization);if(!r)return void this.clearStudioContext({source:"elise_studio",reason:"missing_context",preserveCache:!0});const o=kp(r),a=(null===(i=e.sessionScope)||void 0===i?void 0:i.key)||`org:${r}`,s=function(e){const t="string"==typeof e?Number(e):e;return"number"==typeof t&&Number.isInteger(t)&&t>0?t:null}(e.declaredBuildingId);!this.meChat||this.activeStudioOrgSlug!==o||this.activeStudioBuildingSlug||this.activeStudioSessionScopeKey!==a?this.removeWidget().then(()=>{var e;n===this.studioUpdateToken&&(this.activeStudioOrgSlug=o,this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey=a,this.orgSlug=o,this.start({...t,studio:void 0,organization:r,building:void 0,centralConvo:!0},!1),null===(e=this.meChat)||void 0===e||e.setDeclaredBuildingId(s))}):this.meChat.setDeclaredBuildingId(s)}static clearStudioContext(e){this.studioUpdateToken+=1,this.activeStudioOrgSlug="",this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey="",this.removeWidget()}static async handleBuildingslug(e,t,n,i){if(n)return void e.setAttribute("buildingSlug",n);if(this.mutationObserver)return;if(!t)return;const r=await Cp(t);if(r){const e={...i,organization:t,building:r};this.start(e,!1)}this.previousUrl=window.location.href,document.body.addEventListener("click",()=>{requestAnimationFrame(()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,Cp(t).then(e=>{if(!e)return;const n={...i,organization:t,building:e};this.start(n,!1)}))})},!0)}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,t=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,n=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&Ao({logType:n&&n.data?ko.info:ko.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),!n||!n.data)return;const i={organization:this.orgSlug,building:n.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(i,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&Ao({logType:i&&i.data===e?ko.info:ko.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i&&i.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:i&&i.data===e?null:i&&!i.data?"No match found":i&&i.data!==e?"Mismatch":"No match found"}}),i&&i.data}}function Sp(e){return"string"!=typeof e?"":e.trim()}function kp(e){return"Pacific Urban Residential"===e?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e}var Ap;$p.meChat=null,$p.healthChat=null,$p.utilitiesChat=null,$p.orgSlug="",$p.mutationObserver=null,$p.previousUrl="",$p.hasBuildingSlug=null,$p.brandColor="",$p.backgroundColor="",$p.healthcareId="",$p.activeStudioOrgSlug="",$p.activeStudioBuildingSlug="",$p.activeStudioSessionScopeKey="",$p.activeStudioOptions=null,$p.studioUpdateToken=0,$p.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(Ap||(Ap={}));const Tp=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{Ap as WidgetType,$p as default};
|