@meetelise/chat 1.61.0 → 1.61.1

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.
@@ -9,5 +9,5 @@ export declare function fetchFeatureFlagShowUtilities(orgSlug: string): Promise<
9
9
  export declare function fetchFeatureFlagUseApplicationsLinkReplacement(buildingSlug: string): Promise<boolean>;
10
10
  export declare function fetchTrackedRolloutBedroomPreferenceRequired(buildingSlug: string): Promise<boolean>;
11
11
  export declare function fetchTrackedRolloutCoastalCustomTourTypes(buildingSlug: string): Promise<boolean>;
12
- /** Whether the building has broker intake on, so the email form offers the broker referral fields. */
12
+ /** Whether brokers are on for the building (the broker_rollout rollout), so the email form offers the broker referral fields. */
13
13
  export declare function fetchTrackedRolloutBrokerIntake(buildingSlug: string): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.61.0",
3
+ "version": "1.61.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/MeetElise/chat-ui#readme",
@@ -77,7 +77,7 @@
77
77
  "lint-staged": "^11.1.2",
78
78
  "prettier": "^2.4.1",
79
79
  "rimraf": "^6.0.1",
80
- "semantic-release": "^21.0.0",
80
+ "semantic-release": "25.0.9",
81
81
  "sinon": "^11.1.2",
82
82
  "sort-package-json": "^3.0.0",
83
83
  "style-loader": "^3.3.1",
