@meetelise/chat 1.69.1 → 1.69.3
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/SchedulerV2/itinerary-editor.d.ts +6 -0
- package/dist/src/WebComponent/SchedulerV2/tour-scheduler-v2.d.ts +9 -0
- package/dist/src/WebComponent/SchedulerV2/tourItineraryApi.d.ts +6 -0
- package/dist/src/services/fees/utils.d.ts +3 -0
- package/package.json +1 -1
- package/public/dist/index.js +125 -124
- package/src/WebComponent/SchedulerV2/itinerary-editor.ts +14 -3
- package/src/WebComponent/SchedulerV2/tour-scheduler-v2.ts +45 -4
- package/src/WebComponent/SchedulerV2/tourItineraryApi.ts +7 -0
- package/src/services/fees/utils.ts +17 -0
- package/src/tourSchedulerV2Booking.test.ts +120 -5
package/public/dist/index.js
CHANGED
|
@@ -1786,7 +1786,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
1786
1786
|
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"
|
|
1787
1787
|
fill="${e}"
|
|
1788
1788
|
/>
|
|
1789
|
-
</svg>`;var fa,ga,ma;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(fa||(fa={})),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"}(ga||(ga={})),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"}(ma||(ma={}));const ba=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function ya(e,t){const i=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,n=await r().get(i);return va(n.data)}const va=e=>{var t;try{e.welcomeMessage=wa(null!==(t=e.welcomeMessage)&&void 0!==t?t:"",e.userFirstName)}catch(e){}return e},wa=(e,t)=>e.replace(/elise/gi,t);var Ca=i(7035),xa=i(6353);function $a(e,t,i){var n=function(e,t,i){if(i&&!i.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(i?[i.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,i.timeZone,i.locale);return n.formatToParts?function(e,t){for(var i=e.formatToParts(t),n=i.length-1;n>=0;--n)if("timeZoneName"===i[n].type)return i[n].value}(n,t):function(e,t){var i=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(i);return n?n[0].substr(1):""}(n,t)}function Sa(e,t){var i=function(e){if(!Aa[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")),i="06/25/2014, 00:00:00"===t||"06/25/2014 00:00:00"===t;Aa[e]=i?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 Aa[e]}(t);return i.formatToParts?function(e,t){try{for(var i=e.formatToParts(t),n=[],r=0;r<i.length;r++){var o=ka[i[r].type];o>=0&&(n[o]=parseInt(i[r].value,10))}return n}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(i,e):function(e,t){var i=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(i);return[n[3],n[1],n[2],n[4],n[5],n[6]]}(i,e)}var ka={year:0,month:1,day:2,hour:3,minute:4,second:5};var Aa={};function Ta(e,t,i,n,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,i),s.setUTCHours(n,r,o,a),s}var Ea=36e5,_a={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Oa(e,t,i){var n,r,o;if(!e)return 0;if(n=_a.timezoneZ.exec(e))return 0;if(n=_a.timezoneHH.exec(e))return Ia(o=parseInt(n[1],10))?-o*Ea:NaN;if(n=_a.timezoneHHMM.exec(e)){o=parseInt(n[2],10);var a=parseInt(n[3],10);return Ia(o,a)?(r=Math.abs(o)*Ea+6e4*a,"+"===n[1]?-r:r):NaN}if(function(e){if(Na[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Na[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=i?t:function(e){return Ta(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=Pa(s,e),u=i?l:function(e,t,i){var n=e.getTime(),r=n-t,o=Pa(new Date(r),i);if(t===o)return t;r-=o-t;var a=Pa(new Date(r),i);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function Pa(e,t){var i=Sa(e,t),n=Ta(i[0],i[1]-1,i[2],i[3]%24,i[4],i[5],0).getTime(),r=e.getTime(),o=r%1e3;return n-(r-=o>=0?o:1e3+o)}function Ia(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var Na={};var Ma={X:function(e,t,i,n){var r=Da(n.timeZone,e);if(0===r)return"Z";switch(t){case"X":return Ba(r);case"XXXX":case"XX":return Ra(r);default:return Ra(r,":")}},x:function(e,t,i,n){var r=Da(n.timeZone,e);switch(t){case"x":return Ba(r);case"xxxx":case"xx":return Ra(r);default:return Ra(r,":")}},O:function(e,t,i,n){var r=Da(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var i=e>0?"-":"+",n=Math.abs(e),r=Math.floor(n/60),o=n%60;if(0===o)return i+String(r);var a=t||"";return i+String(r)+a+La(o,2)}(r,":");default:return"GMT"+Ra(r,":")}},z:function(e,t,i,n){switch(t){case"z":case"zz":case"zzz":return $a("short",e,n);default:return $a("long",e,n)}}};function Da(e,t){var i=e?Oa(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(i))throw new RangeError("Invalid time zone specified: "+e);return i}function La(e,t){for(var i=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return i+n}function Ra(e,t){var i=t||"",n=e>0?"-":"+",r=Math.abs(e);return n+La(Math.floor(r/60),2)+i+La(Math.floor(r%60),2)}function Ba(e,t){return e%60==0?(e>0?"-":"+")+La(Math.abs(e)/60,2):Ra(e,t)}const Ua=Ma;var ja=i(9784),Fa=i(9720);var Ha=36e5,za=6e4,Ga={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 Va(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 i=t||{},n=null==i.additionalDigits?2:ja(i.additionalDigits);if(2!==n&&1!==n&&0!==n)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,i={},n=Ga.dateTimePattern.exec(e);n?(i.date=n[1],t=n[3]):(n=Ga.datePattern.exec(e))?(i.date=n[1],t=n[2]):(i.date=null,t=e);if(t){var r=Ga.timeZone.exec(t);r?(i.time=t.replace(r[1],""),i.timeZone=r[1].trim()):i.time=t}return i}(e),o=function(e,t){var i,n=Ga.YYY[t],r=Ga.YYYYY[t];if(i=Ga.YYYY.exec(e)||r.exec(e)){var o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=Ga.YY.exec(e)||n.exec(e)){var a=i[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,n),a=o.year,s=function(e,t){if(null===t)return null;var i,n,r,o;if(0===e.length)return(n=new Date(0)).setUTCFullYear(t),n;if(i=Ga.MM.exec(e))return n=new Date(0),Ka(t,r=parseInt(i[1],10)-1)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(i=Ga.DDD.exec(e)){n=new Date(0);var a=parseInt(i[1],10);return function(e,t){if(t<1)return!1;var i=Ya(e);if(i&&t>366)return!1;if(!i&&t>365)return!1;return!0}(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(i=Ga.MMDD.exec(e)){n=new Date(0),r=parseInt(i[1],10)-1;var s=parseInt(i[2],10);return Ka(t,r,s)?(n.setUTCFullYear(t,r,s),n):new Date(NaN)}if(i=Ga.Www.exec(e))return Xa(t,o=parseInt(i[1],10)-1)?Wa(t,o):new Date(NaN);if(i=Ga.WwwD.exec(e)){o=parseInt(i[1],10)-1;var l=parseInt(i[2],10)-1;return Xa(t,o,l)?Wa(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,i,n;if(t=Ga.HH.exec(e))return Za(i=parseFloat(t[1].replace(",",".")))?i%24*Ha:NaN;if(t=Ga.HHMM.exec(e))return Za(i=parseInt(t[1],10),n=parseFloat(t[2].replace(",",".")))?i%24*Ha+n*za:NaN;if(t=Ga.HHMMSS.exec(e)){i=parseInt(t[1],10),n=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Za(i,n,r)?i%24*Ha+n*za+1e3*r:NaN}return null}(r.time),isNaN(d)))return new Date(NaN);if(r.timeZone||i.timeZone){if(l=Oa(r.timeZone||i.timeZone,new Date(u+d)),isNaN(l))return new Date(NaN)}else l=Fa(new Date(u+d)),l=Fa(new Date(u+d+l));return new Date(u+d+l)}return new Date(NaN)}function Wa(e,t,i){t=t||0,i=i||0;var n=new Date(0);n.setUTCFullYear(e,0,4);var r=7*t+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+r),n}var Qa=[31,28,31,30,31,30,31,31,30,31,30,31],qa=[31,29,31,30,31,30,31,31,30,31,30,31];function Ya(e){return e%400==0||e%4==0&&e%100!=0}function Ka(e,t,i){if(t<0||t>11)return!1;if(null!=i){if(i<1)return!1;var n=Ya(e);if(n&&i>qa[t])return!1;if(!n&&i>Qa[t])return!1}return!0}function Xa(e,t,i){return!(t<0||t>52)&&(null==i||!(i<0||i>6))}function Za(e,t,i){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==i||!(i<0||i>=60)))}var Ja=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function es(e,t,i,n){var r=Ca(n);return r.timeZone=t,r.originalDate=e,function(e,t,i){var n=String(t),r=i||{},o=n.match(Ja);if(o){var a=Va(r.originalDate||e,r);n=o.reduce(function(e,t){if("'"===t[0])return e;var i=e.indexOf(t),n="'"===e[i-1],o=e.replace(t,"'"+Ua[t[0]](a,t,null,r)+"'");return n?o.substring(0,i-1)+o.substring(i+1):o},n)}return xa(e,n,r)}(function(e,t,i){var n=Va(e,i),r=Oa(t,n,!0),o=new Date(n.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),i,r)}const ts="com.eliseai.webchat.googlereserve.referral",is=()=>{var e;try{const t=JSON.parse(null!==(e=localStorage.getItem(ts))&&void 0!==e?e:"null");return(null==t?void 0:t.rwgToken)&&Date.now()<t.expiresAt?t:null}catch{return null}},ns="https://app.meetelise.com",rs=async({buildingSlug:e})=>{try{const t=await r().get(`${ns}/platformApi/webchat/${e}/units/summary`);if(t.data)return Er(t.data)}catch(t){ra({logType:na.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS_SUMMARY]",logData:{error:t},error:t})}return[]};var os,as=i(8805),ss=i.n(as),ls=new Uint8Array(16);function us(){if(!os&&!(os="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 os(ls)}const ds=/^(?:[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 cs=function(e){return"string"==typeof e&&ds.test(e)};for(var hs=[],ps=0;ps<256;++ps)hs.push((ps+256).toString(16).substr(1));const fs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(hs[e[t+0]]+hs[e[t+1]]+hs[e[t+2]]+hs[e[t+3]]+"-"+hs[e[t+4]]+hs[e[t+5]]+"-"+hs[e[t+6]]+hs[e[t+7]]+"-"+hs[e[t+8]]+hs[e[t+9]]+"-"+hs[e[t+10]]+hs[e[t+11]]+hs[e[t+12]]+hs[e[t+13]]+hs[e[t+14]]+hs[e[t+15]]).toLowerCase();if(!cs(i))throw TypeError("Stringified UUID is invalid");return i};const gs=function(e,t,i){var n=(e=e||{}).random||(e.rng||us)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(var r=0;r<16;++r)t[i+r]=n[r];return t}return fs(n)},ms=e=>localStorage.removeItem("com.elise.webchat.slug="+e),bs=(e,t,i)=>{const n=Fr(new Date),r=i||`lead_${gs()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:n,initiatedChat:t})),{leadId:r,timestamp:Yr(n),buildingSlug:e,initiatedChat:t}},ys=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const i=JSON.parse(t),n={leadId:i.leadId,timestamp:new Date(i.timestamp),buildingSlug:i.buildingSlug,initiatedChat:i.initiatedChat};if(vs(e,n))return n}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},vs=(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)},ws=e=>e.startsWith("https://app.meetelise.com/settings/widgets")||e.startsWith("https://app.meetelise.com/settings/marketing/webchat")||e.includes("demo/utilities"),Cs="com.elise.webchat.reopenAfterNavigation",xs=e=>{try{const t=new URL(e);return`${t.origin}${t.pathname}`}catch{return""}},$s=e=>{const t={pageUrl:xs(window.location.href),pageTitle:document.title};return"number"==typeof e&&Number.isInteger(e)&&e>0&&(t.declaredBuildingId=e),t},Ss=(e,t=e=>window.location.assign(e))=>{(()=>{try{sessionStorage.setItem(Cs,"true")}catch{}})(),t(e.url)};var ks;!function(e){e.noReply="no-reply",e.text="text",e.media="media",e.navigation="navigation"}(ks||(ks={}));const As=e=>e.type===_s.text,Ts=e=>e.type===_s.media,Es=e=>e.type===_s.navigation;var _s;!function(e){e.text="text",e.media="media",e.navigation="navigation"}(_s||(_s={}));const Os=class{constructor(e,t,i,n=null,r,o,a=null,s=vp.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=vp.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,i;const n={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,n],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==ks.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,n=null!=t?t:String(+e.timetoken);(t?this.reconstructStreamText(t):null!==(i=e.message.text)&&void 0!==i?i:"").includes("confirmed for your")&&this.fireScheduledTourEventOnce(n,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 i;const n=e.message.stream_id;n&&t.set(n,[...null!==(i=t.get(n))&&void 0!==i?i:[],e])});const i=[...t.entries()].filter(([,e])=>!this.isStreamComplete(e)).map(([e])=>e);i.length>0&&(this.streamingMessageTimeout=setTimeout(()=>{ra({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:na.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory().then(()=>i.forEach(e=>this.checkAndFireTourConfirmationForStream(e)))},e))},this.isStreamComplete=e=>{var t;const i=e.find(e=>e.message.is_done);if(!i)return!1;const n=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=i.message.order)&&void 0!==t?t:0);e++)if(!n.has(e))return!1;return!0},this.getStreamChunks=e=>this.removeDuplicatedRawPubnubMessages(this.rawPubnubMessages).filter(t=>t.message.stream_id===e).sort((e,t)=>{var i,n;return(null!==(i=e.message.order)&&void 0!==i?i:0)-(null!==(n=t.message.order)&&void 0!==n?n:0)}),this.reconstructStreamText=e=>this.getStreamChunks(e).map(e=>e.message.text).join(""),this.fireScheduledTourEventOnce=(e,t)=>{var i;this.firedScheduledTourConfirmationIds.has(e)||(this.firedScheduledTourConfirmationIds.add(e),_o("scheduledTourEvent",{tourDetails:t,buildingId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.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 i=this.getStreamChunks(e);this.fireScheduledTourEventOnce(e,null===(t=i[i.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;_o("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,i;for(let n=e.length-1;n>=0;n--){const r=null===(t=e[n])||void 0===t?void 0:t.message,o=n>0&&(null===(i=e[n-1])||void 0===i?void 0:i.message);(null==r?void 0:r.messageType)===ks.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&&ra({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:na.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=bs(this.chatStorageSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,i,n,r,o,a,s,u,d;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&ra({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:na.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===vp.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:ws(location.href),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.id,buildingSlug:this.buildingSlug,userId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.userId,leadSource:this.leadSource,trackingParams:l(this.orgSlug),widgetType:this.widgetType,isDevState:ws(location.href),...$s(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||(_o("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),_o("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 i=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(i)?(ra({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:na.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(i),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],i={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var n;if(e.message.messageType===ks.navigation){const i=(e=>{if(!e||"object"!=typeof e)return null;const{url:t,label:i}=e;if("string"!=typeof t||"string"!=typeof i)return null;if(!i.trim())return null;try{const e=new URL(t,window.location.href);return"http:"!==e.protocol&&"https:"!==e.protocol?null:{url:e.href,label:i.trim()}}catch{return null}})(e.message.navigation);i&&t.push({timestamp:e.timetoken,navigation:i,isLeadMessage:!1,type:_s.navigation})}else if("media"===e.message.messageType)t.push({timestamp:e.timetoken,media:null!==(n=e.message.media)&&void 0!==n?n:[],isLeadMessage:this.isLeadMessage(e),type:_s.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:_s.text}):i[e.message.stream_id]?i[e.message.stream_id].push(e):i[e.message.stream_id]=[e]}}),Object.keys(i).forEach(e=>{const n=i[e],r=this.getConsecutiveChunks(n.sort((e,t)=>{var i,n;return(null!==(i=e.message.order)&&void 0!==i?i:0)-(null!==(n=t.message.order)&&void 0!==n?n: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,i;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(i=e.message.is_done)&&void 0!==i&&i}}),type:_s.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,i;const n=e.sort((e,t)=>{var i,n;return(null!==(i=e.message.order)&&void 0!==i?i:0)-(null!==(n=t.message.order)&&void 0!==n?n:0)}),r=[];let o=null!==(t=n[0].message.order)&&void 0!==t?t:0;for(const e of n){if((null!==(i=e.message.order)&&void 0!==i?i:-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=i,this.leadSource=n,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}getSessionToken(){return this.sessionToken}async initSession(e,t,i){try{const n={building_slug:e,org_slug:t};this.centralConvo&&(n.central_convo=!0),i&&(n.lead_id=i);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,n);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&&ra({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:na.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(ss())({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&&ra({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:na.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&&ra({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:na.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof n.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&&ra({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:na.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}}async getChannelHistory(e=1500){var t;try{let i=[],n=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((i,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=n?n:void 0},(e,t)=>{e.error?o(e):i(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),i=i.concat(t.filter(e=>e.message.messageType!==ks.noReply))}if(n=a[0].timetoken,i.length>=e||a.length<r)break}this.rawPubnubMessages=i.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&&ra({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:na.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}},Ps=p`
|
|
1789
|
+
</svg>`;var fa,ga,ma;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(fa||(fa={})),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"}(ga||(ga={})),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"}(ma||(ma={}));const ba=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function ya(e,t){const i=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,n=await r().get(i);return va(n.data)}const va=e=>{var t;try{e.welcomeMessage=wa(null!==(t=e.welcomeMessage)&&void 0!==t?t:"",e.userFirstName)}catch(e){}return e},wa=(e,t)=>e.replace(/elise/gi,t);var Ca=i(7035),xa=i(6353);function $a(e,t,i){var n=function(e,t,i){if(i&&!i.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(i?[i.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,i.timeZone,i.locale);return n.formatToParts?function(e,t){for(var i=e.formatToParts(t),n=i.length-1;n>=0;--n)if("timeZoneName"===i[n].type)return i[n].value}(n,t):function(e,t){var i=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(i);return n?n[0].substr(1):""}(n,t)}function Sa(e,t){var i=function(e){if(!Aa[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")),i="06/25/2014, 00:00:00"===t||"06/25/2014 00:00:00"===t;Aa[e]=i?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 Aa[e]}(t);return i.formatToParts?function(e,t){try{for(var i=e.formatToParts(t),n=[],r=0;r<i.length;r++){var o=ka[i[r].type];o>=0&&(n[o]=parseInt(i[r].value,10))}return n}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(i,e):function(e,t){var i=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(i);return[n[3],n[1],n[2],n[4],n[5],n[6]]}(i,e)}var ka={year:0,month:1,day:2,hour:3,minute:4,second:5};var Aa={};function Ta(e,t,i,n,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,i),s.setUTCHours(n,r,o,a),s}var Ea=36e5,_a={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Oa(e,t,i){var n,r,o;if(!e)return 0;if(n=_a.timezoneZ.exec(e))return 0;if(n=_a.timezoneHH.exec(e))return Ia(o=parseInt(n[1],10))?-o*Ea:NaN;if(n=_a.timezoneHHMM.exec(e)){o=parseInt(n[2],10);var a=parseInt(n[3],10);return Ia(o,a)?(r=Math.abs(o)*Ea+6e4*a,"+"===n[1]?-r:r):NaN}if(function(e){if(Na[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Na[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=i?t:function(e){return Ta(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=Pa(s,e),u=i?l:function(e,t,i){var n=e.getTime(),r=n-t,o=Pa(new Date(r),i);if(t===o)return t;r-=o-t;var a=Pa(new Date(r),i);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function Pa(e,t){var i=Sa(e,t),n=Ta(i[0],i[1]-1,i[2],i[3]%24,i[4],i[5],0).getTime(),r=e.getTime(),o=r%1e3;return n-(r-=o>=0?o:1e3+o)}function Ia(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var Na={};var Ma={X:function(e,t,i,n){var r=Da(n.timeZone,e);if(0===r)return"Z";switch(t){case"X":return Ba(r);case"XXXX":case"XX":return Ra(r);default:return Ra(r,":")}},x:function(e,t,i,n){var r=Da(n.timeZone,e);switch(t){case"x":return Ba(r);case"xxxx":case"xx":return Ra(r);default:return Ra(r,":")}},O:function(e,t,i,n){var r=Da(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var i=e>0?"-":"+",n=Math.abs(e),r=Math.floor(n/60),o=n%60;if(0===o)return i+String(r);var a=t||"";return i+String(r)+a+La(o,2)}(r,":");default:return"GMT"+Ra(r,":")}},z:function(e,t,i,n){switch(t){case"z":case"zz":case"zzz":return $a("short",e,n);default:return $a("long",e,n)}}};function Da(e,t){var i=e?Oa(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(i))throw new RangeError("Invalid time zone specified: "+e);return i}function La(e,t){for(var i=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return i+n}function Ra(e,t){var i=t||"",n=e>0?"-":"+",r=Math.abs(e);return n+La(Math.floor(r/60),2)+i+La(Math.floor(r%60),2)}function Ba(e,t){return e%60==0?(e>0?"-":"+")+La(Math.abs(e)/60,2):Ra(e,t)}const Ua=Ma;var ja=i(9784),Fa=i(9720);var Ha=36e5,za=6e4,Ga={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 Va(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 i=t||{},n=null==i.additionalDigits?2:ja(i.additionalDigits);if(2!==n&&1!==n&&0!==n)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,i={},n=Ga.dateTimePattern.exec(e);n?(i.date=n[1],t=n[3]):(n=Ga.datePattern.exec(e))?(i.date=n[1],t=n[2]):(i.date=null,t=e);if(t){var r=Ga.timeZone.exec(t);r?(i.time=t.replace(r[1],""),i.timeZone=r[1].trim()):i.time=t}return i}(e),o=function(e,t){var i,n=Ga.YYY[t],r=Ga.YYYYY[t];if(i=Ga.YYYY.exec(e)||r.exec(e)){var o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=Ga.YY.exec(e)||n.exec(e)){var a=i[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,n),a=o.year,s=function(e,t){if(null===t)return null;var i,n,r,o;if(0===e.length)return(n=new Date(0)).setUTCFullYear(t),n;if(i=Ga.MM.exec(e))return n=new Date(0),Ka(t,r=parseInt(i[1],10)-1)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(i=Ga.DDD.exec(e)){n=new Date(0);var a=parseInt(i[1],10);return function(e,t){if(t<1)return!1;var i=Ya(e);if(i&&t>366)return!1;if(!i&&t>365)return!1;return!0}(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(i=Ga.MMDD.exec(e)){n=new Date(0),r=parseInt(i[1],10)-1;var s=parseInt(i[2],10);return Ka(t,r,s)?(n.setUTCFullYear(t,r,s),n):new Date(NaN)}if(i=Ga.Www.exec(e))return Xa(t,o=parseInt(i[1],10)-1)?Wa(t,o):new Date(NaN);if(i=Ga.WwwD.exec(e)){o=parseInt(i[1],10)-1;var l=parseInt(i[2],10)-1;return Xa(t,o,l)?Wa(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,i,n;if(t=Ga.HH.exec(e))return Za(i=parseFloat(t[1].replace(",",".")))?i%24*Ha:NaN;if(t=Ga.HHMM.exec(e))return Za(i=parseInt(t[1],10),n=parseFloat(t[2].replace(",",".")))?i%24*Ha+n*za:NaN;if(t=Ga.HHMMSS.exec(e)){i=parseInt(t[1],10),n=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Za(i,n,r)?i%24*Ha+n*za+1e3*r:NaN}return null}(r.time),isNaN(d)))return new Date(NaN);if(r.timeZone||i.timeZone){if(l=Oa(r.timeZone||i.timeZone,new Date(u+d)),isNaN(l))return new Date(NaN)}else l=Fa(new Date(u+d)),l=Fa(new Date(u+d+l));return new Date(u+d+l)}return new Date(NaN)}function Wa(e,t,i){t=t||0,i=i||0;var n=new Date(0);n.setUTCFullYear(e,0,4);var r=7*t+i+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+r),n}var Qa=[31,28,31,30,31,30,31,31,30,31,30,31],qa=[31,29,31,30,31,30,31,31,30,31,30,31];function Ya(e){return e%400==0||e%4==0&&e%100!=0}function Ka(e,t,i){if(t<0||t>11)return!1;if(null!=i){if(i<1)return!1;var n=Ya(e);if(n&&i>qa[t])return!1;if(!n&&i>Qa[t])return!1}return!0}function Xa(e,t,i){return!(t<0||t>52)&&(null==i||!(i<0||i>6))}function Za(e,t,i){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==i||!(i<0||i>=60)))}var Ja=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function es(e,t,i,n){var r=Ca(n);return r.timeZone=t,r.originalDate=e,function(e,t,i){var n=String(t),r=i||{},o=n.match(Ja);if(o){var a=Va(r.originalDate||e,r);n=o.reduce(function(e,t){if("'"===t[0])return e;var i=e.indexOf(t),n="'"===e[i-1],o=e.replace(t,"'"+Ua[t[0]](a,t,null,r)+"'");return n?o.substring(0,i-1)+o.substring(i+1):o},n)}return xa(e,n,r)}(function(e,t,i){var n=Va(e,i),r=Oa(t,n,!0),o=new Date(n.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),i,r)}const ts="com.eliseai.webchat.googlereserve.referral",is=()=>{var e;try{const t=JSON.parse(null!==(e=localStorage.getItem(ts))&&void 0!==e?e:"null");return(null==t?void 0:t.rwgToken)&&Date.now()<t.expiresAt?t:null}catch{return null}},ns="https://app.meetelise.com",rs=async({buildingSlug:e})=>{try{const t=await r().get(`${ns}/platformApi/webchat/${e}/units/summary`);if(t.data)return Er(t.data)}catch(t){ra({logType:na.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS_SUMMARY]",logData:{error:t},error:t})}return[]};var os,as=i(8805),ss=i.n(as),ls=new Uint8Array(16);function us(){if(!os&&!(os="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 os(ls)}const ds=/^(?:[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 cs=function(e){return"string"==typeof e&&ds.test(e)};for(var hs=[],ps=0;ps<256;++ps)hs.push((ps+256).toString(16).substr(1));const fs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(hs[e[t+0]]+hs[e[t+1]]+hs[e[t+2]]+hs[e[t+3]]+"-"+hs[e[t+4]]+hs[e[t+5]]+"-"+hs[e[t+6]]+hs[e[t+7]]+"-"+hs[e[t+8]]+hs[e[t+9]]+"-"+hs[e[t+10]]+hs[e[t+11]]+hs[e[t+12]]+hs[e[t+13]]+hs[e[t+14]]+hs[e[t+15]]).toLowerCase();if(!cs(i))throw TypeError("Stringified UUID is invalid");return i};const gs=function(e,t,i){var n=(e=e||{}).random||(e.rng||us)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(var r=0;r<16;++r)t[i+r]=n[r];return t}return fs(n)},ms=e=>localStorage.removeItem("com.elise.webchat.slug="+e),bs=(e,t,i)=>{const n=Fr(new Date),r=i||`lead_${gs()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:n,initiatedChat:t})),{leadId:r,timestamp:Yr(n),buildingSlug:e,initiatedChat:t}},ys=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const i=JSON.parse(t),n={leadId:i.leadId,timestamp:new Date(i.timestamp),buildingSlug:i.buildingSlug,initiatedChat:i.initiatedChat};if(vs(e,n))return n}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},vs=(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)},ws=e=>e.startsWith("https://app.meetelise.com/settings/widgets")||e.startsWith("https://app.meetelise.com/settings/marketing/webchat")||e.includes("demo/utilities"),Cs="com.elise.webchat.reopenAfterNavigation",xs=e=>{try{const t=new URL(e);return`${t.origin}${t.pathname}`}catch{return""}},$s=e=>{const t={pageUrl:xs(window.location.href),pageTitle:document.title};return"number"==typeof e&&Number.isInteger(e)&&e>0&&(t.declaredBuildingId=e),t},Ss=(e,t=e=>window.location.assign(e))=>{(()=>{try{sessionStorage.setItem(Cs,"true")}catch{}})(),t(e.url)};var ks;!function(e){e.noReply="no-reply",e.text="text",e.media="media",e.navigation="navigation"}(ks||(ks={}));const As=e=>e.type===_s.text,Ts=e=>e.type===_s.media,Es=e=>e.type===_s.navigation;var _s;!function(e){e.text="text",e.media="media",e.navigation="navigation"}(_s||(_s={}));const Os=class{constructor(e,t,i,n=null,r,o,a=null,s=Cp.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=Cp.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,i;const n={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,n],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==ks.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,n=null!=t?t:String(+e.timetoken);(t?this.reconstructStreamText(t):null!==(i=e.message.text)&&void 0!==i?i:"").includes("confirmed for your")&&this.fireScheduledTourEventOnce(n,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 i;const n=e.message.stream_id;n&&t.set(n,[...null!==(i=t.get(n))&&void 0!==i?i:[],e])});const i=[...t.entries()].filter(([,e])=>!this.isStreamComplete(e)).map(([e])=>e);i.length>0&&(this.streamingMessageTimeout=setTimeout(()=>{ra({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:na.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory().then(()=>i.forEach(e=>this.checkAndFireTourConfirmationForStream(e)))},e))},this.isStreamComplete=e=>{var t;const i=e.find(e=>e.message.is_done);if(!i)return!1;const n=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=i.message.order)&&void 0!==t?t:0);e++)if(!n.has(e))return!1;return!0},this.getStreamChunks=e=>this.removeDuplicatedRawPubnubMessages(this.rawPubnubMessages).filter(t=>t.message.stream_id===e).sort((e,t)=>{var i,n;return(null!==(i=e.message.order)&&void 0!==i?i:0)-(null!==(n=t.message.order)&&void 0!==n?n:0)}),this.reconstructStreamText=e=>this.getStreamChunks(e).map(e=>e.message.text).join(""),this.fireScheduledTourEventOnce=(e,t)=>{var i;this.firedScheduledTourConfirmationIds.has(e)||(this.firedScheduledTourConfirmationIds.add(e),_o("scheduledTourEvent",{tourDetails:t,buildingId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.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 i=this.getStreamChunks(e);this.fireScheduledTourEventOnce(e,null===(t=i[i.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;_o("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,i;for(let n=e.length-1;n>=0;n--){const r=null===(t=e[n])||void 0===t?void 0:t.message,o=n>0&&(null===(i=e[n-1])||void 0===i?void 0:i.message);(null==r?void 0:r.messageType)===ks.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&&ra({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:na.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=bs(this.chatStorageSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,i,n,r,o,a,s,u,d;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&ra({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:na.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===Cp.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:ws(location.href),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.id,buildingSlug:this.buildingSlug,userId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.userId,leadSource:this.leadSource,trackingParams:l(this.orgSlug),widgetType:this.widgetType,isDevState:ws(location.href),...$s(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||(_o("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),_o("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 i=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(i)?(ra({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:na.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(i),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],i={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var n;if(e.message.messageType===ks.navigation){const i=(e=>{if(!e||"object"!=typeof e)return null;const{url:t,label:i}=e;if("string"!=typeof t||"string"!=typeof i)return null;if(!i.trim())return null;try{const e=new URL(t,window.location.href);return"http:"!==e.protocol&&"https:"!==e.protocol?null:{url:e.href,label:i.trim()}}catch{return null}})(e.message.navigation);i&&t.push({timestamp:e.timetoken,navigation:i,isLeadMessage:!1,type:_s.navigation})}else if("media"===e.message.messageType)t.push({timestamp:e.timetoken,media:null!==(n=e.message.media)&&void 0!==n?n:[],isLeadMessage:this.isLeadMessage(e),type:_s.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:_s.text}):i[e.message.stream_id]?i[e.message.stream_id].push(e):i[e.message.stream_id]=[e]}}),Object.keys(i).forEach(e=>{const n=i[e],r=this.getConsecutiveChunks(n.sort((e,t)=>{var i,n;return(null!==(i=e.message.order)&&void 0!==i?i:0)-(null!==(n=t.message.order)&&void 0!==n?n: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,i;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(i=e.message.is_done)&&void 0!==i&&i}}),type:_s.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,i;const n=e.sort((e,t)=>{var i,n;return(null!==(i=e.message.order)&&void 0!==i?i:0)-(null!==(n=t.message.order)&&void 0!==n?n:0)}),r=[];let o=null!==(t=n[0].message.order)&&void 0!==t?t:0;for(const e of n){if((null!==(i=e.message.order)&&void 0!==i?i:-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=i,this.leadSource=n,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}getSessionToken(){return this.sessionToken}async initSession(e,t,i){try{const n={building_slug:e,org_slug:t};this.centralConvo&&(n.central_convo=!0),i&&(n.lead_id=i);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,n);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&&ra({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:na.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(ss())({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&&ra({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:na.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&&ra({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:na.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof n.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&&ra({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:na.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}}async getChannelHistory(e=1500){var t;try{let i=[],n=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((i,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=n?n:void 0},(e,t)=>{e.error?o(e):i(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),i=i.concat(t.filter(e=>e.message.messageType!==ks.noReply))}if(n=a[0].timetoken,i.length>=e||a.length<r)break}this.rawPubnubMessages=i.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&&ra({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:na.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}},Ps=p`
|
|
1790
1790
|
#healthchat-container {
|
|
1791
1791
|
position: fixed;
|
|
1792
1792
|
|
|
@@ -2292,7 +2292,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2292
2292
|
transform: rotate(360deg);
|
|
2293
2293
|
}
|
|
2294
2294
|
}
|
|
2295
|
-
`,Ul([pe({type:Number})],jl.prototype,"spinSpeed",void 0),jl=Ul([ce("mini-loader")],jl);var Fl=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Hl=class extends ue{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isLeadMessage=!1,this.widgetType=
|
|
2295
|
+
`,Ul([pe({type:Number})],jl.prototype,"spinSpeed",void 0),jl=Ul([ce("mini-loader")],jl);var Fl=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Hl=class extends ue{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isLeadMessage=!1,this.widgetType=Cp.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:i}=this.mapAndMarkHyperLinks(this.message.message),n=/(https?:\/\/[^\s]+)/g,r=[],o=[];this.parsedMessage=H`${i.trim().split("\n").map(e=>{const i=this.sanitizeMarkdownText(e),a=this.preserveHTMLTags(i);return a?H`${a.map(e=>{const i=t.filter(t=>e.includes(t.id));if(i.length){let t=e;return i.forEach(e=>{o.push({redirectTo:e.link,source:e.link}),t=t.replace(e.id,this.hyperlinkHTML(e.link,e.hyperlink))}),H`${Po(Bl.sanitize(t,{ADD_ATTR:["target"]}))} `}if(n.test(e)){const t=this.removeTrailingPunctuation(e);return r.push(this.getLinkData(t)),H`<a
|
|
2296
2296
|
class="redirect-link"
|
|
2297
2297
|
href="${t}"
|
|
2298
2298
|
target="_blank"
|
|
@@ -2301,7 +2301,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2301
2301
|
</a>`}return H`${Po(Bl.sanitize(e))} `})}<br />`:H``})}`,this.imagesToDisplay=o,Promise.all(r).then(e=>{this.websitePreviewInfo=e})}hyperlinkHTML(e,t){const i=document.createElement("a");return i.className="redirect-link",i.href=e,i.target="_blank",i.rel="noopener noreferrer",i.textContent=t,i.outerHTML}preserveHTMLTags(e){var t;const i=e.match(/(<\/?[a-z][^>]*>[^<]*<\/?[a-z]*>|[^\s]+[.,?!]?|\S)/gi);return null!==(t=null==i?void 0:i.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)),i=[],n=t.map(t=>{const i=t[0];if(void 0===t.index)return;const n=e[t.index-1],r=e[t.index+i.length];if(i.startsWith("<https")||i.startsWith("<http"))return{matchedLink:i,link:i.split("|")[0].replace("<",""),hyperlink:i.split("|")[1].replace(">",""),addSpaceBefore:!(!n||" "===n),addSpaceAfter:!(!r||" "===r)};if(i.startsWith("<a href=")){const e=i.match(/href="([^"]+)"/),t=i.match(/>[^<]+</);return{matchedLink:i,link:e?e[1]:"",hyperlink:t?t[0].slice(1,-1):"",addSpaceBefore:!(!n||" "===n),addSpaceAfter:!(!r||" "===r)}}{const[e,t]=i.split("](");return{matchedLink:i,link:t?t.slice(0,-1):"",hyperlink:e?e.slice(1):"",addSpaceBefore:!(!n||" "===n),addSpaceAfter:!(!r||" "===r)}}});return n.forEach(t=>{if(t&&t.link&&t.hyperlink){const n=gs().replace(/-/g,"");i.push({link:this.removeTrailingPunctuation(t.link),hyperlink:this.removeTrailingPunctuation(t.hyperlink),mark:t.matchedLink,id:n}),e=e.replace(t.matchedLink,`${t.addSpaceBefore?" ":""}${n}${t.addSpaceAfter?" ":""}`)}}),{hyperlinks:i,markedText:e}}async getLinkData(e){var t,i,n,o;try{const a=(await r().get(e)).data,s=(new DOMParser).parseFromString(a,"text/html");return s?{title:null!==(i=null===(t=s.querySelector("title"))||void 0===t?void 0:t.textContent)&&void 0!==i?i:null,description:(null===(n=s.querySelector('meta[name="description"]'))||void 0===n?void 0:n.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">
|
|
2302
2302
|
${this.isMessageStillStreamingChunks()?H`<div class="message-loader"><mini-loader></mini-loader></div>`:""}
|
|
2303
2303
|
<p
|
|
2304
|
-
class=${Ce({"message-text":this.widgetType!==
|
|
2304
|
+
class=${Ce({"message-text":this.widgetType!==Cp.Utilities,"message-text-large":this.widgetType===Cp.Utilities,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}
|
|
2305
2305
|
>
|
|
2306
2306
|
${this.parsedMessage}
|
|
2307
2307
|
</p>
|
|
@@ -2332,9 +2332,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2332
2332
|
/>`:""}
|
|
2333
2333
|
|
|
2334
2334
|
<div class="website-preview-body">
|
|
2335
|
-
<p class=${Ce({"message-text":this.widgetType!==
|
|
2335
|
+
<p class=${Ce({"message-text":this.widgetType!==Cp.Utilities,"message-text-large":this.widgetType===Cp.Utilities,"website-preview-title":!0,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}>${e.title}</p>
|
|
2336
2336
|
${e.description?H`<p
|
|
2337
|
-
class=${Ce({"message-text":this.widgetType!==
|
|
2337
|
+
class=${Ce({"message-text":this.widgetType!==Cp.Utilities,"message-text-large":this.widgetType===Cp.Utilities,"website-preview-description":!0,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}
|
|
2338
2338
|
>
|
|
2339
2339
|
${e.description}
|
|
2340
2340
|
</p>`:""}
|
|
@@ -2623,7 +2623,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2623
2623
|
<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}"/>
|
|
2624
2624
|
<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}"/>
|
|
2625
2625
|
</svg>
|
|
2626
|
-
`,Jl=new WeakMap,eu=e=>!!e.hasAttribute("inert")||!0===e.inert,tu=(e,t)=>{const i=e;if(t)return e.setAttribute("inert",""),void(i.inert=!0);e.removeAttribute("inert"),i.inert=!1},iu=e=>{e.setAttribute("aria-hidden","true"),tu(e,!0)},nu=e=>{null===e.ariaHidden?e.element.removeAttribute("aria-hidden"):e.element.setAttribute("aria-hidden",e.ariaHidden),tu(e.element,e.hadInert)},ru=e=>{const t={element:e,ariaHidden:e.getAttribute("aria-hidden"),hadInert:eu(e)};return iu(e),t};var ou,au=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let su=ou=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=
|
|
2626
|
+
`,Jl=new WeakMap,eu=e=>!!e.hasAttribute("inert")||!0===e.inert,tu=(e,t)=>{const i=e;if(t)return e.setAttribute("inert",""),void(i.inert=!0);e.removeAttribute("inert"),i.inert=!1},iu=e=>{e.setAttribute("aria-hidden","true"),tu(e,!0)},nu=e=>{null===e.ariaHidden?e.element.removeAttribute("aria-hidden"):e.element.setAttribute("aria-hidden",e.ariaHidden),tu(e.element,e.hadInert)},ru=e=>{const t={element:e,ariaHidden:e.getAttribute("aria-hidden"),hadInert:eu(e)};return iu(e),t};var ou,au=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let su=ou=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=Cp.Default,this.primaryColor=Xi,this.backgroundColor=Zi,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,i;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:_s.text}]),await(null===(i=this.myPubnub)||void 0===i?void 0:i.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,i=t.scrollHeight-t.clientHeight-t.scrollTop;this.shouldAutoScroll=i<=ou.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 i=localStorage.getItem(this.consentKey);if(!i)return void(this.hasReceivedConsent=!1);const n=JSON.parse(i),{timestamp:r,consentId:o}=n;ql(new Date,new Date(r))<7&&o===Vo?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",i=this.messages.flatMap(e=>{const i=gu(e,t);return i?[{key:fu(e),announcement:i}]:[]});if(!this.hasReplySnapshot){if(0===this.messages.length)return;return i.forEach(({key:e})=>this.announcedReplyKeys.add(e)),void(this.hasReplySnapshot=!0)}const n=i.filter(({key:e})=>!this.announcedReplyKeys.has(e));if(0===n.length)return;n.forEach(({key:e})=>this.announcedReplyKeys.add(e));const r=n.map(({announcement:e})=>e).join(" "),o=this._replyAnnouncement.replace(/\u200b/g,"");this._replyAnnouncement=r!==o||this._replyAnnouncement.endsWith("")?r:`${r}`}renderReplyAnnouncer(){return H`<div
|
|
2627
2627
|
id="reply-announcer"
|
|
2628
2628
|
class="sr-only"
|
|
2629
2629
|
role="status"
|
|
@@ -2636,7 +2636,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2636
2636
|
for="message-input"
|
|
2637
2637
|
style=${Ki({color:e})}
|
|
2638
2638
|
>${"Message"}</label
|
|
2639
|
-
>`}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 i=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat-container");i&&du(e,i)}render(){var e,t,i,n,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===
|
|
2639
|
+
>`}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 i=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat-container");i&&du(e,i)}render(){var e,t,i,n,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===Cp.Utilities)return H`
|
|
2640
2640
|
<div
|
|
2641
2641
|
id="utilities-container"
|
|
2642
2642
|
class=${Ce({"pubnub-container__mobile":this._isMobile,"utilities-container__desktop":!this._isMobile})}
|
|
@@ -2749,7 +2749,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2749
2749
|
</div>
|
|
2750
2750
|
</div>
|
|
2751
2751
|
</div>
|
|
2752
|
-
`;if(this.widgetType===
|
|
2752
|
+
`;if(this.widgetType===Cp.Healthcare)return H`
|
|
2753
2753
|
<div
|
|
2754
2754
|
id="healthchat-container"
|
|
2755
2755
|
class=${Ce({"pubnub-container__mobile":this._isMobile,"healthchat-container__desktop":!this._isMobile})}
|
|
@@ -5409,7 +5409,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5409
5409
|
overflow-x: auto;
|
|
5410
5410
|
}
|
|
5411
5411
|
}
|
|
5412
|
-
`,Yu=e=>({building_id:e.building_id,name:e.name,address:e.address,timezone:e.timezone}),Ku=e=>e?[e.line1,e.city,e.state].filter(Boolean).join(", "):"";class Xu extends Error{constructor(e,t,i){super(i),this.status=e,this.code=t,this.name="TourApiError"}}const Zu=({orgSlug:e,buildingSlug:t,getSessionToken:i,host:n="https://app.meetelise.com"})=>{const o=`${n}/platformApi/webchat`,a=()=>{var n;return{"X-Session-Token":null!==(n=i())&&void 0!==n?n:"","org-slug":e,"building-slug":t}},s=async e=>{try{return(await e()).data}catch(e){throw(e=>{var t,i,n,r,o;const a=e,s=null===(i=null===(t=a.response)||void 0===t?void 0:t.data)||void 0===i?void 0:i.error;return new Xu(null!==(r=null===(n=a.response)||void 0===n?void 0:n.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}}))}},Ju=e=>e.slice(0,10),ed=e=>e.slice(11,16),td=e=>{const[t,i]=e.split(":");return{hour:parseInt(t,10),minute:i}},id=e=>e<12?"am":"pm",nd=(e,t)=>`${e%12==0?12:e%12}:${t}`,rd=e=>{const{hour:t,minute:i}=td(e);return`${nd(t,i)}${id(t)}`},od=e=>rd(ed(e)),ad=(e,t)=>{const i=td(ed(e)),n=td(ed(t));return`${id(i.hour)===id(n.hour)?nd(i.hour,i.minute):rd(ed(e))}–${rd(ed(t))}`},sd=e=>{const[t,i,n]=e.split("-").map(e=>parseInt(e,10));return new Date(t,i-1,n)},ld=e=>nr(sd(e),"EEE, MMM d"),ud=e=>nr(sd(e),"MMM d"),dd=e=>nr(e,"yyyy-MM-dd"),cd={"escorted-tour":{heading:"Escorted Tour",subtitle:"With an agent",icon:pa},"live-virtual-tour":{heading:"Virtual Tour",subtitle:"Over video",icon:ca},"self-guided-tour":{heading:"Self-Guided Tour",subtitle:"On your own",icon:ha}},hd=["escorted-tour","live-virtual-tour","self-guided-tour"];var pd=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const fd={bedrooms:[],moveIn:null,maxBudget:null},gd=[{value:0,label:"Studio"},{value:1,label:"1 bd"},{value:2,label:"2 bd"},{value:3,label:"3+ bd"}],md=["bedrooms","moveIn","budget"];let bd=class extends ue{constructor(){super(...arguments),this.variant="select",this.load=null,this.initial=null,this.selected=[],this.maxSelectable=0,this.filters=fd,this.openFilter=null,this.communities=[],this.loading=!1,this.error=null,this.requestId=0}willUpdate(){!this.hasUpdated&&this.initial&&(this.communities=this.initial.communities)}firstUpdated(){this.initial||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.reload()}isSelected(e){return this.selected.some(t=>t.building_id===e)}toggle(e){e.tourable&&(this.isSelected(e.building_id)?this.emitSelection(this.selected.filter(t=>t.building_id!==e.building_id)):this.selected.length<this.maxSelectable&&this.emitSelection([...this.selected,Yu(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":this.maxSelectable>1?`Select Up to ${this.maxSelectable} Communities to 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?gd.filter(e=>t.bedrooms.includes(e.value)).map(e=>e.label).join(", "):"Bedrooms":"moveIn"===e?t.moveIn?`Move-in ${ld(t.moveIn)}`:"Move-In Date":null!==t.maxBudget?`Up to ${Br(t.maxBudget)}`:"Budget"}renderFilters(){var e;const t=this.filters,i=this.openFilter;return H`<div class="picker-toolbar" role="group" aria-label="Filters">
|
|
5412
|
+
`,Yu=e=>({building_id:e.building_id,name:e.name,address:e.address,timezone:e.timezone,bedrooms:e.bedrooms}),Ku=e=>e?[e.line1,e.city,e.state].filter(Boolean).join(", "):"";class Xu extends Error{constructor(e,t,i){super(i),this.status=e,this.code=t,this.name="TourApiError"}}const Zu=({orgSlug:e,buildingSlug:t,getSessionToken:i,host:n="https://app.meetelise.com"})=>{const o=`${n}/platformApi/webchat`,a=()=>{var n;return{"X-Session-Token":null!==(n=i())&&void 0!==n?n:"","org-slug":e,"building-slug":t}},s=async e=>{try{return(await e()).data}catch(e){throw(e=>{var t,i,n,r,o;const a=e,s=null===(i=null===(t=a.response)||void 0===t?void 0:t.data)||void 0===i?void 0:i.error;return new Xu(null!==(r=null===(n=a.response)||void 0===n?void 0:n.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}}))}},Ju=e=>e.slice(0,10),ed=e=>e.slice(11,16),td=e=>{const[t,i]=e.split(":");return{hour:parseInt(t,10),minute:i}},id=e=>e<12?"am":"pm",nd=(e,t)=>`${e%12==0?12:e%12}:${t}`,rd=e=>{const{hour:t,minute:i}=td(e);return`${nd(t,i)}${id(t)}`},od=e=>rd(ed(e)),ad=(e,t)=>{const i=td(ed(e)),n=td(ed(t));return`${id(i.hour)===id(n.hour)?nd(i.hour,i.minute):rd(ed(e))}–${rd(ed(t))}`},sd=e=>{const[t,i,n]=e.split("-").map(e=>parseInt(e,10));return new Date(t,i-1,n)},ld=e=>nr(sd(e),"EEE, MMM d"),ud=e=>nr(sd(e),"MMM d"),dd=e=>nr(e,"yyyy-MM-dd"),cd={"escorted-tour":{heading:"Escorted Tour",subtitle:"With an agent",icon:pa},"live-virtual-tour":{heading:"Virtual Tour",subtitle:"Over video",icon:ca},"self-guided-tour":{heading:"Self-Guided Tour",subtitle:"On your own",icon:ha}},hd=["escorted-tour","live-virtual-tour","self-guided-tour"];var pd=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const fd={bedrooms:[],moveIn:null,maxBudget:null},gd=[{value:0,label:"Studio"},{value:1,label:"1 bd"},{value:2,label:"2 bd"},{value:3,label:"3+ bd"}],md=["bedrooms","moveIn","budget"];let bd=class extends ue{constructor(){super(...arguments),this.variant="select",this.load=null,this.initial=null,this.selected=[],this.maxSelectable=0,this.filters=fd,this.openFilter=null,this.communities=[],this.loading=!1,this.error=null,this.requestId=0}willUpdate(){!this.hasUpdated&&this.initial&&(this.communities=this.initial.communities)}firstUpdated(){this.initial||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.reload()}isSelected(e){return this.selected.some(t=>t.building_id===e)}toggle(e){e.tourable&&(this.isSelected(e.building_id)?this.emitSelection(this.selected.filter(t=>t.building_id!==e.building_id)):this.selected.length<this.maxSelectable&&this.emitSelection([...this.selected,Yu(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":this.maxSelectable>1?`Select Up to ${this.maxSelectable} Communities to 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?gd.filter(e=>t.bedrooms.includes(e.value)).map(e=>e.label).join(", "):"Bedrooms":"moveIn"===e?t.moveIn?`Move-in ${ld(t.moveIn)}`:"Move-In Date":null!==t.maxBudget?`Up to ${Br(t.maxBudget)}`:"Budget"}renderFilters(){var e;const t=this.filters,i=this.openFilter;return H`<div class="picker-toolbar" role="group" aria-label="Filters">
|
|
5413
5413
|
${md.map(e=>H`<button
|
|
5414
5414
|
class=${Ce({"floor-plan-badge":!0,selected:this.isFilterActive(e)})}
|
|
5415
5415
|
aria-expanded=${String(i===e)}
|
|
@@ -5790,7 +5790,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5790
5790
|
font-size: 0.9rem;
|
|
5791
5791
|
margin: 4px 0;
|
|
5792
5792
|
}
|
|
5793
|
-
`;var wd=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const Cd=e=>({displayTime:od(e),displayTimeZoned:od(e),dateWithTimeZoneOffset:{datetime:e.slice(0,19),offset:e.slice(19)}}),xd=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))};let $d=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.canAddStop=!1,this.loading=!1,this.primaryColor=Xi,this.foregroundColorOnPrimaryBackgroundColor="white",this.editingTimeFor=null,this.dragIndex=null,this.dropIndex=null,this.refocusGripOf=null}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,i;return null!==(i=null===(t=this.communities.get(e))||void 0===t?void 0:t.name)&&void 0!==i?i:""}move(e,t){const i=this.newStopIds();if(t<0||t>=i.length||e===t)return;const[n]=i.splice(e,1);i.splice(t,0,n),xd(this,"stops-reorder",{buildingIds:i})}newIndexAt(e){var t;const i=[...this.renderRoot.querySelectorAll(".stop-item[data-index]")],n=null!==(t=i.find(t=>e<t.getBoundingClientRect().bottom))&&void 0!==t?t:i[i.length-1];return n?Number(n.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,i;if(!this.single)return"";const n=null===(e=this.stops.find(e=>!e.fixed))||void 0===e?void 0:e.building_id,r=void 0===n?void 0:this.communities.get(n);return H`<h2 class="journey-header">Community</h2>
|
|
5793
|
+
`;var wd=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const Cd=e=>({displayTime:od(e),displayTimeZoned:od(e),dateWithTimeZoneOffset:{datetime:e.slice(0,19),offset:e.slice(19)}}),xd=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))};let $d=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.canAddStop=!1,this.loading=!1,this.planned=!1,this.primaryColor=Xi,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,i;return null!==(i=null===(t=this.communities.get(e))||void 0===t?void 0:t.name)&&void 0!==i?i:""}move(e,t){const i=this.newStopIds();if(t<0||t>=i.length||e===t)return;const[n]=i.splice(e,1);i.splice(t,0,n),xd(this,"stops-reorder",{buildingIds:i})}newIndexAt(e){var t;const i=[...this.renderRoot.querySelectorAll(".stop-item[data-index]")],n=null!==(t=i.find(t=>e<t.getBoundingClientRect().bottom))&&void 0!==t?t:i[i.length-1];return n?Number(n.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,i;if(!this.single)return"";const n=null===(e=this.stops.find(e=>!e.fixed))||void 0===e?void 0:e.building_id,r=void 0===n?void 0:this.communities.get(n);return H`<h2 class="journey-header">Community</h2>
|
|
5794
5794
|
<div class="floorplan-image-card community">
|
|
5795
5795
|
<div class="section-right">
|
|
5796
5796
|
<p class="image-card-title">${null!==(t=null==r?void 0:r.name)&&void 0!==t?t:""}</p>
|
|
@@ -5829,9 +5829,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5829
5829
|
${cd[e].icon(t?this.primaryColor:on)}
|
|
5830
5830
|
</tour-type-option>`})}
|
|
5831
5831
|
</div>
|
|
5832
|
-
${0
|
|
5832
|
+
${0===this.tourTypes.length&&this.offersKnown?H`<p class="explanation">
|
|
5833
5833
|
No tour type is offered at every community you picked.
|
|
5834
|
-
</p
|
|
5834
|
+
</p>`:""}`}renderDatePicker(){var e;const t=null!==(e=this.date)&&void 0!==e?e:this.bookableDates[0];return H`<date-picker
|
|
5835
5835
|
outlined
|
|
5836
5836
|
.shownMonth=${null==t?void 0:t.slice(0,7)}
|
|
5837
5837
|
.availabilities=${Object.fromEntries(this.bookableDates.map(e=>[e,[sd(e)]]))}
|
|
@@ -5858,7 +5858,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5858
5858
|
<div id="datePicker">
|
|
5859
5859
|
${this.renderDatePicker()}
|
|
5860
5860
|
${e?H`<div>${this.renderTimePicker(e)}</div>`:H`<p class="explanation">
|
|
5861
|
-
${0
|
|
5861
|
+
${0===this.bookableDates.length&&this.offersKnown?"No tour times in the next 30 days.":""}
|
|
5862
5862
|
</p>`}
|
|
5863
5863
|
</div>
|
|
5864
5864
|
</div>`}renderStop(e,t){var i,n,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=`${ud(Ju(e.start))} · ${ad(e.start,e.end)}`,f=null!==this.dragIndex;return H`<li
|
|
@@ -5972,10 +5972,10 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5972
5972
|
</div>
|
|
5973
5973
|
</li>`}renderItineraryDate(){return H`<h2 class="journey-header date-header">Date</h2>
|
|
5974
5974
|
<div id="datePicker">${this.renderDatePicker()}</div>
|
|
5975
|
-
${0
|
|
5975
|
+
${0===this.bookableDates.length&&this.offersKnown?H`<p class="explanation">
|
|
5976
5976
|
These communities have no back-to-back tour times in the next 30
|
|
5977
5977
|
days. Try removing one.
|
|
5978
|
-
</p
|
|
5978
|
+
</p>`:""}`}renderItinerary(){return H`<h2 class="journey-header">
|
|
5979
5979
|
Your Itinerary ${this.loading?H`<mini-loader></mini-loader>`:""}
|
|
5980
5980
|
</h2>
|
|
5981
5981
|
<ol class="stops" aria-busy=${String(this.loading)}>
|
|
@@ -6096,7 +6096,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6096
6096
|
font-size: 0.7rem;
|
|
6097
6097
|
padding: 2px 8px;
|
|
6098
6098
|
}
|
|
6099
|
-
`],wd([pe({attribute:!1})],$d.prototype,"stops",void 0),wd([pe({attribute:!1})],$d.prototype,"communities",void 0),wd([pe({attribute:!1})],$d.prototype,"problems",void 0),wd([pe({attribute:!1})],$d.prototype,"tourTypes",void 0),wd([pe({attribute:!1})],$d.prototype,"tourType",void 0),wd([pe({attribute:!1})],$d.prototype,"bookableDates",void 0),wd([pe({attribute:!1})],$d.prototype,"date",void 0),wd([pe({type:Boolean})],$d.prototype,"single",void 0),wd([pe({type:Boolean})],$d.prototype,"canEditCommunities",void 0),wd([pe({type:Boolean})],$d.prototype,"canAddStop",void 0),wd([pe({type:Boolean})],$d.prototype,"loading",void 0),wd([pe({attribute:!1})],$d.prototype,"primaryColor",void 0),wd([pe({attribute:!1})],$d.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),wd([fe()],$d.prototype,"editingTimeFor",void 0),wd([fe()],$d.prototype,"dragIndex",void 0),wd([fe()],$d.prototype,"dropIndex",void 0),$d=wd([ce("itinerary-editor")],$d);var Sd=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const kd={firstName:"",lastName:"",email:"",phone:"",phoneE164:null,phoneCountry:null,layout:null,moveIn:"",notes:"",leadSource:null};let Ad=class extends ue{constructor(){super(...arguments),this.values=kd,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})}render(){var e,t;const i=this.values,n=!!i.email&&!Lr(i.email.trim()),r=this.phoneHasBlurred&&!i.phoneE164;return H`<div id="user-info-and-layout-menu-outer-container">
|
|
6099
|
+
`],wd([pe({attribute:!1})],$d.prototype,"stops",void 0),wd([pe({attribute:!1})],$d.prototype,"communities",void 0),wd([pe({attribute:!1})],$d.prototype,"problems",void 0),wd([pe({attribute:!1})],$d.prototype,"tourTypes",void 0),wd([pe({attribute:!1})],$d.prototype,"tourType",void 0),wd([pe({attribute:!1})],$d.prototype,"bookableDates",void 0),wd([pe({attribute:!1})],$d.prototype,"date",void 0),wd([pe({type:Boolean})],$d.prototype,"single",void 0),wd([pe({type:Boolean})],$d.prototype,"canEditCommunities",void 0),wd([pe({type:Boolean})],$d.prototype,"canAddStop",void 0),wd([pe({type:Boolean})],$d.prototype,"loading",void 0),wd([pe({type:Boolean})],$d.prototype,"planned",void 0),wd([pe({attribute:!1})],$d.prototype,"primaryColor",void 0),wd([pe({attribute:!1})],$d.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),wd([fe()],$d.prototype,"editingTimeFor",void 0),wd([fe()],$d.prototype,"dragIndex",void 0),wd([fe()],$d.prototype,"dropIndex",void 0),$d=wd([ce("itinerary-editor")],$d);var Sd=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const kd={firstName:"",lastName:"",email:"",phone:"",phoneE164:null,phoneCountry:null,layout:null,moveIn:"",notes:"",leadSource:null};let Ad=class extends ue{constructor(){super(...arguments),this.values=kd,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})}render(){var e,t;const i=this.values,n=!!i.email&&!Lr(i.email.trim()),r=this.phoneHasBlurred&&!i.phoneE164;return H`<div id="user-info-and-layout-menu-outer-container">
|
|
6100
6100
|
<h2 class="journey-header">Your Information</h2>
|
|
6101
6101
|
<div id="yourInformationMenu">
|
|
6102
6102
|
<div class="namesWrapper">
|
|
@@ -6325,7 +6325,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6325
6325
|
}
|
|
6326
6326
|
`,_d([pe({type:Number})],Od.prototype,"size",void 0),_d([pe({type:Number})],Od.prototype,"spinSpeed",void 0),Od=_d([ce("mega-loader")],Od);const Pd=(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">
|
|
6327
6327
|
<path d="M3.68188 7L0.681885 4L3.68188 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6328
|
-
</svg>`,Id=e=>{const t=Object.fromEntries(e.buildingIds.slice(1).filter(t=>e.laterStarts[t]).map(t=>[String(t),e.laterStarts[t]])),i=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===i?null:{calendar_event_id:i}}},Nd=({orgSlug:e,selectedLeadSource:t,currentLeadSource:i,touchpoints:n,search:r,referrer:o,googleReferral:a})=>{var s,l,u;const d=t||i||null,c=la(e);return{lead_sources:[...new Set(d?[d,c]:[c])],lead_sources_with_timestamps:n.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}},Md=e=>0===e?0:Math.floor(e/10);var Dd=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const Ld={bedrooms:[],moveIn:null,maxBudget:null},Rd={"escorted-tour":"WITH_AGENT","self-guided-tour":"SELF_GUIDED","live-virtual-tour":"VIRTUAL_SHOWING"};let Bd=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=Xi,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.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=kd,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=>{du(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.onPicksChange=e=>{this.picks=e.detail.communities}}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=Zu({orgSlug:this.orgSlug,buildingSlug:this.buildingSlug,getSessionToken:()=>this.getSessionToken()})),this.api}willUpdate(e){if(e.has("primaryColor")||e.has("foregroundColorOnPrimaryBackgroundColor")){const e=this.primaryColor||Xi;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){e.has("step")&&void 0===e.get("step")?lu(this):(e.has("step")||e.has("reschedulePrompt")||e.has("rescheduleCanceled"))&&(this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),this.focus({preventScroll:!0}))}async start(){this.step="loading",this.loadError=null;try{const e=await this.client.getCommunities(Ld);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 Xu&&"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=[]),_o("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,Yu(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:dd(new Date),firstStart:this.firstStart,laterStarts:this.laterStarts,existingEventIds:this.existingEventIds}}async runPlan(e=!1){if(0===this.selectedIds.length)return;const t=++this.planRequestId;this.planLoading=!0,this.planError=null,e||(this.notice=null);try{let e=this.choice(),i=await this.client.plan(Id(e));for(let n=0;n<2&&t===this.planRequestId;n++){if(i.tour_types.includes(e.tourType)){if(!(i.bookable_dates.length>0)||i.bookable_dates.includes(e.date))break;this.date=i.bookable_dates[0]}else{if(0===i.tour_types.length)break;this.tourType=i.tour_types[0]}this.firstStart=null,this.laterStarts={},e=this.choice(),i=await this.client.plan(Id(e))}if(t!==this.planRequestId)return;this.plan=i,i.bookable_dates.includes(e.date)&&(this.date=e.date),i.changed.length>0&&(this.notice=i.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(Rd[e]))return null;const[t,i]={"self-guided-tour":[this.sgtUrl,this.selfGuidedToursTypeOffered],"escorted-tour":[this.escortedToursLink,this.escortedToursTypeOffered],"live-virtual-tour":[this.virtualToursLink,this.virtualToursTypeOffered]}[e];return t&&ba(0,i)?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 i="self-guided-tour"===e&&52===this.orgId?So(t,$o()):t;window.open(i,"_blank")}tourTypeChoices(){var e,t;const i=null!==(t=null===(e=this.plan)||void 0===e?void 0:e.tour_types)&&void 0!==t?t:[];return hd.filter(e=>i.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(_o("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&&(_o("tourDateSelected",{tourType:this.tourType,buildingId:this.buildingId}),this.date=e,this.firstStart=null,this.laterStarts={},this.runPlan())}onStopTime(e,t){const i=this.selectedIds.indexOf(e);if(i<0)return;_o("tourTimeSelected",{tourType:this.tourType,buildingId:this.buildingId,stopNumber:i+1});const n=this.selectedIds.slice(1,i);0===i?(this.firstStart=ed(t),this.laterStarts={}):this.laterStarts={...Object.fromEntries(n.filter(e=>this.laterStarts[e]).map(e=>[e,this.laterStarts[e]])),[e]:t},this.runPlan()}onReorder(e){_o("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(_o("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 i;if(e.forEach(e=>this.rememberOne(e)),_o("tourCommunitiesSelected",{buildingId:this.buildingId,count:e.length,mode:t}),this.extending="extend"===t,this.extending){this.existingEventIds=this.bookedEventIds,this.tourType=null!==(i=this.bookedTourType)&&void 0!==i?i:this.tourType;const e=this.confirmed.filter(e=>e.start).slice(-1)[0];this.date=(null==e?void 0:e.start)?Ju(e.start):this.date}else this.existingEventIds=[];this.startSchedule(e.map(e=>e.building_id))}async submit(e,t=!1){var i,n,r,o,a,s;const l=this.plan;if(!l||this.submitting)return;const u=this.choice(),d=this.showLeadSourceDropdown()?e.leadSource:null,c=(({choice:e,plan:t,contact:i,attribution:n,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}))],contact:i,lead_sources:n,conversation_tracking_id:r,cancel_existing_tours:o}))({choice:u,plan:l,contact:{first_name:e.firstName.trim(),last_name:e.lastName.trim(),email:e.email.trim(),phone_e164:null!==(i=e.phoneE164)&&void 0!==i?i:"",bedrooms:null===e.layout?[]:[Md(e.layout)],move_in:e.moveIn||null,notes:e.notes.trim()},attribution:Nd({orgSlug:this.orgSlug,selectedLeadSource:d,currentLeadSource:this.currentLeadSource,touchpoints:null!==(r=null===(n=this.leadSourceMultitouchClient)||void 0===n?void 0:n.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:d||null}))&&void 0!==r?r:[],search:window.location.search,referrer:document.referrer,googleReferral:is()}),conversationTrackingId:null!==(a=null===(o=this.leadSourceClient)||void 0===o?void 0:o.chatId)&&void 0!==a?a:null,cancelExistingTours:t}),h=JSON.stringify({tour_type:c.tour_type,stops:c.stops,contact:c.contact,cancel_existing_tours:c.cancel_existing_tours});(null===(s=this.idempotency)||void 0===s?void 0:s.booking)!==h&&(this.idempotency={booking:h,key:gs()}),_o("scheduleTourSubmitted",{tourType:u.tourType,stopCount:c.stops.length,buildingId:this.buildingId}),this.submitting=!0,this.bookingError=null;try{const e=await this.client.book(c,this.idempotency.key);this.idempotency=null,this.rescheduled=t,this.onBooked(e,u.tourType,l)}catch(t){this.onBookingError(t,e)}finally{this.submitting=!1}}onBooked(e,t,i){var n,r,o,a,s,l;if(this.reschedulePrompt=null,e.stops.every(e=>"failed"===e.status))return this.notice=null!==(o=null===(r=null===(n=e.stops.find(e=>e.error))||void 0===n?void 0:n.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(i.stops.map(e=>[e.building_id,e]));this.confirmed=e.stops.map(e=>{var t,i,n,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!==(i=d.timezone)&&void 0!==i?i:null===(n=u.get(e.building_id))||void 0===n?void 0:n.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,_o("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}async loadExtension(){const e=this.extendQueryFromBooking();this.extendFrom=e;const t=this.stopsRemaining();if(this.group&&e&&!(t<=0))try{const i=await this.client.getCommunities({...Ld,extend:e});this.remember(i.communities),i.communities.some(e=>e.tourable)&&(this.extendInitial=i,_o("tourExtensionOffered",{buildingId:this.buildingId,stopsRemaining:t}))}catch(e){this.log("TOUR_SCHEDULER_V2_EXTEND_LOAD_ERROR",e)}}onBookingError(e,t){const i=e instanceof Xu?e:new Xu(0,null,"Something went wrong. Please try again.");return"EXISTING_TOUR"===i.code?(this.reschedulePrompt=i.message,void(this.contact=t)):(this.reschedulePrompt=null,"SLOT_TAKEN"===i.code?(this.notice=i.message,void this.runPlan(!0)):(this.bookingError=i.message,void this.log("TOUR_SCHEDULER_V2_BOOKING_ERROR",e)))}showLeadSourceDropdown(){return this.featureFlagShowDropdown===bo.always||this.featureFlagShowDropdown===bo.onAttributionFailure&&0===this.currentLeadSource.length}log(e,t){ra({logTitle:e,logData:{error:t},logType:na.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&&(t=this.contact,i=this.bedroomPreferenceRequired,(!!t.firstName.trim()||!!t.lastName.trim())&&Lr(t.email.trim())&&!!t.phoneE164&&(!i||null!==t.layout));var t,i}disclaimer(){return Yo({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
|
|
6328
|
+
</svg>`,Id=e=>{const t=Object.fromEntries(e.buildingIds.slice(1).filter(t=>e.laterStarts[t]).map(t=>[String(t),e.laterStarts[t]])),i=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===i?null:{calendar_event_id:i}}},Nd=({orgSlug:e,selectedLeadSource:t,currentLeadSource:i,touchpoints:n,search:r,referrer:o,googleReferral:a})=>{var s,l,u;const d=t||i||null,c=la(e);return{lead_sources:[...new Set(d?[d,c]:[c])],lead_sources_with_timestamps:n.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}},Md=e=>0===e?0:Math.floor(e/10),Dd=["Studio","One bedroom","Two bedroom","Three bedroom","Four bedroom","Five bedroom"],Ld=e=>{var t;return{value:10*e,label:null!==(t=Dd[e])&&void 0!==t?t:`${e} bedroom`}};var Rd=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const Bd={bedrooms:[],moveIn:null,maxBudget:null},Ud={"escorted-tour":"WITH_AGENT","self-guided-tour":"SELF_GUIDED","live-virtual-tour":"VIRTUAL_SHOWING"};let jd=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=Xi,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.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=kd,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=>{du(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.onPicksChange=e=>{this.picks=e.detail.communities}}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=Zu({orgSlug:this.orgSlug,buildingSlug:this.buildingSlug,getSessionToken:()=>this.getSessionToken()})),this.api}willUpdate(e){if(e.has("primaryColor")||e.has("foregroundColorOnPrimaryBackgroundColor")){const e=this.primaryColor||Xi;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)}const t=this.contact.layout;null===t||this.bedroomOptions.some(e=>e.value===t)||(this.contact={...this.contact,layout:null})}firstUpdated(){this.start()}updated(e){var t;e.has("step")&&void 0===e.get("step")?lu(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(Bd);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 Xu&&"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=[]),_o("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,Yu(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:dd(new Date),firstStart:this.firstStart,laterStarts:this.laterStarts,existingEventIds:this.existingEventIds}}async runPlan(e=!1){if(0===this.selectedIds.length)return;const t=++this.planRequestId;this.planLoading=!0,this.planError=null,e||(this.notice=null);try{let e=this.choice(),i=await this.client.plan(Id(e));for(let n=0;n<2&&t===this.planRequestId;n++){if(i.tour_types.includes(e.tourType)){if(!(i.bookable_dates.length>0)||i.bookable_dates.includes(e.date))break;this.date=i.bookable_dates[0]}else{if(0===i.tour_types.length)break;this.tourType=i.tour_types[0]}this.firstStart=null,this.laterStarts={},e=this.choice(),i=await this.client.plan(Id(e))}if(t!==this.planRequestId)return;this.plan=i,i.bookable_dates.includes(e.date)&&(this.date=e.date),i.changed.length>0&&(this.notice=i.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(Ud[e]))return null;const[t,i]={"self-guided-tour":[this.sgtUrl,this.selfGuidedToursTypeOffered],"escorted-tour":[this.escortedToursLink,this.escortedToursTypeOffered],"live-virtual-tour":[this.virtualToursLink,this.virtualToursTypeOffered]}[e];return t&&ba(0,i)?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 i="self-guided-tour"===e&&52===this.orgId?So(t,$o()):t;window.open(i,"_blank")}tourTypeChoices(){var e,t;const i=null!==(t=null===(e=this.plan)||void 0===e?void 0:e.tour_types)&&void 0!==t?t:[];return hd.filter(e=>i.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(_o("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&&(_o("tourDateSelected",{tourType:this.tourType,buildingId:this.buildingId}),this.date=e,this.firstStart=null,this.laterStarts={},this.runPlan())}onStopTime(e,t){const i=this.selectedIds.indexOf(e);if(i<0)return;_o("tourTimeSelected",{tourType:this.tourType,buildingId:this.buildingId,stopNumber:i+1});const n=this.selectedIds.slice(1,i);0===i?(this.firstStart=ed(t),this.laterStarts={}):this.laterStarts={...Object.fromEntries(n.filter(e=>this.laterStarts[e]).map(e=>[e,this.laterStarts[e]])),[e]:t},this.runPlan()}onReorder(e){_o("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(_o("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 i;if(e.forEach(e=>this.rememberOne(e)),_o("tourCommunitiesSelected",{buildingId:this.buildingId,count:e.length,mode:t}),this.extending="extend"===t,this.extending){this.existingEventIds=this.bookedEventIds,this.tourType=null!==(i=this.bookedTourType)&&void 0!==i?i:this.tourType;const e=this.confirmed.filter(e=>e.start).slice(-1)[0];this.date=(null==e?void 0:e.start)?Ju(e.start):this.date}else this.existingEventIds=[];this.startSchedule(e.map(e=>e.building_id))}async submit(e,t=!1){var i,n,r,o,a,s;const l=this.plan;if(!l||this.submitting)return;const u=this.choice(),d=this.showLeadSourceDropdown()?e.leadSource:null,c=(({choice:e,plan:t,contact:i,attribution:n,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}))],contact:i,lead_sources:n,conversation_tracking_id:r,cancel_existing_tours:o}))({choice:u,plan:l,contact:{first_name:e.firstName.trim(),last_name:e.lastName.trim(),email:e.email.trim(),phone_e164:null!==(i=e.phoneE164)&&void 0!==i?i:"",bedrooms:null===e.layout?[]:[Md(e.layout)],move_in:e.moveIn||null,notes:e.notes.trim()},attribution:Nd({orgSlug:this.orgSlug,selectedLeadSource:d,currentLeadSource:this.currentLeadSource,touchpoints:null!==(r=null===(n=this.leadSourceMultitouchClient)||void 0===n?void 0:n.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:d||null}))&&void 0!==r?r:[],search:window.location.search,referrer:document.referrer,googleReferral:is()}),conversationTrackingId:null!==(a=null===(o=this.leadSourceClient)||void 0===o?void 0:o.chatId)&&void 0!==a?a:null,cancelExistingTours:t}),h=JSON.stringify({tour_type:c.tour_type,stops:c.stops,contact:c.contact,cancel_existing_tours:c.cancel_existing_tours});(null===(s=this.idempotency)||void 0===s?void 0:s.booking)!==h&&(this.idempotency={booking:h,key:gs()}),_o("scheduleTourSubmitted",{tourType:u.tourType,stopCount:c.stops.length,buildingId:this.buildingId}),this.submitting=!0,this.bookingError=null;try{const e=await this.client.book(c,this.idempotency.key);this.idempotency=null,this.rescheduled=t,this.onBooked(e,u.tourType,l)}catch(t){this.onBookingError(t,e)}finally{this.submitting=!1}}onBooked(e,t,i){var n,r,o,a,s,l;if(this.reschedulePrompt=null,e.stops.every(e=>"failed"===e.status))return this.notice=null!==(o=null===(r=null===(n=e.stops.find(e=>e.error))||void 0===n?void 0:n.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(i.stops.map(e=>[e.building_id,e]));this.confirmed=e.stops.map(e=>{var t,i,n,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!==(i=d.timezone)&&void 0!==i?i:null===(n=u.get(e.building_id))||void 0===n?void 0:n.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,_o("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}async loadExtension(){const e=this.extendQueryFromBooking();this.extendFrom=e;const t=this.stopsRemaining();if(this.group&&e&&!(t<=0))try{const i=await this.client.getCommunities({...Bd,extend:e});this.remember(i.communities),i.communities.some(e=>e.tourable)&&(this.extendInitial=i,_o("tourExtensionOffered",{buildingId:this.buildingId,stopsRemaining:t}))}catch(e){this.log("TOUR_SCHEDULER_V2_EXTEND_LOAD_ERROR",e)}}onBookingError(e,t){const i=e instanceof Xu?e:new Xu(0,null,"Something went wrong. Please try again.");return"EXISTING_TOUR"===i.code?(this.reschedulePrompt=i.message,void(this.contact=t)):(this.reschedulePrompt=null,"SLOT_TAKEN"===i.code?(this.notice=i.message,void this.runPlan(!0)):(this.bookingError=i.message,void this.log("TOUR_SCHEDULER_V2_BOOKING_ERROR",e)))}showLeadSourceDropdown(){return this.featureFlagShowDropdown===bo.always||this.featureFlagShowDropdown===bo.onAttributionFailure&&0===this.currentLeadSource.length}log(e,t){ra({logTitle:e,logData:{error:t},logType:na.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&&(t=this.contact,i=this.bedroomsRequired,(!!t.firstName.trim()||!!t.lastName.trim())&&Lr(t.email.trim())&&!!t.phoneE164&&(!i||null!==t.layout));var t,i}get bedroomOptions(){const e=[...this.extending?this.confirmed.map(e=>e.community):[],...this.selectedIds.map(e=>this.communities.get(e))],t=new Set(e.flatMap(e=>{var t;return null!==(t=null==e?void 0:e.bedrooms)&&void 0!==t?t:[]}));return t.size>0?[...t].sort((e,t)=>e-t).map(Ld):this.layoutOptions}get bedroomsRequired(){return this.bedroomPreferenceRequired&&this.bedroomOptions.length>0}disclaimer(){return Yo({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
|
|
6329
6329
|
id=${this.mobile?"mobile-body-container":"scheduler-container"}
|
|
6330
6330
|
>
|
|
6331
6331
|
${e}
|
|
@@ -6384,6 +6384,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6384
6384
|
?canEditCommunities=${null!==this.group&&!this.extending}
|
|
6385
6385
|
?canAddStop=${null!==this.group&&o<3}
|
|
6386
6386
|
?loading=${this.planLoading}
|
|
6387
|
+
?planned=${null!==r}
|
|
6387
6388
|
.primaryColor=${this.primaryColor}
|
|
6388
6389
|
.foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
|
|
6389
6390
|
@tour-type-change=${e=>this.onTourType(e.detail.tourType)}
|
|
@@ -6396,8 +6397,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6396
6397
|
></itinerary-editor>
|
|
6397
6398
|
<contact-form
|
|
6398
6399
|
.values=${this.contact}
|
|
6399
|
-
.layoutOptions=${this.
|
|
6400
|
-
?bedroomsRequired=${this.
|
|
6400
|
+
.layoutOptions=${this.bedroomOptions}
|
|
6401
|
+
?bedroomsRequired=${this.bedroomsRequired}
|
|
6401
6402
|
.leadSources=${this.leadSources}
|
|
6402
6403
|
?showLeadSourceDropdown=${this.showLeadSourceDropdown()}
|
|
6403
6404
|
currentLeadSource=${this.currentLeadSource}
|
|
@@ -6521,7 +6522,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6521
6522
|
</button>
|
|
6522
6523
|
</div>
|
|
6523
6524
|
${this.renderBody()}
|
|
6524
|
-
</div>`}};
|
|
6525
|
+
</div>`}};jd.styles=[Ko,Me,yd,p`
|
|
6525
6526
|
/* New layout only: the back button beside the title. */
|
|
6526
6527
|
.title {
|
|
6527
6528
|
align-items: center;
|
|
@@ -6558,7 +6559,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6558
6559
|
font: inherit;
|
|
6559
6560
|
text-decoration: underline;
|
|
6560
6561
|
}
|
|
6561
|
-
`],
|
|
6562
|
+
`],Rd([pe({attribute:!0})],jd.prototype,"orgSlug",void 0),Rd([pe({attribute:!0})],jd.prototype,"buildingSlug",void 0),Rd([pe({type:Number})],jd.prototype,"buildingId",void 0),Rd([pe({type:Number})],jd.prototype,"orgId",void 0),Rd([pe({attribute:!1})],jd.prototype,"buildingName",void 0),Rd([pe({attribute:!0})],jd.prototype,"sgtUrl",void 0),Rd([pe({attribute:!0})],jd.prototype,"selfGuidedToursTypeOffered",void 0),Rd([pe({attribute:!0})],jd.prototype,"escortedToursLink",void 0),Rd([pe({attribute:!1})],jd.prototype,"escortedToursTypeOffered",void 0),Rd([pe({attribute:!0})],jd.prototype,"virtualToursLink",void 0),Rd([pe({attribute:!0})],jd.prototype,"virtualToursTypeOffered",void 0),Rd([pe({attribute:!1})],jd.prototype,"tourTypeOptions",void 0),Rd([pe({attribute:!1})],jd.prototype,"layoutOptions",void 0),Rd([pe({attribute:!0})],jd.prototype,"currentLeadSource",void 0),Rd([pe({attribute:!1})],jd.prototype,"leadSources",void 0),Rd([pe({attribute:!0})],jd.prototype,"featureFlagShowDropdown",void 0),Rd([pe({attribute:!1})],jd.prototype,"bedroomPreferenceRequired",void 0),Rd([pe({attribute:!1})],jd.prototype,"orgLegalName",void 0),Rd([pe({attribute:!1})],jd.prototype,"country",void 0),Rd([pe({attribute:!1})],jd.prototype,"buildingState",void 0),Rd([pe({attribute:!1})],jd.prototype,"primaryColor",void 0),Rd([pe({attribute:!1})],jd.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Rd([pe({attribute:!1})],jd.prototype,"compactDesign",void 0),Rd([pe({attribute:!1})],jd.prototype,"leadSourceClient",void 0),Rd([pe({attribute:!1})],jd.prototype,"leadSourceMultitouchClient",void 0),Rd([pe({attribute:!1})],jd.prototype,"getSessionToken",void 0),Rd([fe()],jd.prototype,"step",void 0),Rd([fe()],jd.prototype,"loadError",void 0),Rd([fe()],jd.prototype,"mobile",void 0),Rd([fe()],jd.prototype,"group",void 0),Rd([fe()],jd.prototype,"communities",void 0),Rd([fe()],jd.prototype,"selectedIds",void 0),Rd([fe()],jd.prototype,"picks",void 0),Rd([fe()],jd.prototype,"existingEventIds",void 0),Rd([fe()],jd.prototype,"tourType",void 0),Rd([fe()],jd.prototype,"linkTourType",void 0),Rd([fe()],jd.prototype,"date",void 0),Rd([fe()],jd.prototype,"firstStart",void 0),Rd([fe()],jd.prototype,"laterStarts",void 0),Rd([fe()],jd.prototype,"plan",void 0),Rd([fe()],jd.prototype,"planLoading",void 0),Rd([fe()],jd.prototype,"planError",void 0),Rd([fe()],jd.prototype,"notice",void 0),Rd([fe()],jd.prototype,"contact",void 0),Rd([fe()],jd.prototype,"submitting",void 0),Rd([fe()],jd.prototype,"bookingError",void 0),Rd([fe()],jd.prototype,"reschedulePrompt",void 0),Rd([fe()],jd.prototype,"confirmed",void 0),Rd([fe()],jd.prototype,"bookedTourType",void 0),Rd([fe()],jd.prototype,"bookedEventIds",void 0),Rd([fe()],jd.prototype,"extendInitial",void 0),Rd([fe()],jd.prototype,"extendFrom",void 0),Rd([fe()],jd.prototype,"extending",void 0),Rd([fe()],jd.prototype,"rescheduled",void 0),Rd([fe()],jd.prototype,"rescheduleCanceled",void 0),jd=Rd([ce("tour-scheduler-v2")],jd);const Fd=p`
|
|
6562
6563
|
:host {
|
|
6563
6564
|
display: block;
|
|
6564
6565
|
position: relative;
|
|
@@ -6870,7 +6871,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6870
6871
|
margin: 2px 0;
|
|
6871
6872
|
}
|
|
6872
6873
|
}
|
|
6873
|
-
`;class
|
|
6874
|
+
`;class Hd{constructor(e={}){var t,i,n,r,o,a;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(i=e.description)&&void 0!==i?i:"",this.type=null!==(n=e.type)&&void 0!==n?n:"",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 zd{constructor(e={}){var t,i,n,r,o;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.minAvailableItem=e.minAvailableItem?new Hd(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new Hd(e.maxAvailableItem):void 0,this.allItems=(null!==(n=e.allItems)&&void 0!==n?n:[]).map(e=>new Hd(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 Gd,Vd;!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"}(Gd||(Gd={})),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"}(Vd||(Vd={}));class Wd{constructor(e={}){var t,i,n,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!==(i=e.fee_name)&&void 0!==i?i:"",this.amount=e.amount,this.amount_display=null!==(n=e.amount_display)&&void 0!==n?n:"",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:Gd.ONE_TIME,this.category=null!==(a=e.category)&&void 0!==a?a:Vd.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 Qd=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()}`:""}},qd=ns,Yd=e=>new Wd(e),Kd=e=>new zd(e),Xd=async(e,t)=>{try{const i=(new Qd).addArray("layout_ids",null==t?void 0:t.map(e=>e.toString())),n=await r().get(`${qd}/platformApi/webchat/${e}/marketable-fees?${i.build()}`);if(n.data){const e=Er(n.data);return{fees:e.fees.map(Yd),rentableItems:e.rentableItems.map(Kd),buildingIncentives:e.buildingIncentives}}}catch(t){ra({logType:na.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t},error:t})}return{fees:[],rentableItems:[],buildingIncentives:[]}},Zd=-1,Jd=ns,ec=async({buildingSlug:e,unitId:t,chargeInputs:i,rentableItems:n,leaseTerm:o,moveInDate:a},s)=>{try{const l=await r().post(`${Jd}/platformApi/webchat/${e}/quote/calculate`,_r({unitId:t,chargeInputs:i,rentableItems:n,...Number.isFinite(o)?{leaseTerm:o}:{},moveInDate:a}),{signal:s});if(l.data){return Er(l.data)}}catch(t){const i=t;"ERR_CANCELED"!==i.code&&ra({logType:na.error,buildingSlug:e,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:t},error:t});const n=(e=>{var t,i,n;const r=null===(i=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===i?void 0:i.detail;if(422!==(null===(n=e.response)||void 0===n?void 0:n.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})(i);return{quote:null,error:n?{type:"feeLimit",violations:n}:{type:"unknown"}}}return{quote:null,error:{type:"unknown"}}};function tc(e){return nr(e,"yyyy-MM-dd")}function ic(){return tc(Hr())}const nc=ns,rc=async({buildingSlug:e,numBedrooms:t,moveInDateString:i,leaseTerm:n})=>{try{const a=(({numBedrooms:e,moveInDateString:t,leaseTerm:i})=>{const n=new Qd;return n.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(i)?null==i?void 0:i.toString():void 0),n.build()})({numBedrooms:t,moveInDateString:i,leaseTerm:n}),s=await r().get(`${nc}/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){ra({logType:na.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS]",logData:{error:r,params:{numBedrooms:t,moveInDateString:i,leaseTerm:n}},error:r})}var o;return[]},oc=[Vd.PetFee,Vd.PetRent,Vd.PetDeposit];function ac(e){return`Up to ${e} ${1===e?"pet":"pets"} allowed`}const sc=({color:e="#347FF7",size:t=24}={})=>z`
|
|
6874
6875
|
<svg aria-hidden="true" focusable="false" width="${t}" height="${t}" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6875
6876
|
<g id="Frame" clip-path="url(#clip0_18718_332018)">
|
|
6876
6877
|
<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"/>
|
|
@@ -6883,7 +6884,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6883
6884
|
</clipPath>
|
|
6884
6885
|
</defs>
|
|
6885
6886
|
</svg>
|
|
6886
|
-
`,
|
|
6887
|
+
`,lc=p`
|
|
6887
6888
|
:host {
|
|
6888
6889
|
display: block;
|
|
6889
6890
|
margin-bottom: 20px;
|
|
@@ -6917,9 +6918,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6917
6918
|
color: #868e96;
|
|
6918
6919
|
font-size: 0.8rem;
|
|
6919
6920
|
}
|
|
6920
|
-
`;var
|
|
6921
|
+
`;var uc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let dc=class extends ue{constructor(){super(...arguments),this.promoAmount="0",this.promoDescription="",this.promoValidity=""}render(){return H`
|
|
6921
6922
|
<div class="promo-card">
|
|
6922
|
-
<div class="icon-container">${
|
|
6923
|
+
<div class="icon-container">${sc()}</div>
|
|
6923
6924
|
<div class="content-container">
|
|
6924
6925
|
<h2 class="promo-heading">
|
|
6925
6926
|
${this.promoAmount} ${this.promoDescription}
|
|
@@ -6927,7 +6928,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6927
6928
|
<div class="promo-subtitle">${this.promoValidity}</div>
|
|
6928
6929
|
</div>
|
|
6929
6930
|
</div>
|
|
6930
|
-
`}};
|
|
6931
|
+
`}};dc.styles=lc,uc([pe({type:String})],dc.prototype,"promoAmount",void 0),uc([pe({type:String})],dc.prototype,"promoDescription",void 0),uc([pe({type:String})],dc.prototype,"promoValidity",void 0),dc=uc([ce("promo-card")],dc);var cc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let hc=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`
|
|
6931
6932
|
<div class="floorplan-image-card ${this.selected?"selected":""}">
|
|
6932
6933
|
<div class="section-left">
|
|
6933
6934
|
${this.unit.floorplanUrl?H`
|
|
@@ -6952,7 +6953,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6952
6953
|
</p>
|
|
6953
6954
|
</div>
|
|
6954
6955
|
</div>
|
|
6955
|
-
`}};
|
|
6956
|
+
`}};hc.styles=Qu,cc([pe({type:Object})],hc.prototype,"unit",void 0),cc([pe()],hc.prototype,"onUnitSelect",void 0),cc([pe({type:Boolean})],hc.prototype,"selected",void 0),hc=cc([ce("floorplan-image-card")],hc);var pc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let fc=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.layoutOptions=[],this.selectedLayoutIds=[Zd],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 i;e===Zd?i=[Zd]:this.selectedLayoutIds.includes(Zd)?i=[e]:this.selectedLayoutIds.includes(e)?(i=this.selectedLayoutIds.filter(t=>t!==e),0===i.length&&(i=[Zd])):i=[...this.selectedLayoutIds,e],this.selectedLayoutIds=i,null===(t=this.onSelectLayout)||void 0===t||t.call(this,this.selectedLayoutIds)},this.handleMoveInDateChange=e=>{var t;const i=e.target.value,n=Hr();if(i){const[e,t,r]=i.split("-").map(Number),o=new Date(e,t-1,r);if(Tr(o,n))return;this.moveInDate=o}else this.moveInDate=n;null===(t=this.onMoveInDateChange)||void 0===t||t.call(this,i||tc(n))},this.handleLeaseTermChange=e=>{var t;const i=parseInt(e.target.value);!Number.isInteger(i)||i<=0||(this.leaseTerm=i,null===(t=this.onLeaseTermChange)||void 0===t||t.call(this,this.leaseTerm))},this.renderUnitSelection=()=>{var e,t;return this.isLoading?H`
|
|
6956
6957
|
<div class="unit-selection">
|
|
6957
6958
|
<div class="image-carousel">
|
|
6958
6959
|
${Array.from({length:3},()=>H`<div class="unit-card-skeleton shimmer"></div>`)}
|
|
@@ -6990,7 +6991,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6990
6991
|
</div>
|
|
6991
6992
|
`)}
|
|
6992
6993
|
</div>
|
|
6993
|
-
`}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,i])=>{const n=new RegExp(`\\b${e}\\b`,"gi");t=t.replace(n,i)}),t};return[{value:
|
|
6994
|
+
`}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,i])=>{const n=new RegExp(`\\b${e}\\b`,"gi");t=t.replace(n,i)}),t};return[{value:Zd,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`
|
|
6994
6995
|
<div class="floor-plan-selector">
|
|
6995
6996
|
<div class="floor-plan-selector-label">Select Floor Plan</div>
|
|
6996
6997
|
${this.renderBadges()}
|
|
@@ -7002,8 +7003,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7002
7003
|
<input
|
|
7003
7004
|
type="date"
|
|
7004
7005
|
placeholder="Select move in date"
|
|
7005
|
-
min=${
|
|
7006
|
-
.value=${this.moveInDate?
|
|
7006
|
+
min=${ic()}
|
|
7007
|
+
.value=${this.moveInDate?tc(this.moveInDate):""}
|
|
7007
7008
|
@input=${this.handleMoveInDateChange}
|
|
7008
7009
|
/>
|
|
7009
7010
|
</div>
|
|
@@ -7022,7 +7023,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7022
7023
|
${this.renderUnitSelection()}
|
|
7023
7024
|
</div>
|
|
7024
7025
|
</div>
|
|
7025
|
-
`}};
|
|
7026
|
+
`}};fc.styles=qu,pc([pe({type:String})],fc.prototype,"buildingSlug",void 0),pc([pe({type:Array})],fc.prototype,"layoutOptions",void 0),pc([pe({type:Array})],fc.prototype,"selectedLayoutIds",void 0),pc([pe({type:Array})],fc.prototype,"units",void 0),pc([pe({type:Boolean})],fc.prototype,"isLoading",void 0),pc([pe({type:Boolean})],fc.prototype,"isLoadingLayouts",void 0),pc([pe()],fc.prototype,"onSelectLayout",void 0),pc([pe()],fc.prototype,"onUnitSelect",void 0),pc([pe()],fc.prototype,"onMoveInDateChange",void 0),pc([pe()],fc.prototype,"onLeaseTermChange",void 0),pc([fe()],fc.prototype,"moveInDate",void 0),pc([fe()],fc.prototype,"leaseTerm",void 0),pc([fe()],fc.prototype,"selectedUnit",void 0),fc=pc([ce("floor-plan-selector")],fc);const gc=p`
|
|
7026
7027
|
:host {
|
|
7027
7028
|
display: block;
|
|
7028
7029
|
width: 100%;
|
|
@@ -7068,7 +7069,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7068
7069
|
font-size: 1rem;
|
|
7069
7070
|
align-self: center;
|
|
7070
7071
|
}
|
|
7071
|
-
`;var
|
|
7072
|
+
`;var mc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let bc=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 i=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee;return(null==i?void 0:i.feeName)?Rr(i.feeName):""}get description(){var e,t,i,n;if(null===(e=this.feeQuote)||void 0===e?void 0:e.sourceRentableItem){return`${this.feeQuote.sourceRentableItem.id}`}return null!==(n=null===(i=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee)||void 0===i?void 0:i.description)&&void 0!==n?n:""}get additionalInfo(){var e,t,i;return null!==(i=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.additionalInfo)&&void 0!==i?i:""}get triggeredEvent(){var e,t;const i=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.triggeredByEvent;if(!i)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"}[i]||i}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`
|
|
7072
7073
|
<div class="fee-item">
|
|
7073
7074
|
<div class="fee-info">
|
|
7074
7075
|
<div class="fee-name">${this.name}</div>
|
|
@@ -7082,7 +7083,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7082
7083
|
</div>
|
|
7083
7084
|
<div class="fee-amount">${this.amount}</div>
|
|
7084
7085
|
</div>
|
|
7085
|
-
`:H``}};
|
|
7086
|
+
`:H``}};bc.styles=gc,mc([pe({type:Object})],bc.prototype,"feeQuote",void 0),bc=mc([ce("fee-item")],bc);var yc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let vc=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 i;const n=null!==(i=t.amountRange.fixedValue)&&void 0!==i?i:0;e.set(n,(e.get(n)||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 i;return e+(null!==(i=t.amountRange.fixedValue)&&void 0!==i?i: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} ${i=t,n=e.count,1===n?i:`${i}s`} @ ${Br(e.price,2)}/month`;var i,n}).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`
|
|
7086
7087
|
<div class="fee-item">
|
|
7087
7088
|
<div class="fee-info">
|
|
7088
7089
|
<div class="fee-name">${this.itemType}</div>
|
|
@@ -7090,7 +7091,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7090
7091
|
</div>
|
|
7091
7092
|
<div class="fee-amount">${this.totalAmount}</div>
|
|
7092
7093
|
</div>
|
|
7093
|
-
`:H``}};
|
|
7094
|
+
`:H``}};vc.styles=gc,yc([pe({type:Array})],vc.prototype,"feeQuotes",void 0),vc=yc([ce("grouped-rentable-item")],vc);const wc=p`
|
|
7094
7095
|
.fee-card-section-container {
|
|
7095
7096
|
margin: 0 12px;
|
|
7096
7097
|
border-radius: 4px;
|
|
@@ -7150,7 +7151,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7150
7151
|
margin: 12px;
|
|
7151
7152
|
justify-content: space-between;
|
|
7152
7153
|
}
|
|
7153
|
-
`;var
|
|
7154
|
+
`;var Cc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let xc=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 i;return e+(null!==(i=t.amountRange.fixedValue)&&void 0!==i?i:0)},0);return Br(e,2)}get groupedRentableItems(){const e=this.fees.filter(e=>e.sourceRentableItem);e.sort((e,t)=>{var i,n;const r=(null===(i=e.sourceRentableItem)||void 0===i?void 0:i.description)||"",o=(null===(n=t.sourceRentableItem)||void 0===n?void 0:n.description)||"";return r.localeCompare(o,navigator.language,{numeric:!0})});const t={};return e.forEach(e=>{var i;const n=(null===(i=e.sourceRentableItem)||void 0===i?void 0:i.description)||"unknown";t[n]||(t[n]=[]),t[n].push(e)}),t}get nonRentableItems(){return this.fees.filter(e=>!e.sourceRentableItem)}render(){return H`
|
|
7154
7155
|
<div class="fee-card-section-container">
|
|
7155
7156
|
<div class="fee-card-section-header">
|
|
7156
7157
|
<h1 class="section-title">${this.title}</h1>
|
|
@@ -7174,7 +7175,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7174
7175
|
</div>
|
|
7175
7176
|
</div>
|
|
7176
7177
|
</div>
|
|
7177
|
-
`}};
|
|
7178
|
+
`}};xc.styles=wc,Cc([pe({type:String})],xc.prototype,"title",void 0),Cc([pe({type:Array})],xc.prototype,"fees",void 0),Cc([fe()],xc.prototype,"buildingFeesToQuantity",void 0),xc=Cc([ce("fee-card")],xc);const $c=p`
|
|
7178
7179
|
:host {
|
|
7179
7180
|
--transition-timing: 0.2s ease;
|
|
7180
7181
|
display: flex;
|
|
@@ -7383,7 +7384,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7383
7384
|
font-weight: bold;
|
|
7384
7385
|
color: #0066cc;
|
|
7385
7386
|
}
|
|
7386
|
-
`;var
|
|
7387
|
+
`;var Sc;!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"}(Sc||(Sc={}));var kc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const Ac=["num_cats","num_dogs","num_other_pets"];let Tc=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,i;if(this.selectedRentableItems.some(t=>t.type===e.type)){const i=this.selectedRentableItems.find(t=>t.type===e.type);i&&(null===(t=this.onRentableItemRemove)||void 0===t||t.call(this,i))}else{const t=e.minAvailableItem||e.allItems[0];if(t){const n={id:t.id,type:e.type};null===(i=this.onRentableItemAdd)||void 0===i||i.call(this,n)}}}}get totalPets(){var e,t,i;return(null!==(e=this.chargeInputs.num_cats)&&void 0!==e?e:0)+(null!==(t=this.chargeInputs.num_dogs)&&void 0!==t?t:0)+(null!==(i=this.chargeInputs.num_other_pets)&&void 0!==i?i:0)}isAtPetLimit(e){return null!==this.maxPets&&Ac.includes(e)&&this.totalPets>=this.maxPets}handleIncrement(e){var t,i;if(this.isAtPetLimit(e))return;const n=(null!==(t=this.chargeInputs[e])&&void 0!==t?t:0)+1;Ac.includes(e)?this.updatePetCount({[e]:n}):null===(i=this.onChargeInputsChange)||void 0===i||i.call(this,{[e]:n})}handleDecrement(e){var t,i;const n=null!==(t=this.chargeInputs[e])&&void 0!==t?t:0,r="num_applicants"===e?1:0,o=Math.max(r,n-1);Ac.includes(e)?this.updatePetCount({[e]:o}):null===(i=this.onChargeInputsChange)||void 0===i||i.call(this,{[e]:o})}updatePetCount(e){var t,i,n,r;const o={...this.chargeInputs,...e},a=(null!==(t=o.num_cats)&&void 0!==t?t:0)+(null!==(i=o.num_dogs)&&void 0!==i?i:0)+(null!==(n=o.num_other_pets)&&void 0!==n?n: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`
|
|
7387
7388
|
<div class="rentable-item-row">
|
|
7388
7389
|
<div class="rentable-item-info">
|
|
7389
7390
|
<div class="rentable-item-label">${e.description}</div>
|
|
@@ -7432,7 +7433,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7432
7433
|
${["num_applicants","num_cats","num_dogs","num_other_pets"].map(e=>this.renderChargeInputRow(e))}
|
|
7433
7434
|
${null!==this.maxPets?H`
|
|
7434
7435
|
<div class="charge-input-note">
|
|
7435
|
-
${
|
|
7436
|
+
${ac(this.maxPets)}
|
|
7436
7437
|
</div>
|
|
7437
7438
|
`:""}
|
|
7438
7439
|
</div>
|
|
@@ -7444,7 +7445,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7444
7445
|
</div>
|
|
7445
7446
|
`:""}
|
|
7446
7447
|
</div>
|
|
7447
|
-
`}};
|
|
7448
|
+
`}};Tc.styles=p`
|
|
7448
7449
|
.charge-inputs-container {
|
|
7449
7450
|
background: white;
|
|
7450
7451
|
border-radius: 8px;
|
|
@@ -7578,7 +7579,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7578
7579
|
opacity: 0.5;
|
|
7579
7580
|
cursor: not-allowed;
|
|
7580
7581
|
}
|
|
7581
|
-
|
|
7582
|
+
`,kc([pe({type:Object})],Tc.prototype,"chargeInputs",void 0),kc([pe()],Tc.prototype,"onChargeInputsChange",void 0),kc([pe({type:Boolean})],Tc.prototype,"disabled",void 0),kc([pe({type:Number})],Tc.prototype,"maxPets",void 0),kc([pe({type:Array})],Tc.prototype,"rentableItems",void 0),kc([pe({type:Array})],Tc.prototype,"selectedRentableItems",void 0),kc([pe()],Tc.prototype,"onRentableItemAdd",void 0),kc([pe()],Tc.prototype,"onRentableItemRemove",void 0),Tc=kc([ce("charge-inputs")],Tc);const Ec=p`
|
|
7582
7583
|
:host {
|
|
7583
7584
|
--skeleton-bg-color: #eaeaea;
|
|
7584
7585
|
--skeleton-highlight-color: #f5f5f5;
|
|
@@ -7592,8 +7593,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7592
7593
|
background-position: 200px 0;
|
|
7593
7594
|
}
|
|
7594
7595
|
}
|
|
7595
|
-
`,
|
|
7596
|
-
${
|
|
7596
|
+
`,_c=p`
|
|
7597
|
+
${Ec}
|
|
7597
7598
|
|
|
7598
7599
|
:host {
|
|
7599
7600
|
display: block;
|
|
@@ -7658,8 +7659,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7658
7659
|
margin-bottom: 10px;
|
|
7659
7660
|
}
|
|
7660
7661
|
}
|
|
7661
|
-
`,
|
|
7662
|
-
${
|
|
7662
|
+
`,Oc=p`
|
|
7663
|
+
${Ec}
|
|
7663
7664
|
|
|
7664
7665
|
:host {
|
|
7665
7666
|
display: block;
|
|
@@ -7681,23 +7682,23 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7681
7682
|
box-sizing: border-box;
|
|
7682
7683
|
}
|
|
7683
7684
|
}
|
|
7684
|
-
`;var
|
|
7685
|
+
`;var Pc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Ic=class extends ue{constructor(){super(...arguments),this.rows=2,this.header=!0}render(){return H`
|
|
7685
7686
|
<div class="skeleton-card">
|
|
7686
7687
|
${this.header?H`<div class="skeleton-header"></div>`:""}
|
|
7687
7688
|
${Array(this.rows).fill(0).map(()=>H`<div class="skeleton-row"></div>`)}
|
|
7688
7689
|
</div>
|
|
7689
|
-
`}};
|
|
7690
|
+
`}};Ic.styles=_c,Pc([pe({type:Number})],Ic.prototype,"rows",void 0),Pc([pe({type:Boolean})],Ic.prototype,"header",void 0),Ic=Pc([ce("skeleton-card")],Ic);var Nc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Mc=class extends ue{constructor(){super(...arguments),this.cards=3,this.rowsPerCard=[3,2,1]}render(){return H`
|
|
7690
7691
|
<div class="skeleton-loader">
|
|
7691
7692
|
${Array.from({length:this.cards},(e,t)=>{const i=Array.isArray(this.rowsPerCard)?this.rowsPerCard[t]||2:this.rowsPerCard;return H`<skeleton-card .rows=${i}></skeleton-card>`})}
|
|
7692
7693
|
</div>
|
|
7693
|
-
`}};
|
|
7694
|
+
`}};Mc.styles=Oc,Nc([pe({type:Number})],Mc.prototype,"cards",void 0),Nc([pe({type:Array})],Mc.prototype,"rowsPerCard",void 0),Mc=Nc([ce("skeleton-loader")],Mc);var Dc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Lc=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.showSkeletonLoader=!1,this.selectedUnit=null,this.quote=null,this.quoteError=null,this.layoutOptions=[],this.selectedLayoutIds=[Zd],this.groupedFees={[Gd.ONE_TIME]:[],[Gd.MONTHLY]:[],[Gd.WEEKLY]:[],[Gd.BI_WEEKLY]:[],[Gd.ANNUALLY]:[],[Gd.DAILY]:[],[Gd.AS_NEEDED]:[],[Gd.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:Sc.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 i=[],n=[{freq:Sc.ANNUALLY,title:"Yearly Charges"},{freq:Sc.MONTHLY,title:"Monthly Charges"},{freq:Sc.BI_WEEKLY,title:"Bi-Weekly Charges"},{freq:Sc.WEEKLY,title:"Weekly Charges"},{freq:Sc.DAILY,title:"Daily Charges"},{freq:Sc.ONE_TIME,title:"One-Time"},{freq:Sc.NEVER,title:"No Charges"}],r=null===(e=this.quote)||void 0===e?void 0:e.feeQuotes;for(const{freq:e,title:o}of n){if(!(null==r?void 0:r.length)&&e!==Sc.MONTHLY)continue;let n=null!==(t=null==r?void 0:r.filter(t=>{var i,n;if((null===(i=t.marketableFee)||void 0===i?void 0:i.frequency)===e){if(e===Sc.ONE_TIME){return["APPLICATION_SUBMISSION","APPLICATION_APPROVAL","LEASE_SIGNING","MOVE_IN"].includes((null===(n=t.marketableFee)||void 0===n?void 0:n.triggeredByEvent)||"")}return!0}return!!t.sourceRentableItem&&("monthly"===t.sourceRentableItem.rentFrequency&&e===Sc.MONTHLY||"annually"===t.sourceRentableItem.rentFrequency&&e===Sc.ANNUALLY)}))&&void 0!==t?t:[];if(e===Sc.MONTHLY){const e=this.rentAsFeeQuote;e&&(n=[e,...n])}const a=this.renderRecurringFeeSection(o,n);a&&i.push(a)}return i}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`
|
|
7694
7695
|
<div class="total-cost-section">
|
|
7695
7696
|
<div class="total-cost-row">
|
|
7696
7697
|
<span class="total-cost-label">Total Monthly Cost:</span>
|
|
7697
7698
|
<span class="total-cost-amount">${Br(t,2)}</span>
|
|
7698
7699
|
</div>
|
|
7699
7700
|
</div>
|
|
7700
|
-
`:null}getQuoteErrorMessage(e){if("feeLimit"===e.type){return`${
|
|
7701
|
+
`:null}getQuoteErrorMessage(e){if("feeLimit"===e.type){return`${ac(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`
|
|
7701
7702
|
<div class="fees-container empty-state" role="alert">
|
|
7702
7703
|
<p class="quote-error-message">
|
|
7703
7704
|
${this.getQuoteErrorMessage(this.quoteError)}
|
|
@@ -7753,7 +7754,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7753
7754
|
|
|
7754
7755
|
${this.renderFeesContent()}
|
|
7755
7756
|
</div>
|
|
7756
|
-
`}};
|
|
7757
|
+
`}};Lc.styles=$c,Dc([pe({type:String})],Lc.prototype,"buildingSlug",void 0),Dc([pe({type:Boolean})],Lc.prototype,"showSkeletonLoader",void 0),Dc([pe({type:Object})],Lc.prototype,"selectedUnit",void 0),Dc([pe({type:Object})],Lc.prototype,"quote",void 0),Dc([pe({type:Object})],Lc.prototype,"quoteError",void 0),Dc([pe({type:Array})],Lc.prototype,"layoutOptions",void 0),Dc([pe({type:Array})],Lc.prototype,"selectedLayoutIds",void 0),Dc([pe({type:Object})],Lc.prototype,"groupedFees",void 0),Dc([pe({type:Array})],Lc.prototype,"rentableItems",void 0),Dc([pe({type:Array})],Lc.prototype,"units",void 0),Dc([pe({type:Boolean})],Lc.prototype,"isLoadingUnits",void 0),Dc([pe({type:Boolean})],Lc.prototype,"isLoadingLayouts",void 0),Dc([pe()],Lc.prototype,"onSelectLayout",void 0),Dc([pe()],Lc.prototype,"onUnitSelect",void 0),Dc([pe()],Lc.prototype,"onMoveInDateChange",void 0),Dc([pe()],Lc.prototype,"onLeaseTermChange",void 0),Dc([pe({type:Object})],Lc.prototype,"chargeInputs",void 0),Dc([pe()],Lc.prototype,"onChargeInputsChange",void 0),Dc([pe({type:Number})],Lc.prototype,"maxPets",void 0),Dc([pe({type:Array})],Lc.prototype,"selectedRentableItems",void 0),Dc([pe()],Lc.prototype,"onRentableItemAdd",void 0),Dc([pe()],Lc.prototype,"onRentableItemRemove",void 0),Lc=Dc([ce("fee-calculator-layout")],Lc);var Rc,Bc,Uc,jc;!function(e){e.OneTime="OneTime",e.Daily="Daily",e.Weekly="Weekly",e.BiWeekly="BiWeekly",e.Monthly="Monthly",e.Yearly="Yearly",e.Unknown="Unknown"}(Rc||(Rc={})),function(e){e.Debit="Debit",e.Credit="Credit"}(Bc||(Bc={})),function(e){e.Fixed="Fixed",e.UsageBased="UsageBased",e.Varies="Varies"}(Uc||(Uc={})),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"}(jc||(jc={}));const Fc=p`
|
|
7757
7758
|
:host {
|
|
7758
7759
|
display: block;
|
|
7759
7760
|
--table-header-bg: white;
|
|
@@ -7821,7 +7822,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7821
7822
|
color: #888;
|
|
7822
7823
|
font-style: italic;
|
|
7823
7824
|
}
|
|
7824
|
-
`,
|
|
7825
|
+
`,Hc=p`
|
|
7825
7826
|
:host {
|
|
7826
7827
|
display: inline-flex;
|
|
7827
7828
|
}
|
|
@@ -7880,7 +7881,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7880
7881
|
font-style: italic;
|
|
7881
7882
|
cursor: not-allowed;
|
|
7882
7883
|
}
|
|
7883
|
-
`;var
|
|
7884
|
+
`;var zc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Gc=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,i;if(!e.has("feeItem"))return;const n=null!==(i=null===(t=this.feeItem)||void 0===t?void 0:t.id)&&void 0!==i?i:null;n!==this._previousFeeItemId&&(this.quantity=0,this._previousFeeItemId=n)}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`
|
|
7884
7885
|
<div class="quantity-control ${this.disabled?"unavailable":""}">
|
|
7885
7886
|
<button
|
|
7886
7887
|
class="quantity-button"
|
|
@@ -7902,7 +7903,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7902
7903
|
<span class="operator-sign">+</span>
|
|
7903
7904
|
</button>
|
|
7904
7905
|
</div>
|
|
7905
|
-
`:H``}};
|
|
7906
|
+
`:H``}};Gc.styles=Hc,zc([pe({type:Object})],Gc.prototype,"feeItem",void 0),zc([pe()],Gc.prototype,"onQuantityChange",void 0),zc([pe({type:Boolean,reflect:!0})],Gc.prototype,"disabled",void 0),zc([pe({type:Number})],Gc.prototype,"quantity",void 0),Gc=zc([ce("table-addon-qty-selector")],Gc);let Vc=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,i;return null!==(i=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!==i?i: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,i;if(e.has("rentableItem")){const e=null!==(i=null===(t=this.rentableItem)||void 0===t?void 0:t.type)&&void 0!==i?i: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,i=this.disabled||this.quantity<=0;return H`
|
|
7906
7907
|
<div
|
|
7907
7908
|
class="quantity-control ${!e||this.disabled?"unavailable":""}"
|
|
7908
7909
|
>
|
|
@@ -7926,7 +7927,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7926
7927
|
<span class="operator-sign">+</span>
|
|
7927
7928
|
</button>
|
|
7928
7929
|
</div>
|
|
7929
|
-
`}};
|
|
7930
|
+
`}};Vc.styles=Hc,zc([pe({type:Object})],Vc.prototype,"rentableItem",void 0),zc([pe()],Vc.prototype,"onQuantityChange",void 0),zc([pe({type:Boolean,reflect:!0})],Vc.prototype,"disabled",void 0),zc([pe({type:Number})],Vc.prototype,"quantity",void 0),zc([pe({type:Set})],Vc.prototype,"selectedItemIds",void 0),Vc=zc([ce("table-rentable-item-qty-selector")],Vc);var Wc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Qc=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 i=e.id;1!==e.quantities.length||Array.isArray(this.quantities.get(i))?this.quantities.set(i,e.quantities):this.quantities.set(i,e.quantities[0].quantity),this.requestUpdate("quantities"),null===(t=this.onAddonSelect)||void 0===t||t.call(this,e)},this.handleRentableItemQuantityChange=e=>{var t,i,n,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 zd&&t.type===e.type);if(!l)return;const u=null!==(i=this.selectedRentableItemIds.get(e.type))&&void 0!==i?i:new Set,d=(c=null!==(r=null===(n=l.allItems)||void 0===n?void 0:n.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 i=0;const n=Math.min(d.length,10);if(u.size+t>n)return;for(const n of d){if(i>=t)break;u.has(n.id)||(u.add(n.id),null===(o=this.onRentableItemAdd)||void 0===o||o.call(this,{id:n.id,type:e.type}),i++)}}else if(e.quantity<s){const t=s-e.quantity;let i=0;const n=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 n){if(i>=t)break;u.delete(r.id),null===(a=this.onRentableItemRemove)||void 0===a||a.call(this,{id:r.id,type:e.type}),i++}}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 i=this.quantities.get(e);return null!=i?i:t}initializeRentableItemQuantity(e,t){const i=this.preserveExistingQuantity(e.type,0);t.set(e.type,i),this.selectedRentableItemIds.has(e.type)||this.selectedRentableItemIds.set(e.type,new Set)}initializeBuildingFeeQuantity(e,t){const i=e.id,n=this.preserveExistingQuantity(i,0);t.set(i,n)}initializeQuantities(){const e=new Map;this.addons.forEach(t=>{t instanceof zd?this.initializeRentableItemQuantity(t,e):this.initializeBuildingFeeQuantity(t,e)}),this.quantities=e}getName(e){return e instanceof zd?e.displayName:e.fee_name}getSortedAddons(){return[...this.addons].sort((e,t)=>{const i=this.getName(e),n=this.getName(t);return i.localeCompare(n,navigator.language,{numeric:!0})})}isRentableItemAvailable(e){var t,i;return!(e instanceof zd)||(null!==(i=null===(t=e.allItems)||void 0===t?void 0:t.filter(e=>e.available).length)&&void 0!==i?i:0)>0}renderQtySelector(e){var t;if(e instanceof zd){const i=null!==(t=this.quantities.get(e.type))&&void 0!==t?t:0;return H`
|
|
7930
7931
|
<table-rentable-item-qty-selector
|
|
7931
7932
|
.rentableItem=${e}
|
|
7932
7933
|
.quantity=${i}
|
|
@@ -7967,7 +7968,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7967
7968
|
</tbody>
|
|
7968
7969
|
</table>
|
|
7969
7970
|
</div>
|
|
7970
|
-
`:H`<div class="empty-state">No add-ons available</div> `}};
|
|
7971
|
+
`:H`<div class="empty-state">No add-ons available</div> `}};Qc.styles=Fc,Wc([pe({type:Array})],Qc.prototype,"addons",null),Wc([pe({type:Boolean})],Qc.prototype,"disabled",void 0),Wc([pe()],Qc.prototype,"onAddonSelect",void 0),Wc([pe({attribute:!1})],Qc.prototype,"onRentableItemAdd",void 0),Wc([pe({attribute:!1})],Qc.prototype,"onRentableItemRemove",void 0),Wc([fe()],Qc.prototype,"quantities",void 0),Wc([fe()],Qc.prototype,"selectedRentableItemIds",void 0),Qc=Wc([ce("addon-table")],Qc);var qc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Yc=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,i;const n=this.primaryColor||Xi,r=this.backgroundColor||"#ffffff",o=this.buildingWebchatView&&nn(this.buildingWebchatView.orgId,this.buildingWebchatView.id)&&n!==Xi?tn(n,.6):"black";return H`
|
|
7971
7972
|
<style>
|
|
7972
7973
|
#${this.id}::after {
|
|
7973
7974
|
border-right-color: ${o} !important;
|
|
@@ -7999,7 +8000,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7999
8000
|
.onClick=${this.onClose}
|
|
8000
8001
|
></minimize-expand-button>
|
|
8001
8002
|
</div>
|
|
8002
|
-
`}};
|
|
8003
|
+
`}};Yc.styles=p`
|
|
8003
8004
|
.hideTab {
|
|
8004
8005
|
display: none;
|
|
8005
8006
|
}
|
|
@@ -8009,7 +8010,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8009
8010
|
justify-content: space-between;
|
|
8010
8011
|
gap: 32px;
|
|
8011
8012
|
}
|
|
8012
|
-
`,
|
|
8013
|
+
`,qc([pe({type:String})],Yc.prototype,"id",void 0),qc([pe({type:Boolean})],Yc.prototype,"showChatAdditionalActions",void 0),qc([pe({type:Object})],Yc.prototype,"buildingWebchatView",void 0),qc([pe({type:String})],Yc.prototype,"primaryColor",void 0),qc([pe({type:String})],Yc.prototype,"backgroundColor",void 0),qc([pe({type:String})],Yc.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),qc([pe({type:String})],Yc.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),qc([pe({type:Object})],Yc.prototype,"enabledChatWidgets",void 0),qc([pe({attribute:!0})],Yc.prototype,"onClickMinimize",void 0),qc([pe({attribute:!0})],Yc.prototype,"onClickEmailOption",void 0),qc([pe({attribute:!0})],Yc.prototype,"onClickPhoneOption",void 0),qc([pe({attribute:!0})],Yc.prototype,"onClickSSTOption",void 0),qc([pe({attribute:!0})],Yc.prototype,"onClose",void 0),Yc=qc([ce("chat-additional-actions")],Yc);const Kc=p`
|
|
8013
8014
|
:host {
|
|
8014
8015
|
display: block;
|
|
8015
8016
|
}
|
|
@@ -8046,9 +8047,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8046
8047
|
font-size: 0.9rem;
|
|
8047
8048
|
opacity: 0.9;
|
|
8048
8049
|
}
|
|
8049
|
-
`;var
|
|
8050
|
+
`;var Xc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Zc=class extends ue{getFormattedEndDate(e){return new Date(e.endDate).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}render(){return this.incentive?H`
|
|
8050
8051
|
<div class="incentive-banner">
|
|
8051
|
-
<div class="incentive-icon">${
|
|
8052
|
+
<div class="incentive-icon">${sc({size:32})}</div>
|
|
8052
8053
|
<div class="incentive-content">
|
|
8053
8054
|
<h2 class="incentive-title">
|
|
8054
8055
|
${this.incentive.originalIncentiveString}
|
|
@@ -8059,7 +8060,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8059
8060
|
</p>
|
|
8060
8061
|
</div>
|
|
8061
8062
|
</div>
|
|
8062
|
-
`:H``}};
|
|
8063
|
+
`:H``}};Zc.styles=Kc,Xc([pe({type:Object})],Zc.prototype,"incentive",void 0),Zc=Xc([ce("incentive-banner")],Zc);var Jc=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let eh=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=Xi,this.backgroundColor=Zi,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=[Zd],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=ic(),this.leaseTerm=12,this.buildingWebchatView=null,this.incentives=[],this.quote=null,this.pdfUrl=null,this.quoteError=null,this.groupedFees={[Gd.ONE_TIME]:[],[Gd.MONTHLY]:[],[Gd.WEEKLY]:[],[Gd.BI_WEEKLY]:[],[Gd.ANNUALLY]:[],[Gd.DAILY]:[],[Gd.AS_NEEDED]:[],[Gd.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=ya(this.orgSlug,this.buildingSlug).then(e=>{e&&(this.buildingWebchatView=e)}).finally(()=>{this.isLoadingLayouts=!1}),t=Xd(this.buildingSlug).then(e=>{e&&(this.groupedFees=this.groupFees(e.fees),this.maxPets=function(e){const t=e.filter(e=>oc.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 i=t.frequency||Gd.ONE_TIME;return e[i]=[...e[i]||[],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&&(_o("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(Zd)||(e=this.selectedLayoutIds.map(e=>Md(e)));try{if(this.units=await rc({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 i=this.moveInDateString,n=this.selectedUnit.id,r=this.leaseTerm;try{const o=await ec({buildingSlug:this.buildingSlug,unitId:n,chargeInputs:this.chargeInputs,rentableItems:this.desiredRentableItems,leaseTerm:r,moveInDate:i},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&&_o("feeCalculatorQuoteGenerated",{buildingSlug:this.buildingSlug,unitId:n,leaseTerm:r})}catch(e){"AbortError"!==(null==e?void 0:e.name)&&(this.quote=null,this.pdfUrl=null,this.quoteError={type:"unknown"},this.isCalculatingQuote=!1,ra({logType:na.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 i=this.isExporting||this.isCalculatingQuote||!this.selectedUnit||!this.moveInDateString||!this.pdfUrl;return H`
|
|
8063
8064
|
<div
|
|
8064
8065
|
class="fee-calculator-container"
|
|
8065
8066
|
@keydown=${e=>e.stopPropagation()}
|
|
@@ -8141,7 +8142,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8141
8142
|
</div>
|
|
8142
8143
|
`:""}
|
|
8143
8144
|
</div>
|
|
8144
|
-
`}};
|
|
8145
|
+
`}};eh.styles=Fd,Jc([pe({attribute:!0})],eh.prototype,"buildingSlug",void 0),Jc([pe({attribute:!0})],eh.prototype,"orgSlug",void 0),Jc([pe({type:String})],eh.prototype,"primaryColor",void 0),Jc([pe({type:String})],eh.prototype,"backgroundColor",void 0),Jc([pe()],eh.prototype,"onCloseClicked",void 0),Jc([pe()],eh.prototype,"onClickEmailOption",void 0),Jc([pe()],eh.prototype,"onClickPhoneOption",void 0),Jc([pe()],eh.prototype,"onClickSSTOption",void 0),Jc([pe()],eh.prototype,"onClickTextUsOption",void 0),Jc([fe()],eh.prototype,"isCalculatingQuote",void 0),Jc([fe()],eh.prototype,"isLoadingLayouts",void 0),Jc([fe()],eh.prototype,"isExporting",void 0),Jc([fe()],eh.prototype,"selectedLayoutIds",void 0),Jc([fe()],eh.prototype,"selectedUnit",void 0),Jc([fe()],eh.prototype,"chargeInputs",void 0),Jc([fe()],eh.prototype,"desiredRentableItems",void 0),Jc([fe()],eh.prototype,"moveInDateString",void 0),Jc([fe()],eh.prototype,"leaseTerm",void 0),Jc([fe()],eh.prototype,"buildingWebchatView",void 0),Jc([fe()],eh.prototype,"incentives",void 0),Jc([fe()],eh.prototype,"quote",void 0),Jc([fe()],eh.prototype,"pdfUrl",void 0),Jc([fe()],eh.prototype,"quoteError",void 0),Jc([fe()],eh.prototype,"groupedFees",void 0),Jc([fe()],eh.prototype,"rentableItems",void 0),Jc([fe()],eh.prototype,"maxPets",void 0),Jc([fe()],eh.prototype,"units",void 0),Jc([fe()],eh.prototype,"isLoadingUnits",void 0),eh=Jc([ce("fee-calculator")],eh);const th=p`
|
|
8145
8146
|
#minimize-mobile {
|
|
8146
8147
|
position: absolute;
|
|
8147
8148
|
top: -12px;
|
|
@@ -8190,9 +8191,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8190
8191
|
justify-content: center;
|
|
8191
8192
|
align-items: center;
|
|
8192
8193
|
}
|
|
8193
|
-
`,
|
|
8194
|
+
`,ih=(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">
|
|
8194
8195
|
<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}"/>
|
|
8195
|
-
</svg>`,
|
|
8196
|
+
</svg>`,nh=(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">
|
|
8196
8197
|
<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}"/>
|
|
8197
8198
|
<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"/>
|
|
8198
8199
|
<path d="M4.90283 1V2.30742" stroke="${e}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -8200,14 +8201,14 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8200
8201
|
<path d="M0 6.11862H0.00653352C-3.5908e-06 6.15131 0 6.19053 0 6.22322V6.11862Z" fill="white"/>
|
|
8201
8202
|
<path d="M15.689 6.11862V6.22322C15.689 6.19053 15.689 6.15131 15.6825 6.11862H15.689Z" fill="white"/>
|
|
8202
8203
|
<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"/>
|
|
8203
|
-
</svg>`,
|
|
8204
|
+
</svg>`,rh=(e="white")=>z`
|
|
8204
8205
|
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
8205
8206
|
<path
|
|
8206
8207
|
fill-rule="evenodd"
|
|
8207
8208
|
clip-rule="evenodd"
|
|
8208
8209
|
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"
|
|
8209
8210
|
fill="${e}"/>
|
|
8210
|
-
</svg>`,
|
|
8211
|
+
</svg>`,oh=(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">
|
|
8211
8212
|
<g clip-path="url(#clip0_18382_27345)">
|
|
8212
8213
|
<g clip-path="url(#clip1_18382_27345)">
|
|
8213
8214
|
<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"/>
|
|
@@ -8224,7 +8225,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8224
8225
|
</clipPath>
|
|
8225
8226
|
</defs>
|
|
8226
8227
|
</svg>
|
|
8227
|
-
`,
|
|
8228
|
+
`,ah=(e="white",t=20,i=-2)=>z`
|
|
8228
8229
|
<svg
|
|
8229
8230
|
aria-hidden="true"
|
|
8230
8231
|
focusable="false"
|
|
@@ -8299,7 +8300,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8299
8300
|
</clipPath>
|
|
8300
8301
|
</defs>
|
|
8301
8302
|
</svg>
|
|
8302
|
-
`;var
|
|
8303
|
+
`;var sh=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let lh=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=Xi,this.backgroundColor=Zi,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,i,n)=>e?H` <li>
|
|
8303
8304
|
<button
|
|
8304
8305
|
@click=${t}
|
|
8305
8306
|
class="typeMobile-bttn"
|
|
@@ -8315,12 +8316,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8315
8316
|
</button>
|
|
8316
8317
|
</li>`:""}render(){return H`<div class="typeMobile-list">
|
|
8317
8318
|
<ul>
|
|
8318
|
-
${this.renderListElement(!(!this.hasApplyNowEnabled||!this.applicationLink),this.onClickApplyNowOption,
|
|
8319
|
-
${this.renderListElement(this.hasPricingCalculatorEnabled,this.onClickPriceCalculatorOption,
|
|
8320
|
-
${this.renderListElement(this.hasEmailEnabled,this.onClickEmailOption,
|
|
8319
|
+
${this.renderListElement(!(!this.hasApplyNowEnabled||!this.applicationLink),this.onClickApplyNowOption,oh(this.foregroundColorOnSecondaryBackgroundColor),"Apply now")}
|
|
8320
|
+
${this.renderListElement(this.hasPricingCalculatorEnabled,this.onClickPriceCalculatorOption,ah(this.foregroundColorOnSecondaryBackgroundColor),"Price calculator")}
|
|
8321
|
+
${this.renderListElement(this.hasEmailEnabled,this.onClickEmailOption,ih(this.foregroundColorOnSecondaryBackgroundColor),"Email us")}
|
|
8321
8322
|
${this.renderListElement(this.hasCallUsEnabled||this.hasTextUsEnabled,this.onClickPhoneOption,Bu(this.foregroundColorOnSecondaryBackgroundColor),"Call or text us")}
|
|
8322
|
-
${this.renderListElement(this.hasSSTEnabled,this.onClickSSTOption,
|
|
8323
|
-
${this.renderListElement(this.hasChatEnabled&&!this.hideChat,this.onChatTapped,
|
|
8323
|
+
${this.renderListElement(this.hasSSTEnabled,this.onClickSSTOption,nh(this.foregroundColorOnSecondaryBackgroundColor),"Book a tour")}
|
|
8324
|
+
${this.renderListElement(this.hasChatEnabled&&!this.hideChat,this.onChatTapped,rh(this.foregroundColorOnSecondaryBackgroundColor),"Chat with us")}
|
|
8324
8325
|
${this.isMobileDesign||this.hideChat?"":H`
|
|
8325
8326
|
<li>
|
|
8326
8327
|
<minimize-expand-button
|
|
@@ -8332,18 +8333,18 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8332
8333
|
</li>
|
|
8333
8334
|
`}
|
|
8334
8335
|
</ul>
|
|
8335
|
-
</div>`}};
|
|
8336
|
+
</div>`}};lh.styles=[th],sh([pe({attribute:!0})],lh.prototype,"onClickMinimize",void 0),sh([pe({attribute:!0})],lh.prototype,"onClickEmailOption",void 0),sh([pe({attribute:!0})],lh.prototype,"onClickPhoneOption",void 0),sh([pe({attribute:!0})],lh.prototype,"onClickSSTOption",void 0),sh([pe({attribute:!0})],lh.prototype,"onClickApplyNowOption",void 0),sh([pe({attribute:!0})],lh.prototype,"onClickPriceCalculatorOption",void 0),sh([pe({attribute:!0})],lh.prototype,"onChatTapped",void 0),sh([pe({attribute:!0})],lh.prototype,"hideChat",void 0),sh([pe({attribute:!0})],lh.prototype,"isMobileDesign",void 0),sh([pe({attribute:!0})],lh.prototype,"primaryColor",void 0),sh([pe({attribute:!0})],lh.prototype,"backgroundColor",void 0),sh([pe({attribute:!0})],lh.prototype,"hasChatEnabled",void 0),sh([pe({attribute:!0})],lh.prototype,"hasEmailEnabled",void 0),sh([pe({attribute:!0})],lh.prototype,"hasCallUsEnabled",void 0),sh([pe({attribute:!0})],lh.prototype,"hasTextUsEnabled",void 0),sh([pe({attribute:!0})],lh.prototype,"hasSSTEnabled",void 0),sh([pe({attribute:!0})],lh.prototype,"hasApplyNowEnabled",void 0),sh([pe({attribute:!0})],lh.prototype,"hasPricingCalculatorEnabled",void 0),sh([pe({attribute:!0})],lh.prototype,"applicationLink",void 0),sh([pe({attribute:!0})],lh.prototype,"overrideRentgrata",void 0),sh([pe({attribute:!0})],lh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),sh([pe({attribute:!0})],lh.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),lh=sh([ce("mobile-launcher")],lh);const uh=(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">
|
|
8336
8337
|
<path d="M1.31812 7L4.31812 4L1.31811 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8337
|
-
</svg>`;var
|
|
8338
|
+
</svg>`;var dh=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let ch=class extends ue{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Xi,this.toExpand=!1}render(){return H`
|
|
8338
8339
|
<div class=${"button-container"} @click=${this.onClick}>
|
|
8339
8340
|
<div
|
|
8340
8341
|
class="inner-container"
|
|
8341
8342
|
style=${Ki({background:this.primaryColor})}
|
|
8342
8343
|
>
|
|
8343
|
-
${this.toExpand?
|
|
8344
|
+
${this.toExpand?uh("black"):Pd("black")}
|
|
8344
8345
|
</div>
|
|
8345
8346
|
</div>
|
|
8346
|
-
`}};
|
|
8347
|
+
`}};ch.styles=[p`
|
|
8347
8348
|
.button-container {
|
|
8348
8349
|
width: 36px;
|
|
8349
8350
|
height: 36px;
|
|
@@ -8367,11 +8368,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8367
8368
|
.button-container:hover {
|
|
8368
8369
|
filter: brightness(90%);
|
|
8369
8370
|
}
|
|
8370
|
-
`],
|
|
8371
|
+
`],dh([pe({attribute:!0})],ch.prototype,"onClick",void 0),dh([pe({attribute:!0})],ch.prototype,"primaryColor",void 0),dh([pe({attribute:!0})],ch.prototype,"toExpand",void 0),ch=dh([ce("collapse-expand-button")],ch);const hh=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.openWidget()},ph=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.close()},fh=()=>!!window.rentgrata;var gh=i(3950),mh=i.n(gh);const bh=(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">
|
|
8371
8372
|
<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}"/>
|
|
8372
8373
|
<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}"/>
|
|
8373
8374
|
</svg>
|
|
8374
|
-
`;var
|
|
8375
|
+
`;var yh=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let vh=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=()=>{_o("chatOpened",{buildingId:this.buildingId}),this.onChatTapped()},this.onClickMinimize=()=>{},this.onSstClose=mh(),this.overrideRentgrata=!1,this.launcherStyles={},this.primaryColor=Xi,this.backgroundColor=Zi,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(),ph(),_o("emailUsClicked",{buildingId:this.buildingId}),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.onClickPhoneOption=e=>{e.preventDefault(),e.stopPropagation(),ph(),_o("callTextUsClicked",{buildingId:this.buildingId}),this.isCallUsWindowOpen=!0},this.onClickApplyNowOption=e=>{e.preventDefault(),e.stopPropagation(),ph(),_o("applyNowClicked",{buildingId:this.buildingId,applicationLink:this.applicationLink}),window.open(this.applicationLink,"_blank")},this.onClickPriceCalculatorOption=e=>{e.preventDefault(),e.stopPropagation(),ph(),_o("feeCalculatorOpened",{buildingId:this.buildingId}),this.isCalculatorWindowOpen=!0},this.onClosePhoneWindow=()=>{this.isCallUsWindowOpen=!1},this.onClickSSTOption=e=>{e.preventDefault(),e.stopPropagation(),ph(),_o("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===fa.MINIMIZED?H` ${this.hasHideMobileFeatures&&this._isMobile?H`<collapse-expand-button
|
|
8375
8376
|
.toExpand=${this.isMobileFeaturesExpanded}
|
|
8376
8377
|
.primaryColor=${this.primaryColor}
|
|
8377
8378
|
.onClick=${this.toggleMobileFeatures}
|
|
@@ -8406,7 +8407,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8406
8407
|
>
|
|
8407
8408
|
<div class="type-hey__pill-left">
|
|
8408
8409
|
<div class="type-hey__icon">
|
|
8409
|
-
${
|
|
8410
|
+
${ih(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8410
8411
|
</div>
|
|
8411
8412
|
<div
|
|
8412
8413
|
style=${Ki({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -8415,7 +8416,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8415
8416
|
</div>
|
|
8416
8417
|
</div>
|
|
8417
8418
|
<div class="type-gradient__icon">
|
|
8418
|
-
${
|
|
8419
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8419
8420
|
</div>
|
|
8420
8421
|
</button>`:null},{pillKey:"SST",pill:this.hasSSTEnabledDesktop?H`
|
|
8421
8422
|
<button
|
|
@@ -8426,7 +8427,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8426
8427
|
>
|
|
8427
8428
|
<div class="type-hey__pill-left">
|
|
8428
8429
|
<div class="type-hey__icon">
|
|
8429
|
-
${
|
|
8430
|
+
${nh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8430
8431
|
</div>
|
|
8431
8432
|
<div
|
|
8432
8433
|
style=${Ki({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -8435,7 +8436,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8435
8436
|
</div>
|
|
8436
8437
|
</div>
|
|
8437
8438
|
<div class="type-gradient__icon">
|
|
8438
|
-
${
|
|
8439
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8439
8440
|
</div>
|
|
8440
8441
|
</button>
|
|
8441
8442
|
`:null},{pillKey:"Phone",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?H`
|
|
@@ -8459,7 +8460,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8459
8460
|
</div>
|
|
8460
8461
|
</div>
|
|
8461
8462
|
<div class="type-gradient__icon">
|
|
8462
|
-
${
|
|
8463
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8463
8464
|
</div>
|
|
8464
8465
|
</button>
|
|
8465
8466
|
`:null},{pillKey:"Apply",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?H`
|
|
@@ -8471,7 +8472,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8471
8472
|
>
|
|
8472
8473
|
<div class="type-hey__pill-left">
|
|
8473
8474
|
<div class="type-hey__icon">
|
|
8474
|
-
${
|
|
8475
|
+
${oh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8475
8476
|
</div>
|
|
8476
8477
|
<div
|
|
8477
8478
|
class="vertical-pill-title"
|
|
@@ -8482,7 +8483,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8482
8483
|
</div>
|
|
8483
8484
|
</div>
|
|
8484
8485
|
<div class="type-gradient__icon">
|
|
8485
|
-
${
|
|
8486
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8486
8487
|
</div>
|
|
8487
8488
|
</button>
|
|
8488
8489
|
`:null},{pillKey:"Price Calculator",pill:this.hasPricingCalculatorEnabledDesktop?H`
|
|
@@ -8494,7 +8495,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8494
8495
|
>
|
|
8495
8496
|
<div class="type-hey__pill-left">
|
|
8496
8497
|
<div class="type-hey__icon">
|
|
8497
|
-
${
|
|
8498
|
+
${ah(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8498
8499
|
</div>
|
|
8499
8500
|
<div
|
|
8500
8501
|
style=${Ki({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -8503,7 +8504,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8503
8504
|
</div>
|
|
8504
8505
|
</div>
|
|
8505
8506
|
<div class="type-gradient__icon">
|
|
8506
|
-
${
|
|
8507
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8507
8508
|
</div>
|
|
8508
8509
|
</button>
|
|
8509
8510
|
`:null}].filter(e=>!!e.pill);return H`
|
|
@@ -8545,7 +8546,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8545
8546
|
>
|
|
8546
8547
|
<div class="type-hey__pill-left">
|
|
8547
8548
|
<div class="type-hey__icon">
|
|
8548
|
-
${
|
|
8549
|
+
${rh(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8549
8550
|
</div>
|
|
8550
8551
|
<div
|
|
8551
8552
|
style=${Ki({color:this.foregroundColorOnPrimaryBackgroundColor})}
|
|
@@ -8554,7 +8555,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8554
8555
|
</div>
|
|
8555
8556
|
</div>
|
|
8556
8557
|
<div class="type-gradient__icon">
|
|
8557
|
-
${
|
|
8558
|
+
${uh(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8558
8559
|
</div>
|
|
8559
8560
|
</button>
|
|
8560
8561
|
`:""}
|
|
@@ -8566,15 +8567,15 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8566
8567
|
>
|
|
8567
8568
|
<div class="type-hey__botton-section-pills">
|
|
8568
8569
|
${e.map(e=>e.pill)}
|
|
8569
|
-
${this.overrideRentgrata&&
|
|
8570
|
+
${this.overrideRentgrata&&fh()?H` <button
|
|
8570
8571
|
class="type-hey__pill"
|
|
8571
|
-
@click=${()=>{
|
|
8572
|
+
@click=${()=>{hh()}}
|
|
8572
8573
|
style=${Ki({background:this.backgroundColor})}
|
|
8573
8574
|
aria-label="Contact a resident"
|
|
8574
8575
|
>
|
|
8575
8576
|
<div class="type-hey__pill-left">
|
|
8576
8577
|
<div class="type-hey__icon">
|
|
8577
|
-
${
|
|
8578
|
+
${bh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8578
8579
|
</div>
|
|
8579
8580
|
<div
|
|
8580
8581
|
style=${Ki({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -8583,7 +8584,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8583
8584
|
</div>
|
|
8584
8585
|
</div>
|
|
8585
8586
|
<div class="type-gradient__icon">
|
|
8586
|
-
${
|
|
8587
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8587
8588
|
</div>
|
|
8588
8589
|
</button>`:""}
|
|
8589
8590
|
</div>
|
|
@@ -8605,7 +8606,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8605
8606
|
>
|
|
8606
8607
|
<div class="vertical-pill-left">
|
|
8607
8608
|
<div class="vertical-pill-icon">
|
|
8608
|
-
${
|
|
8609
|
+
${rh(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8609
8610
|
</div>
|
|
8610
8611
|
<div
|
|
8611
8612
|
class="vertical-pill-title"
|
|
@@ -8615,7 +8616,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8615
8616
|
</div>
|
|
8616
8617
|
</div>
|
|
8617
8618
|
<div class="chevron-right">
|
|
8618
|
-
${
|
|
8619
|
+
${uh(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8619
8620
|
</div>
|
|
8620
8621
|
</button>
|
|
8621
8622
|
`:null},{pillKey:"Price Calculator",pill:this.hasPricingCalculatorEnabledDesktop?H`
|
|
@@ -8627,7 +8628,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8627
8628
|
>
|
|
8628
8629
|
<div class="vertical-pill-left">
|
|
8629
8630
|
<div class="vertical-pill-icon">
|
|
8630
|
-
${
|
|
8631
|
+
${ah(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8631
8632
|
</div>
|
|
8632
8633
|
<div
|
|
8633
8634
|
class="vertical-pill-title"
|
|
@@ -8637,7 +8638,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8637
8638
|
</div>
|
|
8638
8639
|
</div>
|
|
8639
8640
|
<div class="chevron-right">
|
|
8640
|
-
${
|
|
8641
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8641
8642
|
</div>
|
|
8642
8643
|
</button>
|
|
8643
8644
|
`:null},{pillKey:"SST",pill:this.hasSSTEnabledDesktop?H`
|
|
@@ -8650,7 +8651,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8650
8651
|
>
|
|
8651
8652
|
<div class="vertical-pill-left">
|
|
8652
8653
|
<div class="vertical-pill-icon">
|
|
8653
|
-
${
|
|
8654
|
+
${nh(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8654
8655
|
</div>
|
|
8655
8656
|
<div
|
|
8656
8657
|
class="vertical-pill-title"
|
|
@@ -8661,7 +8662,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8661
8662
|
</div>
|
|
8662
8663
|
</div>
|
|
8663
8664
|
<div class="chevron-right">
|
|
8664
|
-
${
|
|
8665
|
+
${uh(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8665
8666
|
</div>
|
|
8666
8667
|
</button>
|
|
8667
8668
|
`:null},{pillKey:"Email",pill:this.hasEmailEnabledDesktop?H`
|
|
@@ -8673,7 +8674,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8673
8674
|
>
|
|
8674
8675
|
<div class="vertical-pill-left">
|
|
8675
8676
|
<div class="vertical-pill-icon">
|
|
8676
|
-
${
|
|
8677
|
+
${ih(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8677
8678
|
</div>
|
|
8678
8679
|
<div
|
|
8679
8680
|
class="vertical-pill-title"
|
|
@@ -8684,7 +8685,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8684
8685
|
</div>
|
|
8685
8686
|
</div>
|
|
8686
8687
|
<div class="chevron-right">
|
|
8687
|
-
${
|
|
8688
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8688
8689
|
</div>
|
|
8689
8690
|
</button>
|
|
8690
8691
|
`:null},{pillKey:"Phone",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?H`
|
|
@@ -8725,7 +8726,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8725
8726
|
`:""}
|
|
8726
8727
|
</div>
|
|
8727
8728
|
<div class="chevron-right">
|
|
8728
|
-
${
|
|
8729
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8729
8730
|
</div>
|
|
8730
8731
|
</button>
|
|
8731
8732
|
`:null},{pillKey:"Apply",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?H`
|
|
@@ -8737,7 +8738,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8737
8738
|
>
|
|
8738
8739
|
<div class="vertical-pill-left">
|
|
8739
8740
|
<div class="vertical-pill-icon">
|
|
8740
|
-
${
|
|
8741
|
+
${oh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8741
8742
|
</div>
|
|
8742
8743
|
<div
|
|
8743
8744
|
class="vertical-pill-title"
|
|
@@ -8748,7 +8749,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8748
8749
|
</div>
|
|
8749
8750
|
</div>
|
|
8750
8751
|
<div class="chevron-right">
|
|
8751
|
-
${
|
|
8752
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8752
8753
|
</div>
|
|
8753
8754
|
</button>
|
|
8754
8755
|
`:null}].filter(e=>!!e.pill);if(e){const e=t.findIndex(e=>"SST"===e.pillKey);if(-1!==e){const[i]=t.splice(e,1);t.unshift(i)}}return H`
|
|
@@ -8756,16 +8757,16 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8756
8757
|
<nav aria-label="EliseAI options">
|
|
8757
8758
|
<ul class="vertical-pill-list__items" role="list">
|
|
8758
8759
|
${t.map(e=>H`<li>${e.pill}</li>`)}
|
|
8759
|
-
${this.overrideRentgrata&&
|
|
8760
|
+
${this.overrideRentgrata&&fh()?H`<li>
|
|
8760
8761
|
<button
|
|
8761
|
-
@click=${()=>{
|
|
8762
|
+
@click=${()=>{hh()}}
|
|
8762
8763
|
class="inner-pill-wrapper"
|
|
8763
8764
|
style=${Ki({background:this.backgroundColor})}
|
|
8764
8765
|
aria-label="Contact a resident"
|
|
8765
8766
|
>
|
|
8766
8767
|
<div class="vertical-pill-left">
|
|
8767
8768
|
<div class="vertical-pill-icon">
|
|
8768
|
-
${
|
|
8769
|
+
${bh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8769
8770
|
</div>
|
|
8770
8771
|
<div
|
|
8771
8772
|
class="vertical-pill-title"
|
|
@@ -8776,7 +8777,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8776
8777
|
</div>
|
|
8777
8778
|
</div>
|
|
8778
8779
|
<div class="chevron-right">
|
|
8779
|
-
${
|
|
8780
|
+
${uh(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
8780
8781
|
</div>
|
|
8781
8782
|
</button>
|
|
8782
8783
|
</li>`:""}
|
|
@@ -8787,7 +8788,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8787
8788
|
class="minimize-button"
|
|
8788
8789
|
aria-label="Minimize EliseAI widget"
|
|
8789
8790
|
>
|
|
8790
|
-
<div class="chevron-down">${
|
|
8791
|
+
<div class="chevron-down">${uh("black")}</div>
|
|
8791
8792
|
</button>`:""}
|
|
8792
8793
|
</div>
|
|
8793
8794
|
`}}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",Lu),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",zu),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`
|
|
@@ -8939,11 +8940,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8939
8940
|
`:""}
|
|
8940
8941
|
${this.isCallToActionWindowOpen()||this.showTourNextToChat?"":this.renderActionPills()}
|
|
8941
8942
|
</div>
|
|
8942
|
-
`}};
|
|
8943
|
+
`}};vh.styles=p`
|
|
8943
8944
|
${Eu}
|
|
8944
8945
|
${_u}
|
|
8945
8946
|
${Ou}
|
|
8946
|
-
`,mh([pe({attribute:!0})],bh.prototype,"isMinimized",void 0),mh([pe()],bh.prototype,"mobileStyles",void 0),mh([pe({type:Boolean})],bh.prototype,"isFirstMount",void 0),mh([pe({attribute:!1})],bh.prototype,"openSSTWindowOnLoad",void 0),mh([pe({attribute:!1})],bh.prototype,"autoOpenChatWidget",void 0),mh([pe()],bh.prototype,"phoneNumber",void 0),mh([pe({attribute:!0})],bh.prototype,"buildingName",void 0),mh([pe({attribute:!0})],bh.prototype,"chatId",void 0),mh([pe({attribute:!0})],bh.prototype,"orgLegalName",void 0),mh([pe({attribute:!1})],bh.prototype,"country",void 0),mh([pe({attribute:!1})],bh.prototype,"buildingState",void 0),mh([pe({attribute:!0})],bh.prototype,"chatCallUsHeader",void 0),mh([pe({attribute:!1})],bh.prototype,"buildingId",void 0),mh([pe({type:Number})],bh.prototype,"orgId",void 0),mh([pe({attribute:!1})],bh.prototype,"leadSourceParams",void 0),mh([pe({attribute:!0})],bh.prototype,"buildingSlug",void 0),mh([pe({attribute:!0})],bh.prototype,"orgSlug",void 0),mh([pe({attribute:!0})],bh.prototype,"sgtUrl",void 0),mh([pe({attribute:!0})],bh.prototype,"selfGuidedTourEnabled",void 0),mh([pe({attribute:!0})],bh.prototype,"selfGuidedToursTypeOffered",void 0),mh([pe({attribute:!0})],bh.prototype,"designConcept",void 0),mh([pe({attribute:!0})],bh.prototype,"featureFlagShowDropdown",void 0),mh([pe({attribute:!1})],bh.prototype,"leadSources",void 0),mh([pe({attribute:!0})],bh.prototype,"currentLeadSource",void 0),mh([pe({attribute:!0})],bh.prototype,"escortedToursLink",void 0),mh([pe({attribute:!0})],bh.prototype,"escortedToursTypeOffered",void 0),mh([pe({attribute:!0})],bh.prototype,"virtualToursLink",void 0),mh([pe({attribute:!0})],bh.prototype,"virtualToursTypeOffered",void 0),mh([pe({type:Boolean})],bh.prototype,"hasChatEnabledDesktop",void 0),mh([pe({type:Boolean})],bh.prototype,"hasChatEnabledMobile",void 0),mh([pe({type:Boolean})],bh.prototype,"hasEmailEnabledDesktop",void 0),mh([pe({type:Boolean})],bh.prototype,"hasEmailEnabledMobile",void 0),mh([pe({attribute:!0})],bh.prototype,"hasApplyNowEnabledDesktop",void 0),mh([pe({attribute:!0})],bh.prototype,"hasApplyNowEnabledMobile",void 0),mh([pe({attribute:!0})],bh.prototype,"applicationLink",void 0),mh([pe({type:Boolean})],bh.prototype,"hasCallUsEnabledDesktop",void 0),mh([pe({type:Boolean})],bh.prototype,"hasCallUsEnabledMobile",void 0),mh([pe({type:Boolean})],bh.prototype,"hasTextUsEnabledDesktop",void 0),mh([pe({type:Boolean})],bh.prototype,"hasTextUsEnabledMobile",void 0),mh([pe({type:Boolean})],bh.prototype,"hasSSTEnabledDesktop",void 0),mh([pe({type:Boolean})],bh.prototype,"hasSSTEnabledMobile",void 0),mh([pe({attribute:!1})],bh.prototype,"tourTypeOptions",void 0),mh([pe({attribute:!1})],bh.prototype,"layoutOptions",void 0),mh([pe({attribute:!0})],bh.prototype,"bedroomPreferenceRequired",void 0),mh([pe({attribute:!1})],bh.prototype,"brokerIntakeEnabled",void 0),mh([pe({attribute:!1})],bh.prototype,"tourSchedulerV2",void 0),mh([pe({attribute:!1})],bh.prototype,"getSessionToken",void 0),mh([pe({attribute:!0})],bh.prototype,"hasDynamicSchedulingEnabled",void 0),mh([pe({attribute:!0})],bh.prototype,"hasPricingCalculatorEnabledDesktop",void 0),mh([pe({attribute:!0})],bh.prototype,"hasPricingCalculatorEnabledMobile",void 0),mh([pe({attribute:!1})],bh.prototype,"hasHideMobileFeatures",void 0),mh([pe({type:Number})],bh.prototype,"right",void 0),mh([pe({type:Number})],bh.prototype,"bottom",void 0),mh([pe({type:Number})],bh.prototype,"top",void 0),mh([pe({type:Number})],bh.prototype,"left",void 0),mh([pe({attribute:!0})],bh.prototype,"showTourNextToChat",void 0),mh([pe({attribute:!1})],bh.prototype,"onChatTapped",void 0),mh([pe({attribute:!0})],bh.prototype,"onClickMinimize",void 0),mh([pe({attribute:!0})],bh.prototype,"onSstClose",void 0),mh([pe({attribute:!0})],bh.prototype,"overrideRentgrata",void 0),mh([pe({attribute:!1})],bh.prototype,"launcherStyles",void 0),mh([pe({attribute:!0})],bh.prototype,"primaryColor",void 0),mh([pe({attribute:!0})],bh.prototype,"backgroundColor",void 0),mh([pe({attribute:!0})],bh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),mh([pe({attribute:!0})],bh.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),mh([pe({attribute:!0})],bh.prototype,"leadSourceClient",void 0),mh([fe()],bh.prototype,"leadSourceMultitouchClient",void 0),mh([fe()],bh.prototype,"_isMobile",void 0),mh([fe()],bh.prototype,"isEmailWindowOpen",void 0),mh([fe()],bh.prototype,"isCallUsWindowOpen",void 0),mh([fe()],bh.prototype,"isSSTWindowOpen",void 0),mh([fe()],bh.prototype,"isTextUsWindowOpen",void 0),mh([fe()],bh.prototype,"isCalculatorWindowOpen",void 0),mh([fe()],bh.prototype,"isMobileFeaturesExpanded",void 0),bh=mh([ce("meetelise-launcher")],bh);const yh=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",bh)},vh=["app.meetelise.com","staging.eliseai.com","localhost"],wh={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"}},Ch=e=>{const t=window.location.hostname;if(!vh.includes(t))return e;const i=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[i,n]=t.split(":");return i&&n&&i in wh&&(e[i]="true"===n.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(i).length)return e;const n={...e};return Object.entries(i).forEach(([e,t])=>{const i=wh[e];i&&(n[i.desktop]=t,n[i.mobile]=t)}),n};var xh=i(5072),$h=i.n(xh),Sh=i(7825),kh=i.n(Sh),Ah=i(7659),Th=i.n(Ah),Eh=i(5056),_h=i.n(Eh),Oh=i(540),Ph=i.n(Oh),Ih=i(1113),Nh=i.n(Ih),Mh=i(5541),Dh={};Dh.styleTagTransform=Nh(),Dh.setAttributes=_h(),Dh.insert=Th().bind(null,"head"),Dh.domAPI=kh(),Dh.insertStyleElement=Ph();$h()(Mh.A,Dh);Mh.A&&Mh.A.locals&&Mh.A.locals;async function Lh(e,t){try{const i=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(i.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return i.data.filter(t=>e.includes(t))}return Rh(i.data,t)}return[]}catch(e){return[]}}const Rh=(e,t)=>{let i=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":i=["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":i=["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:i=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!i.map(e=>e.toLowerCase()).includes(t)})};async function Bh(e){var t,i;if(!e)return!1;try{return null!==(i=null===(t=(await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/aip`)).data)||void 0===t?void 0:t.is_aip)&&void 0!==i&&i}catch(e){return!1}}const Uh=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"]),jh=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return Uh.has(t)},Fh=(e,t,i)=>{try{const n=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${n}`,o=`sms:${n}`,a=`whatsapp://send?phone=${n}`,s=`facetime:${n}`,l=`facetime-audio:${n}`,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,i,n,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(i=e.nextElementSibling)||void 0===i?void 0:i.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(n=o.previousElementSibling)||void 0===n?void 0:n.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},b=document.body.getElementsByTagName("*");let y=!1;const v=n.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 i=t.replace(u,e=>{if(jh(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==i&&(x++,b[e].textContent=i),y=!0,w||(w=!0)}if(b[e].hasAttribute("href")){const t=b[e].getAttribute("href");if(!t)continue;let i="",n=d;if(t.startsWith("sms:")?i=o:t.startsWith("whatsapp:")?(i=a,n=c):t.startsWith("facetime:")?(i=s,n=h):t.startsWith("facetime-audio:")?(i=l,n=h):i=r,jh(t))continue;const u=t.replace(n,i);if(b[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==i){t.replace(/\D/g,"").length>=7&&b[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&ra({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:na.info,buildingSlug:i,orgSlug:t}),C&&ra({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:na.info,buildingSlug:i,orgSlug:t}),y||ra({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:na.warn,buildingSlug:i,orgSlug:t}),x}catch(e){return ra({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:na.error,buildingSlug:i,orgSlug:t,error:e}),0}},Hh=(e,t,i,n)=>{document.querySelectorAll("a").forEach(function(r){const o=r.getAttribute("href");o&&o.startsWith("https://app.meetelise.com/")&&((e,t,i)=>{const[n,r,o,...a]=new URL(e).pathname.split("/").filter(Boolean).map(e=>e.toLowerCase());return 0===a.length&&"tour"===o&&n===t.toLowerCase()&&r===i.toLowerCase()})(o,t,i)&&r.addEventListener("click",t=>{n()&&(t.preventDefault(),e(t))})})};var zh=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Gh=class extends ue{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Xi,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return H`
|
|
8947
|
+
`,yh([pe({attribute:!0})],vh.prototype,"isMinimized",void 0),yh([pe()],vh.prototype,"mobileStyles",void 0),yh([pe({type:Boolean})],vh.prototype,"isFirstMount",void 0),yh([pe({attribute:!1})],vh.prototype,"openSSTWindowOnLoad",void 0),yh([pe({attribute:!1})],vh.prototype,"autoOpenChatWidget",void 0),yh([pe()],vh.prototype,"phoneNumber",void 0),yh([pe({attribute:!0})],vh.prototype,"buildingName",void 0),yh([pe({attribute:!0})],vh.prototype,"chatId",void 0),yh([pe({attribute:!0})],vh.prototype,"orgLegalName",void 0),yh([pe({attribute:!1})],vh.prototype,"country",void 0),yh([pe({attribute:!1})],vh.prototype,"buildingState",void 0),yh([pe({attribute:!0})],vh.prototype,"chatCallUsHeader",void 0),yh([pe({attribute:!1})],vh.prototype,"buildingId",void 0),yh([pe({type:Number})],vh.prototype,"orgId",void 0),yh([pe({attribute:!1})],vh.prototype,"leadSourceParams",void 0),yh([pe({attribute:!0})],vh.prototype,"buildingSlug",void 0),yh([pe({attribute:!0})],vh.prototype,"orgSlug",void 0),yh([pe({attribute:!0})],vh.prototype,"sgtUrl",void 0),yh([pe({attribute:!0})],vh.prototype,"selfGuidedTourEnabled",void 0),yh([pe({attribute:!0})],vh.prototype,"selfGuidedToursTypeOffered",void 0),yh([pe({attribute:!0})],vh.prototype,"designConcept",void 0),yh([pe({attribute:!0})],vh.prototype,"featureFlagShowDropdown",void 0),yh([pe({attribute:!1})],vh.prototype,"leadSources",void 0),yh([pe({attribute:!0})],vh.prototype,"currentLeadSource",void 0),yh([pe({attribute:!0})],vh.prototype,"escortedToursLink",void 0),yh([pe({attribute:!0})],vh.prototype,"escortedToursTypeOffered",void 0),yh([pe({attribute:!0})],vh.prototype,"virtualToursLink",void 0),yh([pe({attribute:!0})],vh.prototype,"virtualToursTypeOffered",void 0),yh([pe({type:Boolean})],vh.prototype,"hasChatEnabledDesktop",void 0),yh([pe({type:Boolean})],vh.prototype,"hasChatEnabledMobile",void 0),yh([pe({type:Boolean})],vh.prototype,"hasEmailEnabledDesktop",void 0),yh([pe({type:Boolean})],vh.prototype,"hasEmailEnabledMobile",void 0),yh([pe({attribute:!0})],vh.prototype,"hasApplyNowEnabledDesktop",void 0),yh([pe({attribute:!0})],vh.prototype,"hasApplyNowEnabledMobile",void 0),yh([pe({attribute:!0})],vh.prototype,"applicationLink",void 0),yh([pe({type:Boolean})],vh.prototype,"hasCallUsEnabledDesktop",void 0),yh([pe({type:Boolean})],vh.prototype,"hasCallUsEnabledMobile",void 0),yh([pe({type:Boolean})],vh.prototype,"hasTextUsEnabledDesktop",void 0),yh([pe({type:Boolean})],vh.prototype,"hasTextUsEnabledMobile",void 0),yh([pe({type:Boolean})],vh.prototype,"hasSSTEnabledDesktop",void 0),yh([pe({type:Boolean})],vh.prototype,"hasSSTEnabledMobile",void 0),yh([pe({attribute:!1})],vh.prototype,"tourTypeOptions",void 0),yh([pe({attribute:!1})],vh.prototype,"layoutOptions",void 0),yh([pe({attribute:!0})],vh.prototype,"bedroomPreferenceRequired",void 0),yh([pe({attribute:!1})],vh.prototype,"brokerIntakeEnabled",void 0),yh([pe({attribute:!1})],vh.prototype,"tourSchedulerV2",void 0),yh([pe({attribute:!1})],vh.prototype,"getSessionToken",void 0),yh([pe({attribute:!0})],vh.prototype,"hasDynamicSchedulingEnabled",void 0),yh([pe({attribute:!0})],vh.prototype,"hasPricingCalculatorEnabledDesktop",void 0),yh([pe({attribute:!0})],vh.prototype,"hasPricingCalculatorEnabledMobile",void 0),yh([pe({attribute:!1})],vh.prototype,"hasHideMobileFeatures",void 0),yh([pe({type:Number})],vh.prototype,"right",void 0),yh([pe({type:Number})],vh.prototype,"bottom",void 0),yh([pe({type:Number})],vh.prototype,"top",void 0),yh([pe({type:Number})],vh.prototype,"left",void 0),yh([pe({attribute:!0})],vh.prototype,"showTourNextToChat",void 0),yh([pe({attribute:!1})],vh.prototype,"onChatTapped",void 0),yh([pe({attribute:!0})],vh.prototype,"onClickMinimize",void 0),yh([pe({attribute:!0})],vh.prototype,"onSstClose",void 0),yh([pe({attribute:!0})],vh.prototype,"overrideRentgrata",void 0),yh([pe({attribute:!1})],vh.prototype,"launcherStyles",void 0),yh([pe({attribute:!0})],vh.prototype,"primaryColor",void 0),yh([pe({attribute:!0})],vh.prototype,"backgroundColor",void 0),yh([pe({attribute:!0})],vh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),yh([pe({attribute:!0})],vh.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),yh([pe({attribute:!0})],vh.prototype,"leadSourceClient",void 0),yh([fe()],vh.prototype,"leadSourceMultitouchClient",void 0),yh([fe()],vh.prototype,"_isMobile",void 0),yh([fe()],vh.prototype,"isEmailWindowOpen",void 0),yh([fe()],vh.prototype,"isCallUsWindowOpen",void 0),yh([fe()],vh.prototype,"isSSTWindowOpen",void 0),yh([fe()],vh.prototype,"isTextUsWindowOpen",void 0),yh([fe()],vh.prototype,"isCalculatorWindowOpen",void 0),yh([fe()],vh.prototype,"isMobileFeaturesExpanded",void 0),vh=yh([ce("meetelise-launcher")],vh);const wh=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",vh)},Ch=["app.meetelise.com","staging.eliseai.com","localhost"],xh={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"}},$h=e=>{const t=window.location.hostname;if(!Ch.includes(t))return e;const i=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[i,n]=t.split(":");return i&&n&&i in xh&&(e[i]="true"===n.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(i).length)return e;const n={...e};return Object.entries(i).forEach(([e,t])=>{const i=xh[e];i&&(n[i.desktop]=t,n[i.mobile]=t)}),n};var Sh=i(5072),kh=i.n(Sh),Ah=i(7825),Th=i.n(Ah),Eh=i(7659),_h=i.n(Eh),Oh=i(5056),Ph=i.n(Oh),Ih=i(540),Nh=i.n(Ih),Mh=i(1113),Dh=i.n(Mh),Lh=i(5541),Rh={};Rh.styleTagTransform=Dh(),Rh.setAttributes=Ph(),Rh.insert=_h().bind(null,"head"),Rh.domAPI=Th(),Rh.insertStyleElement=Nh();kh()(Lh.A,Rh);Lh.A&&Lh.A.locals&&Lh.A.locals;async function Bh(e,t){try{const i=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(i.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return i.data.filter(t=>e.includes(t))}return Uh(i.data,t)}return[]}catch(e){return[]}}const Uh=(e,t)=>{let i=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":i=["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":i=["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:i=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!i.map(e=>e.toLowerCase()).includes(t)})};async function jh(e){var t,i;if(!e)return!1;try{return null!==(i=null===(t=(await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/aip`)).data)||void 0===t?void 0:t.is_aip)&&void 0!==i&&i}catch(e){return!1}}const Fh=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"]),Hh=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return Fh.has(t)},zh=(e,t,i)=>{try{const n=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${n}`,o=`sms:${n}`,a=`whatsapp://send?phone=${n}`,s=`facetime:${n}`,l=`facetime-audio:${n}`,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,i,n,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(i=e.nextElementSibling)||void 0===i?void 0:i.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(n=o.previousElementSibling)||void 0===n?void 0:n.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},b=document.body.getElementsByTagName("*");let y=!1;const v=n.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 i=t.replace(u,e=>{if(Hh(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==i&&(x++,b[e].textContent=i),y=!0,w||(w=!0)}if(b[e].hasAttribute("href")){const t=b[e].getAttribute("href");if(!t)continue;let i="",n=d;if(t.startsWith("sms:")?i=o:t.startsWith("whatsapp:")?(i=a,n=c):t.startsWith("facetime:")?(i=s,n=h):t.startsWith("facetime-audio:")?(i=l,n=h):i=r,Hh(t))continue;const u=t.replace(n,i);if(b[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==i){t.replace(/\D/g,"").length>=7&&b[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&ra({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:na.info,buildingSlug:i,orgSlug:t}),C&&ra({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:na.info,buildingSlug:i,orgSlug:t}),y||ra({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:na.warn,buildingSlug:i,orgSlug:t}),x}catch(e){return ra({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:na.error,buildingSlug:i,orgSlug:t,error:e}),0}},Gh=(e,t,i,n)=>{document.querySelectorAll("a").forEach(function(r){const o=r.getAttribute("href");o&&o.startsWith("https://app.meetelise.com/")&&((e,t,i)=>{const[n,r,o,...a]=new URL(e).pathname.split("/").filter(Boolean).map(e=>e.toLowerCase());return 0===a.length&&"tour"===o&&n===t.toLowerCase()&&r===i.toLowerCase()})(o,t,i)&&r.addEventListener("click",t=>{n()&&(t.preventDefault(),e(t))})})};var Vh=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let Wh=class extends ue{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Xi,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return H`
|
|
8947
8948
|
<button
|
|
8948
8949
|
class=${this.toExpand?"button-container mini":"button-container"}
|
|
8949
8950
|
@click=${this.onClick}
|
|
@@ -8954,13 +8955,13 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8954
8955
|
style=${Ki({background:this.primaryColor})}
|
|
8955
8956
|
>
|
|
8956
8957
|
${this.toExpand?H`<div class="chevron-up">
|
|
8957
|
-
${
|
|
8958
|
+
${uh(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8958
8959
|
</div>`:H` <div class="x-icon">
|
|
8959
8960
|
${Kl(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
8960
8961
|
</div>`}
|
|
8961
8962
|
</div>
|
|
8962
8963
|
</button>
|
|
8963
|
-
`}};
|
|
8964
|
+
`}};Wh.styles=[p`
|
|
8964
8965
|
.button-container {
|
|
8965
8966
|
width: 56px;
|
|
8966
8967
|
height: 56px;
|
|
@@ -9010,7 +9011,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9010
9011
|
cursor: pointer;
|
|
9011
9012
|
filter: brightness(90%);
|
|
9012
9013
|
}
|
|
9013
|
-
`],zh([pe({attribute:!0})],Gh.prototype,"onClick",void 0),zh([pe({attribute:!0})],Gh.prototype,"primaryColor",void 0),zh([pe({attribute:!0})],Gh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),zh([pe({attribute:!0})],Gh.prototype,"toExpand",void 0),Gh=zh([ce("minimize-expand-button")],Gh);const Vh="cdn.skypack.dev/@meetelise/chat",Wh="cdn.eliseai.com/@meetelise/chat",Qh=async(e,t)=>{try{if(Math.random()>=.15)return;const i=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",i=t.textContent||"";if(e.includes(Vh)||i.includes(Vh))return"skypack";if(e.includes(Wh)||i.includes(Wh))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:i},{params:{cdn_version:i},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},qh=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,Yh={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},Kh="https://applications.eliseai.com",Xh=["Check Availability","Apply Now"],Zh=(e,t,i,n)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const i=e.getElementsByTagName("span");if(1!==i.length)return!1;const n=null===(t=i[0].textContent)||void 0===t?void 0:t.trim();return null!=n&&Xh.includes(n)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),ra({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:na.info,buildingSlug:n,orgSlug:i}),!0},Jh=(e,t,i,n)=>{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&&Zh(a,t,i,n);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)Zh(s[e],t,i,n)}},ep=(e,t,i)=>{((e,t,i)=>{const n=document.body.getElementsByTagName("a");for(let r=0;r<n.length;r++)Zh(n[r],e,t,i)})(i,e,t);new MutationObserver(n=>{for(const r of n)Jh(r.addedNodes,i,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class tp{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=$o();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(ia()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),i=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(i,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(i,JSON.stringify(t));ra({logType:na.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),i=la(this.orgSlug);if(!t){const t=[{leadSourceValue:i,timestampInitiallyLogged:Fr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),t}const n=t.leadSources.length>0?t.leadSources.sort((e,t)=>Yr(e.timestampInitiallyLogged).getTime()-Yr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Fr(new Date),r=[{timestampInitiallyLogged:n,leadSourceValue:i,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 ip=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let np=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=vp.Default,this.onWidgetLoaded=fh(),this.onSstClose=fh(),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.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 i=this.centralConvo?await async function(e){const t=`https://app.meetelise.com/api/pub/v1/organization/${e}/webchat/v2`,i=await r().get(t);return va(i.data)}(this.orgSlug):await ya(this.orgSlug,this.buildingSlug);if(!this.isOrgMode()){if(Math.random()<.2)try{(async(e,t)=>{const i=window.rentgrata;if(!i)return;const n=i.Widget;if(!n)return;const o=n.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{Qh(this.orgSlug,this.buildingSlug)}catch(e){}}if(!await Tu(i,this.buildingSlug,this.orgSlug))return;oa({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==i?void 0:i.launchedDateTime)?.01:.05}),this.buildingWebchatView=i;const n=(()=>{try{const e="true"===sessionStorage.getItem(Cs);return sessionStorage.removeItem(Cs),e}catch{return!1}})();await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),(e=>{const t=new URLSearchParams(window.location.search),i=t.get("rwg_token"),n=t.get("elise_google_env");if(!i||!n||!e)return;const r={rwgToken:i,environment:n,buildingId:e,expiresAt:Date.now()+2592e6};localStorage.setItem(ts,JSON.stringify(r))})(null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.id)&&void 0!==t?t:0),n?(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,i,n,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&&op(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!==(n=null===(i=this.LeadSourceClient)||void 0===i?void 0:i.leadSource)&&void 0!==n?n:null);const J=Z.featureFlagWebchatMarketingSourceDropdownConfiguration,ee=Z.featureFlagWebchatUseDniPhoneNumberBySource,te=Z.featureFlagInsertDniIntoWebsite,ie=Z.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var ne;ne=Ao.includes(Z.orgId),Eo=ne;const[re,oe,ae,se,le,ue]=await Promise.all([this.isOrgMode()?Promise.resolve([]):Lh(this.orgSlug,this.buildingSlug),yo(this.buildingSlug),Bh(this.buildingSlug),wo(this.buildingSlug),xo(this.buildingSlug),Co(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Wi(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",i=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(i.data)return i.data}catch(t){return ra({logType:na.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(Ch(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?(Hh(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ie&&(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 i;if(!t)return;const n=document.createElement("a");n.textContent=t.textContent,n.style.cursor="pointer",n.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(i=t.parentNode)||void 0===i||i.replaceChild(n,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 i=t.includes("?")?"&":"?";e.setAttribute("href",t+i+`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===fa.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===fa.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===fa.EMOJI&&(this.designConcept=fa.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Xi),null===this.backgroundColor&&(this.backgroundColor=Zi);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 i=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return i.data?{number:Wi(i.data.number),isMatch:i.data.match,isPropertyWebsiteCatchall:i.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)){const e=Fh(be.number,this.orgSlug,this.buildingSlug);e>0&&oa({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&&Fh(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,i)=>{var n;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===(n=l.textContent)||void 0===n?void 0:n.toLowerCase())||"",s=qh(o,e);l.setAttribute("href",s),a++,ra({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:na.info,buildingSlug:i,orgSlug:t})}}return 0===a&&ra({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:na.warn,buildingSlug:i,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&oa({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=Yh[e];if(!t)return 0;const i=`${Kh}/building/${t}/units`,n=`${Kh}/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(i))continue;const l=s.replace(r,n);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(i))return;const a=t.replace(r,n);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&&ep(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,i,n,r,o,a,s,l,u;if(!this.buildingWebchatView)return;const d=this.chatStorageSlug(),c=ys(d),h=vs(d,c),p=h?c:bs(d,!1);if(!p.leadId)throw new Error("Lead ID is null");if(this.LeadSourceClient=new ua,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new tp(this.orgSlug,this.buildingSlug),this.myPubnub=new Os(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!==(i=p.leadId)&&void 0!==i?i:void 0);f&&(bs(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===(n=this.LeadSourceClient)||void 0===n?void 0:n.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"!==la(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:la(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=ys(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 i=await ya(this.orgSlug,e);if(!(null==i?void 0:i.id))return;this.buildingSlug=e,this.buildingWebchatView=i,null===(t=this.myPubnub)||void 0===t||t.adoptBuilding(e,i)}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 ya(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,i;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===(i=this.launcherRef.value)||void 0===i||i.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,i,n;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(n=null===(i=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===i?void 0:i.shadowRoot)||void 0===n?void 0:n.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 i=(null===(e=this.launcherButton)||void 0===e?void 0:e.isConnected)?this.launcherButton:null;null===(t=null!=i?i:this.currentLauncherButton())||void 0===t||t.focus()},this.focusMessageFieldOnOpen=()=>{var e,t;const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("pubnub-chat"),n=null==i?void 0:i.shadowRoot;i&&n&&(i.focusMessageField()||null===(t=n.getElementById("pubnub-chat-container"))||void 0===t||t.focus(),setTimeout(()=>{i.focusMessageField()},0))},this.closeChatAndRestoreFocus=()=>{this.onExitChat(),this.updateComplete.then(()=>{this.focusLauncherButton(),requestAnimationFrame(()=>this.focusLauncherButton())})}}setDeclaredBuildingId(e){this.hostDeclaredBuildingId=e,this.myPubnub&&(this.myPubnub.declaredBuildingId=e)}async handleChatInitializeAnalytics(){var e,t,i,n;this.analytics=new ta(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(n=null===(i=this.LeadSourceClient)||void 0===i?void 0:i.leadSource)&&void 0!==n?n:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),ms(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,i,n;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===(n=null===(i=null==r?void 0:r.querySelector("mobile-launcher"))||void 0===i?void 0:i.shadowRoot)||void 0===n?void 0:n.querySelector("button[aria-label='Chat with us']");return o instanceof HTMLElement?o:a instanceof HTMLElement?a:null}render(){var e,t,i,n,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;yh();const q=this.hideLauncher&&!this.isLoading&&!this._isMobile;return H`
|
|
9014
|
+
`],Vh([pe({attribute:!0})],Wh.prototype,"onClick",void 0),Vh([pe({attribute:!0})],Wh.prototype,"primaryColor",void 0),Vh([pe({attribute:!0})],Wh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Vh([pe({attribute:!0})],Wh.prototype,"toExpand",void 0),Wh=Vh([ce("minimize-expand-button")],Wh);const Qh="cdn.skypack.dev/@meetelise/chat",qh="cdn.eliseai.com/@meetelise/chat",Yh=async(e,t)=>{try{if(Math.random()>=.15)return;const i=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",i=t.textContent||"";if(e.includes(Qh)||i.includes(Qh))return"skypack";if(e.includes(qh)||i.includes(qh))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:i},{params:{cdn_version:i},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},Kh=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,Xh={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},Zh="https://applications.eliseai.com",Jh=["Check Availability","Apply Now"],ep=(e,t,i,n)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const i=e.getElementsByTagName("span");if(1!==i.length)return!1;const n=null===(t=i[0].textContent)||void 0===t?void 0:t.trim();return null!=n&&Jh.includes(n)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),ra({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:na.info,buildingSlug:n,orgSlug:i}),!0},tp=(e,t,i,n)=>{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&&ep(a,t,i,n);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)ep(s[e],t,i,n)}},ip=(e,t,i)=>{((e,t,i)=>{const n=document.body.getElementsByTagName("a");for(let r=0;r<n.length;r++)ep(n[r],e,t,i)})(i,e,t);new MutationObserver(n=>{for(const r of n)tp(r.addedNodes,i,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class np{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=$o();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(ia()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),i=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(i,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(i,JSON.stringify(t));ra({logType:na.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),i=la(this.orgSlug);if(!t){const t=[{leadSourceValue:i,timestampInitiallyLogged:Fr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),t}const n=t.leadSources.length>0?t.leadSources.sort((e,t)=>Yr(e.timestampInitiallyLogged).getTime()-Yr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Fr(new Date),r=[{timestampInitiallyLogged:n,leadSourceValue:i,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 rp=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let op=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=Cp.Default,this.onWidgetLoaded=mh(),this.onSstClose=mh(),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.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 i=this.centralConvo?await async function(e){const t=`https://app.meetelise.com/api/pub/v1/organization/${e}/webchat/v2`,i=await r().get(t);return va(i.data)}(this.orgSlug):await ya(this.orgSlug,this.buildingSlug);if(!this.isOrgMode()){if(Math.random()<.2)try{(async(e,t)=>{const i=window.rentgrata;if(!i)return;const n=i.Widget;if(!n)return;const o=n.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{Yh(this.orgSlug,this.buildingSlug)}catch(e){}}if(!await Tu(i,this.buildingSlug,this.orgSlug))return;oa({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==i?void 0:i.launchedDateTime)?.01:.05}),this.buildingWebchatView=i;const n=(()=>{try{const e="true"===sessionStorage.getItem(Cs);return sessionStorage.removeItem(Cs),e}catch{return!1}})();await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),(e=>{const t=new URLSearchParams(window.location.search),i=t.get("rwg_token"),n=t.get("elise_google_env");if(!i||!n||!e)return;const r={rwgToken:i,environment:n,buildingId:e,expiresAt:Date.now()+2592e6};localStorage.setItem(ts,JSON.stringify(r))})(null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.id)&&void 0!==t?t:0),n?(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,i,n,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&&sp(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!==(n=null===(i=this.LeadSourceClient)||void 0===i?void 0:i.leadSource)&&void 0!==n?n:null);const J=Z.featureFlagWebchatMarketingSourceDropdownConfiguration,ee=Z.featureFlagWebchatUseDniPhoneNumberBySource,te=Z.featureFlagInsertDniIntoWebsite,ie=Z.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var ne;ne=Ao.includes(Z.orgId),Eo=ne;const[re,oe,ae,se,le,ue]=await Promise.all([this.isOrgMode()?Promise.resolve([]):Bh(this.orgSlug,this.buildingSlug),yo(this.buildingSlug),jh(this.buildingSlug),wo(this.buildingSlug),xo(this.buildingSlug),Co(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Wi(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",i=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(i.data)return i.data}catch(t){return ra({logType:na.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($h(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?(Gh(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ie&&(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 i;if(!t)return;const n=document.createElement("a");n.textContent=t.textContent,n.style.cursor="pointer",n.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(i=t.parentNode)||void 0===i||i.replaceChild(n,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 i=t.includes("?")?"&":"?";e.setAttribute("href",t+i+`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===fa.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===fa.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===fa.EMOJI&&(this.designConcept=fa.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Xi),null===this.backgroundColor&&(this.backgroundColor=Zi);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 i=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return i.data?{number:Wi(i.data.number),isMatch:i.data.match,isPropertyWebsiteCatchall:i.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)){const e=zh(be.number,this.orgSlug,this.buildingSlug);e>0&&oa({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&&zh(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,i)=>{var n;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===(n=l.textContent)||void 0===n?void 0:n.toLowerCase())||"",s=Kh(o,e);l.setAttribute("href",s),a++,ra({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:na.info,buildingSlug:i,orgSlug:t})}}return 0===a&&ra({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:na.warn,buildingSlug:i,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&oa({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=Xh[e];if(!t)return 0;const i=`${Zh}/building/${t}/units`,n=`${Zh}/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(i))continue;const l=s.replace(r,n);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(i))return;const a=t.replace(r,n);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&&ip(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,i,n,r,o,a,s,l,u;if(!this.buildingWebchatView)return;const d=this.chatStorageSlug(),c=ys(d),h=vs(d,c),p=h?c:bs(d,!1);if(!p.leadId)throw new Error("Lead ID is null");if(this.LeadSourceClient=new ua,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new np(this.orgSlug,this.buildingSlug),this.myPubnub=new Os(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!==(i=p.leadId)&&void 0!==i?i:void 0);f&&(bs(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===(n=this.LeadSourceClient)||void 0===n?void 0:n.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"!==la(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:la(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=ys(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 i=await ya(this.orgSlug,e);if(!(null==i?void 0:i.id))return;this.buildingSlug=e,this.buildingWebchatView=i,null===(t=this.myPubnub)||void 0===t||t.adoptBuilding(e,i)}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 ya(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,i;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===(i=this.launcherRef.value)||void 0===i||i.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,i,n;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(n=null===(i=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===i?void 0:i.shadowRoot)||void 0===n?void 0:n.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 i=(null===(e=this.launcherButton)||void 0===e?void 0:e.isConnected)?this.launcherButton:null;null===(t=null!=i?i:this.currentLauncherButton())||void 0===t||t.focus()},this.focusMessageFieldOnOpen=()=>{var e,t;const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("pubnub-chat"),n=null==i?void 0:i.shadowRoot;i&&n&&(i.focusMessageField()||null===(t=n.getElementById("pubnub-chat-container"))||void 0===t||t.focus(),setTimeout(()=>{i.focusMessageField()},0))},this.closeChatAndRestoreFocus=()=>{this.onExitChat(),this.updateComplete.then(()=>{this.focusLauncherButton(),requestAnimationFrame(()=>this.focusLauncherButton())})}}setDeclaredBuildingId(e){this.hostDeclaredBuildingId=e,this.myPubnub&&(this.myPubnub.declaredBuildingId=e)}async handleChatInitializeAnalytics(){var e,t,i,n;this.analytics=new ta(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(n=null===(i=this.LeadSourceClient)||void 0===i?void 0:i.leadSource)&&void 0!==n?n:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),ms(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,i,n;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===(n=null===(i=null==r?void 0:r.querySelector("mobile-launcher"))||void 0===i?void 0:i.shadowRoot)||void 0===n?void 0:n.querySelector("button[aria-label='Chat with us']");return o instanceof HTMLElement?o:a instanceof HTMLElement?a:null}render(){var e,t,i,n,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;wh();const q=this.hideLauncher&&!this.isLoading&&!this._isMobile;return H`
|
|
9014
9015
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9015
9016
|
${this.displayPubnubChat?H`
|
|
9016
9017
|
<pubnub-chat
|
|
@@ -9020,7 +9021,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9020
9021
|
.orgSlug=${this.orgSlug}
|
|
9021
9022
|
.buildingSlug=${this.buildingSlug}
|
|
9022
9023
|
.centralConvo=${this.centralConvo}
|
|
9023
|
-
.widgetType=${
|
|
9024
|
+
.widgetType=${Cp.Default}
|
|
9024
9025
|
.building=${this.buildingWebchatView}
|
|
9025
9026
|
.primaryColor=${this.primaryColor}
|
|
9026
9027
|
.backgroundColor=${this.backgroundColor}
|
|
@@ -9130,7 +9131,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9130
9131
|
</meetelise-launcher>`:""}
|
|
9131
9132
|
</div>
|
|
9132
9133
|
</meta>
|
|
9133
|
-
`}};
|
|
9134
|
+
`}};op.styles=p`
|
|
9134
9135
|
:host {
|
|
9135
9136
|
all: initial;
|
|
9136
9137
|
}
|
|
@@ -9179,7 +9180,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9179
9180
|
position: fixed;
|
|
9180
9181
|
bottom: 0;
|
|
9181
9182
|
}
|
|
9182
|
-
`,
|
|
9183
|
+
`,rp([pe({type:String})],op.prototype,"buildingSlug",void 0),rp([pe({type:String})],op.prototype,"orgSlug",void 0),rp([pe({type:Boolean})],op.prototype,"centralConvo",void 0),rp([pe({type:String})],op.prototype,"declaredBuildingSlug",void 0),rp([pe({type:Object})],op.prototype,"launcherStyles",void 0),rp([pe()],op.prototype,"mobileStyles",void 0),rp([pe({type:Boolean})],op.prototype,"isMinimized",void 0),rp([pe({type:String})],op.prototype,"primaryColor",void 0),rp([pe({type:String})],op.prototype,"backgroundColor",void 0),rp([pe({type:String})],op.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),rp([pe({type:String})],op.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),rp([fe()],op.prototype,"_isMobile",void 0),rp([fe()],op.prototype,"chatId",void 0),rp([fe()],op.prototype,"analytics",void 0),rp([fe()],op.prototype,"launcher",void 0),rp([fe()],op.prototype,"buildingWebchatView",void 0),rp([fe()],op.prototype,"designConcept",void 0),rp([fe()],op.prototype,"leadSources",void 0),rp([fe()],op.prototype,"currentLeadSource",void 0),rp([fe()],op.prototype,"featureFlagShowDropdown",void 0),rp([fe()],op.prototype,"bedroomPreferenceRequired",void 0),rp([fe()],op.prototype,"tourSchedulerV2",void 0),rp([fe()],op.prototype,"brokerIntakeEnabled",void 0),rp([fe()],op.prototype,"phoneNumberForSource",void 0),rp([fe()],op.prototype,"hasMounted",void 0),rp([fe()],op.prototype,"hideLauncher",void 0),rp([fe()],op.prototype,"isLoading",void 0),rp([fe()],op.prototype,"showTourNextToChat",void 0),rp([fe()],op.prototype,"openTourSchedulerOnLoad",void 0),rp([fe()],op.prototype,"displayPubnubChat",void 0),rp([fe()],op.prototype,"myPubnub",void 0),rp([fe()],op.prototype,"LeadSourceClient",void 0),rp([fe()],op.prototype,"LeadSourceMultitouchClient",void 0),rp([fe()],op.prototype,"sampleRateToUse",void 0),rp([pe({type:Number})],op.prototype,"right",void 0),rp([pe({type:Number})],op.prototype,"bottom",void 0),rp([pe({type:Number})],op.prototype,"top",void 0),rp([pe({type:Number})],op.prototype,"left",void 0),rp([pe({attribute:!0})],op.prototype,"overrideRentgrata",void 0),rp([pe({attribute:!0})],op.prototype,"widgetType",void 0),rp([pe()],op.prototype,"onWidgetLoaded",void 0),rp([pe({attribute:!0})],op.prototype,"onSstClose",void 0),rp([fe()],op.prototype,"enabledChatWidgets",void 0),rp([fe()],op.prototype,"webchatConfigHasAutoOpenChat",void 0),rp([fe()],op.prototype,"requiresConsent",void 0),rp([fe()],op.prototype,"hideMobileFeatures",void 0),rp([fe()],op.prototype,"privacyPolicyUrl",void 0),op=rp([ce("me-chat")],op);const ap=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},sp=async(e,t,i,n,o)=>{var a;if(!n||!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}}(n);if(!s)return;const u=ap(["myContactForm","contactus","fpa-myContactForm"]);let d;if(!(u&&u instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&lp(n,e,"Could not find form",t?{id:t.id}:void 0))}try{if(u.parentElement&&"scheduleTourForm"===u.parentElement.id)return lp(n,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 lp(n,e,"Could not find submit button");const c=()=>({firstName:ap(["firstname","txtName","fpa-firstname","Form_FirstName"]),lastName:ap(["lastname","txtName2","fpa-lastname","Form_LastName"]),email:ap(["email","txtEmail","fpa-email","Form_Email"]),phone:ap(["phonenumber","txtPhone","fpa-phonenumber","Form_Phone"]),message:ap(["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 lp(n,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&&oa({params:{chat_id:t,org_slug:e,building_slug:n,is_form_override_success:!0},sampleRate:i}),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 i={};Object.entries(c()).forEach(([e,t])=>i[e]=null==t?void 0:t.value);const r=await ya(e,n);if(!r)return lp(n,e,"Could not find building"),null;const a={email_address:i.email,first_name:i.firstName,last_name:i.lastName,phone_number:i.phone,first_message:i.message,building_id:r.id,is_external_form:!0,tracking_params:l(e),lead_sources:[...new Set(o?[o,la(e)]:[la(e)])]},s=JSON.stringify(a);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":n,"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})}},lp=(e,t,i,n)=>{const r=JSON.stringify({orgSlug:t,buildingSlug:e,reason:i,url:window.location.href,formIdInfo:n});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})},up=p`
|
|
9183
9184
|
.chat-launcher {
|
|
9184
9185
|
position: fixed;
|
|
9185
9186
|
}
|
|
@@ -9210,7 +9211,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9210
9211
|
filter: brightness(1.1);
|
|
9211
9212
|
}
|
|
9212
9213
|
}
|
|
9213
|
-
`;var
|
|
9214
|
+
`;var dp=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let cp=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`
|
|
9214
9215
|
<div
|
|
9215
9216
|
class="chat-launcher"
|
|
9216
9217
|
style=${Ki({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`})}
|
|
@@ -9264,12 +9265,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9264
9265
|
/>
|
|
9265
9266
|
</svg>
|
|
9266
9267
|
</button>
|
|
9267
|
-
</div>`}};
|
|
9268
|
+
</div>`}};cp.styles=[up],dp([pe({type:Number})],cp.prototype,"right",void 0),dp([pe({type:Number})],cp.prototype,"bottom",void 0),dp([pe({type:Number})],cp.prototype,"top",void 0),dp([pe({type:Number})],cp.prototype,"left",void 0),dp([pe({attribute:!0})],cp.prototype,"isChatOpen",void 0),dp([pe({attribute:!0})],cp.prototype,"onClickCloseChat",void 0),dp([pe({attribute:!0})],cp.prototype,"onClickOpenChat",void 0),cp=dp([ce("simple-launcher")],cp);var hp=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let pp=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=ys(this.healthcareId),t=vs(this.healthcareId,e)?e:bs(this.healthcareId,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Os(this.healthcareId,null,"",this.currentLeadSource,t.leadId,null,null,Cp.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(),ms(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 wh(),this.isLoading?H``:H`
|
|
9268
9269
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
9269
9270
|
${this.displayPubnubChat?H`
|
|
9270
9271
|
<pubnub-chat
|
|
9271
9272
|
id="pubnub-chat"
|
|
9272
|
-
.widgetType=${
|
|
9273
|
+
.widgetType=${Cp.Healthcare}
|
|
9273
9274
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
9274
9275
|
.myPubnub=${this.myPubnub}
|
|
9275
9276
|
.buildingSlug=${this.healthcareId}
|
|
@@ -9295,7 +9296,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9295
9296
|
></simple-launcher>
|
|
9296
9297
|
|
|
9297
9298
|
</meta>
|
|
9298
|
-
`}};
|
|
9299
|
+
`}};pp.styles=p`
|
|
9299
9300
|
:host {
|
|
9300
9301
|
all: initial;
|
|
9301
9302
|
}
|
|
@@ -9348,13 +9349,13 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9348
9349
|
line-height: 150%;
|
|
9349
9350
|
font-size: 16px;
|
|
9350
9351
|
}
|
|
9351
|
-
`,
|
|
9352
|
+
`,hp([pe({type:String})],pp.prototype,"healthcareId",void 0),hp([pe({type:Number})],pp.prototype,"right",void 0),hp([pe({type:Number})],pp.prototype,"bottom",void 0),hp([pe({type:Number})],pp.prototype,"top",void 0),hp([pe({type:Number})],pp.prototype,"left",void 0),hp([fe()],pp.prototype,"launcher",void 0),hp([fe()],pp.prototype,"currentLeadSource",void 0),hp([fe()],pp.prototype,"displayPubnubChat",void 0),hp([fe()],pp.prototype,"myPubnub",void 0),hp([fe()],pp.prototype,"requiresConsent",void 0),hp([fe()],pp.prototype,"privacyPolicyUrl",void 0),hp([fe()],pp.prototype,"isLoading",void 0),pp=hp([ce("health-chat")],pp);var fp=function(e,t,i,n){var r,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,i,a):r(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};let gp=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=ys(this.orgSlug),t=vs(this.orgSlug,e)?e:bs(this.orgSlug,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Os(this.orgSlug,null,this.orgSlug,this.currentLeadSource,t.leadId,null,null,Cp.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(),ms(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 wh(),this.isLoading?H``:H`
|
|
9352
9353
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
9353
9354
|
${this.displayPubnubChat?H`
|
|
9354
9355
|
<pubnub-chat
|
|
9355
9356
|
id="pubnub-chat"
|
|
9356
9357
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
9357
|
-
.widgetType=${
|
|
9358
|
+
.widgetType=${Cp.Utilities}
|
|
9358
9359
|
.myPubnub=${this.myPubnub}
|
|
9359
9360
|
.buildingSlug=${this.orgSlug}
|
|
9360
9361
|
.onClickExit=${()=>{this.displayPubnubChat=!1}}
|
|
@@ -9378,7 +9379,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9378
9379
|
|
|
9379
9380
|
></simple-launcher>
|
|
9380
9381
|
</meta>
|
|
9381
|
-
`}};
|
|
9382
|
+
`}};gp.styles=p`
|
|
9382
9383
|
:host {
|
|
9383
9384
|
all: initial;
|
|
9384
9385
|
}
|
|
@@ -9431,4 +9432,4 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
9431
9432
|
line-height: 150%;
|
|
9432
9433
|
font-size: 16px;
|
|
9433
9434
|
}
|
|
9434
|
-
`,hp([pe({type:String})],pp.prototype,"orgSlug",void 0),hp([pe({type:Number})],pp.prototype,"right",void 0),hp([pe({type:Number})],pp.prototype,"bottom",void 0),hp([pe({type:Number})],pp.prototype,"top",void 0),hp([pe({type:Number})],pp.prototype,"left",void 0),hp([fe()],pp.prototype,"launcher",void 0),hp([fe()],pp.prototype,"currentLeadSource",void 0),hp([fe()],pp.prototype,"displayPubnubChat",void 0),hp([fe()],pp.prototype,"myPubnub",void 0),hp([fe()],pp.prototype,"requiresConsent",void 0),hp([fe()],pp.prototype,"privacyPolicyUrl",void 0),hp([fe()],pp.prototype,"isLoading",void 0),pp=hp([ce("utilities-chat")],pp);const fp=async e=>{const t=window.location.href,i=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,n=await r().get(i,{headers:{"org-slug":e}});return Math.random()<.2&&ra({logType:n&&n.data?na.info:na.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),n.data},gp=async(e,t=5e3)=>new Promise((i,n)=>{const r=new MutationObserver((t,n)=>{const r=document.getElementById(e);r&&(n.disconnect(),i(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),n(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),i(a))});class mp{static healthcareStart(e,t=!0){var i,n,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),wp();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===(i=e.right)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("bottom",(null===(n=e.bottom)||void 0===n?void 0:n.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),mp.healthChat=a}static start(e,t=!0){var i,n,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===(i=null==e?void 0:e.position)||void 0===i?void 0:i.right,bottom:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.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}),wp(),e.studio&&!e.building)return void this.handleStudioContext(e);let d=null;switch(e.widgetType){case vp.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case vp.Default:d=document.createElement("me-chat");break;case vp.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||vp.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 i=Ji(e),n=0,r=0,o=0,a={r:i.r+Math.round((n-i.r)*t),g:i.g+Math.round((r-i.g)*t),b:i.b+Math.round((o-i.b)*t)};return en(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),d instanceof np&&(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 gp("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 np&&(mp.meChat=d),d instanceof pp&&(mp.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),mp.meChat===t&&(mp.meChat=null)}static handleStudioContext(e){e.studio&&(this.activeStudioOptions=e)}static updateStudioContext(e){var t;const i=this.activeStudioOptions;if(!(null==i?void 0:i.studio))return;const n=++this.studioUpdateToken;if(e.siteId&&e.siteId!==i.studio.siteId)return void ra({logType:na.warn,logTitle:"[STUDIO_WEBCHAT_CONTEXT_SITE_MISMATCH]",logData:{activeSiteId:i.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,i,n);const r=bp(e.organization),o=bp(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=yp(r);this.activeStudioOrgSlug===s&&this.activeStudioBuildingSlug===o&&this.activeStudioSessionScopeKey===a||this.removeWidget().then(()=>{n===this.studioUpdateToken&&(this.activeStudioOrgSlug=s,this.activeStudioBuildingSlug=o,this.activeStudioSessionScopeKey=a,this.orgSlug=s,this.start({...i,organization:r,building:o},!1))})}static updateStudioOrgContext(e,t,i){var n;const r=bp(e.organization);if(!r)return void this.clearStudioContext({source:"elise_studio",reason:"missing_context",preserveCache:!0});const o=yp(r),a=(null===(n=e.sessionScope)||void 0===n?void 0:n.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;i===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,i,n){if(i)return void e.setAttribute("buildingSlug",i);if(this.mutationObserver)return;if(!t)return;const r=await fp(t);if(r){const e={...n,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,fp(t).then(e=>{if(!e)return;const i={...n,organization:t,building:e};this.start(i,!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)}`,i=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&ra({logType:i&&i.data?na.info:na.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),!i||!i.data)return;const n={organization:this.orgSlug,building:i.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(n,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,i=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,n=await r().get(i,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&ra({logType:n&&n.data===e?na.info:na.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n&&n.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:n&&n.data===e?null:n&&!n.data?"No match found":n&&n.data!==e?"Mismatch":"No match found"}}),n&&n.data}}function bp(e){return"string"!=typeof e?"":e.trim()}function yp(e){return"Pacific Urban Residential"===e?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e}var vp;mp.meChat=null,mp.healthChat=null,mp.utilitiesChat=null,mp.orgSlug="",mp.mutationObserver=null,mp.previousUrl="",mp.hasBuildingSlug=null,mp.brandColor="",mp.backgroundColor="",mp.healthcareId="",mp.activeStudioOrgSlug="",mp.activeStudioBuildingSlug="",mp.activeStudioSessionScopeKey="",mp.activeStudioOptions=null,mp.studioUpdateToken=0,mp.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(vp||(vp={}));const wp=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{vp as WidgetType,mp as default};
|
|
9435
|
+
`,fp([pe({type:String})],gp.prototype,"orgSlug",void 0),fp([pe({type:Number})],gp.prototype,"right",void 0),fp([pe({type:Number})],gp.prototype,"bottom",void 0),fp([pe({type:Number})],gp.prototype,"top",void 0),fp([pe({type:Number})],gp.prototype,"left",void 0),fp([fe()],gp.prototype,"launcher",void 0),fp([fe()],gp.prototype,"currentLeadSource",void 0),fp([fe()],gp.prototype,"displayPubnubChat",void 0),fp([fe()],gp.prototype,"myPubnub",void 0),fp([fe()],gp.prototype,"requiresConsent",void 0),fp([fe()],gp.prototype,"privacyPolicyUrl",void 0),fp([fe()],gp.prototype,"isLoading",void 0),gp=fp([ce("utilities-chat")],gp);const mp=async e=>{const t=window.location.href,i=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,n=await r().get(i,{headers:{"org-slug":e}});return Math.random()<.2&&ra({logType:n&&n.data?na.info:na.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),n.data},bp=async(e,t=5e3)=>new Promise((i,n)=>{const r=new MutationObserver((t,n)=>{const r=document.getElementById(e);r&&(n.disconnect(),i(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),n(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),i(a))});class yp{static healthcareStart(e,t=!0){var i,n,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),xp();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===(i=e.right)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("bottom",(null===(n=e.bottom)||void 0===n?void 0:n.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),yp.healthChat=a}static start(e,t=!0){var i,n,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===(i=null==e?void 0:e.position)||void 0===i?void 0:i.right,bottom:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.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}),xp(),e.studio&&!e.building)return void this.handleStudioContext(e);let d=null;switch(e.widgetType){case Cp.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case Cp.Default:d=document.createElement("me-chat");break;case Cp.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||Cp.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 i=Ji(e),n=0,r=0,o=0,a={r:i.r+Math.round((n-i.r)*t),g:i.g+Math.round((r-i.g)*t),b:i.b+Math.round((o-i.b)*t)};return en(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),d instanceof op&&(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 bp("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 op&&(yp.meChat=d),d instanceof gp&&(yp.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),yp.meChat===t&&(yp.meChat=null)}static handleStudioContext(e){e.studio&&(this.activeStudioOptions=e)}static updateStudioContext(e){var t;const i=this.activeStudioOptions;if(!(null==i?void 0:i.studio))return;const n=++this.studioUpdateToken;if(e.siteId&&e.siteId!==i.studio.siteId)return void ra({logType:na.warn,logTitle:"[STUDIO_WEBCHAT_CONTEXT_SITE_MISMATCH]",logData:{activeSiteId:i.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,i,n);const r=vp(e.organization),o=vp(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=wp(r);this.activeStudioOrgSlug===s&&this.activeStudioBuildingSlug===o&&this.activeStudioSessionScopeKey===a||this.removeWidget().then(()=>{n===this.studioUpdateToken&&(this.activeStudioOrgSlug=s,this.activeStudioBuildingSlug=o,this.activeStudioSessionScopeKey=a,this.orgSlug=s,this.start({...i,organization:r,building:o},!1))})}static updateStudioOrgContext(e,t,i){var n;const r=vp(e.organization);if(!r)return void this.clearStudioContext({source:"elise_studio",reason:"missing_context",preserveCache:!0});const o=wp(r),a=(null===(n=e.sessionScope)||void 0===n?void 0:n.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;i===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,i,n){if(i)return void e.setAttribute("buildingSlug",i);if(this.mutationObserver)return;if(!t)return;const r=await mp(t);if(r){const e={...n,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,mp(t).then(e=>{if(!e)return;const i={...n,organization:t,building:e};this.start(i,!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)}`,i=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&ra({logType:i&&i.data?na.info:na.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),!i||!i.data)return;const n={organization:this.orgSlug,building:i.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(n,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,i=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,n=await r().get(i,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&ra({logType:n&&n.data===e?na.info:na.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n&&n.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:n&&n.data===e?null:n&&!n.data?"No match found":n&&n.data!==e?"Mismatch":"No match found"}}),n&&n.data}}function vp(e){return"string"!=typeof e?"":e.trim()}function wp(e){return"Pacific Urban Residential"===e?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e}var Cp;yp.meChat=null,yp.healthChat=null,yp.utilitiesChat=null,yp.orgSlug="",yp.mutationObserver=null,yp.previousUrl="",yp.hasBuildingSlug=null,yp.brandColor="",yp.backgroundColor="",yp.healthcareId="",yp.activeStudioOrgSlug="",yp.activeStudioBuildingSlug="",yp.activeStudioSessionScopeKey="",yp.activeStudioOptions=null,yp.studioUpdateToken=0,yp.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(Cp||(Cp={}));const xp=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{Cp as WidgetType,yp as default};
|