@meetelise/chat 1.61.0 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/public/dist/index.js
CHANGED
|
@@ -757,7 +757,7 @@ var e={2:(e,t,n)=>{var i=n(2199),r=n(4664),o=n(5950);e.exports=function(e){retur
|
|
|
757
757
|
.option.active {
|
|
758
758
|
background-color: var(--active-option-color);
|
|
759
759
|
}
|
|
760
|
-
`,Me],Br([pe({attribute:!1})],jr.prototype,"options",void 0),Br([pe({type:String})],jr.prototype,"placeholder",void 0),Br([pe({type:String})],jr.prototype,"value",void 0),Br([fe()],jr.prototype,"activeOption",void 0),Br([fe()],jr.prototype,"isOpen",void 0),Br([fe()],jr.prototype,"activeOptionIndex",void 0),Br([fe()],jr.prototype,"searchTerm",void 0),Br([ge("#select",!0)],jr.prototype,"meSelect",void 0),Br([ge("#selectText",!0)],jr.prototype,"selectInput",void 0),jr=Br([ce("me-select")],jr),function(e){e.Unknown="UNKNOWN",e.SelfGuided="SELF_GUIDED",e.VirtualShowing="VIRTUAL_SHOWING",e.WithAgent="WITH_AGENT",e.MediaTour="MEDIA_TOUR"}(zr||(zr={}));var Qr=n(2013),Wr=n.n(Qr);Math.pow(10,8);var Vr=6e4,qr=36e5;function Yr(e,t){si(1,arguments);var n=t||{},i=null==n.additionalDigits?2:$i(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=function(e){var t,n={},i=e.split(Kr.dateTimeDelimiter);if(i.length>2)return n;/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],Kr.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Kr.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var r=Kr.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}(e);if(o.date){var a=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((i[1]||i[2]).length)}}(o.date,i);r=function(e,t){if(null===t)return new Date(NaN);var n=e.match(Xr);if(!n)return new Date(NaN);var i=!!n[4],r=eo(n[1]),o=eo(n[2])-1,a=eo(n[3]),s=eo(n[4]),l=eo(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=i.getUTCDay()||7,o=7*(t-1)+n+1-r;return i.setUTCDate(i.getUTCDate()+o),i}(t,s,l):new Date(NaN);var u=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(no[t]||(io(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(io(e)?366:365)}(t,r)?(u.setUTCFullYear(t,o,Math.max(r,a)),u):new Date(NaN)}(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,l=r.getTime(),u=0;if(o.time&&(u=function(e){var t=e.match(Zr);if(!t)return NaN;var n=to(t[1]),i=to(t[2]),r=to(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r))return NaN;return n*qr+i*Vr+1e3*r}(o.time),isNaN(u)))return new Date(NaN);if(!o.timezone){var d=new Date(l+u),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=function(e){if("Z"===e)return 0;var t=e.match(Jr);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,r))return NaN;return n*(i*qr+r*Vr)}(o.timezone),isNaN(s)?new Date(NaN):new Date(l+u+s)}var Kr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Xr=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zr=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Jr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function eo(e){return e?parseInt(e):1}function to(e){return e&&parseFloat(e.replace(",","."))||0}var no=[31,null,31,30,31,30,31,31,30,31,30,31];function io(e){return e%400==0||e%4==0&&e%100!=0}const ro={buildingId:null,availabilities:{}},oo=()=>{ro.buildingId=null,ro.availabilities={}},ao=async e=>{e&&(ro.buildingId=e);const t=ro.buildingId;if(!t)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const n=ro.availabilities;if(n[t])return n[t];const i=Hr(),o=Fr(function(e){si(1,arguments);var t=li(e);return t.setHours(23,59,59,999),t}(Gr(i,30))),a=`https://app.meetelise.com/api/pub/v1/buildings/${t}/tour/availabilities?${`startTime=${encodeURIComponent(Fr(i))}&endTime=${encodeURIComponent(o)}`}`,s=await r().get(a);return ro.availabilities[t]=s.data,s.data},so=async(e,t)=>{var n,i;const r=await ao(t),o=(null===(n=r.availability)||void 0===n?void 0:n[e])?null===(i=r.availability)||void 0===i?void 0:i[e].availableTourStartTimes:[];return r.availability?{...r.availability[e],availableTourStartTimes:o}:null},lo=async()=>{var e,t,n,i,r,o;return{[
|
|
760
|
+
`,Me],Br([pe({attribute:!1})],jr.prototype,"options",void 0),Br([pe({type:String})],jr.prototype,"placeholder",void 0),Br([pe({type:String})],jr.prototype,"value",void 0),Br([fe()],jr.prototype,"activeOption",void 0),Br([fe()],jr.prototype,"isOpen",void 0),Br([fe()],jr.prototype,"activeOptionIndex",void 0),Br([fe()],jr.prototype,"searchTerm",void 0),Br([ge("#select",!0)],jr.prototype,"meSelect",void 0),Br([ge("#selectText",!0)],jr.prototype,"selectInput",void 0),jr=Br([ce("me-select")],jr),function(e){e.Unknown="UNKNOWN",e.SelfGuided="SELF_GUIDED",e.VirtualShowing="VIRTUAL_SHOWING",e.WithAgent="WITH_AGENT",e.MediaTour="MEDIA_TOUR"}(zr||(zr={}));var Qr=n(2013),Wr=n.n(Qr);Math.pow(10,8);var Vr=6e4,qr=36e5;function Yr(e,t){si(1,arguments);var n=t||{},i=null==n.additionalDigits?2:$i(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=function(e){var t,n={},i=e.split(Kr.dateTimeDelimiter);if(i.length>2)return n;/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],Kr.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Kr.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var r=Kr.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}(e);if(o.date){var a=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((i[1]||i[2]).length)}}(o.date,i);r=function(e,t){if(null===t)return new Date(NaN);var n=e.match(Xr);if(!n)return new Date(NaN);var i=!!n[4],r=eo(n[1]),o=eo(n[2])-1,a=eo(n[3]),s=eo(n[4]),l=eo(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=i.getUTCDay()||7,o=7*(t-1)+n+1-r;return i.setUTCDate(i.getUTCDate()+o),i}(t,s,l):new Date(NaN);var u=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(no[t]||(io(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(io(e)?366:365)}(t,r)?(u.setUTCFullYear(t,o,Math.max(r,a)),u):new Date(NaN)}(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,l=r.getTime(),u=0;if(o.time&&(u=function(e){var t=e.match(Zr);if(!t)return NaN;var n=to(t[1]),i=to(t[2]),r=to(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r))return NaN;return n*qr+i*Vr+1e3*r}(o.time),isNaN(u)))return new Date(NaN);if(!o.timezone){var d=new Date(l+u),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=function(e){if("Z"===e)return 0;var t=e.match(Jr);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,r))return NaN;return n*(i*qr+r*Vr)}(o.timezone),isNaN(s)?new Date(NaN):new Date(l+u+s)}var Kr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Xr=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zr=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Jr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function eo(e){return e?parseInt(e):1}function to(e){return e&&parseFloat(e.replace(",","."))||0}var no=[31,null,31,30,31,30,31,31,30,31,30,31];function io(e){return e%400==0||e%4==0&&e%100!=0}const ro={buildingId:null,availabilities:{}},oo=()=>{ro.buildingId=null,ro.availabilities={}},ao=async e=>{e&&(ro.buildingId=e);const t=ro.buildingId;if(!t)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const n=ro.availabilities;if(n[t])return n[t];const i=Hr(),o=Fr(function(e){si(1,arguments);var t=li(e);return t.setHours(23,59,59,999),t}(Gr(i,30))),a=`https://app.meetelise.com/api/pub/v1/buildings/${t}/tour/availabilities?${`startTime=${encodeURIComponent(Fr(i))}&endTime=${encodeURIComponent(o)}`}`,s=await r().get(a);return ro.availabilities[t]=s.data,s.data},so=async(e,t)=>{var n,i;const r=await ao(t),o=(null===(n=r.availability)||void 0===n?void 0:n[e])?null===(i=r.availability)||void 0===i?void 0:i[e].availableTourStartTimes:[];return r.availability?{...r.availability[e],availableTourStartTimes:o}:null},lo=async()=>{var e,t,n,i,r,o;return{[pu.Guided]:!!(null===(t=null===(e=await so(zr.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[pu.Self]:!!(null===(i=null===(n=await so(zr.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[pu.Virtual]:!!(null===(o=null===(r=await so(zr.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}},uo=async(e,t)=>{var n,i;const r=await so(e,t);if(!r)return{};const o={availableTourStartTimes:null===(n=r.availableTourStartTimes?r.availableTourStartTimes.filter(e=>di(Yr(e))&&!function(e){return si(1,arguments),li(e).getTime()<Date.now()}(Yr(e))):[])||void 0===n?void 0:n.map(e=>co(e))};return Wr()(null!==(i=o.availableTourStartTimes)&&void 0!==i?i:[],e=>ir(new Date(e.datetime),"yyyy-MM-dd"))},co=e=>({datetime:e.slice(0,19),offset:e.slice(19)});var ho=n(3916),po=n.n(ho),fo=n(2485),go=n.n(fo);const mo=e=>`https://app.meetelise.com/platformApi/webchat/${e}/chat-ui-feature-flag`;var bo;async function yo(e){if(!e)return!1;try{return(await r().get(mo(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-applications-link-replacement",default_str:null,default_bool:!1}})).data}catch(e){return!1}}!function(e){e.onAttributionFailure="on-attribution-failure",e.never="never",e.always="always"}(bo||(bo={}));const vo=e=>`https://app.meetelise.com/platformApi/webchat/${e}/tracked-rollout`;async function wo(e){if(!e)return!1;try{return(await r().get(vo(e),{params:{rollout_name:"webchat_bedroom_preference_required",default_value:!1}})).data}catch(e){return!1}}async function Co(e){if(!e)return!1;try{return!0===(await r().get(vo(e),{params:{rollout_name:"broker_rollout",default_value:!1},timeout:3e3})).data}catch(e){return!1}}function xo(){return $o()?function(){const e=window.location.search,t={},n=e.split("?").slice(1).join("&");return n.split("&").forEach(e=>{const[n,i]=e.split("=");n&&i&&(t[decodeURIComponent(n)]=decodeURIComponent(i))}),t}():function(){const e=new URLSearchParams(window.location.search),t=e.has("utm_content"),n=e.has("utm_source");if(t&&!n){const t=e.get("utm_content");e.delete("utm_content"),e.set("utm_source",t)}return Object.fromEntries(e)}()}const $o=()=>(window.location.search.match(/\?/g)||[]).length>1,So=[57,2575,2332],Ao=["email","phone","firstName","lastName","message","tourDetails"];let ko=!1;const Eo=(e,t={})=>{window.dataLayer=window.dataLayer||[];let n=t;if(ko){n={...t};for(const e of Ao)delete n[e]}window.dataLayer.push({event:e,...n})};class To extends we{constructor(e){if(super(e),this.it=Q,e.type!==ye)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Q||null==e)return this.ft=void 0,this.it=e;if(e===z)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.ft;this.it=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}To.directiveName="unsafeHTML",To.resultType=1;const _o=ve(To),Oo=G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
761
761
|
<rect x="1" y="1" width="22" height="22" stroke="black" stroke-width="2" rx="2"/>
|
|
762
762
|
</svg>
|
|
763
763
|
`,Po=(G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="17" viewBox="0 0 16 17" fill="none">
|
|
@@ -1619,7 +1619,49 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
1619
1619
|
gap: 12px;
|
|
1620
1620
|
align-items: center;
|
|
1621
1621
|
}
|
|
1622
|
-
`,Yo=(e,t,n,i,r="")=>({firstName:e.trim(),lastName:t.trim(),email:n.trim(),firmName:i.trim(),phone:r}),Ko=e=>!e.firstName||!e.lastName,Xo=(e,t)=>e.email&&Lr(e.email)?e.email.toLowerCase()===t.trim().toLowerCase()?"Enter your client's details below, not yours":null:"Enter your valid email address",Zo=e=>e?{broker_first_name:e.firstName,broker_last_name:e.lastName,broker_email:e.email,broker_firm_name:e.firmName||null,...e.phone?{broker_phone:e.phone}:{}}:{};class Jo{constructor(e,t,n,i){this.org=e,this.building=t,this.chatId=n,this.incomingProcessedLeadSource=i,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}ping(e){var t;fetch("https://app.meetelise.com/platformApi/connectors/talk_js/analytics",{method:"POST",credentials:"omit",keepalive:!0,headers:{"content-type":"application/json; charset=UTF-8"},body:JSON.stringify({eventType:e,chatId:this.chatId,url:location.href,org:this.org,building:this.building,referrer:document.referrer,featureFlags:this.featureFlags,campaignSources:ea(),incomingProcessedLeadSource:this.incomingProcessedLeadSource,webchatVersion:null!==(t="MISSING_ENV_VAR".npm_package_version)&&void 0!==t?t:"1.20.155"})})}}const ea=()=>{var e,t,n,i,r,o;try{const i=new URL(window.location.href).searchParams,r=null!==(n=null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&void 0!==n?n:null,o=i.get("switch_cls[id]"),a=i.get("ilm"),s=i.get("utm_source");return{entrataCampaignSource:o,realpageCampaignSource:a,utmCampaignSource:s,yardiCampaignSource:r,bozzutoAdSource:Dr("bozzuto_ad_source")}}catch(e){const t=document.createElement("iframe");if(t.style.display="none",document.body.appendChild(t),!t.contentWindow)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const n=t.contentWindow.URL;if(!n)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const a=new n(window.location.href).searchParams,s=null!==(o=null===(r=null===(i=window.RCTPCampaign)||void 0===i?void 0:i.CampaignDetails)||void 0===r?void 0:r.Source)&&void 0!==o?o:null;return{entrataCampaignSource:a.get("switch_cls[id]"),realpageCampaignSource:a.get("ilm"),utmCampaignSource:a.get("utm_source"),yardiCampaignSource:s,bozzutoAdSource:Dr("bozzuto_ad_source")}}};var ta;!function(e){e.error="error",e.info="info",e.warn="warn"}(ta||(ta={}));const na=async({logType:e,buildingSlug:t,orgSlug:n,logTitle:o,logData:a,error:s})=>{var l;if(s instanceof i.AxiosError&&403===(null===(l=s.response)||void 0===l?void 0:l.status))return;await r().post("https://app.meetelise.com/platformApi/webchat/logging",{...a},{headers:{"Content-Type":"application/json","building-slug":null!=t?t:"","org-slug":null!=n?n:"","log-type":null!=e?e:ta.error,"log-title":o.toUpperCase().replace(/\s/g,"_")}})},ia=async({params:e,sampleRate:t})=>{try{if(Math.random()>=t)return;await r().post("https://app.meetelise.com/platformApi/webchat/log/signal",{...e,website_origin:window.location.origin,website_search:window.location.search})}catch(e){}};var ra=n(2193),oa=n.n(ra);function aa(e){return"avb"===e?"AVB Company Website":"windsor"===e?"Windsorcommunities.com":"property-website"}const sa=class{constructor(){this.chatId=null,this.apiHost="https://app.meetelise.com",this.leadSource=null,this.leadSourceParams=null,this.localStorageTTLDays=30,this.buildingId=null,this.orgId=null,this.orgSlug=null,this.buildingSlug=null,this.queryParameters=null,this.leadSourceInput=null,this.updateLeadSourceLocalStorage=(e,t,n,i,r)=>{const o=xo();if(this.leadSourceInput={websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:o,referrer:document.referrer,parsedUtmSource:o?o.utm_source:null,campaignSources:Object.values(ea()).filter(e=>e)},i)return;if(!r){const t=this.getLeadSourceBodyIfValid(e);if(t){if(!Mr(t.timestamp,24*this.localStorageTTLDays))return{...t,timestamp:Yr(t.timestamp)}}}const a={leadSource:t,leadSourceParams:this.leadSourceParams,leadId:n,buildingSlug:e,timestamp:Fr(new Date),leadSourceInput:this.leadSourceInput};return localStorage.setItem("com.elise.webchat.leadsource.slug="+e,JSON.stringify(a)),{...a,timestamp:Yr(a.timestamp)}},this.getLeadSourceBodyIfValid=e=>{const t=localStorage.getItem("com.elise.webchat.leadsource.slug="+e);if(t)try{const n=JSON.parse(t);if(n.buildingSlug===e&&n.leadSource&&n.leadId&&n.timestamp&&!Mr(Yr(n.timestamp),24*this.localStorageTTLDays)){try{this.leadSourceInput=n.leadSourceInput}catch(e){}return n}}catch(e){return null}return null},this.resetLeadSource=()=>{if(!this.buildingSlug)return!1;const e="com.elise.webchat.leadsource.slug="+this.buildingSlug;return localStorage.removeItem(e),!0}}async fetchCurrentParsedLeadSource({buildingSlug:e,queryParams:t,referrer:n,campaignSources:i}){const o={query_params:t,building_slug:e,referrer:n,campaign_sources:i};try{return(await r().post(`${this.apiHost}/platformApi/webchat/current-parsed-lead-source`,o)).data}catch(e){return null}}async checkAndHandleForLogLeadSource({webchatAction:e,stateId:t}){var n,i,o,a,s,l,u;try{if(!this.chatId)return null;if(!this.orgSlug)return null;let d=null,c=null;try{if("f1ba5a20-d207-4e5a-879e-65199e7d0a53"===this.orgSlug){const e=await this.getCookieValue("_ga");e&&(d=e),c=null===(n=window.dataLayer.find(e=>{var t;return"gtagApiGet"==(null===(t=e.value)||void 0===t?void 0:t.event)}))||void 0===n?void 0:n.value}}catch(e){}return await r().post(`${this.apiHost}/platformApi/webchat/log/lead-source`,{chat_id:this.chatId,webchat_action:e,state_id:t,building_id:this.buildingId,org_slug:this.orgSlug,building_slug:this.buildingSlug,website_origin:null===(i=this.leadSourceInput)||void 0===i?void 0:i.websiteOrigin,website_search:null===(o=this.leadSourceInput)||void 0===o?void 0:o.websiteSearch,query_parameters:null===(a=this.leadSourceInput)||void 0===a?void 0:a.queryParameters,referrer:null===(s=this.leadSourceInput)||void 0===s?void 0:s.referrer,parsed_utm_source:null===(l=this.leadSourceInput)||void 0===l?void 0:l.parsedUtmSource,campaign_sources:null===(u=this.leadSourceInput)||void 0===u?void 0:u.campaignSources,lead_source_output:this.leadSource,google_analytics_client_id:oa()(d)?null:d,extras:null!=c?c:null}),null}catch(e){return null}}async getCookieValue(e){try{const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const i=t[n].trim();if(i.startsWith(e+"=")){return i.substring((e+"=").length,-1===i.indexOf(";")?void 0:i.indexOf(";"))}}return null}catch(e){}return null}async generateUserLeadSource({leadId:e,orgSlug:t,buildingSlug:n}){var i,r,o;try{const a={queryParams:xo(),buildingSlug:n,referrer:document.referrer,campaignSources:ea()};let s=!1;const l=n?this.getLeadSourceBodyIfValid(n):null;if(l){if(!["test-company","daf00bd2-1ecb-482c-b6f4-e1c5511a01be"].includes(t))return this.leadSource=l.leadSource,this.leadSourceParams=null!==(r=l.leadSourceParams)&&void 0!==r?r:null,this.leadSource;{const e=await this.fetchCurrentParsedLeadSource(a);if(!e)return this.leadSource=l.leadSource,this.leadSourceParams=null!==(i=l.leadSourceParams)&&void 0!==i?i:null,this.leadSource;this.leadSource=e,s=!0}}const u=await this.fetchCurrentParsedLeadSource(a);if(this.leadSource=u,this.buildingId=null,this.orgSlug=t,this.buildingSlug=n,n&&!u){const e=this.getLeadSourceBodyIfValid(n);if(e)return this.leadSource=e.leadSource,this.leadSourceParams=null!==(o=e.leadSourceParams)&&void 0!==o?o:null,this.leadSource}if(n){const t=!!u&&u.length>0;this.updateLeadSourceLocalStorage(n,u,e,!t&&!s,s)}return u}catch(e){}return null}},la=async(e,t=!1)=>{const n=`https://app.meetelise.com/eliseCrmApi/building/${e}/scheduling_status?observe_dynamic_scheduling=${t}`;try{return(await r().get(n)).data.is_enabled}catch(e){return!1}};var ua,da,ca;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(ua||(ua={})),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"}(da||(da={})),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"}(ca||(ca={}));const ha=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function pa(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,i=await r().get(n);return fa(i.data)}const fa=e=>{var t;try{e.welcomeMessage=ga(null!==(t=e.welcomeMessage)&&void 0!==t?t:"",e.userFirstName)}catch(e){}return e},ga=(e,t)=>e.replace(/elise/gi,t);var ma=n(7035),ba=n(6353);function ya(e,t,n){var i=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return i.formatToParts?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value}(i,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(i,t)}function va(e,t){var n=function(e){if(!Ca[e]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"06/25/2014 00:00:00"===t;Ca[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return Ca[e]}(t);return n.formatToParts?function(e,t){try{for(var n=e.formatToParts(t),i=[],r=0;r<n.length;r++){var o=wa[n[r].type];o>=0&&(i[o]=parseInt(n[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[i[3],i[1],i[2],i[4],i[5],i[6]]}(n,e)}var wa={year:0,month:1,day:2,hour:3,minute:4,second:5};var Ca={};function xa(e,t,n,i,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,r,o,a),s}var $a=36e5,Sa={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Aa(e,t,n){var i,r,o;if(!e)return 0;if(i=Sa.timezoneZ.exec(e))return 0;if(i=Sa.timezoneHH.exec(e))return Ea(o=parseInt(i[1],10))?-o*$a:NaN;if(i=Sa.timezoneHHMM.exec(e)){o=parseInt(i[2],10);var a=parseInt(i[3],10);return Ea(o,a)?(r=Math.abs(o)*$a+6e4*a,"+"===i[1]?-r:r):NaN}if(function(e){if(Ta[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Ta[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return xa(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=ka(s,e),u=n?l:function(e,t,n){var i=e.getTime(),r=i-t,o=ka(new Date(r),n);if(t===o)return t;r-=o-t;var a=ka(new Date(r),n);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function ka(e,t){var n=va(e,t),i=xa(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),r=e.getTime(),o=r%1e3;return i-(r-=o>=0?o:1e3+o)}function Ea(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var Ta={};var _a={X:function(e,t,n,i){var r=Oa(i.timeZone,e);if(0===r)return"Z";switch(t){case"X":return Na(r);case"XXXX":case"XX":return Ia(r);default:return Ia(r,":")}},x:function(e,t,n,i){var r=Oa(i.timeZone,e);switch(t){case"x":return Na(r);case"xxxx":case"xx":return Ia(r);default:return Ia(r,":")}},O:function(e,t,n,i){var r=Oa(i.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=t||"";return n+String(r)+a+Pa(o,2)}(r,":");default:return"GMT"+Ia(r,":")}},z:function(e,t,n,i){switch(t){case"z":case"zz":case"zzz":return ya("short",e,i);default:return ya("long",e,i)}}};function Oa(e,t){var n=e?Aa(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Pa(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function Ia(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e);return i+Pa(Math.floor(r/60),2)+n+Pa(Math.floor(r%60),2)}function Na(e,t){return e%60==0?(e>0?"-":"+")+Pa(Math.abs(e)/60,2):Ia(e,t)}const Ma=_a;var Da=n(9784),La=n(9720);var Ra=36e5,Ua=6e4,Ba={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 ja(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=t||{},i=null==n.additionalDigits?2:Da(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r=function(e){var t,n={},i=Ba.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=Ba.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var r=Ba.timeZone.exec(t);r?(n.time=t.replace(r[1],""),n.timeZone=r[1].trim()):n.time=t}return n}(e),o=function(e,t){var n,i=Ba.YYY[t],r=Ba.YYYYY[t];if(n=Ba.YYYY.exec(e)||r.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=Ba.YY.exec(e)||i.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,i),a=o.year,s=function(e,t){if(null===t)return null;var n,i,r,o;if(0===e.length)return(i=new Date(0)).setUTCFullYear(t),i;if(n=Ba.MM.exec(e))return i=new Date(0),Qa(t,r=parseInt(n[1],10)-1)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(n=Ba.DDD.exec(e)){i=new Date(0);var a=parseInt(n[1],10);return function(e,t){if(t<1)return!1;var n=za(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,a)?(i.setUTCFullYear(t,0,a),i):new Date(NaN)}if(n=Ba.MMDD.exec(e)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return Qa(t,r,s)?(i.setUTCFullYear(t,r,s),i):new Date(NaN)}if(n=Ba.Www.exec(e))return Wa(t,o=parseInt(n[1],10)-1)?Fa(t,o):new Date(NaN);if(n=Ba.WwwD.exec(e)){o=parseInt(n[1],10)-1;var l=parseInt(n[2],10)-1;return Wa(t,o,l)?Fa(t,o,l):new Date(NaN)}return null}(o.restDateString,a);if(isNaN(s))return new Date(NaN);if(s){var l,u=s.getTime(),d=0;if(r.time&&(d=function(e){var t,n,i;if(t=Ba.HH.exec(e))return Va(n=parseFloat(t[1].replace(",",".")))?n%24*Ra:NaN;if(t=Ba.HHMM.exec(e))return Va(n=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")))?n%24*Ra+i*Ua:NaN;if(t=Ba.HHMMSS.exec(e)){n=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Va(n,i,r)?n%24*Ra+i*Ua+1e3*r:NaN}return null}(r.time),isNaN(d)))return new Date(NaN);if(r.timeZone||n.timeZone){if(l=Aa(r.timeZone||n.timeZone,new Date(u+d)),isNaN(l))return new Date(NaN)}else l=La(new Date(u+d)),l=La(new Date(u+d+l));return new Date(u+d+l)}return new Date(NaN)}function Fa(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}var Ha=[31,28,31,30,31,30,31,31,30,31,30,31],Ga=[31,29,31,30,31,30,31,31,30,31,30,31];function za(e){return e%400==0||e%4==0&&e%100!=0}function Qa(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=za(e);if(i&&n>Ga[t])return!1;if(!i&&n>Ha[t])return!1}return!0}function Wa(e,t,n){return!(t<0||t>52)&&(null==n||!(n<0||n>6))}function Va(e,t,n){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var qa=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ya(e,t,n,i){var r=ma(i);return r.timeZone=t,r.originalDate=e,function(e,t,n){var i=String(t),r=n||{},o=i.match(qa);if(o){var a=ja(r.originalDate||e,r);i=o.reduce(function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),i="'"===e[n-1],o=e.replace(t,"'"+Ma[t[0]](a,t,null,r)+"'");return i?o.substring(0,n-1)+o.substring(n+1):o},i)}return ba(e,i,r)}(function(e,t,n){var i=ja(e,n),r=Aa(t,i,!0),o=new Date(i.getTime()-r),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}(e,t),n,r)}const Ka="com.eliseai.webchat.googlereserve.referral",Xa="https://app.meetelise.com",Za=async({buildingSlug:e})=>{try{const t=await r().get(`${Xa}/platformApi/webchat/${e}/units/summary`);if(t.data)return Tr(t.data)}catch(t){na({logType:ta.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS_SUMMARY]",logData:{error:t},error:t})}return[]};var Ja,es=n(8805),ts=n.n(es),ns=new Uint8Array(16);function is(){if(!Ja&&!(Ja="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 Ja(ns)}const rs=/^(?:[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 os=function(e){return"string"==typeof e&&rs.test(e)};for(var as=[],ss=0;ss<256;++ss)as.push((ss+256).toString(16).substr(1));const ls=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(as[e[t+0]]+as[e[t+1]]+as[e[t+2]]+as[e[t+3]]+"-"+as[e[t+4]]+as[e[t+5]]+"-"+as[e[t+6]]+as[e[t+7]]+"-"+as[e[t+8]]+as[e[t+9]]+"-"+as[e[t+10]]+as[e[t+11]]+as[e[t+12]]+as[e[t+13]]+as[e[t+14]]+as[e[t+15]]).toLowerCase();if(!os(n))throw TypeError("Stringified UUID is invalid");return n};const us=function(e,t,n){var i=(e=e||{}).random||(e.rng||is)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return ls(i)},ds=e=>localStorage.removeItem("com.elise.webchat.slug="+e),cs=(e,t,n)=>{const i=Fr(new Date),r=n||`lead_${us()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Yr(i),buildingSlug:e,initiatedChat:t}},hs=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if(ps(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},ps=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if(Er(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!Mr(t.timestamp,24)},fs=e=>e.startsWith("https://app.meetelise.com/settings/widgets")||e.startsWith("https://app.meetelise.com/settings/marketing/webchat")||e.includes("demo/utilities"),gs="com.elise.webchat.reopenAfterNavigation",ms=e=>{try{const t=new URL(e);return`${t.origin}${t.pathname}`}catch{return""}},bs=e=>{const t={pageUrl:ms(window.location.href),pageTitle:document.title};return"number"==typeof e&&Number.isInteger(e)&&e>0&&(t.declaredBuildingId=e),t},ys=(e,t=e=>window.location.assign(e))=>{(()=>{try{sessionStorage.setItem(gs,"true")}catch{}})(),t(e.url)};var vs;!function(e){e.noReply="no-reply",e.text="text",e.media="media",e.navigation="navigation"}(vs||(vs={}));const ws=e=>e.type===$s.text,Cs=e=>e.type===$s.media,xs=e=>e.type===$s.navigation;var $s;!function(e){e.text="text",e.media="media",e.navigation="navigation"}($s||($s={}));const Ss=class{constructor(e,t,n,i=null,r,o,a=null,s=xh.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=xh.Default,this.centralConvo=!1,this.declaredBuildingId=null,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.sessionToken=null,this.isCurrentlyStreamingMessage=!1,this.chatListener=null,this.rawPubnubMessages=[],this.simpleChatMessages=[],this.listenerParams={message:e=>{var t,n;const i={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,i],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==vs.noReply),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),this.checkAndHandleDelayStreamingMessages();const r="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;if(null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:r}),!r&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=r,"ai_message"===e.message.customType){const t=e.message.stream_id,i=null!=t?t:String(+e.timetoken);(t?this.reconstructStreamText(t):null!==(n=e.message.text)&&void 0!==n?n:"").includes("confirmed for your")&&this.fireScheduledTourEventOnce(i,e.message)}this.checkAndHandleGTMForLeadEmail(e)}},this.isLoadingMessages=!1,this.isFirstChatMessageSent=!1,this.streamingMessageTimeout=null,this.checkAndHandleDelayStreamingMessages=({delayToFetchHistoryInMs:e=1e4}={})=>{this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null);const t=new Map;this.rawPubnubMessages.forEach(e=>{var n;const i=e.message.stream_id;i&&t.set(i,[...null!==(n=t.get(i))&&void 0!==n?n:[],e])});const n=[...t.entries()].filter(([,e])=>!this.isStreamComplete(e)).map(([e])=>e);n.length>0&&(this.streamingMessageTimeout=setTimeout(()=>{na({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory().then(()=>n.forEach(e=>this.checkAndFireTourConfirmationForStream(e)))},e))},this.isStreamComplete=e=>{var t;const n=e.find(e=>e.message.is_done);if(!n)return!1;const i=new Set(e.map(e=>{var t;return null!==(t=e.message.order)&&void 0!==t?t:0}));for(let e=0;e<=(null!==(t=n.message.order)&&void 0!==t?t:0);e++)if(!i.has(e))return!1;return!0},this.getStreamChunks=e=>this.removeDuplicatedRawPubnubMessages(this.rawPubnubMessages).filter(t=>t.message.stream_id===e).sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),this.reconstructStreamText=e=>this.getStreamChunks(e).map(e=>e.message.text).join(""),this.fireScheduledTourEventOnce=(e,t)=>{var n;this.firedScheduledTourConfirmationIds.has(e)||(this.firedScheduledTourConfirmationIds.add(e),Eo("scheduledTourEvent",{tourDetails:t,buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))},this.checkAndFireTourConfirmationForStream=e=>{var t;if(this.reconstructStreamText(e).includes("confirmed for your")){const n=this.getStreamChunks(e);this.fireScheduledTourEventOnce(e,null===(t=n[n.length-1])||void 0===t?void 0:t.message)}},this.checkAndHandleGTMForLeadEmail=e=>{var t;try{if("lead_message"!==e.message.customType)return;if(!(e=>{try{return/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/.test(e)}catch(e){return!1}})(e.message.text))return;Eo("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,n;for(let i=e.length-1;i>=0;i--){const r=null===(t=e[i])||void 0===t?void 0:t.message,o=i>0&&(null===(n=e[i-1])||void 0===n?void 0:n.message);(null==r?void 0:r.messageType)===vs.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&&na({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:ta.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=cs(this.chatStorageSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,u,d;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&na({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:ta.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===xh.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:fs(location.href),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,userId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.userId,leadSource:this.leadSource,trackingParams:l(this.orgSlug),widgetType:this.widgetType,isDevState:fs(location.href),...bs(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||(Eo("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),Eo("chatMessageSent",{message:e,buildingId:null===(d=this.buildingWebchatView)||void 0===d?void 0:d.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))}),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.removeDuplicatedRawPubnubMessages=e=>{const t=new Set;return e.filter(e=>{if("lead_message"===e.message.customType||!e.message.stream_id||!e.message.order)return!0;const n=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(n)?(na({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(n),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],n={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var i;if(e.message.messageType===vs.navigation){const n=(e=>{if(!e||"object"!=typeof e)return null;const{url:t,label:n}=e;if("string"!=typeof t||"string"!=typeof n)return null;if(!n.trim())return null;try{const e=new URL(t,window.location.href);return"http:"!==e.protocol&&"https:"!==e.protocol?null:{url:e.href,label:n.trim()}}catch{return null}})(e.message.navigation);n&&t.push({timestamp:e.timetoken,navigation:n,isLeadMessage:!1,type:$s.navigation})}else if("media"===e.message.messageType)t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:$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}):n[e.message.stream_id]?n[e.message.stream_id].push(e):n[e.message.stream_id]=[e]}}),Object.keys(n).forEach(e=>{const i=n[e],r=this.getConsecutiveChunks(i.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)})),o=r.map(e=>e.message.text).join(""),a=r[0],s={timestamp:a.timetoken,message:o,isLeadMessage:this.isLeadMessage(a),chunks:r.map(e=>{var t,n;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(n=e.message.is_done)&&void 0!==n&&n}}),type:$s.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,n;const i=e.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),r=[];let o=null!==(t=i[0].message.order)&&void 0!==t?t:0;for(const e of i){if((null!==(n=e.message.order)&&void 0!==n?n:-1)!==o)break;r.push(e),o++}return r},this.isMessageStillStreamingChunks=e=>{const t=e.find(e=>e.message.is_done);return!t||e.length===t.message.order},this.buildingSlug=e,this.chatStorageSlug=e,this.buildingWebchatView=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}async initSession(e,t,n){try{const i={building_slug:e,org_slug:t};this.centralConvo&&(i.central_convo=!0),n&&(i.lead_id=n);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,i);return this.sessionToken=o.data.session_token,this.leadUserId=o.data.lead_id,this.channel=o.data.channel,o.data}catch(e){return this.buildingWebchatView&&na({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:ta.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(ts())({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&&na({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:ta.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&&na({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:ta.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof i.AxiosError&&t&&t.response&&403===t.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const t=await this.fetchToken(this.leadUserId,this.channel);if(!t)return;this.pubnub.setAuthKey(t.auth.result.token),await e()}catch(e){this.buildingWebchatView&&na({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:ta.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}}async getChannelHistory(e=1500){var t;try{let n=[],i=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((n,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=i?i:void 0},(e,t)=>{e.error?o(e):n(t)})}),a=o.channels[this.channel];if(!a)break;if(a.sort((e,t)=>+e.timetoken-+t.timetoken),!a||0===a.length)break;if(this.channel&&0!==Object.keys(o.channels).length){const e=o.channels[this.channel],t=[];e.forEach(e=>{e.uuid&&t.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})}),this.markEveryPreviousNoReplyMessageDone(t),n=n.concat(t.filter(e=>e.message.messageType!==vs.noReply))}if(i=a[0].timetoken,n.length>=e||a.length<r)break}this.rawPubnubMessages=n.slice(0,e),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:!1})}catch(e){this.buildingWebchatView&&na({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}},As=p`
|
|
1622
|
+
`,Yo=(e,t,n,i,r="")=>({firstName:e.trim(),lastName:t.trim(),email:n.trim(),firmName:i.trim(),phone:r}),Ko=e=>!e.firstName||!e.lastName,Xo=(e,t)=>e.email&&Lr(e.email)?e.email.toLowerCase()===t.trim().toLowerCase()?"Enter your client's details below, not yours":null:"Enter your valid email address",Zo=e=>e?{broker_first_name:e.firstName,broker_last_name:e.lastName,broker_email:e.email,broker_firm_name:e.firmName||null,...e.phone?{broker_phone:e.phone}:{}}:{};class Jo{constructor(e,t,n,i){this.org=e,this.building=t,this.chatId=n,this.incomingProcessedLeadSource=i,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}ping(e){var t;fetch("https://app.meetelise.com/platformApi/connectors/talk_js/analytics",{method:"POST",credentials:"omit",keepalive:!0,headers:{"content-type":"application/json; charset=UTF-8"},body:JSON.stringify({eventType:e,chatId:this.chatId,url:location.href,org:this.org,building:this.building,referrer:document.referrer,featureFlags:this.featureFlags,campaignSources:ea(),incomingProcessedLeadSource:this.incomingProcessedLeadSource,webchatVersion:null!==(t="MISSING_ENV_VAR".npm_package_version)&&void 0!==t?t:"1.20.155"})})}}const ea=()=>{var e,t,n,i,r,o;try{const i=new URL(window.location.href).searchParams,r=null!==(n=null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&void 0!==n?n:null,o=i.get("switch_cls[id]"),a=i.get("ilm"),s=i.get("utm_source");return{entrataCampaignSource:o,realpageCampaignSource:a,utmCampaignSource:s,yardiCampaignSource:r,bozzutoAdSource:Dr("bozzuto_ad_source")}}catch(e){const t=document.createElement("iframe");if(t.style.display="none",document.body.appendChild(t),!t.contentWindow)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const n=t.contentWindow.URL;if(!n)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const a=new n(window.location.href).searchParams,s=null!==(o=null===(r=null===(i=window.RCTPCampaign)||void 0===i?void 0:i.CampaignDetails)||void 0===r?void 0:r.Source)&&void 0!==o?o:null;return{entrataCampaignSource:a.get("switch_cls[id]"),realpageCampaignSource:a.get("ilm"),utmCampaignSource:a.get("utm_source"),yardiCampaignSource:s,bozzutoAdSource:Dr("bozzuto_ad_source")}}};var ta;!function(e){e.error="error",e.info="info",e.warn="warn"}(ta||(ta={}));const na=async({logType:e,buildingSlug:t,orgSlug:n,logTitle:o,logData:a,error:s})=>{var l;if(s instanceof i.AxiosError&&403===(null===(l=s.response)||void 0===l?void 0:l.status))return;await r().post("https://app.meetelise.com/platformApi/webchat/logging",{...a},{headers:{"Content-Type":"application/json","building-slug":null!=t?t:"","org-slug":null!=n?n:"","log-type":null!=e?e:ta.error,"log-title":o.toUpperCase().replace(/\s/g,"_")}})},ia=async({params:e,sampleRate:t})=>{try{if(Math.random()>=t)return;await r().post("https://app.meetelise.com/platformApi/webchat/log/signal",{...e,website_origin:window.location.origin,website_search:window.location.search})}catch(e){}};var ra=n(2193),oa=n.n(ra);function aa(e){return"avb"===e?"AVB Company Website":"windsor"===e?"Windsorcommunities.com":"property-website"}const sa=class{constructor(){this.chatId=null,this.apiHost="https://app.meetelise.com",this.leadSource=null,this.leadSourceParams=null,this.localStorageTTLDays=30,this.buildingId=null,this.orgId=null,this.orgSlug=null,this.buildingSlug=null,this.queryParameters=null,this.leadSourceInput=null,this.updateLeadSourceLocalStorage=(e,t,n,i,r)=>{const o=xo();if(this.leadSourceInput={websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:o,referrer:document.referrer,parsedUtmSource:o?o.utm_source:null,campaignSources:Object.values(ea()).filter(e=>e)},i)return;if(!r){const t=this.getLeadSourceBodyIfValid(e);if(t){if(!Mr(t.timestamp,24*this.localStorageTTLDays))return{...t,timestamp:Yr(t.timestamp)}}}const a={leadSource:t,leadSourceParams:this.leadSourceParams,leadId:n,buildingSlug:e,timestamp:Fr(new Date),leadSourceInput:this.leadSourceInput};return localStorage.setItem("com.elise.webchat.leadsource.slug="+e,JSON.stringify(a)),{...a,timestamp:Yr(a.timestamp)}},this.getLeadSourceBodyIfValid=e=>{const t=localStorage.getItem("com.elise.webchat.leadsource.slug="+e);if(t)try{const n=JSON.parse(t);if(n.buildingSlug===e&&n.leadSource&&n.leadId&&n.timestamp&&!Mr(Yr(n.timestamp),24*this.localStorageTTLDays)){try{this.leadSourceInput=n.leadSourceInput}catch(e){}return n}}catch(e){return null}return null},this.resetLeadSource=()=>{if(!this.buildingSlug)return!1;const e="com.elise.webchat.leadsource.slug="+this.buildingSlug;return localStorage.removeItem(e),!0}}async fetchCurrentParsedLeadSource({buildingSlug:e,queryParams:t,referrer:n,campaignSources:i}){const o={query_params:t,building_slug:e,referrer:n,campaign_sources:i};try{return(await r().post(`${this.apiHost}/platformApi/webchat/current-parsed-lead-source`,o)).data}catch(e){return null}}async checkAndHandleForLogLeadSource({webchatAction:e,stateId:t}){var n,i,o,a,s,l,u;try{if(!this.chatId)return null;if(!this.orgSlug)return null;let d=null,c=null;try{if("f1ba5a20-d207-4e5a-879e-65199e7d0a53"===this.orgSlug){const e=await this.getCookieValue("_ga");e&&(d=e),c=null===(n=window.dataLayer.find(e=>{var t;return"gtagApiGet"==(null===(t=e.value)||void 0===t?void 0:t.event)}))||void 0===n?void 0:n.value}}catch(e){}return await r().post(`${this.apiHost}/platformApi/webchat/log/lead-source`,{chat_id:this.chatId,webchat_action:e,state_id:t,building_id:this.buildingId,org_slug:this.orgSlug,building_slug:this.buildingSlug,website_origin:null===(i=this.leadSourceInput)||void 0===i?void 0:i.websiteOrigin,website_search:null===(o=this.leadSourceInput)||void 0===o?void 0:o.websiteSearch,query_parameters:null===(a=this.leadSourceInput)||void 0===a?void 0:a.queryParameters,referrer:null===(s=this.leadSourceInput)||void 0===s?void 0:s.referrer,parsed_utm_source:null===(l=this.leadSourceInput)||void 0===l?void 0:l.parsedUtmSource,campaign_sources:null===(u=this.leadSourceInput)||void 0===u?void 0:u.campaignSources,lead_source_output:this.leadSource,google_analytics_client_id:oa()(d)?null:d,extras:null!=c?c:null}),null}catch(e){return null}}async getCookieValue(e){try{const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const i=t[n].trim();if(i.startsWith(e+"=")){return i.substring((e+"=").length,-1===i.indexOf(";")?void 0:i.indexOf(";"))}}return null}catch(e){}return null}async generateUserLeadSource({leadId:e,orgSlug:t,buildingSlug:n}){var i,r,o;try{const a={queryParams:xo(),buildingSlug:n,referrer:document.referrer,campaignSources:ea()};let s=!1;const l=n?this.getLeadSourceBodyIfValid(n):null;if(l){if(!["test-company","daf00bd2-1ecb-482c-b6f4-e1c5511a01be"].includes(t))return this.leadSource=l.leadSource,this.leadSourceParams=null!==(r=l.leadSourceParams)&&void 0!==r?r:null,this.leadSource;{const e=await this.fetchCurrentParsedLeadSource(a);if(!e)return this.leadSource=l.leadSource,this.leadSourceParams=null!==(i=l.leadSourceParams)&&void 0!==i?i:null,this.leadSource;this.leadSource=e,s=!0}}const u=await this.fetchCurrentParsedLeadSource(a);if(this.leadSource=u,this.buildingId=null,this.orgSlug=t,this.buildingSlug=n,n&&!u){const e=this.getLeadSourceBodyIfValid(n);if(e)return this.leadSource=e.leadSource,this.leadSourceParams=null!==(o=e.leadSourceParams)&&void 0!==o?o:null,this.leadSource}if(n){const t=!!u&&u.length>0;this.updateLeadSourceLocalStorage(n,u,e,!t&&!s,s)}return u}catch(e){}return null}},la=async(e,t=!1)=>{const n=`https://app.meetelise.com/eliseCrmApi/building/${e}/scheduling_status?observe_dynamic_scheduling=${t}`;try{return(await r().get(n)).data.is_enabled}catch(e){return!1}},ua=(e="black")=>G`<svg
|
|
1623
|
+
aria-hidden="true"
|
|
1624
|
+
focusable="false"
|
|
1625
|
+
slot="icon"
|
|
1626
|
+
width="26"
|
|
1627
|
+
height="25"
|
|
1628
|
+
viewBox="0 0 26 25"
|
|
1629
|
+
fill="none"
|
|
1630
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1631
|
+
>
|
|
1632
|
+
<path
|
|
1633
|
+
d="M15.6 19.5V22.1L18.2 23.4V24.7H7.80004L7.79484 23.4052L10.4 22.1V19.5H1.28965C1.11894 19.4989 0.950113 19.4642 0.792841 19.3979C0.635568 19.3315 0.492943 19.2347 0.373141 19.1131C0.253339 18.9915 0.158715 18.8474 0.0946936 18.6892C0.0306718 18.5309 -0.00148955 18.3616 5.29696e-05 18.1909V1.3091C5.29696e-05 0.586299 0.591552 0 1.28965 0H24.7104C25.4228 0 26 0.583699 26 1.3091V18.1909C26 18.9137 25.4085 19.5 24.7104 19.5H15.6ZM2.60005 14.3V16.9H23.4V14.3H2.60005Z"
|
|
1634
|
+
fill="${e}"
|
|
1635
|
+
/>
|
|
1636
|
+
</svg>`,da=(e="black")=>G`<svg
|
|
1637
|
+
aria-hidden="true"
|
|
1638
|
+
focusable="false"
|
|
1639
|
+
slot="icon"
|
|
1640
|
+
width="28"
|
|
1641
|
+
height="31"
|
|
1642
|
+
viewBox="0 0 28 31"
|
|
1643
|
+
fill="none"
|
|
1644
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1645
|
+
>
|
|
1646
|
+
<path
|
|
1647
|
+
d="M14.8334 19.1903V30.1667H0.666687C0.666248 28.4367 1.06183 26.7297 1.82311 25.1763C2.58439 23.6229 3.69118 22.2644 5.05866 21.2049C6.42614 20.1453 8.01802 19.4129 9.71232 19.0637C11.4066 18.7145 13.1584 18.7578 14.8334 19.1903ZM12 17.4167C7.30377 17.4167 3.50002 13.6129 3.50002 8.91666C3.50002 4.22041 7.30377 0.416656 12 0.416656C16.6963 0.416656 20.5 4.22041 20.5 8.91666C20.5 13.6129 16.6963 17.4167 12 17.4167ZM20.5 23.0833V18.125L27.5834 24.5L20.5 30.875V25.9167H16.25V23.0833H20.5Z"
|
|
1648
|
+
fill="${e}"
|
|
1649
|
+
/>
|
|
1650
|
+
</svg>`,ca=(e="black")=>G`<svg
|
|
1651
|
+
aria-hidden="true"
|
|
1652
|
+
focusable="false"
|
|
1653
|
+
slot="icon"
|
|
1654
|
+
width="31"
|
|
1655
|
+
height="31"
|
|
1656
|
+
viewBox="0 0 31 31"
|
|
1657
|
+
fill="none"
|
|
1658
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1659
|
+
>
|
|
1660
|
+
<path
|
|
1661
|
+
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"
|
|
1662
|
+
fill="${e}"
|
|
1663
|
+
/>
|
|
1664
|
+
</svg>`;var ha,pa,fa;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(ha||(ha={})),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"}(pa||(pa={})),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"}(fa||(fa={}));const ga=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function ma(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,i=await r().get(n);return ba(i.data)}const ba=e=>{var t;try{e.welcomeMessage=ya(null!==(t=e.welcomeMessage)&&void 0!==t?t:"",e.userFirstName)}catch(e){}return e},ya=(e,t)=>e.replace(/elise/gi,t);var va=n(7035),wa=n(6353);function Ca(e,t,n){var i=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return i.formatToParts?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value}(i,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(i,t)}function xa(e,t){var n=function(e){if(!Sa[e]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"06/25/2014 00:00:00"===t;Sa[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return Sa[e]}(t);return n.formatToParts?function(e,t){try{for(var n=e.formatToParts(t),i=[],r=0;r<n.length;r++){var o=$a[n[r].type];o>=0&&(i[o]=parseInt(n[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[i[3],i[1],i[2],i[4],i[5],i[6]]}(n,e)}var $a={year:0,month:1,day:2,hour:3,minute:4,second:5};var Sa={};function Aa(e,t,n,i,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,r,o,a),s}var ka=36e5,Ea={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ta(e,t,n){var i,r,o;if(!e)return 0;if(i=Ea.timezoneZ.exec(e))return 0;if(i=Ea.timezoneHH.exec(e))return Oa(o=parseInt(i[1],10))?-o*ka:NaN;if(i=Ea.timezoneHHMM.exec(e)){o=parseInt(i[2],10);var a=parseInt(i[3],10);return Oa(o,a)?(r=Math.abs(o)*ka+6e4*a,"+"===i[1]?-r:r):NaN}if(function(e){if(Pa[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Pa[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return Aa(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=_a(s,e),u=n?l:function(e,t,n){var i=e.getTime(),r=i-t,o=_a(new Date(r),n);if(t===o)return t;r-=o-t;var a=_a(new Date(r),n);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function _a(e,t){var n=xa(e,t),i=Aa(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),r=e.getTime(),o=r%1e3;return i-(r-=o>=0?o:1e3+o)}function Oa(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var Pa={};var Ia={X:function(e,t,n,i){var r=Na(i.timeZone,e);if(0===r)return"Z";switch(t){case"X":return La(r);case"XXXX":case"XX":return Da(r);default:return Da(r,":")}},x:function(e,t,n,i){var r=Na(i.timeZone,e);switch(t){case"x":return La(r);case"xxxx":case"xx":return Da(r);default:return Da(r,":")}},O:function(e,t,n,i){var r=Na(i.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=t||"";return n+String(r)+a+Ma(o,2)}(r,":");default:return"GMT"+Da(r,":")}},z:function(e,t,n,i){switch(t){case"z":case"zz":case"zzz":return Ca("short",e,i);default:return Ca("long",e,i)}}};function Na(e,t){var n=e?Ta(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Ma(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function Da(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e);return i+Ma(Math.floor(r/60),2)+n+Ma(Math.floor(r%60),2)}function La(e,t){return e%60==0?(e>0?"-":"+")+Ma(Math.abs(e)/60,2):Da(e,t)}const Ra=Ia;var Ua=n(9784),Ba=n(9720);var ja=36e5,Fa=6e4,Ha={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 Ga(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=t||{},i=null==n.additionalDigits?2:Ua(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r=function(e){var t,n={},i=Ha.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=Ha.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var r=Ha.timeZone.exec(t);r?(n.time=t.replace(r[1],""),n.timeZone=r[1].trim()):n.time=t}return n}(e),o=function(e,t){var n,i=Ha.YYY[t],r=Ha.YYYYY[t];if(n=Ha.YYYY.exec(e)||r.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=Ha.YY.exec(e)||i.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,i),a=o.year,s=function(e,t){if(null===t)return null;var n,i,r,o;if(0===e.length)return(i=new Date(0)).setUTCFullYear(t),i;if(n=Ha.MM.exec(e))return i=new Date(0),qa(t,r=parseInt(n[1],10)-1)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(n=Ha.DDD.exec(e)){i=new Date(0);var a=parseInt(n[1],10);return function(e,t){if(t<1)return!1;var n=Va(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,a)?(i.setUTCFullYear(t,0,a),i):new Date(NaN)}if(n=Ha.MMDD.exec(e)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return qa(t,r,s)?(i.setUTCFullYear(t,r,s),i):new Date(NaN)}if(n=Ha.Www.exec(e))return Ya(t,o=parseInt(n[1],10)-1)?za(t,o):new Date(NaN);if(n=Ha.WwwD.exec(e)){o=parseInt(n[1],10)-1;var l=parseInt(n[2],10)-1;return Ya(t,o,l)?za(t,o,l):new Date(NaN)}return null}(o.restDateString,a);if(isNaN(s))return new Date(NaN);if(s){var l,u=s.getTime(),d=0;if(r.time&&(d=function(e){var t,n,i;if(t=Ha.HH.exec(e))return Ka(n=parseFloat(t[1].replace(",",".")))?n%24*ja:NaN;if(t=Ha.HHMM.exec(e))return Ka(n=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")))?n%24*ja+i*Fa:NaN;if(t=Ha.HHMMSS.exec(e)){n=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Ka(n,i,r)?n%24*ja+i*Fa+1e3*r:NaN}return null}(r.time),isNaN(d)))return new Date(NaN);if(r.timeZone||n.timeZone){if(l=Ta(r.timeZone||n.timeZone,new Date(u+d)),isNaN(l))return new Date(NaN)}else l=Ba(new Date(u+d)),l=Ba(new Date(u+d+l));return new Date(u+d+l)}return new Date(NaN)}function za(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}var Qa=[31,28,31,30,31,30,31,31,30,31,30,31],Wa=[31,29,31,30,31,30,31,31,30,31,30,31];function Va(e){return e%400==0||e%4==0&&e%100!=0}function qa(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=Va(e);if(i&&n>Wa[t])return!1;if(!i&&n>Qa[t])return!1}return!0}function Ya(e,t,n){return!(t<0||t>52)&&(null==n||!(n<0||n>6))}function Ka(e,t,n){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var Xa=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Za(e,t,n,i){var r=va(i);return r.timeZone=t,r.originalDate=e,function(e,t,n){var i=String(t),r=n||{},o=i.match(Xa);if(o){var a=Ga(r.originalDate||e,r);i=o.reduce(function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),i="'"===e[n-1],o=e.replace(t,"'"+Ra[t[0]](a,t,null,r)+"'");return i?o.substring(0,n-1)+o.substring(n+1):o},i)}return wa(e,i,r)}(function(e,t,n){var i=Ga(e,n),r=Ta(t,i,!0),o=new Date(i.getTime()-r),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}(e,t),n,r)}const Ja="com.eliseai.webchat.googlereserve.referral",es="https://app.meetelise.com",ts=async({buildingSlug:e})=>{try{const t=await r().get(`${es}/platformApi/webchat/${e}/units/summary`);if(t.data)return Tr(t.data)}catch(t){na({logType:ta.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS_SUMMARY]",logData:{error:t},error:t})}return[]};var ns,is=n(8805),rs=n.n(is),os=new Uint8Array(16);function as(){if(!ns&&!(ns="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 ns(os)}const ss=/^(?:[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 ls=function(e){return"string"==typeof e&&ss.test(e)};for(var us=[],ds=0;ds<256;++ds)us.push((ds+256).toString(16).substr(1));const cs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(us[e[t+0]]+us[e[t+1]]+us[e[t+2]]+us[e[t+3]]+"-"+us[e[t+4]]+us[e[t+5]]+"-"+us[e[t+6]]+us[e[t+7]]+"-"+us[e[t+8]]+us[e[t+9]]+"-"+us[e[t+10]]+us[e[t+11]]+us[e[t+12]]+us[e[t+13]]+us[e[t+14]]+us[e[t+15]]).toLowerCase();if(!ls(n))throw TypeError("Stringified UUID is invalid");return n};const hs=function(e,t,n){var i=(e=e||{}).random||(e.rng||as)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return cs(i)},ps=e=>localStorage.removeItem("com.elise.webchat.slug="+e),fs=(e,t,n)=>{const i=Fr(new Date),r=n||`lead_${hs()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Yr(i),buildingSlug:e,initiatedChat:t}},gs=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if(ms(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},ms=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if(Er(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!Mr(t.timestamp,24)},bs=e=>e.startsWith("https://app.meetelise.com/settings/widgets")||e.startsWith("https://app.meetelise.com/settings/marketing/webchat")||e.includes("demo/utilities"),ys="com.elise.webchat.reopenAfterNavigation",vs=e=>{try{const t=new URL(e);return`${t.origin}${t.pathname}`}catch{return""}},ws=e=>{const t={pageUrl:vs(window.location.href),pageTitle:document.title};return"number"==typeof e&&Number.isInteger(e)&&e>0&&(t.declaredBuildingId=e),t},Cs=(e,t=e=>window.location.assign(e))=>{(()=>{try{sessionStorage.setItem(ys,"true")}catch{}})(),t(e.url)};var xs;!function(e){e.noReply="no-reply",e.text="text",e.media="media",e.navigation="navigation"}(xs||(xs={}));const $s=e=>e.type===ks.text,Ss=e=>e.type===ks.media,As=e=>e.type===ks.navigation;var ks;!function(e){e.text="text",e.media="media",e.navigation="navigation"}(ks||(ks={}));const Es=class{constructor(e,t,n,i=null,r,o,a=null,s=kh.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=kh.Default,this.centralConvo=!1,this.declaredBuildingId=null,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.sessionToken=null,this.isCurrentlyStreamingMessage=!1,this.chatListener=null,this.rawPubnubMessages=[],this.simpleChatMessages=[],this.listenerParams={message:e=>{var t,n;const i={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,i],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==xs.noReply),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),this.checkAndHandleDelayStreamingMessages();const r="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;if(null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:r}),!r&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=r,"ai_message"===e.message.customType){const t=e.message.stream_id,i=null!=t?t:String(+e.timetoken);(t?this.reconstructStreamText(t):null!==(n=e.message.text)&&void 0!==n?n:"").includes("confirmed for your")&&this.fireScheduledTourEventOnce(i,e.message)}this.checkAndHandleGTMForLeadEmail(e)}},this.isLoadingMessages=!1,this.isFirstChatMessageSent=!1,this.streamingMessageTimeout=null,this.checkAndHandleDelayStreamingMessages=({delayToFetchHistoryInMs:e=1e4}={})=>{this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null);const t=new Map;this.rawPubnubMessages.forEach(e=>{var n;const i=e.message.stream_id;i&&t.set(i,[...null!==(n=t.get(i))&&void 0!==n?n:[],e])});const n=[...t.entries()].filter(([,e])=>!this.isStreamComplete(e)).map(([e])=>e);n.length>0&&(this.streamingMessageTimeout=setTimeout(()=>{na({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory().then(()=>n.forEach(e=>this.checkAndFireTourConfirmationForStream(e)))},e))},this.isStreamComplete=e=>{var t;const n=e.find(e=>e.message.is_done);if(!n)return!1;const i=new Set(e.map(e=>{var t;return null!==(t=e.message.order)&&void 0!==t?t:0}));for(let e=0;e<=(null!==(t=n.message.order)&&void 0!==t?t:0);e++)if(!i.has(e))return!1;return!0},this.getStreamChunks=e=>this.removeDuplicatedRawPubnubMessages(this.rawPubnubMessages).filter(t=>t.message.stream_id===e).sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),this.reconstructStreamText=e=>this.getStreamChunks(e).map(e=>e.message.text).join(""),this.fireScheduledTourEventOnce=(e,t)=>{var n;this.firedScheduledTourConfirmationIds.has(e)||(this.firedScheduledTourConfirmationIds.add(e),Eo("scheduledTourEvent",{tourDetails:t,buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))},this.checkAndFireTourConfirmationForStream=e=>{var t;if(this.reconstructStreamText(e).includes("confirmed for your")){const n=this.getStreamChunks(e);this.fireScheduledTourEventOnce(e,null===(t=n[n.length-1])||void 0===t?void 0:t.message)}},this.checkAndHandleGTMForLeadEmail=e=>{var t;try{if("lead_message"!==e.message.customType)return;if(!(e=>{try{return/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/.test(e)}catch(e){return!1}})(e.message.text))return;Eo("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,n;for(let i=e.length-1;i>=0;i--){const r=null===(t=e[i])||void 0===t?void 0:t.message,o=i>0&&(null===(n=e[i-1])||void 0===n?void 0:n.message);(null==r?void 0:r.messageType)===xs.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&&na({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:ta.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=fs(this.chatStorageSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,u,d;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&na({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:ta.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===kh.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:bs(location.href),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,userId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.userId,leadSource:this.leadSource,trackingParams:l(this.orgSlug),widgetType:this.widgetType,isDevState:bs(location.href),...ws(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||(Eo("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),Eo("chatMessageSent",{message:e,buildingId:null===(d=this.buildingWebchatView)||void 0===d?void 0:d.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))}),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.removeDuplicatedRawPubnubMessages=e=>{const t=new Set;return e.filter(e=>{if("lead_message"===e.message.customType||!e.message.stream_id||!e.message.order)return!0;const n=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(n)?(na({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(n),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],n={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var i;if(e.message.messageType===xs.navigation){const n=(e=>{if(!e||"object"!=typeof e)return null;const{url:t,label:n}=e;if("string"!=typeof t||"string"!=typeof n)return null;if(!n.trim())return null;try{const e=new URL(t,window.location.href);return"http:"!==e.protocol&&"https:"!==e.protocol?null:{url:e.href,label:n.trim()}}catch{return null}})(e.message.navigation);n&&t.push({timestamp:e.timetoken,navigation:n,isLeadMessage:!1,type:ks.navigation})}else if("media"===e.message.messageType)t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:ks.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:ks.text}):n[e.message.stream_id]?n[e.message.stream_id].push(e):n[e.message.stream_id]=[e]}}),Object.keys(n).forEach(e=>{const i=n[e],r=this.getConsecutiveChunks(i.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)})),o=r.map(e=>e.message.text).join(""),a=r[0],s={timestamp:a.timetoken,message:o,isLeadMessage:this.isLeadMessage(a),chunks:r.map(e=>{var t,n;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(n=e.message.is_done)&&void 0!==n&&n}}),type:ks.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,n;const i=e.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),r=[];let o=null!==(t=i[0].message.order)&&void 0!==t?t:0;for(const e of i){if((null!==(n=e.message.order)&&void 0!==n?n:-1)!==o)break;r.push(e),o++}return r},this.isMessageStillStreamingChunks=e=>{const t=e.find(e=>e.message.is_done);return!t||e.length===t.message.order},this.buildingSlug=e,this.chatStorageSlug=e,this.buildingWebchatView=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}async initSession(e,t,n){try{const i={building_slug:e,org_slug:t};this.centralConvo&&(i.central_convo=!0),n&&(i.lead_id=n);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,i);return this.sessionToken=o.data.session_token,this.leadUserId=o.data.lead_id,this.channel=o.data.channel,o.data}catch(e){return this.buildingWebchatView&&na({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:ta.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(rs())({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&&na({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:ta.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&&na({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:ta.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof i.AxiosError&&t&&t.response&&403===t.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const t=await this.fetchToken(this.leadUserId,this.channel);if(!t)return;this.pubnub.setAuthKey(t.auth.result.token),await e()}catch(e){this.buildingWebchatView&&na({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:ta.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}}async getChannelHistory(e=1500){var t;try{let n=[],i=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((n,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=i?i:void 0},(e,t)=>{e.error?o(e):n(t)})}),a=o.channels[this.channel];if(!a)break;if(a.sort((e,t)=>+e.timetoken-+t.timetoken),!a||0===a.length)break;if(this.channel&&0!==Object.keys(o.channels).length){const e=o.channels[this.channel],t=[];e.forEach(e=>{e.uuid&&t.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})}),this.markEveryPreviousNoReplyMessageDone(t),n=n.concat(t.filter(e=>e.message.messageType!==xs.noReply))}if(i=a[0].timetoken,n.length>=e||a.length<r)break}this.rawPubnubMessages=n.slice(0,e),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:!1})}catch(e){this.buildingWebchatView&&na({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}},Ts=p`
|
|
1623
1665
|
#healthchat-container {
|
|
1624
1666
|
position: fixed;
|
|
1625
1667
|
|
|
@@ -1749,7 +1791,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
1749
1791
|
.health-bttn-allow-access {
|
|
1750
1792
|
padding-right: 28px;
|
|
1751
1793
|
}
|
|
1752
|
-
`,
|
|
1794
|
+
`,_s=p`
|
|
1753
1795
|
#pubnub-chat-container {
|
|
1754
1796
|
position: fixed;
|
|
1755
1797
|
|
|
@@ -1886,7 +1928,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
1886
1928
|
cursor: default;
|
|
1887
1929
|
opacity: 0.45;
|
|
1888
1930
|
}
|
|
1889
|
-
`,
|
|
1931
|
+
`,Os=p`
|
|
1890
1932
|
#header-text {
|
|
1891
1933
|
font-size: 12px;
|
|
1892
1934
|
font-weight: 700;
|
|
@@ -2107,7 +2149,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2107
2149
|
white-space: nowrap;
|
|
2108
2150
|
border: 0;
|
|
2109
2151
|
}
|
|
2110
|
-
`,{entries:Ts,setPrototypeOf:_s,isFrozen:Os,getPrototypeOf:Ps,getOwnPropertyDescriptor:Is}=Object;let{freeze:Ns,seal:Ms,create:Ds}=Object,{apply:Ls,construct:Rs}="undefined"!=typeof Reflect&&Reflect;Ns||(Ns=function(e){return e}),Ms||(Ms=function(e){return e}),Ls||(Ls=function(e,t,n){return e.apply(t,n)}),Rs||(Rs=function(e,t){return new e(...t)});const Us=Js(Array.prototype.forEach),Bs=Js(Array.prototype.lastIndexOf),js=Js(Array.prototype.pop),Fs=Js(Array.prototype.push),Hs=Js(Array.prototype.splice),Gs=Js(String.prototype.toLowerCase),zs=Js(String.prototype.toString),Qs=Js(String.prototype.match),Ws=Js(String.prototype.replace),Vs=Js(String.prototype.indexOf),qs=Js(String.prototype.trim),Ys=Js(Object.prototype.hasOwnProperty),Ks=Js(RegExp.prototype.test),Xs=(Zs=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Rs(Zs,t)});var Zs;function Js(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Ls(e,t,i)}}function el(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Gs;_s&&_s(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(Os(t)||(t[i]=e),r=e)}e[r]=!0}return e}function tl(e){for(let t=0;t<e.length;t++){Ys(e,t)||(e[t]=null)}return e}function nl(e){const t=Ds(null);for(const[n,i]of Ts(e)){Ys(e,n)&&(Array.isArray(i)?t[n]=tl(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=nl(i):t[n]=i)}return t}function il(e,t){for(;null!==e;){const n=Is(e,t);if(n){if(n.get)return Js(n.get);if("function"==typeof n.value)return Js(n.value)}e=Ps(e)}return function(){return null}}const rl=Ns(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ol=Ns(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),al=Ns(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sl=Ns(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ll=Ns(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ul=Ns(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dl=Ns(["#text"]),cl=Ns(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),hl=Ns(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),pl=Ns(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fl=Ns(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),gl=Ms(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ml=Ms(/<%[\w\W]*|[\w\W]*%>/gm),bl=Ms(/\$\{[\w\W]*/gm),yl=Ms(/^data-[\-\w.\u00B7-\uFFFF]+$/),vl=Ms(/^aria-[\-\w]+$/),wl=Ms(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Cl=Ms(/^(?:\w+script|data):/i),xl=Ms(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$l=Ms(/^html$/i),Sl=Ms(/^[a-z][.\w]*(-[.\w]+)+$/i);var Al=Object.freeze({__proto__:null,ARIA_ATTR:vl,ATTR_WHITESPACE:xl,CUSTOM_ELEMENT:Sl,DATA_ATTR:yl,DOCTYPE_NAME:$l,ERB_EXPR:ml,IS_ALLOWED_URI:wl,IS_SCRIPT_OR_DATA:Cl,MUSTACHE_EXPR:gl,TMPLIT_EXPR:bl});const kl=1,El=3,Tl=7,_l=8,Ol=9,Pl=function(){return"undefined"==typeof window?null:window};var Il=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pl();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==Ol||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const r=i,o=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:d,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:f}=t,g=u.prototype,m=il(g,"cloneNode"),b=il(g,"remove"),y=il(g,"nextSibling"),v=il(g,"childNodes"),w=il(g,"parentNode");if("function"==typeof s){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let C,x="";const{implementation:$,createNodeIterator:S,createDocumentFragment:A,getElementsByTagName:k}=i,{importNode:E}=r;let T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Ts&&"function"==typeof w&&$&&void 0!==$.createHTMLDocument;const{MUSTACHE_EXPR:_,ERB_EXPR:O,TMPLIT_EXPR:P,DATA_ATTR:I,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:L}=Al;let{IS_ALLOWED_URI:R}=Al,U=null;const B=el({},[...rl,...ol,...al,...ll,...dl]);let j=null;const F=el({},[...cl,...hl,...pl,...fl]);let H=Object.seal(Ds(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,z=null,Q=!0,W=!0,V=!1,q=!0,Y=!1,K=!0,X=!1,Z=!1,J=!1,ee=!1,te=!1,ne=!1,ie=!0,re=!1,oe=!0,ae=!1,se={},le=null;const ue=el({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const ce=el({},["audio","video","img","source","image","track"]);let he=null;const pe=el({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let be=me,ye=!1,ve=null;const we=el({},[fe,ge,me],zs);let Ce=el({},["mi","mo","mn","ms","mtext"]),xe=el({},["annotation-xml"]);const $e=el({},["title","style","font","a","script"]);let Se=null;const Ae=["application/xhtml+xml","text/html"];let ke=null,Ee=null;const Te=i.createElement("form"),_e=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ee||Ee!==e){if(e&&"object"==typeof e||(e={}),e=nl(e),Se=-1===Ae.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ke="application/xhtml+xml"===Se?zs:Gs,U=Ys(e,"ALLOWED_TAGS")?el({},e.ALLOWED_TAGS,ke):B,j=Ys(e,"ALLOWED_ATTR")?el({},e.ALLOWED_ATTR,ke):F,ve=Ys(e,"ALLOWED_NAMESPACES")?el({},e.ALLOWED_NAMESPACES,zs):we,he=Ys(e,"ADD_URI_SAFE_ATTR")?el(nl(pe),e.ADD_URI_SAFE_ATTR,ke):pe,de=Ys(e,"ADD_DATA_URI_TAGS")?el(nl(ce),e.ADD_DATA_URI_TAGS,ke):ce,le=Ys(e,"FORBID_CONTENTS")?el({},e.FORBID_CONTENTS,ke):ue,G=Ys(e,"FORBID_TAGS")?el({},e.FORBID_TAGS,ke):nl({}),z=Ys(e,"FORBID_ATTR")?el({},e.FORBID_ATTR,ke):nl({}),se=!!Ys(e,"USE_PROFILES")&&e.USE_PROFILES,Q=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,V=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,re=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||wl,be=e.NAMESPACE||me,Ce=e.MATHML_TEXT_INTEGRATION_POINTS||Ce,xe=e.HTML_INTEGRATION_POINTS||xe,H=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(W=!1),te&&(ee=!0),se&&(U=el({},dl),j=[],!0===se.html&&(el(U,rl),el(j,cl)),!0===se.svg&&(el(U,ol),el(j,hl),el(j,fl)),!0===se.svgFilters&&(el(U,al),el(j,hl),el(j,fl)),!0===se.mathMl&&(el(U,ll),el(j,pl),el(j,fl))),e.ADD_TAGS&&(U===B&&(U=nl(U)),el(U,e.ADD_TAGS,ke)),e.ADD_ATTR&&(j===F&&(j=nl(j)),el(j,e.ADD_ATTR,ke)),e.ADD_URI_SAFE_ATTR&&el(he,e.ADD_URI_SAFE_ATTR,ke),e.FORBID_CONTENTS&&(le===ue&&(le=nl(le)),el(le,e.FORBID_CONTENTS,ke)),oe&&(U["#text"]=!0),X&&el(U,["html","head","body"]),U.table&&(el(U,["tbody"]),delete G.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Xs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Xs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,x=C.createHTML("")}else void 0===C&&(C=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return null}}(f,o)),null!==C&&"string"==typeof x&&(x=C.createHTML(""));Ns&&Ns(e),Ee=e}},Pe=el({},[...ol,...al,...sl]),Ie=el({},[...ll,...ul]),Ne=function(e){Fs(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){b(e)}},Me=function(e,t){try{Fs(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Fs(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t=null,n=null;if(J)e="<remove></remove>"+e;else{const t=Qs(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&be===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=C?C.createHTML(e):e;if(be===me)try{t=(new p).parseFromString(r,Se)}catch(e){}if(!t||!t.documentElement){t=$.createDocument(be,"template",null);try{t.documentElement.innerHTML=ye?x:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),be===me?k.call(t,X?"html":"body")[0]:X?t.documentElement:o},Le=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Re=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof c)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ue=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,i){Us(e,e=>{e.call(n,t,i,Ee)})}const je=function(e){let t=null;if(Be(T.beforeSanitizeElements,e,null),Re(e))return Ne(e),!0;const i=ke(e.nodeName);if(Be(T.uponSanitizeElement,e,{tagName:i,allowedTags:U}),K&&e.hasChildNodes()&&!Ue(e.firstElementChild)&&Ks(/<[/\w!]/g,e.innerHTML)&&Ks(/<[/\w!]/g,e.textContent))return Ne(e),!0;if(e.nodeType===Tl)return Ne(e),!0;if(K&&e.nodeType===_l&&Ks(/<[/\w]/g,e.data))return Ne(e),!0;if(!U[i]||G[i]){if(!G[i]&&He(i)){if(H.tagNameCheck instanceof RegExp&&Ks(H.tagNameCheck,i))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(i))return!1}if(oe&&!le[i]){const t=w(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let i=n.length-1;i>=0;--i){const r=m(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,y(e))}}}return Ne(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const n=Gs(e.tagName),i=Gs(t.tagName);return!!ve[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===i||Ce[i]):Boolean(Pe[n]):e.namespaceURI===fe?t.namespaceURI===me?"math"===n:t.namespaceURI===ge?"math"===n&&xe[i]:Boolean(Ie[n]):e.namespaceURI===me?!(t.namespaceURI===ge&&!xe[i])&&!(t.namespaceURI===fe&&!Ce[i])&&!Ie[n]&&($e[n]||!Pe[n]):!("application/xhtml+xml"!==Se||!ve[e.namespaceURI]))}(e)?(Ne(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!Ks(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===El&&(t=e.textContent,Us([_,O,P],e=>{t=Ws(t,e," ")}),e.textContent!==t&&(Fs(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(T.afterSanitizeElements,e,null),!1):(Ne(e),!0)},Fe=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in Te))return!1;if(W&&!z[t]&&Ks(I,t));else if(Q&&Ks(N,t));else if(!j[t]||z[t]){if(!(He(e)&&(H.tagNameCheck instanceof RegExp&&Ks(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&Ks(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&Ks(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(he[t]);else if(Ks(R,Ws(n,D,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Vs(n,"data:")||!de[e]){if(V&&!Ks(M,Ws(n,D,"")));else if(n)return!1}else;return!0},He=function(e){return"annotation-xml"!==e&&Qs(e,L)},Ge=function(e){Be(T.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Re(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0};let r=t.length;for(;r--;){const o=t[r],{name:a,namespaceURI:s,value:l}=o,u=ke(a),d=l;let c="value"===a?d:qs(d);if(i.attrName=u,i.attrValue=c,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(T.uponSanitizeAttribute,e,i),c=i.attrValue,!re||"id"!==u&&"name"!==u||(Me(a,e),c="user-content-"+c),K&&Ks(/((--!?|])>)|<\/(style|title)/i,c)){Me(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Me(a,e);continue}if(!q&&Ks(/\/>/i,c)){Me(a,e);continue}Y&&Us([_,O,P],e=>{c=Ws(c,e," ")});const h=ke(e.nodeName);if(Fe(h,u,c)){if(C&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(h,u)){case"TrustedHTML":c=C.createHTML(c);break;case"TrustedScriptURL":c=C.createScriptURL(c)}if(c!==d)try{s?e.setAttributeNS(s,a,c):e.setAttribute(a,c),Re(e)?Ne(e):js(n.removed)}catch(t){Me(a,e)}}else Me(a,e)}Be(T.afterSanitizeAttributes,e,null)},ze=function e(t){let n=null;const i=Le(t);for(Be(T.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(T.uponSanitizeShadowNode,n,null),je(n),Ge(n),n.content instanceof a&&e(n.content);Be(T.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,u=null;if(ye=!e,ye&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ue(e)){if("function"!=typeof e.toString)throw Xs("toString is not a function");if("string"!=typeof(e=e.toString()))throw Xs("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Z||Oe(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=ke(e.nodeName);if(!U[t]||G[t])throw Xs("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)i=De("\x3c!----\x3e"),o=i.ownerDocument.importNode(e,!0),o.nodeType===kl&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!ee&&!Y&&!X&&-1===e.indexOf("<"))return C&&ne?C.createHTML(e):e;if(i=De(e),!i)return ee?null:ne?x:""}i&&J&&Ne(i.firstChild);const d=Le(ae?e:i);for(;s=d.nextNode();)je(s),Ge(s),s.content instanceof a&&ze(s.content);if(ae)return e;if(ee){if(te)for(u=A.call(i.ownerDocument);i.firstChild;)u.appendChild(i.firstChild);else u=i;return(j.shadowroot||j.shadowrootmode)&&(u=E.call(r,u,!0)),u}let c=X?i.outerHTML:i.innerHTML;return X&&U["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ks($l,i.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+c),Y&&Us([_,O,P],e=>{c=Ws(c,e," ")}),C&&ne?C.createHTML(c):c},n.setConfig=function(){Oe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Z=!0},n.clearConfig=function(){Ee=null,Z=!1},n.isValidAttribute=function(e,t,n){Ee||Oe({});const i=ke(e),r=ke(t);return Fe(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&Fs(T[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Bs(T[e],t);return-1===n?void 0:Hs(T[e],n,1)[0]}return js(T[e])},n.removeHooks=function(e){T[e]=[]},n.removeAllHooks=function(){T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Nl=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Ml=class extends ue{constructor(){super(...arguments),this.spinSpeed=.4}updated(){this.style.setProperty("--spin-duration",`${this.spinSpeed}s`)}render(){return H`<div class="spinner"></div>`}};Ml.styles=p`
|
|
2152
|
+
`,{entries:Ps,setPrototypeOf:Is,isFrozen:Ns,getPrototypeOf:Ms,getOwnPropertyDescriptor:Ds}=Object;let{freeze:Ls,seal:Rs,create:Us}=Object,{apply:Bs,construct:js}="undefined"!=typeof Reflect&&Reflect;Ls||(Ls=function(e){return e}),Rs||(Rs=function(e){return e}),Bs||(Bs=function(e,t,n){return e.apply(t,n)}),js||(js=function(e,t){return new e(...t)});const Fs=nl(Array.prototype.forEach),Hs=nl(Array.prototype.lastIndexOf),Gs=nl(Array.prototype.pop),zs=nl(Array.prototype.push),Qs=nl(Array.prototype.splice),Ws=nl(String.prototype.toLowerCase),Vs=nl(String.prototype.toString),qs=nl(String.prototype.match),Ys=nl(String.prototype.replace),Ks=nl(String.prototype.indexOf),Xs=nl(String.prototype.trim),Zs=nl(Object.prototype.hasOwnProperty),Js=nl(RegExp.prototype.test),el=(tl=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return js(tl,t)});var tl;function nl(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Bs(e,t,i)}}function il(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ws;Is&&Is(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(Ns(t)||(t[i]=e),r=e)}e[r]=!0}return e}function rl(e){for(let t=0;t<e.length;t++){Zs(e,t)||(e[t]=null)}return e}function ol(e){const t=Us(null);for(const[n,i]of Ps(e)){Zs(e,n)&&(Array.isArray(i)?t[n]=rl(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=ol(i):t[n]=i)}return t}function al(e,t){for(;null!==e;){const n=Ds(e,t);if(n){if(n.get)return nl(n.get);if("function"==typeof n.value)return nl(n.value)}e=Ms(e)}return function(){return null}}const sl=Ls(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ll=Ls(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ul=Ls(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),dl=Ls(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),cl=Ls(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),hl=Ls(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pl=Ls(["#text"]),fl=Ls(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),gl=Ls(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ml=Ls(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),bl=Ls(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yl=Rs(/\{\{[\w\W]*|[\w\W]*\}\}/gm),vl=Rs(/<%[\w\W]*|[\w\W]*%>/gm),wl=Rs(/\$\{[\w\W]*/gm),Cl=Rs(/^data-[\-\w.\u00B7-\uFFFF]+$/),xl=Rs(/^aria-[\-\w]+$/),$l=Rs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Sl=Rs(/^(?:\w+script|data):/i),Al=Rs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kl=Rs(/^html$/i),El=Rs(/^[a-z][.\w]*(-[.\w]+)+$/i);var Tl=Object.freeze({__proto__:null,ARIA_ATTR:xl,ATTR_WHITESPACE:Al,CUSTOM_ELEMENT:El,DATA_ATTR:Cl,DOCTYPE_NAME:kl,ERB_EXPR:vl,IS_ALLOWED_URI:$l,IS_SCRIPT_OR_DATA:Sl,MUSTACHE_EXPR:yl,TMPLIT_EXPR:wl});const _l=1,Ol=3,Pl=7,Il=8,Nl=9,Ml=function(){return"undefined"==typeof window?null:window};var Dl=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ml();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==Nl||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const r=i,o=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:d,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:f}=t,g=u.prototype,m=al(g,"cloneNode"),b=al(g,"remove"),y=al(g,"nextSibling"),v=al(g,"childNodes"),w=al(g,"parentNode");if("function"==typeof s){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let C,x="";const{implementation:$,createNodeIterator:S,createDocumentFragment:A,getElementsByTagName:k}=i,{importNode:E}=r;let T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Ps&&"function"==typeof w&&$&&void 0!==$.createHTMLDocument;const{MUSTACHE_EXPR:_,ERB_EXPR:O,TMPLIT_EXPR:P,DATA_ATTR:I,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:L}=Tl;let{IS_ALLOWED_URI:R}=Tl,U=null;const B=il({},[...sl,...ll,...ul,...cl,...pl]);let j=null;const F=il({},[...fl,...gl,...ml,...bl]);let H=Object.seal(Us(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,z=null,Q=!0,W=!0,V=!1,q=!0,Y=!1,K=!0,X=!1,Z=!1,J=!1,ee=!1,te=!1,ne=!1,ie=!0,re=!1,oe=!0,ae=!1,se={},le=null;const ue=il({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const ce=il({},["audio","video","img","source","image","track"]);let he=null;const pe=il({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let be=me,ye=!1,ve=null;const we=il({},[fe,ge,me],Vs);let Ce=il({},["mi","mo","mn","ms","mtext"]),xe=il({},["annotation-xml"]);const $e=il({},["title","style","font","a","script"]);let Se=null;const Ae=["application/xhtml+xml","text/html"];let ke=null,Ee=null;const Te=i.createElement("form"),_e=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ee||Ee!==e){if(e&&"object"==typeof e||(e={}),e=ol(e),Se=-1===Ae.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ke="application/xhtml+xml"===Se?Vs:Ws,U=Zs(e,"ALLOWED_TAGS")?il({},e.ALLOWED_TAGS,ke):B,j=Zs(e,"ALLOWED_ATTR")?il({},e.ALLOWED_ATTR,ke):F,ve=Zs(e,"ALLOWED_NAMESPACES")?il({},e.ALLOWED_NAMESPACES,Vs):we,he=Zs(e,"ADD_URI_SAFE_ATTR")?il(ol(pe),e.ADD_URI_SAFE_ATTR,ke):pe,de=Zs(e,"ADD_DATA_URI_TAGS")?il(ol(ce),e.ADD_DATA_URI_TAGS,ke):ce,le=Zs(e,"FORBID_CONTENTS")?il({},e.FORBID_CONTENTS,ke):ue,G=Zs(e,"FORBID_TAGS")?il({},e.FORBID_TAGS,ke):ol({}),z=Zs(e,"FORBID_ATTR")?il({},e.FORBID_ATTR,ke):ol({}),se=!!Zs(e,"USE_PROFILES")&&e.USE_PROFILES,Q=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,V=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,re=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||$l,be=e.NAMESPACE||me,Ce=e.MATHML_TEXT_INTEGRATION_POINTS||Ce,xe=e.HTML_INTEGRATION_POINTS||xe,H=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(W=!1),te&&(ee=!0),se&&(U=il({},pl),j=[],!0===se.html&&(il(U,sl),il(j,fl)),!0===se.svg&&(il(U,ll),il(j,gl),il(j,bl)),!0===se.svgFilters&&(il(U,ul),il(j,gl),il(j,bl)),!0===se.mathMl&&(il(U,cl),il(j,ml),il(j,bl))),e.ADD_TAGS&&(U===B&&(U=ol(U)),il(U,e.ADD_TAGS,ke)),e.ADD_ATTR&&(j===F&&(j=ol(j)),il(j,e.ADD_ATTR,ke)),e.ADD_URI_SAFE_ATTR&&il(he,e.ADD_URI_SAFE_ATTR,ke),e.FORBID_CONTENTS&&(le===ue&&(le=ol(le)),il(le,e.FORBID_CONTENTS,ke)),oe&&(U["#text"]=!0),X&&il(U,["html","head","body"]),U.table&&(il(U,["tbody"]),delete G.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw el('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw el('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,x=C.createHTML("")}else void 0===C&&(C=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return null}}(f,o)),null!==C&&"string"==typeof x&&(x=C.createHTML(""));Ls&&Ls(e),Ee=e}},Pe=il({},[...ll,...ul,...dl]),Ie=il({},[...cl,...hl]),Ne=function(e){zs(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){b(e)}},Me=function(e,t){try{zs(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){zs(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t=null,n=null;if(J)e="<remove></remove>"+e;else{const t=qs(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&be===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=C?C.createHTML(e):e;if(be===me)try{t=(new p).parseFromString(r,Se)}catch(e){}if(!t||!t.documentElement){t=$.createDocument(be,"template",null);try{t.documentElement.innerHTML=ye?x:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),be===me?k.call(t,X?"html":"body")[0]:X?t.documentElement:o},Le=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Re=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof c)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ue=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,i){Fs(e,e=>{e.call(n,t,i,Ee)})}const je=function(e){let t=null;if(Be(T.beforeSanitizeElements,e,null),Re(e))return Ne(e),!0;const i=ke(e.nodeName);if(Be(T.uponSanitizeElement,e,{tagName:i,allowedTags:U}),K&&e.hasChildNodes()&&!Ue(e.firstElementChild)&&Js(/<[/\w!]/g,e.innerHTML)&&Js(/<[/\w!]/g,e.textContent))return Ne(e),!0;if(e.nodeType===Pl)return Ne(e),!0;if(K&&e.nodeType===Il&&Js(/<[/\w]/g,e.data))return Ne(e),!0;if(!U[i]||G[i]){if(!G[i]&&He(i)){if(H.tagNameCheck instanceof RegExp&&Js(H.tagNameCheck,i))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(i))return!1}if(oe&&!le[i]){const t=w(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let i=n.length-1;i>=0;--i){const r=m(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,y(e))}}}return Ne(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const n=Ws(e.tagName),i=Ws(t.tagName);return!!ve[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===i||Ce[i]):Boolean(Pe[n]):e.namespaceURI===fe?t.namespaceURI===me?"math"===n:t.namespaceURI===ge?"math"===n&&xe[i]:Boolean(Ie[n]):e.namespaceURI===me?!(t.namespaceURI===ge&&!xe[i])&&!(t.namespaceURI===fe&&!Ce[i])&&!Ie[n]&&($e[n]||!Pe[n]):!("application/xhtml+xml"!==Se||!ve[e.namespaceURI]))}(e)?(Ne(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!Js(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===Ol&&(t=e.textContent,Fs([_,O,P],e=>{t=Ys(t,e," ")}),e.textContent!==t&&(zs(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(T.afterSanitizeElements,e,null),!1):(Ne(e),!0)},Fe=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in Te))return!1;if(W&&!z[t]&&Js(I,t));else if(Q&&Js(N,t));else if(!j[t]||z[t]){if(!(He(e)&&(H.tagNameCheck instanceof RegExp&&Js(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&Js(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&Js(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(he[t]);else if(Js(R,Ys(n,D,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Ks(n,"data:")||!de[e]){if(V&&!Js(M,Ys(n,D,"")));else if(n)return!1}else;return!0},He=function(e){return"annotation-xml"!==e&&qs(e,L)},Ge=function(e){Be(T.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Re(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0};let r=t.length;for(;r--;){const o=t[r],{name:a,namespaceURI:s,value:l}=o,u=ke(a),d=l;let c="value"===a?d:Xs(d);if(i.attrName=u,i.attrValue=c,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(T.uponSanitizeAttribute,e,i),c=i.attrValue,!re||"id"!==u&&"name"!==u||(Me(a,e),c="user-content-"+c),K&&Js(/((--!?|])>)|<\/(style|title)/i,c)){Me(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Me(a,e);continue}if(!q&&Js(/\/>/i,c)){Me(a,e);continue}Y&&Fs([_,O,P],e=>{c=Ys(c,e," ")});const h=ke(e.nodeName);if(Fe(h,u,c)){if(C&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(h,u)){case"TrustedHTML":c=C.createHTML(c);break;case"TrustedScriptURL":c=C.createScriptURL(c)}if(c!==d)try{s?e.setAttributeNS(s,a,c):e.setAttribute(a,c),Re(e)?Ne(e):Gs(n.removed)}catch(t){Me(a,e)}}else Me(a,e)}Be(T.afterSanitizeAttributes,e,null)},ze=function e(t){let n=null;const i=Le(t);for(Be(T.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(T.uponSanitizeShadowNode,n,null),je(n),Ge(n),n.content instanceof a&&e(n.content);Be(T.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,u=null;if(ye=!e,ye&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ue(e)){if("function"!=typeof e.toString)throw el("toString is not a function");if("string"!=typeof(e=e.toString()))throw el("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Z||Oe(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=ke(e.nodeName);if(!U[t]||G[t])throw el("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)i=De("\x3c!----\x3e"),o=i.ownerDocument.importNode(e,!0),o.nodeType===_l&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!ee&&!Y&&!X&&-1===e.indexOf("<"))return C&&ne?C.createHTML(e):e;if(i=De(e),!i)return ee?null:ne?x:""}i&&J&&Ne(i.firstChild);const d=Le(ae?e:i);for(;s=d.nextNode();)je(s),Ge(s),s.content instanceof a&&ze(s.content);if(ae)return e;if(ee){if(te)for(u=A.call(i.ownerDocument);i.firstChild;)u.appendChild(i.firstChild);else u=i;return(j.shadowroot||j.shadowrootmode)&&(u=E.call(r,u,!0)),u}let c=X?i.outerHTML:i.innerHTML;return X&&U["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Js(kl,i.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+c),Y&&Fs([_,O,P],e=>{c=Ys(c,e," ")}),C&&ne?C.createHTML(c):c},n.setConfig=function(){Oe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Z=!0},n.clearConfig=function(){Ee=null,Z=!1},n.isValidAttribute=function(e,t,n){Ee||Oe({});const i=ke(e),r=ke(t);return Fe(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&zs(T[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Hs(T[e],t);return-1===n?void 0:Qs(T[e],n,1)[0]}return Gs(T[e])},n.removeHooks=function(e){T[e]=[]},n.removeAllHooks=function(){T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Ll=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Rl=class extends ue{constructor(){super(...arguments),this.spinSpeed=.4}updated(){this.style.setProperty("--spin-duration",`${this.spinSpeed}s`)}render(){return H`<div class="spinner"></div>`}};Rl.styles=p`
|
|
2111
2153
|
.spinner {
|
|
2112
2154
|
border: 2px solid rgba(0, 0, 0, 0.2);
|
|
2113
2155
|
border-top: 2px solid #c057ff;
|
|
@@ -2125,16 +2167,16 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2125
2167
|
transform: rotate(360deg);
|
|
2126
2168
|
}
|
|
2127
2169
|
}
|
|
2128
|
-
`,
|
|
2170
|
+
`,Ll([pe({type:Number})],Rl.prototype,"spinSpeed",void 0),Rl=Ll([ce("mini-loader")],Rl);var Ul=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Bl=class extends ue{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isLeadMessage=!1,this.widgetType=kh.Default}isMessageStillStreamingChunks(){if(!this.message)return!1;const e=this.message.chunks.find(e=>e.isDone);return!e||this.message.chunks.length===e.order}updated(e){if(this.onMount(),!e.has("message"))return;if(!this.message)return;const{hyperlinks:t,markedText:n}=this.mapAndMarkHyperLinks(this.message.message),i=/(https?:\/\/[^\s]+)/g,r=[],o=[];this.parsedMessage=H`${n.trim().split("\n").map(e=>{const n=this.sanitizeMarkdownText(e),a=this.preserveHTMLTags(n);return a?H`${a.map(e=>{const n=t.filter(t=>e.includes(t.id));if(n.length){let t=e;return n.forEach(e=>{o.push({redirectTo:e.link,source:e.link}),t=t.replace(e.id,this.hyperlinkHTML(e.link,e.hyperlink))}),H`${_o(Dl.sanitize(t,{ADD_ATTR:["target"]}))} `}if(i.test(e)){const t=this.removeTrailingPunctuation(e);return r.push(this.getLinkData(t)),H`<a
|
|
2129
2171
|
class="redirect-link"
|
|
2130
2172
|
href="${t}"
|
|
2131
2173
|
target="_blank"
|
|
2132
2174
|
rel="noopener noreferrer"
|
|
2133
2175
|
>${t}
|
|
2134
|
-
</a>`}return H`${_o(
|
|
2176
|
+
</a>`}return H`${_o(Dl.sanitize(e))} `})}<br />`:H``})}`,this.imagesToDisplay=o,Promise.all(r).then(e=>{this.websitePreviewInfo=e})}hyperlinkHTML(e,t){const n=document.createElement("a");return n.className="redirect-link",n.href=e,n.target="_blank",n.rel="noopener noreferrer",n.textContent=t,n.outerHTML}preserveHTMLTags(e){var t;const n=e.match(/(<\/?[a-z][^>]*>[^<]*<\/?[a-z]*>|[^\s]+[.,?!]?|\S)/gi);return null!==(t=null==n?void 0:n.filter(e=>""!==e.trim()))&&void 0!==t?t:[]}sanitizeMarkdownText(e){return e.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/gim,"<b>$1</b>").replace(/\*(.*?)\*/gim,"<i>$1</i>").trim()}removeTrailingPunctuation(e){return[".",",","!","?",":",";"].includes(e[e.length-1])?this.removeTrailingPunctuation(e.slice(0,-1)):e}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>|<a href="[^"]+"(?: target="[^"]*")?>[^<]+<\/a>|\[.*?\]\([^)]*\.[^)]*\)/g)),n=[],i=t.map(t=>{const n=t[0];if(void 0===t.index)return;const i=e[t.index-1],r=e[t.index+n.length];if(n.startsWith("<https")||n.startsWith("<http"))return{matchedLink:n,link:n.split("|")[0].replace("<",""),hyperlink:n.split("|")[1].replace(">",""),addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)};if(n.startsWith("<a href=")){const e=n.match(/href="([^"]+)"/),t=n.match(/>[^<]+</);return{matchedLink:n,link:e?e[1]:"",hyperlink:t?t[0].slice(1,-1):"",addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)}}{const[e,t]=n.split("](");return{matchedLink:n,link:t?t.slice(0,-1):"",hyperlink:e?e.slice(1):"",addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)}}});return i.forEach(t=>{if(t&&t.link&&t.hyperlink){const i=hs().replace(/-/g,"");n.push({link:this.removeTrailingPunctuation(t.link),hyperlink:this.removeTrailingPunctuation(t.hyperlink),mark:t.matchedLink,id:i}),e=e.replace(t.matchedLink,`${t.addSpaceBefore?" ":""}${i}${t.addSpaceAfter?" ":""}`)}}),{hyperlinks:n,markedText:e}}async getLinkData(e){var t,n,i,o;try{const a=(await r().get(e)).data,s=(new DOMParser).parseFromString(a,"text/html");return s?{title:null!==(n=null===(t=s.querySelector("title"))||void 0===t?void 0:t.textContent)&&void 0!==n?n:null,description:(null===(i=s.querySelector('meta[name="description"]'))||void 0===i?void 0:i.getAttribute("content"))||null,image:(null===(o=s.querySelector('meta[property="og:image"]'))||void 0===o?void 0:o.getAttribute("content"))||null,favicon:null,link:e}:{title:null,description:null,image:null,favicon:null,link:e}}catch(t){return{title:null,description:null,image:null,favicon:null,link:e}}}render(){return this.message?H`<div class="message-inner-body">
|
|
2135
2177
|
${this.isMessageStillStreamingChunks()?H`<div class="message-loader"><mini-loader></mini-loader></div>`:""}
|
|
2136
2178
|
<p
|
|
2137
|
-
class=${Ce({"message-text":this.widgetType!==
|
|
2179
|
+
class=${Ce({"message-text":this.widgetType!==kh.Utilities,"message-text-large":this.widgetType===kh.Utilities,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}
|
|
2138
2180
|
>
|
|
2139
2181
|
${this.parsedMessage}
|
|
2140
2182
|
</p>
|
|
@@ -2165,16 +2207,16 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2165
2207
|
/>`:""}
|
|
2166
2208
|
|
|
2167
2209
|
<div class="website-preview-body">
|
|
2168
|
-
<p class=${Ce({"message-text":this.widgetType!==
|
|
2210
|
+
<p class=${Ce({"message-text":this.widgetType!==kh.Utilities,"message-text-large":this.widgetType===kh.Utilities,"website-preview-title":!0,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}>${e.title}</p>
|
|
2169
2211
|
${e.description?H`<p
|
|
2170
|
-
class=${Ce({"message-text":this.widgetType!==
|
|
2212
|
+
class=${Ce({"message-text":this.widgetType!==kh.Utilities,"message-text-large":this.widgetType===kh.Utilities,"website-preview-description":!0,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}
|
|
2171
2213
|
>
|
|
2172
2214
|
${e.description}
|
|
2173
2215
|
</p>`:""}
|
|
2174
2216
|
</div>
|
|
2175
2217
|
</div>
|
|
2176
2218
|
</a></div> `})}
|
|
2177
|
-
</div>`:H``}};
|
|
2219
|
+
</div>`:H``}};Bl.styles=[Me,Os,p`
|
|
2178
2220
|
.message-inner-body {
|
|
2179
2221
|
position: relative;
|
|
2180
2222
|
}
|
|
@@ -2183,7 +2225,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2183
2225
|
bottom: -2px;
|
|
2184
2226
|
right: -2px;
|
|
2185
2227
|
}
|
|
2186
|
-
`],
|
|
2228
|
+
`],Ul([pe({attribute:!0})],Bl.prototype,"buildingSlug",void 0),Ul([pe({attribute:!0})],Bl.prototype,"message",void 0),Ul([pe({attribute:!0})],Bl.prototype,"myPubnub",void 0),Ul([pe({attribute:!0})],Bl.prototype,"onMount",void 0),Ul([fe()],Bl.prototype,"loadingPreviews",void 0),Ul([fe()],Bl.prototype,"parsedMessage",void 0),Ul([fe()],Bl.prototype,"websitePreviewInfo",void 0),Ul([fe()],Bl.prototype,"imagesToDisplay",void 0),Ul([fe()],Bl.prototype,"imageUrlError",void 0),Ul([pe({type:Boolean})],Bl.prototype,"isLeadMessage",void 0),Ul([pe({attribute:!0})],Bl.prototype,"widgetType",void 0),Bl=Ul([ce("pubnub-message")],Bl);var jl=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Fl=class extends ue{constructor(){super(...arguments),this.onMount=()=>({}),this.showMediaAsCarousel=!0,this.activeIndex=0}updated(e){this.onMount(),e.has("message")}prevImage(){this.message&&(0===this.activeIndex?this.activeIndex=this.message.media.length-1:this.activeIndex-=1)}nextImage(){this.message&&(this.activeIndex===this.message.media.length-1?this.activeIndex=0:this.activeIndex+=1)}render(){return this.message?this.showMediaAsCarousel?H`<div class="message-inner-body">
|
|
2187
2229
|
<div class="carousel">
|
|
2188
2230
|
<div
|
|
2189
2231
|
class="image-container"
|
|
@@ -2220,7 +2262,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2220
2262
|
rel="noopener noreferrer"
|
|
2221
2263
|
><img class=${"displayed-message-image"} src=${e.url} alt=""
|
|
2222
2264
|
/></a>`)}
|
|
2223
|
-
</div>`:H``}};
|
|
2265
|
+
</div>`:H``}};Fl.styles=[Me,Os,p`
|
|
2224
2266
|
/* This element is a flex item in a bubble capped below the chat width.
|
|
2225
2267
|
Without min-width: 0 it can grow to all slides side by side, so the
|
|
2226
2268
|
carousel spills out of the bubble and the chat. */
|
|
@@ -2297,13 +2339,13 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2297
2339
|
.button:hover {
|
|
2298
2340
|
background-color: rgba(0, 0, 0, 0.8);
|
|
2299
2341
|
}
|
|
2300
|
-
`],
|
|
2342
|
+
`],jl([pe({attribute:!0})],Fl.prototype,"message",void 0),jl([pe({attribute:!0})],Fl.prototype,"myPubnub",void 0),jl([pe({attribute:!0})],Fl.prototype,"onMount",void 0),jl([fe()],Fl.prototype,"showMediaAsCarousel",void 0),jl([fe()],Fl.prototype,"activeIndex",void 0),Fl=jl([ce("pubnub-media")],Fl);var Hl=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Gl=class extends ue{constructor(){super(...arguments),this.onMount=()=>({}),this.navigate=e=>window.location.assign(e)}updated(){this.onMount()}render(){if(!this.message)return H``;const{navigation:e}=this.message;return H`<button
|
|
2301
2343
|
type="button"
|
|
2302
2344
|
class=${Ce({"navigation-button":!0,"webchat-font__desktop":!Ir(),"webchat-font__mobile":Ir()})}
|
|
2303
|
-
@click=${()=>
|
|
2345
|
+
@click=${()=>Cs(e,this.navigate)}
|
|
2304
2346
|
>
|
|
2305
2347
|
Take me to ${e.label}
|
|
2306
|
-
</button>`}};
|
|
2348
|
+
</button>`}};Gl.styles=[Me,Os,p`
|
|
2307
2349
|
.navigation-button {
|
|
2308
2350
|
cursor: pointer;
|
|
2309
2351
|
border: none;
|
|
@@ -2322,7 +2364,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2322
2364
|
outline: 2px solid #4d90fe;
|
|
2323
2365
|
outline-offset: 2px;
|
|
2324
2366
|
}
|
|
2325
|
-
`],
|
|
2367
|
+
`],Hl([pe({attribute:!1})],Gl.prototype,"message",void 0),Hl([pe({attribute:!1})],Gl.prototype,"onMount",void 0),Hl([pe({attribute:!1})],Gl.prototype,"navigate",void 0),Gl=Hl([ce("pubnub-navigation")],Gl);function zl(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Ql(e,t){si(2,arguments);var n=li(e),i=li(t),r=zl(n,i),o=Math.abs(function(e,t){si(2,arguments);var n=lr(e),i=lr(t),r=n.getTime()-qi(n),o=i.getTime()-qi(i);return Math.round((r-o)/864e5)}(n,i));n.setDate(n.getDate()-r*o);var a=r*(o-Number(zl(n,i)===-r));return 0===a?0:a}const Wl=p`
|
|
2326
2368
|
#utilities-container {
|
|
2327
2369
|
position: fixed;
|
|
2328
2370
|
|
|
@@ -2443,20 +2485,20 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2443
2485
|
.health-bttn-allow-access {
|
|
2444
2486
|
padding-right: 28px;
|
|
2445
2487
|
}
|
|
2446
|
-
`,
|
|
2488
|
+
`,Vl=(e="black")=>G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
|
|
2447
2489
|
<line x1="1.70782" y1="13.2254" x2="13.2376" y2="1.69554" stroke="${e}" stroke-width="2.13401"/>
|
|
2448
2490
|
<path d="M2.00929 1.99996L13.3328 13.3421" stroke="${e}" stroke-width="2.13401"/>
|
|
2449
|
-
</svg>`,
|
|
2491
|
+
</svg>`,ql=(e="black")=>G`
|
|
2450
2492
|
<svg aria-hidden="true" focusable="false" width="32" height="32" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2451
2493
|
<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}"/>
|
|
2452
2494
|
<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}"/>
|
|
2453
2495
|
</svg>
|
|
2454
|
-
`,
|
|
2496
|
+
`,Yl=(e="black")=>G`
|
|
2455
2497
|
<svg aria-hidden="true" focusable="false" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2456
2498
|
<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}"/>
|
|
2457
2499
|
<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}"/>
|
|
2458
2500
|
</svg>
|
|
2459
|
-
`,
|
|
2501
|
+
`,Kl=new WeakMap,Xl=e=>!!e.hasAttribute("inert")||!0===e.inert,Zl=(e,t)=>{const n=e;if(t)return e.setAttribute("inert",""),void(n.inert=!0);e.removeAttribute("inert"),n.inert=!1},Jl=e=>{e.setAttribute("aria-hidden","true"),Zl(e,!0)},eu=e=>{null===e.ariaHidden?e.element.removeAttribute("aria-hidden"):e.element.setAttribute("aria-hidden",e.ariaHidden),Zl(e.element,e.hadInert)},tu=e=>{const t={element:e,ariaHidden:e.getAttribute("aria-hidden"),hadInert:Xl(e)};return Jl(e),t};var nu,iu=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ru=nu=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=kh.Default,this.primaryColor=Zn,this.backgroundColor=Jn,this.onClickExit=()=>{localStorage.setItem("isChatOpen","false")},this.requiresConsent=!1,this._isMobile=Ir(),this.shouldAutoScroll=!0,this.messages=[],this.isLoadingMessages=!1,this.hasReceivedConsent=!1,this._replyAnnouncement="",this.announcedReplyKeys=new Set,this.hasReplySnapshot=!1,this.holdMessageFieldFocus=!1,this.sendInFlight=!1,this.releaseFocusHoldQueued=!1,this.hostPageLock=null,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.websitePreviewMapping={},this.sendMessage=async e=>{var t,n;if(0!==e.length)if(this.sendInFlight||(null===(t=this.myPubnub)||void 0===t?void 0:t.isCurrentlyStreamingMessage))this.holdMessageFieldFocus&&this.focusMessageField();else{this.sendInFlight=!0;try{this.shouldAutoScroll=!0,this.holdMessageFieldFocus=!0,this.focusMessageField(),this.messageInput.value="",this.autoResizeMessageInput(),0===this.messages.length&&(this.messages=[{timestamp:0,message:e,isLeadMessage:!0,chunks:[{text:e,order:0,isDone:!0}],type:ks.text}]),await(null===(n=this.myPubnub)||void 0===n?void 0:n.sendMessage(e))}finally{this.sendInFlight=!1,this.focusMessageField(),await this.updateComplete,this.restoreMessageFieldFocus()}}},this.scrollToChatBottom=()=>{this.shouldAutoScroll&&this.messageBody.scrollTo({top:this.messageBody.scrollHeight-this.messageBody.clientHeight,behavior:"auto"})},this.handleConversationScroll=e=>{const t=e.currentTarget,n=t.scrollHeight-t.clientHeight-t.scrollTop;this.shouldAutoScroll=n<=nu.AUTO_SCROLL_THRESHOLD_PX},this.autoResizeMessageInput=()=>{this.messageInput.style.height="auto",this.messageInput.style.height=this.messageInput.scrollHeight+"px"},this.needsConsent=()=>this.requiresConsent&&!this.hasReceivedConsent}get consentKey(){return`${this.orgSlug}Consent`}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=Nr(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),this.releaseHostPage(),super.disconnectedCallback()}firstUpdated(){var e,t;this.messages=(null===(e=this.myPubnub)||void 0===e?void 0:e.simpleChatMessages)||[],null===(t=this.myPubnub)||void 0===t||t.addChatListener(e=>{this.messages=e.messages,this.isLoadingMessages=e.isLoading}),this.onMount();const n=localStorage.getItem(this.consentKey);if(!n)return void(this.hasReceivedConsent=!1);const i=JSON.parse(n),{timestamp:r,consentId:o}=i;Ql(new Date,new Date(r))<7&&o===Go?this.hasReceivedConsent=!0:(this.hasReceivedConsent=!1,localStorage.removeItem(this.consentKey))}willUpdate(){this.syncReplyAnnouncement()}syncReplyAnnouncement(){var e;const t=(null===(e=this.building)||void 0===e?void 0:e.userFirstName)||"Elise",n=this.messages.flatMap(e=>{const n=du(e,t);return n?[{key:uu(e),announcement:n}]:[]});if(!this.hasReplySnapshot){if(0===this.messages.length)return;return n.forEach(({key:e})=>this.announcedReplyKeys.add(e)),void(this.hasReplySnapshot=!0)}const i=n.filter(({key:e})=>!this.announcedReplyKeys.has(e));if(0===i.length)return;i.forEach(({key:e})=>this.announcedReplyKeys.add(e));const r=i.map(({announcement:e})=>e).join(" "),o=this._replyAnnouncement.replace(/\u200b/g,"");this._replyAnnouncement=r!==o||this._replyAnnouncement.endsWith("")?r:`${r}`}renderReplyAnnouncer(){return H`<div
|
|
2460
2502
|
id="reply-announcer"
|
|
2461
2503
|
class="sr-only"
|
|
2462
2504
|
role="status"
|
|
@@ -2464,12 +2506,12 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2464
2506
|
aria-atomic="true"
|
|
2465
2507
|
>
|
|
2466
2508
|
${this._replyAnnouncement}
|
|
2467
|
-
</div>`}async updated(){this.scrollToChatBottom(),this.syncHostPage(),this.restoreMessageFieldFocus(),this.scheduleFocusHoldRelease()}syncHostPage(){if(!this._isMobile)return void this.releaseHostPage();const e=(e=>{let t=e,n=t.getRootNode();for(;n instanceof ShadowRoot;)t=n.host,n=t.getRootNode();return t instanceof Element?t:null})(this);(null==e?void 0:e.parentElement)&&(this.hostPageLock=e,(e=>{var t;const n=e.parentElement;if(!n)return;const i=new Map((null!==(t=
|
|
2509
|
+
</div>`}async updated(){this.scrollToChatBottom(),this.syncHostPage(),this.restoreMessageFieldFocus(),this.scheduleFocusHoldRelease()}syncHostPage(){if(!this._isMobile)return void this.releaseHostPage();const e=(e=>{let t=e,n=t.getRootNode();for(;n instanceof ShadowRoot;)t=n.host,n=t.getRootNode();return t instanceof Element?t:null})(this);(null==e?void 0:e.parentElement)&&(this.hostPageLock=e,(e=>{var t;const n=e.parentElement;if(!n)return;const i=new Map((null!==(t=Kl.get(e))&&void 0!==t?t:[]).map(e=>[e.element,e])),r=[];for(const t of Array.from(n.children)){if(t===e)continue;const n=i.get(t);n?(r.push(n),i.delete(t),Jl(t)):r.push(tu(t))}i.forEach(e=>eu(e)),Kl.set(e,r)})(e))}releaseHostPage(){this.hostPageLock&&((e=>{const t=Kl.get(e);t&&(t.forEach(e=>eu(e)),Kl.delete(e))})(this.hostPageLock),this.hostPageLock=null)}restoreMessageFieldFocus(){if(!this.holdMessageFieldFocus)return;const e=function(){var e;let t=document.activeElement;for(;null===(e=null==t?void 0:t.shadowRoot)||void 0===e?void 0:e.activeElement;)t=t.shadowRoot.activeElement;return t}();if(e instanceof HTMLElement&&"message-input"===e.id)return;const t=!e||e===document.body||e===document.documentElement,n=e instanceof HTMLElement&&"send-message-bttn"===e.id;(t||n)&&this.focusMessageField()}scheduleFocusHoldRelease(){var e;this.holdMessageFieldFocus&&!this.releaseFocusHoldQueued&&(this.sendInFlight||this.isLoadingMessages||(null===(e=this.myPubnub)||void 0===e?void 0:e.isCurrentlyStreamingMessage)||(this.releaseFocusHoldQueued=!0,requestAnimationFrame(()=>{var e;this.releaseFocusHoldQueued=!1,this.sendInFlight||this.isLoadingMessages||(null===(e=this.myPubnub)||void 0===e?void 0:e.isCurrentlyStreamingMessage)||(this.restoreMessageFieldFocus(),this.holdMessageFieldFocus=!1)})))}renderMessageFieldLabel(e){return H`<label
|
|
2468
2510
|
class="message-input-label"
|
|
2469
2511
|
for="message-input"
|
|
2470
2512
|
style=${Xn({color:e})}
|
|
2471
2513
|
>${"Message"}</label
|
|
2472
|
-
>`}focusMessageField(){const e=this.shadowRoot,t=null==e?void 0:e.getElementById("message-input");return!!(t instanceof HTMLTextAreaElement&&e)&&(0!==t.getClientRects().length&&(e.activeElement!==t&&t.focus({preventScroll:!0}),e.activeElement===t))}trapTabInMobileDialog(e){var t;if(!this._isMobile)return;const n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat-container");n&&
|
|
2514
|
+
>`}focusMessageField(){const e=this.shadowRoot,t=null==e?void 0:e.getElementById("message-input");return!!(t instanceof HTMLTextAreaElement&&e)&&(0!==t.getClientRects().length&&(e.activeElement!==t&&t.focus({preventScroll:!0}),e.activeElement===t))}trapTabInMobileDialog(e){var t;if(!this._isMobile)return;const n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat-container");n&&au(e,n)}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$;if(!this.buildingSlug&&!this.centralConvo)return H``;const S=(null===(e=this.building)||void 0===e?void 0:e.userFirstName)||"Elise",A=null===(t=this.building)||void 0===t?void 0:t.id;let k={};if(k=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===A&&(k={...k,fontFamily:'"Helvetica Neue", Arial'}),this.widgetType===kh.Utilities)return H`
|
|
2473
2515
|
<div
|
|
2474
2516
|
id="utilities-container"
|
|
2475
2517
|
class=${Ce({"pubnub-container__mobile":this._isMobile,"utilities-container__desktop":!this._isMobile})}
|
|
@@ -2484,7 +2526,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2484
2526
|
@click=${this.onClickExit}
|
|
2485
2527
|
aria-label="Close chat"
|
|
2486
2528
|
>
|
|
2487
|
-
${
|
|
2529
|
+
${Vl("black")}
|
|
2488
2530
|
</button>
|
|
2489
2531
|
</div>
|
|
2490
2532
|
<div
|
|
@@ -2520,19 +2562,19 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2520
2562
|
class=${e.isLeadMessage?"message-container lead-message":"message-container ai-message"}
|
|
2521
2563
|
key=${e.timestamp}
|
|
2522
2564
|
role="article"
|
|
2523
|
-
aria-label="${e.isLeadMessage?"You":S}: ${
|
|
2565
|
+
aria-label="${e.isLeadMessage?"You":S}: ${lu(e)}"
|
|
2524
2566
|
>
|
|
2525
|
-
${
|
|
2567
|
+
${As(e)?H`<pubnub-navigation
|
|
2526
2568
|
.message=${e}
|
|
2527
2569
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
2528
2570
|
></pubnub-navigation>`:""}
|
|
2529
|
-
${
|
|
2571
|
+
${Ss(e)?H` <pubnub-media
|
|
2530
2572
|
.message=${e}
|
|
2531
2573
|
.myPubnub=${this.myPubnub}
|
|
2532
2574
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
2533
2575
|
>
|
|
2534
2576
|
</pubnub-media>`:""}
|
|
2535
|
-
${
|
|
2577
|
+
${$s(e)?H` <pubnub-message
|
|
2536
2578
|
.message=${e}
|
|
2537
2579
|
.myPubnub=${this.myPubnub}
|
|
2538
2580
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
@@ -2577,12 +2619,12 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2577
2619
|
class=${Ce({"health-bttn-allow-access":this._isMobile})}
|
|
2578
2620
|
@click=${()=>this.sendMessage(this.messageInput.value)}
|
|
2579
2621
|
>
|
|
2580
|
-
${
|
|
2622
|
+
${ql("black")}
|
|
2581
2623
|
</button>
|
|
2582
2624
|
</div>
|
|
2583
2625
|
</div>
|
|
2584
2626
|
</div>
|
|
2585
|
-
`;if(this.widgetType===
|
|
2627
|
+
`;if(this.widgetType===kh.Healthcare)return H`
|
|
2586
2628
|
<div
|
|
2587
2629
|
id="healthchat-container"
|
|
2588
2630
|
class=${Ce({"pubnub-container__mobile":this._isMobile,"healthchat-container__desktop":!this._isMobile})}
|
|
@@ -2601,7 +2643,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2601
2643
|
@click=${this.onClickExit}
|
|
2602
2644
|
aria-label="Close chat"
|
|
2603
2645
|
>
|
|
2604
|
-
${
|
|
2646
|
+
${Vl("black")}
|
|
2605
2647
|
</button>
|
|
2606
2648
|
</div>
|
|
2607
2649
|
<div
|
|
@@ -2638,19 +2680,19 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2638
2680
|
class=${e.isLeadMessage?"message-container lead-message":"message-container ai-message"}
|
|
2639
2681
|
key=${e.timestamp}
|
|
2640
2682
|
role="article"
|
|
2641
|
-
aria-label="${e.isLeadMessage?"You":S}: ${
|
|
2683
|
+
aria-label="${e.isLeadMessage?"You":S}: ${lu(e)}"
|
|
2642
2684
|
>
|
|
2643
|
-
${
|
|
2685
|
+
${As(e)?H`<pubnub-navigation
|
|
2644
2686
|
.message=${e}
|
|
2645
2687
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
2646
2688
|
></pubnub-navigation>`:""}
|
|
2647
|
-
${
|
|
2689
|
+
${Ss(e)?H` <pubnub-media
|
|
2648
2690
|
.message=${e}
|
|
2649
2691
|
.myPubnub=${this.myPubnub}
|
|
2650
2692
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
2651
2693
|
>
|
|
2652
2694
|
</pubnub-media>`:""}
|
|
2653
|
-
${
|
|
2695
|
+
${$s(e)?H` <pubnub-message
|
|
2654
2696
|
.message=${e}
|
|
2655
2697
|
.myPubnub=${this.myPubnub}
|
|
2656
2698
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
@@ -2695,7 +2737,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2695
2737
|
class=${Ce({"health-bttn-allow-access":this._isMobile})}
|
|
2696
2738
|
@click=${()=>this.sendMessage(this.messageInput.value)}
|
|
2697
2739
|
>
|
|
2698
|
-
${this._isMobile?
|
|
2740
|
+
${this._isMobile?ql("black"):Yl("black")}
|
|
2699
2741
|
</button>
|
|
2700
2742
|
</div>
|
|
2701
2743
|
</div>
|
|
@@ -2722,7 +2764,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2722
2764
|
@click=${this.onClickExit}
|
|
2723
2765
|
aria-label="Close chat"
|
|
2724
2766
|
>
|
|
2725
|
-
${
|
|
2767
|
+
${Vl("black")}
|
|
2726
2768
|
</button>
|
|
2727
2769
|
</div>
|
|
2728
2770
|
<div
|
|
@@ -2757,19 +2799,19 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2757
2799
|
class=${go()("message-container",{"lead-message":e.isLeadMessage,"ai-message":!e.isLeadMessage,"with-box-shadow":444===E})}
|
|
2758
2800
|
key=${e.timestamp}
|
|
2759
2801
|
role="article"
|
|
2760
|
-
aria-label="${e.isLeadMessage?"You":S}: ${
|
|
2802
|
+
aria-label="${e.isLeadMessage?"You":S}: ${lu(e)}"
|
|
2761
2803
|
>
|
|
2762
|
-
${
|
|
2804
|
+
${As(e)?H`<pubnub-navigation
|
|
2763
2805
|
.message=${e}
|
|
2764
2806
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
2765
2807
|
></pubnub-navigation>`:""}
|
|
2766
|
-
${
|
|
2808
|
+
${Ss(e)?H` <pubnub-media
|
|
2767
2809
|
.message=${e}
|
|
2768
2810
|
.myPubnub=${this.myPubnub}
|
|
2769
2811
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
2770
2812
|
>
|
|
2771
2813
|
</pubnub-media>`:""}
|
|
2772
|
-
${
|
|
2814
|
+
${$s(e)?H` <pubnub-message
|
|
2773
2815
|
.message=${e}
|
|
2774
2816
|
.myPubnub=${this.myPubnub}
|
|
2775
2817
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
@@ -2813,11 +2855,11 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2813
2855
|
aria-disabled=${this.sendInFlight||(null===($=this.myPubnub)||void 0===$?void 0:$.isCurrentlyStreamingMessage)?"true":"false"}
|
|
2814
2856
|
aria-label="Send message"
|
|
2815
2857
|
>
|
|
2816
|
-
${ii(this.building.orgId,this.building.id)&&this.primaryColor!==Zn?
|
|
2858
|
+
${ii(this.building.orgId,this.building.id)&&this.primaryColor!==Zn?Yl("black"):Yl("white")}
|
|
2817
2859
|
</button>
|
|
2818
2860
|
</div>
|
|
2819
2861
|
</div>
|
|
2820
|
-
`}};function nu(e){const t=ru(e)[0];return!!t&&(t.focus(),!0)}function iu(e,t){if("Tab"!==e.key)return;const n=function(e){var t;let n=document.activeElement;for(;null===(t=null==n?void 0:n.shadowRoot)||void 0===t?void 0:t.activeElement;)n=n.shadowRoot.activeElement;if(!(n instanceof HTMLElement))return null;let i=n;for(;i;){if(i===e)return n;i=i instanceof ShadowRoot?i.host:i.parentNode}return null}(t);if(!n)return;const i=ru(t);if(0===i.length)return void e.preventDefault();const r=i.indexOf(n),o=0===r,a=r===i.length-1;if(e.shiftKey&&(n===t||o))return e.preventDefault(),void i[i.length-1].focus();e.shiftKey||n!==t&&!a||(e.preventDefault(),i[0].focus())}function ru(e){const t=[],n=e=>{e instanceof Element&&e.shadowRoot&&n(e.shadowRoot),e.querySelectorAll("*").forEach(e=>{(function(e){if("-1"===e.getAttribute("tabindex"))return!1;if("disabled"in e&&e.disabled)return!1;const t="BUTTON"===e.tagName||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||"A"===e.tagName&&e.hasAttribute("href")||e.hasAttribute("tabindex");return t&&e.getClientRects().length>0})(e)&&t.push(e),e.shadowRoot&&n(e.shadowRoot)})};return n(e),t}tu.AUTO_SCROLL_THRESHOLD_PX=32,tu.styles=[Me,Es,ks,As,Gl],eu([pe({type:Number})],tu.prototype,"right",void 0),eu([pe({type:Number})],tu.prototype,"bottom",void 0),eu([pe({type:Number})],tu.prototype,"top",void 0),eu([pe({type:Number})],tu.prototype,"left",void 0),eu([pe({attribute:!0})],tu.prototype,"onMount",void 0),eu([pe({attribute:!0})],tu.prototype,"channel",void 0),eu([pe({attribute:!0})],tu.prototype,"isHealthChat",void 0),eu([pe({attribute:!0})],tu.prototype,"myPubnub",void 0),eu([pe({attribute:!0})],tu.prototype,"orgSlug",void 0),eu([pe({attribute:!0})],tu.prototype,"buildingSlug",void 0),eu([pe({attribute:!0})],tu.prototype,"centralConvo",void 0),eu([pe({attribute:!0})],tu.prototype,"widgetType",void 0),eu([pe({attribute:!0})],tu.prototype,"building",void 0),eu([pe({attribute:!0})],tu.prototype,"primaryColor",void 0),eu([pe({attribute:!0})],tu.prototype,"backgroundColor",void 0),eu([pe({attribute:!0})],tu.prototype,"onClickExit",void 0),eu([pe({attribute:!0})],tu.prototype,"requiresConsent",void 0),eu([ge("#message-input",!0)],tu.prototype,"messageInput",void 0),eu([ge("#conversation-body",!0)],tu.prototype,"messageBody",void 0),eu([fe()],tu.prototype,"_isMobile",void 0),eu([fe()],tu.prototype,"messages",void 0),eu([fe()],tu.prototype,"isLoadingMessages",void 0),eu([fe()],tu.prototype,"hasReceivedConsent",void 0),eu([fe()],tu.prototype,"_replyAnnouncement",void 0),eu([fe()],tu.prototype,"sendInFlight",void 0),eu([fe()],tu.prototype,"privacyPolicyUrl",void 0),eu([fe()],tu.prototype,"websitePreviewMapping",void 0),tu=Jl=eu([ce("pubnub-chat")],tu);const ou=e=>ws(e)?e.message:xs(e)?`Take me to ${e.navigation.label}`:"Media message",au=e=>`${e.type}:${e.timestamp}`,su=(e,t)=>e.isLeadMessage||ws(e)&&(e=>{const t=e.chunks.find(e=>e.isDone);return!t||e.chunks.length===t.order})(e)?null:`${t}: ${ou(e)}`;var lu=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let uu=class extends ue{constructor(){super(...arguments),this.tourTypeOptions=[],this.layoutOptions=[],this.chatId="",this.buildingId=0,this.orgId=0,this.leadSourceParams=null,this.buildingSlug="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.selfGuidedTourEnabled=!1,this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.orgSlug="",this.hasDynamicSchedulingEnabled=!1,this.bedroomPreferenceRequired=!1,this.brokerIntakeEnabled=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingName="",this.trapOverlayTab=e=>{iu(e,this)},this.movedFocusInside=!1,this.tourType=null,this.shouldShowTourType={[du.Guided]:!0,[du.Self]:!0,[du.Virtual]:!0},this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1,this.availabilitiesGroupedByDay={},this.calendarTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.shouldAllowScheduling=!1,this.shouldAllowScheduleLoading=!0,this.promptForReschedule=!1,this.canceledReschedule=!1,this.isBrokerReferral=!1,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerFirmName="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneCountry=null,this.brokerPhoneIsValid=!1,this.brokerPhoneHasBlurred=!1,this.leadSources=[],this.orgLegalName="",this.country=null,this.buildingState=null,this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.firstNameInputValue="",this.lastNameInputValue="",this.leadSourceInputValue="",this.selectedLayoutValue="",this.selectedUnitValue="",this.units=[],this.allowOccupiedUnitTours=!1,this.errorGettingAvailabilities=!1,this.centralConvoBuildings=[],this.isGeneralBuilding=!1,this.statusMessage="",this.useCoastalCustomTourTypes=!1,this._setAvailabilities=async()=>{try{const[e,t]=await Promise.all([la(this.buildingId,this.hasDynamicSchedulingEnabled),lo()]);this.shouldAllowScheduling=e,this.shouldAllowScheduleLoading=!1,this.calendarTimeZone=await(async e=>{var t;return null!==(t=(await ao(e)).calendarTimeZone)&&void 0!==t?t:Intl.DateTimeFormat().resolvedOptions().timeZone})(this.buildingId),na({logTitle:"AVAILABILITIES_EXIST_FOR_TOUR_TYPE",logData:t,logType:ta.info,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});const n=Object.values(t).every(e=>!1===e),i=!this.sgtUrl&&!this.escortedToursLink&&!this.virtualToursLink;if(n&&i)return this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,void na({logTitle:"NO_AVAILABILITIES_EXIST",logData:null,logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.shouldShowTourType={[du.Guided]:this.tourTypeOptions.map(e=>e.value).includes("WITH_AGENT")&&(t[du.Guided]||!!this.escortedToursLink),[du.Self]:this.tourTypeOptions.map(e=>e.value).includes("SELF_GUIDED")&&(t[du.Self]||!!this.sgtUrl),[du.Virtual]:this.tourTypeOptions.map(e=>e.value).includes("VIRTUAL_SHOWING")&&(t[du.Virtual]||!!this.virtualToursLink)};const r=1===Object.values(this.shouldShowTourType).reduce((e,t)=>!0===t?e+1:e,0);if(this._setDefaultSelectedDateAndTimes(),r&&(this.tourType=Object.keys(this.shouldShowTourType).find(e=>this.shouldShowTourType[e])),null===this.tourType)return void(this.waitingForAvailabilities=!1);this.availabilitiesGroupedByDay=await uo(cu[this.tourType]),this.waitingForAvailabilities=!1}catch(e){this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,na({logTitle:"ERROR_LOADING_AVAILABILITIES",logData:{error:e},logType:ta.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this._setDefaultSelectedDateAndTimes=async(e,t)=>{var n,i,r;const o=await ao(this.buildingId),a=null!=e?e:this._getHighestRankedTourType(o),s=a?null===(r=null===(i=null===(n=o.availability)||void 0===n?void 0:n[a])||void 0===i?void 0:i.availableTourStartTimes)||void 0===r?void 0:r.filter(e=>{if(!t)return!0;return ur("string"==typeof e?Yr(e):e,t)}):[],l=null==s?void 0:s[0];a&&l&&a!==zr.Unknown&&a!==zr.MediaTour&&(this.selectedDate=lr("string"==typeof l?Yr(l):l),this.tourType=hu[a],this.selectedTime="string"==typeof l?co(l):(e=>({datetime:ir(e,"yyyy-MM-dd'T'HH:mm:ss"),offset:ir(e,"xxx")}))(l))},this._getHighestRankedTourType=e=>{var t;const n=(null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]).map(t=>{var n,i;return{tourType:t,availabilities:null===(i=null===(n=e.availability)||void 0===n?void 0:n[t])||void 0===i?void 0:i.availableTourStartTimes}}).filter(e=>{if(e.tourType===zr.Unknown||e.tourType===zr.MediaTour)return!1;const t=hu[e.tourType],n=this._getTourTypeOffered(t);return!!n&&(!ha(0,n)&&e.availabilities&&e.availabilities.length>0)}),i=n[0];return i?i.tourType:null},this._getTourTypeOffered=e=>e===du.Guided?this.escortedToursTypeOffered:e===du.Self?this.selfGuidedToursTypeOffered:e===du.Virtual?this.virtualToursTypeOffered:null,this._getUnitOptions=()=>{const e=this.selectedLayoutValue?this.units.filter(e=>mu(10*e.numberOfBedrooms)===this.selectedLayoutValue):this.units,t=e.map(e=>({label:e.unitNumber,value:e.unitNumber}));return t},this._fetchUnits=async()=>{if(this.buildingSlug)try{this.units=await Za({buildingSlug:this.buildingSlug})}catch(e){this.units=[],na({logTitle:"ERROR_LOADING_UNITS_FOR_TOUR_SCHEDULER",logData:{error:e},logType:ta.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this.firstUpdated=async()=>{if(await this._fetchCentralConvoBuildings(),this.isGeneralBuilding)return this.waitingForAvailabilities=!1,this.shouldAllowScheduleLoading=!1,void(this.statusMessage="Please select a building to see tour availabilities.");await this._loadForCurrentBuilding()},this._loadForCurrentBuilding=async()=>{const e=async function(e){if(!e)return!1;try{return!0===(await r().get(vo(e),{params:{rollout_name:"coastal_custom_tour_types",default_value:!1},timeout:3e3})).data}catch(e){return!1}}(this.buildingSlug);try{await ao(this.buildingId)}catch(e){}this.useCoastalCustomTourTypes=await e,await Promise.all([this._setAvailabilities().then(async()=>{try{const e=await ao(this.buildingId);this.allowOccupiedUnitTours=!!e.allowOccupiedUnitTours}catch(e){this.allowOccupiedUnitTours=!1}}),this._fetchUnits()])},this._fetchCentralConvoBuildings=async()=>{if(this.orgSlug&&this.buildingSlug)try{const e=await async function(e,t){var n,i;const o=(await r().get("https://app.meetelise.com/platformApi/webchat/central-convo-buildings-v2",{headers:{"building-slug":t,"org-slug":e}})).data;return{is_general_building:null!==(n=null==o?void 0:o.is_general_building)&&void 0!==n&&n,buildings:null!==(i=null==o?void 0:o.buildings)&&void 0!==i?i:[]}}(this.orgSlug,this.buildingSlug);this.centralConvoBuildings=e.buildings,this.isGeneralBuilding=e.is_general_building}catch(e){this.centralConvoBuildings=[],this.isGeneralBuilding=!1}},this._onBuildingChange=async()=>{var e;const t=null===(e=this.selectedBuildingEl)||void 0===e?void 0:e.value;if(!t||t===this.buildingSlug)return;const n=this.centralConvoBuildings.find(e=>e.slug===t);if(n){this.isGeneralBuilding=!1,this.waitingForAvailabilities=!0,this.errorGettingAvailabilities=!1,this.tourType=null,this.selectedDate=void 0,this.selectedTime=void 0,this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.units=[],this.selectedLayoutValue="",this.selectedUnitValue="",this.buildingId=n.building_id,this.buildingSlug=n.slug,this.buildingName=n.name,this.statusMessage=`Loading tours for ${n.name}…`,Eo("tourBuildingSelected",{buildingId:n.building_id});try{const e=await pa(this.orgSlug,n.slug);this.sgtUrl=e.sgtUrl,this.selfGuidedToursTypeOffered=e.selfGuidedToursTypeOffered,this.selfGuidedTourEnabled=e.isSelfGuidedTourEnabled,this.escortedToursLink=e.escortedToursLink,this.escortedToursTypeOffered=e.escortedToursTypeOffered,this.virtualToursLink=e.virtualToursLink,this.virtualToursTypeOffered=e.virtualToursTypeOffered,this.tourTypeOptions=e.tourTypeOptions.map(e=>({label:e.label,value:e.value})),this.hasDynamicSchedulingEnabled=e.usesDynamicScheduling}catch(e){}if(await this._loadForCurrentBuilding(),!this.shouldAllowScheduling||this.errorGettingAvailabilities)this.statusMessage=`No tour availabilities for ${n.name}.`;else{const e=Object.values(this.shouldShowTourType).filter(Boolean).length;this.statusMessage=`Showing tours for ${n.name}. ${e} tour type${1===e?"":"s"} available.`}}},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await uo(cu[this.tourType]))},this.onChangePhoneNumber=e=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country,this.phoneNumberIsValid=e.detail.isValid},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangeBrokerPhone=e=>{this.brokerPhone=e.detail.formattedValue,this.brokerPhoneE164=e.detail.e164,this.brokerPhoneCountry=e.detail.country,this.brokerPhoneIsValid=e.detail.isValid},this.onToggleBrokerReferral=e=>{const t=e.target.checked,n=!(this.brokerFirstName||this.brokerLastName||this.brokerEmail||this.brokerPhone),i=!(this.firstNameInputValue||this.lastNameInputValue||this.email||this.phoneNumber);t&&n?(this.brokerFirstName=this.firstNameInputValue,this.brokerLastName=this.lastNameInputValue,this.brokerEmail=this.email,this.brokerPhone=this.phoneNumber,this.brokerPhoneE164=this.phoneNumberE164,this.brokerPhoneCountry=this.phoneCountry,this.brokerPhoneIsValid=this.phoneNumberIsValid,this.brokerPhoneHasBlurred=this.phoneNumberHasBlurred,this.firstNameInputValue="",this.lastNameInputValue="",this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1):!t&&i&&(this.firstNameInputValue=this.brokerFirstName,this.lastNameInputValue=this.brokerLastName,this.email=this.brokerEmail,this.phoneNumber=this.brokerPhone,this.phoneNumberE164=this.brokerPhoneE164,this.phoneCountry=this.brokerPhoneCountry,this.phoneNumberIsValid=this.brokerPhoneIsValid,this.phoneNumberHasBlurred=this.brokerPhoneHasBlurred,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneIsValid=!1,this.brokerPhoneHasBlurred=!1),this.isBrokerReferral=t},this.brokerReferral=()=>{var e;return this.brokerIntakeEnabled&&this.isBrokerReferral?Yo(this.brokerFirstName,this.brokerLastName,this.brokerEmail,this.brokerFirmName,null!==(e=this.brokerPhoneE164)&&void 0!==e?e:""):null},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n,i;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&Lr(null!==(i=null===(n=this.emailInput)||void 0===n?void 0:n.value)&&void 0!==i?i:"")&&!!this.phoneNumber&&!!this.phoneNumberE164},layout:()=>!this.bedroomPreferenceRequired||!!this.selectedLayoutValue,broker:()=>{const e=this.brokerReferral();return!e||!Ko(e)&&!Xo(e,this.email)&&(!this.brokerPhone||this.brokerPhoneIsValid)}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo()&&this.validators.layout()&&this.validators.broker(),this.timeStringToHoursAndMinutes=e=>{const[t,n]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(n)]},this.submit=async()=>{var e,t,n,i,o,a,s,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const A=this.phoneNumberE164;if(!A)return void(this.phoneNumberIsValid=!1);if(!this.validators.broker())return;const k=this.brokerReferral(),E=new URLSearchParams(window.location.search);let T=null;T=this.selectedLeadSource&&this.selectedLeadSource.value&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:this.leadSourceInputValue&&this.leadSourceInputValue.length>0?this.leadSourceInputValue:this.currentLeadSource;const _=[...new Set(T?[T,"property-website"]:["property-website"])];this.firstNameInput&&(this.firstNameInputValue=this.firstNameInput.value),this.lastNameInput&&(this.lastNameInputValue=this.lastNameInput.value),this.leadSourceInputValue=T;const O=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||this.selectedLayoutValue||null,P=(null===(t=this.selectedUnitEl)||void 0===t?void 0:t.value)||this.selectedUnitValue||null;Eo("scheduleTourSubmitted",{email:this.email,phone:A,firstName:null!==(i=null===(n=this.firstNameInput)||void 0===n?void 0:n.value)&&void 0!==i?i:this.firstNameInputValue,lastName:null!==(a=null===(o=this.lastNameInput)||void 0===o?void 0:o.value)&&void 0!==a?a:this.lastNameInputValue,tourType:gu[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,originatingSource:_.find(e=>"property-website"!==e)||null,layout:O,unit:P,conversationTrackingId:null!==(u=null===(s=this.leadSourceClient)||void 0===s?void 0:s.chatId)&&void 0!==u?u:null,...k?{isBrokerReferral:!0}:{}});const I=(()=>{var e;try{const t=JSON.parse(null!==(e=localStorage.getItem(Ka))&&void 0!==e?e:"null");return(null==t?void 0:t.rwgToken)&&Date.now()<t.expiresAt?t:null}catch{return null}})(),N={referrer:document.referrer,email_address:this.email,phone_number:A,building_id:this.buildingId,tracking_params:l(this.orgSlug),first_name:null!==(c=null===(d=this.firstNameInput)||void 0===d?void 0:d.value)&&void 0!==c?c:this.firstNameInputValue,last_name:null!==(p=null===(h=this.lastNameInput)||void 0===h?void 0:h.value)&&void 0!==p?p:this.lastNameInputValue,tour_type:gu[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,cancel_existing_tours:this.promptForReschedule,lead_sources:[...new Set(T?[T,aa(this.orgSlug)]:[aa(this.orgSlug)])],query_params:Object.fromEntries(E.entries()),conversation_tracking_id:null===(f=this.leadSourceClient)||void 0===f?void 0:f.chatId,layouts:O?[O]:void 0,unit_numbers:P?[P]:void 0,lead_sources_with_timestamps:(null!==(b=null===(g=this.leadSourceMultitouchClient)||void 0===g?void 0:g.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(m=this.selectedLeadSource)||void 0===m?void 0:m.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}))&&void 0!==b?b:[]).map(e=>_r({...e})),google_rwg_token:null==I?void 0:I.rwgToken,google_referral_building_id:null==I?void 0:I.buildingId,google_environment:null==I?void 0:I.environment,...Zo(k)};this.isSubmitting=!0;try{await r().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",N,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE","org-slug":this.orgSlug}}),null===(y=this.leadSourceClient)||void 0===y||y.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(v=this.leadSourceClient)||void 0===v||v.resetLeadSource(),null===(w=this.leadSourceMultitouchClient)||void 0===w||w.resetLeadSourceTouchpoints(),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e,n=(null===(x=null===(C=t.response)||void 0===C?void 0:C.data)||void 0===x?void 0:x.detail)||"Failed to book tour";if(t.response&&t.response.headers&&t.response.headers["funnel-prospect-conflicting-appointment-error"]){if(this.selectedDate&&this.selectedTime){const e=this.availabilitiesGroupedByDay[ir(this.selectedDate,"yyyy-MM-dd")];e&&(this.availabilitiesGroupedByDay[ir(this.selectedDate,"yyyy-MM-dd")]=e.filter(e=>e!==this.selectedTime))}}else{if(409===(null===($=t.response)||void 0===$?void 0:$.status)&&!this.promptForReschedule&&"User already has a tour scheduled for this building"===n)return this.promptForReschedule=!0,this.isSubmitting=!1,void(this.tourIsBooked=!1);if(409===(null===(S=t.response)||void 0===S?void 0:S.status)&&!this.promptForReschedule)return this.isSubmitting=!1,this.tourIsBooked=!1,oo(),this.availabilitiesGroupedByDay=await uo(cu[this.tourType],this.buildingId),void alert("This timeslot is no longer available. Please select a different time.")}alert(n),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>H`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>H`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo()&&this.validators.broker(),nextButtonText:null,renderNextButton:()=>H` <action-confirm-button
|
|
2862
|
+
`}};function ou(e){const t=su(e)[0];return!!t&&(t.focus(),!0)}function au(e,t){if("Tab"!==e.key)return;const n=function(e){var t;let n=document.activeElement;for(;null===(t=null==n?void 0:n.shadowRoot)||void 0===t?void 0:t.activeElement;)n=n.shadowRoot.activeElement;if(!(n instanceof HTMLElement))return null;let i=n;for(;i;){if(i===e)return n;i=i instanceof ShadowRoot?i.host:i.parentNode}return null}(t);if(!n)return;const i=su(t);if(0===i.length)return void e.preventDefault();const r=i.indexOf(n),o=0===r,a=r===i.length-1;if(e.shiftKey&&(n===t||o))return e.preventDefault(),void i[i.length-1].focus();e.shiftKey||n!==t&&!a||(e.preventDefault(),i[0].focus())}function su(e){const t=[],n=e=>{e instanceof Element&&e.shadowRoot&&n(e.shadowRoot),e.querySelectorAll("*").forEach(e=>{(function(e){if("-1"===e.getAttribute("tabindex"))return!1;if("disabled"in e&&e.disabled)return!1;const t="BUTTON"===e.tagName||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||"A"===e.tagName&&e.hasAttribute("href")||e.hasAttribute("tabindex");return t&&e.getClientRects().length>0})(e)&&t.push(e),e.shadowRoot&&n(e.shadowRoot)})};return n(e),t}ru.AUTO_SCROLL_THRESHOLD_PX=32,ru.styles=[Me,Os,_s,Ts,Wl],iu([pe({type:Number})],ru.prototype,"right",void 0),iu([pe({type:Number})],ru.prototype,"bottom",void 0),iu([pe({type:Number})],ru.prototype,"top",void 0),iu([pe({type:Number})],ru.prototype,"left",void 0),iu([pe({attribute:!0})],ru.prototype,"onMount",void 0),iu([pe({attribute:!0})],ru.prototype,"channel",void 0),iu([pe({attribute:!0})],ru.prototype,"isHealthChat",void 0),iu([pe({attribute:!0})],ru.prototype,"myPubnub",void 0),iu([pe({attribute:!0})],ru.prototype,"orgSlug",void 0),iu([pe({attribute:!0})],ru.prototype,"buildingSlug",void 0),iu([pe({attribute:!0})],ru.prototype,"centralConvo",void 0),iu([pe({attribute:!0})],ru.prototype,"widgetType",void 0),iu([pe({attribute:!0})],ru.prototype,"building",void 0),iu([pe({attribute:!0})],ru.prototype,"primaryColor",void 0),iu([pe({attribute:!0})],ru.prototype,"backgroundColor",void 0),iu([pe({attribute:!0})],ru.prototype,"onClickExit",void 0),iu([pe({attribute:!0})],ru.prototype,"requiresConsent",void 0),iu([ge("#message-input",!0)],ru.prototype,"messageInput",void 0),iu([ge("#conversation-body",!0)],ru.prototype,"messageBody",void 0),iu([fe()],ru.prototype,"_isMobile",void 0),iu([fe()],ru.prototype,"messages",void 0),iu([fe()],ru.prototype,"isLoadingMessages",void 0),iu([fe()],ru.prototype,"hasReceivedConsent",void 0),iu([fe()],ru.prototype,"_replyAnnouncement",void 0),iu([fe()],ru.prototype,"sendInFlight",void 0),iu([fe()],ru.prototype,"privacyPolicyUrl",void 0),iu([fe()],ru.prototype,"websitePreviewMapping",void 0),ru=nu=iu([ce("pubnub-chat")],ru);const lu=e=>$s(e)?e.message:As(e)?`Take me to ${e.navigation.label}`:"Media message",uu=e=>`${e.type}:${e.timestamp}`,du=(e,t)=>e.isLeadMessage||$s(e)&&(e=>{const t=e.chunks.find(e=>e.isDone);return!t||e.chunks.length===t.order})(e)?null:`${t}: ${lu(e)}`;var cu=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let hu=class extends ue{constructor(){super(...arguments),this.tourTypeOptions=[],this.layoutOptions=[],this.chatId="",this.buildingId=0,this.orgId=0,this.leadSourceParams=null,this.buildingSlug="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.selfGuidedTourEnabled=!1,this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.orgSlug="",this.hasDynamicSchedulingEnabled=!1,this.bedroomPreferenceRequired=!1,this.brokerIntakeEnabled=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingName="",this.trapOverlayTab=e=>{au(e,this)},this.movedFocusInside=!1,this.tourType=null,this.shouldShowTourType={[pu.Guided]:!0,[pu.Self]:!0,[pu.Virtual]:!0},this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1,this.availabilitiesGroupedByDay={},this.calendarTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.shouldAllowScheduling=!1,this.shouldAllowScheduleLoading=!0,this.promptForReschedule=!1,this.canceledReschedule=!1,this.isBrokerReferral=!1,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerFirmName="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneCountry=null,this.brokerPhoneIsValid=!1,this.brokerPhoneHasBlurred=!1,this.leadSources=[],this.orgLegalName="",this.country=null,this.buildingState=null,this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.firstNameInputValue="",this.lastNameInputValue="",this.leadSourceInputValue="",this.selectedLayoutValue="",this.selectedUnitValue="",this.units=[],this.allowOccupiedUnitTours=!1,this.errorGettingAvailabilities=!1,this.centralConvoBuildings=[],this.isGeneralBuilding=!1,this.statusMessage="",this.useCoastalCustomTourTypes=!1,this.tourTypeOrder=bu,this._setAvailabilities=async()=>{try{const[e,t]=await Promise.all([la(this.buildingId,this.hasDynamicSchedulingEnabled),lo()]);this.shouldAllowScheduling=e,this.shouldAllowScheduleLoading=!1,this.calendarTimeZone=await(async e=>{var t;return null!==(t=(await ao(e)).calendarTimeZone)&&void 0!==t?t:Intl.DateTimeFormat().resolvedOptions().timeZone})(this.buildingId),na({logTitle:"AVAILABILITIES_EXIST_FOR_TOUR_TYPE",logData:t,logType:ta.info,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});const n=Object.values(t).every(e=>!1===e),i=!this.sgtUrl&&!this.escortedToursLink&&!this.virtualToursLink;if(n&&i)return this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,void na({logTitle:"NO_AVAILABILITIES_EXIST",logData:null,logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.shouldShowTourType={[pu.Guided]:this.tourTypeOptions.map(e=>e.value).includes("WITH_AGENT")&&(t[pu.Guided]||!!this.escortedToursLink),[pu.Self]:this.tourTypeOptions.map(e=>e.value).includes("SELF_GUIDED")&&(t[pu.Self]||!!this.sgtUrl),[pu.Virtual]:this.tourTypeOptions.map(e=>e.value).includes("VIRTUAL_SHOWING")&&(t[pu.Virtual]||!!this.virtualToursLink)};const r=1===Object.values(this.shouldShowTourType).reduce((e,t)=>!0===t?e+1:e,0);if(this._setDefaultSelectedDateAndTimes(),r&&(this.tourType=Object.keys(this.shouldShowTourType).find(e=>this.shouldShowTourType[e])),null===this.tourType)return void(this.waitingForAvailabilities=!1);this.availabilitiesGroupedByDay=await uo(fu[this.tourType]),this.waitingForAvailabilities=!1}catch(e){this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,na({logTitle:"ERROR_LOADING_AVAILABILITIES",logData:{error:e},logType:ta.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this._setDefaultSelectedDateAndTimes=async(e,t)=>{var n,i,r;const o=await ao(this.buildingId),a=null!=e?e:this._getHighestRankedTourType(o),s=a?null===(r=null===(i=null===(n=o.availability)||void 0===n?void 0:n[a])||void 0===i?void 0:i.availableTourStartTimes)||void 0===r?void 0:r.filter(e=>{if(!t)return!0;return ur("string"==typeof e?Yr(e):e,t)}):[],l=null==s?void 0:s[0];a&&l&&a!==zr.Unknown&&a!==zr.MediaTour&&(this.selectedDate=lr("string"==typeof l?Yr(l):l),this.tourType=gu[a],this.selectedTime="string"==typeof l?co(l):(e=>({datetime:ir(e,"yyyy-MM-dd'T'HH:mm:ss"),offset:ir(e,"xxx")}))(l))},this._getHighestRankedTourType=e=>{var t;const n=(null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]).map(t=>{var n,i;return{tourType:t,availabilities:null===(i=null===(n=e.availability)||void 0===n?void 0:n[t])||void 0===i?void 0:i.availableTourStartTimes}}).filter(e=>{if(e.tourType===zr.Unknown||e.tourType===zr.MediaTour)return!1;const t=gu[e.tourType],n=this._getTourTypeOffered(t);return!!n&&(!ga(0,n)&&e.availabilities&&e.availabilities.length>0)}),i=n[0];return i?i.tourType:null},this._getTourTypeOffered=e=>e===pu.Guided?this.escortedToursTypeOffered:e===pu.Self?this.selfGuidedToursTypeOffered:e===pu.Virtual?this.virtualToursTypeOffered:null,this._getUnitOptions=()=>{const e=this.selectedLayoutValue?this.units.filter(e=>wu(10*e.numberOfBedrooms)===this.selectedLayoutValue):this.units,t=e.map(e=>({label:e.unitNumber,value:e.unitNumber}));return t},this._fetchUnits=async()=>{if(this.buildingSlug)try{this.units=await ts({buildingSlug:this.buildingSlug})}catch(e){this.units=[],na({logTitle:"ERROR_LOADING_UNITS_FOR_TOUR_SCHEDULER",logData:{error:e},logType:ta.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}},this.firstUpdated=async()=>{if(await this._fetchCentralConvoBuildings(),this.isGeneralBuilding)return this.waitingForAvailabilities=!1,this.shouldAllowScheduleLoading=!1,void(this.statusMessage="Please select a building to see tour availabilities.");await this._loadForCurrentBuilding()},this._loadForCurrentBuilding=async()=>{const e=async function(e){if(!e)return!1;try{return!0===(await r().get(vo(e),{params:{rollout_name:"coastal_custom_tour_types",default_value:!1},timeout:3e3})).data}catch(e){return!1}}(this.buildingSlug);this.tourTypeOrder=function(e){const t=e.flatMap(e=>bu.filter(t=>fu[t]===e));let n=0;return bu.map(e=>t.includes(e)?t[n++]:e)}(await ao(this.buildingId).then(e=>{var t;return null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]},()=>[])),this.useCoastalCustomTourTypes=await e,await Promise.all([this._setAvailabilities().then(async()=>{try{const e=await ao(this.buildingId);this.allowOccupiedUnitTours=!!e.allowOccupiedUnitTours}catch(e){this.allowOccupiedUnitTours=!1}}),this._fetchUnits()])},this._fetchCentralConvoBuildings=async()=>{if(this.orgSlug&&this.buildingSlug)try{const e=await async function(e,t){var n,i;const o=(await r().get("https://app.meetelise.com/platformApi/webchat/central-convo-buildings-v2",{headers:{"building-slug":t,"org-slug":e}})).data;return{is_general_building:null!==(n=null==o?void 0:o.is_general_building)&&void 0!==n&&n,buildings:null!==(i=null==o?void 0:o.buildings)&&void 0!==i?i:[]}}(this.orgSlug,this.buildingSlug);this.centralConvoBuildings=e.buildings,this.isGeneralBuilding=e.is_general_building}catch(e){this.centralConvoBuildings=[],this.isGeneralBuilding=!1}},this._onBuildingChange=async()=>{var e;const t=null===(e=this.selectedBuildingEl)||void 0===e?void 0:e.value;if(!t||t===this.buildingSlug)return;const n=this.centralConvoBuildings.find(e=>e.slug===t);if(n){this.isGeneralBuilding=!1,this.waitingForAvailabilities=!0,this.errorGettingAvailabilities=!1,this.tourType=null,this.selectedDate=void 0,this.selectedTime=void 0,this.availabilitiesGroupedByDay={},this.mobilePageIndex=0,this.units=[],this.selectedLayoutValue="",this.selectedUnitValue="",this.buildingId=n.building_id,this.buildingSlug=n.slug,this.buildingName=n.name,this.statusMessage=`Loading tours for ${n.name}…`,Eo("tourBuildingSelected",{buildingId:n.building_id});try{const e=await ma(this.orgSlug,n.slug);this.sgtUrl=e.sgtUrl,this.selfGuidedToursTypeOffered=e.selfGuidedToursTypeOffered,this.selfGuidedTourEnabled=e.isSelfGuidedTourEnabled,this.escortedToursLink=e.escortedToursLink,this.escortedToursTypeOffered=e.escortedToursTypeOffered,this.virtualToursLink=e.virtualToursLink,this.virtualToursTypeOffered=e.virtualToursTypeOffered,this.tourTypeOptions=e.tourTypeOptions.map(e=>({label:e.label,value:e.value})),this.hasDynamicSchedulingEnabled=e.usesDynamicScheduling}catch(e){}if(await this._loadForCurrentBuilding(),!this.shouldAllowScheduling||this.errorGettingAvailabilities)this.statusMessage=`No tour availabilities for ${n.name}.`;else{const e=Object.values(this.shouldShowTourType).filter(Boolean).length;this.statusMessage=`Showing tours for ${n.name}. ${e} tour type${1===e?"":"s"} available.`}}},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await uo(fu[this.tourType]))},this.onChangePhoneNumber=e=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country,this.phoneNumberIsValid=e.detail.isValid},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangeBrokerPhone=e=>{this.brokerPhone=e.detail.formattedValue,this.brokerPhoneE164=e.detail.e164,this.brokerPhoneCountry=e.detail.country,this.brokerPhoneIsValid=e.detail.isValid},this.onToggleBrokerReferral=e=>{const t=e.target.checked,n=!(this.brokerFirstName||this.brokerLastName||this.brokerEmail||this.brokerPhone),i=!(this.firstNameInputValue||this.lastNameInputValue||this.email||this.phoneNumber);t&&n?(this.brokerFirstName=this.firstNameInputValue,this.brokerLastName=this.lastNameInputValue,this.brokerEmail=this.email,this.brokerPhone=this.phoneNumber,this.brokerPhoneE164=this.phoneNumberE164,this.brokerPhoneCountry=this.phoneCountry,this.brokerPhoneIsValid=this.phoneNumberIsValid,this.brokerPhoneHasBlurred=this.phoneNumberHasBlurred,this.firstNameInputValue="",this.lastNameInputValue="",this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneNumberIsValid=!1,this.phoneNumberHasBlurred=!1):!t&&i&&(this.firstNameInputValue=this.brokerFirstName,this.lastNameInputValue=this.brokerLastName,this.email=this.brokerEmail,this.phoneNumber=this.brokerPhone,this.phoneNumberE164=this.brokerPhoneE164,this.phoneCountry=this.brokerPhoneCountry,this.phoneNumberIsValid=this.brokerPhoneIsValid,this.phoneNumberHasBlurred=this.brokerPhoneHasBlurred,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneIsValid=!1,this.brokerPhoneHasBlurred=!1),this.isBrokerReferral=t},this.brokerReferral=()=>{var e;return this.brokerIntakeEnabled&&this.isBrokerReferral?Yo(this.brokerFirstName,this.brokerLastName,this.brokerEmail,this.brokerFirmName,null!==(e=this.brokerPhoneE164)&&void 0!==e?e:""):null},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n,i;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&Lr(null!==(i=null===(n=this.emailInput)||void 0===n?void 0:n.value)&&void 0!==i?i:"")&&!!this.phoneNumber&&!!this.phoneNumberE164},layout:()=>!this.bedroomPreferenceRequired||!!this.selectedLayoutValue,broker:()=>{const e=this.brokerReferral();return!e||!Ko(e)&&!Xo(e,this.email)&&(!this.brokerPhone||this.brokerPhoneIsValid)}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo()&&this.validators.layout()&&this.validators.broker(),this.timeStringToHoursAndMinutes=e=>{const[t,n]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(n)]},this.submit=async()=>{var e,t,n,i,o,a,s,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const A=this.phoneNumberE164;if(!A)return void(this.phoneNumberIsValid=!1);if(!this.validators.broker())return;const k=this.brokerReferral(),E=new URLSearchParams(window.location.search);let T=null;T=this.selectedLeadSource&&this.selectedLeadSource.value&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:this.leadSourceInputValue&&this.leadSourceInputValue.length>0?this.leadSourceInputValue:this.currentLeadSource;const _=[...new Set(T?[T,"property-website"]:["property-website"])];this.firstNameInput&&(this.firstNameInputValue=this.firstNameInput.value),this.lastNameInput&&(this.lastNameInputValue=this.lastNameInput.value),this.leadSourceInputValue=T;const O=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||this.selectedLayoutValue||null,P=(null===(t=this.selectedUnitEl)||void 0===t?void 0:t.value)||this.selectedUnitValue||null;Eo("scheduleTourSubmitted",{email:this.email,phone:A,firstName:null!==(i=null===(n=this.firstNameInput)||void 0===n?void 0:n.value)&&void 0!==i?i:this.firstNameInputValue,lastName:null!==(a=null===(o=this.lastNameInput)||void 0===o?void 0:o.value)&&void 0!==a?a:this.lastNameInputValue,tourType:vu[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,originatingSource:_.find(e=>"property-website"!==e)||null,layout:O,unit:P,conversationTrackingId:null!==(u=null===(s=this.leadSourceClient)||void 0===s?void 0:s.chatId)&&void 0!==u?u:null,...k?{isBrokerReferral:!0}:{}});const I=(()=>{var e;try{const t=JSON.parse(null!==(e=localStorage.getItem(Ja))&&void 0!==e?e:"null");return(null==t?void 0:t.rwgToken)&&Date.now()<t.expiresAt?t:null}catch{return null}})(),N={referrer:document.referrer,email_address:this.email,phone_number:A,building_id:this.buildingId,tracking_params:l(this.orgSlug),first_name:null!==(c=null===(d=this.firstNameInput)||void 0===d?void 0:d.value)&&void 0!==c?c:this.firstNameInputValue,last_name:null!==(p=null===(h=this.lastNameInput)||void 0===h?void 0:h.value)&&void 0!==p?p:this.lastNameInputValue,tour_type:vu[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,cancel_existing_tours:this.promptForReschedule,lead_sources:[...new Set(T?[T,aa(this.orgSlug)]:[aa(this.orgSlug)])],query_params:Object.fromEntries(E.entries()),conversation_tracking_id:null===(f=this.leadSourceClient)||void 0===f?void 0:f.chatId,layouts:O?[O]:void 0,unit_numbers:P?[P]:void 0,lead_sources_with_timestamps:(null!==(b=null===(g=this.leadSourceMultitouchClient)||void 0===g?void 0:g.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(m=this.selectedLeadSource)||void 0===m?void 0:m.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}))&&void 0!==b?b:[]).map(e=>_r({...e})),google_rwg_token:null==I?void 0:I.rwgToken,google_referral_building_id:null==I?void 0:I.buildingId,google_environment:null==I?void 0:I.environment,...Zo(k)};this.isSubmitting=!0;try{await r().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",N,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE","org-slug":this.orgSlug}}),null===(y=this.leadSourceClient)||void 0===y||y.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(v=this.leadSourceClient)||void 0===v||v.resetLeadSource(),null===(w=this.leadSourceMultitouchClient)||void 0===w||w.resetLeadSourceTouchpoints(),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e,n=(null===(x=null===(C=t.response)||void 0===C?void 0:C.data)||void 0===x?void 0:x.detail)||"Failed to book tour";if(t.response&&t.response.headers&&t.response.headers["funnel-prospect-conflicting-appointment-error"]){if(this.selectedDate&&this.selectedTime){const e=this.availabilitiesGroupedByDay[ir(this.selectedDate,"yyyy-MM-dd")];e&&(this.availabilitiesGroupedByDay[ir(this.selectedDate,"yyyy-MM-dd")]=e.filter(e=>e!==this.selectedTime))}}else{if(409===(null===($=t.response)||void 0===$?void 0:$.status)&&!this.promptForReschedule&&"User already has a tour scheduled for this building"===n)return this.promptForReschedule=!0,this.isSubmitting=!1,void(this.tourIsBooked=!1);if(409===(null===(S=t.response)||void 0===S?void 0:S.status)&&!this.promptForReschedule)return this.isSubmitting=!1,this.tourIsBooked=!1,oo(),this.availabilitiesGroupedByDay=await uo(fu[this.tourType],this.buildingId),void alert("This timeslot is no longer available. Please select a different time.")}alert(n),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>H`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>H`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo()&&this.validators.broker(),nextButtonText:null,renderNextButton:()=>H` <action-confirm-button
|
|
2821
2863
|
id="schedule-bttn"
|
|
2822
2864
|
.onClick=${this.submit}
|
|
2823
2865
|
.isLoading=${this.isSubmitting}
|
|
@@ -2837,7 +2879,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2837
2879
|
@change=${this.onToggleBrokerReferral}
|
|
2838
2880
|
/>
|
|
2839
2881
|
</label>
|
|
2840
|
-
`}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab),this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("aria-modal")||this.setAttribute("aria-modal","true"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Schedule a Tour")}openSelfGuidedTour(){const e=52===this.orgId?function(e,t){if(!e||!t)return e;try{const n=new URL(e);return Object.entries(t).forEach(([e,t])=>{n.searchParams.set(e,t)}),n.toString()}catch(t){return e}}(this.sgtUrl,xo()):this.sgtUrl;window.open(e,"_blank")}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}updated(){this.movedFocusInside||(
|
|
2882
|
+
`}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab),this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("aria-modal")||this.setAttribute("aria-modal","true"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Schedule a Tour")}openSelfGuidedTour(){const e=52===this.orgId?function(e,t){if(!e||!t)return e;try{const n=new URL(e);return Object.entries(t).forEach(([e,t])=>{n.searchParams.set(e,t)}),n.toString()}catch(t){return e}}(this.sgtUrl,xo()):this.sgtUrl;window.open(e,"_blank")}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}updated(){this.movedFocusInside||(ou(this)?this.movedFocusInside=!0:(this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),this.matches(":focus")||this.focus({preventScroll:!0})))}coastalTourLabel(e){return this.useCoastalCustomTourTypes?mu[e]:void 0}confirmationTourName(e){var t;return null!==(t=this.coastalTourLabel(e))&&void 0!==t?t:yu[e]}buildingSelectMenu(){return H`<me-select
|
|
2841
2883
|
id="building"
|
|
2842
2884
|
placeholder="Select a property"
|
|
2843
2885
|
.value=${this.isGeneralBuilding?"":this.buildingSlug}
|
|
@@ -2845,89 +2887,45 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
2845
2887
|
@change=${this._onBuildingChange}
|
|
2846
2888
|
>
|
|
2847
2889
|
</me-select>`}buildingSelector(){if(this.isGeneralBuilding){if(0===this.centralConvoBuildings.length)return""}else if(this.centralConvoBuildings.length<=1)return"";return H`<h2 class="journey-header">Building</h2>
|
|
2848
|
-
${this.buildingSelectMenu()}`}tourTypeMenu(){
|
|
2890
|
+
${this.buildingSelectMenu()}`}tourTypeMenu(){var e,t;const n={[pu.Self]:this.shouldShowTourType[pu.Self]?H` <tour-type-option
|
|
2891
|
+
heading=${null!==(e=this.coastalTourLabel(pu.Self))&&void 0!==e?e:"Take a tour"}
|
|
2892
|
+
subtitle=${this.coastalTourLabel(pu.Self)?"":"on your own"}
|
|
2893
|
+
.primaryColor=${this.primaryColor}
|
|
2894
|
+
.foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
|
|
2895
|
+
@click="${async()=>{this.tourType=pu.Self,Eo("tourTypeSelected",{tourType:pu.Self,buildingId:this.buildingId}),this.sgtUrl&&ga(pu.Self,this.selfGuidedToursTypeOffered)&&this.openSelfGuidedTour(),this.availabilitiesGroupedByDay=await uo(fu[pu.Self]),this._setDefaultSelectedDateAndTimes(fu[pu.Self])}}"
|
|
2896
|
+
@keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=pu.Self)}}"
|
|
2897
|
+
?selected="${this.tourType===pu.Self}"
|
|
2898
|
+
>
|
|
2899
|
+
${da(this.tourType===pu.Self?this.foregroundColorOnPrimaryBackgroundColor:oi)}
|
|
2900
|
+
</tour-type-option>`:"",[pu.Guided]:this.shouldShowTourType[pu.Guided]?H` <tour-type-option
|
|
2901
|
+
heading=${null!==(t=this.coastalTourLabel(pu.Guided))&&void 0!==t?t:"Guided tour"}
|
|
2902
|
+
subtitle=${this.coastalTourLabel(pu.Guided)?"":"with an agent"}
|
|
2903
|
+
.primaryColor=${this.primaryColor}
|
|
2904
|
+
.foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
|
|
2905
|
+
@click="${async()=>{this.tourType=pu.Guided,Eo("tourTypeSelected",{tourType:pu.Guided,buildingId:this.buildingId}),this.escortedToursLink&&ga(pu.Guided,this.escortedToursTypeOffered)&&window.open(this.escortedToursLink,"_blank"),this.availabilitiesGroupedByDay=await uo(fu[pu.Guided]),this._setDefaultSelectedDateAndTimes(fu[pu.Guided])}}"
|
|
2906
|
+
@keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=pu.Guided)}}"
|
|
2907
|
+
?selected="${this.tourType===pu.Guided}"
|
|
2908
|
+
>
|
|
2909
|
+
${ca(this.tourType===pu.Guided?this.foregroundColorOnPrimaryBackgroundColor:oi)}
|
|
2910
|
+
</tour-type-option>`:"",[pu.Virtual]:this.shouldShowTourType[pu.Virtual]?H` <tour-type-option
|
|
2911
|
+
heading="Virtual tour"
|
|
2912
|
+
subtitle="over video"
|
|
2913
|
+
.primaryColor=${this.primaryColor}
|
|
2914
|
+
.foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
|
|
2915
|
+
@click="${async()=>{this.tourType=pu.Virtual,Eo("tourTypeSelected",{tourType:pu.Virtual,buildingId:this.buildingId}),this.virtualToursLink&&ga(pu.Virtual,this.virtualToursTypeOffered)&&window.open(this.virtualToursLink,"_blank"),this.availabilitiesGroupedByDay=await uo(fu[pu.Virtual]),this._setDefaultSelectedDateAndTimes(fu[pu.Virtual])}}"
|
|
2916
|
+
@keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=pu.Virtual)}}"
|
|
2917
|
+
?selected="${this.tourType===pu.Virtual}"
|
|
2918
|
+
>
|
|
2919
|
+
${ua(this.tourType===pu.Virtual?this.foregroundColorOnPrimaryBackgroundColor:oi)}
|
|
2920
|
+
</tour-type-option>`:""};return H`${this.buildingSelector()}
|
|
2849
2921
|
<h2 id="tour-type-heading" class="journey-header">Tour Type</h2>
|
|
2850
2922
|
<div
|
|
2851
2923
|
id="tour-type-menu"
|
|
2852
2924
|
role="radiogroup"
|
|
2853
2925
|
aria-labelledby="tour-type-heading"
|
|
2854
2926
|
>
|
|
2855
|
-
${this.
|
|
2856
|
-
|
|
2857
|
-
subtitle=${this.useCoastalCustomTourTypes?"":"on your own"}
|
|
2858
|
-
.primaryColor=${this.primaryColor}
|
|
2859
|
-
.foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
|
|
2860
|
-
@click="${async()=>{this.tourType=du.Self,Eo("tourTypeSelected",{tourType:du.Self,buildingId:this.buildingId}),this.sgtUrl&&ha(du.Self,this.selfGuidedToursTypeOffered)&&this.openSelfGuidedTour(),this.availabilitiesGroupedByDay=await uo(cu[du.Self]),this._setDefaultSelectedDateAndTimes(cu[du.Self])}}"
|
|
2861
|
-
@keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=du.Self)}}"
|
|
2862
|
-
?selected="${this.tourType===du.Self}"
|
|
2863
|
-
>
|
|
2864
|
-
${((e="black")=>G`<svg
|
|
2865
|
-
aria-hidden="true"
|
|
2866
|
-
focusable="false"
|
|
2867
|
-
slot="icon"
|
|
2868
|
-
width="28"
|
|
2869
|
-
height="31"
|
|
2870
|
-
viewBox="0 0 28 31"
|
|
2871
|
-
fill="none"
|
|
2872
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2873
|
-
>
|
|
2874
|
-
<path
|
|
2875
|
-
d="M14.8334 19.1903V30.1667H0.666687C0.666248 28.4367 1.06183 26.7297 1.82311 25.1763C2.58439 23.6229 3.69118 22.2644 5.05866 21.2049C6.42614 20.1453 8.01802 19.4129 9.71232 19.0637C11.4066 18.7145 13.1584 18.7578 14.8334 19.1903ZM12 17.4167C7.30377 17.4167 3.50002 13.6129 3.50002 8.91666C3.50002 4.22041 7.30377 0.416656 12 0.416656C16.6963 0.416656 20.5 4.22041 20.5 8.91666C20.5 13.6129 16.6963 17.4167 12 17.4167ZM20.5 23.0833V18.125L27.5834 24.5L20.5 30.875V25.9167H16.25V23.0833H20.5Z"
|
|
2876
|
-
fill="${e}"
|
|
2877
|
-
/>
|
|
2878
|
-
</svg>`)(this.tourType===du.Self?this.foregroundColorOnPrimaryBackgroundColor:oi)}
|
|
2879
|
-
</tour-type-option>`:""}
|
|
2880
|
-
${this.shouldShowTourType[du.Guided]?H` <tour-type-option
|
|
2881
|
-
heading="Guided tour"
|
|
2882
|
-
subtitle="with an agent"
|
|
2883
|
-
.primaryColor=${this.primaryColor}
|
|
2884
|
-
.foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
|
|
2885
|
-
@click="${async()=>{this.tourType=du.Guided,Eo("tourTypeSelected",{tourType:du.Guided,buildingId:this.buildingId}),this.escortedToursLink&&ha(du.Guided,this.escortedToursTypeOffered)&&window.open(this.escortedToursLink,"_blank"),this.availabilitiesGroupedByDay=await uo(cu[du.Guided]),this._setDefaultSelectedDateAndTimes(cu[du.Guided])}}"
|
|
2886
|
-
@keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=du.Guided)}}"
|
|
2887
|
-
?selected="${this.tourType===du.Guided}"
|
|
2888
|
-
>
|
|
2889
|
-
${((e="black")=>G`<svg
|
|
2890
|
-
aria-hidden="true"
|
|
2891
|
-
focusable="false"
|
|
2892
|
-
slot="icon"
|
|
2893
|
-
width="31"
|
|
2894
|
-
height="31"
|
|
2895
|
-
viewBox="0 0 31 31"
|
|
2896
|
-
fill="none"
|
|
2897
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2898
|
-
>
|
|
2899
|
-
<path
|
|
2900
|
-
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"
|
|
2901
|
-
fill="${e}"
|
|
2902
|
-
/>
|
|
2903
|
-
</svg>`)(this.tourType===du.Guided?this.foregroundColorOnPrimaryBackgroundColor:oi)}
|
|
2904
|
-
</tour-type-option>`:""}
|
|
2905
|
-
${this.shouldShowTourType[du.Virtual]?H` <tour-type-option
|
|
2906
|
-
heading="Virtual tour"
|
|
2907
|
-
subtitle="over video"
|
|
2908
|
-
.primaryColor=${this.primaryColor}
|
|
2909
|
-
.foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
|
|
2910
|
-
@click="${async()=>{this.tourType=du.Virtual,Eo("tourTypeSelected",{tourType:du.Virtual,buildingId:this.buildingId}),this.virtualToursLink&&ha(du.Virtual,this.virtualToursTypeOffered)&&window.open(this.virtualToursLink,"_blank"),this.availabilitiesGroupedByDay=await uo(cu[du.Virtual]),this._setDefaultSelectedDateAndTimes(cu[du.Virtual])}}"
|
|
2911
|
-
@keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=du.Virtual)}}"
|
|
2912
|
-
?selected="${this.tourType===du.Virtual}"
|
|
2913
|
-
>
|
|
2914
|
-
${((e="black")=>G`<svg
|
|
2915
|
-
aria-hidden="true"
|
|
2916
|
-
focusable="false"
|
|
2917
|
-
slot="icon"
|
|
2918
|
-
width="26"
|
|
2919
|
-
height="25"
|
|
2920
|
-
viewBox="0 0 26 25"
|
|
2921
|
-
fill="none"
|
|
2922
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
2923
|
-
>
|
|
2924
|
-
<path
|
|
2925
|
-
d="M15.6 19.5V22.1L18.2 23.4V24.7H7.80004L7.79484 23.4052L10.4 22.1V19.5H1.28965C1.11894 19.4989 0.950113 19.4642 0.792841 19.3979C0.635568 19.3315 0.492943 19.2347 0.373141 19.1131C0.253339 18.9915 0.158715 18.8474 0.0946936 18.6892C0.0306718 18.5309 -0.00148955 18.3616 5.29696e-05 18.1909V1.3091C5.29696e-05 0.586299 0.591552 0 1.28965 0H24.7104C25.4228 0 26 0.583699 26 1.3091V18.1909C26 18.9137 25.4085 19.5 24.7104 19.5H15.6ZM2.60005 14.3V16.9H23.4V14.3H2.60005Z"
|
|
2926
|
-
fill="${e}"
|
|
2927
|
-
/>
|
|
2928
|
-
</svg>`)(this.tourType===du.Virtual?this.foregroundColorOnPrimaryBackgroundColor:oi)}
|
|
2929
|
-
</tour-type-option>`:""}
|
|
2930
|
-
</div>`}dateAndTimeMenu(){var e;return this.tourType===du.Self&&this.sgtUrl&&ha(this.tourType,this.selfGuidedToursTypeOffered)?H`<h2 class="journey-header">Date and Time</h2>
|
|
2927
|
+
${this.tourTypeOrder.map(e=>n[e])}
|
|
2928
|
+
</div>`}dateAndTimeMenu(){var e;return this.tourType===pu.Self&&this.sgtUrl&&ga(this.tourType,this.selfGuidedToursTypeOffered)?H`<h2 class="journey-header">Date and Time</h2>
|
|
2931
2929
|
<div id="dateAndTimeMenu">
|
|
2932
2930
|
<button
|
|
2933
2931
|
id="self-guided-redirect-bttn"
|
|
@@ -2941,14 +2939,14 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
2941
2939
|
<date-picker
|
|
2942
2940
|
.availabilities=${po()(this.availabilitiesGroupedByDay,e=>e.map(e=>new Date(e.offset)))}
|
|
2943
2941
|
.defaultDate=${this.selectedDate}
|
|
2944
|
-
@change=${async e=>{if(this.tourType===
|
|
2942
|
+
@change=${async e=>{if(this.tourType===pu.Self&&this.sgtUrl&&ga(this.tourType,this.selfGuidedToursTypeOffered))this.openSelfGuidedTour();else if(this.tourType===pu.Guided&&this.escortedToursLink&&ga(this.tourType,this.escortedToursTypeOffered))window.open(this.escortedToursLink,"_blank");else if(this.tourType===pu.Virtual&&this.virtualToursLink&&ga(this.tourType,this.virtualToursTypeOffered))window.open(this.virtualToursLink,"_blank");else if(e.target instanceof cr){const t=this.selectedDate;if(this.selectedDate=e.target.selectedDate,!this.tourType)return;if(t&&e.target.selectedDate&&ur(t,e.target.selectedDate))return;e.target.selectedDate&&Eo("tourDateSelected",{selectedDate:ir(e.target.selectedDate,"yyyy-MM-dd"),tourType:this.tourType,buildingId:this.buildingId}),this._setDefaultSelectedDateAndTimes(fu[this.tourType],e.target.selectedDate)}}}
|
|
2945
2943
|
></date-picker>
|
|
2946
2944
|
<div>
|
|
2947
2945
|
<time-picker
|
|
2948
2946
|
?selecteddateexists=${!!this.selectedDate}
|
|
2949
2947
|
.timezone=${this.calendarTimeZone}
|
|
2950
|
-
.defaultSelectedTime=${this.selectedTime?{dateWithTimeZoneOffset:this.selectedTime,displayTime:ir(Yr(`${this.selectedTime.datetime}${this.selectedTime.offset}`),"h:mmaaa"),displayTimeZoned:
|
|
2951
|
-
.options=${this.selectedDate?null===(e=this.availabilitiesGroupedByDay[ir(this.selectedDate,"y-MM-dd")])||void 0===e?void 0:e.sort((e,t)=>function(e,t){si(2,arguments);var n=li(e),i=li(t),r=n.getTime()-i.getTime();return r<0?-1:r>0?1:r}(Yr(e.datetime),Yr(t.datetime))).map(e=>({dateWithTimeZoneOffset:e,displayTime:ir(Yr(`${e.datetime}${e.offset}`),"h:mmaaa"),displayTimeZoned:
|
|
2948
|
+
.defaultSelectedTime=${this.selectedTime?{dateWithTimeZoneOffset:this.selectedTime,displayTime:ir(Yr(`${this.selectedTime.datetime}${this.selectedTime.offset}`),"h:mmaaa"),displayTimeZoned:Za(Yr(`${this.selectedTime.datetime}${this.selectedTime.offset}`),this.calendarTimeZone,"h:mmaaa")}:null}
|
|
2949
|
+
.options=${this.selectedDate?null===(e=this.availabilitiesGroupedByDay[ir(this.selectedDate,"y-MM-dd")])||void 0===e?void 0:e.sort((e,t)=>function(e,t){si(2,arguments);var n=li(e),i=li(t),r=n.getTime()-i.getTime();return r<0?-1:r>0?1:r}(Yr(e.datetime),Yr(t.datetime))).map(e=>({dateWithTimeZoneOffset:e,displayTime:ir(Yr(`${e.datetime}${e.offset}`),"h:mmaaa"),displayTimeZoned:Za(Yr(`${e.datetime}${e.offset}`),this.calendarTimeZone,"h:mmaaa")})):[]}
|
|
2952
2950
|
@change=${e=>{if(e.target instanceof mr){if(!this.selectedDate)return;const t=this.availabilitiesGroupedByDay[ir(new Date(this.selectedDate),"y-MM-dd")],n=e.target.selectedTime?t.indexOf(e.target.selectedTime.dateWithTimeZoneOffset):null;this.selectedTime=null!==n?t[n]:null,this.selectedTime&&Eo("tourTimeSelected",{selectedTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,tourType:this.tourType,buildingId:this.buildingId})}}}
|
|
2953
2951
|
></time-picker>
|
|
2954
2952
|
</div>
|
|
@@ -3099,8 +3097,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3099
3097
|
${this.layoutOptions.length>0?H` <me-select
|
|
3100
3098
|
id="layout"
|
|
3101
3099
|
placeholder=${this.bedroomPreferenceRequired?"Bedroom preference":"Bedroom preference (optional)"}
|
|
3102
|
-
.options="${this.layoutOptions.map(e=>({label:e.label,value:
|
|
3103
|
-
@change=${()=>{var e;const t=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||"";if(this.selectedLayoutValue=t,t&&this.selectedUnitValue){const e=this.units.find(e=>e.unitNumber===this.selectedUnitValue);e&&
|
|
3100
|
+
.options="${this.layoutOptions.map(e=>({label:e.label,value:wu(e.value)}))}"
|
|
3101
|
+
@change=${()=>{var e;const t=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||"";if(this.selectedLayoutValue=t,t&&this.selectedUnitValue){const e=this.units.find(e=>e.unitNumber===this.selectedUnitValue);e&&wu(10*e.numberOfBedrooms)!==t&&(this.selectedUnitValue="",this.selectedUnitEl&&(this.selectedUnitEl.value=void 0))}t&&Eo("tourLayoutSelected",{layout:t,buildingId:this.buildingId})}}
|
|
3104
3102
|
>
|
|
3105
3103
|
</me-select>`:""}
|
|
3106
3104
|
${this.allowOccupiedUnitTours&&this._getUnitOptions().length>0?H` <me-select
|
|
@@ -3119,7 +3117,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3119
3117
|
@change=${()=>{var e;(null===(e=this.selectedLeadSource)||void 0===e?void 0:e.value)&&Eo("tourLeadSourceSelected",{leadSource:this.selectedLeadSource.value,buildingId:this.buildingId}),this.requestUpdate()}}
|
|
3120
3118
|
>
|
|
3121
3119
|
</me-select>`:""}
|
|
3122
|
-
</div> `}confirmationMessage(){if(!this.selectedDate||!this.selectedTime||null===this.tourType)return H``;const e=
|
|
3120
|
+
</div> `}confirmationMessage(){if(!this.selectedDate||!this.selectedTime||null===this.tourType)return H``;const e=Za(Yr(`${this.selectedTime.datetime}${this.selectedTime.offset}`),this.calendarTimeZone,"MMM d 'at' h:mmaaa");return this.canceledReschedule?H`
|
|
3123
3121
|
<div id="confirmationMessage">
|
|
3124
3122
|
<svg
|
|
3125
3123
|
aria-hidden="true"
|
|
@@ -3431,7 +3429,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3431
3429
|
</div>
|
|
3432
3430
|
`}
|
|
3433
3431
|
</div>
|
|
3434
|
-
`}};var
|
|
3432
|
+
`}};var pu;hu.styles=[qo,Me],cu([pe({attribute:!1})],hu.prototype,"tourTypeOptions",void 0),cu([pe({attribute:!1})],hu.prototype,"layoutOptions",void 0),cu([pe({attribute:!0})],hu.prototype,"chatId",void 0),cu([pe({type:Number})],hu.prototype,"buildingId",void 0),cu([pe({type:Number})],hu.prototype,"orgId",void 0),cu([pe({attribute:!1})],hu.prototype,"leadSourceParams",void 0),cu([pe({attribute:!0})],hu.prototype,"buildingSlug",void 0),cu([pe({attribute:!0})],hu.prototype,"sgtUrl",void 0),cu([pe({attribute:!0})],hu.prototype,"selfGuidedToursTypeOffered",void 0),cu([pe({attribute:!0})],hu.prototype,"selfGuidedTourEnabled",void 0),cu([pe({attribute:!0})],hu.prototype,"escortedToursLink",void 0),cu([pe({attribute:!0})],hu.prototype,"escortedToursTypeOffered",void 0),cu([pe({attribute:!0})],hu.prototype,"virtualToursLink",void 0),cu([pe({attribute:!0})],hu.prototype,"virtualToursTypeOffered",void 0),cu([pe({attribute:!0})],hu.prototype,"orgSlug",void 0),cu([pe({attribute:!0})],hu.prototype,"hasDynamicSchedulingEnabled",void 0),cu([pe({attribute:!0})],hu.prototype,"bedroomPreferenceRequired",void 0),cu([pe({attribute:!1})],hu.prototype,"brokerIntakeEnabled",void 0),cu([pe({attribute:!0})],hu.prototype,"leadSourceClient",void 0),cu([pe({attribute:!0})],hu.prototype,"leadSourceMultitouchClient",void 0),cu([pe({attribute:!0})],hu.prototype,"buildingName",void 0),cu([fe()],hu.prototype,"tourType",void 0),cu([fe()],hu.prototype,"shouldShowTourType",void 0),cu([fe()],hu.prototype,"email",void 0),cu([fe()],hu.prototype,"phoneNumber",void 0),cu([fe()],hu.prototype,"phoneNumberE164",void 0),cu([fe()],hu.prototype,"phoneCountry",void 0),cu([fe()],hu.prototype,"phoneNumberIsValid",void 0),cu([fe()],hu.prototype,"phoneNumberHasBlurred",void 0),cu([fe()],hu.prototype,"availabilitiesGroupedByDay",void 0),cu([fe()],hu.prototype,"calendarTimeZone",void 0),cu([fe()],hu.prototype,"waitingForAvailabilities",void 0),cu([fe()],hu.prototype,"selectedDate",void 0),cu([fe()],hu.prototype,"selectedTime",void 0),cu([fe()],hu.prototype,"mobilePageIndex",void 0),cu([fe()],hu.prototype,"isSubmitting",void 0),cu([fe()],hu.prototype,"tourIsBooked",void 0),cu([fe()],hu.prototype,"shouldAllowScheduling",void 0),cu([fe()],hu.prototype,"shouldAllowScheduleLoading",void 0),cu([fe()],hu.prototype,"promptForReschedule",void 0),cu([fe()],hu.prototype,"canceledReschedule",void 0),cu([fe()],hu.prototype,"isBrokerReferral",void 0),cu([fe()],hu.prototype,"brokerFirstName",void 0),cu([fe()],hu.prototype,"brokerLastName",void 0),cu([fe()],hu.prototype,"brokerEmail",void 0),cu([fe()],hu.prototype,"brokerFirmName",void 0),cu([fe()],hu.prototype,"brokerPhone",void 0),cu([fe()],hu.prototype,"brokerPhoneE164",void 0),cu([fe()],hu.prototype,"brokerPhoneCountry",void 0),cu([fe()],hu.prototype,"brokerPhoneIsValid",void 0),cu([fe()],hu.prototype,"brokerPhoneHasBlurred",void 0),cu([pe({attribute:!1})],hu.prototype,"leadSources",void 0),cu([pe({attribute:!0})],hu.prototype,"orgLegalName",void 0),cu([pe({attribute:!1})],hu.prototype,"country",void 0),cu([pe({attribute:!1})],hu.prototype,"buildingState",void 0),cu([pe({attribute:!0})],hu.prototype,"currentLeadSource",void 0),cu([pe({attribute:!0})],hu.prototype,"featureFlagShowDropdown",void 0),cu([pe({attribute:!0})],hu.prototype,"compactDesign",void 0),cu([pe({attribute:!0})],hu.prototype,"primaryColor",void 0),cu([pe({attribute:!0})],hu.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),cu([ge(".nameContainer#firstName input")],hu.prototype,"firstNameInput",void 0),cu([ge(".nameContainer#lastName input")],hu.prototype,"lastNameInput",void 0),cu([ge(".inputContainer#email input")],hu.prototype,"emailInput",void 0),cu([ge("me-select#leadSource")],hu.prototype,"selectedLeadSource",void 0),cu([ge("me-select#layout")],hu.prototype,"selectedLayoutEl",void 0),cu([ge("me-select#unit")],hu.prototype,"selectedUnitEl",void 0),cu([fe()],hu.prototype,"firstNameInputValue",void 0),cu([fe()],hu.prototype,"lastNameInputValue",void 0),cu([fe()],hu.prototype,"leadSourceInputValue",void 0),cu([fe()],hu.prototype,"selectedLayoutValue",void 0),cu([fe()],hu.prototype,"selectedUnitValue",void 0),cu([fe()],hu.prototype,"units",void 0),cu([fe()],hu.prototype,"allowOccupiedUnitTours",void 0),cu([fe()],hu.prototype,"errorGettingAvailabilities",void 0),cu([fe()],hu.prototype,"centralConvoBuildings",void 0),cu([fe()],hu.prototype,"isGeneralBuilding",void 0),cu([ge("me-select#building")],hu.prototype,"selectedBuildingEl",void 0),cu([fe()],hu.prototype,"statusMessage",void 0),cu([fe()],hu.prototype,"useCoastalCustomTourTypes",void 0),cu([fe()],hu.prototype,"tourTypeOrder",void 0),hu=cu([ce("tour-scheduler")],hu),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(pu||(pu={}));const fu={[pu.Guided]:zr.WithAgent,[pu.Self]:zr.SelfGuided,[pu.Virtual]:zr.VirtualShowing},gu={[zr.WithAgent]:pu.Guided,[zr.SelfGuided]:pu.Self,[zr.VirtualShowing]:pu.Virtual},mu={[pu.Guided]:"In-Person Tour",[pu.Self]:"VIP Hard Hat Tour"},bu=[pu.Guided,pu.Self,pu.Virtual];const yu={[pu.Guided]:"guided tour",[pu.Self]:"self-guided tour",[pu.Virtual]:"virtual tour"},vu={[pu.Guided]:"escorted-tour",[pu.Self]:"self-guided-tour",[pu.Virtual]:"live-virtual-tour"};function wu(e){const t=Math.round(e/10);return 0===t?"studio":`${t}br`}const Cu=(e,t,n=!0,i=!1,r,o=.01)=>ia({params:{org_slug:e,building_slug:t,is_pixel_on_site:n,is_any_webchat_showing:i,extra_data:{webchat_no_show_reason:r}},sampleRate:o}),xu=async(e,t,n)=>{const i=.01;if(!e)return Cu(n,t,!0,!1,"building_does_not_exist",i),!1;if(!e.launchedDateTime)return Cu(n,t,!0,!1,"building_not_launched",i),!1;if(!e.active)return Cu(n,t,!0,!1,"building_not_active",i),!1;if(!e.webchatScopeConfigured)return Cu(n,t,!0,!1,"building_not_webchat_scope_configured",i),!1;const o=await async function(e){if(!e)return!1;try{return(await r().get(mo(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-leasing-in-maintenance-mode",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(t);return!o||(Cu(n,t,!0,!1,"building_in_maintenance_mode",i),!1)},$u=p`
|
|
3435
3433
|
* {
|
|
3436
3434
|
font-family: "Helvetica Neue", Arial;
|
|
3437
3435
|
font-size: 14px;
|
|
@@ -3928,7 +3926,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
3928
3926
|
width: 164px;
|
|
3929
3927
|
}
|
|
3930
3928
|
}
|
|
3931
|
-
`,
|
|
3929
|
+
`,Su=p`
|
|
3932
3930
|
.type-hey__list {
|
|
3933
3931
|
width: 280px;
|
|
3934
3932
|
height: 300px;
|
|
@@ -4086,7 +4084,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4086
4084
|
.title-bold {
|
|
4087
4085
|
font-weight: 700;
|
|
4088
4086
|
}
|
|
4089
|
-
`,
|
|
4087
|
+
`,Au=p`
|
|
4090
4088
|
.vertical-pill-list {
|
|
4091
4089
|
position: relative;
|
|
4092
4090
|
display: flex;
|
|
@@ -4159,7 +4157,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4159
4157
|
justify-content: center;
|
|
4160
4158
|
align-items: center;
|
|
4161
4159
|
}
|
|
4162
|
-
`;var
|
|
4160
|
+
`;var ku=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Eu=class extends ue{constructor(){super(...arguments),this.text="Submit",this.isLoading=!1,this.disabled=!1,this.height="initial",this.width="initial",this.focus=()=>{var e,t;null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===t||t.focus()},this.render=()=>H`<button
|
|
4163
4161
|
class=${go()("action-confirm-button",{loading:this.isLoading})}
|
|
4164
4162
|
@click=${this.isLoading?null:this.onClick}
|
|
4165
4163
|
?disabled=${this.disabled}
|
|
@@ -4171,7 +4169,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4171
4169
|
<div></div>
|
|
4172
4170
|
<div></div>
|
|
4173
4171
|
</div>`:this.text}
|
|
4174
|
-
</button>`}}
|
|
4172
|
+
</button>`}};Eu.shadowRootOptions={...ue.shadowRootOptions,delegatesFocus:!0},Eu.styles=[p`
|
|
4175
4173
|
.action-confirm-button {
|
|
4176
4174
|
display: flex;
|
|
4177
4175
|
justify-content: center;
|
|
@@ -4245,7 +4243,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4245
4243
|
transform: rotate(360deg);
|
|
4246
4244
|
}
|
|
4247
4245
|
}
|
|
4248
|
-
`],
|
|
4246
|
+
`],ku([pe()],Eu.prototype,"onClick",void 0),ku([pe()],Eu.prototype,"text",void 0),ku([pe({attribute:!1})],Eu.prototype,"isLoading",void 0),ku([pe({type:Boolean})],Eu.prototype,"disabled",void 0),ku([pe({type:String})],Eu.prototype,"height",void 0),ku([pe({type:String})],Eu.prototype,"width",void 0),Eu=ku([ce("action-confirm-button")],Eu);var Tu=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let _u=class extends ue{constructor(){super(...arguments),this.height="425px",this.width="326px",this.useRoundedBorders=!0,this.headerText="",this.isMobileSized=Ir(),this.useGradientDesign=!1,this._onWindowResize=()=>this.fitAboveBottom()}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=Nr(e=>{this.isMobileSized=e}),window.addEventListener("resize",this._onWindowResize)}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}updated(){this.fitAboveBottom()}fitAboveBottom(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("details-window-inner");if(!t)return;const n=t.getBoundingClientRect().bottom,i=getComputedStyle(t),r=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),o=Math.min(window.innerHeight-40,n-16)-r;t.style.maxHeight=n>0?`${Math.max(200,o)}px`:""}render(){return H`
|
|
4249
4247
|
<div
|
|
4250
4248
|
id="details-window-inner"
|
|
4251
4249
|
class="details-window-wrapper"
|
|
@@ -4285,7 +4283,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4285
4283
|
</div>
|
|
4286
4284
|
<slot class="details-window__slot-content"></slot>
|
|
4287
4285
|
</div>
|
|
4288
|
-
`}};
|
|
4286
|
+
`}};_u.styles=p`
|
|
4289
4287
|
.details-window-wrapper {
|
|
4290
4288
|
background: rgba(255, 255, 255, 0.9);
|
|
4291
4289
|
box-shadow: 0px 0px 14px 5px rgba(0, 0, 0, 0.25);
|
|
@@ -4353,7 +4351,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4353
4351
|
border-radius: 0px 0px 0px 0px;
|
|
4354
4352
|
}
|
|
4355
4353
|
}
|
|
4356
|
-
`,
|
|
4354
|
+
`,Tu([pe({type:String})],_u.prototype,"height",void 0),Tu([pe({type:String})],_u.prototype,"width",void 0),Tu([pe({type:Boolean})],_u.prototype,"useRoundedBorders",void 0),Tu([pe({type:String})],_u.prototype,"headerText",void 0),Tu([pe({attribute:!1})],_u.prototype,"onCloseClick",void 0),Tu([fe()],_u.prototype,"isMobileSized",void 0),Tu([pe({attribute:!0})],_u.prototype,"useGradientDesign",void 0),_u=Tu([ce("details-window")],_u);var Ou=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Pu=class extends ue{constructor(){super(...arguments),this.trapOverlayTab=e=>{au(e,this)},this.movedFocusInside=!1,this.leadSources=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.buildingName="",this.orgLegalName="",this.country=null,this.buildingState=null,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.featureFlagShowDropdown="",this.brokerIntakeEnabled=!1,this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.phoneNumberE164=null,this.phoneCountry=null,this.message="",this.isBrokerReferral=!1,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerFirmName="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneCountry=null,this.brokerPhoneIsValid=!1,this.hasBrokerPhoneError=!1,this.currentLeadSource="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasSubmittedForm=!1,this.isKnownBroker=!1,this.windowHeight=525,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangeFirstName=e=>{e.target&&(this.firstName=e.target.value)},this.onChangeLastName=e=>{e.target&&(this.lastName=e.target.value)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangePhoneNumber=e=>{this.phoneNumber=e.detail.formattedValue,this.phoneNumberE164=e.detail.e164,this.phoneCountry=e.detail.country},this.onChangeBrokerPhone=e=>{this.brokerPhone=e.detail.formattedValue,this.brokerPhoneE164=e.detail.e164,this.brokerPhoneCountry=e.detail.country,this.brokerPhoneIsValid=e.detail.isValid},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.onToggleBrokerReferral=e=>{const t=e.target.checked,n=!(this.brokerFirstName||this.brokerLastName||this.brokerEmail||this.brokerPhone);t&&n?(this.brokerFirstName=this.firstName,this.brokerLastName=this.lastName,this.brokerEmail=this.email,this.brokerPhone=this.phoneNumber,this.brokerPhoneE164=this.phoneNumberE164,this.brokerPhoneCountry=this.phoneCountry,this.brokerPhoneIsValid=!!this.phoneNumberE164,this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.phoneNumberE164=null):t||this.firstName||this.lastName||this.email||this.phoneNumber||(this.firstName=this.brokerFirstName,this.lastName=this.brokerLastName,this.email=this.brokerEmail,this.phoneNumber=this.brokerPhone,this.phoneNumberE164=this.brokerPhoneE164,this.phoneCountry=this.brokerPhoneCountry,this.brokerFirstName="",this.brokerLastName="",this.brokerEmail="",this.brokerPhone="",this.brokerPhoneE164=null,this.brokerPhoneIsValid=!1),this.isBrokerReferral=t,this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasBrokerPhoneError=!1,this.windowHeight=this.baseHeight()+30*this.getNumErrors()},this.onChangeBrokerField=e=>t=>{t.target&&(this[e]=t.target.value)},this.baseHeight=()=>525+(this.brokerIntakeEnabled&&this.isBrokerReferral?143:0),this.brokerReferral=()=>{var e;return this.brokerIntakeEnabled&&this.isBrokerReferral?Yo(this.brokerFirstName,this.brokerLastName,this.brokerEmail,this.brokerFirmName,null!==(e=this.brokerPhoneE164)&&void 0!==e?e:""):null},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.hasBrokerNameError=!1,this.brokerEmailError=null,this.hasBrokerPhoneError=!1;const e=this.brokerReferral();e&&(this.hasBrokerNameError=Ko(e),this.brokerEmailError=Xo(e,this.email),this.hasBrokerPhoneError=!!this.brokerPhone&&!this.brokerPhoneIsValid),this.firstName&&this.lastName||(this.hasNameError=!0),this.email&&Lr(this.email)||(this.hasEmailError=!0),this.phoneNumberE164||(this.hasPhoneNumberError=!0),this.windowHeight=this.baseHeight()+30*this.getNumErrors()},this.onClick=async()=>{var e,t,n,i,r,o;if(this.isSubmitting)return;if(this.validateFormFields(),this.hasNameError||this.hasEmailError||this.hasPhoneNumberError||this.hasMessageError||this.hasBrokerNameError||this.brokerEmailError||this.hasBrokerPhoneError)return;const a=this.phoneNumberE164;if(a)try{this.isSubmitting=!0,this.windowHeight=this.baseHeight()+60;const s=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource,{knownBroker:l}=await Iu(this.firstName,this.lastName,this.email,a,this.message,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(s?[s,aa(this.orgSlug)]:[aa(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(n=this.selectedLeadSource)||void 0===n?void 0:n.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}),this.brokerReferral());null===(i=this.leadSourceClient)||void 0===i||i.checkAndHandleForLogLeadSource({webchatAction:"email-us",stateId:null}),null===(r=this.leadSourceClient)||void 0===r||r.resetLeadSource(),null===(o=this.leadSourceMultitouchClient)||void 0===o||o.resetLeadSourceTouchpoints(),this.isKnownBroker=l,this.hasSubmittedForm=!0,this.isSubmitting=!1,this.windowHeight=this.baseHeight()}catch(e){this.hasSubmissionError=!0,this.isSubmitting=!1,this.windowHeight=this.baseHeight()}else this.hasPhoneNumberError=!0},this.getNumErrors=()=>[this.hasNameError,this.hasEmailError,this.hasPhoneNumberError,this.hasMessageError,this.hasSubmissionError,this.hasBrokerNameError,!!this.brokerEmailError,this.hasBrokerPhoneError].filter(e=>e).length,this.renderBrokerToggle=()=>H`
|
|
4357
4355
|
<label class="email-us__broker-toggle">
|
|
4358
4356
|
<span>Are you a broker or locator?</span>
|
|
4359
4357
|
<input
|
|
@@ -4426,7 +4424,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4426
4424
|
<div class="email-us__vertical-spacer"></div>
|
|
4427
4425
|
<div class="email-us__section-label">Your client</div>
|
|
4428
4426
|
`:""}
|
|
4429
|
-
`},this.render=()=>{var e;return window.customElements.get("details-window")||window.customElements.define("details-window",
|
|
4427
|
+
`},this.render=()=>{var e;return window.customElements.get("details-window")||window.customElements.define("details-window",_u),window.customElements.get("action-confirm-button")||window.customElements.define("action-confirm-button",Eu),this.hasSubmittedForm?H`
|
|
4430
4428
|
<details-window
|
|
4431
4429
|
id="details-window"
|
|
4432
4430
|
headerText=""
|
|
@@ -4551,7 +4549,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4551
4549
|
|
|
4552
4550
|
${Vo({buildingName:this.buildingName,phoneNumberInput:this.phoneNumber,emailInput:this.email,orgLegalName:this.orgLegalName,orgSlug:this.orgSlug,country:this.country,buildingState:this.buildingState,clickingButtonText:"send"})}
|
|
4553
4551
|
</details-window>
|
|
4554
|
-
`}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab)}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}updated(){this.movedFocusInside||
|
|
4552
|
+
`}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab)}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}updated(){this.movedFocusInside||ou(this)&&(this.movedFocusInside=!0)}showLeadSourceSelect(){return!(this.brokerIntakeEnabled&&this.isBrokerReferral)&&this.leadSources.length>0&&(this.featureFlagShowDropdown===bo.always||this.featureFlagShowDropdown===bo.onAttributionFailure&&0===this.currentLeadSource.length)}};Pu.styles=[p`
|
|
4555
4553
|
.email-us__name-input,
|
|
4556
4554
|
.email-us__contact_input,
|
|
4557
4555
|
.email-us_message-input {
|
|
@@ -4692,11 +4690,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4692
4690
|
width: 50%;
|
|
4693
4691
|
}
|
|
4694
4692
|
}
|
|
4695
|
-
`,Me],
|
|
4693
|
+
`,Me],Ou([pe({attribute:!1})],Pu.prototype,"leadSources",void 0),Ou([pe({attribute:!1})],Pu.prototype,"onCloseClicked",void 0),Ou([pe({attribute:!0})],Pu.prototype,"chatId",void 0),Ou([pe({attribute:!1})],Pu.prototype,"buildingId",void 0),Ou([pe({attribute:!0})],Pu.prototype,"buildingSlug",void 0),Ou([pe({attribute:!0})],Pu.prototype,"orgSlug",void 0),Ou([pe({attribute:!0})],Pu.prototype,"buildingName",void 0),Ou([pe({attribute:!0})],Pu.prototype,"orgLegalName",void 0),Ou([pe({attribute:!1})],Pu.prototype,"country",void 0),Ou([pe({attribute:!1})],Pu.prototype,"buildingState",void 0),Ou([pe({attribute:!0})],Pu.prototype,"leadSourceClient",void 0),Ou([pe({attribute:!0})],Pu.prototype,"leadSourceMultitouchClient",void 0),Ou([pe({attribute:!0})],Pu.prototype,"featureFlagShowDropdown",void 0),Ou([pe({attribute:!1})],Pu.prototype,"brokerIntakeEnabled",void 0),Ou([pe()],Pu.prototype,"privatePolicyUrl",void 0),Ou([pe()],Pu.prototype,"termsOfServiceUrl",void 0),Ou([fe()],Pu.prototype,"firstName",void 0),Ou([fe()],Pu.prototype,"lastName",void 0),Ou([fe()],Pu.prototype,"email",void 0),Ou([fe()],Pu.prototype,"phoneNumber",void 0),Ou([fe()],Pu.prototype,"phoneNumberE164",void 0),Ou([fe()],Pu.prototype,"phoneCountry",void 0),Ou([fe()],Pu.prototype,"message",void 0),Ou([fe()],Pu.prototype,"isBrokerReferral",void 0),Ou([fe()],Pu.prototype,"brokerFirstName",void 0),Ou([fe()],Pu.prototype,"brokerLastName",void 0),Ou([fe()],Pu.prototype,"brokerEmail",void 0),Ou([fe()],Pu.prototype,"brokerFirmName",void 0),Ou([fe()],Pu.prototype,"brokerPhone",void 0),Ou([fe()],Pu.prototype,"brokerPhoneE164",void 0),Ou([fe()],Pu.prototype,"brokerPhoneCountry",void 0),Ou([fe()],Pu.prototype,"brokerPhoneIsValid",void 0),Ou([fe()],Pu.prototype,"hasBrokerPhoneError",void 0),Ou([ge("me-select#leadSource")],Pu.prototype,"selectedLeadSource",void 0),Ou([pe({attribute:!0})],Pu.prototype,"currentLeadSource",void 0),Ou([fe()],Pu.prototype,"hasNameError",void 0),Ou([fe()],Pu.prototype,"hasEmailError",void 0),Ou([fe()],Pu.prototype,"hasPhoneNumberError",void 0),Ou([fe()],Pu.prototype,"hasMessageError",void 0),Ou([fe()],Pu.prototype,"hasBrokerNameError",void 0),Ou([fe()],Pu.prototype,"brokerEmailError",void 0),Ou([fe()],Pu.prototype,"hasSubmittedForm",void 0),Ou([fe()],Pu.prototype,"isKnownBroker",void 0),Ou([fe()],Pu.prototype,"windowHeight",void 0),Ou([fe()],Pu.prototype,"hasSubmissionError",void 0),Ou([fe()],Pu.prototype,"isSubmitting",void 0),Pu=Ou([ce("email-us-window")],Pu);const Iu=async(e,t,n,i,o,a,s,u,d,c,h,p)=>{var f;const g=new URLSearchParams(window.location.search),m={email_address:n,building_id:a,lead_sources:d,first_message:o,first_name:e,last_name:t,phone_number:i,referrer:document.referrer,query_params:Object.fromEntries(g.entries()),conversation_tracking_id:c,tracking_params:l(s),lead_sources_with_timestamps:(null!=h?h:[]).map(e=>_r({...e})),...Zo(p)};Eo("emailUsSubmitted",{firstName:e,lastName:t,email:n,phone:i,message:o,originatingSource:d.find(e=>"property-website"!==e)||null,conversationTrackingId:null!=c?c:null,...p?{isBrokerReferral:!0}:{}});return{knownBroker:!0===(null===(f=(await r().post("https://app.meetelise.com/platformApi/state/create/emailMe",m,{headers:{"building-slug":u,"org-slug":s,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})).data)||void 0===f?void 0:f.known_broker)}},Nu=(e="white")=>G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
|
|
4696
4694
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.95487 2.54301e-07H7.04513C8.51534 -1.22821e-05 9.67985 -2.22686e-05 10.5912 0.121084C11.5292 0.24572 12.2883 0.508324 12.887 1.10005C13.4857 1.69178 13.7514 2.44211 13.8775 3.36914C14 4.26992 14 5.42089 14 6.874V10.126C14 11.5791 14 12.7301 13.8775 13.6309C13.7514 14.5579 13.4857 15.3082 12.887 15.8999C12.2883 16.4917 11.5292 16.7543 10.5912 16.8789C9.67985 17 8.51534 17 7.04513 17H6.95487C5.48466 17 4.32015 17 3.40878 16.8789C2.47084 16.7543 1.71169 16.4917 1.11299 15.8999C0.514304 15.3082 0.248611 14.5579 0.122508 13.6309C-2.25306e-05 12.7301 -1.24266e-05 11.5791 2.57292e-07 10.126V6.87399C-1.24266e-05 5.42088 -2.25306e-05 4.26992 0.122508 3.36914C0.248611 2.44211 0.514304 1.69178 1.11299 1.10005C1.71169 0.508324 2.47084 0.24572 3.40878 0.121084C4.32015 -2.22686e-05 5.48466 -1.22821e-05 6.95487 2.54301e-07ZM2.85118 1.44157C2.45996 1.55714 2.18378 1.71904 1.96152 1.93871C1.62295 2.27335 1.42002 2.73167 1.31181 3.52718C1.20127 4.33975 1.2 5.41089 1.2 6.9186V10.0814C1.2 11.5891 1.20127 12.6602 1.31181 13.4728C1.42002 14.2683 1.62295 14.7267 1.96152 15.0613C2.30009 15.3959 2.76381 15.5965 3.56868 15.7034C4.39081 15.8127 5.47454 15.814 7 15.814C8.52546 15.814 9.60919 15.8127 10.4313 15.7034C11.2362 15.5965 11.6999 15.3959 12.0385 15.0613C12.377 14.7267 12.58 14.2683 12.6882 13.4728C12.7987 12.6602 12.8 11.5891 12.8 10.0814V6.9186C12.8 5.41089 12.7987 4.33975 12.6882 3.52718C12.58 2.73167 12.377 2.27335 12.0385 1.93871C11.8162 1.71905 11.54 1.55714 11.1488 1.44157C10.6194 2.22728 10.2493 2.77349 9.69896 3.1115C9.58916 3.17894 9.47507 3.23928 9.3574 3.29217C8.76366 3.55903 8.09363 3.55868 7.12834 3.55818C7.08613 3.55816 7.04336 3.55814 7 3.55814C6.95664 3.55814 6.91387 3.55816 6.87166 3.55818C5.90637 3.55868 5.23634 3.55903 4.6426 3.29217C4.52493 3.23928 4.41084 3.17894 4.30104 3.1115C3.75069 2.77349 3.38057 2.22729 2.85118 1.44157ZM4.16103 1.2383C4.51629 1.74715 4.70232 1.96157 4.9344 2.10411C5.00028 2.14457 5.06873 2.18078 5.13933 2.21251C5.46646 2.35954 5.85406 2.37209 7 2.37209C8.14594 2.37209 8.53354 2.35954 8.86066 2.21251C8.93127 2.18078 8.99972 2.14457 9.0656 2.10411C9.29768 1.96157 9.48371 1.74715 9.83897 1.2383C9.10278 1.18681 8.18457 1.18605 7 1.18605C5.81543 1.18605 4.89722 1.18681 4.16103 1.2383ZM4 14.0349C4 13.7074 4.26863 13.4419 4.6 13.4419H9.4C9.73137 13.4419 10 13.7074 10 14.0349C10 14.3624 9.73137 14.6279 9.4 14.6279H4.6C4.26863 14.6279 4 14.3624 4 14.0349Z" fill="${e}"/>
|
|
4697
|
-
</svg>`,
|
|
4695
|
+
</svg>`,Mu={},Du=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],Lu=async e=>{const t=await(async e=>{if(Mu[e])return Mu[e];const t=`https://app.meetelise.com/platformApi/connectors/talk_js/leasing_office_hours/${e}`,n=await r().get(t);return Mu[e]=n.data,n.data})(e);return Du.map(e=>{const n=t[e];return n?{dayOfWeek:e,startTime:n.start,endTime:n.end}:e})};var Ru=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Uu=class extends ue{constructor(){super(...arguments),this.trapOverlayTab=e=>{au(e,this)},this.movedFocusInside=!1,this.buildingSlug="",this.orgSlug="",this.phoneNumberToCall="",this.phoneNumberToText="",this.buildingId=0,this.buildingName="",this.chatCallUsHeader="",this.hasCallUsEnabled="",this.hasTextUsEnabled="",this.currentLeadSource="",this.orgLegalName="",this.country=null,this.buildingState=null,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.phoneNumberInputRef=Oe(),this.hasSubmittedForm=!1,this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.submittingTextUsOption=!1,this.officeHoursTextInfo=[],this.firstUpdated=async()=>{this.buildingId&&this.hasCallUsEnabled&&(this.officeHoursTextInfo=await Lu(this.buildingId))},this.getCallLink=e=>{const t=(e.match(/\d+/g)||[]).join(""),n=t.length<11?`1${t}`:t,i=`+${n[0]}-${n.slice(1,4)}-${n.slice(4,7)}-${n.slice(7)}`;return H`<a href="tel:${i}"
|
|
4698
4696
|
>${e}</a
|
|
4699
|
-
>`},this.enforcePhoneFormat=e=>{(e=>{const t=e.keyCode;return t>=48&&t<=57||t>=96&&t<=105})(e)||qn(e)||e.preventDefault()},this.onSubmitTextUs=async()=>{var e,t,n,i,r;if(this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.phoneNumberToText&&14===this.phoneNumberToText.length||(this.hasPhoneNumberError=!0),!this.hasPhoneNumberError)try{this.submittingTextUsOption=!0,await
|
|
4697
|
+
>`},this.enforcePhoneFormat=e=>{(e=>{const t=e.keyCode;return t>=48&&t<=57||t>=96&&t<=105})(e)||qn(e)||e.preventDefault()},this.onSubmitTextUs=async()=>{var e,t,n,i,r;if(this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.phoneNumberToText&&14===this.phoneNumberToText.length||(this.hasPhoneNumberError=!0),!this.hasPhoneNumberError)try{this.submittingTextUsOption=!0,await Bu(this.phoneNumberToText,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(this.currentLeadSource?[this.currentLeadSource,aa(this.orgSlug)]:[aa(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null})),null===(n=this.leadSourceClient)||void 0===n||n.checkAndHandleForLogLeadSource({webchatAction:"text-us",stateId:null}),null===(i=this.leadSourceClient)||void 0===i||i.resetLeadSource(),null===(r=this.leadSourceMultitouchClient)||void 0===r||r.resetLeadSourceTouchpoints(),this.hasSubmittedForm=!0,this.submittingTextUsOption=!1}catch(e){this.submittingTextUsOption=!1,this.hasSubmissionError=!0}},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(qn(e))return;const t=e.target;this.phoneNumberToText=Wn(t.value),this.phoneNumberInputRef.value.value=this.phoneNumberToText},this.renderFormTextUsOption=()=>H` <div class="text-us-wrapper">
|
|
4700
4698
|
<h1 class="text-us-window__header">Send Us a Text</h1>
|
|
4701
4699
|
<div class="text-us-window__input-container">
|
|
4702
4700
|
<input
|
|
@@ -4823,7 +4821,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4823
4821
|
Contact Our Leasing Team
|
|
4824
4822
|
</h1>
|
|
4825
4823
|
<div class="call-us-window__phone-redirect">
|
|
4826
|
-
${
|
|
4824
|
+
${Nu("black")}
|
|
4827
4825
|
${this.getCallLink(this.phoneNumberToCall)}
|
|
4828
4826
|
</div>
|
|
4829
4827
|
<div class="call-us-window__office-hours-wrapper">
|
|
@@ -4849,7 +4847,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4849
4847
|
</div>`:""}
|
|
4850
4848
|
${this.hasTextUsEnabled?this.hasSubmittedForm?this.renderSubmittedTextUsOption():this.renderFormTextUsOption():""}
|
|
4851
4849
|
</details-window>
|
|
4852
|
-
`}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab)}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}updated(){this.movedFocusInside||
|
|
4850
|
+
`}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.trapOverlayTab)}disconnectedCallback(){this.removeEventListener("keydown",this.trapOverlayTab),super.disconnectedCallback()}updated(){this.movedFocusInside||ou(this)&&(this.movedFocusInside=!0)}};Uu.styles=[Me,p`
|
|
4853
4851
|
#call-us-window__content-wrapper {
|
|
4854
4852
|
font-family: "Helvetica Neue", Arial;
|
|
4855
4853
|
font-style: normal;
|
|
@@ -4954,7 +4952,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4954
4952
|
.text-us-window__error {
|
|
4955
4953
|
color: rgb(255, 49, 3);
|
|
4956
4954
|
}
|
|
4957
|
-
`],
|
|
4955
|
+
`],Ru([pe({attribute:!0})],Uu.prototype,"buildingSlug",void 0),Ru([pe({attribute:!0})],Uu.prototype,"orgSlug",void 0),Ru([pe({attribute:!1})],Uu.prototype,"onCloseClicked",void 0),Ru([pe()],Uu.prototype,"phoneNumberToCall",void 0),Ru([pe()],Uu.prototype,"phoneNumberToText",void 0),Ru([pe({attribute:!1})],Uu.prototype,"buildingId",void 0),Ru([pe({attribute:!1})],Uu.prototype,"buildingName",void 0),Ru([pe({attribute:!0})],Uu.prototype,"chatCallUsHeader",void 0),Ru([pe({attribute:!0})],Uu.prototype,"hasCallUsEnabled",void 0),Ru([pe({attribute:!0})],Uu.prototype,"hasTextUsEnabled",void 0),Ru([pe({attribute:!0})],Uu.prototype,"currentLeadSource",void 0),Ru([pe({attribute:!0})],Uu.prototype,"orgLegalName",void 0),Ru([pe({attribute:!1})],Uu.prototype,"country",void 0),Ru([pe({attribute:!1})],Uu.prototype,"buildingState",void 0),Ru([pe({attribute:!0})],Uu.prototype,"leadSourceClient",void 0),Ru([pe({attribute:!0})],Uu.prototype,"leadSourceMultitouchClient",void 0),Ru([fe()],Uu.prototype,"hasSubmittedForm",void 0),Ru([fe()],Uu.prototype,"hasPhoneNumberError",void 0),Ru([fe()],Uu.prototype,"hasSubmissionError",void 0),Ru([fe()],Uu.prototype,"submittingTextUsOption",void 0),Ru([pe({attribute:!1})],Uu.prototype,"officeHoursTextInfo",void 0),Uu=Ru([ce("call-us-window")],Uu);const Bu=async(e,t,n,i,o,a,s)=>{const u="+1"+e.replace("(","").replace(")","").replace(" ","").replace("-",""),d=new URLSearchParams(window.location.search),c={building_id:t,lead_sources:o,phone_number:u,referrer:document.referrer,query_params:Object.fromEntries(d.entries()),conversation_tracking_id:a,tracking_params:l(n),lead_sources_with_timestamps:(null!=s?s:[]).map(e=>_r({...e}))};Eo("textUsSubmitted",{phone:u,originatingSource:o.find(e=>"property-website"!==e)||null,conversationTrackingId:null!=a?a:null}),await r().post("https://app.meetelise.com/platformApi/state/create/textMe",c,{headers:{"building-slug":i,"org-slug":n,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})},ju=p`
|
|
4958
4956
|
:host {
|
|
4959
4957
|
display: block;
|
|
4960
4958
|
position: relative;
|
|
@@ -5266,7 +5264,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5266
5264
|
margin: 2px 0;
|
|
5267
5265
|
}
|
|
5268
5266
|
}
|
|
5269
|
-
`;class
|
|
5267
|
+
`;class Fu{constructor(e={}){var t,n,i,r,o,a;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(n=e.description)&&void 0!==n?n:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(a=e.available)&&void 0!==a&&a,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class Hu{constructor(e={}){var t,n,i,r,o;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(n=e.type)&&void 0!==n?n:"",this.minAvailableItem=e.minAvailableItem?new Fu(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new Fu(e.maxAvailableItem):void 0,this.allItems=(null!==(i=e.allItems)&&void 0!==i?i:[]).map(e=>new Fu(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 Gu,zu;!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"}(Gu||(Gu={})),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"}(zu||(zu={}));class Qu{constructor(e={}){var t,n,i,r,o,a,s,l,u,d;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.building_id=e.building_id,this.fee_name=null!==(n=e.fee_name)&&void 0!==n?n:"",this.amount=e.amount,this.amount_display=null!==(i=e.amount_display)&&void 0!==i?i:"",this.limit=null!==(r=e.limit)&&void 0!==r?r:null,this.min_estimate=e.min_estimate,this.max_estimate=e.max_estimate,this.percent_rent=e.percent_rent,this.percent_rent_min=e.percent_rent_min,this.percent_rent_max=e.percent_rent_max,this.frequency=null!==(o=e.frequency)&&void 0!==o?o:Gu.ONE_TIME,this.category=null!==(a=e.category)&&void 0!==a?a:zu.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 Wu=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()}`:""}},Vu=es,qu=e=>new Qu(e),Yu=e=>new Hu(e),Ku=async(e,t)=>{try{const n=(new Wu).addArray("layout_ids",null==t?void 0:t.map(e=>e.toString())),i=await r().get(`${Vu}/platformApi/webchat/${e}/marketable-fees?${n.build()}`);if(i.data){const e=Tr(i.data);return{fees:e.fees.map(qu),rentableItems:e.rentableItems.map(Yu),buildingIncentives:e.buildingIncentives}}}catch(t){na({logType:ta.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t},error:t})}return{fees:[],rentableItems:[],buildingIncentives:[]}},Xu=-1,Zu=es,Ju=async({buildingSlug:e,unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a},s)=>{try{const l=await r().post(`${Zu}/platformApi/webchat/${e}/quote/calculate`,_r({unitId:t,chargeInputs:n,rentableItems:i,...Number.isFinite(o)?{leaseTerm:o}:{},moveInDate:a}),{signal:s});if(l.data){return Tr(l.data)}}catch(t){const n=t;"ERR_CANCELED"!==n.code&&na({logType:ta.error,buildingSlug:e,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:t},error:t});const i=(e=>{var t,n,i;const r=null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.detail;if(422!==(null===(i=e.response)||void 0===i?void 0:i.status)||!Array.isArray(r))return null;const o=r.map(e=>Tr(e));return o.length>0&&o.every(e=>"number"==typeof e.limit)?o:null})(n);return{quote:null,error:i?{type:"feeLimit",violations:i}:{type:"unknown"}}}return{quote:null,error:{type:"unknown"}}};function ed(e){return ir(e,"yyyy-MM-dd")}function td(){return ed(Hr())}const nd=es,id=async({buildingSlug:e,numBedrooms:t,moveInDateString:n,leaseTerm:i})=>{try{const a=(({numBedrooms:e,moveInDateString:t,leaseTerm:n})=>{const i=new Wu;return i.addArray("num_bedrooms",null==e?void 0:e.map(e=>e.toString())).addSingle("move_in_date_earliest",t).addSingle("move_in_date_latest",t).addSingle("lease_term_min",Number.isFinite(n)?null==n?void 0:n.toString():void 0),i.build()})({numBedrooms:t,moveInDateString:n,leaseTerm:i}),s=await r().get(`${nd}/platformApi/webchat/${e}/units${a}`);if(s.data){const e=Tr(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){na({logType:ta.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS]",logData:{error:r,params:{numBedrooms:t,moveInDateString:n,leaseTerm:i}},error:r})}var o;return[]},rd=[zu.PetFee,zu.PetRent,zu.PetDeposit];function od(e){return`Up to ${e} ${1===e?"pet":"pets"} allowed`}const ad=({color:e="#347FF7",size:t=24}={})=>G`
|
|
5270
5268
|
<svg aria-hidden="true" focusable="false" width="${t}" height="${t}" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5271
5269
|
<g id="Frame" clip-path="url(#clip0_18718_332018)">
|
|
5272
5270
|
<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"/>
|
|
@@ -5279,7 +5277,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5279
5277
|
</clipPath>
|
|
5280
5278
|
</defs>
|
|
5281
5279
|
</svg>
|
|
5282
|
-
`,
|
|
5280
|
+
`,sd=p`
|
|
5283
5281
|
:host {
|
|
5284
5282
|
display: block;
|
|
5285
5283
|
margin-bottom: 20px;
|
|
@@ -5313,9 +5311,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5313
5311
|
color: #868e96;
|
|
5314
5312
|
font-size: 0.8rem;
|
|
5315
5313
|
}
|
|
5316
|
-
`;var
|
|
5314
|
+
`;var ld=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ud=class extends ue{constructor(){super(...arguments),this.promoAmount="0",this.promoDescription="",this.promoValidity=""}render(){return H`
|
|
5317
5315
|
<div class="promo-card">
|
|
5318
|
-
<div class="icon-container">${
|
|
5316
|
+
<div class="icon-container">${ad()}</div>
|
|
5319
5317
|
<div class="content-container">
|
|
5320
5318
|
<h2 class="promo-heading">
|
|
5321
5319
|
${this.promoAmount} ${this.promoDescription}
|
|
@@ -5323,7 +5321,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5323
5321
|
<div class="promo-subtitle">${this.promoValidity}</div>
|
|
5324
5322
|
</div>
|
|
5325
5323
|
</div>
|
|
5326
|
-
`}};
|
|
5324
|
+
`}};ud.styles=sd,ld([pe({type:String})],ud.prototype,"promoAmount",void 0),ld([pe({type:String})],ud.prototype,"promoDescription",void 0),ld([pe({type:String})],ud.prototype,"promoValidity",void 0),ud=ld([ce("promo-card")],ud);const dd=p`
|
|
5327
5325
|
:host {
|
|
5328
5326
|
display: block;
|
|
5329
5327
|
}
|
|
@@ -5500,7 +5498,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5500
5498
|
overflow-x: auto;
|
|
5501
5499
|
}
|
|
5502
5500
|
}
|
|
5503
|
-
`,
|
|
5501
|
+
`,cd=p`
|
|
5504
5502
|
:host {
|
|
5505
5503
|
display: block;
|
|
5506
5504
|
}
|
|
@@ -5604,7 +5602,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5604
5602
|
margin-right: 8px;
|
|
5605
5603
|
}
|
|
5606
5604
|
}
|
|
5607
|
-
`;var
|
|
5605
|
+
`;var hd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let pd=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`
|
|
5608
5606
|
<div class="floorplan-image-card ${this.selected?"selected":""}">
|
|
5609
5607
|
<div class="section-left">
|
|
5610
5608
|
${this.unit.floorplanUrl?H`
|
|
@@ -5629,7 +5627,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5629
5627
|
</p>
|
|
5630
5628
|
</div>
|
|
5631
5629
|
</div>
|
|
5632
|
-
`}};
|
|
5630
|
+
`}};pd.styles=cd,hd([pe({type:Object})],pd.prototype,"unit",void 0),hd([pe()],pd.prototype,"onUnitSelect",void 0),hd([pe({type:Boolean})],pd.prototype,"selected",void 0),pd=hd([ce("floorplan-image-card")],pd);var fd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let gd=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.layoutOptions=[],this.selectedLayoutIds=[Xu],this.units=[],this.isLoading=!1,this.isLoadingLayouts=!1,this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.moveInDate=Hr(),this.leaseTerm=12,this.selectedUnit=null,this.handleUnitSelect=e=>{var t;this.selectedUnit=e,null===(t=this.onUnitSelect)||void 0===t||t.call(this,e)},this.handleLayoutChange=e=>{var t;let n;e===Xu?n=[Xu]:this.selectedLayoutIds.includes(Xu)?n=[e]:this.selectedLayoutIds.includes(e)?(n=this.selectedLayoutIds.filter(t=>t!==e),0===n.length&&(n=[Xu])):n=[...this.selectedLayoutIds,e],this.selectedLayoutIds=n,null===(t=this.onSelectLayout)||void 0===t||t.call(this,this.selectedLayoutIds)},this.handleMoveInDateChange=e=>{var t;const n=e.target.value,i=Hr();if(n){const[e,t,r]=n.split("-").map(Number),o=new Date(e,t-1,r);if(Er(o,i))return;this.moveInDate=o}else this.moveInDate=i;null===(t=this.onMoveInDateChange)||void 0===t||t.call(this,n||ed(i))},this.handleLeaseTermChange=e=>{var t;const n=parseInt(e.target.value);!Number.isInteger(n)||n<=0||(this.leaseTerm=n,null===(t=this.onLeaseTermChange)||void 0===t||t.call(this,this.leaseTerm))},this.renderUnitSelection=()=>{var e,t;return this.isLoading?H`
|
|
5633
5631
|
<div class="unit-selection">
|
|
5634
5632
|
<div class="image-carousel">
|
|
5635
5633
|
${Array.from({length:3},()=>H`<div class="unit-card-skeleton shimmer"></div>`)}
|
|
@@ -5667,7 +5665,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5667
5665
|
</div>
|
|
5668
5666
|
`)}
|
|
5669
5667
|
</div>
|
|
5670
|
-
`}get displayOptions(){const e=e=>{let t=e;return Object.entries({zero:"0",one:"1",two:"2",three:"3",four:"4",five:"5",six:"6",seven:"7",eight:"8",nine:"9",ten:"10",eleven:"11",twelve:"12"}).forEach(([e,n])=>{const i=new RegExp(`\\b${e}\\b`,"gi");t=t.replace(i,n)}),t};return[{value:
|
|
5668
|
+
`}get displayOptions(){const e=e=>{let t=e;return Object.entries({zero:"0",one:"1",two:"2",three:"3",four:"4",five:"5",six:"6",seven:"7",eight:"8",nine:"9",ten:"10",eleven:"11",twelve:"12"}).forEach(([e,n])=>{const i=new RegExp(`\\b${e}\\b`,"gi");t=t.replace(i,n)}),t};return[{value:Xu,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`
|
|
5671
5669
|
<div class="floor-plan-selector">
|
|
5672
5670
|
<div class="floor-plan-selector-label">Select Floor Plan</div>
|
|
5673
5671
|
${this.renderBadges()}
|
|
@@ -5679,8 +5677,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5679
5677
|
<input
|
|
5680
5678
|
type="date"
|
|
5681
5679
|
placeholder="Select move in date"
|
|
5682
|
-
min=${
|
|
5683
|
-
.value=${this.moveInDate?
|
|
5680
|
+
min=${td()}
|
|
5681
|
+
.value=${this.moveInDate?ed(this.moveInDate):""}
|
|
5684
5682
|
@input=${this.handleMoveInDateChange}
|
|
5685
5683
|
/>
|
|
5686
5684
|
</div>
|
|
@@ -5699,7 +5697,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5699
5697
|
${this.renderUnitSelection()}
|
|
5700
5698
|
</div>
|
|
5701
5699
|
</div>
|
|
5702
|
-
`}};
|
|
5700
|
+
`}};gd.styles=dd,fd([pe({type:String})],gd.prototype,"buildingSlug",void 0),fd([pe({type:Array})],gd.prototype,"layoutOptions",void 0),fd([pe({type:Array})],gd.prototype,"selectedLayoutIds",void 0),fd([pe({type:Array})],gd.prototype,"units",void 0),fd([pe({type:Boolean})],gd.prototype,"isLoading",void 0),fd([pe({type:Boolean})],gd.prototype,"isLoadingLayouts",void 0),fd([pe()],gd.prototype,"onSelectLayout",void 0),fd([pe()],gd.prototype,"onUnitSelect",void 0),fd([pe()],gd.prototype,"onMoveInDateChange",void 0),fd([pe()],gd.prototype,"onLeaseTermChange",void 0),fd([fe()],gd.prototype,"moveInDate",void 0),fd([fe()],gd.prototype,"leaseTerm",void 0),fd([fe()],gd.prototype,"selectedUnit",void 0),gd=fd([ce("floor-plan-selector")],gd);const md=p`
|
|
5703
5701
|
:host {
|
|
5704
5702
|
display: block;
|
|
5705
5703
|
width: 100%;
|
|
@@ -5745,7 +5743,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5745
5743
|
font-size: 1rem;
|
|
5746
5744
|
align-self: center;
|
|
5747
5745
|
}
|
|
5748
|
-
`;var
|
|
5746
|
+
`;var bd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let yd=class extends ue{constructor(){super(...arguments),this.feeQuote=null}get name(){var e,t;if(null===(e=this.feeQuote)||void 0===e?void 0:e.sourceRentableItem)return Rr(this.feeQuote.sourceRentableItem.description||"");const n=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee;return(null==n?void 0:n.feeName)?Rr(n.feeName):""}get description(){var e,t,n,i;if(null===(e=this.feeQuote)||void 0===e?void 0:e.sourceRentableItem){return`${this.feeQuote.sourceRentableItem.id}`}return null!==(i=null===(n=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee)||void 0===n?void 0:n.description)&&void 0!==i?i:""}get additionalInfo(){var e,t,n;return null!==(n=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.additionalInfo)&&void 0!==n?n:""}get triggeredEvent(){var e,t;const n=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.triggeredByEvent;if(!n)return"";return{APPLICATION_SUBMISSION:"Due at Application Submission",APPLICATION_APPROVAL:"Due at Application Approval",LEASE_SIGNING:"Due at Lease Signing",MOVE_IN:"Due at Move-In"}[n]||n}get amount(){var e;if(!this.feeQuote)return null;const t=null!==(e=this.feeQuote.amountRange.fixedValue)&&void 0!==e?e:0;return 0===t?null:Ur(t,2)}render(){return this.feeQuote&&this.amount?H`
|
|
5749
5747
|
<div class="fee-item">
|
|
5750
5748
|
<div class="fee-info">
|
|
5751
5749
|
<div class="fee-name">${this.name}</div>
|
|
@@ -5759,7 +5757,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5759
5757
|
</div>
|
|
5760
5758
|
<div class="fee-amount">${this.amount}</div>
|
|
5761
5759
|
</div>
|
|
5762
|
-
`:H``}};
|
|
5760
|
+
`:H``}};yd.styles=md,bd([pe({type:Object})],yd.prototype,"feeQuote",void 0),yd=bd([ce("fee-item")],yd);var vd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let wd=class extends ue{constructor(){super(...arguments),this.feeQuotes=[]}get itemType(){const e=this.feeQuotes[0];return(null==e?void 0:e.sourceRentableItem)?Rr(e.sourceRentableItem.description||""):""}get priceGroups(){const e=new Map;return this.feeQuotes.forEach(t=>{var n;const i=null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0;e.set(i,(e.get(i)||0)+1)}),Array.from(e.entries()).map(([e,t])=>({price:e,count:t})).sort((e,t)=>e.price-t.price)}get totalAmount(){const e=this.feeQuotes.reduce((e,t)=>{var n;return e+(null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0)},0);return Ur(e,2)}get priceBreakdown(){const e=this.priceGroups;if(0===e.length)return"";const t=this.getUnitName();return e.map(e=>{return`${e.count} ${n=t,i=e.count,1===i?n:`${n}s`} @ ${Ur(e.price,2)}/month`;var n,i}).join(" + ")}getUnitName(){var e;const t=this.feeQuotes[0];return function(e){const t=e.toLowerCase();return t.includes("garage")||t.includes("parking")?"space":t.includes("storage")?"unit":t.includes("locker")?"locker":t.includes("bike")?"spot":"unit"}((null===(e=null==t?void 0:t.sourceRentableItem)||void 0===e?void 0:e.description)||"")}render(){return this.feeQuotes.length&&this.totalAmount!==Ur(0,2)?H`
|
|
5763
5761
|
<div class="fee-item">
|
|
5764
5762
|
<div class="fee-info">
|
|
5765
5763
|
<div class="fee-name">${this.itemType}</div>
|
|
@@ -5767,7 +5765,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5767
5765
|
</div>
|
|
5768
5766
|
<div class="fee-amount">${this.totalAmount}</div>
|
|
5769
5767
|
</div>
|
|
5770
|
-
`:H``}};
|
|
5768
|
+
`:H``}};wd.styles=md,vd([pe({type:Array})],wd.prototype,"feeQuotes",void 0),wd=vd([ce("grouped-rentable-item")],wd);const Cd=p`
|
|
5771
5769
|
.fee-card-section-container {
|
|
5772
5770
|
margin: 0 12px;
|
|
5773
5771
|
border-radius: 4px;
|
|
@@ -5827,7 +5825,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5827
5825
|
margin: 12px;
|
|
5828
5826
|
justify-content: space-between;
|
|
5829
5827
|
}
|
|
5830
|
-
`;var
|
|
5828
|
+
`;var xd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let $d=class extends ue{constructor(){super(...arguments),this.title="Fees",this.fees=[],this.buildingFeesToQuantity={},this.handleQuantityChange=(e,t)=>{this.buildingFeesToQuantity[e]=t,this.requestUpdate()}}get totalAmount(){const e=this.fees.reduce((e,t)=>{var n;return e+(null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0)},0);return Ur(e,2)}get groupedRentableItems(){const e=this.fees.filter(e=>e.sourceRentableItem);e.sort((e,t)=>{var n,i;const r=(null===(n=e.sourceRentableItem)||void 0===n?void 0:n.description)||"",o=(null===(i=t.sourceRentableItem)||void 0===i?void 0:i.description)||"";return r.localeCompare(o,navigator.language,{numeric:!0})});const t={};return e.forEach(e=>{var n;const i=(null===(n=e.sourceRentableItem)||void 0===n?void 0:n.description)||"unknown";t[i]||(t[i]=[]),t[i].push(e)}),t}get nonRentableItems(){return this.fees.filter(e=>!e.sourceRentableItem)}render(){return H`
|
|
5831
5829
|
<div class="fee-card-section-container">
|
|
5832
5830
|
<div class="fee-card-section-header">
|
|
5833
5831
|
<h1 class="section-title">${this.title}</h1>
|
|
@@ -5851,7 +5849,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
5851
5849
|
</div>
|
|
5852
5850
|
</div>
|
|
5853
5851
|
</div>
|
|
5854
|
-
`}}
|
|
5852
|
+
`}};$d.styles=Cd,xd([pe({type:String})],$d.prototype,"title",void 0),xd([pe({type:Array})],$d.prototype,"fees",void 0),xd([fe()],$d.prototype,"buildingFeesToQuantity",void 0),$d=xd([ce("fee-card")],$d);const Sd=p`
|
|
5855
5853
|
:host {
|
|
5856
5854
|
--transition-timing: 0.2s ease;
|
|
5857
5855
|
display: flex;
|
|
@@ -6060,7 +6058,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6060
6058
|
font-weight: bold;
|
|
6061
6059
|
color: #0066cc;
|
|
6062
6060
|
}
|
|
6063
|
-
`;var
|
|
6061
|
+
`;var Ad;!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"}(Ad||(Ad={}));var kd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};const Ed=["num_cats","num_dogs","num_other_pets"];let Td=class extends ue{constructor(){super(...arguments),this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1,num_cats:0,num_dogs:0,num_other_pets:0},this.onChargeInputsChange=null,this.disabled=!1,this.maxPets=null,this.rentableItems=[],this.selectedRentableItems=[],this.onRentableItemAdd=null,this.onRentableItemRemove=null,this.handleRentableItemToggle=e=>{var t,n;if(this.selectedRentableItems.some(t=>t.type===e.type)){const n=this.selectedRentableItems.find(t=>t.type===e.type);n&&(null===(t=this.onRentableItemRemove)||void 0===t||t.call(this,n))}else{const t=e.minAvailableItem||e.allItems[0];if(t){const i={id:t.id,type:e.type};null===(n=this.onRentableItemAdd)||void 0===n||n.call(this,i)}}}}get totalPets(){var e,t,n;return(null!==(e=this.chargeInputs.num_cats)&&void 0!==e?e:0)+(null!==(t=this.chargeInputs.num_dogs)&&void 0!==t?t:0)+(null!==(n=this.chargeInputs.num_other_pets)&&void 0!==n?n:0)}isAtPetLimit(e){return null!==this.maxPets&&Ed.includes(e)&&this.totalPets>=this.maxPets}handleIncrement(e){var t,n;if(this.isAtPetLimit(e))return;const i=(null!==(t=this.chargeInputs[e])&&void 0!==t?t:0)+1;Ed.includes(e)?this.updatePetCount({[e]:i}):null===(n=this.onChargeInputsChange)||void 0===n||n.call(this,{[e]:i})}handleDecrement(e){var t,n;const i=null!==(t=this.chargeInputs[e])&&void 0!==t?t:0,r="num_applicants"===e?1:0,o=Math.max(r,i-1);Ed.includes(e)?this.updatePetCount({[e]:o}):null===(n=this.onChargeInputsChange)||void 0===n||n.call(this,{[e]:o})}updatePetCount(e){var t,n,i,r;const o={...this.chargeInputs,...e},a=(null!==(t=o.num_cats)&&void 0!==t?t:0)+(null!==(n=o.num_dogs)&&void 0!==n?n:0)+(null!==(i=o.num_other_pets)&&void 0!==i?i:0);null===(r=this.onChargeInputsChange)||void 0===r||r.call(this,{...e,num_pets:a})}getFieldLabel(e){return{base_rent:"Base Rent ($)",num_pets:"Pets",num_vehicles:"Vehicles",num_applicants:"Applicants",num_cats:"Cats",num_dogs:"Dogs",num_other_pets:"All Other Pets"}[e]||e}renderRentableItemRow(e){const t=this.selectedRentableItems.some(t=>t.type===e.type);return H`
|
|
6064
6062
|
<div class="rentable-item-row">
|
|
6065
6063
|
<div class="rentable-item-info">
|
|
6066
6064
|
<div class="rentable-item-label">${e.description}</div>
|
|
@@ -6109,7 +6107,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6109
6107
|
${["num_applicants","num_cats","num_dogs","num_other_pets"].map(e=>this.renderChargeInputRow(e))}
|
|
6110
6108
|
${null!==this.maxPets?H`
|
|
6111
6109
|
<div class="charge-input-note">
|
|
6112
|
-
${
|
|
6110
|
+
${od(this.maxPets)}
|
|
6113
6111
|
</div>
|
|
6114
6112
|
`:""}
|
|
6115
6113
|
</div>
|
|
@@ -6121,7 +6119,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6121
6119
|
</div>
|
|
6122
6120
|
`:""}
|
|
6123
6121
|
</div>
|
|
6124
|
-
`}};
|
|
6122
|
+
`}};Td.styles=p`
|
|
6125
6123
|
.charge-inputs-container {
|
|
6126
6124
|
background: white;
|
|
6127
6125
|
border-radius: 8px;
|
|
@@ -6255,7 +6253,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6255
6253
|
opacity: 0.5;
|
|
6256
6254
|
cursor: not-allowed;
|
|
6257
6255
|
}
|
|
6258
|
-
`,
|
|
6256
|
+
`,kd([pe({type:Object})],Td.prototype,"chargeInputs",void 0),kd([pe()],Td.prototype,"onChargeInputsChange",void 0),kd([pe({type:Boolean})],Td.prototype,"disabled",void 0),kd([pe({type:Number})],Td.prototype,"maxPets",void 0),kd([pe({type:Array})],Td.prototype,"rentableItems",void 0),kd([pe({type:Array})],Td.prototype,"selectedRentableItems",void 0),kd([pe()],Td.prototype,"onRentableItemAdd",void 0),kd([pe()],Td.prototype,"onRentableItemRemove",void 0),Td=kd([ce("charge-inputs")],Td);const _d=p`
|
|
6259
6257
|
:host {
|
|
6260
6258
|
--skeleton-bg-color: #eaeaea;
|
|
6261
6259
|
--skeleton-highlight-color: #f5f5f5;
|
|
@@ -6269,8 +6267,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6269
6267
|
background-position: 200px 0;
|
|
6270
6268
|
}
|
|
6271
6269
|
}
|
|
6272
|
-
`,
|
|
6273
|
-
${
|
|
6270
|
+
`,Od=p`
|
|
6271
|
+
${_d}
|
|
6274
6272
|
|
|
6275
6273
|
:host {
|
|
6276
6274
|
display: block;
|
|
@@ -6335,8 +6333,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6335
6333
|
margin-bottom: 10px;
|
|
6336
6334
|
}
|
|
6337
6335
|
}
|
|
6338
|
-
`,
|
|
6339
|
-
${
|
|
6336
|
+
`,Pd=p`
|
|
6337
|
+
${_d}
|
|
6340
6338
|
|
|
6341
6339
|
:host {
|
|
6342
6340
|
display: block;
|
|
@@ -6358,16 +6356,16 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6358
6356
|
box-sizing: border-box;
|
|
6359
6357
|
}
|
|
6360
6358
|
}
|
|
6361
|
-
`;var
|
|
6359
|
+
`;var Id=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Nd=class extends ue{constructor(){super(...arguments),this.rows=2,this.header=!0}render(){return H`
|
|
6362
6360
|
<div class="skeleton-card">
|
|
6363
6361
|
${this.header?H`<div class="skeleton-header"></div>`:""}
|
|
6364
6362
|
${Array(this.rows).fill(0).map(()=>H`<div class="skeleton-row"></div>`)}
|
|
6365
6363
|
</div>
|
|
6366
|
-
`}};
|
|
6364
|
+
`}};Nd.styles=Od,Id([pe({type:Number})],Nd.prototype,"rows",void 0),Id([pe({type:Boolean})],Nd.prototype,"header",void 0),Nd=Id([ce("skeleton-card")],Nd);var Md=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Dd=class extends ue{constructor(){super(...arguments),this.cards=3,this.rowsPerCard=[3,2,1]}render(){return H`
|
|
6367
6365
|
<div class="skeleton-loader">
|
|
6368
6366
|
${Array.from({length:this.cards},(e,t)=>{const n=Array.isArray(this.rowsPerCard)?this.rowsPerCard[t]||2:this.rowsPerCard;return H`<skeleton-card .rows=${n}></skeleton-card>`})}
|
|
6369
6367
|
</div>
|
|
6370
|
-
`}};
|
|
6368
|
+
`}};Dd.styles=Pd,Md([pe({type:Number})],Dd.prototype,"cards",void 0),Md([pe({type:Array})],Dd.prototype,"rowsPerCard",void 0),Dd=Md([ce("skeleton-loader")],Dd);var Ld=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Rd=class extends ue{constructor(){super(...arguments),this.size=64,this.spinSpeed=.8}updated(){this.style.setProperty("--mega-loader-size",`${this.size}px`),this.style.setProperty("--mega-loader-spin-speed",`${this.spinSpeed}s`)}render(){return H`<div class="spinner"></div>`}};Rd.styles=p`
|
|
6371
6369
|
.spinner {
|
|
6372
6370
|
border: 4px solid rgba(0, 0, 0, 0.2);
|
|
6373
6371
|
border-top: 4px solid var(--primary-color, #c057ff);
|
|
@@ -6385,14 +6383,14 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6385
6383
|
transform: rotate(360deg);
|
|
6386
6384
|
}
|
|
6387
6385
|
}
|
|
6388
|
-
`,
|
|
6386
|
+
`,Ld([pe({type:Number})],Rd.prototype,"size",void 0),Ld([pe({type:Number})],Rd.prototype,"spinSpeed",void 0),Rd=Ld([ce("mega-loader")],Rd);var Ud=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Bd=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.showSkeletonLoader=!1,this.selectedUnit=null,this.quote=null,this.quoteError=null,this.layoutOptions=[],this.selectedLayoutIds=[Xu],this.groupedFees={[Gu.ONE_TIME]:[],[Gu.MONTHLY]:[],[Gu.WEEKLY]:[],[Gu.BI_WEEKLY]:[],[Gu.ANNUALLY]:[],[Gu.DAILY]:[],[Gu.AS_NEEDED]:[],[Gu.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:Ur(this.quote.rentCost,2),minEstimate:null,maxEstimate:null,percentRentMin:null,percentRentMax:null,percentRent:null,frequency:Ad.MONTHLY,category:"Rent",hiddenReason:null,description:`Unit ${null===(t=this.selectedUnit)||void 0===t?void 0:t.unitNumber}`,additionalInfo:null,refundable:!1,unitIds:null,layoutIds:null,startDate:null,endDate:null,triggeredByEvent:null,externalKey:null,chargeCode:null,bundleKey:null,source:null,publicFacing:!0,perApplicant:!1,prorated:null,syncActive:!0},amountRange:{fixedValue:this.quote.rentCost,minValue:null,maxValue:null},chargeInputs:{baseRent:this.quote.rentCost,numPets:0,numDogs:0,numCats:0,numOtherPets:0,numVehicles:0,numApplicants:1,unitId:this.quote.unitId,layoutId:null},isAddon:!1}:null}renderRecurringFeeSection(e,t){return(null==t?void 0:t.length)?H` <fee-card .fees=${t} title=${e}></fee-card> `:null}renderFeeSections(){var e,t;const n=[],i=[{freq:Ad.ANNUALLY,title:"Yearly Charges"},{freq:Ad.MONTHLY,title:"Monthly Charges"},{freq:Ad.BI_WEEKLY,title:"Bi-Weekly Charges"},{freq:Ad.WEEKLY,title:"Weekly Charges"},{freq:Ad.DAILY,title:"Daily Charges"},{freq:Ad.ONE_TIME,title:"One-Time"},{freq:Ad.NEVER,title:"No Charges"}],r=null===(e=this.quote)||void 0===e?void 0:e.feeQuotes;for(const{freq:e,title:o}of i){if(!(null==r?void 0:r.length)&&e!==Ad.MONTHLY)continue;let i=null!==(t=null==r?void 0:r.filter(t=>{var n,i;if((null===(n=t.marketableFee)||void 0===n?void 0:n.frequency)===e){if(e===Ad.ONE_TIME){return["APPLICATION_SUBMISSION","APPLICATION_APPROVAL","LEASE_SIGNING","MOVE_IN"].includes((null===(i=t.marketableFee)||void 0===i?void 0:i.triggeredByEvent)||"")}return!0}return!!t.sourceRentableItem&&("monthly"===t.sourceRentableItem.rentFrequency&&e===Ad.MONTHLY||"annually"===t.sourceRentableItem.rentFrequency&&e===Ad.ANNUALLY)}))&&void 0!==t?t:[];if(e===Ad.MONTHLY){const e=this.rentAsFeeQuote;e&&(i=[e,...i])}const a=this.renderRecurringFeeSection(o,i);a&&n.push(a)}return n}renderTotalCost(){var e;if(!(null===(e=this.quote)||void 0===e?void 0:e.totalMonthlyCost))return null;const t=this.quote.totalMonthlyCost.fixedValue;return t?H`
|
|
6389
6387
|
<div class="total-cost-section">
|
|
6390
6388
|
<div class="total-cost-row">
|
|
6391
6389
|
<span class="total-cost-label">Total Monthly Cost:</span>
|
|
6392
6390
|
<span class="total-cost-amount">${Ur(t,2)}</span>
|
|
6393
6391
|
</div>
|
|
6394
6392
|
</div>
|
|
6395
|
-
`:null}getQuoteErrorMessage(e){if("feeLimit"===e.type){return`${
|
|
6393
|
+
`:null}getQuoteErrorMessage(e){if("feeLimit"===e.type){return`${od(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`
|
|
6396
6394
|
<div class="fees-container empty-state" role="alert">
|
|
6397
6395
|
<p class="quote-error-message">
|
|
6398
6396
|
${this.getQuoteErrorMessage(this.quoteError)}
|
|
@@ -6448,7 +6446,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6448
6446
|
|
|
6449
6447
|
${this.renderFeesContent()}
|
|
6450
6448
|
</div>
|
|
6451
|
-
`}};
|
|
6449
|
+
`}};Bd.styles=Sd,Ud([pe({type:String})],Bd.prototype,"buildingSlug",void 0),Ud([pe({type:Boolean})],Bd.prototype,"showSkeletonLoader",void 0),Ud([pe({type:Object})],Bd.prototype,"selectedUnit",void 0),Ud([pe({type:Object})],Bd.prototype,"quote",void 0),Ud([pe({type:Object})],Bd.prototype,"quoteError",void 0),Ud([pe({type:Array})],Bd.prototype,"layoutOptions",void 0),Ud([pe({type:Array})],Bd.prototype,"selectedLayoutIds",void 0),Ud([pe({type:Object})],Bd.prototype,"groupedFees",void 0),Ud([pe({type:Array})],Bd.prototype,"rentableItems",void 0),Ud([pe({type:Array})],Bd.prototype,"units",void 0),Ud([pe({type:Boolean})],Bd.prototype,"isLoadingUnits",void 0),Ud([pe({type:Boolean})],Bd.prototype,"isLoadingLayouts",void 0),Ud([pe()],Bd.prototype,"onSelectLayout",void 0),Ud([pe()],Bd.prototype,"onUnitSelect",void 0),Ud([pe()],Bd.prototype,"onMoveInDateChange",void 0),Ud([pe()],Bd.prototype,"onLeaseTermChange",void 0),Ud([pe({type:Object})],Bd.prototype,"chargeInputs",void 0),Ud([pe()],Bd.prototype,"onChargeInputsChange",void 0),Ud([pe({type:Number})],Bd.prototype,"maxPets",void 0),Ud([pe({type:Array})],Bd.prototype,"selectedRentableItems",void 0),Ud([pe()],Bd.prototype,"onRentableItemAdd",void 0),Ud([pe()],Bd.prototype,"onRentableItemRemove",void 0),Bd=Ud([ce("fee-calculator-layout")],Bd);var jd,Fd,Hd,Gd;!function(e){e.OneTime="OneTime",e.Daily="Daily",e.Weekly="Weekly",e.BiWeekly="BiWeekly",e.Monthly="Monthly",e.Yearly="Yearly",e.Unknown="Unknown"}(jd||(jd={})),function(e){e.Debit="Debit",e.Credit="Credit"}(Fd||(Fd={})),function(e){e.Fixed="Fixed",e.UsageBased="UsageBased",e.Varies="Varies"}(Hd||(Hd={})),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"}(Gd||(Gd={}));const zd=p`
|
|
6452
6450
|
:host {
|
|
6453
6451
|
display: block;
|
|
6454
6452
|
--table-header-bg: white;
|
|
@@ -6516,14 +6514,14 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6516
6514
|
color: #888;
|
|
6517
6515
|
font-style: italic;
|
|
6518
6516
|
}
|
|
6519
|
-
`;var
|
|
6517
|
+
`;var Qd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Wd=class extends ue{constructor(){super(...arguments),this.tooltip="",this.disabled=!1}render(){return H`
|
|
6520
6518
|
<div
|
|
6521
6519
|
class="tooltip-container ${this.disabled?"":"show-tooltip"}"
|
|
6522
6520
|
data-tooltip="${this.tooltip}"
|
|
6523
6521
|
>
|
|
6524
6522
|
<slot></slot>
|
|
6525
6523
|
</div>
|
|
6526
|
-
`}};
|
|
6524
|
+
`}};Wd.styles=p`
|
|
6527
6525
|
:host {
|
|
6528
6526
|
display: block;
|
|
6529
6527
|
position: relative;
|
|
@@ -6557,7 +6555,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6557
6555
|
opacity: 1;
|
|
6558
6556
|
visibility: visible;
|
|
6559
6557
|
}
|
|
6560
|
-
`,
|
|
6558
|
+
`,Qd([pe({type:String})],Wd.prototype,"tooltip",void 0),Qd([pe({type:Boolean,reflect:!0})],Wd.prototype,"disabled",void 0),Wd=Qd([ce("simple-tooltip")],Wd);const Vd=p`
|
|
6561
6559
|
:host {
|
|
6562
6560
|
display: inline-flex;
|
|
6563
6561
|
}
|
|
@@ -6616,7 +6614,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6616
6614
|
font-style: italic;
|
|
6617
6615
|
cursor: not-allowed;
|
|
6618
6616
|
}
|
|
6619
|
-
`;var
|
|
6617
|
+
`;var qd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Yd=class extends ue{constructor(){super(...arguments),this.feeItem=null,this._previousFeeItemId=null,this.onQuantityChange=null,this.disabled=!1,this.quantity=0}get maxQuantity(){var e,t;return null!==(t=null===(e=this.feeItem)||void 0===e?void 0:e.max_estimate)&&void 0!==t?t:10}updated(e){var t,n;if(!e.has("feeItem"))return;const i=null!==(n=null===(t=this.feeItem)||void 0===t?void 0:t.id)&&void 0!==n?n:null;i!==this._previousFeeItemId&&(this.quantity=0,this._previousFeeItemId=i)}handleIncrement(){this.disabled||this.quantity>=this.maxQuantity||(this.quantity+=1,this.notifyQuantityChange())}handleDecrement(){this.disabled||this.quantity<=0||(this.quantity=Math.max(0,this.quantity-1),this.notifyQuantityChange())}notifyQuantityChange(){this.onQuantityChange&&this.feeItem&&this.onQuantityChange({id:this.feeItem.id,quantities:[{itemType:this.feeItem.fee_name,quantity:this.quantity}]})}render(){return this.feeItem?H`
|
|
6620
6618
|
<div class="quantity-control ${this.disabled?"unavailable":""}">
|
|
6621
6619
|
<button
|
|
6622
6620
|
class="quantity-button"
|
|
@@ -6638,7 +6636,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6638
6636
|
<span class="operator-sign">+</span>
|
|
6639
6637
|
</button>
|
|
6640
6638
|
</div>
|
|
6641
|
-
`:H``}};
|
|
6639
|
+
`:H``}};Yd.styles=Vd,qd([pe({type:Object})],Yd.prototype,"feeItem",void 0),qd([pe()],Yd.prototype,"onQuantityChange",void 0),qd([pe({type:Boolean,reflect:!0})],Yd.prototype,"disabled",void 0),qd([pe({type:Number})],Yd.prototype,"quantity",void 0),Yd=qd([ce("table-addon-qty-selector")],Yd);let Kd=class extends ue{constructor(){super(...arguments),this.rentableItem=null,this._previousRentableItemType=null,this.onQuantityChange=null,this.disabled=!1,this.quantity=0,this.selectedItemIds=new Set}get totalAvailableItems(){var e,t,n;return null!==(n=null===(t=null===(e=this.rentableItem)||void 0===e?void 0:e.allItems)||void 0===t?void 0:t.filter(e=>e.available).length)&&void 0!==n?n:0}get maxSelectableItems(){return Math.min(this.totalAvailableItems,10)}get atMaxUnits(){return this.quantity>=this.maxSelectableItems}get atMinUnits(){return this.quantity<=0}updated(e){var t,n;if(e.has("rentableItem")){const e=null!==(n=null===(t=this.rentableItem)||void 0===t?void 0:t.type)&&void 0!==n?n:null;e!==this._previousRentableItemType&&(this.selectedItemIds=new Set,this._previousRentableItemType=e)}}handleIncrement(){this.disabled||this.atMaxUnits||this.emitChange(this.quantity+1)}handleDecrement(){this.disabled||this.atMinUnits||this.emitChange(Math.max(0,this.quantity-1))}emitChange(e){var t;this.rentableItem&&(null===(t=this.onQuantityChange)||void 0===t||t.call(this,{type:this.rentableItem.type,quantity:e}))}render(){if(!this.rentableItem)return H``;const e=this.totalAvailableItems>0,t=this.disabled||!e||this.atMaxUnits,n=this.disabled||this.quantity<=0;return H`
|
|
6642
6640
|
<div
|
|
6643
6641
|
class="quantity-control ${!e||this.disabled?"unavailable":""}"
|
|
6644
6642
|
>
|
|
@@ -6662,7 +6660,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6662
6660
|
<span class="operator-sign">+</span>
|
|
6663
6661
|
</button>
|
|
6664
6662
|
</div>
|
|
6665
|
-
`}};
|
|
6663
|
+
`}};Kd.styles=Vd,qd([pe({type:Object})],Kd.prototype,"rentableItem",void 0),qd([pe()],Kd.prototype,"onQuantityChange",void 0),qd([pe({type:Boolean,reflect:!0})],Kd.prototype,"disabled",void 0),qd([pe({type:Number})],Kd.prototype,"quantity",void 0),qd([pe({type:Set})],Kd.prototype,"selectedItemIds",void 0),Kd=qd([ce("table-rentable-item-qty-selector")],Kd);var Xd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Zd=class extends ue{constructor(){super(...arguments),this._addons=[],this.disabled=!1,this.onAddonSelect=null,this.onRentableItemAdd=null,this.onRentableItemRemove=null,this.quantities=new Map,this.selectedRentableItemIds=new Map,this.handleAddonQuantityChange=e=>{var t;const n=e.id;1!==e.quantities.length||Array.isArray(this.quantities.get(n))?this.quantities.set(n,e.quantities):this.quantities.set(n,e.quantities[0].quantity),this.requestUpdate("quantities"),null===(t=this.onAddonSelect)||void 0===t||t.call(this,e)},this.handleRentableItemQuantityChange=e=>{var t,n,i,r,o,a;const s=null!==(t=this.quantities.get(e.type))&&void 0!==t?t:0;this.quantities.set(e.type,e.quantity),this.requestUpdate("quantities");const l=this.addons.find(t=>t instanceof Hu&&t.type===e.type);if(!l)return;const u=null!==(n=this.selectedRentableItemIds.get(e.type))&&void 0!==n?n:new Set,d=(c=null!==(r=null===(i=l.allItems)||void 0===i?void 0:i.filter(e=>e.available))&&void 0!==r?r:[],[...c].sort((e,t)=>e.rent!==t.rent?e.rent-t.rent:e.id.localeCompare(t.id)));var c;if(e.quantity>s){const t=e.quantity-s;let n=0;const i=Math.min(d.length,10);if(u.size+t>i)return;for(const i of d){if(n>=t)break;u.has(i.id)||(u.add(i.id),null===(o=this.onRentableItemAdd)||void 0===o||o.call(this,{id:i.id,type:e.type}),n++)}}else if(e.quantity<s){const t=s-e.quantity;let n=0;const i=function(e){return[...e].sort((e,t)=>e.rent!==t.rent?t.rent-e.rent:t.id.localeCompare(e.id))}(d.filter(e=>u.has(e.id)));for(const r of i){if(n>=t)break;u.delete(r.id),null===(a=this.onRentableItemRemove)||void 0===a||a.call(this,{id:r.id,type:e.type}),n++}}this.selectedRentableItemIds.set(e.type,u),this.requestUpdate("selectedRentableItemIds")}}set addons(e){const t=this._addons;this._addons=e,e!==t&&this.initializeQuantities(),this.requestUpdate("addons",t)}get addons(){return this._addons}preserveExistingQuantity(e,t){const n=this.quantities.get(e);return null!=n?n:t}initializeRentableItemQuantity(e,t){const n=this.preserveExistingQuantity(e.type,0);t.set(e.type,n),this.selectedRentableItemIds.has(e.type)||this.selectedRentableItemIds.set(e.type,new Set)}initializeBuildingFeeQuantity(e,t){const n=e.id,i=this.preserveExistingQuantity(n,0);t.set(n,i)}initializeQuantities(){const e=new Map;this.addons.forEach(t=>{t instanceof Hu?this.initializeRentableItemQuantity(t,e):this.initializeBuildingFeeQuantity(t,e)}),this.quantities=e}getName(e){return e instanceof Hu?e.displayName:e.fee_name}getSortedAddons(){return[...this.addons].sort((e,t)=>{const n=this.getName(e),i=this.getName(t);return n.localeCompare(i,navigator.language,{numeric:!0})})}isRentableItemAvailable(e){var t,n;return!(e instanceof Hu)||(null!==(n=null===(t=e.allItems)||void 0===t?void 0:t.filter(e=>e.available).length)&&void 0!==n?n:0)>0}renderQtySelector(e){var t;if(e instanceof Hu){const n=null!==(t=this.quantities.get(e.type))&&void 0!==t?t:0;return H`
|
|
6666
6664
|
<table-rentable-item-qty-selector
|
|
6667
6665
|
.rentableItem=${e}
|
|
6668
6666
|
.quantity=${n}
|
|
@@ -6703,7 +6701,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6703
6701
|
</tbody>
|
|
6704
6702
|
</table>
|
|
6705
6703
|
</div>
|
|
6706
|
-
`:H`<div class="empty-state">No add-ons available</div> `}};
|
|
6704
|
+
`:H`<div class="empty-state">No add-ons available</div> `}};Zd.styles=zd,Xd([pe({type:Array})],Zd.prototype,"addons",null),Xd([pe({type:Boolean})],Zd.prototype,"disabled",void 0),Xd([pe()],Zd.prototype,"onAddonSelect",void 0),Xd([pe({attribute:!1})],Zd.prototype,"onRentableItemAdd",void 0),Xd([pe({attribute:!1})],Zd.prototype,"onRentableItemRemove",void 0),Xd([fe()],Zd.prototype,"quantities",void 0),Xd([fe()],Zd.prototype,"selectedRentableItemIds",void 0),Zd=Xd([ce("addon-table")],Zd);var Jd=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ec=class extends ue{constructor(){super(...arguments),this.id="",this.showChatAdditionalActions=!1,this.buildingWebchatView=null,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this.enabledChatWidgets={callDesktop:!1,chatDesktop:!1,emailDesktop:!1,textDesktop:!1,sstDesktop:!1},this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onClose=()=>{}}render(){var e,t,n;const i=this.primaryColor||Zn,r=this.backgroundColor||"#ffffff",o=this.buildingWebchatView&&ii(this.buildingWebchatView.orgId,this.buildingWebchatView.id)&&i!==Zn?ni(i,.6):"black";return H`
|
|
6707
6705
|
<style>
|
|
6708
6706
|
#${this.id}::after {
|
|
6709
6707
|
border-right-color: ${o} !important;
|
|
@@ -6735,7 +6733,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6735
6733
|
.onClick=${this.onClose}
|
|
6736
6734
|
></minimize-expand-button>
|
|
6737
6735
|
</div>
|
|
6738
|
-
`}};
|
|
6736
|
+
`}};ec.styles=p`
|
|
6739
6737
|
.hideTab {
|
|
6740
6738
|
display: none;
|
|
6741
6739
|
}
|
|
@@ -6745,7 +6743,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6745
6743
|
justify-content: space-between;
|
|
6746
6744
|
gap: 32px;
|
|
6747
6745
|
}
|
|
6748
|
-
`,
|
|
6746
|
+
`,Jd([pe({type:String})],ec.prototype,"id",void 0),Jd([pe({type:Boolean})],ec.prototype,"showChatAdditionalActions",void 0),Jd([pe({type:Object})],ec.prototype,"buildingWebchatView",void 0),Jd([pe({type:String})],ec.prototype,"primaryColor",void 0),Jd([pe({type:String})],ec.prototype,"backgroundColor",void 0),Jd([pe({type:String})],ec.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Jd([pe({type:String})],ec.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Jd([pe({type:Object})],ec.prototype,"enabledChatWidgets",void 0),Jd([pe({attribute:!0})],ec.prototype,"onClickMinimize",void 0),Jd([pe({attribute:!0})],ec.prototype,"onClickEmailOption",void 0),Jd([pe({attribute:!0})],ec.prototype,"onClickPhoneOption",void 0),Jd([pe({attribute:!0})],ec.prototype,"onClickSSTOption",void 0),Jd([pe({attribute:!0})],ec.prototype,"onClose",void 0),ec=Jd([ce("chat-additional-actions")],ec);const tc=p`
|
|
6749
6747
|
:host {
|
|
6750
6748
|
display: block;
|
|
6751
6749
|
}
|
|
@@ -6782,9 +6780,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6782
6780
|
font-size: 0.9rem;
|
|
6783
6781
|
opacity: 0.9;
|
|
6784
6782
|
}
|
|
6785
|
-
`;var
|
|
6783
|
+
`;var nc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ic=class extends ue{getFormattedEndDate(e){return new Date(e.endDate).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}render(){return this.incentive?H`
|
|
6786
6784
|
<div class="incentive-banner">
|
|
6787
|
-
<div class="incentive-icon">${
|
|
6785
|
+
<div class="incentive-icon">${ad({size:32})}</div>
|
|
6788
6786
|
<div class="incentive-content">
|
|
6789
6787
|
<h2 class="incentive-title">
|
|
6790
6788
|
${this.incentive.originalIncentiveString}
|
|
@@ -6795,7 +6793,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6795
6793
|
</p>
|
|
6796
6794
|
</div>
|
|
6797
6795
|
</div>
|
|
6798
|
-
`:H``}};
|
|
6796
|
+
`:H``}};ic.styles=tc,nc([pe({type:Object})],ic.prototype,"incentive",void 0),ic=nc([ce("incentive-banner")],ic);var rc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let oc=class extends ue{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=Zn,this.backgroundColor=Jn,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isCalculatingQuote=!1,this.isLoadingLayouts=!0,this.isExporting=!1,this.selectedLayoutIds=[Xu],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=td(),this.leaseTerm=12,this.buildingWebchatView=null,this.incentives=[],this.quote=null,this.pdfUrl=null,this.quoteError=null,this.groupedFees={[Gu.ONE_TIME]:[],[Gu.MONTHLY]:[],[Gu.WEEKLY]:[],[Gu.BI_WEEKLY]:[],[Gu.ANNUALLY]:[],[Gu.DAILY]:[],[Gu.AS_NEEDED]:[],[Gu.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=ma(this.orgSlug,this.buildingSlug).then(e=>{e&&(this.buildingWebchatView=e)}).finally(()=>{this.isLoadingLayouts=!1}),t=Ku(this.buildingSlug).then(e=>{e&&(this.groupedFees=this.groupFees(e.fees),this.maxPets=function(e){const t=e.filter(e=>rd.includes(e.category)).map(e=>e.limit).filter(e=>"number"==typeof e);return t.length?Math.min(...t):null}(e.fees),this.rentableItems=e.rentableItems)});await Promise.allSettled([e,t])},this.requestQuoteCalculation=()=>{if(this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),!this.selectedUnit||!this.moveInDateString)return this.clearQuote(),void(this.isCalculatingQuote=!1);this.quoteDebounceTimer=window.setTimeout(()=>{this.startQuoteApiCall(),this.quoteDebounceTimer=null},1e3)},this.handleUnitSelect=e=>{const t=!this.selectedUnit;if(this.selectedUnit=e,t)return this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),this.isCalculatingQuote=!0,void this.startQuoteApiCall();this.requestQuoteCalculation()},this.handleMoveInDateChange=async e=>{this.moveInDateString=e,this.clearQuote(),await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleLeaseTermChange=async e=>{this.leaseTerm=e,this.clearQuote(),await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleChargeInputsChange=e=>{this.chargeInputs={...this.chargeInputs,...e},this.requestQuoteCalculation()},this.handleRentableItemAdd=e=>{this.desiredRentableItems.some(t=>t.id===e.id)||this.desiredRentableItems.push(e),this.requestQuoteCalculation()},this.handleRentableItemRemove=e=>{this.desiredRentableItems=this.desiredRentableItems.filter(t=>t.id!==e.id),this.requestQuoteCalculation()},this.groupFees=e=>e.reduce((e,t)=>{const n=t.frequency||Gu.ONE_TIME;return e[n]=[...e[n]||[],t],e},{}),this.handleClickEmailOption=e=>{this.handleClose(),this.onClickEmailOption&&this.onClickEmailOption(e)},this.handleClickPhoneOption=e=>{this.handleClose(),this.onClickPhoneOption&&this.onClickPhoneOption(e)},this.handleClickSSTOption=e=>{this.handleClose(),this.onClickSSTOption&&this.onClickSSTOption(e)},this.handleClickTextUsOption=e=>{this.handleClose(),this.onClickTextUsOption&&this.onClickTextUsOption(e)},this.handleClose=()=>{var e;null===(e=this.onCloseClicked)||void 0===e||e.call(this)},this.handleSelectLayout=async e=>{this.selectedLayoutIds=e,await this.fetchUnits()},this.handleShare=async()=>{var e,t;this.selectedUnit&&this.moveInDateString&&this.pdfUrl&&(Eo("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(Xu)||(e=this.selectedLayoutIds.map(e=>{return 0===(t=e)?0:Math.floor(t/10);var t}));try{if(this.units=await id({buildingSlug:this.buildingSlug,moveInDateString:this.moveInDateString,...e?{numBedrooms:e}:{},leaseTerm:this.leaseTerm}),this.selectedUnit){this.units.some(e=>{var t;return e.id===(null===(t=this.selectedUnit)||void 0===t?void 0:t.id)})||(this.selectedUnit=null,this.clearQuote())}}finally{this.isLoadingUnits=!1}}}clearQuote(){this.quote=null,this.pdfUrl=null,this.quoteError=null}async performQuoteCalculation(e){var t;if(!this.selectedUnit||!this.moveInDateString)return this.clearQuote(),void(this.isCalculatingQuote=!1);const n=this.moveInDateString,i=this.selectedUnit.id,r=this.leaseTerm;try{const o=await Ju({buildingSlug:this.buildingSlug,unitId:i,chargeInputs:this.chargeInputs,rentableItems:this.desiredRentableItems,leaseTerm:r,moveInDate:n},e);if(e.aborted)return;this.quote=o.quote,this.pdfUrl=o.pdfUrl||null,this.quoteError=null!==(t=o.error)&&void 0!==t?t:null,this.quote&&Eo("feeCalculatorQuoteGenerated",{buildingSlug:this.buildingSlug,unitId:i,leaseTerm:r})}catch(e){"AbortError"!==(null==e?void 0:e.name)&&(this.quote=null,this.pdfUrl=null,this.quoteError={type:"unknown"},this.isCalculatingQuote=!1,na({logType:ta.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:e},error:e}))}finally{e.aborted||(this.isCalculatingQuote=!1)}}get layouts(){var e,t;return null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.layoutOptions)&&void 0!==t?t:[]}updated(e){(e.has("primaryColor")||e.has("backgroundColor"))&&(this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor))}disconnectedCallback(){var e;super.disconnectedCallback(),this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=null}render(){var e,t;const n=this.isExporting||this.isCalculatingQuote||!this.selectedUnit||!this.moveInDateString||!this.pdfUrl;return H`
|
|
6799
6797
|
<div
|
|
6800
6798
|
class="fee-calculator-container"
|
|
6801
6799
|
@keydown=${e=>e.stopPropagation()}
|
|
@@ -6827,7 +6825,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6827
6825
|
class="close-button"
|
|
6828
6826
|
@click=${this.handleClose}
|
|
6829
6827
|
>
|
|
6830
|
-
${
|
|
6828
|
+
${Vl("gray")}
|
|
6831
6829
|
</button>
|
|
6832
6830
|
</div>
|
|
6833
6831
|
</div>
|
|
@@ -6877,7 +6875,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6877
6875
|
</div>
|
|
6878
6876
|
`:""}
|
|
6879
6877
|
</div>
|
|
6880
|
-
`}};
|
|
6878
|
+
`}};oc.styles=ju,rc([pe({attribute:!0})],oc.prototype,"buildingSlug",void 0),rc([pe({attribute:!0})],oc.prototype,"orgSlug",void 0),rc([pe({type:String})],oc.prototype,"primaryColor",void 0),rc([pe({type:String})],oc.prototype,"backgroundColor",void 0),rc([pe()],oc.prototype,"onCloseClicked",void 0),rc([pe()],oc.prototype,"onClickEmailOption",void 0),rc([pe()],oc.prototype,"onClickPhoneOption",void 0),rc([pe()],oc.prototype,"onClickSSTOption",void 0),rc([pe()],oc.prototype,"onClickTextUsOption",void 0),rc([fe()],oc.prototype,"isCalculatingQuote",void 0),rc([fe()],oc.prototype,"isLoadingLayouts",void 0),rc([fe()],oc.prototype,"isExporting",void 0),rc([fe()],oc.prototype,"selectedLayoutIds",void 0),rc([fe()],oc.prototype,"selectedUnit",void 0),rc([fe()],oc.prototype,"chargeInputs",void 0),rc([fe()],oc.prototype,"desiredRentableItems",void 0),rc([fe()],oc.prototype,"moveInDateString",void 0),rc([fe()],oc.prototype,"leaseTerm",void 0),rc([fe()],oc.prototype,"buildingWebchatView",void 0),rc([fe()],oc.prototype,"incentives",void 0),rc([fe()],oc.prototype,"quote",void 0),rc([fe()],oc.prototype,"pdfUrl",void 0),rc([fe()],oc.prototype,"quoteError",void 0),rc([fe()],oc.prototype,"groupedFees",void 0),rc([fe()],oc.prototype,"rentableItems",void 0),rc([fe()],oc.prototype,"maxPets",void 0),rc([fe()],oc.prototype,"units",void 0),rc([fe()],oc.prototype,"isLoadingUnits",void 0),oc=rc([ce("fee-calculator")],oc);const ac=p`
|
|
6881
6879
|
#minimize-mobile {
|
|
6882
6880
|
position: absolute;
|
|
6883
6881
|
top: -12px;
|
|
@@ -6926,9 +6924,9 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6926
6924
|
justify-content: center;
|
|
6927
6925
|
align-items: center;
|
|
6928
6926
|
}
|
|
6929
|
-
`,
|
|
6927
|
+
`,sc=(e="white")=>G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 16 14" fill="none">
|
|
6930
6928
|
<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}"/>
|
|
6931
|
-
</svg>`,
|
|
6929
|
+
</svg>`,lc=(e="black")=>G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="18" viewBox="0 0 16 18" fill="none">
|
|
6932
6930
|
<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}"/>
|
|
6933
6931
|
<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"/>
|
|
6934
6932
|
<path d="M4.90283 1V2.30742" stroke="${e}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -6936,14 +6934,14 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6936
6934
|
<path d="M0 6.11862H0.00653352C-3.5908e-06 6.15131 0 6.19053 0 6.22322V6.11862Z" fill="white"/>
|
|
6937
6935
|
<path d="M15.689 6.11862V6.22322C15.689 6.19053 15.689 6.15131 15.6825 6.11862H15.689Z" fill="white"/>
|
|
6938
6936
|
<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"/>
|
|
6939
|
-
</svg>`,
|
|
6937
|
+
</svg>`,uc=(e="white")=>G`
|
|
6940
6938
|
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
6941
6939
|
<path
|
|
6942
6940
|
fill-rule="evenodd"
|
|
6943
6941
|
clip-rule="evenodd"
|
|
6944
6942
|
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"
|
|
6945
6943
|
fill="${e}"/>
|
|
6946
|
-
</svg>`,
|
|
6944
|
+
</svg>`,dc=(e="white")=>G`<svg aria-hidden="true" focusable="false" width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6947
6945
|
<g clip-path="url(#clip0_18382_27345)">
|
|
6948
6946
|
<g clip-path="url(#clip1_18382_27345)">
|
|
6949
6947
|
<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"/>
|
|
@@ -6960,7 +6958,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6960
6958
|
</clipPath>
|
|
6961
6959
|
</defs>
|
|
6962
6960
|
</svg>
|
|
6963
|
-
`,
|
|
6961
|
+
`,cc=(e="white",t=20,n=-2)=>G`
|
|
6964
6962
|
<svg
|
|
6965
6963
|
aria-hidden="true"
|
|
6966
6964
|
focusable="false"
|
|
@@ -7035,7 +7033,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7035
7033
|
</clipPath>
|
|
7036
7034
|
</defs>
|
|
7037
7035
|
</svg>
|
|
7038
|
-
`;var
|
|
7036
|
+
`;var hc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let pc=class extends ue{constructor(){super(...arguments),this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onClickApplyNowOption=()=>{},this.onClickPriceCalculatorOption=()=>{},this.onChatTapped=()=>{},this.hideChat=!1,this.isMobileDesign=!1,this.primaryColor=Zn,this.backgroundColor=Jn,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasCallUsEnabled=!1,this.hasTextUsEnabled=!1,this.hasSSTEnabled=!1,this.hasApplyNowEnabled=!1,this.hasPricingCalculatorEnabled=!1,this.applicationLink="",this.overrideRentgrata=!1,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.renderListElement=(e,t,n,i)=>e?H` <li>
|
|
7039
7037
|
<button
|
|
7040
7038
|
@click=${t}
|
|
7041
7039
|
class="typeMobile-bttn"
|
|
@@ -7051,12 +7049,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7051
7049
|
</button>
|
|
7052
7050
|
</li>`:""}render(){return H`<div class="typeMobile-list">
|
|
7053
7051
|
<ul>
|
|
7054
|
-
${this.renderListElement(!(!this.hasApplyNowEnabled||!this.applicationLink),this.onClickApplyNowOption,
|
|
7055
|
-
${this.renderListElement(this.hasPricingCalculatorEnabled,this.onClickPriceCalculatorOption,
|
|
7056
|
-
${this.renderListElement(this.hasEmailEnabled,this.onClickEmailOption,
|
|
7057
|
-
${this.renderListElement(this.hasCallUsEnabled||this.hasTextUsEnabled,this.onClickPhoneOption,
|
|
7058
|
-
${this.renderListElement(this.hasSSTEnabled,this.onClickSSTOption,
|
|
7059
|
-
${this.renderListElement(this.hasChatEnabled&&!this.hideChat,this.onChatTapped,
|
|
7052
|
+
${this.renderListElement(!(!this.hasApplyNowEnabled||!this.applicationLink),this.onClickApplyNowOption,dc(this.foregroundColorOnSecondaryBackgroundColor),"Apply now")}
|
|
7053
|
+
${this.renderListElement(this.hasPricingCalculatorEnabled,this.onClickPriceCalculatorOption,cc(this.foregroundColorOnSecondaryBackgroundColor),"Price calculator")}
|
|
7054
|
+
${this.renderListElement(this.hasEmailEnabled,this.onClickEmailOption,sc(this.foregroundColorOnSecondaryBackgroundColor),"Email us")}
|
|
7055
|
+
${this.renderListElement(this.hasCallUsEnabled||this.hasTextUsEnabled,this.onClickPhoneOption,Nu(this.foregroundColorOnSecondaryBackgroundColor),"Call or text us")}
|
|
7056
|
+
${this.renderListElement(this.hasSSTEnabled,this.onClickSSTOption,lc(this.foregroundColorOnSecondaryBackgroundColor),"Book a tour")}
|
|
7057
|
+
${this.renderListElement(this.hasChatEnabled&&!this.hideChat,this.onChatTapped,uc(this.foregroundColorOnSecondaryBackgroundColor),"Chat with us")}
|
|
7060
7058
|
${this.isMobileDesign||this.hideChat?"":H`
|
|
7061
7059
|
<li>
|
|
7062
7060
|
<minimize-expand-button
|
|
@@ -7068,20 +7066,20 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7068
7066
|
</li>
|
|
7069
7067
|
`}
|
|
7070
7068
|
</ul>
|
|
7071
|
-
</div>`}};
|
|
7069
|
+
</div>`}};pc.styles=[ac],hc([pe({attribute:!0})],pc.prototype,"onClickMinimize",void 0),hc([pe({attribute:!0})],pc.prototype,"onClickEmailOption",void 0),hc([pe({attribute:!0})],pc.prototype,"onClickPhoneOption",void 0),hc([pe({attribute:!0})],pc.prototype,"onClickSSTOption",void 0),hc([pe({attribute:!0})],pc.prototype,"onClickApplyNowOption",void 0),hc([pe({attribute:!0})],pc.prototype,"onClickPriceCalculatorOption",void 0),hc([pe({attribute:!0})],pc.prototype,"onChatTapped",void 0),hc([pe({attribute:!0})],pc.prototype,"hideChat",void 0),hc([pe({attribute:!0})],pc.prototype,"isMobileDesign",void 0),hc([pe({attribute:!0})],pc.prototype,"primaryColor",void 0),hc([pe({attribute:!0})],pc.prototype,"backgroundColor",void 0),hc([pe({attribute:!0})],pc.prototype,"hasChatEnabled",void 0),hc([pe({attribute:!0})],pc.prototype,"hasEmailEnabled",void 0),hc([pe({attribute:!0})],pc.prototype,"hasCallUsEnabled",void 0),hc([pe({attribute:!0})],pc.prototype,"hasTextUsEnabled",void 0),hc([pe({attribute:!0})],pc.prototype,"hasSSTEnabled",void 0),hc([pe({attribute:!0})],pc.prototype,"hasApplyNowEnabled",void 0),hc([pe({attribute:!0})],pc.prototype,"hasPricingCalculatorEnabled",void 0),hc([pe({attribute:!0})],pc.prototype,"applicationLink",void 0),hc([pe({attribute:!0})],pc.prototype,"overrideRentgrata",void 0),hc([pe({attribute:!0})],pc.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),hc([pe({attribute:!0})],pc.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),pc=hc([ce("mobile-launcher")],pc);const fc=(e="white")=>G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
|
|
7072
7070
|
<path d="M1.31812 7L4.31812 4L1.31811 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7073
|
-
</svg>`;var
|
|
7071
|
+
</svg>`;var gc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let mc=class extends ue{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Zn,this.toExpand=!1}render(){return H`
|
|
7074
7072
|
<div class=${"button-container"} @click=${this.onClick}>
|
|
7075
7073
|
<div
|
|
7076
7074
|
class="inner-container"
|
|
7077
7075
|
style=${Xn({background:this.primaryColor})}
|
|
7078
7076
|
>
|
|
7079
|
-
${this.toExpand?
|
|
7077
|
+
${this.toExpand?fc("black"):((e="white")=>G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
|
|
7080
7078
|
<path d="M3.68188 7L0.681885 4L3.68188 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7081
7079
|
</svg>`)("black")}
|
|
7082
7080
|
</div>
|
|
7083
7081
|
</div>
|
|
7084
|
-
`}};
|
|
7082
|
+
`}};mc.styles=[p`
|
|
7085
7083
|
.button-container {
|
|
7086
7084
|
width: 36px;
|
|
7087
7085
|
height: 36px;
|
|
@@ -7105,11 +7103,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7105
7103
|
.button-container:hover {
|
|
7106
7104
|
filter: brightness(90%);
|
|
7107
7105
|
}
|
|
7108
|
-
`],
|
|
7106
|
+
`],gc([pe({attribute:!0})],mc.prototype,"onClick",void 0),gc([pe({attribute:!0})],mc.prototype,"primaryColor",void 0),gc([pe({attribute:!0})],mc.prototype,"toExpand",void 0),mc=gc([ce("collapse-expand-button")],mc);const bc=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.openWidget()},yc=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.close()},vc=()=>!!window.rentgrata;var wc=n(3950),Cc=n.n(wc);const xc=(e="black")=>G`<svg aria-hidden="true" focusable="false" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7109
7107
|
<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}"/>
|
|
7110
7108
|
<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}"/>
|
|
7111
7109
|
</svg>
|
|
7112
|
-
`;var
|
|
7110
|
+
`;var $c=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Sc=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.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=()=>{Eo("chatOpened",{buildingId:this.buildingId}),this.onChatTapped()},this.onClickMinimize=()=>{},this.onSstClose=Cc(),this.overrideRentgrata=!1,this.launcherStyles={},this.primaryColor=Zn,this.backgroundColor=Jn,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this._isMobile=Ir(),this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.isCalculatorWindowOpen=!1,this.isMobileFeaturesExpanded=!1,this.getNumCallToActions=()=>[this.hasEmailEnabledDesktop||this.hasEmailEnabledMobile,!!this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasCallUsEnabledMobile),this.hasSSTEnabledDesktop||this.hasSSTEnabledMobile,this.hasTextUsEnabledDesktop||this.hasTextUsEnabledMobile,this.hasApplyNowEnabledDesktop||this.hasApplyNowEnabledMobile,this.hasPricingCalculatorEnabledDesktop||this.hasPricingCalculatorEnabledMobile].filter(e=>e).length,this.emailUsWindowRef=Oe(),this.tourSchedulerRef=Oe(),this.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.tourSchedulerRef.value;e&&(e.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(),yc(),Eo("emailUsClicked",{buildingId:this.buildingId}),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.onClickPhoneOption=e=>{e.preventDefault(),e.stopPropagation(),yc(),Eo("callTextUsClicked",{buildingId:this.buildingId}),this.isCallUsWindowOpen=!0},this.onClickApplyNowOption=e=>{e.preventDefault(),e.stopPropagation(),yc(),Eo("applyNowClicked",{buildingId:this.buildingId,applicationLink:this.applicationLink}),window.open(this.applicationLink,"_blank")},this.onClickPriceCalculatorOption=e=>{e.preventDefault(),e.stopPropagation(),yc(),Eo("feeCalculatorOpened",{buildingId:this.buildingId}),this.isCalculatorWindowOpen=!0},this.onClosePhoneWindow=()=>{this.isCallUsWindowOpen=!1},this.onClickSSTOption=e=>{e.preventDefault(),e.stopPropagation(),yc(),Eo("bookTourClicked",{buildingId:this.buildingId}),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===ha.MINIMIZED?H` ${this.hasHideMobileFeatures&&this._isMobile?H`<collapse-expand-button
|
|
7113
7111
|
.toExpand=${this.isMobileFeaturesExpanded}
|
|
7114
7112
|
.primaryColor=${this.primaryColor}
|
|
7115
7113
|
.onClick=${this.toggleMobileFeatures}
|
|
@@ -7123,7 +7121,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7123
7121
|
.onClickApplyNowOption=${this.onClickApplyNowOption}
|
|
7124
7122
|
.onClickPriceCalculatorOption=${this.onClickPriceCalculatorOption}
|
|
7125
7123
|
.overrideRentgrata=${this.overrideRentgrata}
|
|
7126
|
-
.isMobileDesign=${this._isMobile||this.designConcept===
|
|
7124
|
+
.isMobileDesign=${this._isMobile||this.designConcept===ha.MINIMIZED}
|
|
7127
7125
|
.primaryColor=${this.primaryColor}
|
|
7128
7126
|
.backgroundColor=${this.backgroundColor}
|
|
7129
7127
|
.hasChatEnabled=${this._isMobile?this.hasChatEnabledMobile:this.hasChatEnabledDesktop}
|
|
@@ -7136,7 +7134,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7136
7134
|
.hasPricingCalculatorEnabled=${this._isMobile?!(this.hasHideMobileFeatures&&!this.isMobileFeaturesExpanded)&&this.hasPricingCalculatorEnabledMobile:this.hasPricingCalculatorEnabledDesktop}
|
|
7137
7135
|
.foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
|
|
7138
7136
|
.foregroundColorOnSecondaryBackgroundColor=${this.foregroundColorOnSecondaryBackgroundColor}
|
|
7139
|
-
></mobile-launcher>`:this.designConcept===
|
|
7137
|
+
></mobile-launcher>`:this.designConcept===ha.EMOJI?this.emojiPillList():this.verticalPillList(),this.emojiPillList=()=>{const e=[{pillKey:"Email",pill:this.hasEmailEnabledDesktop?H` <button
|
|
7140
7138
|
class="type-hey__pill"
|
|
7141
7139
|
@click=${this.onClickEmailOption}
|
|
7142
7140
|
style=${Xn({background:this.backgroundColor})}
|
|
@@ -7144,7 +7142,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7144
7142
|
>
|
|
7145
7143
|
<div class="type-hey__pill-left">
|
|
7146
7144
|
<div class="type-hey__icon">
|
|
7147
|
-
${
|
|
7145
|
+
${sc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7148
7146
|
</div>
|
|
7149
7147
|
<div
|
|
7150
7148
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -7153,7 +7151,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7153
7151
|
</div>
|
|
7154
7152
|
</div>
|
|
7155
7153
|
<div class="type-gradient__icon">
|
|
7156
|
-
${
|
|
7154
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7157
7155
|
</div>
|
|
7158
7156
|
</button>`:null},{pillKey:"SST",pill:this.hasSSTEnabledDesktop?H`
|
|
7159
7157
|
<button
|
|
@@ -7164,7 +7162,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7164
7162
|
>
|
|
7165
7163
|
<div class="type-hey__pill-left">
|
|
7166
7164
|
<div class="type-hey__icon">
|
|
7167
|
-
${
|
|
7165
|
+
${lc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7168
7166
|
</div>
|
|
7169
7167
|
<div
|
|
7170
7168
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -7173,7 +7171,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7173
7171
|
</div>
|
|
7174
7172
|
</div>
|
|
7175
7173
|
<div class="type-gradient__icon">
|
|
7176
|
-
${
|
|
7174
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7177
7175
|
</div>
|
|
7178
7176
|
</button>
|
|
7179
7177
|
`:null},{pillKey:"Phone",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?H`
|
|
@@ -7185,7 +7183,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7185
7183
|
>
|
|
7186
7184
|
<div class="type-hey__pill-left">
|
|
7187
7185
|
<div class="type-hey__icon">
|
|
7188
|
-
${
|
|
7186
|
+
${Nu(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7189
7187
|
</div>
|
|
7190
7188
|
<div
|
|
7191
7189
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -7197,7 +7195,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7197
7195
|
</div>
|
|
7198
7196
|
</div>
|
|
7199
7197
|
<div class="type-gradient__icon">
|
|
7200
|
-
${
|
|
7198
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7201
7199
|
</div>
|
|
7202
7200
|
</button>
|
|
7203
7201
|
`:null},{pillKey:"Apply",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?H`
|
|
@@ -7209,7 +7207,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7209
7207
|
>
|
|
7210
7208
|
<div class="type-hey__pill-left">
|
|
7211
7209
|
<div class="type-hey__icon">
|
|
7212
|
-
${
|
|
7210
|
+
${dc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7213
7211
|
</div>
|
|
7214
7212
|
<div
|
|
7215
7213
|
class="vertical-pill-title"
|
|
@@ -7220,7 +7218,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7220
7218
|
</div>
|
|
7221
7219
|
</div>
|
|
7222
7220
|
<div class="type-gradient__icon">
|
|
7223
|
-
${
|
|
7221
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7224
7222
|
</div>
|
|
7225
7223
|
</button>
|
|
7226
7224
|
`:null},{pillKey:"Price Calculator",pill:this.hasPricingCalculatorEnabledDesktop?H`
|
|
@@ -7232,7 +7230,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7232
7230
|
>
|
|
7233
7231
|
<div class="type-hey__pill-left">
|
|
7234
7232
|
<div class="type-hey__icon">
|
|
7235
|
-
${
|
|
7233
|
+
${cc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7236
7234
|
</div>
|
|
7237
7235
|
<div
|
|
7238
7236
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -7241,7 +7239,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7241
7239
|
</div>
|
|
7242
7240
|
</div>
|
|
7243
7241
|
<div class="type-gradient__icon">
|
|
7244
|
-
${
|
|
7242
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7245
7243
|
</div>
|
|
7246
7244
|
</button>
|
|
7247
7245
|
`:null}].filter(e=>!!e.pill);return H`
|
|
@@ -7283,7 +7281,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7283
7281
|
>
|
|
7284
7282
|
<div class="type-hey__pill-left">
|
|
7285
7283
|
<div class="type-hey__icon">
|
|
7286
|
-
${
|
|
7284
|
+
${uc(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
7287
7285
|
</div>
|
|
7288
7286
|
<div
|
|
7289
7287
|
style=${Xn({color:this.foregroundColorOnPrimaryBackgroundColor})}
|
|
@@ -7292,7 +7290,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7292
7290
|
</div>
|
|
7293
7291
|
</div>
|
|
7294
7292
|
<div class="type-gradient__icon">
|
|
7295
|
-
${
|
|
7293
|
+
${fc(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
7296
7294
|
</div>
|
|
7297
7295
|
</button>
|
|
7298
7296
|
`:""}
|
|
@@ -7304,15 +7302,15 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7304
7302
|
>
|
|
7305
7303
|
<div class="type-hey__botton-section-pills">
|
|
7306
7304
|
${e.map(e=>e.pill)}
|
|
7307
|
-
${this.overrideRentgrata&&
|
|
7305
|
+
${this.overrideRentgrata&&vc()?H` <button
|
|
7308
7306
|
class="type-hey__pill"
|
|
7309
|
-
@click=${()=>{
|
|
7307
|
+
@click=${()=>{bc()}}
|
|
7310
7308
|
style=${Xn({background:this.backgroundColor})}
|
|
7311
7309
|
aria-label="Contact a resident"
|
|
7312
7310
|
>
|
|
7313
7311
|
<div class="type-hey__pill-left">
|
|
7314
7312
|
<div class="type-hey__icon">
|
|
7315
|
-
${
|
|
7313
|
+
${xc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7316
7314
|
</div>
|
|
7317
7315
|
<div
|
|
7318
7316
|
style=${Xn({color:this.foregroundColorOnSecondaryBackgroundColor})}
|
|
@@ -7321,7 +7319,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7321
7319
|
</div>
|
|
7322
7320
|
</div>
|
|
7323
7321
|
<div class="type-gradient__icon">
|
|
7324
|
-
${
|
|
7322
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7325
7323
|
</div>
|
|
7326
7324
|
</button>`:""}
|
|
7327
7325
|
</div>
|
|
@@ -7343,7 +7341,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7343
7341
|
>
|
|
7344
7342
|
<div class="vertical-pill-left">
|
|
7345
7343
|
<div class="vertical-pill-icon">
|
|
7346
|
-
${
|
|
7344
|
+
${uc(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
|
|
7347
7345
|
</div>
|
|
7348
7346
|
<div
|
|
7349
7347
|
class="vertical-pill-title"
|
|
@@ -7353,7 +7351,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7353
7351
|
</div>
|
|
7354
7352
|
</div>
|
|
7355
7353
|
<div class="chevron-right">
|
|
7356
|
-
${
|
|
7354
|
+
${fc(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
|
|
7357
7355
|
</div>
|
|
7358
7356
|
</button>
|
|
7359
7357
|
`:null},{pillKey:"Price Calculator",pill:this.hasPricingCalculatorEnabledDesktop?H`
|
|
@@ -7365,7 +7363,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7365
7363
|
>
|
|
7366
7364
|
<div class="vertical-pill-left">
|
|
7367
7365
|
<div class="vertical-pill-icon">
|
|
7368
|
-
${
|
|
7366
|
+
${cc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7369
7367
|
</div>
|
|
7370
7368
|
<div
|
|
7371
7369
|
class="vertical-pill-title"
|
|
@@ -7375,7 +7373,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7375
7373
|
</div>
|
|
7376
7374
|
</div>
|
|
7377
7375
|
<div class="chevron-right">
|
|
7378
|
-
${
|
|
7376
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7379
7377
|
</div>
|
|
7380
7378
|
</button>
|
|
7381
7379
|
`:null},{pillKey:"SST",pill:this.hasSSTEnabledDesktop?H`
|
|
@@ -7388,7 +7386,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7388
7386
|
>
|
|
7389
7387
|
<div class="vertical-pill-left">
|
|
7390
7388
|
<div class="vertical-pill-icon">
|
|
7391
|
-
${
|
|
7389
|
+
${lc(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7392
7390
|
</div>
|
|
7393
7391
|
<div
|
|
7394
7392
|
class="vertical-pill-title"
|
|
@@ -7399,7 +7397,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7399
7397
|
</div>
|
|
7400
7398
|
</div>
|
|
7401
7399
|
<div class="chevron-right">
|
|
7402
|
-
${
|
|
7400
|
+
${fc(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7403
7401
|
</div>
|
|
7404
7402
|
</button>
|
|
7405
7403
|
`:null},{pillKey:"Email",pill:this.hasEmailEnabledDesktop?H`
|
|
@@ -7411,7 +7409,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7411
7409
|
>
|
|
7412
7410
|
<div class="vertical-pill-left">
|
|
7413
7411
|
<div class="vertical-pill-icon">
|
|
7414
|
-
${
|
|
7412
|
+
${sc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7415
7413
|
</div>
|
|
7416
7414
|
<div
|
|
7417
7415
|
class="vertical-pill-title"
|
|
@@ -7422,7 +7420,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7422
7420
|
</div>
|
|
7423
7421
|
</div>
|
|
7424
7422
|
<div class="chevron-right">
|
|
7425
|
-
${
|
|
7423
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7426
7424
|
</div>
|
|
7427
7425
|
</button>
|
|
7428
7426
|
`:null},{pillKey:"Phone",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?H`
|
|
@@ -7434,7 +7432,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7434
7432
|
>
|
|
7435
7433
|
<div class="vertical-pill-left">
|
|
7436
7434
|
<div class="vertical-pill-icon">
|
|
7437
|
-
${
|
|
7435
|
+
${Nu(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7438
7436
|
</div>
|
|
7439
7437
|
${this.hasCallUsEnabledDesktop&&this.hasTextUsEnabledDesktop?H`
|
|
7440
7438
|
<div
|
|
@@ -7463,7 +7461,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7463
7461
|
`:""}
|
|
7464
7462
|
</div>
|
|
7465
7463
|
<div class="chevron-right">
|
|
7466
|
-
${
|
|
7464
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7467
7465
|
</div>
|
|
7468
7466
|
</button>
|
|
7469
7467
|
`:null},{pillKey:"Apply",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?H`
|
|
@@ -7475,7 +7473,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7475
7473
|
>
|
|
7476
7474
|
<div class="vertical-pill-left">
|
|
7477
7475
|
<div class="vertical-pill-icon">
|
|
7478
|
-
${
|
|
7476
|
+
${dc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7479
7477
|
</div>
|
|
7480
7478
|
<div
|
|
7481
7479
|
class="vertical-pill-title"
|
|
@@ -7486,7 +7484,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7486
7484
|
</div>
|
|
7487
7485
|
</div>
|
|
7488
7486
|
<div class="chevron-right">
|
|
7489
|
-
${
|
|
7487
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7490
7488
|
</div>
|
|
7491
7489
|
</button>
|
|
7492
7490
|
`:null}].filter(e=>!!e.pill);if(e){const e=t.findIndex(e=>"SST"===e.pillKey);if(-1!==e){const[n]=t.splice(e,1);t.unshift(n)}}return H`
|
|
@@ -7494,16 +7492,16 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7494
7492
|
<nav aria-label="EliseAI options">
|
|
7495
7493
|
<ul class="vertical-pill-list__items" role="list">
|
|
7496
7494
|
${t.map(e=>H`<li>${e.pill}</li>`)}
|
|
7497
|
-
${this.overrideRentgrata&&
|
|
7495
|
+
${this.overrideRentgrata&&vc()?H`<li>
|
|
7498
7496
|
<button
|
|
7499
|
-
@click=${()=>{
|
|
7497
|
+
@click=${()=>{bc()}}
|
|
7500
7498
|
class="inner-pill-wrapper"
|
|
7501
7499
|
style=${Xn({background:this.backgroundColor})}
|
|
7502
7500
|
aria-label="Contact a resident"
|
|
7503
7501
|
>
|
|
7504
7502
|
<div class="vertical-pill-left">
|
|
7505
7503
|
<div class="vertical-pill-icon">
|
|
7506
|
-
${
|
|
7504
|
+
${xc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7507
7505
|
</div>
|
|
7508
7506
|
<div
|
|
7509
7507
|
class="vertical-pill-title"
|
|
@@ -7514,7 +7512,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7514
7512
|
</div>
|
|
7515
7513
|
</div>
|
|
7516
7514
|
<div class="chevron-right">
|
|
7517
|
-
${
|
|
7515
|
+
${fc(this.foregroundColorOnSecondaryBackgroundColor)}
|
|
7518
7516
|
</div>
|
|
7519
7517
|
</button>
|
|
7520
7518
|
</li>`:""}
|
|
@@ -7525,10 +7523,10 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7525
7523
|
class="minimize-button"
|
|
7526
7524
|
aria-label="Minimize EliseAI widget"
|
|
7527
7525
|
>
|
|
7528
|
-
<div class="chevron-down">${
|
|
7526
|
+
<div class="chevron-down">${fc("black")}</div>
|
|
7529
7527
|
</button>`:""}
|
|
7530
7528
|
</div>
|
|
7531
|
-
`}}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)}render(){window.customElements.get("email-us-window")||window.customElements.define("email-us-window",
|
|
7529
|
+
`}}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)}render(){window.customElements.get("email-us-window")||window.customElements.define("email-us-window",Pu),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",Uu),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`
|
|
7532
7530
|
<div
|
|
7533
7531
|
class=${go()({"launcher__mobile-launcher-wrapper":this._isMobile||this.isMinimized,"launcher__mini-launcher-wrapper":!this._isMobile&&!this.isMinimized,"launcher__mini-elevated":"livcor"===this.orgSlug.toLowerCase()&&(this._isMobile||this.isMinimized)})}
|
|
7534
7532
|
style=${Xn({...this.launcherStyles,...this.mobileStyles,top:this._isMobile||void 0===this.top||isNaN(this.top)?void 0!==this.mobileStyles.top?`${this.mobileStyles.top}px`:void 0:this.top-700+"px",bottom:this._isMobile||void 0===this.bottom||isNaN(this.bottom)?void 0!==this.mobileStyles.bottom?`${this.mobileStyles.bottom}px`:"72px":`${this.bottom}px`,left:this._isMobile||void 0===this.left||isNaN(this.left)?void 0!==this.mobileStyles.left?`${this.mobileStyles.left}px`:void 0:`${this.left}px`,right:this._isMobile||void 0===this.right||isNaN(this.right)?void 0!==this.mobileStyles.right?`${this.mobileStyles.right}px`:"18px":`${this.right}px`})}
|
|
@@ -7643,11 +7641,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7643
7641
|
`:""}
|
|
7644
7642
|
${this.isCallToActionWindowOpen()||this.showTourNextToChat?"":this.renderActionPills()}
|
|
7645
7643
|
</div>
|
|
7646
|
-
`}};
|
|
7647
|
-
${
|
|
7648
|
-
${
|
|
7649
|
-
${
|
|
7650
|
-
`,vc([pe({attribute:!0})],wc.prototype,"isMinimized",void 0),vc([pe()],wc.prototype,"mobileStyles",void 0),vc([pe({type:Boolean})],wc.prototype,"isFirstMount",void 0),vc([pe({attribute:!1})],wc.prototype,"openSSTWindowOnLoad",void 0),vc([pe({attribute:!1})],wc.prototype,"autoOpenChatWidget",void 0),vc([pe()],wc.prototype,"phoneNumber",void 0),vc([pe({attribute:!0})],wc.prototype,"buildingName",void 0),vc([pe({attribute:!0})],wc.prototype,"chatId",void 0),vc([pe({attribute:!0})],wc.prototype,"orgLegalName",void 0),vc([pe({attribute:!1})],wc.prototype,"country",void 0),vc([pe({attribute:!1})],wc.prototype,"buildingState",void 0),vc([pe({attribute:!0})],wc.prototype,"chatCallUsHeader",void 0),vc([pe({attribute:!1})],wc.prototype,"buildingId",void 0),vc([pe({type:Number})],wc.prototype,"orgId",void 0),vc([pe({attribute:!1})],wc.prototype,"leadSourceParams",void 0),vc([pe({attribute:!0})],wc.prototype,"buildingSlug",void 0),vc([pe({attribute:!0})],wc.prototype,"orgSlug",void 0),vc([pe({attribute:!0})],wc.prototype,"sgtUrl",void 0),vc([pe({attribute:!0})],wc.prototype,"selfGuidedTourEnabled",void 0),vc([pe({attribute:!0})],wc.prototype,"selfGuidedToursTypeOffered",void 0),vc([pe({attribute:!0})],wc.prototype,"designConcept",void 0),vc([pe({attribute:!0})],wc.prototype,"featureFlagShowDropdown",void 0),vc([pe({attribute:!1})],wc.prototype,"leadSources",void 0),vc([pe({attribute:!0})],wc.prototype,"currentLeadSource",void 0),vc([pe({attribute:!0})],wc.prototype,"escortedToursLink",void 0),vc([pe({attribute:!0})],wc.prototype,"escortedToursTypeOffered",void 0),vc([pe({attribute:!0})],wc.prototype,"virtualToursLink",void 0),vc([pe({attribute:!0})],wc.prototype,"virtualToursTypeOffered",void 0),vc([pe({type:Boolean})],wc.prototype,"hasChatEnabledDesktop",void 0),vc([pe({type:Boolean})],wc.prototype,"hasChatEnabledMobile",void 0),vc([pe({type:Boolean})],wc.prototype,"hasEmailEnabledDesktop",void 0),vc([pe({type:Boolean})],wc.prototype,"hasEmailEnabledMobile",void 0),vc([pe({attribute:!0})],wc.prototype,"hasApplyNowEnabledDesktop",void 0),vc([pe({attribute:!0})],wc.prototype,"hasApplyNowEnabledMobile",void 0),vc([pe({attribute:!0})],wc.prototype,"applicationLink",void 0),vc([pe({type:Boolean})],wc.prototype,"hasCallUsEnabledDesktop",void 0),vc([pe({type:Boolean})],wc.prototype,"hasCallUsEnabledMobile",void 0),vc([pe({type:Boolean})],wc.prototype,"hasTextUsEnabledDesktop",void 0),vc([pe({type:Boolean})],wc.prototype,"hasTextUsEnabledMobile",void 0),vc([pe({type:Boolean})],wc.prototype,"hasSSTEnabledDesktop",void 0),vc([pe({type:Boolean})],wc.prototype,"hasSSTEnabledMobile",void 0),vc([pe({attribute:!1})],wc.prototype,"tourTypeOptions",void 0),vc([pe({attribute:!1})],wc.prototype,"layoutOptions",void 0),vc([pe({attribute:!0})],wc.prototype,"bedroomPreferenceRequired",void 0),vc([pe({attribute:!1})],wc.prototype,"brokerIntakeEnabled",void 0),vc([pe({attribute:!0})],wc.prototype,"hasDynamicSchedulingEnabled",void 0),vc([pe({attribute:!0})],wc.prototype,"hasPricingCalculatorEnabledDesktop",void 0),vc([pe({attribute:!0})],wc.prototype,"hasPricingCalculatorEnabledMobile",void 0),vc([pe({attribute:!1})],wc.prototype,"hasHideMobileFeatures",void 0),vc([pe({type:Number})],wc.prototype,"right",void 0),vc([pe({type:Number})],wc.prototype,"bottom",void 0),vc([pe({type:Number})],wc.prototype,"top",void 0),vc([pe({type:Number})],wc.prototype,"left",void 0),vc([pe({attribute:!0})],wc.prototype,"showTourNextToChat",void 0),vc([pe({attribute:!1})],wc.prototype,"onChatTapped",void 0),vc([pe({attribute:!0})],wc.prototype,"onClickMinimize",void 0),vc([pe({attribute:!0})],wc.prototype,"onSstClose",void 0),vc([pe({attribute:!0})],wc.prototype,"overrideRentgrata",void 0),vc([pe({attribute:!1})],wc.prototype,"launcherStyles",void 0),vc([pe({attribute:!0})],wc.prototype,"primaryColor",void 0),vc([pe({attribute:!0})],wc.prototype,"backgroundColor",void 0),vc([pe({attribute:!0})],wc.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),vc([pe({attribute:!0})],wc.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),vc([pe({attribute:!0})],wc.prototype,"leadSourceClient",void 0),vc([fe()],wc.prototype,"leadSourceMultitouchClient",void 0),vc([fe()],wc.prototype,"_isMobile",void 0),vc([fe()],wc.prototype,"isEmailWindowOpen",void 0),vc([fe()],wc.prototype,"isCallUsWindowOpen",void 0),vc([fe()],wc.prototype,"isSSTWindowOpen",void 0),vc([fe()],wc.prototype,"isTextUsWindowOpen",void 0),vc([fe()],wc.prototype,"isCalculatorWindowOpen",void 0),vc([fe()],wc.prototype,"isMobileFeaturesExpanded",void 0),wc=vc([ce("meetelise-launcher")],wc);const Cc=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",wc)},xc=["app.meetelise.com","staging.eliseai.com","localhost"],$c={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"}},Sc=e=>{const t=window.location.hostname;if(!xc.includes(t))return e;const n=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&n in $c&&(e[n]="true"===i.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(n).length)return e;const i={...e};return Object.entries(n).forEach(([e,t])=>{const n=$c[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var Ac=n(5072),kc=n.n(Ac),Ec=n(7825),Tc=n.n(Ec),_c=n(7659),Oc=n.n(_c),Pc=n(5056),Ic=n.n(Pc),Nc=n(540),Mc=n.n(Nc),Dc=n(1113),Lc=n.n(Dc),Rc=n(5541),Uc={};Uc.styleTagTransform=Lc(),Uc.setAttributes=Ic(),Uc.insert=Oc().bind(null,"head"),Uc.domAPI=Tc(),Uc.insertStyleElement=Mc();kc()(Rc.A,Uc);Rc.A&&Rc.A.locals&&Rc.A.locals;async function Bc(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(n.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return n.data.filter(t=>e.includes(t))}return jc(n.data,t)}return[]}catch(e){return[]}}const jc=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!n.map(e=>e.toLowerCase()).includes(t)})};async function Fc(e){var t,n;if(!e)return!1;try{return null!==(n=null===(t=(await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/aip`)).data)||void 0===t?void 0:t.is_aip)&&void 0!==n&&n}catch(e){return!1}}const Hc=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"]),Gc=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return Hc.has(t)},zc=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\([2-9]\d{2}\)[\s.-]?|[2-9]\d{2}[\s.-])[2-9]\d{2}[\s.-]?\d{4}/g,d=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,c=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},b=document.body.getElementsByTagName("*");let y=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<b.length;e++)if(b[e].nodeType===Node.ELEMENT_NODE&&!m(b[e])){if(1===b[e].childNodes.length&&b[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=b[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(Gc(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,b[e].textContent=n),y=!0,w||(w=!0)}if(b[e].hasAttribute("href")){const t=b[e].getAttribute("href");if(!t)continue;let n="",i=d;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=c):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,Gc(t))continue;const u=t.replace(i,n);if(b[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&b[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&na({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:ta.info,buildingSlug:n,orgSlug:t}),C&&na({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:ta.info,buildingSlug:n,orgSlug:t}),y||na({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:ta.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return na({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:ta.error,buildingSlug:n,orgSlug:t,error:e}),0}},Qc=(e,t,n,i)=>{document.querySelectorAll("a").forEach(function(r){const o=r.getAttribute("href");o&&o.startsWith("https://app.meetelise.com/")&&((e,t,n)=>{const[i,r,o,...a]=new URL(e).pathname.split("/").filter(Boolean).map(e=>e.toLowerCase());return 0===a.length&&"tour"===o&&i===t.toLowerCase()&&r===n.toLowerCase()})(o,t,n)&&r.addEventListener("click",t=>{i()&&(t.preventDefault(),e(t))})})};var Wc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Vc=class extends ue{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return H`
|
|
7644
|
+
`}};Sc.styles=p`
|
|
7645
|
+
${$u}
|
|
7646
|
+
${Su}
|
|
7647
|
+
${Au}
|
|
7648
|
+
`,$c([pe({attribute:!0})],Sc.prototype,"isMinimized",void 0),$c([pe()],Sc.prototype,"mobileStyles",void 0),$c([pe({type:Boolean})],Sc.prototype,"isFirstMount",void 0),$c([pe({attribute:!1})],Sc.prototype,"openSSTWindowOnLoad",void 0),$c([pe({attribute:!1})],Sc.prototype,"autoOpenChatWidget",void 0),$c([pe()],Sc.prototype,"phoneNumber",void 0),$c([pe({attribute:!0})],Sc.prototype,"buildingName",void 0),$c([pe({attribute:!0})],Sc.prototype,"chatId",void 0),$c([pe({attribute:!0})],Sc.prototype,"orgLegalName",void 0),$c([pe({attribute:!1})],Sc.prototype,"country",void 0),$c([pe({attribute:!1})],Sc.prototype,"buildingState",void 0),$c([pe({attribute:!0})],Sc.prototype,"chatCallUsHeader",void 0),$c([pe({attribute:!1})],Sc.prototype,"buildingId",void 0),$c([pe({type:Number})],Sc.prototype,"orgId",void 0),$c([pe({attribute:!1})],Sc.prototype,"leadSourceParams",void 0),$c([pe({attribute:!0})],Sc.prototype,"buildingSlug",void 0),$c([pe({attribute:!0})],Sc.prototype,"orgSlug",void 0),$c([pe({attribute:!0})],Sc.prototype,"sgtUrl",void 0),$c([pe({attribute:!0})],Sc.prototype,"selfGuidedTourEnabled",void 0),$c([pe({attribute:!0})],Sc.prototype,"selfGuidedToursTypeOffered",void 0),$c([pe({attribute:!0})],Sc.prototype,"designConcept",void 0),$c([pe({attribute:!0})],Sc.prototype,"featureFlagShowDropdown",void 0),$c([pe({attribute:!1})],Sc.prototype,"leadSources",void 0),$c([pe({attribute:!0})],Sc.prototype,"currentLeadSource",void 0),$c([pe({attribute:!0})],Sc.prototype,"escortedToursLink",void 0),$c([pe({attribute:!0})],Sc.prototype,"escortedToursTypeOffered",void 0),$c([pe({attribute:!0})],Sc.prototype,"virtualToursLink",void 0),$c([pe({attribute:!0})],Sc.prototype,"virtualToursTypeOffered",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasChatEnabledDesktop",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasChatEnabledMobile",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasEmailEnabledDesktop",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasEmailEnabledMobile",void 0),$c([pe({attribute:!0})],Sc.prototype,"hasApplyNowEnabledDesktop",void 0),$c([pe({attribute:!0})],Sc.prototype,"hasApplyNowEnabledMobile",void 0),$c([pe({attribute:!0})],Sc.prototype,"applicationLink",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasCallUsEnabledDesktop",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasCallUsEnabledMobile",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasTextUsEnabledDesktop",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasTextUsEnabledMobile",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasSSTEnabledDesktop",void 0),$c([pe({type:Boolean})],Sc.prototype,"hasSSTEnabledMobile",void 0),$c([pe({attribute:!1})],Sc.prototype,"tourTypeOptions",void 0),$c([pe({attribute:!1})],Sc.prototype,"layoutOptions",void 0),$c([pe({attribute:!0})],Sc.prototype,"bedroomPreferenceRequired",void 0),$c([pe({attribute:!1})],Sc.prototype,"brokerIntakeEnabled",void 0),$c([pe({attribute:!0})],Sc.prototype,"hasDynamicSchedulingEnabled",void 0),$c([pe({attribute:!0})],Sc.prototype,"hasPricingCalculatorEnabledDesktop",void 0),$c([pe({attribute:!0})],Sc.prototype,"hasPricingCalculatorEnabledMobile",void 0),$c([pe({attribute:!1})],Sc.prototype,"hasHideMobileFeatures",void 0),$c([pe({type:Number})],Sc.prototype,"right",void 0),$c([pe({type:Number})],Sc.prototype,"bottom",void 0),$c([pe({type:Number})],Sc.prototype,"top",void 0),$c([pe({type:Number})],Sc.prototype,"left",void 0),$c([pe({attribute:!0})],Sc.prototype,"showTourNextToChat",void 0),$c([pe({attribute:!1})],Sc.prototype,"onChatTapped",void 0),$c([pe({attribute:!0})],Sc.prototype,"onClickMinimize",void 0),$c([pe({attribute:!0})],Sc.prototype,"onSstClose",void 0),$c([pe({attribute:!0})],Sc.prototype,"overrideRentgrata",void 0),$c([pe({attribute:!1})],Sc.prototype,"launcherStyles",void 0),$c([pe({attribute:!0})],Sc.prototype,"primaryColor",void 0),$c([pe({attribute:!0})],Sc.prototype,"backgroundColor",void 0),$c([pe({attribute:!0})],Sc.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),$c([pe({attribute:!0})],Sc.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),$c([pe({attribute:!0})],Sc.prototype,"leadSourceClient",void 0),$c([fe()],Sc.prototype,"leadSourceMultitouchClient",void 0),$c([fe()],Sc.prototype,"_isMobile",void 0),$c([fe()],Sc.prototype,"isEmailWindowOpen",void 0),$c([fe()],Sc.prototype,"isCallUsWindowOpen",void 0),$c([fe()],Sc.prototype,"isSSTWindowOpen",void 0),$c([fe()],Sc.prototype,"isTextUsWindowOpen",void 0),$c([fe()],Sc.prototype,"isCalculatorWindowOpen",void 0),$c([fe()],Sc.prototype,"isMobileFeaturesExpanded",void 0),Sc=$c([ce("meetelise-launcher")],Sc);const Ac=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Sc)},kc=["app.meetelise.com","staging.eliseai.com","localhost"],Ec={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"}},Tc=e=>{const t=window.location.hostname;if(!kc.includes(t))return e;const n=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&n in Ec&&(e[n]="true"===i.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(n).length)return e;const i={...e};return Object.entries(n).forEach(([e,t])=>{const n=Ec[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var _c=n(5072),Oc=n.n(_c),Pc=n(7825),Ic=n.n(Pc),Nc=n(7659),Mc=n.n(Nc),Dc=n(5056),Lc=n.n(Dc),Rc=n(540),Uc=n.n(Rc),Bc=n(1113),jc=n.n(Bc),Fc=n(5541),Hc={};Hc.styleTagTransform=jc(),Hc.setAttributes=Lc(),Hc.insert=Mc().bind(null,"head"),Hc.domAPI=Ic(),Hc.insertStyleElement=Uc();Oc()(Fc.A,Hc);Fc.A&&Fc.A.locals&&Fc.A.locals;async function Gc(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(n.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return n.data.filter(t=>e.includes(t))}return zc(n.data,t)}return[]}catch(e){return[]}}const zc=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!n.map(e=>e.toLowerCase()).includes(t)})};async function Qc(e){var t,n;if(!e)return!1;try{return null!==(n=null===(t=(await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/aip`)).data)||void 0===t?void 0:t.is_aip)&&void 0!==n&&n}catch(e){return!1}}const Wc=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"]),Vc=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return Wc.has(t)},qc=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\([2-9]\d{2}\)[\s.-]?|[2-9]\d{2}[\s.-])[2-9]\d{2}[\s.-]?\d{4}/g,d=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,c=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},b=document.body.getElementsByTagName("*");let y=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<b.length;e++)if(b[e].nodeType===Node.ELEMENT_NODE&&!m(b[e])){if(1===b[e].childNodes.length&&b[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=b[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(Vc(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,b[e].textContent=n),y=!0,w||(w=!0)}if(b[e].hasAttribute("href")){const t=b[e].getAttribute("href");if(!t)continue;let n="",i=d;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=c):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,Vc(t))continue;const u=t.replace(i,n);if(b[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&b[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&na({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:ta.info,buildingSlug:n,orgSlug:t}),C&&na({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:ta.info,buildingSlug:n,orgSlug:t}),y||na({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:ta.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return na({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:ta.error,buildingSlug:n,orgSlug:t,error:e}),0}},Yc=(e,t,n,i)=>{document.querySelectorAll("a").forEach(function(r){const o=r.getAttribute("href");o&&o.startsWith("https://app.meetelise.com/")&&((e,t,n)=>{const[i,r,o,...a]=new URL(e).pathname.split("/").filter(Boolean).map(e=>e.toLowerCase());return 0===a.length&&"tour"===o&&i===t.toLowerCase()&&r===n.toLowerCase()})(o,t,n)&&r.addEventListener("click",t=>{i()&&(t.preventDefault(),e(t))})})};var Kc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Xc=class extends ue{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Zn,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return H`
|
|
7651
7649
|
<button
|
|
7652
7650
|
class=${this.toExpand?"button-container mini":"button-container"}
|
|
7653
7651
|
@click=${this.onClick}
|
|
@@ -7658,13 +7656,13 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7658
7656
|
style=${Xn({background:this.primaryColor})}
|
|
7659
7657
|
>
|
|
7660
7658
|
${this.toExpand?H`<div class="chevron-up">
|
|
7661
|
-
${
|
|
7659
|
+
${fc(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
7662
7660
|
</div>`:H` <div class="x-icon">
|
|
7663
|
-
${
|
|
7661
|
+
${Vl(this.foregroundColorOnPrimaryBackgroundColor)}
|
|
7664
7662
|
</div>`}
|
|
7665
7663
|
</div>
|
|
7666
7664
|
</button>
|
|
7667
|
-
`}};
|
|
7665
|
+
`}};Xc.styles=[p`
|
|
7668
7666
|
.button-container {
|
|
7669
7667
|
width: 56px;
|
|
7670
7668
|
height: 56px;
|
|
@@ -7714,7 +7712,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7714
7712
|
cursor: pointer;
|
|
7715
7713
|
filter: brightness(90%);
|
|
7716
7714
|
}
|
|
7717
|
-
`],Wc([pe({attribute:!0})],Vc.prototype,"onClick",void 0),Wc([pe({attribute:!0})],Vc.prototype,"primaryColor",void 0),Wc([pe({attribute:!0})],Vc.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Wc([pe({attribute:!0})],Vc.prototype,"toExpand",void 0),Vc=Wc([ce("minimize-expand-button")],Vc);const qc="cdn.skypack.dev/@meetelise/chat",Yc="cdn.eliseai.com/@meetelise/chat",Kc=async(e,t)=>{try{if(Math.random()>=.15)return;const n=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",n=t.textContent||"";if(e.includes(qc)||n.includes(qc))return"skypack";if(e.includes(Yc)||n.includes(Yc))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:n},{params:{cdn_version:n},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},Xc=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,Zc={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},Jc="https://applications.eliseai.com",eh=["Check Availability","Apply Now"],th=(e,t,n,i)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const n=e.getElementsByTagName("span");if(1!==n.length)return!1;const i=null===(t=n[0].textContent)||void 0===t?void 0:t.trim();return null!=i&&eh.includes(i)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),na({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:ta.info,buildingSlug:i,orgSlug:n}),!0},nh=(e,t,n,i)=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.nodeType!==Node.ELEMENT_NODE)continue;const a=o;"A"===a.tagName&&th(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)th(s[e],t,n,i)}},ih=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)th(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)nh(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class rh{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Fr(Gr(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=xo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(ea()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),n=this._generateLeadSourceLocalStorageKey();if(!t||this.isExpiredTimestamp(t.timestampExpires)){const t={timestampExpires:this._generateNewExpirationTimestamp(),leadSources:[{parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"touchpoint"}]};localStorage.setItem(n,JSON.stringify(t))}else{if(t.leadSources.find(t=>t.leadSourceValue===e))return;if(t.leadSources.length<this.maxSourcesNonPropertyWebsiteCount)return t.leadSources.push({parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));na({logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),n=aa(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Fr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Yr(e.timestampInitiallyLogged).getTime()-Yr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Fr(new Date),r=[{timestampInitiallyLogged:i,leadSourceValue:n,type:"default"},...t.leadSources.map(e=>({timestampInitiallyLogged:e.timestampInitiallyLogged,leadSourceValue:e.leadSourceValue,type:e.type}))];return e&&r.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),r},this.getLocalStorageMultitouchValue=()=>{const e=this._generateLeadSourceLocalStorageKey(),t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t)},this.isExpiredTimestamp=e=>Yr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var oh=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ah=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.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.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=xh.Default,this.onWidgetLoaded=bc(),this.onSstClose=bc(),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 n=this.centralConvo?await async function(e){const t=`https://app.meetelise.com/api/pub/v1/organization/${e}/webchat/v2`,n=await r().get(t);return fa(n.data)}(this.orgSlug):await pa(this.orgSlug,this.buildingSlug);if(!this.isOrgMode()){if(Math.random()<.2)try{(async(e,t)=>{const n=window.rentgrata;if(!n)return;const i=n.Widget;if(!i)return;const o=i.config;if(!o)return;const a=o.widgetKey;a&&await r().post(`https://app.meetelise.com/platformApi/webchat/rentgrata?token=${a}`,{},{headers:{"Content-Type":"application/json","building-slug":null!=e?e:"","org-slug":null!=t?t:""}})})(this.buildingSlug,this.orgSlug)}catch(e){}try{Kc(this.orgSlug,this.buildingSlug)}catch(e){}}if(!await yu(n,this.buildingSlug,this.orgSlug))return;ia({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==n?void 0:n.launchedDateTime)?.01:.05}),this.buildingWebchatView=n;const i=(()=>{try{const e="true"===sessionStorage.getItem(gs);return sessionStorage.removeItem(gs),e}catch{return!1}})();await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),(e=>{const t=new URLSearchParams(window.location.search),n=t.get("rwg_token"),i=t.get("elise_google_env");if(!n||!i||!e)return;const r={rwgToken:n,environment:i,buildingId:e,expiresAt:Date.now()+2592e6};localStorage.setItem(Ka,JSON.stringify(r))})(null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.id)&&void 0!==t?t:0),i?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0):"tour"===new URLSearchParams(window.location.search).get("elise_open")&&(this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile)?this.openTourSchedulerOnLoad=!0:this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.rememberChatAutoOpenDismissed()):"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0),this.isLoading=!1},this.setBuildingDerivedInfo=async()=>{var e,t,n,i,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S,A,k,E,T,_,O,P,I,N,M,D,L,R,U,B,j,F,H,G,z,Q,W,V,q,Y,K,X;const Z=this.buildingWebchatView;if(!Z)return;Z&&this.orgSlug&&!this.orgLevel&&lh(this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.chatId)&&void 0!==t?t:null,this.sampleRateToUse,this.buildingSlug,null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null);const J=Z.featureFlagWebchatMarketingSourceDropdownConfiguration,ee=Z.featureFlagWebchatUseDniPhoneNumberBySource,te=Z.featureFlagInsertDniIntoWebsite,ne=Z.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var ie;ie=So.includes(Z.orgId),ko=ie;const[re,oe,ae,se,le]=await Promise.all([this.isOrgMode()?Promise.resolve([]):Bc(this.orgSlug,this.buildingSlug),yo(this.buildingSlug),Fc(this.buildingSlug),wo(this.buildingSlug),Co(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Vn(Z.phoneNumber),this.buildingWebchatView.isAip=ae),this.leadSources=re,this.featureFlagShowDropdown=J,this.bedroomPreferenceRequired=se,this.brokerIntakeEnabled=le;const ue=this.orgLevel?null:Z.textWithUsPhoneNumber?Z.textWithUsPhoneNumber:await(async e=>{try{const t="https://app.meetelise.com",n=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(n.data)return n.data}catch(t){return na({logType:ta.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t},error:t}),null}return null})(this.buildingSlug),de=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,ce=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,he={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)&&!!ue)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!ue)&&void 0!==S&&S,sstDesktop:null!==(k=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowSstDesktop)&&void 0!==k&&k,sstMobile:null!==(T=null===(E=this.buildingWebchatView)||void 0===E?void 0:E.shouldShowSstMobile)&&void 0!==T&&T,calcDesktop:de,calcMobile:ce};var pe,fe;this.enabledChatWidgets=this.withOrgLevelContactOptions(Sc(he),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?(Qc(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ne&&(fe=this.handleTourClicked,document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(e=>{e&&e.addEventListener("click",e=>{e.preventDefault(),fe(e)})})),"radco"===this.orgSlug&&(e=>{document.querySelectorAll('a[href^="#leaseleads-tour-open"]').forEach(t=>{var n;if(!t)return;const i=document.createElement("a");i.textContent=t.textContent,i.style.cursor="pointer",i.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(n=t.parentNode)||void 0===n||n.replaceChild(i,t)})})(this.handleTourClicked)):(null===(P=this.LeadSourceClient)||void 0===P?void 0:P.leadSource)&&(pe=null!==(N=null===(I=this.LeadSourceClient)||void 0===I?void 0:I.leadSource)&&void 0!==N?N:null,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(pe)}`)}}))),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!==(U=this.buildingWebchatView.autoOpenChat)&&void 0!==U&&U,this.requiresConsent=null!==(B=this.buildingWebchatView.requiresConsentForChat)&&void 0!==B&&B,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===ua.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===ua.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===ua.EMOJI&&(this.designConcept=ua.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Zn),null===this.backgroundColor&&(this.backgroundColor=Jn);const ge=null!==(G=null===(H=this.buildingWebchatView)||void 0===H?void 0:H.phoneNumber)&&void 0!==G?G:"";let me=null;if(ee&&!this.orgLevel&&(me=await async function(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return n.data?{number:Vn(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(Q=null===(z=this.LeadSourceClient)||void 0===z?void 0:z.leadSource)&&void 0!==Q?Q:null),me&&!me.isMatch&&(me.number=ge)),te&&(null==me?void 0:me.number)){const e=zc(me.number,this.orgSlug,this.buildingSlug);e>0&&ia({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const be=localStorage.getItem("eliseai_phone_number_devtest");be&&zc(be,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=me||{number:ge,isMatch:!1,isPropertyWebsiteCatchall:!0};const ye=null!==(V=null===(W=this.LeadSourceClient)||void 0===W?void 0:W.leadSource)&&void 0!==V?V:null;ye&&(this.leadSources.includes(ye)||this.leadSources.push(ye)),this.isOrgMode()||ao(Z.id);if((oe||(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isAip))&&(null===(Y=this.buildingWebchatView)||void 0===Y?void 0:Y.isLiveOnApplications)&&this.buildingSlug&&!this.orgLevel){const e=((e,t,n)=>{var i;const r=[/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/content\/apply/,/\/apply-now/,/\/apply/,/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,/busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/],o=document.body.getElementsByTagName("a");let a=0;for(let s=0;s<o.length;s++){const l=o[s];if(l.nodeType===Node.ELEMENT_NODE&&r.some(e=>e.test(l.href))){const r=l.getAttribute("href"),o=(null===(i=l.textContent)||void 0===i?void 0:i.toLowerCase())||"",s=Xc(o,e);l.setAttribute("href",s),a++,na({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:ta.info,buildingSlug:n,orgSlug:t})}}return 0===a&&na({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:ta.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&ia({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=Zc[e];if(!t)return 0;const n=`${Jc}/building/${t}/units`,i=`${Jc}/building/${e}/units`,r=new RegExp(`https://applications\\.eliseai\\.com/building/${t}/units`,"g");let o=0;const a=document.body.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a[e],s=t.getAttribute("href");if(!s||!s.includes(n))continue;const l=s.replace(r,i);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(n))return;const a=t.replace(r,i);a!==t&&(e.setAttribute("onclick",a),o++)})})(this.buildingSlug)}catch{}this.buildingSlug&&!this.orgLevel&&(null===(K=this.buildingWebchatView)||void 0===K?void 0:K.isLiveOnApplications)&&(null===(X=this.buildingWebchatView)||void 0===X?void 0:X.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&ih(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,n,i,r,o,a,s,l,u;if(!this.buildingWebchatView)return;const d=this.chatStorageSlug(),c=hs(d),h=ps(d,c),p=h?c:cs(d,!1);if(!p.leadId)throw new Error("Lead ID is null");if(this.LeadSourceClient=new sa,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new rh(this.orgSlug,this.buildingSlug),this.myPubnub=new Ss(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,p.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType),this.myPubnub.chatStorageSlug=d,this.centralConvo){const e=this.myPubnub;e.centralConvo=!0,void 0!==this.hostDeclaredBuildingId?e.declaredBuildingId=this.hostDeclaredBuildingId:this.fetchDeclaredBuildingId().then(t=>{void 0===this.hostDeclaredBuildingId&&(e.declaredBuildingId=t)})}else this.myPubnub.declaredBuildingId=this.buildingWebchatView.id;const f=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,h&&null!==(n=p.leadId)&&void 0!==n?n:void 0);f&&(cs(d,p.initiatedChat,f.lead_id),this.isOrgMode()&&f.building_slug&&await this.adoptBuilding(f.building_slug)),this.LeadSourceClient.chatId=this.myPubnub.channel;const g=await(null===(i=this.LeadSourceClient)||void 0===i?void 0:i.generateUserLeadSource({leadId:null!==(o=null===(r=this.myPubnub)||void 0===r?void 0:r.leadUserId)&&void 0!==o?o:"",orgSlug:this.orgSlug,buildingSlug:this.buildingSlug}));g&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(g),"property-website"!==aa(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:aa(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=hs(d);m.initiatedChat&&await this.myPubnub.initializePubnub(m)},this.isOrgMode=()=>this.centralConvo&&!this.buildingSlug,this.chatStorageSlug=()=>this.orgLevel?"":this.buildingSlug,this.adoptBuilding=async e=>{var t;try{const n=await pa(this.orgSlug,e);if(!(null==n?void 0:n.id))return;this.buildingSlug=e,this.buildingWebchatView=n,null===(t=this.myPubnub)||void 0===t||t.adoptBuilding(e,n)}catch(e){}},this.withOrgLevelContactOptions=(e,t)=>this.orgLevel?{...e,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,callDesktop:e.callDesktop&&!!t,callMobile:e.callMobile&&!!t}:e,this.fetchDeclaredBuildingId=async()=>{if(!this.declaredBuildingSlug||!this.orgSlug)return null;try{const e=await pa(this.orgSlug,this.declaredBuildingSlug);return"number"==typeof(null==e?void 0:e.id)&&e.id>0?e.id:null}catch{return null}},this.chatAutoOpenDismissedStorageKey=()=>{const{orgSlug:e,buildingSlug:t}=this;return e&&t?`com.elise.webchat.autoOpenDismissed=${e}=${t}`:t?`com.elise.webchat.autoOpenDismissed=${t}`:e?`com.elise.webchat.autoOpenDismissed=${e}`:null},this.shouldAutoOpenChat=e=>{if(!e||Ir())return!1;const t=this.chatAutoOpenDismissedStorageKey();return!t||"true"!==localStorage.getItem(t)},this.rememberChatAutoOpenDismissed=()=>{const e=this.chatAutoOpenDismissedStorageKey();e&&localStorage.setItem(e,"true")},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.focusChatOnMount=!0,this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,localStorage.setItem("isChatOpen","true")},e.onExitChat=this.onExitChat)},this.onExitChat=()=>{this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,localStorage.setItem("isChatOpen","false"),this.rememberChatAutoOpenDismissed()},this.focusLauncherButton=()=>{var e,t;const n=(null===(e=this.launcherButton)||void 0===e?void 0:e.isConnected)?this.launcherButton:null;null===(t=null!=n?n:this.currentLauncherButton())||void 0===t||t.focus()},this.focusMessageFieldOnOpen=()=>{var e,t;const n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("pubnub-chat"),i=null==n?void 0:n.shadowRoot;n&&i&&(n.focusMessageField()||null===(t=i.getElementById("pubnub-chat-container"))||void 0===t||t.focus(),setTimeout(()=>{n.focusMessageField()},0))},this.closeChatAndRestoreFocus=()=>{this.onExitChat(),this.updateComplete.then(()=>{this.focusLauncherButton(),requestAnimationFrame(()=>this.focusLauncherButton())})}}setDeclaredBuildingId(e){this.hostDeclaredBuildingId=e,this.myPubnub&&(this.myPubnub.declaredBuildingId=e)}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new Jo(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),ds(this.chatStorageSlug()),this.orgLevel&&(this.buildingSlug=""),this.myPubnub=null,this.displayPubnubChat=!1,await this.setupWebchat(),this.hideLauncher=!1}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustPositionChatAdditionalActions),this._cleanupMobileListener=Nr(e=>{this._isMobile=e})}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}currentLauncherButton(){var e,t,n,i;const r=null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("meetelise-launcher"))||void 0===t?void 0:t.shadowRoot,o=null==r?void 0:r.querySelector("#type-hey__ask-prompt, button[aria-label='Chat with us']"),a=null===(i=null===(n=null==r?void 0:r.querySelector("mobile-launcher"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.querySelector("button[aria-label='Chat with us']");return o instanceof HTMLElement?o:a instanceof HTMLElement?a:null}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S,A,k,E,T,_,O,P,I,N,M,D,L,R,U,B,j,F,G,z,Q,W,V;Cc();const q=this.hideLauncher&&!this.isLoading&&!this._isMobile;return H`
|
|
7715
|
+
`],Kc([pe({attribute:!0})],Xc.prototype,"onClick",void 0),Kc([pe({attribute:!0})],Xc.prototype,"primaryColor",void 0),Kc([pe({attribute:!0})],Xc.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Kc([pe({attribute:!0})],Xc.prototype,"toExpand",void 0),Xc=Kc([ce("minimize-expand-button")],Xc);const Zc="cdn.skypack.dev/@meetelise/chat",Jc="cdn.eliseai.com/@meetelise/chat",eh=async(e,t)=>{try{if(Math.random()>=.15)return;const n=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",n=t.textContent||"";if(e.includes(Zc)||n.includes(Zc))return"skypack";if(e.includes(Jc)||n.includes(Jc))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:n},{params:{cdn_version:n},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},th=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,nh={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},ih="https://applications.eliseai.com",rh=["Check Availability","Apply Now"],oh=(e,t,n,i)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const n=e.getElementsByTagName("span");if(1!==n.length)return!1;const i=null===(t=n[0].textContent)||void 0===t?void 0:t.trim();return null!=i&&rh.includes(i)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),na({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:ta.info,buildingSlug:i,orgSlug:n}),!0},ah=(e,t,n,i)=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.nodeType!==Node.ELEMENT_NODE)continue;const a=o;"A"===a.tagName&&oh(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)oh(s[e],t,n,i)}},sh=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)oh(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)ah(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class lh{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Fr(Gr(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=xo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(ea()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),n=this._generateLeadSourceLocalStorageKey();if(!t||this.isExpiredTimestamp(t.timestampExpires)){const t={timestampExpires:this._generateNewExpirationTimestamp(),leadSources:[{parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"touchpoint"}]};localStorage.setItem(n,JSON.stringify(t))}else{if(t.leadSources.find(t=>t.leadSourceValue===e))return;if(t.leadSources.length<this.maxSourcesNonPropertyWebsiteCount)return t.leadSources.push({parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));na({logType:ta.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),n=aa(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Fr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Yr(e.timestampInitiallyLogged).getTime()-Yr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Fr(new Date),r=[{timestampInitiallyLogged:i,leadSourceValue:n,type:"default"},...t.leadSources.map(e=>({timestampInitiallyLogged:e.timestampInitiallyLogged,leadSourceValue:e.leadSourceValue,type:e.type}))];return e&&r.push({leadSourceValue:e,timestampInitiallyLogged:Fr(new Date),type:"user-selected"}),r},this.getLocalStorageMultitouchValue=()=>{const e=this._generateLeadSourceLocalStorageKey(),t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t)},this.isExpiredTimestamp=e=>Yr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var uh=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let dh=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.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.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=kh.Default,this.onWidgetLoaded=Cc(),this.onSstClose=Cc(),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 n=this.centralConvo?await async function(e){const t=`https://app.meetelise.com/api/pub/v1/organization/${e}/webchat/v2`,n=await r().get(t);return ba(n.data)}(this.orgSlug):await ma(this.orgSlug,this.buildingSlug);if(!this.isOrgMode()){if(Math.random()<.2)try{(async(e,t)=>{const n=window.rentgrata;if(!n)return;const i=n.Widget;if(!i)return;const o=i.config;if(!o)return;const a=o.widgetKey;a&&await r().post(`https://app.meetelise.com/platformApi/webchat/rentgrata?token=${a}`,{},{headers:{"Content-Type":"application/json","building-slug":null!=e?e:"","org-slug":null!=t?t:""}})})(this.buildingSlug,this.orgSlug)}catch(e){}try{eh(this.orgSlug,this.buildingSlug)}catch(e){}}if(!await xu(n,this.buildingSlug,this.orgSlug))return;ia({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==n?void 0:n.launchedDateTime)?.01:.05}),this.buildingWebchatView=n;const i=(()=>{try{const e="true"===sessionStorage.getItem(ys);return sessionStorage.removeItem(ys),e}catch{return!1}})();await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),(e=>{const t=new URLSearchParams(window.location.search),n=t.get("rwg_token"),i=t.get("elise_google_env");if(!n||!i||!e)return;const r={rwgToken:n,environment:i,buildingId:e,expiresAt:Date.now()+2592e6};localStorage.setItem(Ja,JSON.stringify(r))})(null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.id)&&void 0!==t?t:0),i?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0):"tour"===new URLSearchParams(window.location.search).get("elise_open")&&(this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile)?this.openTourSchedulerOnLoad=!0:this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.rememberChatAutoOpenDismissed()):"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0),this.isLoading=!1},this.setBuildingDerivedInfo=async()=>{var e,t,n,i,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S,A,k,E,T,_,O,P,I,N,M,D,L,R,U,B,j,F,H,G,z,Q,W,V,q,Y,K,X;const Z=this.buildingWebchatView;if(!Z)return;Z&&this.orgSlug&&!this.orgLevel&&hh(this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.chatId)&&void 0!==t?t:null,this.sampleRateToUse,this.buildingSlug,null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null);const J=Z.featureFlagWebchatMarketingSourceDropdownConfiguration,ee=Z.featureFlagWebchatUseDniPhoneNumberBySource,te=Z.featureFlagInsertDniIntoWebsite,ne=Z.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var ie;ie=So.includes(Z.orgId),ko=ie;const[re,oe,ae,se,le]=await Promise.all([this.isOrgMode()?Promise.resolve([]):Gc(this.orgSlug,this.buildingSlug),yo(this.buildingSlug),Qc(this.buildingSlug),wo(this.buildingSlug),Co(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Vn(Z.phoneNumber),this.buildingWebchatView.isAip=ae),this.leadSources=re,this.featureFlagShowDropdown=J,this.bedroomPreferenceRequired=se,this.brokerIntakeEnabled=le;const ue=this.orgLevel?null:Z.textWithUsPhoneNumber?Z.textWithUsPhoneNumber:await(async e=>{try{const t="https://app.meetelise.com",n=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(n.data)return n.data}catch(t){return na({logType:ta.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t},error:t}),null}return null})(this.buildingSlug),de=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,ce=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,he={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)&&!!ue)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!ue)&&void 0!==S&&S,sstDesktop:null!==(k=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowSstDesktop)&&void 0!==k&&k,sstMobile:null!==(T=null===(E=this.buildingWebchatView)||void 0===E?void 0:E.shouldShowSstMobile)&&void 0!==T&&T,calcDesktop:de,calcMobile:ce};var pe,fe;this.enabledChatWidgets=this.withOrgLevelContactOptions(Tc(he),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?(Yc(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ne&&(fe=this.handleTourClicked,document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(e=>{e&&e.addEventListener("click",e=>{e.preventDefault(),fe(e)})})),"radco"===this.orgSlug&&(e=>{document.querySelectorAll('a[href^="#leaseleads-tour-open"]').forEach(t=>{var n;if(!t)return;const i=document.createElement("a");i.textContent=t.textContent,i.style.cursor="pointer",i.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(n=t.parentNode)||void 0===n||n.replaceChild(i,t)})})(this.handleTourClicked)):(null===(P=this.LeadSourceClient)||void 0===P?void 0:P.leadSource)&&(pe=null!==(N=null===(I=this.LeadSourceClient)||void 0===I?void 0:I.leadSource)&&void 0!==N?N:null,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(pe)}`)}}))),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!==(U=this.buildingWebchatView.autoOpenChat)&&void 0!==U&&U,this.requiresConsent=null!==(B=this.buildingWebchatView.requiresConsentForChat)&&void 0!==B&&B,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===ha.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===ha.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===ha.EMOJI&&(this.designConcept=ha.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Zn),null===this.backgroundColor&&(this.backgroundColor=Jn);const ge=null!==(G=null===(H=this.buildingWebchatView)||void 0===H?void 0:H.phoneNumber)&&void 0!==G?G:"";let me=null;if(ee&&!this.orgLevel&&(me=await async function(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return n.data?{number:Vn(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(Q=null===(z=this.LeadSourceClient)||void 0===z?void 0:z.leadSource)&&void 0!==Q?Q:null),me&&!me.isMatch&&(me.number=ge)),te&&(null==me?void 0:me.number)){const e=qc(me.number,this.orgSlug,this.buildingSlug);e>0&&ia({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const be=localStorage.getItem("eliseai_phone_number_devtest");be&&qc(be,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=me||{number:ge,isMatch:!1,isPropertyWebsiteCatchall:!0};const ye=null!==(V=null===(W=this.LeadSourceClient)||void 0===W?void 0:W.leadSource)&&void 0!==V?V:null;ye&&(this.leadSources.includes(ye)||this.leadSources.push(ye)),this.isOrgMode()||ao(Z.id);if((oe||(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isAip))&&(null===(Y=this.buildingWebchatView)||void 0===Y?void 0:Y.isLiveOnApplications)&&this.buildingSlug&&!this.orgLevel){const e=((e,t,n)=>{var i;const r=[/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/content\/apply/,/\/apply-now/,/\/apply/,/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,/busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/],o=document.body.getElementsByTagName("a");let a=0;for(let s=0;s<o.length;s++){const l=o[s];if(l.nodeType===Node.ELEMENT_NODE&&r.some(e=>e.test(l.href))){const r=l.getAttribute("href"),o=(null===(i=l.textContent)||void 0===i?void 0:i.toLowerCase())||"",s=th(o,e);l.setAttribute("href",s),a++,na({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:ta.info,buildingSlug:n,orgSlug:t})}}return 0===a&&na({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:ta.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&ia({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=nh[e];if(!t)return 0;const n=`${ih}/building/${t}/units`,i=`${ih}/building/${e}/units`,r=new RegExp(`https://applications\\.eliseai\\.com/building/${t}/units`,"g");let o=0;const a=document.body.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a[e],s=t.getAttribute("href");if(!s||!s.includes(n))continue;const l=s.replace(r,i);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(n))return;const a=t.replace(r,i);a!==t&&(e.setAttribute("onclick",a),o++)})})(this.buildingSlug)}catch{}this.buildingSlug&&!this.orgLevel&&(null===(K=this.buildingWebchatView)||void 0===K?void 0:K.isLiveOnApplications)&&(null===(X=this.buildingWebchatView)||void 0===X?void 0:X.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&sh(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,n,i,r,o,a,s,l,u;if(!this.buildingWebchatView)return;const d=this.chatStorageSlug(),c=gs(d),h=ms(d,c),p=h?c:fs(d,!1);if(!p.leadId)throw new Error("Lead ID is null");if(this.LeadSourceClient=new sa,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new lh(this.orgSlug,this.buildingSlug),this.myPubnub=new Es(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,p.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType),this.myPubnub.chatStorageSlug=d,this.centralConvo){const e=this.myPubnub;e.centralConvo=!0,void 0!==this.hostDeclaredBuildingId?e.declaredBuildingId=this.hostDeclaredBuildingId:this.fetchDeclaredBuildingId().then(t=>{void 0===this.hostDeclaredBuildingId&&(e.declaredBuildingId=t)})}else this.myPubnub.declaredBuildingId=this.buildingWebchatView.id;const f=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,h&&null!==(n=p.leadId)&&void 0!==n?n:void 0);f&&(fs(d,p.initiatedChat,f.lead_id),this.isOrgMode()&&f.building_slug&&await this.adoptBuilding(f.building_slug)),this.LeadSourceClient.chatId=this.myPubnub.channel;const g=await(null===(i=this.LeadSourceClient)||void 0===i?void 0:i.generateUserLeadSource({leadId:null!==(o=null===(r=this.myPubnub)||void 0===r?void 0:r.leadUserId)&&void 0!==o?o:"",orgSlug:this.orgSlug,buildingSlug:this.buildingSlug}));g&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(g),"property-website"!==aa(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:aa(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=gs(d);m.initiatedChat&&await this.myPubnub.initializePubnub(m)},this.isOrgMode=()=>this.centralConvo&&!this.buildingSlug,this.chatStorageSlug=()=>this.orgLevel?"":this.buildingSlug,this.adoptBuilding=async e=>{var t;try{const n=await ma(this.orgSlug,e);if(!(null==n?void 0:n.id))return;this.buildingSlug=e,this.buildingWebchatView=n,null===(t=this.myPubnub)||void 0===t||t.adoptBuilding(e,n)}catch(e){}},this.withOrgLevelContactOptions=(e,t)=>this.orgLevel?{...e,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,callDesktop:e.callDesktop&&!!t,callMobile:e.callMobile&&!!t}:e,this.fetchDeclaredBuildingId=async()=>{if(!this.declaredBuildingSlug||!this.orgSlug)return null;try{const e=await ma(this.orgSlug,this.declaredBuildingSlug);return"number"==typeof(null==e?void 0:e.id)&&e.id>0?e.id:null}catch{return null}},this.chatAutoOpenDismissedStorageKey=()=>{const{orgSlug:e,buildingSlug:t}=this;return e&&t?`com.elise.webchat.autoOpenDismissed=${e}=${t}`:t?`com.elise.webchat.autoOpenDismissed=${t}`:e?`com.elise.webchat.autoOpenDismissed=${e}`:null},this.shouldAutoOpenChat=e=>{if(!e||Ir())return!1;const t=this.chatAutoOpenDismissedStorageKey();return!t||"true"!==localStorage.getItem(t)},this.rememberChatAutoOpenDismissed=()=>{const e=this.chatAutoOpenDismissedStorageKey();e&&localStorage.setItem(e,"true")},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.focusChatOnMount=!0,this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,localStorage.setItem("isChatOpen","true")},e.onExitChat=this.onExitChat)},this.onExitChat=()=>{this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,localStorage.setItem("isChatOpen","false"),this.rememberChatAutoOpenDismissed()},this.focusLauncherButton=()=>{var e,t;const n=(null===(e=this.launcherButton)||void 0===e?void 0:e.isConnected)?this.launcherButton:null;null===(t=null!=n?n:this.currentLauncherButton())||void 0===t||t.focus()},this.focusMessageFieldOnOpen=()=>{var e,t;const n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("pubnub-chat"),i=null==n?void 0:n.shadowRoot;n&&i&&(n.focusMessageField()||null===(t=i.getElementById("pubnub-chat-container"))||void 0===t||t.focus(),setTimeout(()=>{n.focusMessageField()},0))},this.closeChatAndRestoreFocus=()=>{this.onExitChat(),this.updateComplete.then(()=>{this.focusLauncherButton(),requestAnimationFrame(()=>this.focusLauncherButton())})}}setDeclaredBuildingId(e){this.hostDeclaredBuildingId=e,this.myPubnub&&(this.myPubnub.declaredBuildingId=e)}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new Jo(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),ps(this.chatStorageSlug()),this.orgLevel&&(this.buildingSlug=""),this.myPubnub=null,this.displayPubnubChat=!1,await this.setupWebchat(),this.hideLauncher=!1}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustPositionChatAdditionalActions),this._cleanupMobileListener=Nr(e=>{this._isMobile=e})}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}currentLauncherButton(){var e,t,n,i;const r=null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("meetelise-launcher"))||void 0===t?void 0:t.shadowRoot,o=null==r?void 0:r.querySelector("#type-hey__ask-prompt, button[aria-label='Chat with us']"),a=null===(i=null===(n=null==r?void 0:r.querySelector("mobile-launcher"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.querySelector("button[aria-label='Chat with us']");return o instanceof HTMLElement?o:a instanceof HTMLElement?a:null}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,b,y,v,w,C,x,$,S,A,k,E,T,_,O,P,I,N,M,D,L,R,U,B,j,F,G,z,Q,W,V;Ac();const q=this.hideLauncher&&!this.isLoading&&!this._isMobile;return H`
|
|
7718
7716
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7719
7717
|
${this.displayPubnubChat?H`
|
|
7720
7718
|
<pubnub-chat
|
|
@@ -7724,7 +7722,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7724
7722
|
.orgSlug=${this.orgSlug}
|
|
7725
7723
|
.buildingSlug=${this.buildingSlug}
|
|
7726
7724
|
.centralConvo=${this.centralConvo}
|
|
7727
|
-
.widgetType=${
|
|
7725
|
+
.widgetType=${kh.Default}
|
|
7728
7726
|
.building=${this.buildingWebchatView}
|
|
7729
7727
|
.primaryColor=${this.primaryColor}
|
|
7730
7728
|
.backgroundColor=${this.backgroundColor}
|
|
@@ -7832,7 +7830,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7832
7830
|
</meetelise-launcher>`:""}
|
|
7833
7831
|
</div>
|
|
7834
7832
|
</meta>
|
|
7835
|
-
`}};
|
|
7833
|
+
`}};dh.styles=p`
|
|
7836
7834
|
:host {
|
|
7837
7835
|
all: initial;
|
|
7838
7836
|
}
|
|
@@ -7881,7 +7879,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7881
7879
|
position: fixed;
|
|
7882
7880
|
bottom: 0;
|
|
7883
7881
|
}
|
|
7884
|
-
`,
|
|
7882
|
+
`,uh([pe({type:String})],dh.prototype,"buildingSlug",void 0),uh([pe({type:String})],dh.prototype,"orgSlug",void 0),uh([pe({type:Boolean})],dh.prototype,"centralConvo",void 0),uh([pe({type:String})],dh.prototype,"declaredBuildingSlug",void 0),uh([pe({type:Object})],dh.prototype,"launcherStyles",void 0),uh([pe()],dh.prototype,"mobileStyles",void 0),uh([pe({type:Boolean})],dh.prototype,"isMinimized",void 0),uh([pe({type:String})],dh.prototype,"primaryColor",void 0),uh([pe({type:String})],dh.prototype,"backgroundColor",void 0),uh([pe({type:String})],dh.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),uh([pe({type:String})],dh.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),uh([fe()],dh.prototype,"_isMobile",void 0),uh([fe()],dh.prototype,"chatId",void 0),uh([fe()],dh.prototype,"analytics",void 0),uh([fe()],dh.prototype,"launcher",void 0),uh([fe()],dh.prototype,"buildingWebchatView",void 0),uh([fe()],dh.prototype,"designConcept",void 0),uh([fe()],dh.prototype,"leadSources",void 0),uh([fe()],dh.prototype,"currentLeadSource",void 0),uh([fe()],dh.prototype,"featureFlagShowDropdown",void 0),uh([fe()],dh.prototype,"bedroomPreferenceRequired",void 0),uh([fe()],dh.prototype,"brokerIntakeEnabled",void 0),uh([fe()],dh.prototype,"phoneNumberForSource",void 0),uh([fe()],dh.prototype,"hasMounted",void 0),uh([fe()],dh.prototype,"hideLauncher",void 0),uh([fe()],dh.prototype,"isLoading",void 0),uh([fe()],dh.prototype,"showTourNextToChat",void 0),uh([fe()],dh.prototype,"openTourSchedulerOnLoad",void 0),uh([fe()],dh.prototype,"displayPubnubChat",void 0),uh([fe()],dh.prototype,"myPubnub",void 0),uh([fe()],dh.prototype,"LeadSourceClient",void 0),uh([fe()],dh.prototype,"LeadSourceMultitouchClient",void 0),uh([fe()],dh.prototype,"sampleRateToUse",void 0),uh([pe({type:Number})],dh.prototype,"right",void 0),uh([pe({type:Number})],dh.prototype,"bottom",void 0),uh([pe({type:Number})],dh.prototype,"top",void 0),uh([pe({type:Number})],dh.prototype,"left",void 0),uh([pe({attribute:!0})],dh.prototype,"overrideRentgrata",void 0),uh([pe({attribute:!0})],dh.prototype,"widgetType",void 0),uh([pe()],dh.prototype,"onWidgetLoaded",void 0),uh([pe({attribute:!0})],dh.prototype,"onSstClose",void 0),uh([fe()],dh.prototype,"enabledChatWidgets",void 0),uh([fe()],dh.prototype,"webchatConfigHasAutoOpenChat",void 0),uh([fe()],dh.prototype,"requiresConsent",void 0),uh([fe()],dh.prototype,"hideMobileFeatures",void 0),uh([fe()],dh.prototype,"privacyPolicyUrl",void 0),dh=uh([ce("me-chat")],dh);const ch=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},hh=async(e,t,n,i,o)=>{var a;if(!i||!e)return;const s=await async function(e){if(!e)return!1;try{return(await r().get(mo(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-override-contact-us-form",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(i);if(!s)return;const u=ch(["myContactForm","contactus","fpa-myContactForm"]);let d;if(!(u&&u instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&ph(i,e,"Could not find form",t?{id:t.id}:void 0))}try{if(u.parentElement&&"scheduleTourForm"===u.parentElement.id)return ph(i,e,"Form is apart of schedule tour form!")}catch(e){}for(let e=0;e<u.elements.length;e++){const t=u.elements[e];if("button"===t.tagName.toLowerCase()&&"fakebutton"===t.getAttribute("data-selenium-id")){d=t;break}if("fpa-contact-submit"===t.getAttribute("id")){d=t;break}}if(!d)return ph(i,e,"Could not find submit button");const c=()=>({firstName:ch(["firstname","txtName","fpa-firstname","Form_FirstName"]),lastName:ch(["lastname","txtName2","fpa-lastname","Form_LastName"]),email:ch(["email","txtEmail","fpa-email","Form_Email"]),phone:ch(["phonenumber","txtPhone","fpa-phonenumber","Form_Phone"]),message:ch(["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 ph(i,e,"Missing the following form elements: "+t.join(", "))}const h=d.textContent,p=d.cloneNode(!0);null===(a=d.parentNode)||void 0===a||a.replaceChild(p,d),p&&ia({params:{chat_id:t,org_slug:e,building_slug:i,is_form_override_success:!0},sampleRate:n}),p.onclick=async function(t){if(Object.values(c()).forEach(e=>{"true"!==(null==e?void 0:e.getAttribute("aria-required"))||e.value||(e.className="form-control required is-invalid")}),!Object.values(c()).every(e=>null!==e&&!("true"===e.getAttribute("aria-required")&&!e.value)&&("email"!==e.id&&"phonenumber"!==e.id||"true"!==e.getAttribute("aria-invalid"))))return;t.preventDefault(),p.textContent="Processing request...",p.disabled=!0;const n={};Object.entries(c()).forEach(([e,t])=>n[e]=null==t?void 0:t.value);const r=await ma(e,i);if(!r)return ph(i,e,"Could not find building"),null;const a={email_address:n.email,first_name:n.firstName,last_name:n.lastName,phone_number:n.phone,first_message:n.message,building_id:r.id,is_external_form:!0,tracking_params:l(e),lead_sources:[...new Set(o?[o,aa(e)]:[aa(e)])]},s=JSON.stringify(a);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":i,"org-slug":e},body:s}).then(e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return u&&u.reset(),Object.values(c()).forEach(e=>{e&&(e.disabled=!0)}),p.textContent="Submitted",p.disabled=!0,e.json()}).catch(()=>{p.textContent=h})}},ph=(e,t,n,i)=>{const r=JSON.stringify({orgSlug:t,buildingSlug:e,reason:n,url:window.location.href,formIdInfo:i});fetch("https://app.meetelise.com/platformApi/webchat/form-override-error",{method:"POST",headers:{"Content-Type":"application/json","building-slug":e,"org-slug":t},body:r})},fh=p`
|
|
7885
7883
|
.chat-launcher {
|
|
7886
7884
|
position: fixed;
|
|
7887
7885
|
}
|
|
@@ -7912,7 +7910,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7912
7910
|
filter: brightness(1.1);
|
|
7913
7911
|
}
|
|
7914
7912
|
}
|
|
7915
|
-
`;var
|
|
7913
|
+
`;var gh=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let mh=class extends ue{constructor(){super(...arguments),this.right=0,this.bottom=0,this.top=0,this.left=0,this.isChatOpen=!1,this.onClickCloseChat=()=>({}),this.onClickOpenChat=()=>({})}render(){return this.isChatOpen?H`
|
|
7916
7914
|
<div
|
|
7917
7915
|
class="chat-launcher"
|
|
7918
7916
|
style=${Xn({top:Ir()||isNaN(this.top)?void 0:`${this.top+432}px`,bottom:Ir()||isNaN(this.bottom)?"72px":this.bottom-60+"px",left:Ir()||isNaN(this.left)?void 0:`${this.left}px`,right:Ir()||isNaN(this.right)?"18px":`${this.right}px`})}
|
|
@@ -7966,12 +7964,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7966
7964
|
/>
|
|
7967
7965
|
</svg>
|
|
7968
7966
|
</button>
|
|
7969
|
-
</div>`}};
|
|
7967
|
+
</div>`}};mh.styles=[fh],gh([pe({type:Number})],mh.prototype,"right",void 0),gh([pe({type:Number})],mh.prototype,"bottom",void 0),gh([pe({type:Number})],mh.prototype,"top",void 0),gh([pe({type:Number})],mh.prototype,"left",void 0),gh([pe({attribute:!0})],mh.prototype,"isChatOpen",void 0),gh([pe({attribute:!0})],mh.prototype,"onClickCloseChat",void 0),gh([pe({attribute:!0})],mh.prototype,"onClickOpenChat",void 0),mh=gh([ce("simple-launcher")],mh);var bh=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let yh=class extends ue{constructor(){super(...arguments),this.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=gs(this.healthcareId),t=ms(this.healthcareId,e)?e:fs(this.healthcareId,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Es(this.healthcareId,null,"",this.currentLeadSource,t.leadId,null,null,kh.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(),ps(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 Ac(),this.isLoading?H``:H`
|
|
7970
7968
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
7971
7969
|
${this.displayPubnubChat?H`
|
|
7972
7970
|
<pubnub-chat
|
|
7973
7971
|
id="pubnub-chat"
|
|
7974
|
-
.widgetType=${
|
|
7972
|
+
.widgetType=${kh.Healthcare}
|
|
7975
7973
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
7976
7974
|
.myPubnub=${this.myPubnub}
|
|
7977
7975
|
.buildingSlug=${this.healthcareId}
|
|
@@ -7997,7 +7995,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7997
7995
|
></simple-launcher>
|
|
7998
7996
|
|
|
7999
7997
|
</meta>
|
|
8000
|
-
`}};
|
|
7998
|
+
`}};yh.styles=p`
|
|
8001
7999
|
:host {
|
|
8002
8000
|
all: initial;
|
|
8003
8001
|
}
|
|
@@ -8050,13 +8048,13 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8050
8048
|
line-height: 150%;
|
|
8051
8049
|
font-size: 16px;
|
|
8052
8050
|
}
|
|
8053
|
-
`,
|
|
8051
|
+
`,bh([pe({type:String})],yh.prototype,"healthcareId",void 0),bh([pe({type:Number})],yh.prototype,"right",void 0),bh([pe({type:Number})],yh.prototype,"bottom",void 0),bh([pe({type:Number})],yh.prototype,"top",void 0),bh([pe({type:Number})],yh.prototype,"left",void 0),bh([fe()],yh.prototype,"launcher",void 0),bh([fe()],yh.prototype,"currentLeadSource",void 0),bh([fe()],yh.prototype,"displayPubnubChat",void 0),bh([fe()],yh.prototype,"myPubnub",void 0),bh([fe()],yh.prototype,"requiresConsent",void 0),bh([fe()],yh.prototype,"privacyPolicyUrl",void 0),bh([fe()],yh.prototype,"isLoading",void 0),yh=bh([ce("health-chat")],yh);var vh=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let wh=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=gs(this.orgSlug),t=ms(this.orgSlug,e)?e:fs(this.orgSlug,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Es(this.orgSlug,null,this.orgSlug,this.currentLeadSource,t.leadId,null,null,kh.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(),ps(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 Ac(),this.isLoading?H``:H`
|
|
8054
8052
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
8055
8053
|
${this.displayPubnubChat?H`
|
|
8056
8054
|
<pubnub-chat
|
|
8057
8055
|
id="pubnub-chat"
|
|
8058
8056
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
8059
|
-
.widgetType=${
|
|
8057
|
+
.widgetType=${kh.Utilities}
|
|
8060
8058
|
.myPubnub=${this.myPubnub}
|
|
8061
8059
|
.buildingSlug=${this.orgSlug}
|
|
8062
8060
|
.onClickExit=${()=>{this.displayPubnubChat=!1}}
|
|
@@ -8080,7 +8078,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8080
8078
|
|
|
8081
8079
|
></simple-launcher>
|
|
8082
8080
|
</meta>
|
|
8083
|
-
`}};
|
|
8081
|
+
`}};wh.styles=p`
|
|
8084
8082
|
:host {
|
|
8085
8083
|
all: initial;
|
|
8086
8084
|
}
|
|
@@ -8133,4 +8131,4 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8133
8131
|
line-height: 150%;
|
|
8134
8132
|
font-size: 16px;
|
|
8135
8133
|
}
|
|
8136
|
-
`,gh([pe({type:String})],mh.prototype,"orgSlug",void 0),gh([pe({type:Number})],mh.prototype,"right",void 0),gh([pe({type:Number})],mh.prototype,"bottom",void 0),gh([pe({type:Number})],mh.prototype,"top",void 0),gh([pe({type:Number})],mh.prototype,"left",void 0),gh([fe()],mh.prototype,"launcher",void 0),gh([fe()],mh.prototype,"currentLeadSource",void 0),gh([fe()],mh.prototype,"displayPubnubChat",void 0),gh([fe()],mh.prototype,"myPubnub",void 0),gh([fe()],mh.prototype,"requiresConsent",void 0),gh([fe()],mh.prototype,"privacyPolicyUrl",void 0),gh([fe()],mh.prototype,"isLoading",void 0),mh=gh([ce("utilities-chat")],mh);const bh=async e=>{const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&na({logType:i&&i.data?ta.info:ta.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),i.data},yh=async(e,t=5e3)=>new Promise((n,i)=>{const r=new MutationObserver((t,i)=>{const r=document.getElementById(e);r&&(i.disconnect(),n(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),i(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),n(a))});class vh{static healthcareStart(e,t=!0){var n,i,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),$h();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","region"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(n=e.right)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("bottom",(null===(i=e.bottom)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),vh.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;if(t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization||"",this.hasBuildingSlug=!!e.building,this.overridePlacement={right:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.right,bottom:null===(i=null==e?void 0:e.position)||void 0===i?void 0:i.bottom,top:null===(r=null==e?void 0:e.position)||void 0===r?void 0:r.top,left:null===(o=null==e?void 0:e.position)||void 0===o?void 0:o.left}),$h(),e.studio&&!e.building)return void this.handleStudioContext(e);let d=null;switch(e.widgetType){case xh.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case xh.Default:d=document.createElement("me-chat");break;case xh.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||xh.Default),d.setAttribute("class","meetelise-chat"),d.setAttribute("role","region"),d.setAttribute("aria-label","EliseAI Widget"),e.brandColor&&(this.brandColor=e.brandColor,d.setAttribute("primaryColor",((e,t)=>{const n=ei(e),i=0,r=0,o=0,a={r:n.r+Math.round((i-n.r)*t),g:n.g+Math.round((r-n.g)*t),b:n.b+Math.round((o-n.b)*t)};return ti(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),d instanceof ah&&(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 yh("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 ah&&(vh.meChat=d),d instanceof mh&&(vh.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),vh.meChat===t&&(vh.meChat=null)}static handleStudioContext(e){e.studio&&(this.activeStudioOptions=e)}static updateStudioContext(e){var t;const n=this.activeStudioOptions;if(!(null==n?void 0:n.studio))return;const i=++this.studioUpdateToken;if(e.siteId&&e.siteId!==n.studio.siteId)return void na({logType:ta.warn,logTitle:"[STUDIO_WEBCHAT_CONTEXT_SITE_MISMATCH]",logData:{activeSiteId:n.studio.siteId,contextSiteId:e.siteId,url:window.location.href}});if("org"===(null===(t=e.sessionScope)||void 0===t?void 0:t.type))return void this.updateStudioOrgContext(e,n,i);const r=wh(e.organization),o=wh(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=Ch(r);this.activeStudioOrgSlug===s&&this.activeStudioBuildingSlug===o&&this.activeStudioSessionScopeKey===a||this.removeWidget().then(()=>{i===this.studioUpdateToken&&(this.activeStudioOrgSlug=s,this.activeStudioBuildingSlug=o,this.activeStudioSessionScopeKey=a,this.orgSlug=s,this.start({...n,organization:r,building:o},!1))})}static updateStudioOrgContext(e,t,n){var i;const r=wh(e.organization);if(!r)return void this.clearStudioContext({source:"elise_studio",reason:"missing_context",preserveCache:!0});const o=Ch(r),a=(null===(i=e.sessionScope)||void 0===i?void 0:i.key)||`org:${r}`,s=function(e){const t="string"==typeof e?Number(e):e;return"number"==typeof t&&Number.isInteger(t)&&t>0?t:null}(e.declaredBuildingId);!this.meChat||this.activeStudioOrgSlug!==o||this.activeStudioBuildingSlug||this.activeStudioSessionScopeKey!==a?this.removeWidget().then(()=>{var e;n===this.studioUpdateToken&&(this.activeStudioOrgSlug=o,this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey=a,this.orgSlug=o,this.start({...t,studio:void 0,organization:r,building:void 0,centralConvo:!0},!1),null===(e=this.meChat)||void 0===e||e.setDeclaredBuildingId(s))}):this.meChat.setDeclaredBuildingId(s)}static clearStudioContext(e){this.studioUpdateToken+=1,this.activeStudioOrgSlug="",this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey="",this.removeWidget()}static async handleBuildingslug(e,t,n,i){if(n)return void e.setAttribute("buildingSlug",n);if(this.mutationObserver)return;if(!t)return;const r=await bh(t);if(r){const e={...i,organization:t,building:r};this.start(e,!1)}this.previousUrl=window.location.href,document.body.addEventListener("click",()=>{requestAnimationFrame(()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,bh(t).then(e=>{if(!e)return;const n={...i,organization:t,building:e};this.start(n,!1)}))})},!0)}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,t=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,n=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&na({logType:n&&n.data?ta.info:ta.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),!n||!n.data)return;const i={organization:this.orgSlug,building:n.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(i,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&na({logType:i&&i.data===e?ta.info:ta.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i&&i.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:i&&i.data===e?null:i&&!i.data?"No match found":i&&i.data!==e?"Mismatch":"No match found"}}),i&&i.data}}function wh(e){return"string"!=typeof e?"":e.trim()}function Ch(e){return"Pacific Urban Residential"===e?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e}var xh;vh.meChat=null,vh.healthChat=null,vh.utilitiesChat=null,vh.orgSlug="",vh.mutationObserver=null,vh.previousUrl="",vh.hasBuildingSlug=null,vh.brandColor="",vh.backgroundColor="",vh.healthcareId="",vh.activeStudioOrgSlug="",vh.activeStudioBuildingSlug="",vh.activeStudioSessionScopeKey="",vh.activeStudioOptions=null,vh.studioUpdateToken=0,vh.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(xh||(xh={}));const $h=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{xh as WidgetType,vh as default};
|
|
8134
|
+
`,vh([pe({type:String})],wh.prototype,"orgSlug",void 0),vh([pe({type:Number})],wh.prototype,"right",void 0),vh([pe({type:Number})],wh.prototype,"bottom",void 0),vh([pe({type:Number})],wh.prototype,"top",void 0),vh([pe({type:Number})],wh.prototype,"left",void 0),vh([fe()],wh.prototype,"launcher",void 0),vh([fe()],wh.prototype,"currentLeadSource",void 0),vh([fe()],wh.prototype,"displayPubnubChat",void 0),vh([fe()],wh.prototype,"myPubnub",void 0),vh([fe()],wh.prototype,"requiresConsent",void 0),vh([fe()],wh.prototype,"privacyPolicyUrl",void 0),vh([fe()],wh.prototype,"isLoading",void 0),wh=vh([ce("utilities-chat")],wh);const Ch=async e=>{const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&na({logType:i&&i.data?ta.info:ta.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),i.data},xh=async(e,t=5e3)=>new Promise((n,i)=>{const r=new MutationObserver((t,i)=>{const r=document.getElementById(e);r&&(i.disconnect(),n(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),i(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),n(a))});class $h{static healthcareStart(e,t=!0){var n,i,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),Eh();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","region"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(n=e.right)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("bottom",(null===(i=e.bottom)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),$h.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;if(t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization||"",this.hasBuildingSlug=!!e.building,this.overridePlacement={right:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.right,bottom:null===(i=null==e?void 0:e.position)||void 0===i?void 0:i.bottom,top:null===(r=null==e?void 0:e.position)||void 0===r?void 0:r.top,left:null===(o=null==e?void 0:e.position)||void 0===o?void 0:o.left}),Eh(),e.studio&&!e.building)return void this.handleStudioContext(e);let d=null;switch(e.widgetType){case kh.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case kh.Default:d=document.createElement("me-chat");break;case kh.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||kh.Default),d.setAttribute("class","meetelise-chat"),d.setAttribute("role","region"),d.setAttribute("aria-label","EliseAI Widget"),e.brandColor&&(this.brandColor=e.brandColor,d.setAttribute("primaryColor",((e,t)=>{const n=ei(e),i=0,r=0,o=0,a={r:n.r+Math.round((i-n.r)*t),g:n.g+Math.round((r-n.g)*t),b:n.b+Math.round((o-n.b)*t)};return ti(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),d instanceof dh&&(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 xh("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 dh&&($h.meChat=d),d instanceof wh&&($h.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),$h.meChat===t&&($h.meChat=null)}static handleStudioContext(e){e.studio&&(this.activeStudioOptions=e)}static updateStudioContext(e){var t;const n=this.activeStudioOptions;if(!(null==n?void 0:n.studio))return;const i=++this.studioUpdateToken;if(e.siteId&&e.siteId!==n.studio.siteId)return void na({logType:ta.warn,logTitle:"[STUDIO_WEBCHAT_CONTEXT_SITE_MISMATCH]",logData:{activeSiteId:n.studio.siteId,contextSiteId:e.siteId,url:window.location.href}});if("org"===(null===(t=e.sessionScope)||void 0===t?void 0:t.type))return void this.updateStudioOrgContext(e,n,i);const r=Sh(e.organization),o=Sh(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=Ah(r);this.activeStudioOrgSlug===s&&this.activeStudioBuildingSlug===o&&this.activeStudioSessionScopeKey===a||this.removeWidget().then(()=>{i===this.studioUpdateToken&&(this.activeStudioOrgSlug=s,this.activeStudioBuildingSlug=o,this.activeStudioSessionScopeKey=a,this.orgSlug=s,this.start({...n,organization:r,building:o},!1))})}static updateStudioOrgContext(e,t,n){var i;const r=Sh(e.organization);if(!r)return void this.clearStudioContext({source:"elise_studio",reason:"missing_context",preserveCache:!0});const o=Ah(r),a=(null===(i=e.sessionScope)||void 0===i?void 0:i.key)||`org:${r}`,s=function(e){const t="string"==typeof e?Number(e):e;return"number"==typeof t&&Number.isInteger(t)&&t>0?t:null}(e.declaredBuildingId);!this.meChat||this.activeStudioOrgSlug!==o||this.activeStudioBuildingSlug||this.activeStudioSessionScopeKey!==a?this.removeWidget().then(()=>{var e;n===this.studioUpdateToken&&(this.activeStudioOrgSlug=o,this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey=a,this.orgSlug=o,this.start({...t,studio:void 0,organization:r,building:void 0,centralConvo:!0},!1),null===(e=this.meChat)||void 0===e||e.setDeclaredBuildingId(s))}):this.meChat.setDeclaredBuildingId(s)}static clearStudioContext(e){this.studioUpdateToken+=1,this.activeStudioOrgSlug="",this.activeStudioBuildingSlug="",this.activeStudioSessionScopeKey="",this.removeWidget()}static async handleBuildingslug(e,t,n,i){if(n)return void e.setAttribute("buildingSlug",n);if(this.mutationObserver)return;if(!t)return;const r=await Ch(t);if(r){const e={...i,organization:t,building:r};this.start(e,!1)}this.previousUrl=window.location.href,document.body.addEventListener("click",()=>{requestAnimationFrame(()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,Ch(t).then(e=>{if(!e)return;const n={...i,organization:t,building:e};this.start(n,!1)}))})},!0)}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,t=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,n=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&na({logType:n&&n.data?ta.info:ta.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),!n||!n.data)return;const i={organization:this.orgSlug,building:n.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(i,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&na({logType:i&&i.data===e?ta.info:ta.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i&&i.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:i&&i.data===e?null:i&&!i.data?"No match found":i&&i.data!==e?"Mismatch":"No match found"}}),i&&i.data}}function Sh(e){return"string"!=typeof e?"":e.trim()}function Ah(e){return"Pacific Urban Residential"===e?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e}var kh;$h.meChat=null,$h.healthChat=null,$h.utilitiesChat=null,$h.orgSlug="",$h.mutationObserver=null,$h.previousUrl="",$h.hasBuildingSlug=null,$h.brandColor="",$h.backgroundColor="",$h.healthcareId="",$h.activeStudioOrgSlug="",$h.activeStudioBuildingSlug="",$h.activeStudioSessionScopeKey="",$h.activeStudioOptions=null,$h.studioUpdateToken=0,$h.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(kh||(kh={}));const Eh=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{kh as WidgetType,$h as default};
|