@@ -757,7 +757,7 @@ var e={2:(e,t,n)=>{var i=n(2199),r=n(4664),o=n(5950);e.exports=function(e){retur
757
757
  .option.active {
758
758
  background-color: var(--active-option-color);
759
759
  }
760
- `,Me],Br([pe({attribute:!1})],jr.prototype,"options",void 0),Br([pe({type:String})],jr.prototype,"placeholder",void 0),Br([pe({type:String})],jr.prototype,"value",void 0),Br([fe()],jr.prototype,"activeOption",void 0),Br([fe()],jr.prototype,"isOpen",void 0),Br([fe()],jr.prototype,"activeOptionIndex",void 0),Br([fe()],jr.prototype,"searchTerm",void 0),Br([ge("#select",!0)],jr.prototype,"meSelect",void 0),Br([ge("#selectText",!0)],jr.prototype,"selectInput",void 0),jr=Br([ce("me-select")],jr),function(e){e.Unknown="UNKNOWN",e.SelfGuided="SELF_GUIDED",e.VirtualShowing="VIRTUAL_SHOWING",e.WithAgent="WITH_AGENT",e.MediaTour="MEDIA_TOUR"}(zr||(zr={}));var Qr=n(2013),Wr=n.n(Qr);Math.pow(10,8);var Vr=6e4,qr=36e5;function Yr(e,t){si(1,arguments);var n=t||{},i=null==n.additionalDigits?2:$i(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=function(e){var t,n={},i=e.split(Kr.dateTimeDelimiter);if(i.length>2)return n;/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],Kr.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Kr.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var r=Kr.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}(e);if(o.date){var a=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((i[1]||i[2]).length)}}(o.date,i);r=function(e,t){if(null===t)return new Date(NaN);var n=e.match(Xr);if(!n)return new Date(NaN);var i=!!n[4],r=eo(n[1]),o=eo(n[2])-1,a=eo(n[3]),s=eo(n[4]),l=eo(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=i.getUTCDay()||7,o=7*(t-1)+n+1-r;return i.setUTCDate(i.getUTCDate()+o),i}(t,s,l):new Date(NaN);var u=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(no[t]||(io(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(io(e)?366:365)}(t,r)?(u.setUTCFullYear(t,o,Math.max(r,a)),u):new Date(NaN)}(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,l=r.getTime(),u=0;if(o.time&&(u=function(e){var t=e.match(Zr);if(!t)return NaN;var n=to(t[1]),i=to(t[2]),r=to(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r))return NaN;return n*qr+i*Vr+1e3*r}(o.time),isNaN(u)))return new Date(NaN);if(!o.timezone){var d=new Date(l+u),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=function(e){if("Z"===e)return 0;var t=e.match(Jr);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,r))return NaN;return n*(i*qr+r*Vr)}(o.timezone),isNaN(s)?new Date(NaN):new Date(l+u+s)}var Kr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Xr=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zr=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Jr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function eo(e){return e?parseInt(e):1}function to(e){return e&&parseFloat(e.replace(",","."))||0}var no=[31,null,31,30,31,30,31,31,30,31,30,31];function io(e){return e%400==0||e%4==0&&e%100!=0}const ro={buildingId:null,availabilities:{}},oo=()=>{ro.buildingId=null,ro.availabilities={}},ao=async e=>{e&&(ro.buildingId=e);const t=ro.buildingId;if(!t)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const n=ro.availabilities;if(n[t])return n[t];const i=Hr(),o=Fr(function(e){si(1,arguments);var t=li(e);return t.setHours(23,59,59,999),t}(Gr(i,30))),a=`https://app.meetelise.com/api/pub/v1/buildings/${t}/tour/availabilities?${`startTime=${encodeURIComponent(Fr(i))}&endTime=${encodeURIComponent(o)}`}`,s=await r().get(a);return ro.availabilities[t]=s.data,s.data},so=async(e,t)=>{var n,i;const r=await ao(t),o=(null===(n=r.availability)||void 0===n?void 0:n[e])?null===(i=r.availability)||void 0===i?void 0:i[e].availableTourStartTimes:[];return r.availability?{...r.availability[e],availableTourStartTimes:o}:null},lo=async()=>{var e,t,n,i,r,o;return{[du.Guided]:!!(null===(t=null===(e=await so(zr.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[du.Self]:!!(null===(i=null===(n=await so(zr.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[du.Virtual]:!!(null===(o=null===(r=await so(zr.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}},uo=async(e,t)=>{var n,i;const r=await so(e,t);if(!r)return{};const o={availableTourStartTimes:null===(n=r.availableTourStartTimes?r.availableTourStartTimes.filter(e=>di(Yr(e))&&!function(e){return si(1,arguments),li(e).getTime()<Date.now()}(Yr(e))):[])||void 0===n?void 0:n.map(e=>co(e))};return Wr()(null!==(i=o.availableTourStartTimes)&&void 0!==i?i:[],e=>ir(new Date(e.datetime),"yyyy-MM-dd"))},co=e=>({datetime:e.slice(0,19),offset:e.slice(19)});var ho=n(3916),po=n.n(ho),fo=n(2485),go=n.n(fo);const mo=e=>`https://app.meetelise.com/platformApi/webchat/${e}/chat-ui-feature-flag`;var bo;async function yo(e){if(!e)return!1;try{return(await r().get(mo(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-applications-link-replacement",default_str:null,default_bool:!1}})).data}catch(e){return!1}}!function(e){e.onAttributionFailure="on-attribution-failure",e.never="never",e.always="always"}(bo||(bo={}));const vo=e=>`https://app.meetelise.com/platformApi/webchat/${e}/tracked-rollout`;async function wo(e){if(!e)return!1;try{return(await r().get(vo(e),{params:{rollout_name:"webchat_bedroom_preference_required",default_value:!1}})).data}catch(e){return!1}}async function Co(e){if(!e)return!1;try{return!0===(await r().get(vo(e),{params:{rollout_name:"broker_intake",default_value:!1},timeout:3e3})).data}catch(e){return!1}}function xo(){return $o()?function(){const e=window.location.search,t={},n=e.split("?").slice(1).join("&");return n.split("&").forEach(e=>{const[n,i]=e.split("=");n&&i&&(t[decodeURIComponent(n)]=decodeURIComponent(i))}),t}():function(){const e=new URLSearchParams(window.location.search),t=e.has("utm_content"),n=e.has("utm_source");if(t&&!n){const t=e.get("utm_content");e.delete("utm_content"),e.set("utm_source",t)}return Object.fromEntries(e)}()}const $o=()=>(window.location.search.match(/\?/g)||[]).length>1,So=[57,2575,2332],Ao=["email","phone","firstName","lastName","message","tourDetails"];let ko=!1;const Eo=(e,t={})=>{window.dataLayer=window.dataLayer||[];let n=t;if(ko){n={...t};for(const e of Ao)delete n[e]}window.dataLayer.push({event:e,...n})};class To extends we{constructor(e){if(super(e),this.it=Q,e.type!==ye)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Q||null==e)return this.ft=void 0,this.it=e;if(e===z)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.ft;this.it=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}To.directiveName="unsafeHTML",To.resultType=1;const _o=ve(To),Oo=G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
760
+ `,Me],Br([pe({attribute:!1})],jr.prototype,"options",void 0),Br([pe({type:String})],jr.prototype,"placeholder",void 0),Br([pe({type:String})],jr.prototype,"value",void 0),Br([fe()],jr.prototype,"activeOption",void 0),Br([fe()],jr.prototype,"isOpen",void 0),Br([fe()],jr.prototype,"activeOptionIndex",void 0),Br([fe()],jr.prototype,"searchTerm",void 0),Br([ge("#select",!0)],jr.prototype,"meSelect",void 0),Br([ge("#selectText",!0)],jr.prototype,"selectInput",void 0),jr=Br([ce("me-select")],jr),function(e){e.Unknown="UNKNOWN",e.SelfGuided="SELF_GUIDED",e.VirtualShowing="VIRTUAL_SHOWING",e.WithAgent="WITH_AGENT",e.MediaTour="MEDIA_TOUR"}(zr||(zr={}));var Qr=n(2013),Wr=n.n(Qr);Math.pow(10,8);var Vr=6e4,qr=36e5;function Yr(e,t){si(1,arguments);var n=t||{},i=null==n.additionalDigits?2:$i(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r,o=function(e){var t,n={},i=e.split(Kr.dateTimeDelimiter);if(i.length>2)return n;/:/.test(i[0])?t=i[0]:(n.date=i[0],t=i[1],Kr.timeZoneDelimiter.test(n.date)&&(n.date=e.split(Kr.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var r=Kr.timezone.exec(t);r?(n.time=t.replace(r[1],""),n.timezone=r[1]):n.time=t}return n}(e);if(o.date){var a=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:null===o?r:100*o,restDateString:e.slice((i[1]||i[2]).length)}}(o.date,i);r=function(e,t){if(null===t)return new Date(NaN);var n=e.match(Xr);if(!n)return new Date(NaN);var i=!!n[4],r=eo(n[1]),o=eo(n[2])-1,a=eo(n[3]),s=eo(n[4]),l=eo(n[5])-1;if(i)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,l)?function(e,t,n){var i=new Date(0);i.setUTCFullYear(e,0,4);var r=i.getUTCDay()||7,o=7*(t-1)+n+1-r;return i.setUTCDate(i.getUTCDate()+o),i}(t,s,l):new Date(NaN);var u=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(no[t]||(io(e)?29:28))}(t,o,a)&&function(e,t){return t>=1&&t<=(io(e)?366:365)}(t,r)?(u.setUTCFullYear(t,o,Math.max(r,a)),u):new Date(NaN)}(a.restDateString,a.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var s,l=r.getTime(),u=0;if(o.time&&(u=function(e){var t=e.match(Zr);if(!t)return NaN;var n=to(t[1]),i=to(t[2]),r=to(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,i,r))return NaN;return n*qr+i*Vr+1e3*r}(o.time),isNaN(u)))return new Date(NaN);if(!o.timezone){var d=new Date(l+u),c=new Date(0);return c.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),c.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),c}return s=function(e){if("Z"===e)return 0;var t=e.match(Jr);if(!t)return 0;var n="+"===t[1]?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,r))return NaN;return n*(i*qr+r*Vr)}(o.timezone),isNaN(s)?new Date(NaN):new Date(l+u+s)}var Kr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Xr=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Zr=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Jr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function eo(e){return e?parseInt(e):1}function to(e){return e&&parseFloat(e.replace(",","."))||0}var no=[31,null,31,30,31,30,31,31,30,31,30,31];function io(e){return e%400==0||e%4==0&&e%100!=0}const ro={buildingId:null,availabilities:{}},oo=()=>{ro.buildingId=null,ro.availabilities={}},ao=async e=>{e&&(ro.buildingId=e);const t=ro.buildingId;if(!t)throw new Error("No buildingId was provided to getRawAvailabilities and there is no buildingId cached.");const n=ro.availabilities;if(n[t])return n[t];const i=Hr(),o=Fr(function(e){si(1,arguments);var t=li(e);return t.setHours(23,59,59,999),t}(Gr(i,30))),a=`https://app.meetelise.com/api/pub/v1/buildings/${t}/tour/availabilities?${`startTime=${encodeURIComponent(Fr(i))}&endTime=${encodeURIComponent(o)}`}`,s=await r().get(a);return ro.availabilities[t]=s.data,s.data},so=async(e,t)=>{var n,i;const r=await ao(t),o=(null===(n=r.availability)||void 0===n?void 0:n[e])?null===(i=r.availability)||void 0===i?void 0:i[e].availableTourStartTimes:[];return r.availability?{...r.availability[e],availableTourStartTimes:o}:null},lo=async()=>{var e,t,n,i,r,o;return{[du.Guided]:!!(null===(t=null===(e=await so(zr.WithAgent))||void 0===e?void 0:e.availableTourStartTimes)||void 0===t?void 0:t.length),[du.Self]:!!(null===(i=null===(n=await so(zr.SelfGuided))||void 0===n?void 0:n.availableTourStartTimes)||void 0===i?void 0:i.length),[du.Virtual]:!!(null===(o=null===(r=await so(zr.VirtualShowing))||void 0===r?void 0:r.availableTourStartTimes)||void 0===o?void 0:o.length)}},uo=async(e,t)=>{var n,i;const r=await so(e,t);if(!r)return{};const o={availableTourStartTimes:null===(n=r.availableTourStartTimes?r.availableTourStartTimes.filter(e=>di(Yr(e))&&!function(e){return si(1,arguments),li(e).getTime()<Date.now()}(Yr(e))):[])||void 0===n?void 0:n.map(e=>co(e))};return Wr()(null!==(i=o.availableTourStartTimes)&&void 0!==i?i:[],e=>ir(new Date(e.datetime),"yyyy-MM-dd"))},co=e=>({datetime:e.slice(0,19),offset:e.slice(19)});var ho=n(3916),po=n.n(ho),fo=n(2485),go=n.n(fo);const mo=e=>`https://app.meetelise.com/platformApi/webchat/${e}/chat-ui-feature-flag`;var bo;async function yo(e){if(!e)return!1;try{return(await r().get(mo(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-applications-link-replacement",default_str:null,default_bool:!1}})).data}catch(e){return!1}}!function(e){e.onAttributionFailure="on-attribution-failure",e.never="never",e.always="always"}(bo||(bo={}));const vo=e=>`https://app.meetelise.com/platformApi/webchat/${e}/tracked-rollout`;async function wo(e){if(!e)return!1;try{return(await r().get(vo(e),{params:{rollout_name:"webchat_bedroom_preference_required",default_value:!1}})).data}catch(e){return!1}}async function Co(e){if(!e)return!1;try{return!0===(await r().get(vo(e),{params:{rollout_name:"broker_rollout",default_value:!1},timeout:3e3})).data}catch(e){return!1}}function xo(){return $o()?function(){const e=window.location.search,t={},n=e.split("?").slice(1).join("&");return n.split("&").forEach(e=>{const[n,i]=e.split("=");n&&i&&(t[decodeURIComponent(n)]=decodeURIComponent(i))}),t}():function(){const e=new URLSearchParams(window.location.search),t=e.has("utm_content"),n=e.has("utm_source");if(t&&!n){const t=e.get("utm_content");e.delete("utm_content"),e.set("utm_source",t)}return Object.fromEntries(e)}()}const $o=()=>(window.location.search.match(/\?/g)||[]).length>1,So=[57,2575,2332],Ao=["email","phone","firstName","lastName","message","tourDetails"];let ko=!1;const Eo=(e,t={})=>{window.dataLayer=window.dataLayer||[];let n=t;if(ko){n={...t};for(const e of Ao)delete n[e]}window.dataLayer.push({event:e,...n})};class To extends we{constructor(e){if(super(e),this.it=Q,e.type!==ye)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Q||null==e)return this.ft=void 0,this.it=e;if(e===z)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.ft;this.it=e;const t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}To.directiveName="unsafeHTML",To.resultType=1;const _o=ve(To),Oo=G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
761
761
  <rect x="1" y="1" width="22" height="22" stroke="black" stroke-width="2" rx="2"/>
762
762
  </svg>
763
763
  `,Po=(G`<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="16" height="17" viewBox="0 0 16 17" fill="none">
@@ -155,7 +155,7 @@ export async function fetchTrackedRolloutCoastalCustomTourTypes(
155
155
  }
156
156
  }
157
157
 
158
- /** Whether the building has broker intake on, so the email form offers the broker referral fields. */
158
+ /** Whether brokers are on for the building (the broker_rollout rollout), so the email form offers the broker referral fields. */
159
159
  export async function fetchTrackedRolloutBrokerIntake(
160
160
  buildingSlug: string
161
161
  ): Promise<boolean> {
@@ -163,7 +163,7 @@ export async function fetchTrackedRolloutBrokerIntake(
163
163
  try {
164
164
  const response = await axios.get(trackedRolloutEndpoint(buildingSlug), {
165
165
  params: {
166
- rollout_name: "broker_intake",
166
+ rollout_name: "broker_rollout",
167
167
  default_value: false,
168
168
  },
169
169
  // The widget waits on this with its other startup reads; a slow answer means "off", not a slow widget.