@meetelise/chat 1.55.2 → 1.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/MyPubnub.d.ts +38 -3
- package/dist/src/WebComponent/me-chat.d.ts +33 -0
- package/dist/src/WebComponent/pubnub-chat.d.ts +3 -0
- package/dist/src/WebComponent/pubnub-navigation.d.ts +17 -0
- package/dist/src/webchatNavigation.d.ts +38 -0
- package/package.json +1 -1
- package/public/dist/index.js +84 -46
- package/src/MyPubnub.ts +87 -5
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +5 -1
- package/src/WebComponent/me-chat.ts +158 -26
- package/src/WebComponent/pubnub-chat.ts +36 -10
- package/src/WebComponent/pubnub-navigation.ts +73 -0
- package/src/feeCalculatorLeaseTerm.test.ts +71 -0
- package/src/main/MEChat.ts +9 -1
- package/src/orgLevelNavigation.test.ts +625 -0
- package/src/services/fees/buildBuildingUnitsQuery.ts +4 -1
- package/src/services/fees/calculateQuote.ts +1 -1
- package/src/services/fees/fetchBuildingUnits.test.ts +20 -0
- package/src/webchatNavigation.test.ts +99 -0
- package/src/webchatNavigation.ts +108 -0
package/public/dist/index.js
CHANGED
|
@@ -4047,10 +4047,10 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4047
4047
|
margin: 2px 0;
|
|
4048
4048
|
}
|
|
4049
4049
|
}
|
|
4050
|
-
`;class $s{constructor(e={}){var t,n,i,r,o,a;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(n=e.description)&&void 0!==n?n:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(a=e.available)&&void 0!==a&&a,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class Ss{constructor(e={}){var t,n,i,r,o;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(n=e.type)&&void 0!==n?n:"",this.minAvailableItem=e.minAvailableItem?new $s(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new $s(e.maxAvailableItem):void 0,this.allItems=(null!==(i=e.allItems)&&void 0!==i?i:[]).map(e=>new $s(e)),this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.priceDescription=null!==(o=e.priceDescription)&&void 0!==o?o:""}get displayName(){return this.description}get itemDescription(){return this.description}}var As,ks;!function(e){e.NEVER="NEVER",e.AS_NEEDED="AS_NEEDED",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(As||(As={})),function(e){e.Rent="Rent",e.Utility="Utility",e.ApplicationFee="ApplicationFee",e.Parking="Parking",e.Insurance="Insurance",e.Storage="Storage",e.PetFee="PetFee",e.PetRent="PetRent",e.PetDeposit="PetDeposit",e.SecurityDeposit="SecurityDeposit",e.MoveInFee="MoveInFee",e.Other="Other"}(ks||(ks={}));class Es{constructor(e={}){var t,n,i,r,o,a,s,l,u,d;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.building_id=e.building_id,this.fee_name=null!==(n=e.fee_name)&&void 0!==n?n:"",this.amount=e.amount,this.amount_display=null!==(i=e.amount_display)&&void 0!==i?i:"",this.limit=null!==(r=e.limit)&&void 0!==r?r:null,this.min_estimate=e.min_estimate,this.max_estimate=e.max_estimate,this.percent_rent=e.percent_rent,this.percent_rent_min=e.percent_rent_min,this.percent_rent_max=e.percent_rent_max,this.frequency=null!==(o=e.frequency)&&void 0!==o?o:As.ONE_TIME,this.category=null!==(a=e.category)&&void 0!==a?a:ks.Other,this.description=e.description,this.additional_info=e.additional_info,this.refundable=null!==(s=e.refundable)&&void 0!==s&&s,this.hidden_reason=e.hidden_reason,this.unit_ids=e.unit_ids,this.layout_ids=e.layout_ids,this.public_facing=null===(l=e.public_facing)||void 0===l||l,this.per_applicant=null!==(u=e.per_applicant)&&void 0!==u&&u,this.required_for_quotes=null!==(d=e.required_for_quotes)&&void 0!==d&&d,this.charge_code=e.charge_code,this.bundle_key=e.bundle_key,this.external_key=e.external_key}get displayFrequency(){return this.frequency.replace(/_/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}get isOptional(){return!this.required_for_quotes}}const Ts=class{constructor(){this.params=new URLSearchParams}addSingle(e,t){return t?(this.params.append(e,t),this):this}addArray(e,t){return t?(t.forEach(t=>{t&&this.params.append(`${e}[]`,t)}),this):this}build(){return this.params.toString()?`?${this.params.toString()}`:""}},_s=Va,Os=e=>new Es(e),Ps=e=>new Ss(e),Is=async(e,t)=>{try{const n=(new Ts).addArray("layout_ids",null==t?void 0:t.map(e=>e.toString())),i=await r().get(`${_s}/platformApi/webchat/${e}/marketable-fees?${n.build()}`);if(i.data){const e=Sr(i.data);return{fees:e.fees.map(Os),rentableItems:e.rentableItems.map(Ps),buildingIncentives:e.buildingIncentives}}}catch(t){Jo({logType:Zo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t},error:t})}return{fees:[],rentableItems:[],buildingIncentives:[]}},Ns=-1,Ms=Va,Ds=async({buildingSlug:e,unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a},s)=>{try{const l=await r().post(`${Ms}/platformApi/webchat/${e}/quote/calculate`,Ar({unitId:t,chargeInputs:n,rentableItems:i
|
|
4050
|
+
`;class $s{constructor(e={}){var t,n,i,r,o,a;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(n=e.description)&&void 0!==n?n:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(a=e.available)&&void 0!==a&&a,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class Ss{constructor(e={}){var t,n,i,r,o;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(n=e.type)&&void 0!==n?n:"",this.minAvailableItem=e.minAvailableItem?new $s(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new $s(e.maxAvailableItem):void 0,this.allItems=(null!==(i=e.allItems)&&void 0!==i?i:[]).map(e=>new $s(e)),this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.priceDescription=null!==(o=e.priceDescription)&&void 0!==o?o:""}get displayName(){return this.description}get itemDescription(){return this.description}}var As,ks;!function(e){e.NEVER="NEVER",e.AS_NEEDED="AS_NEEDED",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(As||(As={})),function(e){e.Rent="Rent",e.Utility="Utility",e.ApplicationFee="ApplicationFee",e.Parking="Parking",e.Insurance="Insurance",e.Storage="Storage",e.PetFee="PetFee",e.PetRent="PetRent",e.PetDeposit="PetDeposit",e.SecurityDeposit="SecurityDeposit",e.MoveInFee="MoveInFee",e.Other="Other"}(ks||(ks={}));class Es{constructor(e={}){var t,n,i,r,o,a,s,l,u,d;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.building_id=e.building_id,this.fee_name=null!==(n=e.fee_name)&&void 0!==n?n:"",this.amount=e.amount,this.amount_display=null!==(i=e.amount_display)&&void 0!==i?i:"",this.limit=null!==(r=e.limit)&&void 0!==r?r:null,this.min_estimate=e.min_estimate,this.max_estimate=e.max_estimate,this.percent_rent=e.percent_rent,this.percent_rent_min=e.percent_rent_min,this.percent_rent_max=e.percent_rent_max,this.frequency=null!==(o=e.frequency)&&void 0!==o?o:As.ONE_TIME,this.category=null!==(a=e.category)&&void 0!==a?a:ks.Other,this.description=e.description,this.additional_info=e.additional_info,this.refundable=null!==(s=e.refundable)&&void 0!==s&&s,this.hidden_reason=e.hidden_reason,this.unit_ids=e.unit_ids,this.layout_ids=e.layout_ids,this.public_facing=null===(l=e.public_facing)||void 0===l||l,this.per_applicant=null!==(u=e.per_applicant)&&void 0!==u&&u,this.required_for_quotes=null!==(d=e.required_for_quotes)&&void 0!==d&&d,this.charge_code=e.charge_code,this.bundle_key=e.bundle_key,this.external_key=e.external_key}get displayFrequency(){return this.frequency.replace(/_/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}get isOptional(){return!this.required_for_quotes}}const Ts=class{constructor(){this.params=new URLSearchParams}addSingle(e,t){return t?(this.params.append(e,t),this):this}addArray(e,t){return t?(t.forEach(t=>{t&&this.params.append(`${e}[]`,t)}),this):this}build(){return this.params.toString()?`?${this.params.toString()}`:""}},_s=Va,Os=e=>new Es(e),Ps=e=>new Ss(e),Is=async(e,t)=>{try{const n=(new Ts).addArray("layout_ids",null==t?void 0:t.map(e=>e.toString())),i=await r().get(`${_s}/platformApi/webchat/${e}/marketable-fees?${n.build()}`);if(i.data){const e=Sr(i.data);return{fees:e.fees.map(Os),rentableItems:e.rentableItems.map(Ps),buildingIncentives:e.buildingIncentives}}}catch(t){Jo({logType:Zo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t},error:t})}return{fees:[],rentableItems:[],buildingIncentives:[]}},Ns=-1,Ms=Va,Ds=async({buildingSlug:e,unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a},s)=>{try{const l=await r().post(`${Ms}/platformApi/webchat/${e}/quote/calculate`,Ar({unitId:t,chargeInputs:n,rentableItems:i,...Number.isFinite(o)?{leaseTerm:o}:{},moveInDate:a}),{signal:s});if(l.data){return Sr(l.data)}}catch(t){const n=t;"ERR_CANCELED"!==n.code&&Jo({logType:Zo.error,buildingSlug:e,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:t},error:t});const i=(e=>{var t,n,i;const r=null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.detail;if(422!==(null===(i=e.response)||void 0===i?void 0:i.status)||!Array.isArray(r))return null;const o=r.map(e=>Sr(e));return o.length>0&&o.every(e=>"number"==typeof e.limit)?o:null})(n);return{quote:null,error:i?{type:"feeLimit",violations:i}:{type:"unknown"}}}return{quote:null,error:{type:"unknown"}}},Ls=(e="black")=>B`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
|
|
4051
4051
|
<line x1="1.70782" y1="13.2254" x2="13.2376" y2="1.69554" stroke="${e}" stroke-width="2.13401"/>
|
|
4052
4052
|
<path d="M2.00929 1.99996L13.3328 13.3421" stroke="${e}" stroke-width="2.13401"/>
|
|
4053
|
-
</svg>`;function Rs(e){return Ji(e,"yyyy-MM-dd")}function Us(){return Rs(Ur())}const Bs=Va,js=async({buildingSlug:e,numBedrooms:t,moveInDateString:n,leaseTerm:i})=>{try{const a=(({numBedrooms:e,moveInDateString:t,leaseTerm:n})=>{const i=new Ts;return i.addArray("num_bedrooms",null==e?void 0:e.map(e=>e.toString())).addSingle("move_in_date_earliest",t).addSingle("move_in_date_latest",t).addSingle("lease_term_min",null==n?void 0:n.toString()),i.build()})({numBedrooms:t,moveInDateString:n,leaseTerm:i}),s=await r().get(`${Bs}/platformApi/webchat/${e}/units${a}`);if(s.data){const e=Sr(s.data);return o=e.map(e=>({...e,id:parseInt(e.id.toString().substring(1))})),[...o].sort((e,t)=>e.startingPrice-t.startingPrice||e.id-t.id)}}catch(r){Jo({logType:Zo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS]",logData:{error:r,params:{numBedrooms:t,moveInDateString:n,leaseTerm:i}},error:r})}var o;return[]},Fs=[ks.PetFee,ks.PetRent,ks.PetDeposit];function Hs(e){return`Up to ${e} ${1===e?"pet":"pets"} allowed`}const Gs=({color:e="#347FF7",size:t=24}={})=>B`
|
|
4053
|
+
</svg>`;function Rs(e){return Ji(e,"yyyy-MM-dd")}function Us(){return Rs(Ur())}const Bs=Va,js=async({buildingSlug:e,numBedrooms:t,moveInDateString:n,leaseTerm:i})=>{try{const a=(({numBedrooms:e,moveInDateString:t,leaseTerm:n})=>{const i=new Ts;return i.addArray("num_bedrooms",null==e?void 0:e.map(e=>e.toString())).addSingle("move_in_date_earliest",t).addSingle("move_in_date_latest",t).addSingle("lease_term_min",Number.isFinite(n)?null==n?void 0:n.toString():void 0),i.build()})({numBedrooms:t,moveInDateString:n,leaseTerm:i}),s=await r().get(`${Bs}/platformApi/webchat/${e}/units${a}`);if(s.data){const e=Sr(s.data);return o=e.map(e=>({...e,id:parseInt(e.id.toString().substring(1))})),[...o].sort((e,t)=>e.startingPrice-t.startingPrice||e.id-t.id)}}catch(r){Jo({logType:Zo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS]",logData:{error:r,params:{numBedrooms:t,moveInDateString:n,leaseTerm:i}},error:r})}var o;return[]},Fs=[ks.PetFee,ks.PetRent,ks.PetDeposit];function Hs(e){return`Up to ${e} ${1===e?"pet":"pets"} allowed`}const Gs=({color:e="#347FF7",size:t=24}={})=>B`
|
|
4054
4054
|
<svg aria-hidden="true" focusable="false" width="${t}" height="${t}" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4055
4055
|
<g id="Frame" clip-path="url(#clip0_18718_332018)">
|
|
4056
4056
|
<path id="Vector" d="M3 12.5C3 13.6819 3.23279 14.8522 3.68508 15.9442C4.13738 17.0361 4.80031 18.0282 5.63604 18.864C6.47177 19.6997 7.46392 20.3626 8.55585 20.8149C9.64778 21.2672 10.8181 21.5 12 21.5C13.1819 21.5 14.3522 21.2672 15.4442 20.8149C16.5361 20.3626 17.5282 19.6997 18.364 18.864C19.1997 18.0282 19.8626 17.0361 20.3149 15.9442C20.7672 14.8522 21 13.6819 21 12.5C21 11.3181 20.7672 10.1478 20.3149 9.05585C19.8626 7.96392 19.1997 6.97177 18.364 6.13604C17.5282 5.30031 16.5361 4.63738 15.4442 4.18508C14.3522 3.73279 13.1819 3.5 12 3.5C10.8181 3.5 9.64778 3.73279 8.55585 4.18508C7.46392 4.63738 6.47177 5.30031 5.63604 6.13604C4.80031 6.97177 4.13738 7.96392 3.68508 9.05585C3.23279 10.1478 3 11.3181 3 12.5Z" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -4413,7 +4413,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
4413
4413
|
</p>
|
|
4414
4414
|
</div>
|
|
4415
4415
|
</div>
|
|
4416
|
-
`}};Ks.styles=Vs,Ys([ue({type:Object})],Ks.prototype,"unit",void 0),Ys([ue()],Ks.prototype,"onUnitSelect",void 0),Ys([ue({type:Boolean})],Ks.prototype,"selected",void 0),Ks=Ys([se("floorplan-image-card")],Ks);var Xs=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 Zs=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.layoutOptions=[],this.selectedLayoutIds=[Ns],this.units=[],this.isLoading=!1,this.isLoadingLayouts=!1,this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.moveInDate=Ur(),this.leaseTerm=12,this.selectedUnit=null,this.handleUnitSelect=e=>{var t;this.selectedUnit=e,null===(t=this.onUnitSelect)||void 0===t||t.call(this,e)},this.handleLayoutChange=e=>{var t;let n;e===Ns?n=[Ns]:this.selectedLayoutIds.includes(Ns)?n=[e]:this.selectedLayoutIds.includes(e)?(n=this.selectedLayoutIds.filter(t=>t!==e),0===n.length&&(n=[Ns])):n=[...this.selectedLayoutIds,e],this.selectedLayoutIds=n,null===(t=this.onSelectLayout)||void 0===t||t.call(this,this.selectedLayoutIds)},this.handleMoveInDateChange=e=>{var t;const n=e.target.value,i=Ur();if(n){const[e,t,r]=n.split("-").map(Number),o=new Date(e,t-1,r);if($r(o,i))return;this.moveInDate=o}else this.moveInDate=i;null===(t=this.onMoveInDateChange)||void 0===t||t.call(this,n||Rs(i))},this.handleLeaseTermChange=e=>{var t;
|
|
4416
|
+
`}};Ks.styles=Vs,Ys([ue({type:Object})],Ks.prototype,"unit",void 0),Ys([ue()],Ks.prototype,"onUnitSelect",void 0),Ys([ue({type:Boolean})],Ks.prototype,"selected",void 0),Ks=Ys([se("floorplan-image-card")],Ks);var Xs=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 Zs=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.layoutOptions=[],this.selectedLayoutIds=[Ns],this.units=[],this.isLoading=!1,this.isLoadingLayouts=!1,this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.moveInDate=Ur(),this.leaseTerm=12,this.selectedUnit=null,this.handleUnitSelect=e=>{var t;this.selectedUnit=e,null===(t=this.onUnitSelect)||void 0===t||t.call(this,e)},this.handleLayoutChange=e=>{var t;let n;e===Ns?n=[Ns]:this.selectedLayoutIds.includes(Ns)?n=[e]:this.selectedLayoutIds.includes(e)?(n=this.selectedLayoutIds.filter(t=>t!==e),0===n.length&&(n=[Ns])):n=[...this.selectedLayoutIds,e],this.selectedLayoutIds=n,null===(t=this.onSelectLayout)||void 0===t||t.call(this,this.selectedLayoutIds)},this.handleMoveInDateChange=e=>{var t;const n=e.target.value,i=Ur();if(n){const[e,t,r]=n.split("-").map(Number),o=new Date(e,t-1,r);if($r(o,i))return;this.moveInDate=o}else this.moveInDate=i;null===(t=this.onMoveInDateChange)||void 0===t||t.call(this,n||Rs(i))},this.handleLeaseTermChange=e=>{var t;const n=parseInt(e.target.value);!Number.isInteger(n)||n<=0||(this.leaseTerm=n,null===(t=this.onLeaseTermChange)||void 0===t||t.call(this,this.leaseTerm))},this.renderUnitSelection=()=>{var e,t;return this.isLoading?U`
|
|
4417
4417
|
<div class="unit-selection">
|
|
4418
4418
|
<div class="image-carousel">
|
|
4419
4419
|
${Array.from({length:3},()=>U`<div class="unit-card-skeleton shimmer"></div>`)}
|
|
@@ -6431,7 +6431,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6431
6431
|
${os}
|
|
6432
6432
|
${as}
|
|
6433
6433
|
${ss}
|
|
6434
|
-
`,au([ue({attribute:!0})],su.prototype,"isMinimized",void 0),au([ue()],su.prototype,"mobileStyles",void 0),au([ue({type:Boolean})],su.prototype,"isFirstMount",void 0),au([ue({attribute:!1})],su.prototype,"openSSTWindowOnLoad",void 0),au([ue({attribute:!1})],su.prototype,"autoOpenChatWidget",void 0),au([ue()],su.prototype,"phoneNumber",void 0),au([ue({attribute:!0})],su.prototype,"buildingName",void 0),au([ue({attribute:!0})],su.prototype,"chatId",void 0),au([ue({attribute:!0})],su.prototype,"orgLegalName",void 0),au([ue({attribute:!1})],su.prototype,"country",void 0),au([ue({attribute:!1})],su.prototype,"buildingState",void 0),au([ue({attribute:!0})],su.prototype,"chatCallUsHeader",void 0),au([ue({attribute:!1})],su.prototype,"buildingId",void 0),au([ue({type:Number})],su.prototype,"orgId",void 0),au([ue({attribute:!1})],su.prototype,"leadSourceParams",void 0),au([ue({attribute:!0})],su.prototype,"buildingSlug",void 0),au([ue({attribute:!0})],su.prototype,"orgSlug",void 0),au([ue({attribute:!0})],su.prototype,"sgtUrl",void 0),au([ue({attribute:!0})],su.prototype,"selfGuidedTourEnabled",void 0),au([ue({attribute:!0})],su.prototype,"selfGuidedToursTypeOffered",void 0),au([ue({attribute:!0})],su.prototype,"designConcept",void 0),au([ue({attribute:!0})],su.prototype,"featureFlagShowDropdown",void 0),au([ue({attribute:!1})],su.prototype,"leadSources",void 0),au([ue({attribute:!0})],su.prototype,"currentLeadSource",void 0),au([ue({attribute:!0})],su.prototype,"escortedToursLink",void 0),au([ue({attribute:!0})],su.prototype,"escortedToursTypeOffered",void 0),au([ue({attribute:!0})],su.prototype,"virtualToursLink",void 0),au([ue({attribute:!0})],su.prototype,"virtualToursTypeOffered",void 0),au([ue({type:Boolean})],su.prototype,"hasChatEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasChatEnabledMobile",void 0),au([ue({type:Boolean})],su.prototype,"hasEmailEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasEmailEnabledMobile",void 0),au([ue({attribute:!0})],su.prototype,"hasApplyNowEnabledDesktop",void 0),au([ue({attribute:!0})],su.prototype,"hasApplyNowEnabledMobile",void 0),au([ue({attribute:!0})],su.prototype,"applicationLink",void 0),au([ue({type:Boolean})],su.prototype,"hasCallUsEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasCallUsEnabledMobile",void 0),au([ue({type:Boolean})],su.prototype,"hasTextUsEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasTextUsEnabledMobile",void 0),au([ue({type:Boolean})],su.prototype,"hasSSTEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasSSTEnabledMobile",void 0),au([ue({attribute:!1})],su.prototype,"tourTypeOptions",void 0),au([ue({attribute:!1})],su.prototype,"layoutOptions",void 0),au([ue({attribute:!0})],su.prototype,"bedroomPreferenceRequired",void 0),au([ue({attribute:!1})],su.prototype,"brokerIntakeEnabled",void 0),au([ue({attribute:!0})],su.prototype,"hasDynamicSchedulingEnabled",void 0),au([ue({attribute:!0})],su.prototype,"hasPricingCalculatorEnabledDesktop",void 0),au([ue({attribute:!0})],su.prototype,"hasPricingCalculatorEnabledMobile",void 0),au([ue({attribute:!1})],su.prototype,"hasHideMobileFeatures",void 0),au([ue({type:Number})],su.prototype,"right",void 0),au([ue({type:Number})],su.prototype,"bottom",void 0),au([ue({type:Number})],su.prototype,"top",void 0),au([ue({type:Number})],su.prototype,"left",void 0),au([ue({attribute:!0})],su.prototype,"showTourNextToChat",void 0),au([ue({attribute:!1})],su.prototype,"onChatTapped",void 0),au([ue({attribute:!0})],su.prototype,"onClickMinimize",void 0),au([ue({attribute:!0})],su.prototype,"onSstClose",void 0),au([ue({attribute:!0})],su.prototype,"overrideRentgrata",void 0),au([ue({attribute:!1})],su.prototype,"launcherStyles",void 0),au([ue({attribute:!0})],su.prototype,"primaryColor",void 0),au([ue({attribute:!0})],su.prototype,"backgroundColor",void 0),au([ue({attribute:!0})],su.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),au([ue({attribute:!0})],su.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),au([ue({attribute:!0})],su.prototype,"leadSourceClient",void 0),au([de()],su.prototype,"leadSourceMultitouchClient",void 0),au([de()],su.prototype,"_isMobile",void 0),au([de()],su.prototype,"isEmailWindowOpen",void 0),au([de()],su.prototype,"isCallUsWindowOpen",void 0),au([de()],su.prototype,"isSSTWindowOpen",void 0),au([de()],su.prototype,"isTextUsWindowOpen",void 0),au([de()],su.prototype,"isCalculatorWindowOpen",void 0),au([de()],su.prototype,"isMobileFeaturesExpanded",void 0),su=au([se("meetelise-launcher")],su);const lu=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",su)},uu=["app.meetelise.com","staging.eliseai.com","localhost"],du={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"}},cu=e=>{const t=window.location.hostname;if(!uu.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 du&&(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=du[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var hu=n(5072),pu=n.n(hu),fu=n(7825),gu=n.n(fu),mu=n(7659),bu=n.n(mu),yu=n(5056),vu=n.n(yu),wu=n(540),Cu=n.n(wu),xu=n(1113),$u=n.n(xu),Su=n(5541),Au={};Au.styleTagTransform=$u(),Au.setAttributes=vu(),Au.insert=bu().bind(null,"head"),Au.domAPI=gu(),Au.insertStyleElement=Cu();pu()(Su.A,Au);Su.A&&Su.A.locals&&Su.A.locals;async function ku(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 Eu(n.data,t)}return[]}catch(e){return[]}}const Eu=(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 Tu(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 _u,Ou=n(8805),Pu=n.n(Ou),Iu=new Uint8Array(16);function Nu(){if(!_u&&!(_u="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 _u(Iu)}const Mu=/^(?:[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 Du=function(e){return"string"==typeof e&&Mu.test(e)};for(var Lu=[],Ru=0;Ru<256;++Ru)Lu.push((Ru+256).toString(16).substr(1));const Uu=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Lu[e[t+0]]+Lu[e[t+1]]+Lu[e[t+2]]+Lu[e[t+3]]+"-"+Lu[e[t+4]]+Lu[e[t+5]]+"-"+Lu[e[t+6]]+Lu[e[t+7]]+"-"+Lu[e[t+8]]+Lu[e[t+9]]+"-"+Lu[e[t+10]]+Lu[e[t+11]]+Lu[e[t+12]]+Lu[e[t+13]]+Lu[e[t+14]]+Lu[e[t+15]]).toLowerCase();if(!Du(n))throw TypeError("Stringified UUID is invalid");return n};const Bu=function(e,t,n){var i=(e=e||{}).random||(e.rng||Nu)();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 Uu(i)},ju=e=>localStorage.removeItem("com.elise.webchat.slug="+e),Fu=(e,t,n)=>{const i=Rr(new Date),r=n||`lead_${Bu()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Wr(i),buildingSlug:e,initiatedChat:t}},Hu=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(Gu(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},Gu=(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)&&!Or(t.timestamp,24)},zu=e=>e.startsWith("https://app.meetelise.com/settings/widgets")||e.startsWith("https://app.meetelise.com/settings/marketing/webchat")||e.includes("demo/utilities");var Qu;!function(e){e.noReply="no-reply",e.text="text",e.media="media"}(Qu||(Qu={}));const Wu=e=>e.type===Vu.text,qu=e=>e.type===Vu.media;var Vu;!function(e){e.text="text",e.media="media"}(Vu||(Vu={}));const Yu=class{constructor(e,t,n,i=null,r,o,a=null,s=Zc.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=Zc.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!==Qu.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(()=>{Jo({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:Zo.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),So("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;So("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)===Qu.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&&Jo({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:Zo.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=Fu(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&&Jo({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:Zo.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===Zc.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:zu(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:zu(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=>Ar({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||(So("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),So("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)?(Jo({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:Zo.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:Vu.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:Vu.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:Vu.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&&Jo({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:Zo.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(Pu())({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&&Jo({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:Zo.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&&Jo({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:Zo.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&&Jo({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:Zo.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!==Qu.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&&Jo({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:Zo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}},Ku=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"]),Xu=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return Ku.has(t)},Zu=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\([2-9]\d{2}\)[\s.-]?|[2-9]\d{2}[\s.-])[2-9]\d{2}[\s.-]?\d{4}/g,d=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,c=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},b=document.body.getElementsByTagName("*");let y=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<b.length;e++)if(b[e].nodeType===Node.ELEMENT_NODE&&!m(b[e])){if(1===b[e].childNodes.length&&b[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=b[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(Xu(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,b[e].textContent=n),y=!0,w||(w=!0)}if(b[e].hasAttribute("href")){const t=b[e].getAttribute("href");if(!t)continue;let n="",i=d;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=c):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,Xu(t))continue;const u=t.replace(i,n);if(b[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&b[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&Jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:Zo.info,buildingSlug:n,orgSlug:t}),C&&Jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:Zo.info,buildingSlug:n,orgSlug:t}),y||Jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:Zo.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return Jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:Zo.error,buildingSlug:n,orgSlug:t,error:e}),0}},Ju=(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 ed=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 td=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Vn,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return U`
|
|
6434
|
+
`,au([ue({attribute:!0})],su.prototype,"isMinimized",void 0),au([ue()],su.prototype,"mobileStyles",void 0),au([ue({type:Boolean})],su.prototype,"isFirstMount",void 0),au([ue({attribute:!1})],su.prototype,"openSSTWindowOnLoad",void 0),au([ue({attribute:!1})],su.prototype,"autoOpenChatWidget",void 0),au([ue()],su.prototype,"phoneNumber",void 0),au([ue({attribute:!0})],su.prototype,"buildingName",void 0),au([ue({attribute:!0})],su.prototype,"chatId",void 0),au([ue({attribute:!0})],su.prototype,"orgLegalName",void 0),au([ue({attribute:!1})],su.prototype,"country",void 0),au([ue({attribute:!1})],su.prototype,"buildingState",void 0),au([ue({attribute:!0})],su.prototype,"chatCallUsHeader",void 0),au([ue({attribute:!1})],su.prototype,"buildingId",void 0),au([ue({type:Number})],su.prototype,"orgId",void 0),au([ue({attribute:!1})],su.prototype,"leadSourceParams",void 0),au([ue({attribute:!0})],su.prototype,"buildingSlug",void 0),au([ue({attribute:!0})],su.prototype,"orgSlug",void 0),au([ue({attribute:!0})],su.prototype,"sgtUrl",void 0),au([ue({attribute:!0})],su.prototype,"selfGuidedTourEnabled",void 0),au([ue({attribute:!0})],su.prototype,"selfGuidedToursTypeOffered",void 0),au([ue({attribute:!0})],su.prototype,"designConcept",void 0),au([ue({attribute:!0})],su.prototype,"featureFlagShowDropdown",void 0),au([ue({attribute:!1})],su.prototype,"leadSources",void 0),au([ue({attribute:!0})],su.prototype,"currentLeadSource",void 0),au([ue({attribute:!0})],su.prototype,"escortedToursLink",void 0),au([ue({attribute:!0})],su.prototype,"escortedToursTypeOffered",void 0),au([ue({attribute:!0})],su.prototype,"virtualToursLink",void 0),au([ue({attribute:!0})],su.prototype,"virtualToursTypeOffered",void 0),au([ue({type:Boolean})],su.prototype,"hasChatEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasChatEnabledMobile",void 0),au([ue({type:Boolean})],su.prototype,"hasEmailEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasEmailEnabledMobile",void 0),au([ue({attribute:!0})],su.prototype,"hasApplyNowEnabledDesktop",void 0),au([ue({attribute:!0})],su.prototype,"hasApplyNowEnabledMobile",void 0),au([ue({attribute:!0})],su.prototype,"applicationLink",void 0),au([ue({type:Boolean})],su.prototype,"hasCallUsEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasCallUsEnabledMobile",void 0),au([ue({type:Boolean})],su.prototype,"hasTextUsEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasTextUsEnabledMobile",void 0),au([ue({type:Boolean})],su.prototype,"hasSSTEnabledDesktop",void 0),au([ue({type:Boolean})],su.prototype,"hasSSTEnabledMobile",void 0),au([ue({attribute:!1})],su.prototype,"tourTypeOptions",void 0),au([ue({attribute:!1})],su.prototype,"layoutOptions",void 0),au([ue({attribute:!0})],su.prototype,"bedroomPreferenceRequired",void 0),au([ue({attribute:!1})],su.prototype,"brokerIntakeEnabled",void 0),au([ue({attribute:!0})],su.prototype,"hasDynamicSchedulingEnabled",void 0),au([ue({attribute:!0})],su.prototype,"hasPricingCalculatorEnabledDesktop",void 0),au([ue({attribute:!0})],su.prototype,"hasPricingCalculatorEnabledMobile",void 0),au([ue({attribute:!1})],su.prototype,"hasHideMobileFeatures",void 0),au([ue({type:Number})],su.prototype,"right",void 0),au([ue({type:Number})],su.prototype,"bottom",void 0),au([ue({type:Number})],su.prototype,"top",void 0),au([ue({type:Number})],su.prototype,"left",void 0),au([ue({attribute:!0})],su.prototype,"showTourNextToChat",void 0),au([ue({attribute:!1})],su.prototype,"onChatTapped",void 0),au([ue({attribute:!0})],su.prototype,"onClickMinimize",void 0),au([ue({attribute:!0})],su.prototype,"onSstClose",void 0),au([ue({attribute:!0})],su.prototype,"overrideRentgrata",void 0),au([ue({attribute:!1})],su.prototype,"launcherStyles",void 0),au([ue({attribute:!0})],su.prototype,"primaryColor",void 0),au([ue({attribute:!0})],su.prototype,"backgroundColor",void 0),au([ue({attribute:!0})],su.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),au([ue({attribute:!0})],su.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),au([ue({attribute:!0})],su.prototype,"leadSourceClient",void 0),au([de()],su.prototype,"leadSourceMultitouchClient",void 0),au([de()],su.prototype,"_isMobile",void 0),au([de()],su.prototype,"isEmailWindowOpen",void 0),au([de()],su.prototype,"isCallUsWindowOpen",void 0),au([de()],su.prototype,"isSSTWindowOpen",void 0),au([de()],su.prototype,"isTextUsWindowOpen",void 0),au([de()],su.prototype,"isCalculatorWindowOpen",void 0),au([de()],su.prototype,"isMobileFeaturesExpanded",void 0),su=au([se("meetelise-launcher")],su);const lu=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",su)},uu=["app.meetelise.com","staging.eliseai.com","localhost"],du={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"}},cu=e=>{const t=window.location.hostname;if(!uu.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 du&&(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=du[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var hu=n(5072),pu=n.n(hu),fu=n(7825),gu=n.n(fu),mu=n(7659),bu=n.n(mu),yu=n(5056),vu=n.n(yu),wu=n(540),Cu=n.n(wu),xu=n(1113),$u=n.n(xu),Su=n(5541),Au={};Au.styleTagTransform=$u(),Au.setAttributes=vu(),Au.insert=bu().bind(null,"head"),Au.domAPI=gu(),Au.insertStyleElement=Cu();pu()(Su.A,Au);Su.A&&Su.A.locals&&Su.A.locals;async function ku(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 Eu(n.data,t)}return[]}catch(e){return[]}}const Eu=(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 Tu(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 _u,Ou=n(8805),Pu=n.n(Ou),Iu=new Uint8Array(16);function Nu(){if(!_u&&!(_u="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 _u(Iu)}const Mu=/^(?:[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 Du=function(e){return"string"==typeof e&&Mu.test(e)};for(var Lu=[],Ru=0;Ru<256;++Ru)Lu.push((Ru+256).toString(16).substr(1));const Uu=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Lu[e[t+0]]+Lu[e[t+1]]+Lu[e[t+2]]+Lu[e[t+3]]+"-"+Lu[e[t+4]]+Lu[e[t+5]]+"-"+Lu[e[t+6]]+Lu[e[t+7]]+"-"+Lu[e[t+8]]+Lu[e[t+9]]+"-"+Lu[e[t+10]]+Lu[e[t+11]]+Lu[e[t+12]]+Lu[e[t+13]]+Lu[e[t+14]]+Lu[e[t+15]]).toLowerCase();if(!Du(n))throw TypeError("Stringified UUID is invalid");return n};const Bu=function(e,t,n){var i=(e=e||{}).random||(e.rng||Nu)();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 Uu(i)},ju=e=>localStorage.removeItem("com.elise.webchat.slug="+e),Fu=(e,t,n)=>{const i=Rr(new Date),r=n||`lead_${Bu()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Wr(i),buildingSlug:e,initiatedChat:t}},Hu=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(Gu(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},Gu=(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)&&!Or(t.timestamp,24)},zu=e=>e.startsWith("https://app.meetelise.com/settings/widgets")||e.startsWith("https://app.meetelise.com/settings/marketing/webchat")||e.includes("demo/utilities"),Qu="com.elise.webchat.reopenAfterNavigation",Wu=e=>{try{const t=new URL(e);return`${t.origin}${t.pathname}`}catch{return""}},qu=e=>{const t={pageUrl:Wu(window.location.href),pageTitle:document.title};return"number"==typeof e&&Number.isInteger(e)&&e>0&&(t.declaredBuildingId=e),t},Vu=(e,t=e=>window.location.assign(e))=>{(()=>{try{sessionStorage.setItem(Qu,"true")}catch{}})(),t(e.url)};var Yu;!function(e){e.noReply="no-reply",e.text="text",e.media="media",e.navigation="navigation"}(Yu||(Yu={}));const Ku=e=>e.type===Ju.text,Xu=e=>e.type===Ju.media,Zu=e=>e.type===Ju.navigation;var Ju;!function(e){e.text="text",e.media="media",e.navigation="navigation"}(Ju||(Ju={}));const ed=class{constructor(e,t,n,i=null,r,o,a=null,s=ah.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=ah.Default,this.centralConvo=!1,this.declaredBuildingId=null,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.sessionToken=null,this.isCurrentlyStreamingMessage=!1,this.chatListener=null,this.rawPubnubMessages=[],this.simpleChatMessages=[],this.listenerParams={message:e=>{var t,n;const i={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,i],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==Yu.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(()=>{Jo({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:Zo.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),So("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;So("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)===Yu.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&&Jo({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:Zo.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=Fu(this.chatStorageSlug,!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&&Jo({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:Zo.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===ah.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:zu(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:zu(location.href),...qu(this.declaredBuildingId),lead_sources_with_timestamps:(null!==(o=null===(r=this.leadSourceMultitouchClient)||void 0===r?void 0:r.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null}))&&void 0!==o?o:[]).map(e=>Ar({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||(So("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),So("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)?(Jo({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:Zo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(n),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],n={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var i;if(e.message.messageType===Yu.navigation){const n=(e=>{if(!e||"object"!=typeof e)return null;const{url:t,label:n}=e;if("string"!=typeof t||"string"!=typeof n)return null;if(!n.trim())return null;try{const e=new URL(t,window.location.href);return"http:"!==e.protocol&&"https:"!==e.protocol?null:{url:e.href,label:n.trim()}}catch{return null}})(e.message.navigation);n&&t.push({timestamp:e.timetoken,navigation:n,isLeadMessage:!1,type:Ju.navigation})}else if("media"===e.message.messageType)t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:Ju.media});else{if("string"!=typeof e.message.text)return;!e.message.stream_id||e.message.is_done&&0===e.message.order?t.push({timestamp:e.timetoken,message:e.message.text,isLeadMessage:this.isLeadMessage(e),chunks:[{text:e.message.text,order:0,isDone:!0}],type:Ju.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:Ju.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,n;const i=e.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),r=[];let o=null!==(t=i[0].message.order)&&void 0!==t?t:0;for(const e of i){if((null!==(n=e.message.order)&&void 0!==n?n:-1)!==o)break;r.push(e),o++}return r},this.isMessageStillStreamingChunks=e=>{const t=e.find(e=>e.message.is_done);return!t||e.length===t.message.order},this.buildingSlug=e,this.chatStorageSlug=e,this.buildingWebchatView=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}async initSession(e,t,n){try{const i={building_slug:e,org_slug:t};this.centralConvo&&(i.central_convo=!0),n&&(i.lead_id=n);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,i);return this.sessionToken=o.data.session_token,this.leadUserId=o.data.lead_id,this.channel=o.data.channel,o.data}catch(e){return this.buildingWebchatView&&Jo({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:Zo.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e}),null}}adoptBuilding(e,t){this.buildingSlug=e,this.buildingWebchatView=t}addChatListener(e){this.chatListener=e}async initializePubnub(e){if(!e.leadId)return;this.leadUserId=e.leadId;const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(Pu())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token,origin:"meetelise.pubnubapi.com"}),this.withAuthToken(()=>new Promise(()=>this.handleChatListeners())),await this.withAuthToken(()=>this.getChannelHistory()),this.pubnub):void 0}async fetchToken(e,t){try{if(this.sessionToken){const e="healthcare"===this.widgetType?"?industry=health_care":"";return(await r().get(`${this.apiHost}/platformApi/webchat/pn/v2/request-token${e}`,{headers:{"X-Session-Token":this.sessionToken}})).data}if(this.centralConvo)return null;return(await r().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${t}&${"healthcare"===this.widgetType?"industry=health_care":""}`)).data}catch(e){this.buildingWebchatView&&Jo({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:Zo.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&&Jo({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:Zo.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&&Jo({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:Zo.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!==Yu.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&&Jo({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:Zo.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,error:e})}}},td=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"]),nd=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return td.has(t)},id=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\([2-9]\d{2}\)[\s.-]?|[2-9]\d{2}[\s.-])[2-9]\d{2}[\s.-]?\d{4}/g,d=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,c=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},b=document.body.getElementsByTagName("*");let y=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<b.length;e++)if(b[e].nodeType===Node.ELEMENT_NODE&&!m(b[e])){if(1===b[e].childNodes.length&&b[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=b[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(nd(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,b[e].textContent=n),y=!0,w||(w=!0)}if(b[e].hasAttribute("href")){const t=b[e].getAttribute("href");if(!t)continue;let n="",i=d;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=c):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,nd(t))continue;const u=t.replace(i,n);if(b[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&b[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&Jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:Zo.info,buildingSlug:n,orgSlug:t}),C&&Jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:Zo.info,buildingSlug:n,orgSlug:t}),y||Jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:Zo.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return Jo({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:Zo.error,buildingSlug:n,orgSlug:t,error:e}),0}},rd=(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 od=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 ad=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Vn,this.foregroundColorOnPrimaryBackgroundColor="white",this.toExpand=!1}render(){return U`
|
|
6435
6435
|
<button
|
|
6436
6436
|
class=${this.toExpand?"button-container mini":"button-container"}
|
|
6437
6437
|
@click=${this.onClick}
|
|
@@ -6448,7 +6448,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6448
6448
|
</div>`}
|
|
6449
6449
|
</div>
|
|
6450
6450
|
</button>
|
|
6451
|
-
`}};
|
|
6451
|
+
`}};ad.styles=[u`
|
|
6452
6452
|
.button-container {
|
|
6453
6453
|
width: 56px;
|
|
6454
6454
|
height: 56px;
|
|
@@ -6498,7 +6498,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6498
6498
|
cursor: pointer;
|
|
6499
6499
|
filter: brightness(90%);
|
|
6500
6500
|
}
|
|
6501
|
-
`],
|
|
6501
|
+
`],od([ue({attribute:!0})],ad.prototype,"onClick",void 0),od([ue({attribute:!0})],ad.prototype,"primaryColor",void 0),od([ue({attribute:!0})],ad.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),od([ue({attribute:!0})],ad.prototype,"toExpand",void 0),ad=od([se("minimize-expand-button")],ad);const sd=u`
|
|
6502
6502
|
#healthchat-container {
|
|
6503
6503
|
position: fixed;
|
|
6504
6504
|
|
|
@@ -6616,7 +6616,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6616
6616
|
.health-bttn-allow-access {
|
|
6617
6617
|
padding-right: 28px;
|
|
6618
6618
|
}
|
|
6619
|
-
`,
|
|
6619
|
+
`,ld=u`
|
|
6620
6620
|
#pubnub-chat-container {
|
|
6621
6621
|
position: fixed;
|
|
6622
6622
|
|
|
@@ -6736,7 +6736,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6736
6736
|
border: none;
|
|
6737
6737
|
cursor: pointer;
|
|
6738
6738
|
}
|
|
6739
|
-
`,
|
|
6739
|
+
`,ud=u`
|
|
6740
6740
|
#header-text {
|
|
6741
6741
|
font-size: 12px;
|
|
6742
6742
|
font-weight: 700;
|
|
@@ -6937,7 +6937,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6937
6937
|
.checkbox:hover {
|
|
6938
6938
|
opacity: 0.5;
|
|
6939
6939
|
}
|
|
6940
|
-
`,{entries:od,setPrototypeOf:ad,isFrozen:sd,getPrototypeOf:ld,getOwnPropertyDescriptor:ud}=Object;let{freeze:dd,seal:cd,create:hd}=Object,{apply:pd,construct:fd}="undefined"!=typeof Reflect&&Reflect;dd||(dd=function(e){return e}),cd||(cd=function(e){return e}),pd||(pd=function(e,t,n){return e.apply(t,n)}),fd||(fd=function(e,t){return new e(...t)});const gd=Od(Array.prototype.forEach),md=Od(Array.prototype.lastIndexOf),bd=Od(Array.prototype.pop),yd=Od(Array.prototype.push),vd=Od(Array.prototype.splice),wd=Od(String.prototype.toLowerCase),Cd=Od(String.prototype.toString),xd=Od(String.prototype.match),$d=Od(String.prototype.replace),Sd=Od(String.prototype.indexOf),Ad=Od(String.prototype.trim),kd=Od(Object.prototype.hasOwnProperty),Ed=Od(RegExp.prototype.test),Td=(_d=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return fd(_d,t)});var _d;function Od(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 pd(e,t,i)}}function Pd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wd;ad&&ad(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(sd(t)||(t[i]=e),r=e)}e[r]=!0}return e}function Id(e){for(let t=0;t<e.length;t++){kd(e,t)||(e[t]=null)}return e}function Nd(e){const t=hd(null);for(const[n,i]of od(e)){kd(e,n)&&(Array.isArray(i)?t[n]=Id(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=Nd(i):t[n]=i)}return t}function Md(e,t){for(;null!==e;){const n=ud(e,t);if(n){if(n.get)return Od(n.get);if("function"==typeof n.value)return Od(n.value)}e=ld(e)}return function(){return null}}const Dd=dd(["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"]),Ld=dd(["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"]),Rd=dd(["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"]),Ud=dd(["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"]),Bd=dd(["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"]),jd=dd(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fd=dd(["#text"]),Hd=dd(["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"]),Gd=dd(["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"]),zd=dd(["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"]),Qd=dd(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Wd=cd(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qd=cd(/<%[\w\W]*|[\w\W]*%>/gm),Vd=cd(/\$\{[\w\W]*/gm),Yd=cd(/^data-[\-\w.\u00B7-\uFFFF]+$/),Kd=cd(/^aria-[\-\w]+$/),Xd=cd(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zd=cd(/^(?:\w+script|data):/i),Jd=cd(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ec=cd(/^html$/i),tc=cd(/^[a-z][.\w]*(-[.\w]+)+$/i);var nc=Object.freeze({__proto__:null,ARIA_ATTR:Kd,ATTR_WHITESPACE:Jd,CUSTOM_ELEMENT:tc,DATA_ATTR:Yd,DOCTYPE_NAME:ec,ERB_EXPR:qd,IS_ALLOWED_URI:Xd,IS_SCRIPT_OR_DATA:Zd,MUSTACHE_EXPR:Wd,TMPLIT_EXPR:Vd});const ic=1,rc=3,oc=7,ac=8,sc=9,lc=function(){return"undefined"==typeof window?null:window};var uc=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lc();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==sc||!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=Md(g,"cloneNode"),b=Md(g,"remove"),y=Md(g,"nextSibling"),v=Md(g,"childNodes"),w=Md(g,"parentNode");if("function"==typeof s){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let C,x="";const{implementation:$,createNodeIterator:S,createDocumentFragment:A,getElementsByTagName:k}=i,{importNode:E}=r;let T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof od&&"function"==typeof w&&$&&void 0!==$.createHTMLDocument;const{MUSTACHE_EXPR:_,ERB_EXPR:O,TMPLIT_EXPR:P,DATA_ATTR:I,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:L}=nc;let{IS_ALLOWED_URI:R}=nc,U=null;const B=Pd({},[...Dd,...Ld,...Rd,...Bd,...Fd]);let j=null;const F=Pd({},[...Hd,...Gd,...zd,...Qd]);let H=Object.seal(hd(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=Pd({},["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=Pd({},["audio","video","img","source","image","track"]);let he=null;const pe=Pd({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let be=me,ye=!1,ve=null;const we=Pd({},[fe,ge,me],Cd);let Ce=Pd({},["mi","mo","mn","ms","mtext"]),xe=Pd({},["annotation-xml"]);const $e=Pd({},["title","style","font","a","script"]);let Se=null;const Ae=["application/xhtml+xml","text/html"];let ke=null,Ee=null;const Te=i.createElement("form"),_e=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ee||Ee!==e){if(e&&"object"==typeof e||(e={}),e=Nd(e),Se=-1===Ae.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ke="application/xhtml+xml"===Se?Cd:wd,U=kd(e,"ALLOWED_TAGS")?Pd({},e.ALLOWED_TAGS,ke):B,j=kd(e,"ALLOWED_ATTR")?Pd({},e.ALLOWED_ATTR,ke):F,ve=kd(e,"ALLOWED_NAMESPACES")?Pd({},e.ALLOWED_NAMESPACES,Cd):we,he=kd(e,"ADD_URI_SAFE_ATTR")?Pd(Nd(pe),e.ADD_URI_SAFE_ATTR,ke):pe,de=kd(e,"ADD_DATA_URI_TAGS")?Pd(Nd(ce),e.ADD_DATA_URI_TAGS,ke):ce,le=kd(e,"FORBID_CONTENTS")?Pd({},e.FORBID_CONTENTS,ke):ue,G=kd(e,"FORBID_TAGS")?Pd({},e.FORBID_TAGS,ke):Nd({}),z=kd(e,"FORBID_ATTR")?Pd({},e.FORBID_ATTR,ke):Nd({}),se=!!kd(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,R=e.ALLOWED_URI_REGEXP||Xd,be=e.NAMESPACE||me,Ce=e.MATHML_TEXT_INTEGRATION_POINTS||Ce,xe=e.HTML_INTEGRATION_POINTS||xe,H=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(W=!1),te&&(ee=!0),se&&(U=Pd({},Fd),j=[],!0===se.html&&(Pd(U,Dd),Pd(j,Hd)),!0===se.svg&&(Pd(U,Ld),Pd(j,Gd),Pd(j,Qd)),!0===se.svgFilters&&(Pd(U,Rd),Pd(j,Gd),Pd(j,Qd)),!0===se.mathMl&&(Pd(U,Bd),Pd(j,zd),Pd(j,Qd))),e.ADD_TAGS&&(U===B&&(U=Nd(U)),Pd(U,e.ADD_TAGS,ke)),e.ADD_ATTR&&(j===F&&(j=Nd(j)),Pd(j,e.ADD_ATTR,ke)),e.ADD_URI_SAFE_ATTR&&Pd(he,e.ADD_URI_SAFE_ATTR,ke),e.FORBID_CONTENTS&&(le===ue&&(le=Nd(le)),Pd(le,e.FORBID_CONTENTS,ke)),oe&&(U["#text"]=!0),X&&Pd(U,["html","head","body"]),U.table&&(Pd(U,["tbody"]),delete G.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Td('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Td('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(""));dd&&dd(e),Ee=e}},Pe=Pd({},[...Ld,...Rd,...Ud]),Ie=Pd({},[...Bd,...jd]),Ne=function(e){yd(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){b(e)}},Me=function(e,t){try{yd(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){yd(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t=null,n=null;if(J)e="<remove></remove>"+e;else{const t=xd(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&be===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=C?C.createHTML(e):e;if(be===me)try{t=(new p).parseFromString(r,Se)}catch(e){}if(!t||!t.documentElement){t=$.createDocument(be,"template",null);try{t.documentElement.innerHTML=ye?x:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),be===me?k.call(t,X?"html":"body")[0]:X?t.documentElement:o},Le=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Re=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof c)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ue=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,i){gd(e,e=>{e.call(n,t,i,Ee)})}const je=function(e){let t=null;if(Be(T.beforeSanitizeElements,e,null),Re(e))return Ne(e),!0;const i=ke(e.nodeName);if(Be(T.uponSanitizeElement,e,{tagName:i,allowedTags:U}),K&&e.hasChildNodes()&&!Ue(e.firstElementChild)&&Ed(/<[/\w!]/g,e.innerHTML)&&Ed(/<[/\w!]/g,e.textContent))return Ne(e),!0;if(e.nodeType===oc)return Ne(e),!0;if(K&&e.nodeType===ac&&Ed(/<[/\w]/g,e.data))return Ne(e),!0;if(!U[i]||G[i]){if(!G[i]&&He(i)){if(H.tagNameCheck instanceof RegExp&&Ed(H.tagNameCheck,i))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(i))return!1}if(oe&&!le[i]){const t=w(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let i=n.length-1;i>=0;--i){const r=m(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,y(e))}}}return Ne(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const n=wd(e.tagName),i=wd(t.tagName);return!!ve[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===i||Ce[i]):Boolean(Pe[n]):e.namespaceURI===fe?t.namespaceURI===me?"math"===n:t.namespaceURI===ge?"math"===n&&xe[i]:Boolean(Ie[n]):e.namespaceURI===me?!(t.namespaceURI===ge&&!xe[i])&&!(t.namespaceURI===fe&&!Ce[i])&&!Ie[n]&&($e[n]||!Pe[n]):!("application/xhtml+xml"!==Se||!ve[e.namespaceURI]))}(e)?(Ne(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!Ed(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===rc&&(t=e.textContent,gd([_,O,P],e=>{t=$d(t,e," ")}),e.textContent!==t&&(yd(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(T.afterSanitizeElements,e,null),!1):(Ne(e),!0)},Fe=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in Te))return!1;if(W&&!z[t]&&Ed(I,t));else if(Q&&Ed(N,t));else if(!j[t]||z[t]){if(!(He(e)&&(H.tagNameCheck instanceof RegExp&&Ed(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&Ed(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&Ed(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(he[t]);else if(Ed(R,$d(n,D,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Sd(n,"data:")||!de[e]){if(q&&!Ed(M,$d(n,D,"")));else if(n)return!1}else;return!0},He=function(e){return"annotation-xml"!==e&&xd(e,L)},Ge=function(e){Be(T.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Re(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0};let r=t.length;for(;r--;){const o=t[r],{name:a,namespaceURI:s,value:l}=o,u=ke(a),d=l;let c="value"===a?d:Ad(d);if(i.attrName=u,i.attrValue=c,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(T.uponSanitizeAttribute,e,i),c=i.attrValue,!re||"id"!==u&&"name"!==u||(Me(a,e),c="user-content-"+c),K&&Ed(/((--!?|])>)|<\/(style|title)/i,c)){Me(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Me(a,e);continue}if(!V&&Ed(/\/>/i,c)){Me(a,e);continue}Y&&gd([_,O,P],e=>{c=$d(c,e," ")});const h=ke(e.nodeName);if(Fe(h,u,c)){if(C&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(h,u)){case"TrustedHTML":c=C.createHTML(c);break;case"TrustedScriptURL":c=C.createScriptURL(c)}if(c!==d)try{s?e.setAttributeNS(s,a,c):e.setAttribute(a,c),Re(e)?Ne(e):bd(n.removed)}catch(t){Me(a,e)}}else Me(a,e)}Be(T.afterSanitizeAttributes,e,null)},ze=function e(t){let n=null;const i=Le(t);for(Be(T.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(T.uponSanitizeShadowNode,n,null),je(n),Ge(n),n.content instanceof a&&e(n.content);Be(T.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,u=null;if(ye=!e,ye&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ue(e)){if("function"!=typeof e.toString)throw Td("toString is not a function");if("string"!=typeof(e=e.toString()))throw Td("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Z||Oe(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=ke(e.nodeName);if(!U[t]||G[t])throw Td("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===ic&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!ee&&!Y&&!X&&-1===e.indexOf("<"))return C&&ne?C.createHTML(e):e;if(i=De(e),!i)return ee?null:ne?x:""}i&&J&&Ne(i.firstChild);const d=Le(ae?e:i);for(;s=d.nextNode();)je(s),Ge(s),s.content instanceof a&&ze(s.content);if(ae)return e;if(ee){if(te)for(u=A.call(i.ownerDocument);i.firstChild;)u.appendChild(i.firstChild);else u=i;return(j.shadowroot||j.shadowrootmode)&&(u=E.call(r,u,!0)),u}let c=X?i.outerHTML:i.innerHTML;return X&&U["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ed(ec,i.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+c),Y&&gd([_,O,P],e=>{c=$d(c,e," ")}),C&&ne?C.createHTML(c):c},n.setConfig=function(){Oe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Z=!0},n.clearConfig=function(){Ee=null,Z=!1},n.isValidAttribute=function(e,t,n){Ee||Oe({});const i=ke(e),r=ke(t);return Fe(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&yd(T[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=md(T[e],t);return-1===n?void 0:vd(T[e],n,1)[0]}return bd(T[e])},n.removeHooks=function(e){T[e]=[]},n.removeAllHooks=function(){T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),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 cc=class extends oe{constructor(){super(...arguments),this.spinSpeed=.4}updated(){this.style.setProperty("--spin-duration",`${this.spinSpeed}s`)}render(){return U`<div class="spinner"></div>`}};cc.styles=u`
|
|
6940
|
+
`,{entries:dd,setPrototypeOf:cd,isFrozen:hd,getPrototypeOf:pd,getOwnPropertyDescriptor:fd}=Object;let{freeze:gd,seal:md,create:bd}=Object,{apply:yd,construct:vd}="undefined"!=typeof Reflect&&Reflect;gd||(gd=function(e){return e}),md||(md=function(e){return e}),yd||(yd=function(e,t,n){return e.apply(t,n)}),vd||(vd=function(e,t){return new e(...t)});const wd=Dd(Array.prototype.forEach),Cd=Dd(Array.prototype.lastIndexOf),xd=Dd(Array.prototype.pop),$d=Dd(Array.prototype.push),Sd=Dd(Array.prototype.splice),Ad=Dd(String.prototype.toLowerCase),kd=Dd(String.prototype.toString),Ed=Dd(String.prototype.match),Td=Dd(String.prototype.replace),_d=Dd(String.prototype.indexOf),Od=Dd(String.prototype.trim),Pd=Dd(Object.prototype.hasOwnProperty),Id=Dd(RegExp.prototype.test),Nd=(Md=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return vd(Md,t)});var Md;function Dd(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 yd(e,t,i)}}function Ld(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ad;cd&&cd(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(hd(t)||(t[i]=e),r=e)}e[r]=!0}return e}function Rd(e){for(let t=0;t<e.length;t++){Pd(e,t)||(e[t]=null)}return e}function Ud(e){const t=bd(null);for(const[n,i]of dd(e)){Pd(e,n)&&(Array.isArray(i)?t[n]=Rd(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=Ud(i):t[n]=i)}return t}function Bd(e,t){for(;null!==e;){const n=fd(e,t);if(n){if(n.get)return Dd(n.get);if("function"==typeof n.value)return Dd(n.value)}e=pd(e)}return function(){return null}}const jd=gd(["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"]),Fd=gd(["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"]),Hd=gd(["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"]),Gd=gd(["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"]),zd=gd(["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"]),Qd=gd(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wd=gd(["#text"]),qd=gd(["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"]),Vd=gd(["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"]),Yd=gd(["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"]),Kd=gd(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Xd=md(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Zd=md(/<%[\w\W]*|[\w\W]*%>/gm),Jd=md(/\$\{[\w\W]*/gm),ec=md(/^data-[\-\w.\u00B7-\uFFFF]+$/),tc=md(/^aria-[\-\w]+$/),nc=md(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ic=md(/^(?:\w+script|data):/i),rc=md(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oc=md(/^html$/i),ac=md(/^[a-z][.\w]*(-[.\w]+)+$/i);var sc=Object.freeze({__proto__:null,ARIA_ATTR:tc,ATTR_WHITESPACE:rc,CUSTOM_ELEMENT:ac,DATA_ATTR:ec,DOCTYPE_NAME:oc,ERB_EXPR:Zd,IS_ALLOWED_URI:nc,IS_SCRIPT_OR_DATA:ic,MUSTACHE_EXPR:Xd,TMPLIT_EXPR:Jd});const lc=1,uc=3,dc=7,cc=8,hc=9,pc=function(){return"undefined"==typeof window?null:window};var fc=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pc();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==hc||!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=Bd(g,"cloneNode"),b=Bd(g,"remove"),y=Bd(g,"nextSibling"),v=Bd(g,"childNodes"),w=Bd(g,"parentNode");if("function"==typeof s){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let C,x="";const{implementation:$,createNodeIterator:S,createDocumentFragment:A,getElementsByTagName:k}=i,{importNode:E}=r;let T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof dd&&"function"==typeof w&&$&&void 0!==$.createHTMLDocument;const{MUSTACHE_EXPR:_,ERB_EXPR:O,TMPLIT_EXPR:P,DATA_ATTR:I,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:L}=sc;let{IS_ALLOWED_URI:R}=sc,U=null;const B=Ld({},[...jd,...Fd,...Hd,...zd,...Wd]);let j=null;const F=Ld({},[...qd,...Vd,...Yd,...Kd]);let H=Object.seal(bd(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=Ld({},["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=Ld({},["audio","video","img","source","image","track"]);let he=null;const pe=Ld({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let be=me,ye=!1,ve=null;const we=Ld({},[fe,ge,me],kd);let Ce=Ld({},["mi","mo","mn","ms","mtext"]),xe=Ld({},["annotation-xml"]);const $e=Ld({},["title","style","font","a","script"]);let Se=null;const Ae=["application/xhtml+xml","text/html"];let ke=null,Ee=null;const Te=i.createElement("form"),_e=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ee||Ee!==e){if(e&&"object"==typeof e||(e={}),e=Ud(e),Se=-1===Ae.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ke="application/xhtml+xml"===Se?kd:Ad,U=Pd(e,"ALLOWED_TAGS")?Ld({},e.ALLOWED_TAGS,ke):B,j=Pd(e,"ALLOWED_ATTR")?Ld({},e.ALLOWED_ATTR,ke):F,ve=Pd(e,"ALLOWED_NAMESPACES")?Ld({},e.ALLOWED_NAMESPACES,kd):we,he=Pd(e,"ADD_URI_SAFE_ATTR")?Ld(Ud(pe),e.ADD_URI_SAFE_ATTR,ke):pe,de=Pd(e,"ADD_DATA_URI_TAGS")?Ld(Ud(ce),e.ADD_DATA_URI_TAGS,ke):ce,le=Pd(e,"FORBID_CONTENTS")?Ld({},e.FORBID_CONTENTS,ke):ue,G=Pd(e,"FORBID_TAGS")?Ld({},e.FORBID_TAGS,ke):Ud({}),z=Pd(e,"FORBID_ATTR")?Ld({},e.FORBID_ATTR,ke):Ud({}),se=!!Pd(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,R=e.ALLOWED_URI_REGEXP||nc,be=e.NAMESPACE||me,Ce=e.MATHML_TEXT_INTEGRATION_POINTS||Ce,xe=e.HTML_INTEGRATION_POINTS||xe,H=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(W=!1),te&&(ee=!0),se&&(U=Ld({},Wd),j=[],!0===se.html&&(Ld(U,jd),Ld(j,qd)),!0===se.svg&&(Ld(U,Fd),Ld(j,Vd),Ld(j,Kd)),!0===se.svgFilters&&(Ld(U,Hd),Ld(j,Vd),Ld(j,Kd)),!0===se.mathMl&&(Ld(U,zd),Ld(j,Yd),Ld(j,Kd))),e.ADD_TAGS&&(U===B&&(U=Ud(U)),Ld(U,e.ADD_TAGS,ke)),e.ADD_ATTR&&(j===F&&(j=Ud(j)),Ld(j,e.ADD_ATTR,ke)),e.ADD_URI_SAFE_ATTR&&Ld(he,e.ADD_URI_SAFE_ATTR,ke),e.FORBID_CONTENTS&&(le===ue&&(le=Ud(le)),Ld(le,e.FORBID_CONTENTS,ke)),oe&&(U["#text"]=!0),X&&Ld(U,["html","head","body"]),U.table&&(Ld(U,["tbody"]),delete G.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Nd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Nd('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(""));gd&&gd(e),Ee=e}},Pe=Ld({},[...Fd,...Hd,...Gd]),Ie=Ld({},[...zd,...Qd]),Ne=function(e){$d(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){b(e)}},Me=function(e,t){try{$d(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){$d(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},De=function(e){let t=null,n=null;if(J)e="<remove></remove>"+e;else{const t=Ed(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&be===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=C?C.createHTML(e):e;if(be===me)try{t=(new p).parseFromString(r,Se)}catch(e){}if(!t||!t.documentElement){t=$.createDocument(be,"template",null);try{t.documentElement.innerHTML=ye?x:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),be===me?k.call(t,X?"html":"body")[0]:X?t.documentElement:o},Le=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Re=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof c)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ue=function(e){return"function"==typeof l&&e instanceof l};function Be(e,t,i){wd(e,e=>{e.call(n,t,i,Ee)})}const je=function(e){let t=null;if(Be(T.beforeSanitizeElements,e,null),Re(e))return Ne(e),!0;const i=ke(e.nodeName);if(Be(T.uponSanitizeElement,e,{tagName:i,allowedTags:U}),K&&e.hasChildNodes()&&!Ue(e.firstElementChild)&&Id(/<[/\w!]/g,e.innerHTML)&&Id(/<[/\w!]/g,e.textContent))return Ne(e),!0;if(e.nodeType===dc)return Ne(e),!0;if(K&&e.nodeType===cc&&Id(/<[/\w]/g,e.data))return Ne(e),!0;if(!U[i]||G[i]){if(!G[i]&&He(i)){if(H.tagNameCheck instanceof RegExp&&Id(H.tagNameCheck,i))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(i))return!1}if(oe&&!le[i]){const t=w(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let i=n.length-1;i>=0;--i){const r=m(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,y(e))}}}return Ne(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:be,tagName:"template"});const n=Ad(e.tagName),i=Ad(t.tagName);return!!ve[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===i||Ce[i]):Boolean(Pe[n]):e.namespaceURI===fe?t.namespaceURI===me?"math"===n:t.namespaceURI===ge?"math"===n&&xe[i]:Boolean(Ie[n]):e.namespaceURI===me?!(t.namespaceURI===ge&&!xe[i])&&!(t.namespaceURI===fe&&!Ce[i])&&!Ie[n]&&($e[n]||!Pe[n]):!("application/xhtml+xml"!==Se||!ve[e.namespaceURI]))}(e)?(Ne(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!Id(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===uc&&(t=e.textContent,wd([_,O,P],e=>{t=Td(t,e," ")}),e.textContent!==t&&($d(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be(T.afterSanitizeElements,e,null),!1):(Ne(e),!0)},Fe=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in Te))return!1;if(W&&!z[t]&&Id(I,t));else if(Q&&Id(N,t));else if(!j[t]||z[t]){if(!(He(e)&&(H.tagNameCheck instanceof RegExp&&Id(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&Id(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&Id(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(he[t]);else if(Id(R,Td(n,D,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_d(n,"data:")||!de[e]){if(q&&!Id(M,Td(n,D,"")));else if(n)return!1}else;return!0},He=function(e){return"annotation-xml"!==e&&Ed(e,L)},Ge=function(e){Be(T.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Re(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0};let r=t.length;for(;r--;){const o=t[r],{name:a,namespaceURI:s,value:l}=o,u=ke(a),d=l;let c="value"===a?d:Od(d);if(i.attrName=u,i.attrValue=c,i.keepAttr=!0,i.forceKeepAttr=void 0,Be(T.uponSanitizeAttribute,e,i),c=i.attrValue,!re||"id"!==u&&"name"!==u||(Me(a,e),c="user-content-"+c),K&&Id(/((--!?|])>)|<\/(style|title)/i,c)){Me(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Me(a,e);continue}if(!V&&Id(/\/>/i,c)){Me(a,e);continue}Y&&wd([_,O,P],e=>{c=Td(c,e," ")});const h=ke(e.nodeName);if(Fe(h,u,c)){if(C&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(h,u)){case"TrustedHTML":c=C.createHTML(c);break;case"TrustedScriptURL":c=C.createScriptURL(c)}if(c!==d)try{s?e.setAttributeNS(s,a,c):e.setAttribute(a,c),Re(e)?Ne(e):xd(n.removed)}catch(t){Me(a,e)}}else Me(a,e)}Be(T.afterSanitizeAttributes,e,null)},ze=function e(t){let n=null;const i=Le(t);for(Be(T.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)Be(T.uponSanitizeShadowNode,n,null),je(n),Ge(n),n.content instanceof a&&e(n.content);Be(T.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,u=null;if(ye=!e,ye&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ue(e)){if("function"!=typeof e.toString)throw Nd("toString is not a function");if("string"!=typeof(e=e.toString()))throw Nd("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Z||Oe(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=ke(e.nodeName);if(!U[t]||G[t])throw Nd("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===lc&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!ee&&!Y&&!X&&-1===e.indexOf("<"))return C&&ne?C.createHTML(e):e;if(i=De(e),!i)return ee?null:ne?x:""}i&&J&&Ne(i.firstChild);const d=Le(ae?e:i);for(;s=d.nextNode();)je(s),Ge(s),s.content instanceof a&&ze(s.content);if(ae)return e;if(ee){if(te)for(u=A.call(i.ownerDocument);i.firstChild;)u.appendChild(i.firstChild);else u=i;return(j.shadowroot||j.shadowrootmode)&&(u=E.call(r,u,!0)),u}let c=X?i.outerHTML:i.innerHTML;return X&&U["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Id(oc,i.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+c),Y&&wd([_,O,P],e=>{c=Td(c,e," ")}),C&&ne?C.createHTML(c):c},n.setConfig=function(){Oe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Z=!0},n.clearConfig=function(){Ee=null,Z=!1},n.isValidAttribute=function(e,t,n){Ee||Oe({});const i=ke(e),r=ke(t);return Fe(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&$d(T[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Cd(T[e],t);return-1===n?void 0:Sd(T[e],n,1)[0]}return xd(T[e])},n.removeHooks=function(e){T[e]=[]},n.removeAllHooks=function(){T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),gc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let mc=class extends oe{constructor(){super(...arguments),this.spinSpeed=.4}updated(){this.style.setProperty("--spin-duration",`${this.spinSpeed}s`)}render(){return U`<div class="spinner"></div>`}};mc.styles=u`
|
|
6941
6941
|
.spinner {
|
|
6942
6942
|
border: 2px solid rgba(0, 0, 0, 0.2);
|
|
6943
6943
|
border-top: 2px solid #c057ff;
|
|
@@ -6955,16 +6955,16 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6955
6955
|
transform: rotate(360deg);
|
|
6956
6956
|
}
|
|
6957
6957
|
}
|
|
6958
|
-
`,
|
|
6958
|
+
`,gc([ue({type:Number})],mc.prototype,"spinSpeed",void 0),mc=gc([se("mini-loader")],mc);var bc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let yc=class extends oe{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isLeadMessage=!1,this.widgetType=ah.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=U`${n.trim().split("\n").map(e=>{const n=this.sanitizeMarkdownText(e),a=this.preserveHTMLTags(n);return a?U`${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))}),U`${ko(fc.sanitize(t,{ADD_ATTR:["target"]}))} `}if(i.test(e)){const t=this.removeTrailingPunctuation(e);return r.push(this.getLinkData(t)),U`<a
|
|
6959
6959
|
class="redirect-link"
|
|
6960
6960
|
href="${t}"
|
|
6961
6961
|
target="_blank"
|
|
6962
6962
|
rel="noopener noreferrer"
|
|
6963
6963
|
>${t}
|
|
6964
|
-
</a>`}return U`${ko(
|
|
6964
|
+
</a>`}return U`${ko(fc.sanitize(e))} `})}<br />`:U``})}`,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=Bu().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?U`<div class="message-inner-body">
|
|
6965
6965
|
${this.isMessageStillStreamingChunks()?U`<div class="message-loader"><mini-loader></mini-loader></div>`:""}
|
|
6966
6966
|
<p
|
|
6967
|
-
class=${be({"message-text":this.widgetType!==
|
|
6967
|
+
class=${be({"message-text":this.widgetType!==ah.Utilities,"message-text-large":this.widgetType===ah.Utilities,"webchat-font__desktop":!Tr(),"webchat-font__mobile":Tr()})}
|
|
6968
6968
|
>
|
|
6969
6969
|
${this.parsedMessage}
|
|
6970
6970
|
</p>
|
|
@@ -6995,16 +6995,16 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
6995
6995
|
/>`:""}
|
|
6996
6996
|
|
|
6997
6997
|
<div class="website-preview-body">
|
|
6998
|
-
<p class=${be({"message-text":this.widgetType!==
|
|
6998
|
+
<p class=${be({"message-text":this.widgetType!==ah.Utilities,"message-text-large":this.widgetType===ah.Utilities,"website-preview-title":!0,"webchat-font__desktop":!Tr(),"webchat-font__mobile":Tr()})}>${e.title}</p>
|
|
6999
6999
|
${e.description?U`<p
|
|
7000
|
-
class=${be({"message-text":this.widgetType!==
|
|
7000
|
+
class=${be({"message-text":this.widgetType!==ah.Utilities,"message-text-large":this.widgetType===ah.Utilities,"website-preview-description":!0,"webchat-font__desktop":!Tr(),"webchat-font__mobile":Tr()})}
|
|
7001
7001
|
>
|
|
7002
7002
|
${e.description}
|
|
7003
7003
|
</p>`:""}
|
|
7004
7004
|
</div>
|
|
7005
7005
|
</div>
|
|
7006
7006
|
</a></div> `})}
|
|
7007
|
-
</div>`:U``}};
|
|
7007
|
+
</div>`:U``}};yc.styles=[Oe,ud,u`
|
|
7008
7008
|
.message-inner-body {
|
|
7009
7009
|
position: relative;
|
|
7010
7010
|
}
|
|
@@ -7013,7 +7013,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7013
7013
|
bottom: -2px;
|
|
7014
7014
|
right: -2px;
|
|
7015
7015
|
}
|
|
7016
|
-
`],
|
|
7016
|
+
`],bc([ue({attribute:!0})],yc.prototype,"buildingSlug",void 0),bc([ue({attribute:!0})],yc.prototype,"message",void 0),bc([ue({attribute:!0})],yc.prototype,"myPubnub",void 0),bc([ue({attribute:!0})],yc.prototype,"onMount",void 0),bc([de()],yc.prototype,"loadingPreviews",void 0),bc([de()],yc.prototype,"parsedMessage",void 0),bc([de()],yc.prototype,"websitePreviewInfo",void 0),bc([de()],yc.prototype,"imagesToDisplay",void 0),bc([de()],yc.prototype,"imageUrlError",void 0),bc([ue({type:Boolean})],yc.prototype,"isLeadMessage",void 0),bc([ue({attribute:!0})],yc.prototype,"widgetType",void 0),yc=bc([se("pubnub-message")],yc);var vc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let wc=class extends 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?U`<div class="message-inner-body">
|
|
7017
7017
|
<div class="carousel">
|
|
7018
7018
|
<div
|
|
7019
7019
|
class="image-container"
|
|
@@ -7050,7 +7050,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7050
7050
|
rel="noopener noreferrer"
|
|
7051
7051
|
><img class=${"displayed-message-image"} src=${e.url} alt=""
|
|
7052
7052
|
/></a>`)}
|
|
7053
|
-
</div>`:U``}};
|
|
7053
|
+
</div>`:U``}};wc.styles=[Oe,ud,u`
|
|
7054
7054
|
/* This element is a flex item in a bubble capped below the chat width.
|
|
7055
7055
|
Without min-width: 0 it can grow to all slides side by side, so the
|
|
7056
7056
|
carousel spills out of the bubble and the chat. */
|
|
@@ -7127,7 +7127,32 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7127
7127
|
.button:hover {
|
|
7128
7128
|
background-color: rgba(0, 0, 0, 0.8);
|
|
7129
7129
|
}
|
|
7130
|
-
`],
|
|
7130
|
+
`],vc([ue({attribute:!0})],wc.prototype,"message",void 0),vc([ue({attribute:!0})],wc.prototype,"myPubnub",void 0),vc([ue({attribute:!0})],wc.prototype,"onMount",void 0),vc([de()],wc.prototype,"showMediaAsCarousel",void 0),vc([de()],wc.prototype,"activeIndex",void 0),wc=vc([se("pubnub-media")],wc);var Cc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let xc=class extends oe{constructor(){super(...arguments),this.onMount=()=>({}),this.navigate=e=>window.location.assign(e)}updated(){this.onMount()}render(){if(!this.message)return U``;const{navigation:e}=this.message;return U`<button
|
|
7131
|
+
type="button"
|
|
7132
|
+
class=${be({"navigation-button":!0,"webchat-font__desktop":!Tr(),"webchat-font__mobile":Tr()})}
|
|
7133
|
+
@click=${()=>Vu(e,this.navigate)}
|
|
7134
|
+
>
|
|
7135
|
+
Take me to ${e.label}
|
|
7136
|
+
</button>`}};xc.styles=[Oe,ud,u`
|
|
7137
|
+
.navigation-button {
|
|
7138
|
+
cursor: pointer;
|
|
7139
|
+
border: none;
|
|
7140
|
+
border-radius: 8px;
|
|
7141
|
+
padding: 8px 12px;
|
|
7142
|
+
background: black;
|
|
7143
|
+
color: white;
|
|
7144
|
+
font-family: inherit;
|
|
7145
|
+
text-align: left;
|
|
7146
|
+
line-height: 1.4;
|
|
7147
|
+
}
|
|
7148
|
+
.navigation-button:hover {
|
|
7149
|
+
opacity: 0.85;
|
|
7150
|
+
}
|
|
7151
|
+
.navigation-button:focus-visible {
|
|
7152
|
+
outline: 2px solid #4d90fe;
|
|
7153
|
+
outline-offset: 2px;
|
|
7154
|
+
}
|
|
7155
|
+
`],Cc([ue({attribute:!1})],xc.prototype,"message",void 0),Cc([ue({attribute:!1})],xc.prototype,"onMount",void 0),Cc([ue({attribute:!1})],xc.prototype,"navigate",void 0),xc=Cc([se("pubnub-navigation")],xc);function $c(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 Sc(e,t){ii(2,arguments);var n=ri(e),i=ri(t),r=$c(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($c(n,i)===-r));return 0===a?0:a}const Ac=u`
|
|
7131
7156
|
#utilities-container {
|
|
7132
7157
|
position: fixed;
|
|
7133
7158
|
|
|
@@ -7236,17 +7261,17 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7236
7261
|
.health-bttn-allow-access {
|
|
7237
7262
|
padding-right: 28px;
|
|
7238
7263
|
}
|
|
7239
|
-
`,
|
|
7264
|
+
`,kc=(e="black")=>B`
|
|
7240
7265
|
<svg aria-hidden="true" focusable="false" width="32" height="32" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7241
7266
|
<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}"/>
|
|
7242
7267
|
<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}"/>
|
|
7243
7268
|
</svg>
|
|
7244
|
-
`,
|
|
7269
|
+
`,Ec=(e="black")=>B`
|
|
7245
7270
|
<svg aria-hidden="true" focusable="false" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7246
7271
|
<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}"/>
|
|
7247
7272
|
<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}"/>
|
|
7248
7273
|
</svg>
|
|
7249
|
-
`;var
|
|
7274
|
+
`;var Tc,_c=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Oc=Tc=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.centralConvo=!1,this.widgetType=ah.Default,this.primaryColor=Vn,this.backgroundColor=Yn,this.onClickExit=()=>{localStorage.setItem("isChatOpen","false")},this.requiresConsent=!1,this._isMobile=Tr(),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:Ju.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<=Tc.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=_r(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;Sc(new Date,new Date(r))<7&&o===jo?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,b,y,v,w,C,x;if(!this.buildingSlug&&!this.centralConvo)return U``;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===ah.Utilities)return U`
|
|
7250
7275
|
<div
|
|
7251
7276
|
id="utilities-container"
|
|
7252
7277
|
class=${be({"pubnub-container__mobile":this._isMobile,"utilities-container__desktop":!this._isMobile})}
|
|
@@ -7301,15 +7326,19 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7301
7326
|
key=${e.timestamp}
|
|
7302
7327
|
tabindex="0"
|
|
7303
7328
|
role="article"
|
|
7304
|
-
aria-label="${e.isLeadMessage?"You":"Elise"}: ${
|
|
7329
|
+
aria-label="${e.isLeadMessage?"You":"Elise"}: ${Pc(e)}"
|
|
7305
7330
|
>
|
|
7306
|
-
${
|
|
7331
|
+
${Zu(e)?U`<pubnub-navigation
|
|
7332
|
+
.message=${e}
|
|
7333
|
+
.onMount=${()=>this.scrollToChatBottom()}
|
|
7334
|
+
></pubnub-navigation>`:""}
|
|
7335
|
+
${Xu(e)?U` <pubnub-media
|
|
7307
7336
|
.message=${e}
|
|
7308
7337
|
.myPubnub=${this.myPubnub}
|
|
7309
7338
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
7310
7339
|
>
|
|
7311
7340
|
</pubnub-media>`:""}
|
|
7312
|
-
${
|
|
7341
|
+
${Ku(e)?U` <pubnub-message
|
|
7313
7342
|
.message=${e}
|
|
7314
7343
|
.myPubnub=${this.myPubnub}
|
|
7315
7344
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
@@ -7352,12 +7381,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7352
7381
|
class=${be({"health-bttn-allow-access":this._isMobile})}
|
|
7353
7382
|
@click=${()=>this.sendMessage(this.messageInput.value)}
|
|
7354
7383
|
>
|
|
7355
|
-
${
|
|
7384
|
+
${kc("black")}
|
|
7356
7385
|
</button>
|
|
7357
7386
|
</div>
|
|
7358
7387
|
</div>
|
|
7359
7388
|
</div>
|
|
7360
|
-
`;if(this.widgetType===
|
|
7389
|
+
`;if(this.widgetType===ah.Healthcare)return U`
|
|
7361
7390
|
<div
|
|
7362
7391
|
id="healthchat-container"
|
|
7363
7392
|
class=${be({"pubnub-container__mobile":this._isMobile,"healthchat-container__desktop":!this._isMobile})}
|
|
@@ -7417,15 +7446,19 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7417
7446
|
key=${e.timestamp}
|
|
7418
7447
|
tabindex="0"
|
|
7419
7448
|
role="article"
|
|
7420
|
-
aria-label="${e.isLeadMessage?"You":"Elise"}: ${
|
|
7449
|
+
aria-label="${e.isLeadMessage?"You":"Elise"}: ${Pc(e)}"
|
|
7421
7450
|
>
|
|
7422
|
-
${
|
|
7451
|
+
${Zu(e)?U`<pubnub-navigation
|
|
7452
|
+
.message=${e}
|
|
7453
|
+
.onMount=${()=>this.scrollToChatBottom()}
|
|
7454
|
+
></pubnub-navigation>`:""}
|
|
7455
|
+
${Xu(e)?U` <pubnub-media
|
|
7423
7456
|
.message=${e}
|
|
7424
7457
|
.myPubnub=${this.myPubnub}
|
|
7425
7458
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
7426
7459
|
>
|
|
7427
7460
|
</pubnub-media>`:""}
|
|
7428
|
-
${
|
|
7461
|
+
${Ku(e)?U` <pubnub-message
|
|
7429
7462
|
.message=${e}
|
|
7430
7463
|
.myPubnub=${this.myPubnub}
|
|
7431
7464
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
@@ -7468,7 +7501,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7468
7501
|
class=${be({"health-bttn-allow-access":this._isMobile})}
|
|
7469
7502
|
@click=${()=>this.sendMessage(this.messageInput.value)}
|
|
7470
7503
|
>
|
|
7471
|
-
${this._isMobile?
|
|
7504
|
+
${this._isMobile?kc("black"):Ec("black")}
|
|
7472
7505
|
</button>
|
|
7473
7506
|
</div>
|
|
7474
7507
|
</div>
|
|
@@ -7530,15 +7563,19 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7530
7563
|
key=${e.timestamp}
|
|
7531
7564
|
tabindex="0"
|
|
7532
7565
|
role="article"
|
|
7533
|
-
aria-label="${e.isLeadMessage?"You":"Elise"}: ${
|
|
7566
|
+
aria-label="${e.isLeadMessage?"You":"Elise"}: ${Pc(e)}"
|
|
7534
7567
|
>
|
|
7535
|
-
${
|
|
7568
|
+
${Zu(e)?U`<pubnub-navigation
|
|
7569
|
+
.message=${e}
|
|
7570
|
+
.onMount=${()=>this.scrollToChatBottom()}
|
|
7571
|
+
></pubnub-navigation>`:""}
|
|
7572
|
+
${Xu(e)?U` <pubnub-media
|
|
7536
7573
|
.message=${e}
|
|
7537
7574
|
.myPubnub=${this.myPubnub}
|
|
7538
7575
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
7539
7576
|
>
|
|
7540
7577
|
</pubnub-media>`:""}
|
|
7541
|
-
${
|
|
7578
|
+
${Ku(e)?U` <pubnub-message
|
|
7542
7579
|
.message=${e}
|
|
7543
7580
|
.myPubnub=${this.myPubnub}
|
|
7544
7581
|
.onMount=${()=>this.scrollToChatBottom()}
|
|
@@ -7581,11 +7618,11 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7581
7618
|
aria-label="Send message"
|
|
7582
7619
|
aria-describedby="Send message"
|
|
7583
7620
|
>
|
|
7584
|
-
${Jn(this.building.orgId,this.building.id)&&this.primaryColor!==Vn?
|
|
7621
|
+
${Jn(this.building.orgId,this.building.id)&&this.primaryColor!==Vn?Ec("black"):Ec("white")}
|
|
7585
7622
|
</button>
|
|
7586
7623
|
</div>
|
|
7587
7624
|
</div>
|
|
7588
|
-
`}};$c.AUTO_SCROLL_THRESHOLD_PX=32,$c.styles=[Oe,rd,id,nd,yc],xc([ue({type:Number})],$c.prototype,"right",void 0),xc([ue({type:Number})],$c.prototype,"bottom",void 0),xc([ue({type:Number})],$c.prototype,"top",void 0),xc([ue({type:Number})],$c.prototype,"left",void 0),xc([ue({attribute:!0})],$c.prototype,"onMount",void 0),xc([ue({attribute:!0})],$c.prototype,"channel",void 0),xc([ue({attribute:!0})],$c.prototype,"isHealthChat",void 0),xc([ue({attribute:!0})],$c.prototype,"myPubnub",void 0),xc([ue({attribute:!0})],$c.prototype,"orgSlug",void 0),xc([ue({attribute:!0})],$c.prototype,"buildingSlug",void 0),xc([ue({attribute:!0})],$c.prototype,"widgetType",void 0),xc([ue({attribute:!0})],$c.prototype,"building",void 0),xc([ue({attribute:!0})],$c.prototype,"primaryColor",void 0),xc([ue({attribute:!0})],$c.prototype,"backgroundColor",void 0),xc([ue({attribute:!0})],$c.prototype,"onClickExit",void 0),xc([ue({attribute:!0})],$c.prototype,"requiresConsent",void 0),xc([ce("#message-input",!0)],$c.prototype,"messageInput",void 0),xc([ce("#conversation-body",!0)],$c.prototype,"messageBody",void 0),xc([de()],$c.prototype,"_isMobile",void 0),xc([de()],$c.prototype,"messages",void 0),xc([de()],$c.prototype,"isLoadingMessages",void 0),xc([de()],$c.prototype,"hasReceivedConsent",void 0),xc([de()],$c.prototype,"privacyPolicyUrl",void 0),xc([de()],$c.prototype,"websitePreviewMapping",void 0),$c=Cc=xc([se("pubnub-chat")],$c);const Sc="cdn.skypack.dev/@meetelise/chat",Ac="cdn.eliseai.com/@meetelise/chat",kc=async(e,t)=>{try{if(Math.random()>=.15)return;const n=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",n=t.textContent||"";if(e.includes(Sc)||n.includes(Sc))return"skypack";if(e.includes(Ac)||n.includes(Ac))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){}},Ec=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,Tc={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},_c="https://applications.eliseai.com",Oc=["Check Availability","Apply Now"],Pc=(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&&Oc.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"),Jo({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:Zo.info,buildingSlug:i,orgSlug:n}),!0},Ic=(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&&Pc(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)Pc(s[e],t,n,i)}},Nc=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)Pc(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)Ic(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class Mc{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Rr(Br(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=vo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(Xo()).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:Rr(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:Rr(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));Jo({logType:Zo.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=ia(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Rr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Wr(e.timestampInitiallyLogged).getTime()-Wr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Rr(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:Rr(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=>Wr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var Dc,Lc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Rc=Dc=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=Tr(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=fo.always,this.bedroomPreferenceRequired=!1,this.brokerIntakeEnabled=!1,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.openTourSchedulerOnLoad=!1,this.displayPubnubChat=!1,this.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=Zc.Default,this.onWidgetLoaded=ru(),this.onSstClose=ru(),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=ke(),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 ca(n.data)}(this.orgSlug):await da(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{kc(this.orgSlug,this.buildingSlug)}catch(e){}await rs(n,this.buildingSlug,this.orgSlug)&&(ea({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(qa,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,b,y,v,w,C,x,$,S,A,k,E,T,_,O,P,I,N,M,D,L,R,U,B,j,F,H,G,z,Q,W,q,V,Y;const K=this.buildingWebchatView;if(!K)return;K&&this.orgSlug&&Bc(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=Co.includes(K.orgId),$o=te;const[ne,ie,re,oe,ae]=await Promise.all([ku(this.orgSlug,this.buildingSlug),go(this.buildingSlug),Tu(this.buildingSlug),bo(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,this.brokerIntakeEnabled=ae;const se=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 Jo({logType:Zo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t},error:t}),null}return null})(this.buildingSlug),le=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,ue=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,de={callDesktop:null!==(d=null===(u=this.buildingWebchatView)||void 0===u?void 0:u.shouldShowPhoneDesktop)&&void 0!==d&&d,callMobile:null!==(h=null===(c=this.buildingWebchatView)||void 0===c?void 0:c.shouldShowPhoneMobile)&&void 0!==h&&h,chatDesktop:null!==(f=null===(p=this.buildingWebchatView)||void 0===p?void 0:p.shouldShowChatDesktop)&&void 0!==f&&f,chatMobile:null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.shouldShowChatMobile)&&void 0!==m&&m,emailDesktop:null!==(y=null===(b=this.buildingWebchatView)||void 0===b?void 0:b.shouldShowEmailDesktop)&&void 0!==y&&y,emailMobile:null!==(w=null===(v=this.buildingWebchatView)||void 0===v?void 0:v.shouldShowEmailMobile)&&void 0!==w&&w,textDesktop:null!==(x=(null===(C=this.buildingWebchatView)||void 0===C?void 0:C.shouldShowTextDesktop)&&!!se)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!se)&&void 0!==S&&S,sstDesktop:null!==(k=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowSstDesktop)&&void 0!==k&&k,sstMobile:null!==(T=null===(E=this.buildingWebchatView)||void 0===E?void 0:E.shouldShowSstMobile)&&void 0!==T&&T,calcDesktop:le,calcMobile:ue};var ce,he;this.enabledChatWidgets=cu(de),this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(Ju(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ee&&(he=this.handleTourClicked,document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(e=>{e&&e.addEventListener("click",e=>{e.preventDefault(),he(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)&&(ce=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(ce)}`)}})),this.buildingWebchatView&&(this.primaryColor=null!==(I=this.buildingWebchatView.primaryColor)&&void 0!==I?I:null,this.backgroundColor=null!==(N=this.buildingWebchatView.secondaryColor)&&void 0!==N?N:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(M=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==M?M: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!==(R=this.buildingWebchatView.requiresConsentForChat)&&void 0!==R&&R,this.hideMobileFeatures=null!==(U=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==U&&U,this.privacyPolicyUrl=null!==(B=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==B?B:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===aa.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===aa.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===aa.EMOJI&&(this.designConcept=aa.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Vn),null===this.backgroundColor&&(this.backgroundColor=Yn);const pe=null!==(F=null===(j=this.buildingWebchatView)||void 0===j?void 0:j.phoneNumber)&&void 0!==F?F:"";let fe=null;if(Z&&(fe=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),fe&&!fe.isMatch&&(fe.number=pe)),J&&(null==fe?void 0:fe.number)){const e=Zu(fe.number,this.orgSlug,this.buildingSlug);e>0&&ea({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const ge=localStorage.getItem("eliseai_phone_number_devtest");ge&&Zu(ge,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=fe||{number:pe,isMatch:!1,isPropertyWebsiteCatchall:!0};const me=null!==(Q=null===(z=this.LeadSourceClient)||void 0===z?void 0:z.leadSource)&&void 0!==Q?Q:null;me&&(this.leadSources.includes(me)||this.leadSources.push(me)),io(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=Ec(o,e);l.setAttribute("href",s),a++,Jo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:Zo.info,buildingSlug:n,orgSlug:t})}}return 0===a&&Jo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:Zo.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&ea({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=Tc[e];if(!t)return 0;const n=`${_c}/building/${t}/units`,i=`${_c}/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&&Nc(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=Hu(this.buildingSlug),c=Gu(this.buildingSlug,d),h=c?d:Fu(this.buildingSlug,!1);if(!h.leadId)throw new Error("Lead ID is null");this.LeadSourceClient=new ra,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new Mc(this.orgSlug,this.buildingSlug),this.myPubnub=new Yu(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&&Fu(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"!==ia(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:ia(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=Hu(this.buildingSlug);g.initiatedChat&&await this.myPubnub.initializePubnub(g)},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!Gr(Wr(t)));return!!e&&!!n&&!Tr()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",Rr(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 Ko(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(),ju(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=_r(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(Dc.FOCUSABLE_SELECTOR)&&Dc.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){Jo({logType:Zo.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,b,y,v,w,C,x,$,S,A,k,E,T,_,O,P,I,N,M,D,L,R,B,j,F,H,G,z,Q,W,q;lu();const V=this.hideLauncher&&!this.isLoading&&!this._isMobile;return U`
|
|
7625
|
+
`}};Oc.AUTO_SCROLL_THRESHOLD_PX=32,Oc.styles=[Oe,ud,ld,sd,Ac],_c([ue({type:Number})],Oc.prototype,"right",void 0),_c([ue({type:Number})],Oc.prototype,"bottom",void 0),_c([ue({type:Number})],Oc.prototype,"top",void 0),_c([ue({type:Number})],Oc.prototype,"left",void 0),_c([ue({attribute:!0})],Oc.prototype,"onMount",void 0),_c([ue({attribute:!0})],Oc.prototype,"channel",void 0),_c([ue({attribute:!0})],Oc.prototype,"isHealthChat",void 0),_c([ue({attribute:!0})],Oc.prototype,"myPubnub",void 0),_c([ue({attribute:!0})],Oc.prototype,"orgSlug",void 0),_c([ue({attribute:!0})],Oc.prototype,"buildingSlug",void 0),_c([ue({attribute:!0})],Oc.prototype,"centralConvo",void 0),_c([ue({attribute:!0})],Oc.prototype,"widgetType",void 0),_c([ue({attribute:!0})],Oc.prototype,"building",void 0),_c([ue({attribute:!0})],Oc.prototype,"primaryColor",void 0),_c([ue({attribute:!0})],Oc.prototype,"backgroundColor",void 0),_c([ue({attribute:!0})],Oc.prototype,"onClickExit",void 0),_c([ue({attribute:!0})],Oc.prototype,"requiresConsent",void 0),_c([ce("#message-input",!0)],Oc.prototype,"messageInput",void 0),_c([ce("#conversation-body",!0)],Oc.prototype,"messageBody",void 0),_c([de()],Oc.prototype,"_isMobile",void 0),_c([de()],Oc.prototype,"messages",void 0),_c([de()],Oc.prototype,"isLoadingMessages",void 0),_c([de()],Oc.prototype,"hasReceivedConsent",void 0),_c([de()],Oc.prototype,"privacyPolicyUrl",void 0),_c([de()],Oc.prototype,"websitePreviewMapping",void 0),Oc=Tc=_c([se("pubnub-chat")],Oc);const Pc=e=>Ku(e)?e.message:Zu(e)?`Take me to ${e.navigation.label}`:"Media message",Ic="cdn.skypack.dev/@meetelise/chat",Nc="cdn.eliseai.com/@meetelise/chat",Mc=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(Ic)||n.includes(Ic))return"skypack";if(e.includes(Nc)||n.includes(Nc))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){}},Dc=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?t.endsWith("/units")?t:`${t}/units`:t,Lc={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},Rc="https://applications.eliseai.com",Uc=["Check Availability","Apply Now"],Bc=(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&&Uc.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"),Jo({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:Zo.info,buildingSlug:i,orgSlug:n}),!0},jc=(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&&Bc(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)Bc(s[e],t,n,i)}},Fc=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)Bc(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)jc(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class Hc{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>Rr(Br(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=vo();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(Xo()).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:Rr(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:Rr(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));Jo({logType:Zo.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=ia(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:Rr(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:Rr(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Wr(e.timestampInitiallyLogged).getTime()-Wr(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:Rr(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:Rr(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=>Wr(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var Gc,zc=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 Qc=Gc=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.centralConvo=!1,this.declaredBuildingSlug="",this.orgLevel=!1,this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this._isMobile=Tr(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=fo.always,this.bedroomPreferenceRequired=!1,this.brokerIntakeEnabled=!1,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.openTourSchedulerOnLoad=!1,this.displayPubnubChat=!1,this.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=ah.Default,this.onWidgetLoaded=ru(),this.onSstClose=ru(),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=ke(),this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{var e,t;if(!this.orgSlug)return;if(!this.centralConvo&&!this.buildingSlug)return;this.centralConvo&&!this.buildingSlug&&(this.orgLevel=!0);const n=this.centralConvo?await async function(e){const t=`https://app.meetelise.com/api/pub/v1/organization/${e}/webchat/v2`,n=await r().get(t);return ca(n.data)}(this.orgSlug):await da(this.orgSlug,this.buildingSlug);if(!this.isOrgMode()){if(Math.random()<.2)try{(async(e,t)=>{const n=window.rentgrata;if(!n)return;const i=n.Widget;if(!i)return;const o=i.config;if(!o)return;const a=o.widgetKey;a&&await r().post(`https://app.meetelise.com/platformApi/webchat/rentgrata?token=${a}`,{},{headers:{"Content-Type":"application/json","building-slug":null!=e?e:"","org-slug":null!=t?t:""}})})(this.buildingSlug,this.orgSlug)}catch(e){}try{Mc(this.orgSlug,this.buildingSlug)}catch(e){}}if(!await rs(n,this.buildingSlug,this.orgSlug))return;ea({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==n?void 0:n.launchedDateTime)?.01:.05}),this.buildingWebchatView=n;const i=(()=>{try{const e="true"===sessionStorage.getItem(Qu);return sessionStorage.removeItem(Qu),e}catch{return!1}})();await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),(e=>{const t=new URLSearchParams(window.location.search),n=t.get("rwg_token"),i=t.get("elise_google_env");if(!n||!i||!e)return;const r={rwgToken:n,environment:i,buildingId:e,expiresAt:Date.now()+2592e6};localStorage.setItem(qa,JSON.stringify(r))})(null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.id)&&void 0!==t?t:0),i?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0):"tour"===new URLSearchParams(window.location.search).get("elise_open")&&(this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile)?this.openTourSchedulerOnLoad=!0:this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)?(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.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,b,y,v,w,C,x,$,S,A,k,E,T,_,O,P,I,N,M,D,L,R,U,B,j,F,H,G,z,Q,W,q,V,Y,K,X;const Z=this.buildingWebchatView;if(!Z)return;Z&&this.orgSlug&&!this.orgLevel&&qc(this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.chatId)&&void 0!==t?t:null,this.sampleRateToUse,this.buildingSlug,null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null);const J=Z.featureFlagWebchatMarketingSourceDropdownConfiguration,ee=Z.featureFlagWebchatUseDniPhoneNumberBySource,te=Z.featureFlagInsertDniIntoWebsite,ne=Z.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;var ie;ie=Co.includes(Z.orgId),$o=ie;const[re,oe,ae,se,le]=await Promise.all([this.isOrgMode()?Promise.resolve([]):ku(this.orgSlug,this.buildingSlug),go(this.buildingSlug),Tu(this.buildingSlug),bo(this.buildingSlug),yo(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Gn(Z.phoneNumber),this.buildingWebchatView.isAip=ae),this.leadSources=re,this.featureFlagShowDropdown=J,this.bedroomPreferenceRequired=se,this.brokerIntakeEnabled=le;const ue=this.orgLevel?null:Z.textWithUsPhoneNumber?Z.textWithUsPhoneNumber:await(async e=>{try{const t="https://app.meetelise.com",n=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(n.data)return n.data}catch(t){return Jo({logType:Zo.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t},error:t}),null}return null})(this.buildingSlug),de=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,ce=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,he={callDesktop:null!==(d=null===(u=this.buildingWebchatView)||void 0===u?void 0:u.shouldShowPhoneDesktop)&&void 0!==d&&d,callMobile:null!==(h=null===(c=this.buildingWebchatView)||void 0===c?void 0:c.shouldShowPhoneMobile)&&void 0!==h&&h,chatDesktop:null!==(f=null===(p=this.buildingWebchatView)||void 0===p?void 0:p.shouldShowChatDesktop)&&void 0!==f&&f,chatMobile:null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.shouldShowChatMobile)&&void 0!==m&&m,emailDesktop:null!==(y=null===(b=this.buildingWebchatView)||void 0===b?void 0:b.shouldShowEmailDesktop)&&void 0!==y&&y,emailMobile:null!==(w=null===(v=this.buildingWebchatView)||void 0===v?void 0:v.shouldShowEmailMobile)&&void 0!==w&&w,textDesktop:null!==(x=(null===(C=this.buildingWebchatView)||void 0===C?void 0:C.shouldShowTextDesktop)&&!!ue)&&void 0!==x&&x,textMobile:null!==(S=(null===($=this.buildingWebchatView)||void 0===$?void 0:$.shouldShowTextMobile)&&!!ue)&&void 0!==S&&S,sstDesktop:null!==(k=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowSstDesktop)&&void 0!==k&&k,sstMobile:null!==(T=null===(E=this.buildingWebchatView)||void 0===E?void 0:E.shouldShowSstMobile)&&void 0!==T&&T,calcDesktop:de,calcMobile:ce};var pe,fe;this.enabledChatWidgets=this.withOrgLevelContactOptions(cu(he),null!==(O=null===(_=this.buildingWebchatView)||void 0===_?void 0:_.phoneNumber)&&void 0!==O?O:""),this.orgLevel||(this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(rd(this.handleTourClicked,this.orgSlug,this.buildingSlug,()=>this.isConnected),ne&&(fe=this.handleTourClicked,document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(e=>{e&&e.addEventListener("click",e=>{e.preventDefault(),fe(e)})})),"radco"===this.orgSlug&&(e=>{document.querySelectorAll('a[href^="#leaseleads-tour-open"]').forEach(t=>{var n;if(!t)return;const i=document.createElement("a");i.textContent=t.textContent,i.style.cursor="pointer",i.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(n=t.parentNode)||void 0===n||n.replaceChild(i,t)})})(this.handleTourClicked)):(null===(P=this.LeadSourceClient)||void 0===P?void 0:P.leadSource)&&(pe=null!==(N=null===(I=this.LeadSourceClient)||void 0===I?void 0:I.leadSource)&&void 0!==N?N:null,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(pe)}`)}}))),this.buildingWebchatView&&(this.primaryColor=null!==(M=this.buildingWebchatView.primaryColor)&&void 0!==M?M:null,this.backgroundColor=null!==(D=this.buildingWebchatView.secondaryColor)&&void 0!==D?D:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(L=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==L?L:null,this.foregroundColorOnSecondaryBackgroundColor=null!==(R=this.buildingWebchatView.foregroundColorOnSecondaryBackgroundColor)&&void 0!==R?R:null,this.webchatConfigHasAutoOpenChat=null!==(U=this.buildingWebchatView.autoOpenChat)&&void 0!==U&&U,this.requiresConsent=null!==(B=this.buildingWebchatView.requiresConsentForChat)&&void 0!==B&&B,this.hideMobileFeatures=null!==(j=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==j&&j,this.privacyPolicyUrl=null!==(F=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==F?F:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===aa.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===aa.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===aa.EMOJI&&(this.designConcept=aa.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Vn),null===this.backgroundColor&&(this.backgroundColor=Yn);const ge=null!==(G=null===(H=this.buildingWebchatView)||void 0===H?void 0:H.phoneNumber)&&void 0!==G?G:"";let me=null;if(ee&&!this.orgLevel&&(me=await async function(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return n.data?{number:Gn(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(Q=null===(z=this.LeadSourceClient)||void 0===z?void 0:z.leadSource)&&void 0!==Q?Q:null),me&&!me.isMatch&&(me.number=ge)),te&&(null==me?void 0:me.number)){const e=id(me.number,this.orgSlug,this.buildingSlug);e>0&&ea({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const be=localStorage.getItem("eliseai_phone_number_devtest");be&&id(be,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=me||{number:ge,isMatch:!1,isPropertyWebsiteCatchall:!0};const ye=null!==(q=null===(W=this.LeadSourceClient)||void 0===W?void 0:W.leadSource)&&void 0!==q?q:null;ye&&(this.leadSources.includes(ye)||this.leadSources.push(ye)),this.isOrgMode()||io(Z.id);if((oe||(null===(V=this.buildingWebchatView)||void 0===V?void 0:V.isAip))&&(null===(Y=this.buildingWebchatView)||void 0===Y?void 0:Y.isLiveOnApplications)&&this.buildingSlug&&!this.orgLevel){const e=((e,t,n)=>{var i;const r=[/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/content\/apply/,/\/apply-now/,/\/apply/,/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,/busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/],o=document.body.getElementsByTagName("a");let a=0;for(let s=0;s<o.length;s++){const l=o[s];if(l.nodeType===Node.ELEMENT_NODE&&r.some(e=>e.test(l.href))){const r=l.getAttribute("href"),o=(null===(i=l.textContent)||void 0===i?void 0:i.toLowerCase())||"",s=Dc(o,e);l.setAttribute("href",s),a++,Jo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:Zo.info,buildingSlug:n,orgSlug:t})}}return 0===a&&Jo({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:Zo.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&ea({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_application_link_replacement_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}if(this.buildingSlug&&this.orgSlug&&!this.orgLevel)try{(e=>{const t=Lc[e];if(!t)return 0;const n=`${Rc}/building/${t}/units`,i=`${Rc}/building/${e}/units`,r=new RegExp(`https://applications\\.eliseai\\.com/building/${t}/units`,"g");let o=0;const a=document.body.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a[e],s=t.getAttribute("href");if(!s||!s.includes(n))continue;const l=s.replace(r,i);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(n))return;const a=t.replace(r,i);a!==t&&(e.setAttribute("onclick",a),o++)})})(this.buildingSlug)}catch{}this.buildingSlug&&!this.orgLevel&&(null===(K=this.buildingWebchatView)||void 0===K?void 0:K.isLiveOnApplications)&&(null===(X=this.buildingWebchatView)||void 0===X?void 0:X.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&Fc(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,n,i,r,o,a,s,l,u;if(!this.buildingWebchatView)return;const d=this.chatStorageSlug(),c=Hu(d),h=Gu(d,c),p=h?c:Fu(d,!1);if(!p.leadId)throw new Error("Lead ID is null");if(this.LeadSourceClient=new ra,this.LeadSourceClient.orgId=null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.orgId)&&void 0!==t?t:0,this.LeadSourceMultitouchClient=new Hc(this.orgSlug,this.buildingSlug),this.myPubnub=new ed(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,p.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType),this.myPubnub.chatStorageSlug=d,this.centralConvo){const e=this.myPubnub;e.centralConvo=!0,this.fetchDeclaredBuildingId().then(t=>{e.declaredBuildingId=t})}else this.myPubnub.declaredBuildingId=this.buildingWebchatView.id;const f=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,h&&null!==(n=p.leadId)&&void 0!==n?n:void 0);f&&(Fu(d,p.initiatedChat,f.lead_id),this.isOrgMode()&&f.building_slug&&await this.adoptBuilding(f.building_slug)),this.LeadSourceClient.chatId=this.myPubnub.channel;const g=await(null===(i=this.LeadSourceClient)||void 0===i?void 0:i.generateUserLeadSource({leadId:null!==(o=null===(r=this.myPubnub)||void 0===r?void 0:r.leadUserId)&&void 0!==o?o:"",orgSlug:this.orgSlug,buildingSlug:this.buildingSlug}));g&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(g),"property-website"!==ia(this.orgSlug)?this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:ia(this.orgSlug):this.myPubnub.leadSource=null!==(u=null===(l=this.LeadSourceClient)||void 0===l?void 0:l.leadSource)&&void 0!==u?u:null;const m=Hu(d);m.initiatedChat&&await this.myPubnub.initializePubnub(m)},this.isOrgMode=()=>this.centralConvo&&!this.buildingSlug,this.chatStorageSlug=()=>this.orgLevel?"":this.buildingSlug,this.adoptBuilding=async e=>{var t;try{const n=await da(this.orgSlug,e);if(!(null==n?void 0:n.id))return;this.buildingSlug=e,this.buildingWebchatView=n,null===(t=this.myPubnub)||void 0===t||t.adoptBuilding(e,n)}catch(e){}},this.withOrgLevelContactOptions=(e,t)=>this.orgLevel?{...e,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,callDesktop:e.callDesktop&&!!t,callMobile:e.callMobile&&!!t}:e,this.fetchDeclaredBuildingId=async()=>{if(!this.declaredBuildingSlug||!this.orgSlug)return null;try{const e=await da(this.orgSlug,this.declaredBuildingSlug);return"number"==typeof(null==e?void 0:e.id)&&e.id>0?e.id:null}catch{return null}},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!Gr(Wr(t)));return!!e&&!!n&&!Tr()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",Rr(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 Ko(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(),ju(this.chatStorageSlug()),this.orgLevel&&(this.buildingSlug=""),this.myPubnub=null,this.displayPubnubChat=!1,await this.setupWebchat(),this.hideLauncher=!1}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustPositionChatAdditionalActions),window.addEventListener("keydown",this.handleKeydownTab),this._cleanupMobileListener=_r(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(Gc.FOCUSABLE_SELECTOR)&&Gc.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){Jo({logType:Zo.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,b,y,v,w,C,x,$,S,A,k,E,T,_,O,P,I,N,M,D,L,R,B,j,F,H,G,z,Q,W,q;lu();const V=this.hideLauncher&&!this.isLoading&&!this._isMobile;return U`
|
|
7589
7626
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7590
7627
|
${this.displayPubnubChat?U`
|
|
7591
7628
|
<pubnub-chat
|
|
@@ -7594,7 +7631,8 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7594
7631
|
.myPubnub=${this.myPubnub}
|
|
7595
7632
|
.orgSlug=${this.orgSlug}
|
|
7596
7633
|
.buildingSlug=${this.buildingSlug}
|
|
7597
|
-
.
|
|
7634
|
+
.centralConvo=${this.centralConvo}
|
|
7635
|
+
.widgetType=${ah.Default}
|
|
7598
7636
|
.building=${this.buildingWebchatView}
|
|
7599
7637
|
.primaryColor=${this.primaryColor}
|
|
7600
7638
|
.backgroundColor=${this.backgroundColor}
|
|
@@ -7702,7 +7740,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7702
7740
|
</meetelise-launcher>`:""}
|
|
7703
7741
|
</div>
|
|
7704
7742
|
</meta>
|
|
7705
|
-
`}};
|
|
7743
|
+
`}};Qc.styles=u`
|
|
7706
7744
|
:host {
|
|
7707
7745
|
all: initial;
|
|
7708
7746
|
}
|
|
@@ -7751,7 +7789,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7751
7789
|
position: fixed;
|
|
7752
7790
|
bottom: 0;
|
|
7753
7791
|
}
|
|
7754
|
-
`,
|
|
7792
|
+
`,Qc.FOCUSABLE_SELECTOR="a[href]:not([tabindex='-1']), input:not([disabled]), button:not([disabled]), textarea, [tabindex]:not([tabindex='-1'])",zc([ue({type:String})],Qc.prototype,"buildingSlug",void 0),zc([ue({type:String})],Qc.prototype,"orgSlug",void 0),zc([ue({type:Boolean})],Qc.prototype,"centralConvo",void 0),zc([ue({type:String})],Qc.prototype,"declaredBuildingSlug",void 0),zc([ue({type:Object})],Qc.prototype,"launcherStyles",void 0),zc([ue()],Qc.prototype,"mobileStyles",void 0),zc([ue({type:Boolean})],Qc.prototype,"isMinimized",void 0),zc([ue({type:String})],Qc.prototype,"primaryColor",void 0),zc([ue({type:String})],Qc.prototype,"backgroundColor",void 0),zc([ue({type:String})],Qc.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),zc([ue({type:String})],Qc.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),zc([de()],Qc.prototype,"_isMobile",void 0),zc([de()],Qc.prototype,"chatId",void 0),zc([de()],Qc.prototype,"analytics",void 0),zc([de()],Qc.prototype,"launcher",void 0),zc([de()],Qc.prototype,"buildingWebchatView",void 0),zc([de()],Qc.prototype,"designConcept",void 0),zc([de()],Qc.prototype,"leadSources",void 0),zc([de()],Qc.prototype,"currentLeadSource",void 0),zc([de()],Qc.prototype,"featureFlagShowDropdown",void 0),zc([de()],Qc.prototype,"bedroomPreferenceRequired",void 0),zc([de()],Qc.prototype,"brokerIntakeEnabled",void 0),zc([de()],Qc.prototype,"phoneNumberForSource",void 0),zc([de()],Qc.prototype,"hasMounted",void 0),zc([de()],Qc.prototype,"hideLauncher",void 0),zc([de()],Qc.prototype,"isLoading",void 0),zc([de()],Qc.prototype,"showTourNextToChat",void 0),zc([de()],Qc.prototype,"openTourSchedulerOnLoad",void 0),zc([de()],Qc.prototype,"displayPubnubChat",void 0),zc([de()],Qc.prototype,"myPubnub",void 0),zc([de()],Qc.prototype,"LeadSourceClient",void 0),zc([de()],Qc.prototype,"LeadSourceMultitouchClient",void 0),zc([de()],Qc.prototype,"sampleRateToUse",void 0),zc([ue({type:Number})],Qc.prototype,"right",void 0),zc([ue({type:Number})],Qc.prototype,"bottom",void 0),zc([ue({type:Number})],Qc.prototype,"top",void 0),zc([ue({type:Number})],Qc.prototype,"left",void 0),zc([ue({attribute:!0})],Qc.prototype,"overrideRentgrata",void 0),zc([ue({attribute:!0})],Qc.prototype,"widgetType",void 0),zc([ue()],Qc.prototype,"onWidgetLoaded",void 0),zc([ue({attribute:!0})],Qc.prototype,"onSstClose",void 0),zc([de()],Qc.prototype,"enabledChatWidgets",void 0),zc([de()],Qc.prototype,"webchatConfigHasAutoOpenChat",void 0),zc([de()],Qc.prototype,"requiresConsent",void 0),zc([de()],Qc.prototype,"hideMobileFeatures",void 0),zc([de()],Qc.prototype,"privacyPolicyUrl",void 0),Qc=Gc=zc([se("me-chat")],Qc);const Wc=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},qc=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(po(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=Wc(["myContactForm","contactus","fpa-myContactForm"]);let u;if(!(l&&l instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&Vc(i,e,"Could not find form",t?{id:t.id}:void 0))}try{if(l.parentElement&&"scheduleTourForm"===l.parentElement.id)return Vc(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 Vc(i,e,"Could not find submit button");const d=()=>({firstName:Wc(["firstname","txtName","fpa-firstname","Form_FirstName"]),lastName:Wc(["lastname","txtName2","fpa-lastname","Form_LastName"]),email:Wc(["email","txtEmail","fpa-email","Form_Email"]),phone:Wc(["phonenumber","txtPhone","fpa-phonenumber","Form_Phone"]),message:Wc(["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 Vc(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&&ea({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 da(e,i);if(!r)return Vc(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,ia(e)]:[ia(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})}},Vc=(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})},Yc=u`
|
|
7755
7793
|
.chat-launcher {
|
|
7756
7794
|
position: fixed;
|
|
7757
7795
|
}
|
|
@@ -7782,7 +7820,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7782
7820
|
filter: brightness(1.1);
|
|
7783
7821
|
}
|
|
7784
7822
|
}
|
|
7785
|
-
`;var
|
|
7823
|
+
`;var Kc=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let Xc=class extends 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?U`
|
|
7786
7824
|
<div
|
|
7787
7825
|
class="chat-launcher"
|
|
7788
7826
|
style=${qn({top:Tr()||isNaN(this.top)?void 0:`${this.top+432}px`,bottom:Tr()||isNaN(this.bottom)?"72px":this.bottom-60+"px",left:Tr()||isNaN(this.left)?void 0:`${this.left}px`,right:Tr()||isNaN(this.right)?"18px":`${this.right}px`})}
|
|
@@ -7836,12 +7874,12 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7836
7874
|
/>
|
|
7837
7875
|
</svg>
|
|
7838
7876
|
</button>
|
|
7839
|
-
</div>`}};
|
|
7877
|
+
</div>`}};Xc.styles=[Yc],Kc([ue({type:Number})],Xc.prototype,"right",void 0),Kc([ue({type:Number})],Xc.prototype,"bottom",void 0),Kc([ue({type:Number})],Xc.prototype,"top",void 0),Kc([ue({type:Number})],Xc.prototype,"left",void 0),Kc([ue({attribute:!0})],Xc.prototype,"isChatOpen",void 0),Kc([ue({attribute:!0})],Xc.prototype,"onClickCloseChat",void 0),Kc([ue({attribute:!0})],Xc.prototype,"onClickOpenChat",void 0),Xc=Kc([se("simple-launcher")],Xc);var Zc=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 Jc=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=ke(),this.firstUpdated=async()=>{await this.initializeChatVariables()},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=Hu(this.healthcareId),t=Gu(this.healthcareId,e)?e:Fu(this.healthcareId,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new ed(this.healthcareId,null,"",this.currentLeadSource,t.leadId,null,null,ah.Healthcare),t.initiatedChat&&await this.myPubnub.initializePubnub(e),Tr()||(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(),ju(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 lu(),this.isLoading?U``:U`
|
|
7840
7878
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
7841
7879
|
${this.displayPubnubChat?U`
|
|
7842
7880
|
<pubnub-chat
|
|
7843
7881
|
id="pubnub-chat"
|
|
7844
|
-
.widgetType=${
|
|
7882
|
+
.widgetType=${ah.Healthcare}
|
|
7845
7883
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
7846
7884
|
.myPubnub=${this.myPubnub}
|
|
7847
7885
|
.buildingSlug=${this.healthcareId}
|
|
@@ -7867,7 +7905,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7867
7905
|
></simple-launcher>
|
|
7868
7906
|
|
|
7869
7907
|
</meta>
|
|
7870
|
-
`}};
|
|
7908
|
+
`}};Jc.styles=u`
|
|
7871
7909
|
:host {
|
|
7872
7910
|
all: initial;
|
|
7873
7911
|
}
|
|
@@ -7920,13 +7958,13 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7920
7958
|
line-height: 150%;
|
|
7921
7959
|
font-size: 16px;
|
|
7922
7960
|
}
|
|
7923
|
-
`,
|
|
7961
|
+
`,Zc([ue({type:String})],Jc.prototype,"healthcareId",void 0),Zc([ue({type:Number})],Jc.prototype,"right",void 0),Zc([ue({type:Number})],Jc.prototype,"bottom",void 0),Zc([ue({type:Number})],Jc.prototype,"top",void 0),Zc([ue({type:Number})],Jc.prototype,"left",void 0),Zc([de()],Jc.prototype,"launcher",void 0),Zc([de()],Jc.prototype,"currentLeadSource",void 0),Zc([de()],Jc.prototype,"displayPubnubChat",void 0),Zc([de()],Jc.prototype,"myPubnub",void 0),Zc([de()],Jc.prototype,"requiresConsent",void 0),Zc([de()],Jc.prototype,"privacyPolicyUrl",void 0),Zc([de()],Jc.prototype,"isLoading",void 0),Jc=Zc([se("health-chat")],Jc);var eh=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 th=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=ke(),this.firstUpdated=async()=>{(await async function(e){if(!e)return!1;const t="e2e-test-yardi-building";try{return(await r().get(po(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=Hu(this.orgSlug),t=Gu(this.orgSlug,e)?e:Fu(this.orgSlug,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new ed(this.orgSlug,null,this.orgSlug,this.currentLeadSource,t.leadId,null,null,ah.Utilities),t.initiatedChat&&await this.myPubnub.initializePubnub(e),Tr()||(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(),ju(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 lu(),this.isLoading?U``:U`
|
|
7924
7962
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
7925
7963
|
${this.displayPubnubChat?U`
|
|
7926
7964
|
<pubnub-chat
|
|
7927
7965
|
id="pubnub-chat"
|
|
7928
7966
|
.channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
|
|
7929
|
-
.widgetType=${
|
|
7967
|
+
.widgetType=${ah.Utilities}
|
|
7930
7968
|
.myPubnub=${this.myPubnub}
|
|
7931
7969
|
.buildingSlug=${this.orgSlug}
|
|
7932
7970
|
.onClickExit=${()=>{this.displayPubnubChat=!1}}
|
|
@@ -7950,7 +7988,7 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
7950
7988
|
|
|
7951
7989
|
></simple-launcher>
|
|
7952
7990
|
</meta>
|
|
7953
|
-
`}};
|
|
7991
|
+
`}};th.styles=u`
|
|
7954
7992
|
:host {
|
|
7955
7993
|
all: initial;
|
|
7956
7994
|
}
|
|
@@ -8003,4 +8041,4 @@ xmlns="http://www.w3.org/2000/svg"
|
|
|
8003
8041
|
line-height: 150%;
|
|
8004
8042
|
font-size: 16px;
|
|
8005
8043
|
}
|
|
8006
|
-
`,
|
|
8044
|
+
`,eh([ue({type:String})],th.prototype,"orgSlug",void 0),eh([ue({type:Number})],th.prototype,"right",void 0),eh([ue({type:Number})],th.prototype,"bottom",void 0),eh([ue({type:Number})],th.prototype,"top",void 0),eh([ue({type:Number})],th.prototype,"left",void 0),eh([de()],th.prototype,"launcher",void 0),eh([de()],th.prototype,"currentLeadSource",void 0),eh([de()],th.prototype,"displayPubnubChat",void 0),eh([de()],th.prototype,"myPubnub",void 0),eh([de()],th.prototype,"requiresConsent",void 0),eh([de()],th.prototype,"privacyPolicyUrl",void 0),eh([de()],th.prototype,"isLoading",void 0),th=eh([se("utilities-chat")],th);const nh=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&&Jo({logType:i&&i.data?Zo.info:Zo.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},ih=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 rh{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}),sh();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),rh.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}),sh(),e.studio&&!e.building)return void this.handleStudioContext(e);let d=null;switch(e.widgetType){case ah.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case ah.Default:d=document.createElement("me-chat");break;case ah.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||ah.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 Qc&&(e.centralConvo?(d.setAttribute("centralConvo","true"),e.building&&d.setAttribute("declaredBuildingSlug",e.building)):this.handleBuildingslug(d,e.organization,e.building,e),e.launcherStyles&&(d.launcherStyles=e.launcherStyles),e.mobileStyles&&(d.mobileStyles=e.mobileStyles),e.onWidgetLoaded&&(d.onWidgetLoaded=e.onWidgetLoaded),e.overrideRentgrata&&((async()=>{const e=await ih("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 Qc&&(rh.meChat=d),d instanceof th&&(rh.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),rh.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 Jo({logType:Zo.warn,logTitle:"[STUDIO_WEBCHAT_CONTEXT_SITE_MISMATCH]",logData:{activeSiteId:t.studio.siteId,contextSiteId:e.siteId,url:window.location.href}});const i=oh(e.organization),r=oh(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 nh(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,nh(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&&Jo({logType:n&&n.data?Zo.info:Zo.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&&Jo({logType:i&&i.data===e?Zo.info:Zo.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 oh(e){return"string"!=typeof e?"":e.trim()}var ah;rh.meChat=null,rh.healthChat=null,rh.utilitiesChat=null,rh.orgSlug="",rh.mutationObserver=null,rh.previousUrl="",rh.hasBuildingSlug=null,rh.brandColor="",rh.backgroundColor="",rh.healthcareId="",rh.activeStudioOrgSlug="",rh.activeStudioBuildingSlug="",rh.activeStudioSessionScopeKey="",rh.activeStudioOptions=null,rh.studioUpdateToken=0,rh.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(ah||(ah={}));const sh=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{ah as WidgetType,rh as default};
|