@meetelise/chat 1.53.5 → 1.53.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/MyPubnub.d.ts
CHANGED
|
@@ -121,7 +121,6 @@ declare class MyPubnub {
|
|
|
121
121
|
handleDisconnect: () => void;
|
|
122
122
|
removeChatListeners: () => void;
|
|
123
123
|
sendMessage: (message: string) => Promise<void>;
|
|
124
|
-
private shouldCreateAsDevState;
|
|
125
124
|
isLeadMessage: (message: RawPubnubMessage) => boolean;
|
|
126
125
|
private removeDuplicatedRawPubnubMessages;
|
|
127
126
|
translatePubnubMessagesIntoSimpleChatMessages: (messages: RawPubnubMessage[]) => SimpleChatMessage[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const shouldCreateAsDevState: (href: string) => boolean;
|
package/package.json
CHANGED
package/public/dist/index.js
CHANGED
|
@@ -6125,7 +6125,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6125
6125
|
${Ja}
|
|
6126
6126
|
${es}
|
|
6127
6127
|
${ts}
|
|
6128
|
-
`,Yl([ue({attribute:!0})],Kl.prototype,"isMinimized",void 0),Yl([ue()],Kl.prototype,"mobileStyles",void 0),Yl([ue({type:Boolean})],Kl.prototype,"isFirstMount",void 0),Yl([ue({attribute:!1})],Kl.prototype,"openSSTWindowOnLoad",void 0),Yl([ue({attribute:!1})],Kl.prototype,"autoOpenChatWidget",void 0),Yl([ue()],Kl.prototype,"phoneNumber",void 0),Yl([ue({attribute:!0})],Kl.prototype,"buildingName",void 0),Yl([ue({attribute:!0})],Kl.prototype,"chatId",void 0),Yl([ue({attribute:!0})],Kl.prototype,"orgLegalName",void 0),Yl([ue({attribute:!1})],Kl.prototype,"country",void 0),Yl([ue({attribute:!1})],Kl.prototype,"buildingState",void 0),Yl([ue({attribute:!0})],Kl.prototype,"chatCallUsHeader",void 0),Yl([ue({attribute:!1})],Kl.prototype,"buildingId",void 0),Yl([ue({type:Number})],Kl.prototype,"orgId",void 0),Yl([ue({attribute:!1})],Kl.prototype,"leadSourceParams",void 0),Yl([ue({attribute:!0})],Kl.prototype,"buildingSlug",void 0),Yl([ue({attribute:!0})],Kl.prototype,"orgSlug",void 0),Yl([ue({attribute:!0})],Kl.prototype,"sgtUrl",void 0),Yl([ue({attribute:!0})],Kl.prototype,"selfGuidedTourEnabled",void 0),Yl([ue({attribute:!0})],Kl.prototype,"selfGuidedToursTypeOffered",void 0),Yl([ue({attribute:!0})],Kl.prototype,"designConcept",void 0),Yl([ue({attribute:!0})],Kl.prototype,"featureFlagShowDropdown",void 0),Yl([ue({attribute:!1})],Kl.prototype,"leadSources",void 0),Yl([ue({attribute:!0})],Kl.prototype,"currentLeadSource",void 0),Yl([ue({attribute:!0})],Kl.prototype,"escortedToursLink",void 0),Yl([ue({attribute:!0})],Kl.prototype,"escortedToursTypeOffered",void 0),Yl([ue({attribute:!0})],Kl.prototype,"virtualToursLink",void 0),Yl([ue({attribute:!0})],Kl.prototype,"virtualToursTypeOffered",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasChatEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasChatEnabledMobile",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasEmailEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasEmailEnabledMobile",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasApplyNowEnabledDesktop",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasApplyNowEnabledMobile",void 0),Yl([ue({attribute:!0})],Kl.prototype,"applicationLink",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasCallUsEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasCallUsEnabledMobile",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasTextUsEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasTextUsEnabledMobile",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasSSTEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasSSTEnabledMobile",void 0),Yl([ue({attribute:!1})],Kl.prototype,"tourTypeOptions",void 0),Yl([ue({attribute:!1})],Kl.prototype,"layoutOptions",void 0),Yl([ue({attribute:!0})],Kl.prototype,"bedroomPreferenceRequired",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasDynamicSchedulingEnabled",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasPricingCalculatorEnabledDesktop",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasPricingCalculatorEnabledMobile",void 0),Yl([ue({attribute:!1})],Kl.prototype,"hasHideMobileFeatures",void 0),Yl([ue({type:Number})],Kl.prototype,"right",void 0),Yl([ue({type:Number})],Kl.prototype,"bottom",void 0),Yl([ue({type:Number})],Kl.prototype,"top",void 0),Yl([ue({type:Number})],Kl.prototype,"left",void 0),Yl([ue({attribute:!0})],Kl.prototype,"showTourNextToChat",void 0),Yl([ue({attribute:!1})],Kl.prototype,"onChatTapped",void 0),Yl([ue({attribute:!0})],Kl.prototype,"onClickMinimize",void 0),Yl([ue({attribute:!0})],Kl.prototype,"onSstClose",void 0),Yl([ue({attribute:!0})],Kl.prototype,"overrideRentgrata",void 0),Yl([ue({attribute:!1})],Kl.prototype,"launcherStyles",void 0),Yl([ue({attribute:!0})],Kl.prototype,"primaryColor",void 0),Yl([ue({attribute:!0})],Kl.prototype,"backgroundColor",void 0),Yl([ue({attribute:!0})],Kl.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Yl([ue({attribute:!0})],Kl.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Yl([ue({attribute:!0})],Kl.prototype,"leadSourceClient",void 0),Yl([de()],Kl.prototype,"leadSourceMultitouchClient",void 0),Yl([de()],Kl.prototype,"_isMobile",void 0),Yl([de()],Kl.prototype,"isEmailWindowOpen",void 0),Yl([de()],Kl.prototype,"isCallUsWindowOpen",void 0),Yl([de()],Kl.prototype,"isSSTWindowOpen",void 0),Yl([de()],Kl.prototype,"isTextUsWindowOpen",void 0),Yl([de()],Kl.prototype,"isCalculatorWindowOpen",void 0),Yl([de()],Kl.prototype,"isMobileFeaturesExpanded",void 0),Kl=Yl([se("meetelise-launcher")],Kl);const Xl=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Kl)},Zl=["app.meetelise.com","staging.eliseai.com","localhost"],Jl={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"}},eu=e=>{const t=window.location.hostname;if(!Zl.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 Jl&&(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=Jl[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var tu=n(5072),nu=n.n(tu),iu=n(7825),ru=n.n(iu),ou=n(7659),au=n.n(ou),su=n(5056),lu=n.n(su),uu=n(540),du=n.n(uu),cu=n(1113),hu=n.n(cu),pu=n(5541),fu={};fu.styleTagTransform=hu(),fu.setAttributes=lu(),fu.insert=au().bind(null,"head"),fu.domAPI=ru(),fu.insertStyleElement=du();nu()(pu.A,fu);pu.A&&pu.A.locals&&pu.A.locals;async function gu(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 mu(n.data,t)}return[]}catch(e){return[]}}const mu=(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 yu(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}}var bu,vu=n(8805),wu=n.n(vu),Cu=new Uint8Array(16);function xu(){if(!bu&&!(bu="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 bu(Cu)}const $u=/^(?:[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 Su=function(e){return"string"==typeof e&&$u.test(e)};for(var Au=[],Eu=0;Eu<256;++Eu)Au.push((Eu+256).toString(16).substr(1));const Tu=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Au[e[t+0]]+Au[e[t+1]]+Au[e[t+2]]+Au[e[t+3]]+"-"+Au[e[t+4]]+Au[e[t+5]]+"-"+Au[e[t+6]]+Au[e[t+7]]+"-"+Au[e[t+8]]+Au[e[t+9]]+"-"+Au[e[t+10]]+Au[e[t+11]]+Au[e[t+12]]+Au[e[t+13]]+Au[e[t+14]]+Au[e[t+15]]).toLowerCase();if(!Su(n))throw TypeError("Stringified UUID is invalid");return n};const ku=function(e,t,n){var i=(e=e||{}).random||(e.rng||xu)();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 Tu(i)},_u=e=>localStorage.removeItem("com.elise.webchat.slug="+e),Ou=(e,t,n)=>{const i=Br(new Date),r=n||`lead_${ku()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:qr(i),buildingSlug:e,initiatedChat:t}},Pu=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(Iu(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},Iu=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if($r(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!Ir(t.timestamp,24)};var Mu;!function(e){e.noReply="no-reply",e.text="text",e.media="media"}(Mu||(Mu={}));const Nu=e=>e.type===Lu.text,Du=e=>e.type===Lu.media;var Lu;!function(e){e.text="text",e.media="media"}(Lu||(Lu={}));const Uu=class{constructor(e,t,n,i=null,r,o,a=null,s=jc.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=jc.Default,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!==Mu.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(()=>{Vo({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:qo.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),$o("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;$o("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,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)===Mu.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&&Vo({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:qo.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=Ou(this.buildingSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,l,u;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&Vo({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:qo.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===jc.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),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,widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),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=>Tr({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||($o("firstChatMessageSent",{message:e,buildingId:null===(l=this.buildingWebchatView)||void 0===l?void 0:l.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}),this.isFirstChatMessageSent=!0),$o("chatMessageSent",{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}))}),!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)?(Vo({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:qo.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;"media"===e.message.messageType?t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:Lu.media}):!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:Lu.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:Lu.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.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};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&&Vo({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:qo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e}),null}}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(wu())({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}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&&Vo({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:qo.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&&Vo({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:qo.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&&Vo({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:qo.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!==Mu.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&&Vo({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:qo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}shouldCreateAsDevState(){return location.href.startsWith("https://app.meetelise.com/settings/widgets")||location.href.includes("demo/utilities")}},Ru=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"]),Bu=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return Ru.has(t)},ju=(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))},y=document.body.getElementsByTagName("*");let b=!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<y.length;e++)if(y[e].nodeType===Node.ELEMENT_NODE&&!m(y[e])){if(1===y[e].childNodes.length&&y[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=y[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(Bu(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,y[e].textContent=n),b=!0,w||(w=!0)}if(y[e].hasAttribute("href")){const t=y[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,Bu(t))continue;const u=t.replace(i,n);if(y[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&y[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&Vo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:qo.info,buildingSlug:n,orgSlug:t}),C&&Vo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:qo.info,buildingSlug:n,orgSlug:t}),b||Vo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:qo.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return Vo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:qo.error,buildingSlug:n,orgSlug:t,error:e}),0}},Fu=(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 Hu=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 Gu=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Vn,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return R`
|
|
6128
|
+
`,Yl([ue({attribute:!0})],Kl.prototype,"isMinimized",void 0),Yl([ue()],Kl.prototype,"mobileStyles",void 0),Yl([ue({type:Boolean})],Kl.prototype,"isFirstMount",void 0),Yl([ue({attribute:!1})],Kl.prototype,"openSSTWindowOnLoad",void 0),Yl([ue({attribute:!1})],Kl.prototype,"autoOpenChatWidget",void 0),Yl([ue()],Kl.prototype,"phoneNumber",void 0),Yl([ue({attribute:!0})],Kl.prototype,"buildingName",void 0),Yl([ue({attribute:!0})],Kl.prototype,"chatId",void 0),Yl([ue({attribute:!0})],Kl.prototype,"orgLegalName",void 0),Yl([ue({attribute:!1})],Kl.prototype,"country",void 0),Yl([ue({attribute:!1})],Kl.prototype,"buildingState",void 0),Yl([ue({attribute:!0})],Kl.prototype,"chatCallUsHeader",void 0),Yl([ue({attribute:!1})],Kl.prototype,"buildingId",void 0),Yl([ue({type:Number})],Kl.prototype,"orgId",void 0),Yl([ue({attribute:!1})],Kl.prototype,"leadSourceParams",void 0),Yl([ue({attribute:!0})],Kl.prototype,"buildingSlug",void 0),Yl([ue({attribute:!0})],Kl.prototype,"orgSlug",void 0),Yl([ue({attribute:!0})],Kl.prototype,"sgtUrl",void 0),Yl([ue({attribute:!0})],Kl.prototype,"selfGuidedTourEnabled",void 0),Yl([ue({attribute:!0})],Kl.prototype,"selfGuidedToursTypeOffered",void 0),Yl([ue({attribute:!0})],Kl.prototype,"designConcept",void 0),Yl([ue({attribute:!0})],Kl.prototype,"featureFlagShowDropdown",void 0),Yl([ue({attribute:!1})],Kl.prototype,"leadSources",void 0),Yl([ue({attribute:!0})],Kl.prototype,"currentLeadSource",void 0),Yl([ue({attribute:!0})],Kl.prototype,"escortedToursLink",void 0),Yl([ue({attribute:!0})],Kl.prototype,"escortedToursTypeOffered",void 0),Yl([ue({attribute:!0})],Kl.prototype,"virtualToursLink",void 0),Yl([ue({attribute:!0})],Kl.prototype,"virtualToursTypeOffered",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasChatEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasChatEnabledMobile",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasEmailEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasEmailEnabledMobile",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasApplyNowEnabledDesktop",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasApplyNowEnabledMobile",void 0),Yl([ue({attribute:!0})],Kl.prototype,"applicationLink",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasCallUsEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasCallUsEnabledMobile",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasTextUsEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasTextUsEnabledMobile",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasSSTEnabledDesktop",void 0),Yl([ue({type:Boolean})],Kl.prototype,"hasSSTEnabledMobile",void 0),Yl([ue({attribute:!1})],Kl.prototype,"tourTypeOptions",void 0),Yl([ue({attribute:!1})],Kl.prototype,"layoutOptions",void 0),Yl([ue({attribute:!0})],Kl.prototype,"bedroomPreferenceRequired",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasDynamicSchedulingEnabled",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasPricingCalculatorEnabledDesktop",void 0),Yl([ue({attribute:!0})],Kl.prototype,"hasPricingCalculatorEnabledMobile",void 0),Yl([ue({attribute:!1})],Kl.prototype,"hasHideMobileFeatures",void 0),Yl([ue({type:Number})],Kl.prototype,"right",void 0),Yl([ue({type:Number})],Kl.prototype,"bottom",void 0),Yl([ue({type:Number})],Kl.prototype,"top",void 0),Yl([ue({type:Number})],Kl.prototype,"left",void 0),Yl([ue({attribute:!0})],Kl.prototype,"showTourNextToChat",void 0),Yl([ue({attribute:!1})],Kl.prototype,"onChatTapped",void 0),Yl([ue({attribute:!0})],Kl.prototype,"onClickMinimize",void 0),Yl([ue({attribute:!0})],Kl.prototype,"onSstClose",void 0),Yl([ue({attribute:!0})],Kl.prototype,"overrideRentgrata",void 0),Yl([ue({attribute:!1})],Kl.prototype,"launcherStyles",void 0),Yl([ue({attribute:!0})],Kl.prototype,"primaryColor",void 0),Yl([ue({attribute:!0})],Kl.prototype,"backgroundColor",void 0),Yl([ue({attribute:!0})],Kl.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Yl([ue({attribute:!0})],Kl.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Yl([ue({attribute:!0})],Kl.prototype,"leadSourceClient",void 0),Yl([de()],Kl.prototype,"leadSourceMultitouchClient",void 0),Yl([de()],Kl.prototype,"_isMobile",void 0),Yl([de()],Kl.prototype,"isEmailWindowOpen",void 0),Yl([de()],Kl.prototype,"isCallUsWindowOpen",void 0),Yl([de()],Kl.prototype,"isSSTWindowOpen",void 0),Yl([de()],Kl.prototype,"isTextUsWindowOpen",void 0),Yl([de()],Kl.prototype,"isCalculatorWindowOpen",void 0),Yl([de()],Kl.prototype,"isMobileFeaturesExpanded",void 0),Kl=Yl([se("meetelise-launcher")],Kl);const Xl=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Kl)},Zl=["app.meetelise.com","staging.eliseai.com","localhost"],Jl={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"}},eu=e=>{const t=window.location.hostname;if(!Zl.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 Jl&&(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=Jl[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var tu=n(5072),nu=n.n(tu),iu=n(7825),ru=n.n(iu),ou=n(7659),au=n.n(ou),su=n(5056),lu=n.n(su),uu=n(540),du=n.n(uu),cu=n(1113),hu=n.n(cu),pu=n(5541),fu={};fu.styleTagTransform=hu(),fu.setAttributes=lu(),fu.insert=au().bind(null,"head"),fu.domAPI=ru(),fu.insertStyleElement=du();nu()(pu.A,fu);pu.A&&pu.A.locals&&pu.A.locals;async function gu(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 mu(n.data,t)}return[]}catch(e){return[]}}const mu=(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 yu(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}}var bu,vu=n(8805),wu=n.n(vu),Cu=new Uint8Array(16);function xu(){if(!bu&&!(bu="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 bu(Cu)}const $u=/^(?:[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 Su=function(e){return"string"==typeof e&&$u.test(e)};for(var Au=[],Eu=0;Eu<256;++Eu)Au.push((Eu+256).toString(16).substr(1));const Tu=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Au[e[t+0]]+Au[e[t+1]]+Au[e[t+2]]+Au[e[t+3]]+"-"+Au[e[t+4]]+Au[e[t+5]]+"-"+Au[e[t+6]]+Au[e[t+7]]+"-"+Au[e[t+8]]+Au[e[t+9]]+"-"+Au[e[t+10]]+Au[e[t+11]]+Au[e[t+12]]+Au[e[t+13]]+Au[e[t+14]]+Au[e[t+15]]).toLowerCase();if(!Su(n))throw TypeError("Stringified UUID is invalid");return n};const ku=function(e,t,n){var i=(e=e||{}).random||(e.rng||xu)();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 Tu(i)},_u=e=>localStorage.removeItem("com.elise.webchat.slug="+e),Ou=(e,t,n)=>{const i=Br(new Date),r=n||`lead_${ku()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:qr(i),buildingSlug:e,initiatedChat:t}},Pu=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(Iu(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},Iu=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if($r(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!Ir(t.timestamp,24)},Mu=e=>e.startsWith("https://app.meetelise.com/settings/widgets")||e.startsWith("https://app.meetelise.com/settings/marketing/webchat")||e.includes("demo/utilities");var Nu;!function(e){e.noReply="no-reply",e.text="text",e.media="media"}(Nu||(Nu={}));const Du=e=>e.type===Uu.text,Lu=e=>e.type===Uu.media;var Uu;!function(e){e.text="text",e.media="media"}(Uu||(Uu={}));const Ru=class{constructor(e,t,n,i=null,r,o,a=null,s=Fc.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=Fc.Default,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!==Nu.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(()=>{Vo({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:qo.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),$o("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;$o("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,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)===Nu.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&&Vo({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:qo.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=Ou(this.buildingSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,l,u;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&Vo({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:qo.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===Fc.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:Mu(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,widgetType:this.widgetType,isDevState:Mu(location.href),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=>Tr({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||($o("firstChatMessageSent",{message:e,buildingId:null===(l=this.buildingWebchatView)||void 0===l?void 0:l.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}),this.isFirstChatMessageSent=!0),$o("chatMessageSent",{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}))}),!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)?(Vo({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:qo.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;"media"===e.message.messageType?t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:Uu.media}):!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:Uu.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:Uu.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.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};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&&Vo({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:qo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e}),null}}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(wu())({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}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&&Vo({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:qo.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&&Vo({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:qo.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&&Vo({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:qo.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!==Nu.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&&Vo({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:qo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}},Bu=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"]),ju=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return Bu.has(t)},Fu=(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))},y=document.body.getElementsByTagName("*");let b=!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<y.length;e++)if(y[e].nodeType===Node.ELEMENT_NODE&&!m(y[e])){if(1===y[e].childNodes.length&&y[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=y[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(ju(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,y[e].textContent=n),b=!0,w||(w=!0)}if(y[e].hasAttribute("href")){const t=y[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,ju(t))continue;const u=t.replace(i,n);if(y[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&y[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&Vo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:qo.info,buildingSlug:n,orgSlug:t}),C&&Vo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:qo.info,buildingSlug:n,orgSlug:t}),b||Vo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:qo.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return Vo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:qo.error,buildingSlug:n,orgSlug:t,error:e}),0}},Hu=(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 Gu=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let zu=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Vn,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return R`
|
|
6129
6129
|
<button
|
|
6130
6130
|
class=${this.toExpand?"button-container mini":"button-container"}
|
|
6131
6131
|
@click=${this.onClick}
|
|
@@ -6142,7 +6142,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6142
6142
|
</div>`}
|
|
6143
6143
|
</div>
|
|
6144
6144
|
</button>
|
|
6145
|
-
`}};
|
|
6145
|
+
`}};zu.styles=[u`
|
|
6146
6146
|
.button-container {
|
|
6147
6147
|
width: 56px;
|
|
6148
6148
|
height: 56px;
|
|
@@ -6192,7 +6192,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6192
6192
|
cursor: pointer;
|
|
6193
6193
|
filter: brightness(90%);
|
|
6194
6194
|
}
|
|
6195
|
-
`],
|
|
6195
|
+
`],Gu([ue({attribute:!0})],zu.prototype,"onClick",void 0),Gu([ue({attribute:!0})],zu.prototype,"primaryColor",void 0),Gu([ue({attribute:!0})],zu.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Gu([ue({attribute:!0})],zu.prototype,"toExpand",void 0),zu=Gu([se("minimize-expand-button")],zu);const Qu=u`
|
|
6196
6196
|
#healthchat-container {
|
|
6197
6197
|
position: fixed;
|
|
6198
6198
|
|
|
@@ -6310,7 +6310,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6310
6310
|
.health-bttn-allow-access {
|
|
6311
6311
|
padding-right: 28px;
|
|
6312
6312
|
}
|
|
6313
|
-
`,
|
|
6313
|
+
`,Wu=u`
|
|
6314
6314
|
#pubnub-chat-container {
|
|
6315
6315
|
position: fixed;
|
|
6316
6316
|
|
|
@@ -6430,7 +6430,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6430
6430
|
border: none;
|
|
6431
6431
|
cursor: pointer;
|
|
6432
6432
|
}
|
|
6433
|
-
`,
|
|
6433
|
+
`,qu=u`
|
|
6434
6434
|
#header-text {
|
|
6435
6435
|
font-size: 12px;
|
|
6436
6436
|
font-weight: 700;
|
|
@@ -6631,7 +6631,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6631
6631
|
.checkbox:hover {
|
|
6632
6632
|
opacity: 0.5;
|
|
6633
6633
|
}
|
|
6634
|
-
`,{entries:qu,setPrototypeOf:Vu,isFrozen:Yu,getPrototypeOf:Ku,getOwnPropertyDescriptor:Xu}=Object;let{freeze:Zu,seal:Ju,create:ed}=Object,{apply:td,construct:nd}="undefined"!=typeof Reflect&&Reflect;Zu||(Zu=function(e){return e}),Ju||(Ju=function(e){return e}),td||(td=function(e,t,n){return e.apply(t,n)}),nd||(nd=function(e,t){return new e(...t)});const id=bd(Array.prototype.forEach),rd=bd(Array.prototype.lastIndexOf),od=bd(Array.prototype.pop),ad=bd(Array.prototype.push),sd=bd(Array.prototype.splice),ld=bd(String.prototype.toLowerCase),ud=bd(String.prototype.toString),dd=bd(String.prototype.match),cd=bd(String.prototype.replace),hd=bd(String.prototype.indexOf),pd=bd(String.prototype.trim),fd=bd(Object.prototype.hasOwnProperty),gd=bd(RegExp.prototype.test),md=(yd=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return nd(yd,t)});var yd;function bd(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 td(e,t,i)}}function vd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ld;Vu&&Vu(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(Yu(t)||(t[i]=e),r=e)}e[r]=!0}return e}function wd(e){for(let t=0;t<e.length;t++){fd(e,t)||(e[t]=null)}return e}function Cd(e){const t=ed(null);for(const[n,i]of qu(e)){fd(e,n)&&(Array.isArray(i)?t[n]=wd(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=Cd(i):t[n]=i)}return t}function xd(e,t){for(;null!==e;){const n=Xu(e,t);if(n){if(n.get)return bd(n.get);if("function"==typeof n.value)return bd(n.value)}e=Ku(e)}return function(){return null}}const $d=Zu(["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"]),Sd=Zu(["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"]),Ad=Zu(["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"]),Ed=Zu(["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"]),Td=Zu(["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"]),kd=Zu(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_d=Zu(["#text"]),Od=Zu(["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"]),Pd=Zu(["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"]),Id=Zu(["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"]),Md=Zu(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Nd=Ju(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Dd=Ju(/<%[\w\W]*|[\w\W]*%>/gm),Ld=Ju(/\$\{[\w\W]*/gm),Ud=Ju(/^data-[\-\w.\u00B7-\uFFFF]+$/),Rd=Ju(/^aria-[\-\w]+$/),Bd=Ju(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jd=Ju(/^(?:\w+script|data):/i),Fd=Ju(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hd=Ju(/^html$/i),Gd=Ju(/^[a-z][.\w]*(-[.\w]+)+$/i);var zd=Object.freeze({__proto__:null,ARIA_ATTR:Rd,ATTR_WHITESPACE:Fd,CUSTOM_ELEMENT:Gd,DATA_ATTR:Ud,DOCTYPE_NAME:Hd,ERB_EXPR:Dd,IS_ALLOWED_URI:Bd,IS_SCRIPT_OR_DATA:jd,MUSTACHE_EXPR:Nd,TMPLIT_EXPR:Ld});const Qd=1,Wd=3,qd=7,Vd=8,Yd=9,Kd=function(){return"undefined"==typeof window?null:window};var Xd=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Kd();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==Yd||!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=xd(g,"cloneNode"),y=xd(g,"remove"),b=xd(g,"nextSibling"),v=xd(g,"childNodes"),w=xd(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:E}=i,{importNode:T}=r;let k={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof qu&&"function"==typeof w&&$&&void 0!==$.createHTMLDocument;const{MUSTACHE_EXPR:_,ERB_EXPR:O,TMPLIT_EXPR:P,DATA_ATTR:I,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:N,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:L}=zd;let{IS_ALLOWED_URI:U}=zd,R=null;const B=vd({},[...$d,...Sd,...Ad,...Td,..._d]);let j=null;const F=vd({},[...Od,...Pd,...Id,...Md]);let H=Object.seal(ed(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,q=!1,V=!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=vd({},["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=vd({},["audio","video","img","source","image","track"]);let he=null;const pe=vd({},["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 ye=me,be=!1,ve=null;const we=vd({},[fe,ge,me],ud);let Ce=vd({},["mi","mo","mn","ms","mtext"]),xe=vd({},["annotation-xml"]);const $e=vd({},["title","style","font","a","script"]);let Se=null;const Ae=["application/xhtml+xml","text/html"];let Ee=null,Te=null;const ke=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(!Te||Te!==e){if(e&&"object"==typeof e||(e={}),e=Cd(e),Se=-1===Ae.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ee="application/xhtml+xml"===Se?ud:ld,R=fd(e,"ALLOWED_TAGS")?vd({},e.ALLOWED_TAGS,Ee):B,j=fd(e,"ALLOWED_ATTR")?vd({},e.ALLOWED_ATTR,Ee):F,ve=fd(e,"ALLOWED_NAMESPACES")?vd({},e.ALLOWED_NAMESPACES,ud):we,he=fd(e,"ADD_URI_SAFE_ATTR")?vd(Cd(pe),e.ADD_URI_SAFE_ATTR,Ee):pe,de=fd(e,"ADD_DATA_URI_TAGS")?vd(Cd(ce),e.ADD_DATA_URI_TAGS,Ee):ce,le=fd(e,"FORBID_CONTENTS")?vd({},e.FORBID_CONTENTS,Ee):ue,G=fd(e,"FORBID_TAGS")?vd({},e.FORBID_TAGS,Ee):Cd({}),z=fd(e,"FORBID_ATTR")?vd({},e.FORBID_ATTR,Ee):Cd({}),se=!!fd(e,"USE_PROFILES")&&e.USE_PROFILES,Q=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,V=!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,U=e.ALLOWED_URI_REGEXP||Bd,ye=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&&(R=vd({},_d),j=[],!0===se.html&&(vd(R,$d),vd(j,Od)),!0===se.svg&&(vd(R,Sd),vd(j,Pd),vd(j,Md)),!0===se.svgFilters&&(vd(R,Ad),vd(j,Pd),vd(j,Md)),!0===se.mathMl&&(vd(R,Td),vd(j,Id),vd(j,Md))),e.ADD_TAGS&&(R===B&&(R=Cd(R)),vd(R,e.ADD_TAGS,Ee)),e.ADD_ATTR&&(j===F&&(j=Cd(j)),vd(j,e.ADD_ATTR,Ee)),e.ADD_URI_SAFE_ATTR&&vd(he,e.ADD_URI_SAFE_ATTR,Ee),e.FORBID_CONTENTS&&(le===ue&&(le=Cd(le)),vd(le,e.FORBID_CONTENTS,Ee)),oe&&(R["#text"]=!0),X&&vd(R,["html","head","body"]),R.table&&(vd(R,["tbody"]),delete G.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw md('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw md('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(""));Zu&&Zu(e),Te=e}},Pe=vd({},[...Sd,...Ad,...Ed]),Ie=vd({},[...Td,...kd]),Me=function(e){ad(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){y(e)}},Ne=function(e,t){try{ad(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){ad(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Me(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=dd(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&ye===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=C?C.createHTML(e):e;if(ye===me)try{t=(new p).parseFromString(r,Se)}catch(e){}if(!t||!t.documentElement){t=$.createDocument(ye,"template",null);try{t.documentElement.innerHTML=be?x:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),ye===me?E.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)},Ue=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)},Re=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,i){id(e,e=>{e.call(n,t,i,Te)})}const je=function(e){let t=null;if(Be(k.beforeSanitizeElements,e,null),Ue(e))return Me(e),!0;const i=Ee(e.nodeName);if(Be(k.uponSanitizeElement,e,{tagName:i,allowedTags:R}),K&&e.hasChildNodes()&&!Re(e.firstElementChild)&&gd(/<[/\w!]/g,e.innerHTML)&&gd(/<[/\w!]/g,e.textContent))return Me(e),!0;if(e.nodeType===qd)return Me(e),!0;if(K&&e.nodeType===Vd&&gd(/<[/\w]/g,e.data))return Me(e),!0;if(!R[i]||G[i]){if(!G[i]&&He(i)){if(H.tagNameCheck instanceof RegExp&&gd(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,b(e))}}}return Me(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:ye,tagName:"template"});const n=ld(e.tagName),i=ld(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)?(Me(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!gd(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===Wd&&(t=e.textContent,id([_,O,P],e=>{t=cd(t,e," ")}),e.textContent!==t&&(ad(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(k.afterSanitizeElements,e,null),!1):(Me(e),!0)},Fe=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in ke))return!1;if(W&&!z[t]&&gd(I,t));else if(Q&&gd(M,t));else if(!j[t]||z[t]){if(!(He(e)&&(H.tagNameCheck instanceof RegExp&&gd(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&gd(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&gd(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(he[t]);else if(gd(U,cd(n,D,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==hd(n,"data:")||!de[e]){if(q&&!gd(N,cd(n,D,"")));else if(n)return!1}else;return!0},He=function(e){return"annotation-xml"!==e&&dd(e,L)},Ge=function(e){Be(k.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Ue(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=Ee(a),d=l;let c="value"===a?d:pd(d);if(i.attrName=u,i.attrValue=c,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(k.uponSanitizeAttribute,e,i),c=i.attrValue,!re||"id"!==u&&"name"!==u||(Ne(a,e),c="user-content-"+c),K&&gd(/((--!?|])>)|<\/(style|title)/i,c)){Ne(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Ne(a,e);continue}if(!V&&gd(/\/>/i,c)){Ne(a,e);continue}Y&&id([_,O,P],e=>{c=cd(c,e," ")});const h=Ee(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),Ue(e)?Me(e):od(n.removed)}catch(t){Ne(a,e)}}else Ne(a,e)}Be(k.afterSanitizeAttributes,e,null)},ze=function e(t){let n=null;const i=Le(t);for(Be(k.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(k.uponSanitizeShadowNode,n,null),je(n),Ge(n),n.content instanceof a&&e(n.content);Be(k.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(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Re(e)){if("function"!=typeof e.toString)throw md("toString is not a function");if("string"!=typeof(e=e.toString()))throw md("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=Ee(e.nodeName);if(!R[t]||G[t])throw md("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===Qd&&"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&&Me(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=T.call(r,u,!0)),u}let c=X?i.outerHTML:i.innerHTML;return X&&R["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&gd(Hd,i.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+c),Y&&id([_,O,P],e=>{c=cd(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(){Te=null,Z=!1},n.isValidAttribute=function(e,t,n){Te||Oe({});const i=Ee(e),r=Ee(t);return Fe(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&ad(k[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=rd(k[e],t);return-1===n?void 0:sd(k[e],n,1)[0]}return od(k[e])},n.removeHooks=function(e){k[e]=[]},n.removeAllHooks=function(){k={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Zd=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 Jd=class extends oe{constructor(){super(...arguments),this.spinSpeed=.4}updated(){this.style.setProperty("--spin-duration",`${this.spinSpeed}s`)}render(){return R`<div class="spinner"></div>`}};Jd.styles=u`
|
|
6634
|
+
`,{entries:Vu,setPrototypeOf:Yu,isFrozen:Ku,getPrototypeOf:Xu,getOwnPropertyDescriptor:Zu}=Object;let{freeze:Ju,seal:ed,create:td}=Object,{apply:nd,construct:id}="undefined"!=typeof Reflect&&Reflect;Ju||(Ju=function(e){return e}),ed||(ed=function(e){return e}),nd||(nd=function(e,t,n){return e.apply(t,n)}),id||(id=function(e,t){return new e(...t)});const rd=vd(Array.prototype.forEach),od=vd(Array.prototype.lastIndexOf),ad=vd(Array.prototype.pop),sd=vd(Array.prototype.push),ld=vd(Array.prototype.splice),ud=vd(String.prototype.toLowerCase),dd=vd(String.prototype.toString),cd=vd(String.prototype.match),hd=vd(String.prototype.replace),pd=vd(String.prototype.indexOf),fd=vd(String.prototype.trim),gd=vd(Object.prototype.hasOwnProperty),md=vd(RegExp.prototype.test),yd=(bd=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return id(bd,t)});var bd;function vd(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 nd(e,t,i)}}function wd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ud;Yu&&Yu(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(Ku(t)||(t[i]=e),r=e)}e[r]=!0}return e}function Cd(e){for(let t=0;t<e.length;t++){gd(e,t)||(e[t]=null)}return e}function xd(e){const t=td(null);for(const[n,i]of Vu(e)){gd(e,n)&&(Array.isArray(i)?t[n]=Cd(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=xd(i):t[n]=i)}return t}function $d(e,t){for(;null!==e;){const n=Zu(e,t);if(n){if(n.get)return vd(n.get);if("function"==typeof n.value)return vd(n.value)}e=Xu(e)}return function(){return null}}const Sd=Ju(["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"]),Ad=Ju(["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"]),Ed=Ju(["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"]),Td=Ju(["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"]),kd=Ju(["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"]),_d=Ju(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Od=Ju(["#text"]),Pd=Ju(["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"]),Id=Ju(["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"]),Md=Ju(["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"]),Nd=Ju(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dd=ed(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ld=ed(/<%[\w\W]*|[\w\W]*%>/gm),Ud=ed(/\$\{[\w\W]*/gm),Rd=ed(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bd=ed(/^aria-[\-\w]+$/),jd=ed(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fd=ed(/^(?:\w+script|data):/i),Hd=ed(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gd=ed(/^html$/i),zd=ed(/^[a-z][.\w]*(-[.\w]+)+$/i);var Qd=Object.freeze({__proto__:null,ARIA_ATTR:Bd,ATTR_WHITESPACE:Hd,CUSTOM_ELEMENT:zd,DATA_ATTR:Rd,DOCTYPE_NAME:Gd,ERB_EXPR:Ld,IS_ALLOWED_URI:jd,IS_SCRIPT_OR_DATA:Fd,MUSTACHE_EXPR:Dd,TMPLIT_EXPR:Ud});const Wd=1,qd=3,Vd=7,Yd=8,Kd=9,Xd=function(){return"undefined"==typeof window?null:window};var Zd=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xd();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==Kd||!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=$d(g,"cloneNode"),y=$d(g,"remove"),b=$d(g,"nextSibling"),v=$d(g,"childNodes"),w=$d(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:E}=i,{importNode:T}=r;let k={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Vu&&"function"==typeof w&&$&&void 0!==$.createHTMLDocument;const{MUSTACHE_EXPR:_,ERB_EXPR:O,TMPLIT_EXPR:P,DATA_ATTR:I,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:N,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:L}=Qd;let{IS_ALLOWED_URI:U}=Qd,R=null;const B=wd({},[...Sd,...Ad,...Ed,...kd,...Od]);let j=null;const F=wd({},[...Pd,...Id,...Md,...Nd]);let H=Object.seal(td(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,q=!1,V=!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=wd({},["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=wd({},["audio","video","img","source","image","track"]);let he=null;const pe=wd({},["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 ye=me,be=!1,ve=null;const we=wd({},[fe,ge,me],dd);let Ce=wd({},["mi","mo","mn","ms","mtext"]),xe=wd({},["annotation-xml"]);const $e=wd({},["title","style","font","a","script"]);let Se=null;const Ae=["application/xhtml+xml","text/html"];let Ee=null,Te=null;const ke=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(!Te||Te!==e){if(e&&"object"==typeof e||(e={}),e=xd(e),Se=-1===Ae.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ee="application/xhtml+xml"===Se?dd:ud,R=gd(e,"ALLOWED_TAGS")?wd({},e.ALLOWED_TAGS,Ee):B,j=gd(e,"ALLOWED_ATTR")?wd({},e.ALLOWED_ATTR,Ee):F,ve=gd(e,"ALLOWED_NAMESPACES")?wd({},e.ALLOWED_NAMESPACES,dd):we,he=gd(e,"ADD_URI_SAFE_ATTR")?wd(xd(pe),e.ADD_URI_SAFE_ATTR,Ee):pe,de=gd(e,"ADD_DATA_URI_TAGS")?wd(xd(ce),e.ADD_DATA_URI_TAGS,Ee):ce,le=gd(e,"FORBID_CONTENTS")?wd({},e.FORBID_CONTENTS,Ee):ue,G=gd(e,"FORBID_TAGS")?wd({},e.FORBID_TAGS,Ee):xd({}),z=gd(e,"FORBID_ATTR")?wd({},e.FORBID_ATTR,Ee):xd({}),se=!!gd(e,"USE_PROFILES")&&e.USE_PROFILES,Q=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,V=!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,U=e.ALLOWED_URI_REGEXP||jd,ye=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&&(R=wd({},Od),j=[],!0===se.html&&(wd(R,Sd),wd(j,Pd)),!0===se.svg&&(wd(R,Ad),wd(j,Id),wd(j,Nd)),!0===se.svgFilters&&(wd(R,Ed),wd(j,Id),wd(j,Nd)),!0===se.mathMl&&(wd(R,kd),wd(j,Md),wd(j,Nd))),e.ADD_TAGS&&(R===B&&(R=xd(R)),wd(R,e.ADD_TAGS,Ee)),e.ADD_ATTR&&(j===F&&(j=xd(j)),wd(j,e.ADD_ATTR,Ee)),e.ADD_URI_SAFE_ATTR&&wd(he,e.ADD_URI_SAFE_ATTR,Ee),e.FORBID_CONTENTS&&(le===ue&&(le=xd(le)),wd(le,e.FORBID_CONTENTS,Ee)),oe&&(R["#text"]=!0),X&&wd(R,["html","head","body"]),R.table&&(wd(R,["tbody"]),delete G.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw yd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw yd('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(""));Ju&&Ju(e),Te=e}},Pe=wd({},[...Ad,...Ed,...Td]),Ie=wd({},[...kd,..._d]),Me=function(e){sd(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){y(e)}},Ne=function(e,t){try{sd(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){sd(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Me(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=cd(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&ye===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=C?C.createHTML(e):e;if(ye===me)try{t=(new p).parseFromString(r,Se)}catch(e){}if(!t||!t.documentElement){t=$.createDocument(ye,"template",null);try{t.documentElement.innerHTML=be?x:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),ye===me?E.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)},Ue=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)},Re=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,i){rd(e,e=>{e.call(n,t,i,Te)})}const je=function(e){let t=null;if(Be(k.beforeSanitizeElements,e,null),Ue(e))return Me(e),!0;const i=Ee(e.nodeName);if(Be(k.uponSanitizeElement,e,{tagName:i,allowedTags:R}),K&&e.hasChildNodes()&&!Re(e.firstElementChild)&&md(/<[/\w!]/g,e.innerHTML)&&md(/<[/\w!]/g,e.textContent))return Me(e),!0;if(e.nodeType===Vd)return Me(e),!0;if(K&&e.nodeType===Yd&&md(/<[/\w]/g,e.data))return Me(e),!0;if(!R[i]||G[i]){if(!G[i]&&He(i)){if(H.tagNameCheck instanceof RegExp&&md(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,b(e))}}}return Me(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:ye,tagName:"template"});const n=ud(e.tagName),i=ud(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)?(Me(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!md(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===qd&&(t=e.textContent,rd([_,O,P],e=>{t=hd(t,e," ")}),e.textContent!==t&&(sd(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(k.afterSanitizeElements,e,null),!1):(Me(e),!0)},Fe=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in ke))return!1;if(W&&!z[t]&&md(I,t));else if(Q&&md(M,t));else if(!j[t]||z[t]){if(!(He(e)&&(H.tagNameCheck instanceof RegExp&&md(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&md(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&md(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(he[t]);else if(md(U,hd(n,D,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==pd(n,"data:")||!de[e]){if(q&&!md(N,hd(n,D,"")));else if(n)return!1}else;return!0},He=function(e){return"annotation-xml"!==e&&cd(e,L)},Ge=function(e){Be(k.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Ue(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=Ee(a),d=l;let c="value"===a?d:fd(d);if(i.attrName=u,i.attrValue=c,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(k.uponSanitizeAttribute,e,i),c=i.attrValue,!re||"id"!==u&&"name"!==u||(Ne(a,e),c="user-content-"+c),K&&md(/((--!?|])>)|<\/(style|title)/i,c)){Ne(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Ne(a,e);continue}if(!V&&md(/\/>/i,c)){Ne(a,e);continue}Y&&rd([_,O,P],e=>{c=hd(c,e," ")});const h=Ee(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),Ue(e)?Me(e):ad(n.removed)}catch(t){Ne(a,e)}}else Ne(a,e)}Be(k.afterSanitizeAttributes,e,null)},ze=function e(t){let n=null;const i=Le(t);for(Be(k.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(k.uponSanitizeShadowNode,n,null),je(n),Ge(n),n.content instanceof a&&e(n.content);Be(k.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(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Re(e)){if("function"!=typeof e.toString)throw yd("toString is not a function");if("string"!=typeof(e=e.toString()))throw yd("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=Ee(e.nodeName);if(!R[t]||G[t])throw yd("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===Wd&&"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&&Me(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=T.call(r,u,!0)),u}let c=X?i.outerHTML:i.innerHTML;return X&&R["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&md(Gd,i.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+c),Y&&rd([_,O,P],e=>{c=hd(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(){Te=null,Z=!1},n.isValidAttribute=function(e,t,n){Te||Oe({});const i=Ee(e),r=Ee(t);return Fe(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&sd(k[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=od(k[e],t);return-1===n?void 0:ld(k[e],n,1)[0]}return ad(k[e])},n.removeHooks=function(e){k[e]=[]},n.removeAllHooks=function(){k={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),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 oe{constructor(){super(...arguments),this.spinSpeed=.4}updated(){this.style.setProperty("--spin-duration",`${this.spinSpeed}s`)}render(){return R`<div class="spinner"></div>`}};ec.styles=u`
|
|
6635
6635
|
.spinner {
|
|
6636
6636
|
border: 2px solid rgba(0, 0, 0, 0.2);
|
|
6637
6637
|
border-top: 2px solid #c057ff;
|
|
@@ -6649,16 +6649,16 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6649
6649
|
transform: rotate(360deg);
|
|
6650
6650
|
}
|
|
6651
6651
|
}
|
|
6652
|
-
`,
|
|
6652
|
+
`,Jd([ue({type:Number})],ec.prototype,"spinSpeed",void 0),ec=Jd([se("mini-loader")],ec);var tc=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 nc=class extends oe{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isLeadMessage=!1,this.widgetType=Fc.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=R`${n.trim().split("\n").map(e=>{const n=this.sanitizeMarkdownText(e),a=this.preserveHTMLTags(n);return a?R`${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))}),R`${Ao(Zd.sanitize(t,{ADD_ATTR:["target"]}))} `}if(i.test(e)){const t=this.removeTrailingPunctuation(e);return r.push(this.getLinkData(t)),R`<a
|
|
6653
6653
|
class="redirect-link"
|
|
6654
6654
|
href="${t}"
|
|
6655
6655
|
target="_blank"
|
|
6656
6656
|
rel="noopener noreferrer"
|
|
6657
6657
|
>${t}
|
|
6658
|
-
</a>`}return R`${Ao(
|
|
6658
|
+
</a>`}return R`${Ao(Zd.sanitize(e))} `})}<br />`:R``})}`,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=ku().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?R`<div class="message-inner-body">
|
|
6659
6659
|
${this.isMessageStillStreamingChunks()?R`<div class="message-loader"><mini-loader></mini-loader></div>`:""}
|
|
6660
6660
|
<p
|
|
6661
|
-
class=${ye({"message-text":this.widgetType!==
|
|
6661
|
+
class=${ye({"message-text":this.widgetType!==Fc.Utilities,"message-text-large":this.widgetType===Fc.Utilities,"webchat-font__desktop":!Or(),"webchat-font__mobile":Or()})}
|
|
6662
6662
|
>
|
|
6663
6663
|
${this.parsedMessage}
|
|
6664
6664
|
</p>
|
|
@@ -6689,16 +6689,16 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6689
6689
|
/>`:""}
|
|
6690
6690
|
|
|
6691
6691
|
<div class="website-preview-body">
|
|
6692
|
-
<p class=${ye({"message-text":this.widgetType!==
|
|
6692
|
+
<p class=${ye({"message-text":this.widgetType!==Fc.Utilities,"message-text-large":this.widgetType===Fc.Utilities,"website-preview-title":!0,"webchat-font__desktop":!Or(),"webchat-font__mobile":Or()})}>${e.title}</p>
|
|
6693
6693
|
${e.description?R`<p
|
|
6694
|
-
class=${ye({"message-text":this.widgetType!==
|
|
6694
|
+
class=${ye({"message-text":this.widgetType!==Fc.Utilities,"message-text-large":this.widgetType===Fc.Utilities,"website-preview-description":!0,"webchat-font__desktop":!Or(),"webchat-font__mobile":Or()})}
|
|
6695
6695
|
>
|
|
6696
6696
|
${e.description}
|
|
6697
6697
|
</p>`:""}
|
|
6698
6698
|
</div>
|
|
6699
6699
|
</div>
|
|
6700
6700
|
</a></div> `})}
|
|
6701
|
-
</div>`:R``}};
|
|
6701
|
+
</div>`:R``}};nc.styles=[Oe,qu,u`
|
|
6702
6702
|
.message-inner-body {
|
|
6703
6703
|
position: relative;
|
|
6704
6704
|
}
|
|
@@ -6707,7 +6707,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6707
6707
|
bottom: -2px;
|
|
6708
6708
|
right: -2px;
|
|
6709
6709
|
}
|
|
6710
|
-
`],
|
|
6710
|
+
`],tc([ue({attribute:!0})],nc.prototype,"buildingSlug",void 0),tc([ue({attribute:!0})],nc.prototype,"message",void 0),tc([ue({attribute:!0})],nc.prototype,"myPubnub",void 0),tc([ue({attribute:!0})],nc.prototype,"onMount",void 0),tc([de()],nc.prototype,"loadingPreviews",void 0),tc([de()],nc.prototype,"parsedMessage",void 0),tc([de()],nc.prototype,"websitePreviewInfo",void 0),tc([de()],nc.prototype,"imagesToDisplay",void 0),tc([de()],nc.prototype,"imageUrlError",void 0),tc([ue({type:Boolean})],nc.prototype,"isLeadMessage",void 0),tc([ue({attribute:!0})],nc.prototype,"widgetType",void 0),nc=tc([se("pubnub-message")],nc);var ic=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let rc=class extends oe{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?R`<div class="message-inner-body">
|
|
6711
6711
|
<div class="carousel">
|
|
6712
6712
|
<div
|
|
6713
6713
|
class="image-container"
|
|
@@ -6744,7 +6744,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6744
6744
|
rel="noopener noreferrer"
|
|
6745
6745
|
><img class=${"displayed-message-image"} src=${e.url} alt=""
|
|
6746
6746
|
/></a>`)}
|
|
6747
|
-
</div>`:R``}};
|
|
6747
|
+
</div>`:R``}};rc.styles=[Oe,qu,u`
|
|
6748
6748
|
/* This element is a flex item in a bubble capped below the chat width.
|
|
6749
6749
|
Without min-width: 0 it can grow to all slides side by side, so the
|
|
6750
6750
|
carousel spills out of the bubble and the chat. */
|
|
@@ -6821,7 +6821,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6821
6821
|
.button:hover {
|
|
6822
6822
|
background-color: rgba(0, 0, 0, 0.8);
|
|
6823
6823
|
}
|
|
6824
|
-
`],
|
|
6824
|
+
`],ic([ue({attribute:!0})],rc.prototype,"message",void 0),ic([ue({attribute:!0})],rc.prototype,"myPubnub",void 0),ic([ue({attribute:!0})],rc.prototype,"onMount",void 0),ic([de()],rc.prototype,"showMediaAsCarousel",void 0),ic([de()],rc.prototype,"activeIndex",void 0),rc=ic([se("pubnub-media")],rc);function oc(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 ac(e,t){ii(2,arguments);var n=ri(e),i=ri(t),r=oc(n,i),o=Math.abs(function(e,t){ii(2,arguments);var n=rr(e),i=rr(t),r=n.getTime()-zi(n),o=i.getTime()-zi(i);return Math.round((r-o)/864e5)}(n,i));n.setDate(n.getDate()-r*o);var a=r*(o-Number(oc(n,i)===-r));return 0===a?0:a}const sc=u`
|
|
6825
6825
|
#utilities-container {
|
|
6826
6826
|
position: fixed;
|
|
6827
6827
|
|
|
@@ -6930,17 +6930,17 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6930
6930
|
.health-bttn-allow-access {
|
|
6931
6931
|
padding-right: 28px;
|
|
6932
6932
|
}
|
|
6933
|
-
`,
|
|
6933
|
+
`,lc=(e="black")=>B`
|
|
6934
6934
|
<svg aria-hidden="true" focusable="false" width="32" height="32" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6935
6935
|
<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}"/>
|
|
6936
6936
|
<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}"/>
|
|
6937
6937
|
</svg>
|
|
6938
|
-
`,
|
|
6938
|
+
`,uc=(e="black")=>B`
|
|
6939
6939
|
<svg aria-hidden="true" focusable="false" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6940
6940
|
<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}"/>
|
|
6941
6941
|
<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}"/>
|
|
6942
6942
|
</svg>
|
|
6943
|
-
`;var
|
|
6943
|
+
`;var dc,cc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let hc=dc=class extends oe{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.widgetType=Fc.Default,this.primaryColor=Vn,this.backgroundColor=Yn,this.onClickExit=()=>{localStorage.setItem("isChatOpen","false")},this.requiresConsent=!1,this._isMobile=Or(),this.shouldAutoScroll=!0,this.messages=[],this.isLoadingMessages=!1,this.hasReceivedConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.websitePreviewMapping={},this.sendMessage=async e=>{var t;0!==e.length&&(this.shouldAutoScroll=!0,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:Uu.text}]),await(null===(t=this.myPubnub)||void 0===t?void 0:t.sendMessage(e)))},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<=dc.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=Pr(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),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;ac(new Date,new Date(r))<7&&o===Bo?this.hasReceivedConsent=!0:(this.hasReceivedConsent=!1,localStorage.removeItem(this.consentKey))}async updated(){this.scrollToChatBottom();try{const e=document.getElementById("#healthchat-container");if(!e)return;e.focus()}catch(e){}}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,y,b,v,w,C,x;if(!this.buildingSlug)return R``;const $=null===(e=this.building)||void 0===e?void 0:e.id;let S={};if(S=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===$&&(S={...S,fontFamily:'"Helvetica Neue", Arial'}),this.widgetType===Fc.Utilities)return R`
|
|
6944
6944
|
<div
|
|
6945
6945
|
id="utilities-container"
|
|
6946
6946
|
class=${ye({"pubnub-container__mobile":this._isMobile,"utilities-container__desktop":!this._isMobile})}
|
|
@@ -6995,15 +6995,15 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6995
6995
|
key=${e.timestamp}
|
|
6996
6996
|
tabindex="0"
|
|
6997
6997
|
role="article"
|
|
6998
|
-
aria-label="${e.isLeadMessage?"You":"Elise"}: ${
|
|
6998
|
+
aria-label="${e.isLeadMessage?"You":"Elise"}: ${Du(e)?e.message:"Media message"}"
|
|
6999
6999
|
>
|
|
7000
|
-
${
|
|
7000
|
+
${Lu(e)?R` <pubnub-media
|
|
7001
7001
|
.message=${e}
|
|
7002
7002
|
.myPubnub=${this.myPubnub}
|
|
7003
7003
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
7004
7004
|
>
|
|
7005
7005
|
</pubnub-media>`:""}
|
|
7006
|
-
${
|
|
7006
|
+
${Du(e)?R` <pubnub-message
|
|
7007
7007
|
.message=${e}
|
|
7008
7008
|
.myPubnub=${this.myPubnub}
|
|
7009
7009
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
@@ -7046,12 +7046,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7046
7046
|
class=${ye({"health-bttn-allow-access":this._isMobile})}
|
|
7047
7047
|
@click=${()=>this.sendMessage(this.messageInput.value)}
|
|
7048
7048
|
>
|
|
7049
|
-
${
|
|
7049
|
+
${lc("black")}
|
|
7050
7050
|
</button>
|
|
7051
7051
|
</div>
|
|
7052
7052
|
</div>
|
|
7053
7053
|
</div>
|
|
7054
|
-
`;if(this.widgetType===
|
|
7054
|
+
`;if(this.widgetType===Fc.Healthcare)return R`
|
|
7055
7055
|
<div
|
|
7056
7056
|
id="healthchat-container"
|
|
7057
7057
|
class=${ye({"pubnub-container__mobile":this._isMobile,"healthchat-container__desktop":!this._isMobile})}
|
|
@@ -7111,15 +7111,15 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7111
7111
|
key=${e.timestamp}
|
|
7112
7112
|
tabindex="0"
|
|
7113
7113
|
role="article"
|
|
7114
|
-
aria-label="${e.isLeadMessage?"You":"Elise"}: ${
|
|
7114
|
+
aria-label="${e.isLeadMessage?"You":"Elise"}: ${Du(e)?e.message:"Media message"}"
|
|
7115
7115
|
>
|
|
7116
|
-
${
|
|
7116
|
+
${Lu(e)?R` <pubnub-media
|
|
7117
7117
|
.message=${e}
|
|
7118
7118
|
.myPubnub=${this.myPubnub}
|
|
7119
7119
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
7120
7120
|
>
|
|
7121
7121
|
</pubnub-media>`:""}
|
|
7122
|
-
${
|
|
7122
|
+
${Du(e)?R` <pubnub-message
|
|
7123
7123
|
.message=${e}
|
|
7124
7124
|
.myPubnub=${this.myPubnub}
|
|
7125
7125
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
@@ -7162,7 +7162,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7162
7162
|
class=${ye({"health-bttn-allow-access":this._isMobile})}
|
|
7163
7163
|
@click=${()=>this.sendMessage(this.messageInput.value)}
|
|
7164
7164
|
>
|
|
7165
|
-
${this._isMobile?
|
|
7165
|
+
${this._isMobile?lc("black"):uc("black")}
|
|
7166
7166
|
</button>
|
|
7167
7167
|
</div>
|
|
7168
7168
|
</div>
|
|
@@ -7224,15 +7224,15 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7224
7224
|
key=${e.timestamp}
|
|
7225
7225
|
tabindex="0"
|
|
7226
7226
|
role="article"
|
|
7227
|
-
aria-label="${e.isLeadMessage?"You":"Elise"}: ${
|
|
7227
|
+
aria-label="${e.isLeadMessage?"You":"Elise"}: ${Du(e)?e.message:"Media message"}"
|
|
7228
7228
|
>
|
|
7229
|
-
${
|
|
7229
|
+
${Lu(e)?R` <pubnub-media
|
|
7230
7230
|
.message=${e}
|
|
7231
7231
|
.myPubnub=${this.myPubnub}
|
|
7232
7232
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
7233
7233
|
>
|
|
7234
7234
|
</pubnub-media>`:""}
|
|
7235
|
-
${
|
|
7235
|
+
${Du(e)?R` <pubnub-message
|
|
7236
7236
|
.message=${e}
|
|
7237
7237
|
.myPubnub=${this.myPubnub}
|
|
7238
7238
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
@@ -7275,11 +7275,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7275
7275
|
aria-label="Send message"
|
|
7276
7276
|
aria-describedby="Send message"
|
|
7277
7277
|
>
|
|
7278
|
-
${Jn(this.building.orgId,this.building.id)&&this.primaryColor!==Vn?
|
|
7278
|
+
${Jn(this.building.orgId,this.building.id)&&this.primaryColor!==Vn?uc("black"):uc("white")}
|
|
7279
7279
|
</button>
|
|
7280
7280
|
</div>
|
|
7281
7281
|
</div>
|
|
7282
|
-
`}};cc.AUTO_SCROLL_THRESHOLD_PX=32,cc.styles=[Oe,Wu,Qu,zu,ac],dc([ue({type:Number})],cc.prototype,"right",void 0),dc([ue({type:Number})],cc.prototype,"bottom",void 0),dc([ue({type:Number})],cc.prototype,"top",void 0),dc([ue({type:Number})],cc.prototype,"left",void 0),dc([ue({attribute:!0})],cc.prototype,"onMount",void 0),dc([ue({attribute:!0})],cc.prototype,"channel",void 0),dc([ue({attribute:!0})],cc.prototype,"isHealthChat",void 0),dc([ue({attribute:!0})],cc.prototype,"myPubnub",void 0),dc([ue({attribute:!0})],cc.prototype,"orgSlug",void 0),dc([ue({attribute:!0})],cc.prototype,"buildingSlug",void 0),dc([ue({attribute:!0})],cc.prototype,"widgetType",void 0),dc([ue({attribute:!0})],cc.prototype,"building",void 0),dc([ue({attribute:!0})],cc.prototype,"primaryColor",void 0),dc([ue({attribute:!0})],cc.prototype,"backgroundColor",void 0),dc([ue({attribute:!0})],cc.prototype,"onClickExit",void 0),dc([ue({attribute:!0})],cc.prototype,"requiresConsent",void 0),dc([ce("#message-input",!0)],cc.prototype,"messageInput",void 0),dc([ce("#conversation-body",!0)],cc.prototype,"messageBody",void 0),dc([de()],cc.prototype,"_isMobile",void 0),dc([de()],cc.prototype,"messages",void 0),dc([de()],cc.prototype,"isLoadingMessages",void 0),dc([de()],cc.prototype,"hasReceivedConsent",void 0),dc([de()],cc.prototype,"privacyPolicyUrl",void 0),dc([de()],cc.prototype,"websitePreviewMapping",void 0),cc=uc=dc([se("pubnub-chat")],cc);const hc="cdn.skypack.dev/@meetelise/chat",pc="cdn.eliseai.com/@meetelise/chat",fc=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(hc)||n.includes(hc))return"skypack";if(e.includes(pc)||n.includes(pc))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){}},gc=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,mc={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},yc="https://applications.eliseai.com",bc=["Check Availability","Apply Now"],vc=(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&&bc.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"),Vo({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:qo.info,buildingSlug:i,orgSlug:n}),!0},wc=(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&&vc(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)vc(s[e],t,n,i)}},Cc=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)vc(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)wc(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class xc{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Br(jr(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=bo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(Wo()).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:Br(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:Br(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));Vo({logType:qo.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=Zo(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Br(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Br(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>qr(e.timestampInitiallyLogged).getTime()-qr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Br(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:Br(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=>qr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var $c,Sc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Ac=$c=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.centralConvo=!1,this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this._isMobile=Or(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=go.always,this.bedroomPreferenceRequired=!1,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.openTourSchedulerOnLoad=!1,this.displayPubnubChat=!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=jc.Default,this.onWidgetLoaded=ql(),this.onSstClose=ql(),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=Ee(),this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{var e,t;if(!this.orgSlug)return;if(!this.centralConvo&&!this.buildingSlug)return;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 aa(n.data)}(this.orgSlug):await oa(this.orgSlug,this.buildingSlug);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{fc(this.orgSlug,this.buildingSlug)}catch(e){}await Za(n,this.buildingSlug,this.orgSlug)&&(Yo({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,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(Ha,JSON.stringify(r))})(null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.id)&&void 0!==t?t: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.updateAlreadyAutoOpenedTimestamp()):"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,y,b,v,w,C,x,$,S,A,E,T,k,_,O,P,I,M,N,D,L,U,R,B,j,F,H,G,z,Q,W,q,V,Y;const K=this.buildingWebchatView;if(!K)return;K&&this.orgSlug&&Tc(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 X=K.featureFlagWebchatMarketingSourceDropdownConfiguration,Z=K.featureFlagWebchatUseDniPhoneNumberBySource,J=K.featureFlagInsertDniIntoWebsite,ee=K.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var te;te=wo.includes(K.orgId),xo=te;const[ne,ie,re,oe]=await Promise.all([gu(this.orgSlug,this.buildingSlug),mo(this.buildingSlug),yu(this.buildingSlug),yo(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Gn(K.phoneNumber),this.buildingWebchatView.isAip=re),this.leadSources=ne,this.featureFlagShowDropdown=X,this.bedroomPreferenceRequired=oe;const ae=K.textWithUsPhoneNumber?K.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 Vo({logType:qo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t},error:t}),null}return null})(this.buildingSlug),se=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,le=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,ue={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!==(b=null===(y=this.buildingWebchatView)||void 0===y?void 0:y.shouldShowEmailDesktop)&&void 0!==b&&b,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)&&!!ae)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!ae)&&void 0!==S&&S,sstDesktop:null!==(E=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowSstDesktop)&&void 0!==E&&E,sstMobile:null!==(k=null===(T=this.buildingWebchatView)||void 0===T?void 0:T.shouldShowSstMobile)&&void 0!==k&&k,calcDesktop:se,calcMobile:le};var de,ce;this.enabledChatWidgets=eu(ue),this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(Fu(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ee&&(ce=this.handleTourClicked,document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(e=>{e&&e.addEventListener("click",e=>{e.preventDefault(),ce(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===(_=this.LeadSourceClient)||void 0===_?void 0:_.leadSource)&&(de=null!==(P=null===(O=this.LeadSourceClient)||void 0===O?void 0:O.leadSource)&&void 0!==P?P: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(de)}`)}})),this.buildingWebchatView&&(this.primaryColor=null!==(I=this.buildingWebchatView.primaryColor)&&void 0!==I?I:null,this.backgroundColor=null!==(M=this.buildingWebchatView.secondaryColor)&&void 0!==M?M:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(N=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==N?N:null,this.foregroundColorOnSecondaryBackgroundColor=null!==(D=this.buildingWebchatView.foregroundColorOnSecondaryBackgroundColor)&&void 0!==D?D:null,this.webchatConfigHasAutoOpenChat=null!==(L=this.buildingWebchatView.autoOpenChat)&&void 0!==L&&L,this.requiresConsent=null!==(U=this.buildingWebchatView.requiresConsentForChat)&&void 0!==U&&U,this.hideMobileFeatures=null!==(R=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==R&&R,this.privacyPolicyUrl=null!==(B=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==B?B:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===ta.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===ta.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===ta.EMOJI&&(this.designConcept=ta.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Vn),null===this.backgroundColor&&(this.backgroundColor=Yn);const he=null!==(F=null===(j=this.buildingWebchatView)||void 0===j?void 0:j.phoneNumber)&&void 0!==F?F:"";let pe=null;if(Z&&(pe=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:Gn(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(G=null===(H=this.LeadSourceClient)||void 0===H?void 0:H.leadSource)&&void 0!==G?G:null),pe&&!pe.isMatch&&(pe.number=he)),J&&(null==pe?void 0:pe.number)){const e=ju(pe.number,this.orgSlug,this.buildingSlug);e>0&&Yo({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const fe=localStorage.getItem("eliseai_phone_number_devtest");fe&&ju(fe,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=pe||{number:he,isMatch:!1,isPropertyWebsiteCatchall:!0};const ge=null!==(Q=null===(z=this.LeadSourceClient)||void 0===z?void 0:z.leadSource)&&void 0!==Q?Q:null;ge&&(this.leadSources.includes(ge)||this.leadSources.push(ge)),ro(K.id);if((ie||(null===(W=this.buildingWebchatView)||void 0===W?void 0:W.isAip))&&(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isLiveOnApplications)&&this.buildingSlug){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=gc(o,e);l.setAttribute("href",s),a++,Vo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:qo.info,buildingSlug:n,orgSlug:t})}}return 0===a&&Vo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:qo.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&Yo({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)try{(e=>{const t=mc[e];if(!t)return 0;const n=`${yc}/building/${t}/units`,i=`${yc}/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&&(null===(V=this.buildingWebchatView)||void 0===V?void 0:V.isLiveOnApplications)&&(null===(Y=this.buildingWebchatView)||void 0===Y?void 0:Y.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&Cc(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=Pu(this.buildingSlug),c=Iu(this.buildingSlug,d),h=c?d:Ou(this.buildingSlug,!1);if(!h.leadId)throw new Error("Lead ID is null");this.LeadSourceClient=new Jo,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new xc(this.orgSlug,this.buildingSlug),this.myPubnub=new Uu(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,h.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType);const p=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,c&&null!==(n=h.leadId)&&void 0!==n?n:void 0);p&&Ou(this.buildingSlug,h.initiatedChat,p.lead_id),this.LeadSourceClient.chatId=this.myPubnub.channel;const f=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}));f&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(f),"property-website"!==Zo(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:Zo(this.orgSlug):this.myPubnub.leadSource=null!==(u=null===(l=this.LeadSourceClient)||void 0===l?void 0:l.leadSource)&&void 0!==u?u:null;const g=Pu(this.buildingSlug);g.initiatedChat&&await this.myPubnub.initializePubnub(g)},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!zr(qr(t)));return!!e&&!!n&&!Or()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",Br(function(e,t){return ii(2,arguments),wi(e,6e4*vi(t))}(new Date,15)))},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.handleKeydownTab=e=>{var t,n,i,r,o,a,s,l;if("Tab"!==e.key)return;const u=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("meetelise-launcher"))||void 0===n?void 0:n.shadowRoot;let d=[];if(this.displayPubnubChat){const e=null===(o=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat"))||void 0===r?void 0:r.shadowRoot)||void 0===o?void 0:o.getElementById("pubnub-chat-container"),t=null===(a=this.shadowRoot)||void 0===a?void 0:a.getElementById("chatAdditionalActionsPubnub");e&&d.push(...this.collectFocusableElements(e)),t&&d.push(...this.collectFocusableElements(t))}else{const e=null!==(l=null!==(s=null==u?void 0:u.getElementById("email-us-window"))&&void 0!==s?s:null==u?void 0:u.getElementById("tour-scheduler-window"))&&void 0!==l?l:null==u?void 0:u.getElementById("call-us-window");e&&(d=this.collectFocusableElements(e))}if(0===d.length)return;e.preventDefault();const c=this.getDeepActiveElement(),h=d.findIndex(e=>e===c);d[e.shiftKey?(h-1+d.length)%d.length:(h+1)%d.length].focus()},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.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")}}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new Qo(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(),_u(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),window.addEventListener("keydown",this.handleKeydownTab),this._cleanupMobileListener=Pr(e=>{this._isMobile=e})}static isFocusable(e){return!("disabled"in e)||!e.disabled}collectFocusableElements(e){const t=[];e instanceof Element&&e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));const n=e.querySelectorAll("*");for(const e of Array.from(n))e.matches($c.FOCUSABLE_SELECTOR)&&$c.isFocusable(e)&&t.push(e),e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));return t}getDeepActiveElement(){let e=document.activeElement,t=0;for(;(null==e?void 0:e.shadowRoot)&&(null==e?void 0:e.shadowRoot.activeElement);)if(t+=1,e=null==e?void 0:e.shadowRoot.activeElement,t>100){Vo({logType:qo.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_GETTING_DEEP_ELEMENT]",logData:{message:"error getting deep active element"}});break}return e}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),window.removeEventListener("keydown",this.handleKeydownTab),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,y,b,v,w,C,x,$,S,A,E,T,k,_,O,P,I,M,N,D,L,U,B,j,F,H,G,z,Q,W,q;Xl();const V=this.hideLauncher&&!this.isLoading&&!this._isMobile;return R`
|
|
7282
|
+
`}};hc.AUTO_SCROLL_THRESHOLD_PX=32,hc.styles=[Oe,qu,Wu,Qu,sc],cc([ue({type:Number})],hc.prototype,"right",void 0),cc([ue({type:Number})],hc.prototype,"bottom",void 0),cc([ue({type:Number})],hc.prototype,"top",void 0),cc([ue({type:Number})],hc.prototype,"left",void 0),cc([ue({attribute:!0})],hc.prototype,"onMount",void 0),cc([ue({attribute:!0})],hc.prototype,"channel",void 0),cc([ue({attribute:!0})],hc.prototype,"isHealthChat",void 0),cc([ue({attribute:!0})],hc.prototype,"myPubnub",void 0),cc([ue({attribute:!0})],hc.prototype,"orgSlug",void 0),cc([ue({attribute:!0})],hc.prototype,"buildingSlug",void 0),cc([ue({attribute:!0})],hc.prototype,"widgetType",void 0),cc([ue({attribute:!0})],hc.prototype,"building",void 0),cc([ue({attribute:!0})],hc.prototype,"primaryColor",void 0),cc([ue({attribute:!0})],hc.prototype,"backgroundColor",void 0),cc([ue({attribute:!0})],hc.prototype,"onClickExit",void 0),cc([ue({attribute:!0})],hc.prototype,"requiresConsent",void 0),cc([ce("#message-input",!0)],hc.prototype,"messageInput",void 0),cc([ce("#conversation-body",!0)],hc.prototype,"messageBody",void 0),cc([de()],hc.prototype,"_isMobile",void 0),cc([de()],hc.prototype,"messages",void 0),cc([de()],hc.prototype,"isLoadingMessages",void 0),cc([de()],hc.prototype,"hasReceivedConsent",void 0),cc([de()],hc.prototype,"privacyPolicyUrl",void 0),cc([de()],hc.prototype,"websitePreviewMapping",void 0),hc=dc=cc([se("pubnub-chat")],hc);const pc="cdn.skypack.dev/@meetelise/chat",fc="cdn.eliseai.com/@meetelise/chat",gc=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(pc)||n.includes(pc))return"skypack";if(e.includes(fc)||n.includes(fc))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){}},mc=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,yc={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},bc="https://applications.eliseai.com",vc=["Check Availability","Apply Now"],wc=(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&&vc.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"),Vo({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:qo.info,buildingSlug:i,orgSlug:n}),!0},Cc=(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&&wc(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)wc(s[e],t,n,i)}},xc=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)wc(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)Cc(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class $c{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Br(jr(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=bo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(Wo()).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:Br(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:Br(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));Vo({logType:qo.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=Zo(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Br(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Br(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>qr(e.timestampInitiallyLogged).getTime()-qr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Br(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:Br(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=>qr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var Sc,Ac=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=Sc=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.centralConvo=!1,this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this._isMobile=Or(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=go.always,this.bedroomPreferenceRequired=!1,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.openTourSchedulerOnLoad=!1,this.displayPubnubChat=!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=Fc.Default,this.onWidgetLoaded=ql(),this.onSstClose=ql(),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=Ee(),this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{var e,t;if(!this.orgSlug)return;if(!this.centralConvo&&!this.buildingSlug)return;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 aa(n.data)}(this.orgSlug):await oa(this.orgSlug,this.buildingSlug);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{gc(this.orgSlug,this.buildingSlug)}catch(e){}await Za(n,this.buildingSlug,this.orgSlug)&&(Yo({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,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(Ha,JSON.stringify(r))})(null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.id)&&void 0!==t?t: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.updateAlreadyAutoOpenedTimestamp()):"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,y,b,v,w,C,x,$,S,A,E,T,k,_,O,P,I,M,N,D,L,U,R,B,j,F,H,G,z,Q,W,q,V,Y;const K=this.buildingWebchatView;if(!K)return;K&&this.orgSlug&&kc(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 X=K.featureFlagWebchatMarketingSourceDropdownConfiguration,Z=K.featureFlagWebchatUseDniPhoneNumberBySource,J=K.featureFlagInsertDniIntoWebsite,ee=K.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var te;te=wo.includes(K.orgId),xo=te;const[ne,ie,re,oe]=await Promise.all([gu(this.orgSlug,this.buildingSlug),mo(this.buildingSlug),yu(this.buildingSlug),yo(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Gn(K.phoneNumber),this.buildingWebchatView.isAip=re),this.leadSources=ne,this.featureFlagShowDropdown=X,this.bedroomPreferenceRequired=oe;const ae=K.textWithUsPhoneNumber?K.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 Vo({logType:qo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t},error:t}),null}return null})(this.buildingSlug),se=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,le=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,ue={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!==(b=null===(y=this.buildingWebchatView)||void 0===y?void 0:y.shouldShowEmailDesktop)&&void 0!==b&&b,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)&&!!ae)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!ae)&&void 0!==S&&S,sstDesktop:null!==(E=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowSstDesktop)&&void 0!==E&&E,sstMobile:null!==(k=null===(T=this.buildingWebchatView)||void 0===T?void 0:T.shouldShowSstMobile)&&void 0!==k&&k,calcDesktop:se,calcMobile:le};var de,ce;this.enabledChatWidgets=eu(ue),this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(Hu(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ee&&(ce=this.handleTourClicked,document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(e=>{e&&e.addEventListener("click",e=>{e.preventDefault(),ce(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===(_=this.LeadSourceClient)||void 0===_?void 0:_.leadSource)&&(de=null!==(P=null===(O=this.LeadSourceClient)||void 0===O?void 0:O.leadSource)&&void 0!==P?P: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(de)}`)}})),this.buildingWebchatView&&(this.primaryColor=null!==(I=this.buildingWebchatView.primaryColor)&&void 0!==I?I:null,this.backgroundColor=null!==(M=this.buildingWebchatView.secondaryColor)&&void 0!==M?M:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(N=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==N?N:null,this.foregroundColorOnSecondaryBackgroundColor=null!==(D=this.buildingWebchatView.foregroundColorOnSecondaryBackgroundColor)&&void 0!==D?D:null,this.webchatConfigHasAutoOpenChat=null!==(L=this.buildingWebchatView.autoOpenChat)&&void 0!==L&&L,this.requiresConsent=null!==(U=this.buildingWebchatView.requiresConsentForChat)&&void 0!==U&&U,this.hideMobileFeatures=null!==(R=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==R&&R,this.privacyPolicyUrl=null!==(B=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==B?B:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===ta.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===ta.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===ta.EMOJI&&(this.designConcept=ta.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Vn),null===this.backgroundColor&&(this.backgroundColor=Yn);const he=null!==(F=null===(j=this.buildingWebchatView)||void 0===j?void 0:j.phoneNumber)&&void 0!==F?F:"";let pe=null;if(Z&&(pe=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:Gn(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(G=null===(H=this.LeadSourceClient)||void 0===H?void 0:H.leadSource)&&void 0!==G?G:null),pe&&!pe.isMatch&&(pe.number=he)),J&&(null==pe?void 0:pe.number)){const e=Fu(pe.number,this.orgSlug,this.buildingSlug);e>0&&Yo({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const fe=localStorage.getItem("eliseai_phone_number_devtest");fe&&Fu(fe,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=pe||{number:he,isMatch:!1,isPropertyWebsiteCatchall:!0};const ge=null!==(Q=null===(z=this.LeadSourceClient)||void 0===z?void 0:z.leadSource)&&void 0!==Q?Q:null;ge&&(this.leadSources.includes(ge)||this.leadSources.push(ge)),ro(K.id);if((ie||(null===(W=this.buildingWebchatView)||void 0===W?void 0:W.isAip))&&(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isLiveOnApplications)&&this.buildingSlug){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=mc(o,e);l.setAttribute("href",s),a++,Vo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:qo.info,buildingSlug:n,orgSlug:t})}}return 0===a&&Vo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:qo.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&Yo({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)try{(e=>{const t=yc[e];if(!t)return 0;const n=`${bc}/building/${t}/units`,i=`${bc}/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&&(null===(V=this.buildingWebchatView)||void 0===V?void 0:V.isLiveOnApplications)&&(null===(Y=this.buildingWebchatView)||void 0===Y?void 0:Y.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&xc(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=Pu(this.buildingSlug),c=Iu(this.buildingSlug,d),h=c?d:Ou(this.buildingSlug,!1);if(!h.leadId)throw new Error("Lead ID is null");this.LeadSourceClient=new Jo,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new $c(this.orgSlug,this.buildingSlug),this.myPubnub=new Ru(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,h.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType);const p=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,c&&null!==(n=h.leadId)&&void 0!==n?n:void 0);p&&Ou(this.buildingSlug,h.initiatedChat,p.lead_id),this.LeadSourceClient.chatId=this.myPubnub.channel;const f=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}));f&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(f),"property-website"!==Zo(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:Zo(this.orgSlug):this.myPubnub.leadSource=null!==(u=null===(l=this.LeadSourceClient)||void 0===l?void 0:l.leadSource)&&void 0!==u?u:null;const g=Pu(this.buildingSlug);g.initiatedChat&&await this.myPubnub.initializePubnub(g)},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!zr(qr(t)));return!!e&&!!n&&!Or()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",Br(function(e,t){return ii(2,arguments),wi(e,6e4*vi(t))}(new Date,15)))},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.handleKeydownTab=e=>{var t,n,i,r,o,a,s,l;if("Tab"!==e.key)return;const u=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("meetelise-launcher"))||void 0===n?void 0:n.shadowRoot;let d=[];if(this.displayPubnubChat){const e=null===(o=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat"))||void 0===r?void 0:r.shadowRoot)||void 0===o?void 0:o.getElementById("pubnub-chat-container"),t=null===(a=this.shadowRoot)||void 0===a?void 0:a.getElementById("chatAdditionalActionsPubnub");e&&d.push(...this.collectFocusableElements(e)),t&&d.push(...this.collectFocusableElements(t))}else{const e=null!==(l=null!==(s=null==u?void 0:u.getElementById("email-us-window"))&&void 0!==s?s:null==u?void 0:u.getElementById("tour-scheduler-window"))&&void 0!==l?l:null==u?void 0:u.getElementById("call-us-window");e&&(d=this.collectFocusableElements(e))}if(0===d.length)return;e.preventDefault();const c=this.getDeepActiveElement(),h=d.findIndex(e=>e===c);d[e.shiftKey?(h-1+d.length)%d.length:(h+1)%d.length].focus()},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.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")}}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new Qo(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(),_u(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),window.addEventListener("keydown",this.handleKeydownTab),this._cleanupMobileListener=Pr(e=>{this._isMobile=e})}static isFocusable(e){return!("disabled"in e)||!e.disabled}collectFocusableElements(e){const t=[];e instanceof Element&&e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));const n=e.querySelectorAll("*");for(const e of Array.from(n))e.matches(Sc.FOCUSABLE_SELECTOR)&&Sc.isFocusable(e)&&t.push(e),e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));return t}getDeepActiveElement(){let e=document.activeElement,t=0;for(;(null==e?void 0:e.shadowRoot)&&(null==e?void 0:e.shadowRoot.activeElement);)if(t+=1,e=null==e?void 0:e.shadowRoot.activeElement,t>100){Vo({logType:qo.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_GETTING_DEEP_ELEMENT]",logData:{message:"error getting deep active element"}});break}return e}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),window.removeEventListener("keydown",this.handleKeydownTab),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}render(){var e,t,n,i,r,o,a,s,l,u,d,c,h,p,f,g,m,y,b,v,w,C,x,$,S,A,E,T,k,_,O,P,I,M,N,D,L,U,B,j,F,H,G,z,Q,W,q;Xl();const V=this.hideLauncher&&!this.isLoading&&!this._isMobile;return R`
|
|
7283
7283
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7284
7284
|
${this.displayPubnubChat?R`
|
|
7285
7285
|
<pubnub-chat
|
|
@@ -7288,7 +7288,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7288
7288
|
.myPubnub=${this.myPubnub}
|
|
7289
7289
|
.orgSlug=${this.orgSlug}
|
|
7290
7290
|
.buildingSlug=${this.buildingSlug}
|
|
7291
|
-
.widgetType=${
|
|
7291
|
+
.widgetType=${Fc.Default}
|
|
7292
7292
|
.building=${this.buildingWebchatView}
|
|
7293
7293
|
.primaryColor=${this.primaryColor}
|
|
7294
7294
|
.backgroundColor=${this.backgroundColor}
|
|
@@ -7395,7 +7395,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7395
7395
|
</meetelise-launcher>`:""}
|
|
7396
7396
|
</div>
|
|
7397
7397
|
</meta>
|
|
7398
|
-
`}};
|
|
7398
|
+
`}};Ec.styles=u`
|
|
7399
7399
|
:host {
|
|
7400
7400
|
all: initial;
|
|
7401
7401
|
}
|
|
@@ -7444,7 +7444,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7444
7444
|
position: fixed;
|
|
7445
7445
|
bottom: 0;
|
|
7446
7446
|
}
|
|
7447
|
-
`,
|
|
7447
|
+
`,Ec.FOCUSABLE_SELECTOR="a[href]:not([tabindex='-1']), input:not([disabled]), button:not([disabled]), textarea, [tabindex]:not([tabindex='-1'])",Ac([ue({type:String})],Ec.prototype,"buildingSlug",void 0),Ac([ue({type:String})],Ec.prototype,"orgSlug",void 0),Ac([ue({type:Boolean})],Ec.prototype,"centralConvo",void 0),Ac([ue({type:Object})],Ec.prototype,"launcherStyles",void 0),Ac([ue()],Ec.prototype,"mobileStyles",void 0),Ac([ue({type:Boolean})],Ec.prototype,"isMinimized",void 0),Ac([ue({type:String})],Ec.prototype,"primaryColor",void 0),Ac([ue({type:String})],Ec.prototype,"backgroundColor",void 0),Ac([ue({type:String})],Ec.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Ac([ue({type:String})],Ec.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Ac([de()],Ec.prototype,"_isMobile",void 0),Ac([de()],Ec.prototype,"chatId",void 0),Ac([de()],Ec.prototype,"analytics",void 0),Ac([de()],Ec.prototype,"launcher",void 0),Ac([de()],Ec.prototype,"buildingWebchatView",void 0),Ac([de()],Ec.prototype,"designConcept",void 0),Ac([de()],Ec.prototype,"leadSources",void 0),Ac([de()],Ec.prototype,"currentLeadSource",void 0),Ac([de()],Ec.prototype,"featureFlagShowDropdown",void 0),Ac([de()],Ec.prototype,"bedroomPreferenceRequired",void 0),Ac([de()],Ec.prototype,"phoneNumberForSource",void 0),Ac([de()],Ec.prototype,"hasMounted",void 0),Ac([de()],Ec.prototype,"hideLauncher",void 0),Ac([de()],Ec.prototype,"isLoading",void 0),Ac([de()],Ec.prototype,"showTourNextToChat",void 0),Ac([de()],Ec.prototype,"openTourSchedulerOnLoad",void 0),Ac([de()],Ec.prototype,"displayPubnubChat",void 0),Ac([de()],Ec.prototype,"myPubnub",void 0),Ac([de()],Ec.prototype,"LeadSourceClient",void 0),Ac([de()],Ec.prototype,"LeadSourceMultitouchClient",void 0),Ac([de()],Ec.prototype,"sampleRateToUse",void 0),Ac([ue({type:Number})],Ec.prototype,"right",void 0),Ac([ue({type:Number})],Ec.prototype,"bottom",void 0),Ac([ue({type:Number})],Ec.prototype,"top",void 0),Ac([ue({type:Number})],Ec.prototype,"left",void 0),Ac([ue({attribute:!0})],Ec.prototype,"overrideRentgrata",void 0),Ac([ue({attribute:!0})],Ec.prototype,"widgetType",void 0),Ac([ue()],Ec.prototype,"onWidgetLoaded",void 0),Ac([ue({attribute:!0})],Ec.prototype,"onSstClose",void 0),Ac([de()],Ec.prototype,"enabledChatWidgets",void 0),Ac([de()],Ec.prototype,"webchatConfigHasAutoOpenChat",void 0),Ac([de()],Ec.prototype,"requiresConsent",void 0),Ac([de()],Ec.prototype,"hideMobileFeatures",void 0),Ac([de()],Ec.prototype,"privacyPolicyUrl",void 0),Ec=Sc=Ac([se("me-chat")],Ec);const Tc=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},kc=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(fo(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 l=Tc(["myContactForm","contactus","fpa-myContactForm"]);let u;if(!(l&&l instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&_c(i,e,"Could not find form",t?{id:t.id}:void 0))}try{if(l.parentElement&&"scheduleTourForm"===l.parentElement.id)return _c(i,e,"Form is apart of schedule tour form!")}catch(e){}for(let e=0;e<l.elements.length;e++){const t=l.elements[e];if("button"===t.tagName.toLowerCase()&&"fakebutton"===t.getAttribute("data-selenium-id")){u=t;break}if("fpa-contact-submit"===t.getAttribute("id")){u=t;break}}if(!u)return _c(i,e,"Could not find submit button");const d=()=>({firstName:Tc(["firstname","txtName","fpa-firstname","Form_FirstName"]),lastName:Tc(["lastname","txtName2","fpa-lastname","Form_LastName"]),email:Tc(["email","txtEmail","fpa-email","Form_Email"]),phone:Tc(["phonenumber","txtPhone","fpa-phonenumber","Form_Phone"]),message:Tc(["message","txtComments","fpa-email","Form_Message"])});if(Object.values(d()).some(e=>null===e)){const t=Object.entries(d()).filter(([,e])=>null===e).map(([e])=>e);return _c(i,e,"Missing the following form elements: "+t.join(", "))}const c=u.textContent,h=u.cloneNode(!0);null===(a=u.parentNode)||void 0===a||a.replaceChild(h,u),h&&Yo({params:{chat_id:t,org_slug:e,building_slug:i,is_form_override_success:!0},sampleRate:n}),h.onclick=async function(t){if(Object.values(d()).forEach(e=>{"true"!==(null==e?void 0:e.getAttribute("aria-required"))||e.value||(e.className="form-control required is-invalid")}),!Object.values(d()).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(),h.textContent="Processing request...",h.disabled=!0;const n={};Object.entries(d()).forEach(([e,t])=>n[e]=null==t?void 0:t.value);const r=await oa(e,i);if(!r)return _c(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,lead_sources:[...new Set(o?[o,Zo(e)]:[Zo(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 l&&l.reset(),Object.values(d()).forEach(e=>{e&&(e.disabled=!0)}),h.textContent="Submitted",h.disabled=!0,e.json()}).catch(()=>{h.textContent=c})}},_c=(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})},Oc=u`
|
|
7448
7448
|
.chat-launcher {
|
|
7449
7449
|
position: fixed;
|
|
7450
7450
|
}
|
|
@@ -7475,7 +7475,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7475
7475
|
filter: brightness(1.1);
|
|
7476
7476
|
}
|
|
7477
7477
|
}
|
|
7478
|
-
`;var
|
|
7478
|
+
`;var Pc=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 oe{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?R`
|
|
7479
7479
|
<div
|
|
7480
7480
|
class="chat-launcher"
|
|
7481
7481
|
style=${qn({top:Or()||isNaN(this.top)?void 0:`${this.top+432}px`,bottom:Or()||isNaN(this.bottom)?"72px":this.bottom-60+"px",left:Or()||isNaN(this.left)?void 0:`${this.left}px`,right:Or()||isNaN(this.right)?"18px":`${this.right}px`})}
|
|
@@ -7529,12 +7529,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7529
7529
|
/>
|
|
7530
7530
|
</svg>
|
|
7531
7531
|
</button>
|
|
7532
|
-
</div>`}};
|
|
7532
|
+
</div>`}};Ic.styles=[Oc],Pc([ue({type:Number})],Ic.prototype,"right",void 0),Pc([ue({type:Number})],Ic.prototype,"bottom",void 0),Pc([ue({type:Number})],Ic.prototype,"top",void 0),Pc([ue({type:Number})],Ic.prototype,"left",void 0),Pc([ue({attribute:!0})],Ic.prototype,"isChatOpen",void 0),Pc([ue({attribute:!0})],Ic.prototype,"onClickCloseChat",void 0),Pc([ue({attribute:!0})],Ic.prototype,"onClickOpenChat",void 0),Ic=Pc([se("simple-launcher")],Ic);var Mc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Nc=class extends oe{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=Ee(),this.firstUpdated=async()=>{await this.initializeChatVariables()},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=Pu(this.healthcareId),t=Iu(this.healthcareId,e)?e:Ou(this.healthcareId,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Ru(this.healthcareId,null,"",this.currentLeadSource,t.leadId,null,null,Fc.Healthcare),t.initiatedChat&&await this.myPubnub.initializePubnub(e),Or()||(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(),_u(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 Xl(),this.isLoading?R``:R`
|
|
7533
7533
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
7534
7534
|
${this.displayPubnubChat?R`
|
|
7535
7535
|
<pubnub-chat
|
|
7536
7536
|
id="pubnub-chat"
|
|
7537
|
-
.widgetType=${
|
|
7537
|
+
.widgetType=${Fc.Healthcare}
|
|
7538
7538
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
7539
7539
|
.myPubnub=${this.myPubnub}
|
|
7540
7540
|
.buildingSlug=${this.healthcareId}
|
|
@@ -7560,7 +7560,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7560
7560
|
></simple-launcher>
|
|
7561
7561
|
|
|
7562
7562
|
</meta>
|
|
7563
|
-
`}};
|
|
7563
|
+
`}};Nc.styles=u`
|
|
7564
7564
|
:host {
|
|
7565
7565
|
all: initial;
|
|
7566
7566
|
}
|
|
@@ -7613,13 +7613,13 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7613
7613
|
line-height: 150%;
|
|
7614
7614
|
font-size: 16px;
|
|
7615
7615
|
}
|
|
7616
|
-
`,
|
|
7616
|
+
`,Mc([ue({type:String})],Nc.prototype,"healthcareId",void 0),Mc([ue({type:Number})],Nc.prototype,"right",void 0),Mc([ue({type:Number})],Nc.prototype,"bottom",void 0),Mc([ue({type:Number})],Nc.prototype,"top",void 0),Mc([ue({type:Number})],Nc.prototype,"left",void 0),Mc([de()],Nc.prototype,"launcher",void 0),Mc([de()],Nc.prototype,"currentLeadSource",void 0),Mc([de()],Nc.prototype,"displayPubnubChat",void 0),Mc([de()],Nc.prototype,"myPubnub",void 0),Mc([de()],Nc.prototype,"requiresConsent",void 0),Mc([de()],Nc.prototype,"privacyPolicyUrl",void 0),Mc([de()],Nc.prototype,"isLoading",void 0),Nc=Mc([se("health-chat")],Nc);var Dc=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 Lc=class extends oe{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=Ee(),this.firstUpdated=async()=>{(await async function(e){if(!e)return!1;const t="e2e-test-yardi-building";try{return(await r().get(fo(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=Pu(this.orgSlug),t=Iu(this.orgSlug,e)?e:Ou(this.orgSlug,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new Ru(this.orgSlug,null,this.orgSlug,this.currentLeadSource,t.leadId,null,null,Fc.Utilities),t.initiatedChat&&await this.myPubnub.initializePubnub(e),Or()||(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(),_u(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 Xl(),this.isLoading?R``:R`
|
|
7617
7617
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
7618
7618
|
${this.displayPubnubChat?R`
|
|
7619
7619
|
<pubnub-chat
|
|
7620
7620
|
id="pubnub-chat"
|
|
7621
7621
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
7622
|
-
.widgetType=${
|
|
7622
|
+
.widgetType=${Fc.Utilities}
|
|
7623
7623
|
.myPubnub=${this.myPubnub}
|
|
7624
7624
|
.buildingSlug=${this.orgSlug}
|
|
7625
7625
|
.onClickExit=${()=>{this.displayPubnubChat=!1}}
|
|
@@ -7643,7 +7643,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7643
7643
|
|
|
7644
7644
|
></simple-launcher>
|
|
7645
7645
|
</meta>
|
|
7646
|
-
`}};
|
|
7646
|
+
`}};Lc.styles=u`
|
|
7647
7647
|
:host {
|
|
7648
7648
|
all: initial;
|
|
7649
7649
|
}
|
|
@@ -7696,4 +7696,4 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7696
7696
|
line-height: 150%;
|
|
7697
7697
|
font-size: 16px;
|
|
7698
7698
|
}
|
|
7699
|
-
`,
|
|
7699
|
+
`,Dc([ue({type:String})],Lc.prototype,"orgSlug",void 0),Dc([ue({type:Number})],Lc.prototype,"right",void 0),Dc([ue({type:Number})],Lc.prototype,"bottom",void 0),Dc([ue({type:Number})],Lc.prototype,"top",void 0),Dc([ue({type:Number})],Lc.prototype,"left",void 0),Dc([de()],Lc.prototype,"launcher",void 0),Dc([de()],Lc.prototype,"currentLeadSource",void 0),Dc([de()],Lc.prototype,"displayPubnubChat",void 0),Dc([de()],Lc.prototype,"myPubnub",void 0),Dc([de()],Lc.prototype,"requiresConsent",void 0),Dc([de()],Lc.prototype,"privacyPolicyUrl",void 0),Dc([de()],Lc.prototype,"isLoading",void 0),Lc=Dc([se("utilities-chat")],Lc);const Uc=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&&Vo({logType:i&&i.data?qo.info:qo.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},Rc=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 Bc{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}),Hc();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),Bc.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}),Hc(),e.studio&&!e.building)return void this.handleStudioContext(e);let d=null;switch(e.widgetType){case Fc.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case Fc.Default:d=document.createElement("me-chat");break;case Fc.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||Fc.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=Kn(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 Xn(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),d instanceof Ec&&(e.centralConvo?d.setAttribute("centralConvo","true"):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 Rc("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 Ec&&(Bc.meChat=d),d instanceof Lc&&(Bc.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),Bc.meChat=null}static handleStudioContext(e){e.studio&&(this.activeStudioOptions=e)}static updateStudioContext(e){const t=this.activeStudioOptions;if(!(null==t?void 0:t.studio))return;const n=++this.studioUpdateToken;if(e.siteId&&e.siteId!==t.studio.siteId)return void Vo({logType:qo.warn,logTitle:"[STUDIO_WEBCHAT_CONTEXT_SITE_MISMATCH]",logData:{activeSiteId:t.studio.siteId,contextSiteId:e.siteId,url:window.location.href}});const i=jc(e.organization),r=jc(e.building);if(!i||!r)return void this.clearStudioContext({source:"elise_studio",reason:"missing_context",preserveCache:!0});const o=function(e,t){if(!(null==e?void 0:e.key))return`building:${t}`;return e.key}(e.sessionScope,r),a=function(e){return"Pacific Urban Residential"===e?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e}(i);this.activeStudioOrgSlug===a&&this.activeStudioBuildingSlug===r&&this.activeStudioSessionScopeKey===o||this.removeWidget().then(()=>{n===this.studioUpdateToken&&(this.activeStudioOrgSlug=a,this.activeStudioBuildingSlug=r,this.activeStudioSessionScopeKey=o,this.orgSlug=a,this.start({...t,organization:i,building:r},!1))})}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 Uc(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,Uc(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&&Vo({logType:n&&n.data?qo.info:qo.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&&Vo({logType:i&&i.data===e?qo.info:qo.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 jc(e){return"string"!=typeof e?"":e.trim()}var Fc;Bc.meChat=null,Bc.healthChat=null,Bc.utilitiesChat=null,Bc.orgSlug="",Bc.mutationObserver=null,Bc.previousUrl="",Bc.hasBuildingSlug=null,Bc.brandColor="",Bc.backgroundColor="",Bc.healthcareId="",Bc.activeStudioOrgSlug="",Bc.activeStudioBuildingSlug="",Bc.activeStudioSessionScopeKey="",Bc.activeStudioOptions=null,Bc.studioUpdateToken=0,Bc.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(Fc||(Fc={}));const Hc=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{Fc as WidgetType,Bc as default};
|
package/src/MyPubnub.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { ChatStorageKey, createChatStorageKey } from "./handleChatId";
|
|
|
7
7
|
import LeadSourceClient from "./WebComponent/LeadSourceClient";
|
|
8
8
|
import { pushGtmEvent } from "./gtm";
|
|
9
9
|
import { isContainingEmail, snakify } from "./utils";
|
|
10
|
+
import { shouldCreateAsDevState } from "./shouldCreateAsDevState";
|
|
10
11
|
import { WidgetType } from "./main/MEChat";
|
|
11
12
|
import { BuildingWebchatView } from "./fetchBuildingWebchatView";
|
|
12
13
|
import { LeadSourceMultitouchClient } from "./WebComponent/LeadSourceMultitouchClient";
|
|
@@ -711,7 +712,7 @@ class MyPubnub {
|
|
|
711
712
|
text: message,
|
|
712
713
|
customType: "lead_message",
|
|
713
714
|
widgetType: this.widgetType,
|
|
714
|
-
isDevState:
|
|
715
|
+
isDevState: shouldCreateAsDevState(location.href),
|
|
715
716
|
orgSlug: this.orgSlug,
|
|
716
717
|
},
|
|
717
718
|
});
|
|
@@ -726,7 +727,7 @@ class MyPubnub {
|
|
|
726
727
|
userId: this.buildingWebchatView?.userId, // this userid is actually the AI user!
|
|
727
728
|
leadSource: this.leadSource,
|
|
728
729
|
widgetType: this.widgetType,
|
|
729
|
-
isDevState:
|
|
730
|
+
isDevState: shouldCreateAsDevState(location.href),
|
|
730
731
|
lead_sources_with_timestamps: (
|
|
731
732
|
this.leadSourceMultitouchClient?.getSafeLeadSourceTouchpointsWithDefault(
|
|
732
733
|
{ includedUserSelectedLeadSource: null }
|
|
@@ -763,12 +764,6 @@ class MyPubnub {
|
|
|
763
764
|
if (this.isLoadingMessages === false) this.isLoadingMessages = true;
|
|
764
765
|
}
|
|
765
766
|
};
|
|
766
|
-
private shouldCreateAsDevState(): boolean {
|
|
767
|
-
return (
|
|
768
|
-
location.href.startsWith("https://app.meetelise.com/settings/widgets") ||
|
|
769
|
-
location.href.includes("demo/utilities")
|
|
770
|
-
);
|
|
771
|
-
}
|
|
772
767
|
|
|
773
768
|
isLeadMessage = (message: RawPubnubMessage): boolean =>
|
|
774
769
|
message.publisher.includes("lead_") &&
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { expect } from "@esm-bundle/chai";
|
|
2
|
+
import { shouldCreateAsDevState } from "./shouldCreateAsDevState";
|
|
3
|
+
|
|
4
|
+
describe("webchat demo state", () => {
|
|
5
|
+
for (const href of [
|
|
6
|
+
"https://app.meetelise.com/settings/marketing/webchat",
|
|
7
|
+
"https://app.meetelise.com/settings/marketing/webchat?buildingId=b_67771",
|
|
8
|
+
"https://app.meetelise.com/settings/widgets?buildingId=67771",
|
|
9
|
+
"https://app.meetelise.com/demo/utilities/test-org",
|
|
10
|
+
]) {
|
|
11
|
+
it(`marks messages from ${href} as test conversations`, () => {
|
|
12
|
+
expect(shouldCreateAsDevState(href)).to.equal(true);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
for (const href of [
|
|
17
|
+
"https://www.example-apartments.com/",
|
|
18
|
+
"https://app.meetelise.com/",
|
|
19
|
+
"https://www.example-apartments.com/settings/marketing/webchat",
|
|
20
|
+
"https://www.example-apartments.com/?ref=https://app.meetelise.com/settings/marketing/webchat",
|
|
21
|
+
]) {
|
|
22
|
+
it(`keeps messages from ${href} as live conversations`, () => {
|
|
23
|
+
expect(shouldCreateAsDevState(href)).to.equal(false);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|