@local-logic/sdks-app 1.2.3 → 1.3.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.
- package/dist/assets/index-legacy.008d8ab5.js +40 -0
- package/dist/assets/index-legacy.74694904.js +1 -0
- package/dist/assets/index-legacy.ad6dd738.js +8 -0
- package/dist/assets/{index-legacy.07116093.js → index-legacy.f7e0f85f.js} +1 -1
- package/dist/assets/{index.c1827e8f.js → index.1e974327.js} +9 -9
- package/dist/assets/{index.1b45b39b.js → index.3a10cc5f.js} +80 -75
- package/dist/assets/index.465d1ec4.js +242 -0
- package/dist/assets/index.c6852ed8.js +1109 -0
- package/dist/assets/{polyfills-legacy.d3683099.js → polyfills-legacy.9624f473.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/types/components/Search/index.d.ts +3 -3
- package/dist/types/components/Search/index.d.ts.map +1 -1
- package/dist/types/components/Search/index.js +26 -20
- package/dist/types/components/Search/index.js.map +1 -1
- package/dist/types/components/Search/styles.d.ts +2 -2
- package/dist/types/components/Search/styles.js +3 -3
- package/dist/types/sdks/DataExplorer/components/Map/index.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/components/Map/index.js +1 -1
- package/dist/types/sdks/DataExplorer/components/Map/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/CommuteCalculator/index.js +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/index.js +1 -2
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/styles.d.ts +1 -0
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/styles.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/styles.js +4 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/styles.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/index.d.ts +14 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/index.js +44 -3
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/styles.d.ts +3 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/styles.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/styles.js +23 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Cluster/styles.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/Marker/index.d.ts +16 -0
- package/dist/types/sdks/LocalContent/Map/Markers/Marker/index.d.ts.map +1 -0
- package/dist/types/sdks/LocalContent/Map/Markers/Marker/index.js +53 -0
- package/dist/types/sdks/LocalContent/Map/Markers/Marker/index.js.map +1 -0
- package/dist/types/sdks/LocalContent/Map/Markers/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/Markers/index.js +6 -52
- package/dist/types/sdks/LocalContent/Map/Markers/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/index.js +6 -0
- package/dist/types/sdks/LocalContent/Map/index.js.map +1 -1
- package/dist/types/sdks/LocalContent/index.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/index.js +5 -2
- package/dist/types/sdks/LocalContent/index.js.map +1 -1
- package/dist/types/services/storage/browserStorage.d.ts +46 -0
- package/dist/types/services/storage/browserStorage.d.ts.map +1 -0
- package/dist/types/services/storage/browserStorage.js +56 -0
- package/dist/types/services/storage/browserStorage.js.map +1 -0
- package/dist/types/services/storage/commuteHistory.d.ts +46 -0
- package/dist/types/services/storage/commuteHistory.d.ts.map +1 -0
- package/dist/types/services/storage/commuteHistory.js +54 -0
- package/dist/types/services/storage/commuteHistory.js.map +1 -0
- package/package.json +4 -3
- package/dist/assets/auto-track-legacy.541af3f5.js +0 -1
- package/dist/assets/auto-track.10e7c441.js +0 -1
- package/dist/assets/index-legacy.4d95875e.js +0 -40
- package/dist/assets/index-legacy.60d9e590.js +0 -1
- package/dist/assets/index-legacy.690811dc.js +0 -1
- package/dist/assets/index-legacy.89760bd0.js +0 -1
- package/dist/assets/index-legacy.a4b02181.js +0 -1
- package/dist/assets/index-legacy.be4ae81b.js +0 -672
- package/dist/assets/index-legacy.d24a67f5.js +0 -1
- package/dist/assets/index-legacy.d281a40b.js +0 -1
- package/dist/assets/index-legacy.d7f5a5d6.js +0 -1
- package/dist/assets/index.0c5b062b.js +0 -1345
- package/dist/assets/index.1787c8e5.js +0 -1
- package/dist/assets/index.24a102e7.js +0 -1
- package/dist/assets/index.27821d72.js +0 -1155
- package/dist/assets/index.7dae5d4e.js +0 -1
- package/dist/assets/index.99863166.js +0 -221
- package/dist/assets/index.ca339fe1.js +0 -1
- package/dist/assets/index.e50321f4.js +0 -1
- package/dist/assets/index.umd-legacy.84ee2b87.js +0 -1
- package/dist/assets/index.umd.703b7a5f.js +0 -1
- package/dist/assets/is-plan-event-enabled-legacy.0a339854.js +0 -1
- package/dist/assets/is-plan-event-enabled.681b46ca.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as y}from"./index.99863166.js";import"./index.1b45b39b.js";import"./index.27821d72.js";function _(a,i){return Object.keys(i).reduce(function(e,s){if(s.startsWith(a)){var r=s.substr(a.length);e[r]=i[s]}return e},{})}function P(a,i){var e=document.createElement("a");e.href=i;var s=e.search.slice(1),r=s.split("&").reduce(function(n,l){var u=l.split("="),A=u[0],h=u[1];return n[A]=y(h),n},{}),t=[],v=r.ajs_uid,d=r.ajs_event,j=r.ajs_aid;if(j){var o=Array.isArray(r.ajs_aid)?r.ajs_aid[0]:r.ajs_aid;a.setAnonymousId(o)}if(v){var p=Array.isArray(r.ajs_uid)?r.ajs_uid[0]:r.ajs_uid,f=_("ajs_trait_",r);t.push(a.identify(p,f))}if(d){var m=Array.isArray(r.ajs_event)?r.ajs_event[0]:r.ajs_event,c=_("ajs_prop_",r);t.push(a.track(m,c))}return Promise.all(t)}export{P as queryString};
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
var Qn=Object.defineProperty;var Yn=(t,e,r)=>e in t?Qn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var xr=(t,e,r)=>(Yn(t,typeof e!="symbol"?e+"":e,r),r);import{M as Hr,d as rt,u as dt,p as Xn,s as ei,a as Sr,b as ti,$ as ri,c as ni,e as ii,f as oi,S as ai,g as si,h as ui,i as li,A as ci,j as fi,k as di,m as pi,l as hi,N as vi,P as Cr}from"./index.1b45b39b.js";import{_ as ne,a as C,b as A,c as P,d as D,e as mi,f as z,g as J,R as ie,r as M,S as Jr,j as _,I as qe,L as Zt,u as be,h as Kt,p as Be,s as L,y as I,F as Ge,i as F,k as St,l as we,m as U,M as Ze,n as se,B as Ye,U as Wr,A as Qr,x as kt,O as Yr,o as Ie,q as Ht,C as nt,t as gi,v as ze,w as yi,z as bi,N as Xr,T as _i}from"./index.27821d72.js";function me(t){return typeof t=="string"}function jt(t){return typeof t=="number"}function Ae(t){return typeof t=="function"}function W(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()==="object"}function wi(t){var e,r,n,i=(n=(r=(e=t.userId)!==null&&e!==void 0?e:t.anonymousId)!==null&&r!==void 0?r:t.groupId)!==null&&n!==void 0?n:t.previousId;return me(i)}var je=function(t){ne(e,t);function e(r,n){var i=t.call(this,n)||this;return i.field=r,i}return e}(Error);function xe(t){var e,r=t&&t.event&&t.event.type,n=t.event;if(n===void 0)throw new je("event","Event is missing");if(!me(r))throw new je("event","Event is not a string");if(r==="track"&&!me(n.event))throw new je("event","Event is not a string");var i=(e=n.properties)!==null&&e!==void 0?e:n.traits;if(r!=="alias"&&!W(i))throw new je("properties","properties is not an object");if(!wi(n))throw new je("userId","Missing userId or anonymousId");return t}var xi={name:"Event Validation",type:"before",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:xe,identify:xe,page:xe,alias:xe,group:xe,screen:xe};function Si(t,e,r,n){var i,o=[t,e,r,n],a=W(t)?t.event:t;if(!a||!me(a))throw new Error("Event missing");var s=W(t)?(i=t.properties)!==null&&i!==void 0?i:{}:W(e)?e:{},u={};W(e)&&!Ae(r)&&(u=r!=null?r:{}),W(t)&&!Ae(e)&&(u=e!=null?e:{});var f=o.find(Ae);return[a,s,u,f]}function Ir(t,e,r,n,i){var o,a,s=null,u=null,f=[t,e,r,n,i],p=f.filter(me);p[0]!==void 0&&p[1]!==void 0&&(s=p[0],u=p[1]),p.length===1&&(s=null,u=p[0]);var v=f.find(Ae),b=f.filter(function(S){return u===null?W(S):W(S)||S===null}),y=(o=b[0])!==null&&o!==void 0?o:{},w=(a=b[1])!==null&&a!==void 0?a:{};return[s,u,y,w,v]}var Mr=function(t){return function(){for(var e,r,n,i,o,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var u=null;u=(n=(e=a.find(me))!==null&&e!==void 0?e:(r=a.find(jt))===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:t.id();var f=a.filter(function(y){return u===null?W(y):W(y)||y===null}),p=(i=f[0])!==null&&i!==void 0?i:{},v=(o=f[1])!==null&&o!==void 0?o:{},b=a.find(Ae);return[u,p,v,b]}};function Ci(t,e,r,n){jt(t)&&(t=t.toString()),jt(e)&&(e=e.toString());var i=[t,e,r,n],o=i.filter(me),a=o[0],s=a===void 0?t:a,u=o[1],f=u===void 0?null:u,p=i.filter(W)[0],v=p===void 0?{}:p,b=i.find(Ae);return[s,f,v,b]}function pt(t){return Promise.resolve(t)}function Ii(t,e){return new Promise(function(r,n){var i=setTimeout(function(){n(Error("Promise timed out"))},e);t.then(function(o){return clearTimeout(i),r(o)}).catch(n)})}function Mi(t){return new Promise(function(e){return setTimeout(e,t)})}function Ai(t,e,r,n){var i=function(){try{return pt(e(t))}catch(o){return Promise.reject(o)}};return Mi(r).then(function(){return Ii(i(),n!=null?n:1e3)}).catch(function(o){t==null||t.log("warn","Callback Error",{error:o}),t==null||t.stats.increment("callback_error")}).then(function(){return t})}function Jt(){return typeof window<"u"}function Cu(){return!Jt()}function en(){return Jt()?window.navigator.onLine:!0}function ut(){return!en()}var pe=256,it=[],Xe;for(;pe--;)it[pe]=(pe+256).toString(16).substring(1);function Wt(){var t=0,e,r="";if(!Xe||pe+16>256){for(Xe=Array(t=256);t--;)Xe[t]=256*Math.random()|0;t=pe=0}for(;t<16;t++)e=Xe[pe+t],t==6?r+=it[e&15|64]:t==8?r+=it[e&63|128]:r+=it[e],t&1&&t>1&&t<11&&(r+="-");return pe++,r}function lt(t,e,r){e.split&&(e=e.split("."));for(var n=0,i=e.length,o=t,a,s;n<i&&(s=e[n++],!(s==="__proto__"||s==="constructor"||s==="prototype"));)o=o[s]=n===i?r:typeof(a=o[s])==typeof e?a:e[n]*0!==0||!!~(""+e[n]).indexOf(".")?{}:[]}const Iu=Object.freeze(Object.defineProperty({__proto__:null,dset:lt},Symbol.toStringTag,{value:"Module"}));var Pi=function(){function t(){var e=this;this._logs=[],this.log=function(r,n,i){var o=new Date;e._logs.push({level:r,message:n,time:o,extras:i})}}return Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var e=this._logs.reduce(function(r,n){var i,o,a,s=C(C({},n),{json:JSON.stringify(n.extras,null," "),extras:n.extras});delete s.time;var u=(a=(o=n.time)===null||o===void 0?void 0:o.toISOString())!==null&&a!==void 0?a:"";return r[u]&&(u="".concat(u,"-").concat(Math.random())),C(C({},r),(i={},i[u]=s,i))},{});console.table?console.table(e):console.log(e)}else this.logs.forEach(function(r){var n=r.level,i=r.message,o=r.extras;n==="info"||n==="debug"?console.log(i,o!=null?o:""):console[n](i,o!=null?o:"")});this._logs=[]},t}();const Ei=Pi;var Oi=function(t){var e={gauge:"g",counter:"c"};return e[t]},$i=function(){function t(e){this.metrics=[],this.remoteMetrics=e}return t.prototype.increment=function(e,r,n){var i;r===void 0&&(r=1),this.metrics.push({metric:e,value:r,tags:n!=null?n:[],type:"counter",timestamp:Date.now()}),(i=this.remoteMetrics)===null||i===void 0||i.increment(e,n!=null?n:[])},t.prototype.gauge=function(e,r,n){this.metrics.push({metric:e,value:r,tags:n!=null?n:[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var e=this.metrics.map(function(r){return C(C({},r),{tags:r.tags.join(",")})});console.table?console.table(e):console.log(e),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map(function(e){return{m:e.metric,v:e.value,t:e.tags,k:Oi(e.type),e:e.timestamp}})},t}();const Li=$i;function $e(t,e){return e=e||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(p){return s[p.toLowerCase()]},has:function(p){return p.toLowerCase()in s}}}};for(var f in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(p,v,b){o.push(v=v.toLowerCase()),a.push([v,b]),s[v]=s[v]?s[v]+","+b:b}),r(u())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(f,e.headers[f]);i.send(e.body||null)})}var Ee="1.44.0";/*! js-cookie v3.0.1 | MIT */function et(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}var Ti={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Ft(t,e){function r(i,o,a){if(!(typeof document>"u")){a=et({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var u in a)!a[u]||(s+="; "+u,a[u]!==!0&&(s+="="+a[u].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var u=o[s].split("="),f=u.slice(1).join("=");try{var p=decodeURIComponent(u[0]);if(a[p]=t.read(f,p),i===p)break}catch(v){}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",et({},o,{expires:-1}))},withAttributes:function(i){return Ft(this.converter,et({},this.attributes,i))},withConverter:function(i){return Ft(et({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var q=Ft(Ti,{path:"/"});function Di(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}}function ki(t){var e=t.hostname,r=e.split("."),n=r[r.length-1],i=[];if(r.length===4&&parseInt(n,10)>0||r.length<=1)return i;for(var o=r.length-2;o>=0;--o)i.push(r.slice(o).join("."));return i}function ji(t){try{return new URL(t)}catch(e){return}}function tn(t){var e=ji(t);if(!!e)for(var r=ki(e),n=0;n<r.length;++n){var i="__tld__",o=r[n],a={domain:"."+o};try{if(q.set(i,"1",a),q.get(i))return q.remove(i,a),o}catch(s){return}}}var Fe;function Fi(){if(Fe)return Fe;var t=tn(window.location.href);return Fe={expires:31536e6,secure:!1,path:"/"},t&&(Fe.domain=t),Fe}var Ri="npm";function rn(){return Ri}function Ni(){var t=q.get("_ga");if(t&&t.startsWith("amp"))return t}function zi(t){return t.startsWith("?")&&(t=t.substring(1)),t=t.replace(/\?/g,"&"),t.split("&").reduce(function(e,r){var n=r.split("="),i=n[0],o=n[1],a=o===void 0?"":o;if(i.includes("utm_")&&i.length>4){var s=i.substr(4);s==="campaign"&&(s="name"),e[s]=Di(a)}return e},{})}function Bi(t){var e={btid:"dataxu",urid:"millennial-media"};t.startsWith("?")&&(t=t.substring(1)),t=t.replace(/\?/g,"&");for(var r=t.split("&"),n=0,i=r;n<i.length;n++){var o=i[n],a=o.split("="),s=a[0],u=a[1];if(e[s])return{id:u,type:e[s]}}}function Ui(t,e,r){var n=q.get("s:context.referrer"),i=Bi(t);n=n?JSON.parse(n):void 0,i=i!=null?i:n,i&&(e&&(e.referrer=C(C({},e.referrer),i)),r||q.set("s:context.referrer",JSON.stringify(i),Fi()))}function Vi(t,e,r,n){var i,o,a,s,u=t.user(),f=window.location.search;e.context=(o=(i=e.context)!==null&&i!==void 0?i:e.options)!==null&&o!==void 0?o:{};var p=e.context,v=e.anonymousId;delete e.options,e.writeKey=r==null?void 0:r.apiKey,p.userAgent=window.navigator.userAgent;var b=navigator.userLanguage||navigator.language;if(typeof p.locale>"u"&&typeof b<"u"&&(p.locale=b),!p.library){var y=rn();y==="web"?p.library={name:"analytics.js",version:"next-".concat(Ee)}:p.library={name:"analytics.js",version:"npm:next-".concat(Ee)}}f&&!p.campaign&&(p.campaign=zi(f)),Ui(f,p,(a=t.options.disableClientPersistence)!==null&&a!==void 0?a:!1),e.userId=e.userId||u.id(),e.anonymousId=u.anonymousId(v),e.sentAt=new Date;var w=t.queue.failedInitializations||[];w.length>0&&(e._metadata={failedInitializations:w});var S=[],x=[];for(var m in n){var g=n[m];m==="Segment.io"&&S.push(m),g.bundlingStatus==="bundled"&&S.push(m),g.bundlingStatus==="unbundled"&&x.push(m)}for(var c=0,l=(r==null?void 0:r.unbundledIntegrations)||[];c<l.length;c++){var h=l[c];x.includes(h)||x.push(h)}var d=(s=r==null?void 0:r.maybeBundledConfigIds)!==null&&s!==void 0?s:{},E=[];S.sort().forEach(function(T){var B;((B=d[T])!==null&&B!==void 0?B:[]).forEach(function(Qe){E.push(Qe)})}),(r==null?void 0:r.addBundledMetadata)!==!1&&(e._metadata=C(C({},e._metadata),{bundled:S.sort(),unbundled:x.sort(),bundledIds:E}));var $=Ni();return $&&(p.amp={id:$}),e}function Ct(t){console.error("Error sending segment performance metrics",t)}var qi=function(){function t(e){var r=this,n,i,o,a;if(this.host=(n=e==null?void 0:e.host)!==null&&n!==void 0?n:"api.segment.io/v1",this.sampleRate=(i=e==null?void 0:e.sampleRate)!==null&&i!==void 0?i:1,this.flushTimer=(o=e==null?void 0:e.flushTimer)!==null&&o!==void 0?o:30*1e3,this.maxQueueSize=(a=e==null?void 0:e.maxQueueSize)!==null&&a!==void 0?a:20,this.queue=[],this.sampleRate>0){var s=!1,u=function(){s||(s=!0,r.flush().catch(Ct),s=!1,setTimeout(u,r.flushTimer))};u()}}return t.prototype.increment=function(e,r){if(!!e.includes("analytics_js.")&&r.length!==0&&!(Math.random()>this.sampleRate)&&!(this.queue.length>=this.maxQueueSize)){var n=r.reduce(function(o,a){var s=a.split(":"),u=s[0],f=s[1];return o[u]=f,o},{});n.library="analytics.js";var i=rn();i==="web"?n.library_version="next-".concat(Ee):n.library_version="npm:next-".concat(Ee),this.queue.push({type:"Counter",metric:e,value:1,tags:n}),e.includes("error")&&this.flush().catch(Ct)}},t.prototype.flush=function(){return A(this,void 0,void 0,function(){var e=this;return P(this,function(r){switch(r.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(n){Ct(n),e.sampleRate=0})];case 1:return r.sent(),[2]}})})},t.prototype.send=function(){return A(this,void 0,void 0,function(){var e,r,n;return P(this,function(i){return e={series:this.queue},this.queue=[],r={"Content-Type":"text/plain"},n="https://".concat(this.host,"/m"),[2,$e(n,{headers:r,body:JSON.stringify(e),method:"POST"})]})})},t}(),ge=function(){function t(e){var r,n,i;this.retry=(r=e.retry)!==null&&r!==void 0?r:!0,this.type=(n=e.type)!==null&&n!==void 0?n:"plugin Error",this.reason=(i=e.reason)!==null&&i!==void 0?i:""}return t}(),Ar,te=function(){function t(e,r){this.logger=new Ei,this.cancel=function(n){throw n||new ge({reason:"Context Cancel"})},this._attempts=0,this._event=e,this._id=r!=null?r:Wt(),this.stats=new Li(Ar)}return t.initMetrics=function(e){Ar=new qi(e)},t.system=function(){return new t({type:"track",event:"system"})},t.prototype.isSame=function(e){return e._id===this._id},t.prototype.log=function(e,r,n){this.logger.log(e,r,n)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){this._event=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attempts",{get:function(){return this._attempts},set:function(e){this._attempts=e},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(e,r){var n;if(e.split(".")[0]==="integrations"){var i=e.split(".")[1];if(((n=this._event.integrations)===null||n===void 0?void 0:n[i])===!1)return this._event}return lt(this._event,e,r),this._event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(e){this._failedDelivery=e},t.prototype.logs=function(){return this.logger.logs},t.prototype.flush=function(){this.logger.flush(),this.stats.flush()},t.prototype.toJSON=function(){return{id:this._id,event:this._event,logs:this.logger.logs,metrics:this.stats.metrics}},t}(),Qt=function(){function t(){this.callbacks={}}return t.prototype.on=function(e,r){return this.callbacks[e]?this.callbacks[e].push(r):this.callbacks[e]=[r],this},t.prototype.once=function(e,r){var n=this,i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];n.off(e,i),r.apply(n,o)};return this.on(e,i),this},t.prototype.off=function(e,r){var n,i=(n=this.callbacks[e])!==null&&n!==void 0?n:[],o=i.filter(function(a){return a!==r});return this.callbacks[e]=o,this},t.prototype.emit=function(e){for(var r=this,n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var a=(n=this.callbacks[e])!==null&&n!==void 0?n:[];return a.forEach(function(s){s.apply(r,i)}),this},t}(),fe={},oe={},Yt={},Ke={exports:{}};(function(t){t.exports=e(r),t.exports.find=t.exports,t.exports.replace=function(s,u,f,p){return e(i).call(this,s,u,f,p),s},t.exports.del=function(s,u,f){return e(n).call(this,s,u,null,f),s};function e(s){return function(u,f,p,v){var b=v&&a(v.normalizer)?v.normalizer:o;f=b(f);for(var y,w=!1;!w;)S();function S(){for(y in u){var x=b(y);if(f.indexOf(x)===0){var m=f.substr(x.length);if(m.charAt(0)==="."||m.length===0){f=m.substr(1);var g=u[y];if(g==null){w=!0;return}if(!f.length){w=!0;return}u=g;return}}}y=void 0,w=!0}if(!!y)return u==null?u:s(u,y,p)}}function r(s,u){if(s.hasOwnProperty(u))return s[u]}function n(s,u){return s.hasOwnProperty(u)&&delete s[u],s}function i(s,u,f){return s.hasOwnProperty(u)&&(s[u]=f),s}function o(s){return s.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}function a(s){return typeof s=="function"}})(Ke);var Gi=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yt,"__esModule",{value:!0});var ce=Gi(Ke.exports);function Se(t,e){return function(){var r=this.traits(),n=this.properties?this.properties():{};return ce.default(r,"address."+t)||ce.default(r,t)||(e?ce.default(r,"address."+e):null)||(e?ce.default(r,e):null)||ce.default(n,"address."+t)||ce.default(n,t)||(e?ce.default(n,"address."+e):null)||(e?ce.default(n,e):null)}}function Zi(t){t.zip=Se("postalCode","zip"),t.country=Se("country"),t.street=Se("street"),t.state=Se("state"),t.city=Se("city"),t.region=Se("region")}Yt.default=Zi;var ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.clone=void 0;function Rt(t){if(Object.prototype.toString.call(t)==="[object Object]"){var e={};for(var r in t)e[r]=Rt(t[r]);return e}else return Array.isArray(t)?t.map(Rt):t}ht.clone=Rt;var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0});var Ki={Salesforce:!0};function Hi(t){return!Ki[t]}Xt.default=Hi;var vt={},nn=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;vt.parse=function(t){var e=[1,5,6,7,11,12],r=nn.exec(t),n=0;if(!r)return new Date(t);for(var i=0,o;o=e[i];i++)r[o]=parseInt(r[o],10)||0;r[2]=parseInt(r[2],10)||1,r[3]=parseInt(r[3],10)||1,r[2]--,r[8]=r[8]?(r[8]+"00").substring(0,3):0,r[4]===" "?n=new Date().getTimezoneOffset():r[9]!=="Z"&&r[10]&&(n=r[11]*60+r[12],r[10]==="+"&&(n=0-n));var a=Date.UTC(r[1],r[2],r[3],r[5],r[6]+n,r[7],r[8]);return new Date(a)};vt.is=function(t,e){return typeof t!="string"||e&&/^\d{4}-\d{2}-\d{2}/.test(t)===!1?!1:nn.test(t)};var er={},Ji=/\d{13}/;er.is=function(t){return Ji.test(t)};er.parse=function(t){return t=parseInt(t,10),new Date(t)};var tr={},Wi=/\d{10}/;tr.is=function(t){return Wi.test(t)};tr.parse=function(t){var e=parseInt(t,10)*1e3;return new Date(e)};var Pr=vt,Er=er,Or=tr,Qi=Object.prototype,on=Qi.toString;function Yi(t){return on.call(t)==="[object Date]"}function Xi(t){return on.call(t)==="[object Number]"}var rr=function(e){return Yi(e)?e:Xi(e)?new Date(eo(e)):Pr.is(e)?Pr.parse(e):Er.is(e)?Er.parse(e):Or.is(e)?Or.parse(e):new Date(e)};function eo(t){return t<315576e5?t*1e3:t}var $r=vt,to=nr;function nr(t,e){return e===void 0&&(e=!0),t&&typeof t=="object"?ro(t,e):Array.isArray(t)?no(t,e):$r.is(t,e)?$r.parse(t):t}function ro(t,e){return Object.keys(t).forEach(function(r){t[r]=nr(t[r],e)}),t}function no(t,e){return t.forEach(function(r,n){t[n]=nr(r,e)}),t}var He=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oe,"__esModule",{value:!0});oe.Facade=void 0;var io=He(Yt),Oe=ht,oo=He(Xt),ao=He(rr),Nt=He(Ke.exports),so=He(to);function G(t,e){e=e||{},this.raw=Oe.clone(t),"clone"in e||(e.clone=!0),e.clone&&(t=Oe.clone(t)),"traverse"in e||(e.traverse=!0),"timestamp"in t?t.timestamp=ao.default(t.timestamp):t.timestamp=new Date,e.traverse&&so.default(t),this.opts=e,this.obj=t}oe.Facade=G;var k=G.prototype;k.proxy=function(t){var e=t.split(".");t=e.shift();var r=this[t]||this.field(t);return r&&(typeof r=="function"&&(r=r.call(this)||{}),e.length===0?this.opts.clone?zt(r):r:(r=Nt.default(r,e.join(".")),this.opts.clone?zt(r):r))};k.field=function(t){var e=this.obj[t];return this.opts.clone?zt(e):e};G.proxy=function(t){return function(){return this.proxy(t)}};G.field=function(t){return function(){return this.field(t)}};G.multi=function(t){return function(){var e=this.proxy(t+"s");if(Array.isArray(e))return e;var r=this.proxy(t);return r&&(r=[this.opts.clone?Oe.clone(r):r]),r||[]}};G.one=function(t){return function(){var e=this.proxy(t);if(e)return e;var r=this.proxy(t+"s");if(Array.isArray(r))return r[0]}};k.json=function(){var t=this.opts.clone?Oe.clone(this.obj):this.obj;return this.type&&(t.type=this.type()),t};k.rawEvent=function(){return this.raw};k.options=function(t){var e=this.obj.options||this.obj.context||{},r=this.opts.clone?Oe.clone(e):e;if(!t)return r;if(!!this.enabled(t)){var n=this.integrations(),i=n[t]||Nt.default(n,t);return typeof i!="object"&&(i=Nt.default(this.options(),t)),typeof i=="object"?i:{}}};k.context=k.options;k.enabled=function(t){var e=this.proxy("options.providers.all");typeof e!="boolean"&&(e=this.proxy("options.all")),typeof e!="boolean"&&(e=this.proxy("integrations.all")),typeof e!="boolean"&&(e=!0);var r=e&&oo.default(t),n=this.integrations();if(n.providers&&n.providers.hasOwnProperty(t)&&(r=n.providers[t]),n.hasOwnProperty(t)){var i=n[t];typeof i=="boolean"?r=i:r=!0}return!!r};k.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()};k.active=function(){var t=this.proxy("options.active");return t==null&&(t=!0),t};k.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")};k.sessionId=k.anonymousId;k.groupId=G.proxy("options.groupId");k.traits=function(t){var e=this.proxy("options.traits")||{},r=this.userId();t=t||{},r&&(e.id=r);for(var n in t){var i=this[n]==null?this.proxy("options.traits."+n):this[n]();i!=null&&(e[t[n]]=i,delete e[n])}return e};k.library=function(){var t=this.proxy("options.library");return t?typeof t=="string"?{name:t,version:null}:t:{name:"unknown",version:null}};k.device=function(){var t=this.proxy("context.device");(typeof t!="object"||t===null)&&(t={});var e=this.library().name;return t.type||(e.indexOf("ios")>-1&&(t.type="ios"),e.indexOf("android")>-1&&(t.type="android")),t};k.userAgent=G.proxy("context.userAgent");k.timezone=G.proxy("context.timezone");k.timestamp=G.field("timestamp");k.channel=G.field("channel");k.ip=G.proxy("context.ip");k.userId=G.field("userId");io.default(k);function zt(t){return Oe.clone(t)}var mt={},ue={exports:{}};typeof Object.create=="function"?ue.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ue.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var uo=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mt,"__esModule",{value:!0});mt.Alias=void 0;var lo=uo(ue.exports),an=oe;function Q(t,e){an.Facade.call(this,t,e)}mt.Alias=Q;lo.default(Q,an.Facade);Q.prototype.action=function(){return"alias"};Q.prototype.type=Q.prototype.action;Q.prototype.previousId=function(){return this.field("previousId")||this.field("from")};Q.prototype.from=Q.prototype.previousId;Q.prototype.userId=function(){return this.field("userId")||this.field("to")};Q.prototype.to=Q.prototype.userId;var gt={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});var co=/.+\@.+\..+/;function fo(t){return co.test(t)}Le.default=fo;var ir=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gt,"__esModule",{value:!0});gt.Group=void 0;var po=ir(ue.exports),ho=ir(Le),vo=ir(rr),Te=oe;function or(t,e){Te.Facade.call(this,t,e)}gt.Group=or;po.default(or,Te.Facade);var Y=or.prototype;Y.action=function(){return"group"};Y.type=Y.action;Y.groupId=Te.Facade.field("groupId");Y.created=function(){var t=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(t)return vo.default(t)};Y.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.groupId();if(ho.default(e))return e};Y.traits=function(t){var e=this.properties(),r=this.groupId();t=t||{},r&&(e.id=r);for(var n in t){var i=this[n]==null?this.proxy("traits."+n):this[n]();i!=null&&(e[t[n]]=i,delete e[n])}return e};Y.name=Te.Facade.proxy("traits.name");Y.industry=Te.Facade.proxy("traits.industry");Y.employees=Te.Facade.proxy("traits.employees");Y.properties=function(){return this.field("traits")||this.field("properties")||{}};var Je={},yt=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Je,"__esModule",{value:!0});Je.Identify=void 0;var ae=oe,Pe=yt(Ke.exports),mo=yt(ue.exports),go=yt(Le),sn=yt(rr),he=function(t){return t.trim()};function ar(t,e){ae.Facade.call(this,t,e)}Je.Identify=ar;mo.default(ar,ae.Facade);var j=ar.prototype;j.action=function(){return"identify"};j.type=j.action;j.traits=function(t){var e=this.field("traits")||{},r=this.userId();t=t||{},r&&(e.id=r);for(var n in t){var i=this[n]==null?this.proxy("traits."+n):this[n]();i!=null&&(e[t[n]]=i,n!==t[n]&&delete e[n])}return e};j.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.userId();if(go.default(e))return e};j.created=function(){var t=this.proxy("traits.created")||this.proxy("traits.createdAt");if(t)return sn.default(t)};j.companyCreated=function(){var t=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(t)return sn.default(t)};j.companyName=function(){return this.proxy("traits.company.name")};j.name=function(){var t=this.proxy("traits.name");if(typeof t=="string")return he(t);var e=this.firstName(),r=this.lastName();if(e&&r)return he(e+" "+r)};j.firstName=function(){var t=this.proxy("traits.firstName");if(typeof t=="string")return he(t);var e=this.proxy("traits.name");if(typeof e=="string")return he(e).split(" ")[0]};j.lastName=function(){var t=this.proxy("traits.lastName");if(typeof t=="string")return he(t);var e=this.proxy("traits.name");if(typeof e=="string"){var r=he(e).indexOf(" ");if(r!==-1)return he(e.substr(r+1))}};j.uid=function(){return this.userId()||this.username()||this.email()};j.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")};j.age=function(){var t=this.birthday(),e=Pe.default(this.traits(),"age");if(e!=null)return e;if(t instanceof Date){var r=new Date;return r.getFullYear()-t.getFullYear()}};j.avatar=function(){var t=this.traits();return Pe.default(t,"avatar")||Pe.default(t,"photoUrl")||Pe.default(t,"avatarUrl")};j.position=function(){var t=this.traits();return Pe.default(t,"position")||Pe.default(t,"jobTitle")};j.username=ae.Facade.proxy("traits.username");j.website=ae.Facade.one("traits.website");j.websites=ae.Facade.multi("traits.website");j.phone=ae.Facade.one("traits.phone");j.phones=ae.Facade.multi("traits.phone");j.address=ae.Facade.proxy("traits.address");j.gender=ae.Facade.proxy("traits.gender");j.birthday=ae.Facade.proxy("traits.birthday");var De={},sr=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(De,"__esModule",{value:!0});De.Track=void 0;var yo=sr(ue.exports),R=oe,bo=Je,_o=sr(Le),un=sr(Ke.exports);function ur(t,e){R.Facade.call(this,t,e)}De.Track=ur;yo.default(ur,R.Facade);var O=ur.prototype;O.action=function(){return"track"};O.type=O.action;O.event=R.Facade.field("event");O.value=R.Facade.proxy("properties.value");O.category=R.Facade.proxy("properties.category");O.id=R.Facade.proxy("properties.id");O.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")};O.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")};O.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")};O.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")};O.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")};O.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")};O.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")};O.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")};O.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")};O.sku=R.Facade.proxy("properties.sku");O.tax=R.Facade.proxy("properties.tax");O.name=R.Facade.proxy("properties.name");O.price=R.Facade.proxy("properties.price");O.total=R.Facade.proxy("properties.total");O.repeat=R.Facade.proxy("properties.repeat");O.coupon=R.Facade.proxy("properties.coupon");O.shipping=R.Facade.proxy("properties.shipping");O.discount=R.Facade.proxy("properties.discount");O.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")};O.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")};O.description=R.Facade.proxy("properties.description");O.plan=R.Facade.proxy("properties.plan");O.subtotal=function(){var t=un.default(this.properties(),"subtotal"),e=this.total()||this.revenue();if(t)return t;if(!e)return 0;if(this.total()){var r=this.tax();r&&(e-=r),r=this.shipping(),r&&(e-=r),r=this.discount(),r&&(e+=r)}return e};O.products=function(){var t=this.properties(),e=un.default(t,"products");return Array.isArray(e)?e.filter(function(r){return r!==null}):[]};O.quantity=function(){var t=this.obj.properties||{};return t.quantity||1};O.currency=function(){var t=this.obj.properties||{};return t.currency||"USD"};O.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")};O.query=R.Facade.proxy("options.query");O.properties=function(t){var e=this.field("properties")||{};t=t||{};for(var r in t){var n=this[r]==null?this.proxy("properties."+r):this[r]();n!=null&&(e[t[r]]=n,delete e[r])}return e};O.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()};O.email=function(){var t=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(t)return t;var e=this.userId();if(_o.default(e))return e};O.revenue=function(){var t=this.proxy("properties.revenue"),e=this.event(),r=/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i;return!t&&e&&e.match(r)&&(t=this.proxy("properties.total")),wo(t)};O.cents=function(){var t=this.revenue();return typeof t!="number"?this.value()||0:t*100};O.identify=function(){var t=this.json();return t.traits=this.traits(),new bo.Identify(t,this.opts)};function wo(t){if(!!t){if(typeof t=="number")return t;if(typeof t=="string"&&(t=t.replace(/\$/g,""),t=parseFloat(t),!isNaN(t)))return t}}var We={},ln=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(We,"__esModule",{value:!0});We.Page=void 0;var xo=ln(ue.exports),_e=oe,So=De,Co=ln(Le);function lr(t,e){_e.Facade.call(this,t,e)}We.Page=lr;xo.default(lr,_e.Facade);var V=lr.prototype;V.action=function(){return"page"};V.type=V.action;V.category=_e.Facade.field("category");V.name=_e.Facade.field("name");V.title=_e.Facade.proxy("properties.title");V.path=_e.Facade.proxy("properties.path");V.url=_e.Facade.proxy("properties.url");V.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")};V.properties=function(t){var e=this.field("properties")||{},r=this.category(),n=this.name();t=t||{},r&&(e.category=r),n&&(e.name=n);for(var i in t){var o=this[i]==null?this.proxy("properties."+i):this[i]();o!=null&&(e[t[i]]=o,i!==t[i]&&delete e[i])}return e};V.email=function(){var t=this.proxy("context.traits.email")||this.proxy("properties.email");if(t)return t;var e=this.userId();if(Co.default(e))return e};V.fullName=function(){var t=this.category(),e=this.name();return e&&t?t+" "+e:e};V.event=function(t){return t?"Viewed "+t+" Page":"Loaded a Page"};V.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new So.Track(e,this.opts)};var bt={},Io=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bt,"__esModule",{value:!0});bt.Screen=void 0;var Mo=Io(ue.exports),cn=We,Ao=De;function ye(t,e){cn.Page.call(this,t,e)}bt.Screen=ye;Mo.default(ye,cn.Page);ye.prototype.action=function(){return"screen"};ye.prototype.type=ye.prototype.action;ye.prototype.event=function(t){return t?"Viewed "+t+" Screen":"Loaded a Screen"};ye.prototype.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new Ao.Track(e,this.opts)};var _t={},Po=D&&D.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_t,"__esModule",{value:!0});_t.Delete=void 0;var Eo=Po(ue.exports),fn=oe;function cr(t,e){fn.Facade.call(this,t,e)}_t.Delete=cr;Eo.default(cr,fn.Facade);cr.prototype.type=function(){return"delete"};(function(t){var e=D&&D.__assign||function(){return e=Object.assign||function(p){for(var v,b=1,y=arguments.length;b<y;b++){v=arguments[b];for(var w in v)Object.prototype.hasOwnProperty.call(v,w)&&(p[w]=v[w])}return p},e.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Delete=t.Screen=t.Page=t.Track=t.Identify=t.Group=t.Alias=t.Facade=void 0;var r=oe;Object.defineProperty(t,"Facade",{enumerable:!0,get:function(){return r.Facade}});var n=mt;Object.defineProperty(t,"Alias",{enumerable:!0,get:function(){return n.Alias}});var i=gt;Object.defineProperty(t,"Group",{enumerable:!0,get:function(){return i.Group}});var o=Je;Object.defineProperty(t,"Identify",{enumerable:!0,get:function(){return o.Identify}});var a=De;Object.defineProperty(t,"Track",{enumerable:!0,get:function(){return a.Track}});var s=We;Object.defineProperty(t,"Page",{enumerable:!0,get:function(){return s.Page}});var u=bt;Object.defineProperty(t,"Screen",{enumerable:!0,get:function(){return u.Screen}});var f=_t;Object.defineProperty(t,"Delete",{enumerable:!0,get:function(){return f.Delete}}),t.default=e(e({},r.Facade),{Alias:n.Alias,Group:i.Group,Identify:o.Identify,Track:a.Track,Page:s.Page,Screen:u.Screen,Delete:f.Delete})})(fe);var dn={exports:{}};(function(t,e){(function(r){t.exports=r()})(function(r){var n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(m,g){var c=m[0],l=m[1],h=m[2],d=m[3];c+=(l&h|~l&d)+g[0]-680876936|0,c=(c<<7|c>>>25)+l|0,d+=(c&l|~c&h)+g[1]-389564586|0,d=(d<<12|d>>>20)+c|0,h+=(d&c|~d&l)+g[2]+606105819|0,h=(h<<17|h>>>15)+d|0,l+=(h&d|~h&c)+g[3]-1044525330|0,l=(l<<22|l>>>10)+h|0,c+=(l&h|~l&d)+g[4]-176418897|0,c=(c<<7|c>>>25)+l|0,d+=(c&l|~c&h)+g[5]+1200080426|0,d=(d<<12|d>>>20)+c|0,h+=(d&c|~d&l)+g[6]-1473231341|0,h=(h<<17|h>>>15)+d|0,l+=(h&d|~h&c)+g[7]-45705983|0,l=(l<<22|l>>>10)+h|0,c+=(l&h|~l&d)+g[8]+1770035416|0,c=(c<<7|c>>>25)+l|0,d+=(c&l|~c&h)+g[9]-1958414417|0,d=(d<<12|d>>>20)+c|0,h+=(d&c|~d&l)+g[10]-42063|0,h=(h<<17|h>>>15)+d|0,l+=(h&d|~h&c)+g[11]-1990404162|0,l=(l<<22|l>>>10)+h|0,c+=(l&h|~l&d)+g[12]+1804603682|0,c=(c<<7|c>>>25)+l|0,d+=(c&l|~c&h)+g[13]-40341101|0,d=(d<<12|d>>>20)+c|0,h+=(d&c|~d&l)+g[14]-1502002290|0,h=(h<<17|h>>>15)+d|0,l+=(h&d|~h&c)+g[15]+1236535329|0,l=(l<<22|l>>>10)+h|0,c+=(l&d|h&~d)+g[1]-165796510|0,c=(c<<5|c>>>27)+l|0,d+=(c&h|l&~h)+g[6]-1069501632|0,d=(d<<9|d>>>23)+c|0,h+=(d&l|c&~l)+g[11]+643717713|0,h=(h<<14|h>>>18)+d|0,l+=(h&c|d&~c)+g[0]-373897302|0,l=(l<<20|l>>>12)+h|0,c+=(l&d|h&~d)+g[5]-701558691|0,c=(c<<5|c>>>27)+l|0,d+=(c&h|l&~h)+g[10]+38016083|0,d=(d<<9|d>>>23)+c|0,h+=(d&l|c&~l)+g[15]-660478335|0,h=(h<<14|h>>>18)+d|0,l+=(h&c|d&~c)+g[4]-405537848|0,l=(l<<20|l>>>12)+h|0,c+=(l&d|h&~d)+g[9]+568446438|0,c=(c<<5|c>>>27)+l|0,d+=(c&h|l&~h)+g[14]-1019803690|0,d=(d<<9|d>>>23)+c|0,h+=(d&l|c&~l)+g[3]-187363961|0,h=(h<<14|h>>>18)+d|0,l+=(h&c|d&~c)+g[8]+1163531501|0,l=(l<<20|l>>>12)+h|0,c+=(l&d|h&~d)+g[13]-1444681467|0,c=(c<<5|c>>>27)+l|0,d+=(c&h|l&~h)+g[2]-51403784|0,d=(d<<9|d>>>23)+c|0,h+=(d&l|c&~l)+g[7]+1735328473|0,h=(h<<14|h>>>18)+d|0,l+=(h&c|d&~c)+g[12]-1926607734|0,l=(l<<20|l>>>12)+h|0,c+=(l^h^d)+g[5]-378558|0,c=(c<<4|c>>>28)+l|0,d+=(c^l^h)+g[8]-2022574463|0,d=(d<<11|d>>>21)+c|0,h+=(d^c^l)+g[11]+1839030562|0,h=(h<<16|h>>>16)+d|0,l+=(h^d^c)+g[14]-35309556|0,l=(l<<23|l>>>9)+h|0,c+=(l^h^d)+g[1]-1530992060|0,c=(c<<4|c>>>28)+l|0,d+=(c^l^h)+g[4]+1272893353|0,d=(d<<11|d>>>21)+c|0,h+=(d^c^l)+g[7]-155497632|0,h=(h<<16|h>>>16)+d|0,l+=(h^d^c)+g[10]-1094730640|0,l=(l<<23|l>>>9)+h|0,c+=(l^h^d)+g[13]+681279174|0,c=(c<<4|c>>>28)+l|0,d+=(c^l^h)+g[0]-358537222|0,d=(d<<11|d>>>21)+c|0,h+=(d^c^l)+g[3]-722521979|0,h=(h<<16|h>>>16)+d|0,l+=(h^d^c)+g[6]+76029189|0,l=(l<<23|l>>>9)+h|0,c+=(l^h^d)+g[9]-640364487|0,c=(c<<4|c>>>28)+l|0,d+=(c^l^h)+g[12]-421815835|0,d=(d<<11|d>>>21)+c|0,h+=(d^c^l)+g[15]+530742520|0,h=(h<<16|h>>>16)+d|0,l+=(h^d^c)+g[2]-995338651|0,l=(l<<23|l>>>9)+h|0,c+=(h^(l|~d))+g[0]-198630844|0,c=(c<<6|c>>>26)+l|0,d+=(l^(c|~h))+g[7]+1126891415|0,d=(d<<10|d>>>22)+c|0,h+=(c^(d|~l))+g[14]-1416354905|0,h=(h<<15|h>>>17)+d|0,l+=(d^(h|~c))+g[5]-57434055|0,l=(l<<21|l>>>11)+h|0,c+=(h^(l|~d))+g[12]+1700485571|0,c=(c<<6|c>>>26)+l|0,d+=(l^(c|~h))+g[3]-1894986606|0,d=(d<<10|d>>>22)+c|0,h+=(c^(d|~l))+g[10]-1051523|0,h=(h<<15|h>>>17)+d|0,l+=(d^(h|~c))+g[1]-2054922799|0,l=(l<<21|l>>>11)+h|0,c+=(h^(l|~d))+g[8]+1873313359|0,c=(c<<6|c>>>26)+l|0,d+=(l^(c|~h))+g[15]-30611744|0,d=(d<<10|d>>>22)+c|0,h+=(c^(d|~l))+g[6]-1560198380|0,h=(h<<15|h>>>17)+d|0,l+=(d^(h|~c))+g[13]+1309151649|0,l=(l<<21|l>>>11)+h|0,c+=(h^(l|~d))+g[4]-145523070|0,c=(c<<6|c>>>26)+l|0,d+=(l^(c|~h))+g[11]-1120210379|0,d=(d<<10|d>>>22)+c|0,h+=(c^(d|~l))+g[2]+718787259|0,h=(h<<15|h>>>17)+d|0,l+=(d^(h|~c))+g[9]-343485551|0,l=(l<<21|l>>>11)+h|0,m[0]=c+m[0]|0,m[1]=l+m[1]|0,m[2]=h+m[2]|0,m[3]=d+m[3]|0}function o(m){var g=[],c;for(c=0;c<64;c+=4)g[c>>2]=m.charCodeAt(c)+(m.charCodeAt(c+1)<<8)+(m.charCodeAt(c+2)<<16)+(m.charCodeAt(c+3)<<24);return g}function a(m){var g=[],c;for(c=0;c<64;c+=4)g[c>>2]=m[c]+(m[c+1]<<8)+(m[c+2]<<16)+(m[c+3]<<24);return g}function s(m){var g=m.length,c=[1732584193,-271733879,-1732584194,271733878],l,h,d,E,$,T;for(l=64;l<=g;l+=64)i(c,o(m.substring(l-64,l)));for(m=m.substring(l-64),h=m.length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<h;l+=1)d[l>>2]|=m.charCodeAt(l)<<(l%4<<3);if(d[l>>2]|=128<<(l%4<<3),l>55)for(i(c,d),l=0;l<16;l+=1)d[l]=0;return E=g*8,E=E.toString(16).match(/(.*?)(.{0,8})$/),$=parseInt(E[2],16),T=parseInt(E[1],16)||0,d[14]=$,d[15]=T,i(c,d),c}function u(m){var g=m.length,c=[1732584193,-271733879,-1732584194,271733878],l,h,d,E,$,T;for(l=64;l<=g;l+=64)i(c,a(m.subarray(l-64,l)));for(m=l-64<g?m.subarray(l-64):new Uint8Array(0),h=m.length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<h;l+=1)d[l>>2]|=m[l]<<(l%4<<3);if(d[l>>2]|=128<<(l%4<<3),l>55)for(i(c,d),l=0;l<16;l+=1)d[l]=0;return E=g*8,E=E.toString(16).match(/(.*?)(.{0,8})$/),$=parseInt(E[2],16),T=parseInt(E[1],16)||0,d[14]=$,d[15]=T,i(c,d),c}function f(m){var g="",c;for(c=0;c<4;c+=1)g+=n[m>>c*8+4&15]+n[m>>c*8&15];return g}function p(m){var g;for(g=0;g<m.length;g+=1)m[g]=f(m[g]);return m.join("")}p(s("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function m(g,c){return g=g|0||0,g<0?Math.max(g+c,0):Math.min(g,c)}ArrayBuffer.prototype.slice=function(g,c){var l=this.byteLength,h=m(g,l),d=l,E,$,T,B;return c!==r&&(d=m(c,l)),h>d?new ArrayBuffer(0):(E=d-h,$=new ArrayBuffer(E),T=new Uint8Array($),B=new Uint8Array(this,h,E),T.set(B),$)}}();function v(m){return/[\u0080-\uFFFF]/.test(m)&&(m=unescape(encodeURIComponent(m))),m}function b(m,g){var c=m.length,l=new ArrayBuffer(c),h=new Uint8Array(l),d;for(d=0;d<c;d+=1)h[d]=m.charCodeAt(d);return g?h:l}function y(m){return String.fromCharCode.apply(null,new Uint8Array(m))}function w(m,g,c){var l=new Uint8Array(m.byteLength+g.byteLength);return l.set(new Uint8Array(m)),l.set(new Uint8Array(g),m.byteLength),c?l:l.buffer}function S(m){var g=[],c=m.length,l;for(l=0;l<c-1;l+=2)g.push(parseInt(m.substr(l,2),16));return String.fromCharCode.apply(String,g)}function x(){this.reset()}return x.prototype.append=function(m){return this.appendBinary(v(m)),this},x.prototype.appendBinary=function(m){this._buff+=m,this._length+=m.length;var g=this._buff.length,c;for(c=64;c<=g;c+=64)i(this._hash,o(this._buff.substring(c-64,c)));return this._buff=this._buff.substring(c-64),this},x.prototype.end=function(m){var g=this._buff,c=g.length,l,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d;for(l=0;l<c;l+=1)h[l>>2]|=g.charCodeAt(l)<<(l%4<<3);return this._finish(h,c),d=p(this._hash),m&&(d=S(d)),this.reset(),d},x.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},x.prototype.setState=function(m){return this._buff=m.buff,this._length=m.length,this._hash=m.hash,this},x.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},x.prototype._finish=function(m,g){var c=g,l,h,d;if(m[c>>2]|=128<<(c%4<<3),c>55)for(i(this._hash,m),c=0;c<16;c+=1)m[c]=0;l=this._length*8,l=l.toString(16).match(/(.*?)(.{0,8})$/),h=parseInt(l[2],16),d=parseInt(l[1],16)||0,m[14]=h,m[15]=d,i(this._hash,m)},x.hash=function(m,g){return x.hashBinary(v(m),g)},x.hashBinary=function(m,g){var c=s(m),l=p(c);return g?S(l):l},x.ArrayBuffer=function(){this.reset()},x.ArrayBuffer.prototype.append=function(m){var g=w(this._buff.buffer,m,!0),c=g.length,l;for(this._length+=m.byteLength,l=64;l<=c;l+=64)i(this._hash,a(g.subarray(l-64,l)));return this._buff=l-64<c?new Uint8Array(g.buffer.slice(l-64)):new Uint8Array(0),this},x.ArrayBuffer.prototype.end=function(m){var g=this._buff,c=g.length,l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h,d;for(h=0;h<c;h+=1)l[h>>2]|=g[h]<<(h%4<<3);return this._finish(l,c),d=p(this._hash),m&&(d=S(d)),this.reset(),d},x.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.ArrayBuffer.prototype.getState=function(){var m=x.prototype.getState.call(this);return m.buff=y(m.buff),m},x.ArrayBuffer.prototype.setState=function(m){return m.buff=b(m.buff,!0),x.prototype.setState.call(this,m)},x.ArrayBuffer.prototype.destroy=x.prototype.destroy,x.ArrayBuffer.prototype._finish=x.prototype._finish,x.ArrayBuffer.hash=function(m,g){var c=u(new Uint8Array(m)),l=p(c);return g?S(l):l},x})})(dn);const Oo=dn.exports;var $o=function(){function t(e){this.user=e}return t.prototype.track=function(e,r,n,i){return this.normalize(C(C({},this.baseEvent()),{event:e,type:"track",properties:r,options:C({},n),integrations:C({},i)}))},t.prototype.page=function(e,r,n,i,o){var a,s={type:"page",properties:C({},n),options:C({},i),integrations:C({},o)};return e!==null&&(s.category=e,s.properties=(a=s.properties)!==null&&a!==void 0?a:{},s.properties.category=e),r!==null&&(s.name=r),this.normalize(C(C({},this.baseEvent()),s))},t.prototype.screen=function(e,r,n,i,o){var a={type:"screen",properties:C({},n),options:C({},i),integrations:C({},o)};return e!==null&&(a.category=e),r!==null&&(a.name=r),this.normalize(C(C({},this.baseEvent()),a))},t.prototype.identify=function(e,r,n,i){return this.normalize(C(C({},this.baseEvent()),{type:"identify",userId:e,traits:r,options:C({},n),integrations:C({},i)}))},t.prototype.group=function(e,r,n,i){return this.normalize(C(C({},this.baseEvent()),{type:"group",traits:r,options:C({},n),integrations:C({},i),groupId:e}))},t.prototype.alias=function(e,r,n,i){var o={userId:e,type:"alias",options:C({},n),integrations:C({},i)};return r!==null&&(o.previousId=r),e===void 0?this.normalize(C(C({},o),this.baseEvent())):this.normalize(C(C({},this.baseEvent()),o))},t.prototype.baseEvent=function(){var e={integrations:{},options:{}},r=this.user;return r.id()&&(e.userId=r.id()),r.anonymousId()&&(e.anonymousId=r.anonymousId()),e},t.prototype.context=function(e){var r,n,i,o=["integrations","anonymousId","timestamp","userId"],a=(r=e.options)!==null&&r!==void 0?r:{};delete a.integrations;var s=Object.keys(a),u=(i=(n=e.options)===null||n===void 0?void 0:n.context)!==null&&i!==void 0?i:{},f={};return s.forEach(function(p){p!=="context"&&(o.includes(p)?lt(f,p,a[p]):lt(u,p,a[p]))}),[u,f]},t.prototype.normalize=function(e){var r,n,i=Object.keys((r=e.integrations)!==null&&r!==void 0?r:{}).reduce(function(y,w){var S,x;return C(C({},y),(S={},S[w]=Boolean((x=e.integrations)===null||x===void 0?void 0:x[w]),S))},{}),o=C(C({},i),(n=e.options)===null||n===void 0?void 0:n.integrations),a=this.context(e),s=a[0],u=a[1];e.options;var f=mi(e,["options"]),p=C(C(C({timestamp:new Date},f),{context:s,integrations:o}),u),v="ajs-next-"+Oo.hash(JSON.stringify(p)+Wt()),b=C(C({},p),{messageId:v});return b},t}();function Lo(t,e){var r={};return t.forEach(function(n){var i,o=void 0;if(typeof e=="string"){var a=n[e];o=typeof a!="string"?JSON.stringify(a):a}else e instanceof Function&&(o=e(n));o!==void 0&&(r[o]=z(z([],(i=r[o])!==null&&i!==void 0?i:[],!0),[n],!1))}),r}function To(t){var e=Math.random()+1,r=t.minTimeout,n=r===void 0?500:r,i=t.factor,o=i===void 0?2:i,a=t.attempt,s=t.maxTimeout,u=s===void 0?1/0:s;return Math.min(e*n*Math.pow(o,a),u)}var pn="onRemoveFromFuture",fr=function(t){ne(e,t);function e(r,n,i){var o=t.call(this)||this;return o.future=[],o.maxAttempts=r,o.queue=n,o.seen=i!=null?i:{},o}return e.prototype.push=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=n.map(function(a){var s=r.updateAttempts(a);return s>r.maxAttempts||r.includes(a)?!1:(r.queue.push(a),!0)});return this.queue=this.queue.sort(function(a,s){return r.getAttempts(a)-r.getAttempts(s)}),o},e.prototype.pushWithBackoff=function(r){var n=this;if(this.getAttempts(r)===0)return this.push(r)[0];var i=this.updateAttempts(r);if(i>this.maxAttempts||this.includes(r))return!1;var o=To({attempt:i-1});return setTimeout(function(){n.queue.push(r),n.future=n.future.filter(function(a){return a.id!==r.id}),n.emit(pn)},o),this.future.push(r),!0},e.prototype.getAttempts=function(r){var n;return(n=this.seen[r.id])!==null&&n!==void 0?n:0},e.prototype.updateAttempts=function(r){return this.seen[r.id]=this.getAttempts(r)+1,this.getAttempts(r)},e.prototype.includes=function(r){return this.queue.includes(r)||this.future.includes(r)||Boolean(this.queue.find(function(n){return n.id===r.id}))||Boolean(this.future.find(function(n){return n.id===r.id}))},e.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(e.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),e}(Qt),re={getItem:function(){},setItem:function(){},removeItem:function(){}};try{re=Jt()&&window.localStorage?window.localStorage:re}catch(t){console.warn("Unable to access localStorage",t)}function hn(t){var e=re.getItem(t);return(e?JSON.parse(e):[]).map(function(r){return new te(r.event,r.id)})}function Do(t,e){var r=hn(t),n=z(z([],e,!0),r,!0),i=n.reduce(function(o,a){var s;return C(C({},o),(s={},s[a.id]=a,s))},{});re.setItem(t,JSON.stringify(Object.values(i)))}function vn(t){var e=re.getItem(t);return e?JSON.parse(e):{}}function ko(t,e){var r=vn(t);re.setItem(t,JSON.stringify(C(C({},r),e)))}function Lr(t){re.removeItem(t)}var jo=function(){return new Date().getTime()};function Bt(t,e,r){r===void 0&&(r=0);var n=50,i="persisted-queue:v1:".concat(t,":lock"),o=function(f){return new Date().getTime()>f},a=re.getItem(i),s=a?JSON.parse(a):null,u=s===null||o(s);if(u){re.setItem(i,JSON.stringify(jo()+n)),e(),re.removeItem(i);return}!u&&r<3?setTimeout(function(){Bt(t,e,r+1)},n):console.error("Unable to retrieve lock")}var dr=function(t){ne(e,t);function e(r,n){var i=t.call(this,r,[])||this,o="persisted-queue:v1:".concat(n,":items"),a="persisted-queue:v1:".concat(n,":seen"),s=[],u={};return Bt(n,function(){try{s=hn(o),u=vn(a),Lr(o),Lr(a),i.queue=z(z([],s,!0),i.queue,!0),i.seen=C(C({},u),i.seen)}catch(f){console.error(f)}}),document.addEventListener("pagehide",function(){if(i.todo>0){var f=z(z([],i.queue,!0),i.future,!0);try{Bt(n,function(){Do(o,f),ko(a,i.seen)})}catch(p){console.error(p)}}}),i}return e}(fr),mn=function(t){return typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"},Fo=function(){var t,e,r=0;return{done:function(){return t},run:function(n){var i=n();return mn(i)&&(++r===1&&(t=new Promise(function(o){return e=o})),i.finally(function(){return--r===0&&e()})),i}}};function Ro(t){return A(this,void 0,void 0,function(){var e;return P(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t()];case 1:return[2,r.sent()];case 2:return e=r.sent(),[2,Promise.reject(e)];case 3:return[2]}})})}function Ue(t,e){var r="action"in e?e.action.name:e.name;t.log("debug","plugin",{plugin:r});var n=new Date().getTime(),i=e[t.event.type];if(i===void 0)return Promise.resolve(t);var o=Ro(function(){return i.apply(e,[t])}).then(function(a){var s=new Date().getTime()-n;return a.stats.gauge("plugin_time",s,["plugin:".concat(r)]),a}).catch(function(a){if(a instanceof ge&&a.type==="middleware_cancellation")throw a;return a instanceof ge?(t.log("warn",a.type,{plugin:r,error:a}),a):(t.log("error","plugin Error",{plugin:r,error:a}),t.stats.increment("plugin_error",1,["plugin:".concat(r)]),a)});return o}function No(t,e){return Ue(t,e).then(function(r){if(r instanceof te)return r;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(r)})}var gn=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:null},It,Tr,zo=gn(),Me=(It=(Tr=zo).__SEGMENT_INSPECTOR__)!==null&&It!==void 0?It:Tr.__SEGMENT_INSPECTOR__={},Bo=function(t){ne(e,t);function e(r){var n=t.call(this)||this;return n.criticalTasks=Fo(),n.plugins=[],n.failedInitializations=[],n.flushing=!1,n.queue=r!=null?r:new dr(4,"event-queue"),n.queue.on(pn,function(){n.scheduleFlush(0)}),n}return e.prototype.register=function(r,n,i){return A(this,void 0,void 0,function(){var o=this;return P(this,function(a){switch(a.label){case 0:return[4,Promise.resolve(n.load(r,i)).then(function(){o.plugins.push(n)}).catch(function(s){if(n.type==="destination"){o.failedInitializations.push(n.name),console.warn(n.name,s),r.log("warn","Failed to load destination",{plugin:n.name,error:s});return}throw s})];case 1:return a.sent(),[2]}})})},e.prototype.deregister=function(r,n,i){return A(this,void 0,void 0,function(){var o;return P(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),n.unload?[4,Promise.resolve(n.unload(r,i))]:[3,2];case 1:a.sent(),a.label=2;case 2:return this.plugins=this.plugins.filter(function(s){return s.name!==n.name}),[3,4];case 3:return o=a.sent(),r.log("warn","Failed to unload destination",{plugin:n.name,error:o}),[3,4];case 4:return[2]}})})},e.prototype.dispatch=function(r){return A(this,void 0,void 0,function(){var n;return P(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.push(r),n=this.subscribeToDelivery(r),this.scheduleFlush(0),[2,n]})})},e.prototype.subscribeToDelivery=function(r){return A(this,void 0,void 0,function(){var n=this;return P(this,function(i){return[2,new Promise(function(o){var a=function(s,u){s.isSame(r)&&(n.off("flush",a),o(s))};n.on("flush",a)})]})})},e.prototype.dispatchSingle=function(r){return A(this,void 0,void 0,function(){var n=this;return P(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.updateAttempts(r),r.attempts=1,[2,this.deliver(r).catch(function(o){if(o instanceof ge&&o.retry===!1)return r.setFailedDelivery({reason:o}),r;var a=n.enqueuRetry(o,r);return a?n.subscribeToDelivery(r):(r.setFailedDelivery({reason:o}),r)})]})})},e.prototype.isEmpty=function(){return this.queue.length===0},e.prototype.scheduleFlush=function(r){var n=this;r===void 0&&(r=500),!this.flushing&&(this.flushing=!0,setTimeout(function(){n.flush().then(function(){setTimeout(function(){n.flushing=!1,n.queue.length&&n.scheduleFlush(0)},0)})},r))},e.prototype.deliver=function(r){return A(this,void 0,void 0,function(){var n,i,o;return P(this,function(a){switch(a.label){case 0:return[4,this.criticalTasks.done()];case 1:a.sent(),n=Date.now(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.flushOne(r)];case 3:return r=a.sent(),i=Date.now()-n,r.stats.gauge("delivered",i),r.log("debug","Delivered",r.event),[2,r];case 4:throw o=a.sent(),r.log("error","Failed to deliver",o),r.stats.increment("delivery_failed"),o;case 5:return[2]}})})},e.prototype.enqueuRetry=function(r,n){var i=r instanceof ge&&r.retry===!1,o=!i;if(o){var a=this.queue.pushWithBackoff(n);return a}return!1},e.prototype.flush=function(){return A(this,void 0,void 0,function(){var r,n,i;return P(this,function(o){switch(o.label){case 0:if(this.queue.length===0||!en())return[2,[]];if(r=this.queue.pop(),!r)return[2,[]];r.attempts=this.queue.getAttempts(r),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.deliver(r)];case 2:return r=o.sent(),this.emit("flush",r,!0),[3,4];case 3:return n=o.sent(),i=this.enqueuRetry(n,r),i||(r.setFailedDelivery({reason:n}),this.emit("flush",r,!1)),[2,[]];case 4:return[2,[r]]}})})},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(r){var n=this.plugins.filter(function(y){var w,S,x;if(y.type!=="destination"&&y.name!=="Segment.io")return!0;var m=void 0;return(w=y.alternativeNames)===null||w===void 0||w.forEach(function(g){r[g]!==void 0&&(m=r[g])}),(x=(S=r[y.name])!==null&&S!==void 0?S:m)!==null&&x!==void 0?x:(y.name==="Segment.io"?!0:r.All)!==!1}),i=Lo(n,"type"),o=i.before,a=o===void 0?[]:o,s=i.enrichment,u=s===void 0?[]:s,f=i.destination,p=f===void 0?[]:f,v=i.after,b=v===void 0?[]:v;return{before:a,enrichment:u,destinations:p,after:b}},e.prototype.flushOne=function(r){var n,i,o,a;return A(this,void 0,void 0,function(){var s,u,f,p,v,b,x,y,w,S,x,m,g,c,l;return P(this,function(h){switch(h.label){case 0:if(!this.isReady())throw new Error("Not ready");s=this.availableExtensions((n=r.event.integrations)!==null&&n!==void 0?n:{}),u=s.before,f=s.enrichment,p=0,v=u,h.label=1;case 1:return p<v.length?(b=v[p],[4,No(r,b)]):[3,4];case 2:x=h.sent(),x instanceof te&&(r=x),h.label=3;case 3:return p++,[3,1];case 4:y=0,w=f,h.label=5;case 5:return y<w.length?(S=w[y],[4,Ue(r,S)]):[3,8];case 6:x=h.sent(),x instanceof te&&(r=x),h.label=7;case 7:return y++,[3,5];case 8:return(i=Me.enriched)===null||i===void 0||i.call(Me,r),m=this.availableExtensions((o=r.event.integrations)!==null&&o!==void 0?o:{}),g=m.destinations,c=m.after,[4,new Promise(function(d,E){setTimeout(function(){var $=g.map(function(T){return Ue(r,T)});Promise.all($).then(d).catch(E)},0)})];case 9:return h.sent(),r.stats.increment("message_delivered"),(a=Me.delivered)===null||a===void 0||a.call(Me,r,["segment.io"]),l=c.map(function(d){return Ue(r,d)}),[4,Promise.all(l)];case 10:return h.sent(),[2,r]}})})},e}(Qt);function pr(t){for(var e=t.constructor.prototype,r=0,n=Object.getOwnPropertyNames(e);r<n.length;r++){var i=n[r];if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);!!o&&typeof o.value=="function"&&(t[i]=t[i].bind(t))}}return t}var Ce={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},wt=function(){function t(){this.cache={}}return t.prototype.get=function(e){return this.cache[e]},t.prototype.set=function(e,r){return this.cache[e]=r,r},t.prototype.remove=function(e){delete this.cache[e]},t}(),Uo=365,Dr=function(t){ne(e,t);function e(r){r===void 0&&(r=e.defaults);var n=t.call(this)||this;return n.options=C(C({},e.defaults),r),n}return e.available=function(){var r=window.navigator.cookieEnabled;return r||(q.set("ajs:cookies","test"),r=document.cookie.includes("ajs:cookies"),q.remove("ajs:cookies")),r},Object.defineProperty(e,"defaults",{get:function(){return{maxage:Uo,domain:tn(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),e.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},e.prototype.get=function(r){try{var n=q.get(r);if(!n)return null;try{return JSON.parse(n)}catch(i){return n}}catch(i){return null}},e.prototype.set=function(r,n){return typeof n=="string"?q.set(r,n,this.opts()):n===null?q.remove(r,this.opts()):q.set(r,JSON.stringify(n),this.opts()),n},e.prototype.remove=function(r){return q.remove(r,this.opts())},e}(wt),Mt=function(t){ne(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.get=function(n){return null},r.set=function(n,i){return null},r.remove=function(n){},r}return e}(wt),kr=function(t){ne(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.available=function(){var r="test";try{return localStorage.setItem(r,r),localStorage.removeItem(r),!0}catch(n){return!1}},e.prototype.get=function(r){var n=localStorage.getItem(r);if(n)try{return JSON.parse(n)}catch(i){return JSON.parse(JSON.stringify(n))}return null},e.prototype.set=function(r,n){try{localStorage.setItem(r,JSON.stringify(n))}catch(i){console.warn("Unable to set ".concat(r," in localStorage, storage may be full."))}return n},e.prototype.remove=function(r){return localStorage.removeItem(r)},e}(wt),yn=function(){function t(e,r){e===void 0&&(e=Ce);var n=this,i,o,a,s;this.options={},this.id=function(v){var b,y;if(n.options.disable)return null;var w=n.chainGet(n.idKey);if(v!==void 0){n.trySet(n.idKey,v);var S=v!==w&&w!==null&&v!==null;S&&n.anonymousId(null)}return(y=(b=n.chainGet(n.idKey))!==null&&b!==void 0?b:n.cookies.get(Ce.cookie.oldKey))!==null&&y!==void 0?y:null},this.anonymousId=function(v){var b,y;if(n.options.disable)return null;if(v===void 0){var w=(b=n.chainGet(n.anonKey))!==null&&b!==void 0?b:(y=n.legacySIO())===null||y===void 0?void 0:y[0];if(w)return w}return v===null?(n.trySet(n.anonKey,null),n.chainGet(n.anonKey)):(n.trySet(n.anonKey,v!=null?v:Wt()),n.chainGet(n.anonKey))},this.traits=function(v){var b,y;if(!n.options.disable)return v===null&&(v={}),v&&(n.mem.set(n.traitsKey,v!=null?v:{}),n.localStorage.set(n.traitsKey,v!=null?v:{})),(y=(b=n.localStorage.get(n.traitsKey))!==null&&b!==void 0?b:n.mem.get(n.traitsKey))!==null&&y!==void 0?y:{}},this.options=e,this.cookieOptions=r,this.idKey=(o=(i=e.cookie)===null||i===void 0?void 0:i.key)!==null&&o!==void 0?o:Ce.cookie.key,this.traitsKey=(s=(a=e.localStorage)===null||a===void 0?void 0:a.key)!==null&&s!==void 0?s:Ce.localStorage.key,this.anonKey="ajs_anonymous_id";var u=e.disable===!0,f=e.persist!==!1;this.localStorage=u||e.localStorageFallbackDisabled||!f||!kr.available()?new Mt:new kr,this.cookies=!u&&f&&Dr.available()?new Dr(r):new Mt,this.mem=u?new Mt:new wt;var p=this.cookies.get(Ce.cookie.oldKey);p&&(p.id&&this.id(p.id),p.traits&&this.traits(p.traits)),pr(this)}return t.prototype.chainGet=function(e){var r,n,i,o=(i=(n=(r=this.localStorage.get(e))!==null&&r!==void 0?r:this.cookies.get(e))!==null&&n!==void 0?n:this.mem.get(e))!==null&&i!==void 0?i:null;return this.trySet(e,typeof o=="number"?o.toString():o)},t.prototype.trySet=function(e,r){return this.localStorage.set(e,r),this.cookies.set(e,r),this.mem.set(e,r),r},t.prototype.chainClear=function(e){this.localStorage.remove(e),this.cookies.remove(e),this.mem.remove(e)},t.prototype.legacySIO=function(){var e=this.cookies.get("_sio");if(!e)return null;var r=e.split("----"),n=r[0],i=r[1];return[n,i]},t.prototype.identify=function(e,r){if(!this.options.disable){r=r!=null?r:{};var n=this.id();(n===null||n===e)&&(r=C(C({},this.traits()),r)),e&&this.id(e),this.traits(r)}},t.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},t.prototype.reset=function(){this.logout(),this.chainClear(this.idKey),this.chainClear(this.anonKey),this.chainClear(this.traitsKey)},t.prototype.load=function(){return new t(this.options,this.cookieOptions)},t.prototype.save=function(){return!0},t.defaults=Ce,t}(),Vo={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},qo=function(t){ne(e,t);function e(r,n){r===void 0&&(r=Vo);var i=t.call(this,r,n)||this;return i.anonymousId=function(o){},pr(i),i}return e}(yn),de="This is being deprecated and will be not be available in future releases of Analytics JS",At=gn(),Pt=At==null?void 0:At.analytics;function Go(t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var r=t?4:1,n=e?new fr(r,[]):new dr(r,"event-queue");return new Bo(n)}function ee(){console.warn(de)}var Zo=function(t){ne(e,t);function e(r,n,i,o,a){var s=this,u,f,p;s=t.call(this)||this,s._debug=!1,s.initialized=!1,s.user=function(){return s._user},s.init=s.initialize.bind(s),s.log=ee,s.addIntegrationMiddleware=ee,s.listeners=ee,s.addEventListener=ee,s.removeAllListeners=ee,s.removeListener=ee,s.removeEventListener=ee,s.hasListeners=ee,s.add=ee,s.addIntegration=ee;var v=n==null?void 0:n.cookie,b=(u=n==null?void 0:n.disableClientPersistence)!==null&&u!==void 0?u:!1;return s.settings=r,s.settings.timeout=(f=s.settings.timeout)!==null&&f!==void 0?f:300,s.queue=i!=null?i:Go(n==null?void 0:n.retryQueue,b),s._user=o!=null?o:new yn(b?C(C({},n==null?void 0:n.user),{persist:!1}):n==null?void 0:n.user,v).load(),s._group=a!=null?a:new qo(b?C(C({},n==null?void 0:n.group),{persist:!1}):n==null?void 0:n.group,v).load(),s.eventFactory=new $o(s._user),s.integrations=(p=n==null?void 0:n.integrations)!==null&&p!==void 0?p:{},s.options=n!=null?n:{},pr(s),s}return e.prototype.track=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o,a,s,u,f,p=this;return P(this,function(v){return i=Si.apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],f=this.eventFactory.track(o,a,s,this.integrations),[2,this.dispatch(f,u).then(function(b){return p.emit("track",o,b.event.properties,b.event.options),b})]})})},e.prototype.page=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o,a,s,u,f,p,v=this;return P(this,function(b){return i=Ir.apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],f=i[4],p=this.eventFactory.page(o,a,s,u,this.integrations),[2,this.dispatch(p,f).then(function(y){return v.emit("page",o,a,y.event.properties,y.event.options),y})]})})},e.prototype.identify=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o,a,s,u,f,p=this;return P(this,function(v){return i=Mr(this._user).apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],this._user.identify(o,a),f=this.eventFactory.identify(this._user.id(),this._user.traits(),s,this.integrations),[2,this.dispatch(f,u).then(function(b){return p.emit("identify",b.event.userId,b.event.traits,b.event.options),b})]})})},e.prototype.group=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(n.length===0)return this._group;var o=Mr(this._group).apply(void 0,n),a=o[0],s=o[1],u=o[2],f=o[3];this._group.identify(a,s);var p=this._group.id(),v=this._group.traits(),b=this.eventFactory.group(p,v,u,this.integrations);return this.dispatch(b,f).then(function(y){return r.emit("group",y.event.groupId,y.event.traits,y.event.options),y})},e.prototype.alias=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o,a,s,u,f,p=this;return P(this,function(v){return i=Ci.apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],f=this.eventFactory.alias(o,a,s,this.integrations),[2,this.dispatch(f,u).then(function(b){return p.emit("alias",o,a,b.event.options),b})]})})},e.prototype.screen=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o,a,s,u,f,p,v=this;return P(this,function(b){return i=Ir.apply(void 0,r),o=i[0],a=i[1],s=i[2],u=i[3],f=i[4],p=this.eventFactory.screen(o,a,s,u,this.integrations),[2,this.dispatch(p,f).then(function(y){return v.emit("screen",o,a,y.event.properties,y.event.options),y})]})})},e.prototype.trackClick=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o;return P(this,function(a){switch(a.label){case 0:return[4,J(()=>import("./auto-track.10e7c441.js"),["assets/auto-track.10e7c441.js","assets/index.1b45b39b.js","assets/index.08649806.css","assets/index.27821d72.js"])];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,z([this],r,!1))]}})})},e.prototype.trackLink=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o;return P(this,function(a){switch(a.label){case 0:return[4,J(()=>import("./auto-track.10e7c441.js"),["assets/auto-track.10e7c441.js","assets/index.1b45b39b.js","assets/index.08649806.css","assets/index.27821d72.js"])];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,z([this],r,!1))]}})})},e.prototype.trackSubmit=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o;return P(this,function(a){switch(a.label){case 0:return[4,J(()=>import("./auto-track.10e7c441.js"),["assets/auto-track.10e7c441.js","assets/index.1b45b39b.js","assets/index.08649806.css","assets/index.27821d72.js"])];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,z([this],r,!1))]}})})},e.prototype.trackForm=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o;return P(this,function(a){switch(a.label){case 0:return[4,J(()=>import("./auto-track.10e7c441.js"),["assets/auto-track.10e7c441.js","assets/index.1b45b39b.js","assets/index.08649806.css","assets/index.27821d72.js"])];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,z([this],r,!1))]}})})},e.prototype.register=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o,a=this;return P(this,function(s){switch(s.label){case 0:return i=te.system(),o=r.map(function(u){return a.queue.register(i,u,a)}),[4,Promise.all(o)];case 1:return s.sent(),[2,i]}})})},e.prototype.deregister=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return A(this,void 0,void 0,function(){var i,o,a=this;return P(this,function(s){switch(s.label){case 0:return i=te.system(),o=r.map(function(u){return A(a,void 0,void 0,function(){var f;return P(this,function(p){return f=this.queue.plugins.find(function(v){return v.name===u}),f?[2,this.queue.deregister(i,f,this)]:(i.log("warn","plugin ".concat(u," not found")),[2])})})}),[4,Promise.all(o)];case 1:return s.sent(),[2,i]}})})},e.prototype.debug=function(r){return r===!1&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=r,this},e.prototype.reset=function(){this._user.reset(),this._group.reset()},e.prototype.timeout=function(r){this.settings.timeout=r},e.prototype.dispatch=function(r,n){var i;return A(this,void 0,void 0,function(){var o,a,s,u,f;return P(this,function(p){switch(p.label){case 0:return o=new te(r),(i=Me.triggered)===null||i===void 0||i.call(Me,o),ut()&&!this.options.retryQueue?[2,o]:(a=Date.now(),this.queue.isEmpty()?[4,this.queue.dispatchSingle(o)]:[3,2]);case 1:return s=p.sent(),[3,4];case 2:return[4,this.queue.dispatch(o)];case 3:s=p.sent(),p.label=4;case 4:return u=Date.now()-a,f=this.settings.timeout,n?[4,Ai(s,n,Math.max((f!=null?f:300)-u,0),f)]:[3,6];case 5:s=p.sent(),p.label=6;case 6:return this._debug&&s.flush(),[2,s]}})})},e.prototype.addSourceMiddleware=function(r){return A(this,void 0,void 0,function(){var n=this;return P(this,function(i){switch(i.label){case 0:return[4,this.queue.criticalTasks.run(function(){return A(n,void 0,void 0,function(){var o,a,s;return P(this,function(u){switch(u.label){case 0:return[4,J(()=>Promise.resolve().then(()=>na),void 0)];case 1:return o=u.sent().sourceMiddlewarePlugin,a={},this.queue.plugins.forEach(function(f){if(f.type==="destination")return a[f.name]=!0}),s=o(r,a),[4,this.register(s)];case 2:return u.sent(),[2]}})})})];case 1:return i.sent(),[2,this]}})})},e.prototype.addDestinationMiddleware=function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this.queue.plugins.filter(function(a){return a.name.toLowerCase()===r.toLowerCase()});return o.forEach(function(a){a.addMiddleware.apply(a,n)}),Promise.resolve(this)},e.prototype.setAnonymousId=function(r){return this._user.anonymousId(r)},e.prototype.queryString=function(r){return A(this,void 0,void 0,function(){var n;return P(this,function(i){switch(i.label){case 0:return[4,J(()=>import("./index.7dae5d4e.js"),["assets/index.7dae5d4e.js","assets/index.1b45b39b.js","assets/index.08649806.css","assets/index.27821d72.js"])];case 1:return n=i.sent().queryString,[2,n(this,r)]}})})},e.prototype.use=function(r){return r(this),this},e.prototype.ready=function(r){return r===void 0&&(r=function(n){return n}),A(this,void 0,void 0,function(){return P(this,function(n){return[2,Promise.all(this.queue.plugins.map(function(i){return i.ready?i.ready():Promise.resolve()})).then(function(i){return r(i),i})]})})},e.prototype.noConflict=function(){return console.warn(de),window.analytics=Pt!=null?Pt:this,this},e.prototype.normalize=function(r){return console.warn(de),this.eventFactory.normalize(r)},Object.defineProperty(e.prototype,"failedInitializations",{get:function(){return console.warn(de),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"VERSION",{get:function(){return Ee},enumerable:!1,configurable:!0}),e.prototype.initialize=function(r,n){return A(this,void 0,void 0,function(){return P(this,function(i){return console.warn(de),[2,Promise.resolve(this)]})})},e.prototype.pageview=function(r){return A(this,void 0,void 0,function(){return P(this,function(n){switch(n.label){case 0:return console.warn(de),[4,this.page({path:r})];case 1:return n.sent(),[2,this]}})})},Object.defineProperty(e.prototype,"plugins",{get:function(){var r;return console.warn(de),(r=this._plugins)!==null&&r!==void 0?r:{}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Integrations",{get:function(){console.warn(de);var r=this.queue.plugins.filter(function(n){return n.type==="destination"}).reduce(function(n,i){var o="".concat(i.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),a=window[o];if(!a)return n;var s=a.Integration;return s?(n[i.name]=s,n):(n[i.name]=a,n)},{});return r},enumerable:!1,configurable:!0}),e.prototype.push=function(r){var n=this,i=r.shift();i&&!n[i]||n[i].apply(this,r)},e}(Qt);function bn(){return typeof process>"u"||!process.env?{}:process.env}var Ko=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,Ho=function(){var t,e=Array.prototype.slice.call(document.querySelectorAll("script"));return e.forEach(function(r){var n,i=(n=r.getAttribute("src"))!==null&&n!==void 0?n:"",o=Ko.exec(i);o&&o[1]&&(t=o[1])}),t},ot,Jo=function(){var t,e=ot!=null?ot:(t=window.analytics)===null||t===void 0?void 0:t._cdn;return e},Wo=function(t){window.analytics&&(window.analytics._cdn=t),ot=t},hr=function(){var t=Jo();if(t)return t;var e=Ho();return e||"https://cdn.segment.com"},Mu=function(){var t=hr();return"".concat(t,"/next-integrations")};function Qo(t,e){var r,n=Object.entries((r=e.integrations)!==null&&r!==void 0?r:{}).reduce(function(i,o){var a,s,u=o[0],f=o[1];return typeof f=="object"?C(C({},i),(a={},a[u]=f,a)):C(C({},i),(s={},s[u]={},s))},{});return Object.entries(t.integrations).reduce(function(i,o){var a,s=o[0],u=o[1];return C(C({},i),(a={},a[s]=C(C({},u),n[s]),a))},{})}function _n(){var t=document.getElementsByTagName("link"),e="";return Array.prototype.slice.call(t).forEach(function(r){r.getAttribute("rel")==="canonical"&&(e=r.getAttribute("href"))}),e}function Yo(){var t=_n();if(!t)return window.location.pathname;var e=document.createElement("a");e.href=t;var r=e.pathname.startsWith("/")?e.pathname:"/"+e.pathname;return r}function Xo(t){t===void 0&&(t="");var e=_n();if(e)return e.includes("?")?e:"".concat(e).concat(t);var r=window.location.href,n=r.indexOf("#");return n===-1?r:r.slice(0,n)}function wn(){return{path:Yo(),referrer:document.referrer,search:location.search,title:document.title,url:Xo(location.search)}}function Re(t){var e,r=t.event;r.context=r.context||{};var n=wn(),i=(e=r.properties)!==null&&e!==void 0?e:{};return Object.keys(n).forEach(function(o){i[o]&&(n[o]=i[o])}),r.context.page&&(n=Object.assign({},n,r.context.page)),r.context=Object.assign({},r.context,{page:n}),t.event=r,t}var ea={name:"Page Enrichment",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:function(t){return t.event.properties=Object.assign({},wn(),t.event.properties),t.event.name&&(t.event.properties.name=t.event.name),Re(t)},alias:Re,track:Re,identify:Re,group:Re};function xn(t){var e=Array.prototype.slice.call(window.document.querySelectorAll("script"));return e.find(function(r){return r.src===t})}function Et(t,e){var r=xn(t);if(r!==void 0){var n=r==null?void 0:r.getAttribute("status");if(n==="loaded")return Promise.resolve(r);if(n==="loading")return new Promise(function(i,o){r.addEventListener("load",function(){return i(r)}),r.addEventListener("error",function(a){return o(a)})})}return new Promise(function(i,o){var a,s=window.document.createElement("script");s.type="text/javascript",s.src=t,s.async=!0,s.setAttribute("status","loading");for(var u=0,f=Object.entries(e!=null?e:{});u<f.length;u++){var p=f[u],v=p[0],b=p[1];s.setAttribute(v,b)}s.onload=function(){s.onerror=s.onload=null,s.setAttribute("status","loaded"),i(s)},s.onerror=function(){s.onerror=s.onload=null,s.setAttribute("status","error"),o(new Error("Failed to load ".concat(t)))};var y=window.document.getElementsByTagName("script")[0];(a=y.parentElement)===null||a===void 0||a.insertBefore(s,y)})}function Au(t){var e=xn(t);return e!==void 0&&e.remove(),Promise.resolve()}function vr(t,e){var r=new fe.Facade(t,e);return t.type==="track"&&(r=new fe.Track(t,e)),t.type==="identify"&&(r=new fe.Identify(t,e)),t.type==="page"&&(r=new fe.Page(t,e)),t.type==="alias"&&(r=new fe.Alias(t,e)),t.type==="group"&&(r=new fe.Group(t,e)),t.type==="screen"&&(r=new fe.Screen(t,e)),Object.defineProperty(r,"obj",{value:t,writable:!0}),r}var ta=function(t){return JSON.parse(JSON.stringify(t))};function Sn(t,e,r){return A(this,void 0,void 0,function(){function n(f,p){return A(this,void 0,void 0,function(){var v,b,y;return P(this,function(w){switch(w.label){case 0:return v=!1,b=null,[4,pt(p({payload:vr(f,{clone:!0,traverse:!1}),integration:t,next:function(S){v=!0,S===null&&(b=null),S&&(b=S.obj)}}))];case 1:return w.sent(),!v&&b!==null&&(b=b,b.integrations=C(C({},f.integrations),(y={},y[t]=!1,y))),[2,b]}})})}var i,o,a,s,u;return P(this,function(f){switch(f.label){case 0:i=ta(e),o=0,a=r,f.label=1;case 1:return o<a.length?(s=a[o],[4,n(i,s)]):[3,4];case 2:if(u=f.sent(),u===null)return[2,null];i=u,f.label=3;case 3:return o++,[3,1];case 4:return[2,i]}})})}function ra(t,e){function r(n){return A(this,void 0,void 0,function(){var i;return P(this,function(o){switch(o.label){case 0:return i=!1,[4,pt(t({payload:vr(n.event,{clone:!0,traverse:!1}),integrations:e!=null?e:{},next:function(a){i=!0,a&&(n.event=a.obj)}}))];case 1:if(o.sent(),!i)throw new ge({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}})})}return{name:"Source Middleware ".concat(t.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(n){return Promise.resolve(n)},track:r,page:r,identify:r,alias:r,group:r}}const na=Object.freeze(Object.defineProperty({__proto__:null,applyDestinationMiddleware:Sn,sourceMiddlewarePlugin:ra},Symbol.toStringTag,{value:"Module"}));var ia=function(){function t(e,r){this.version="1.0.0",this.alternativeNames=[],this.middleware=[],this.alias=this._createMethod("alias"),this.group=this._createMethod("group"),this.identify=this._createMethod("identify"),this.page=this._createMethod("page"),this.screen=this._createMethod("screen"),this.track=this._createMethod("track"),this.action=r,this.name=e,this.type=r.type,this.alternativeNames.push(r.name)}return t.prototype.addMiddleware=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];(e=this.middleware).push.apply(e,r)},t.prototype.transform=function(e){return A(this,void 0,void 0,function(){var r;return P(this,function(n){switch(n.label){case 0:return[4,Sn(this.name,e.event,this.middleware)];case 1:return r=n.sent(),r===null&&e.cancel(new ge({retry:!1,reason:"dropped by destination middleware"})),[2,new te(r)]}})})},t.prototype._createMethod=function(e){var r=this;return function(n){return A(r,void 0,void 0,function(){var i;return P(this,function(o){switch(o.label){case 0:return this.action[e]?[4,this.transform(n)]:[2,n];case 1:return i=o.sent(),[4,this.action[e](i)];case 2:return o.sent(),[2,n]}})})}},t.prototype.isLoaded=function(){return this.action.isLoaded()},t.prototype.ready=function(){return this.action.ready?this.action.ready():Promise.resolve()},t.prototype.load=function(e,r){return this.action.load(e,r)},t.prototype.unload=function(e,r){var n,i;return(i=(n=this.action).unload)===null||i===void 0?void 0:i.call(n,e,r)},t}();function oa(t){if(!Array.isArray(t))throw new Error("Not a valid list of plugins");var e=["load","isLoaded","name","version","type"];return t.forEach(function(r){e.forEach(function(n){var i;if(r[n]===void 0)throw new Error("Plugin: ".concat((i=r.name)!==null&&i!==void 0?i:"unknown"," missing required function ").concat(n))})}),!0}function aa(t,e,r,n,i){var o,a,s;return A(this,void 0,void 0,function(){var u,f,p,v,b=this;return P(this,function(y){switch(y.label){case 0:return u=[],f=hr(),p=(a=(o=t.middlewareSettings)===null||o===void 0?void 0:o.routingRules)!==null&&a!==void 0?a:[],v=((s=t.remotePlugins)!==null&&s!==void 0?s:[]).map(function(w){return A(b,void 0,void 0,function(){var S,x,m,g,c,l,h,d,E;return P(this,function($){switch($.label){case 0:if(e.All===!1&&!e[w.name]||e[w.name]===!1)return[2];$.label=1;case 1:if($.trys.push([1,12,,13]),!n)return[3,7];S=w.url.split("/"),x=S[S.length-2],m=w.url.replace(x,btoa(x).replace(/=/g,"")),$.label=2;case 2:return $.trys.push([2,4,,6]),[4,Et(m.replace("https://cdn.segment.com",f))];case 3:return $.sent(),[3,6];case 4:return $.sent(),[4,Et(w.url.replace("https://cdn.segment.com",f))];case 5:return $.sent(),[3,6];case 6:return[3,9];case 7:return[4,Et(w.url.replace("https://cdn.segment.com",f))];case 8:$.sent(),$.label=9;case 9:return g=w.libraryName,typeof window[g]!="function"?[3,11]:(c=window[g],[4,pt(c(C(C({},w.settings),r[w.name])))]);case 10:l=$.sent(),h=Array.isArray(l)?l:[l],oa(h),d=p.filter(function(T){return T.destinationName===w.creationName}),h.forEach(function(T){var B=new ia(w.creationName,T);d.length&&i&&T.type==="destination"&&B.addMiddleware(i),u.push(B)}),$.label=11;case 11:return[3,13];case 12:return E=$.sent(),console.warn("Failed to load Remote Plugin",E),[3,13];case 13:return[2]}})})}),[4,Promise.all(v)];case 1:return y.sent(),[2,u.filter(Boolean)]}})})}var sa=function(t){var e=!1;document.addEventListener("pagehide",function(){e||(e=!0,t())}),document.addEventListener("visibilitychange",function(){if(document.visibilityState=="hidden"){if(e)return;e=!0,t()}else e=!1})},Cn=$e;typeof window<"u"&&(Cn=window.fetch||$e);var ua=500;function In(t){var e=encodeURI(JSON.stringify(t)).split(/%..|./).length-1;return e/1024}function la(t){return In(t)>=ua-50}function ca(t){var e=[],r=0;return t.forEach(function(n){var i=In(e[r]);i>=64&&r++,e[r]?e[r].push(n):e[r]=[n]}),e}function fa(t,e){var r,n,i=[],o=!1,a=(r=e==null?void 0:e.size)!==null&&r!==void 0?r:10,s=(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:5e3;function u(y){var w;if(y.length!==0){var S=(w=y[0])===null||w===void 0?void 0:w.writeKey;return Cn("https://".concat(t,"/b"),{keepalive:o,headers:{"Content-Type":"text/plain"},method:"post",body:JSON.stringify({batch:y,writeKey:S})})}}function f(){return A(this,void 0,void 0,function(){var y;return P(this,function(w){return i.length?(y=i,i=[],[2,u(y)]):[2]})})}var p;function v(){p||(p=setTimeout(function(){p=void 0,f().catch(console.error)},s))}sa(function(){if(o=!0,i.length){var y=ca(i).map(u);Promise.all(y).catch(console.error)}});function b(y,w){return A(this,void 0,void 0,function(){var S;return P(this,function(x){return i.push(w),S=i.length>=a||la(i),[2,S||o?f():v()]})})}return{dispatch:b}}var Mn=$e;typeof window<"u"&&(Mn=window.fetch||$e);function da(){function t(e,r){return Mn(e,{headers:{"Content-Type":"text/plain"},method:"post",body:JSON.stringify(r)})}return{dispatch:t}}var pa=function(t,e){return A(void 0,void 0,void 0,function(){var r;return P(this,function(n){return r=function(i){return A(void 0,void 0,void 0,function(){var o;return P(this,function(a){switch(a.label){case 0:return t(i)?(o=r,[4,e()]):[3,2];case 1:return[2,o.apply(void 0,[a.sent()])];case 2:return[2]}})})},[2,r(void 0)]})})};function ha(t,e){return A(this,void 0,void 0,function(){var r,n=this;return P(this,function(i){switch(i.label){case 0:return r=[],ut()?[2,e]:[4,pa(function(){return e.length>0&&!ut()},function(){return A(n,void 0,void 0,function(){var o,a,s;return P(this,function(u){switch(u.label){case 0:return o=e.pop(),o?[4,Ue(o,t)]:[2];case 1:return a=u.sent(),s=a instanceof te,s||r.push(o),[2]}})})})];case 1:return i.sent(),r.map(function(o){return e.pushWithBackoff(o)}),[2,e]}})})}function tt(t,e,r,n){var i=this;t||setTimeout(function(){return A(i,void 0,void 0,function(){var o,a;return P(this,function(s){switch(s.label){case 0:return o=!0,[4,ha(r,e)];case 1:return a=s.sent(),o=!1,e.todo>0&&n(o,a,r,n),[2]}})})},Math.random()*5e3)}function va(t,e){var r,n,i,o,a=t.user();return e.previousId=(i=(n=(r=e.previousId)!==null&&r!==void 0?r:e.from)!==null&&n!==void 0?n:a.id())!==null&&i!==void 0?i:a.anonymousId(),e.userId=(o=e.userId)!==null&&o!==void 0?o:e.to,delete e.from,delete e.to,e}function ma(t,e,r){var n,i,o,a,s=t.options.disableClientPersistence?new fr(t.queue.queue.maxAttempts,[]):new dr(t.queue.queue.maxAttempts,"dest-Segment.io"),u=!1,f=(n=e==null?void 0:e.apiHost)!==null&&n!==void 0?n:"api.segment.io/v1",p=(i=e==null?void 0:e.protocol)!==null&&i!==void 0?i:"https",v="".concat(p,"://").concat(f),b=((o=e==null?void 0:e.deliveryStrategy)===null||o===void 0?void 0:o.strategy)==="batching"?fa(f,(a=e==null?void 0:e.deliveryStrategy)===null||a===void 0?void 0:a.config):da();function y(S){return A(this,void 0,void 0,function(){var x,m;return P(this,function(g){return ut()?(s.push(S),tt(u,s,w,tt),[2,S]):(x=S.event.type.charAt(0),m=vr(S.event).json(),S.event.type==="track"&&delete m.traits,S.event.type==="alias"&&(m=va(t,m)),[2,b.dispatch("".concat(v,"/").concat(x),Vi(t,m,e,r)).then(function(){return S}).catch(function(c){return(c.type==="error"||c.message==="Failed to fetch")&&(s.push(S),tt(u,s,w,tt)),S})])})})}var w={name:"Segment.io",type:"after",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:y,identify:y,page:y,alias:y,group:y};return w}var An=function(t,e,r){r.getCalls(t).forEach(function(n){mr(e,n).catch(console.error)})},ga=function(t,e){return A(void 0,void 0,void 0,function(){var r,n,i;return P(this,function(o){switch(o.label){case 0:r=0,n=e.getCalls("addSourceMiddleware"),o.label=1;case 1:return r<n.length?(i=n[r],[4,mr(t,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},ya=An.bind(globalThis,"on"),ba=An.bind(globalThis,"setAnonymousId"),_a=function(t,e){e.toArray().forEach(function(r){setTimeout(function(){mr(t,r).catch(console.error)},0)})},wa=function(){function t(){this._value={}}return t.prototype.toArray=function(){var e;return(e=[]).concat.apply(e,Object.values(this._value))},t.prototype.getCalls=function(e){var r;return(r=this._value[e])!==null&&r!==void 0?r:[]},t.prototype.push=function(){for(var e=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.forEach(function(i){e._value[i.method]?e._value[i.method].push(i):e._value[i.method]=[i]}),this},t.prototype.clear=function(){return this._value={},this},t}();function mr(t,e){return A(this,void 0,void 0,function(){var r,n;return P(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e.called?[2,void 0]:(e.called=!0,r=t[e.method].apply(t,e.args),mn(r)?[4,r]:[3,2]);case 1:i.sent(),i.label=2;case 2:return e.resolve(r),[3,4];case 3:return n=i.sent(),e.reject(n),[3,4];case 4:return[2]}})})}var xa=function(){function t(e){var r=this;this._preInitBuffer=new wa,this.trackSubmit=this._createMethod("trackSubmit"),this.trackClick=this._createMethod("trackClick"),this.trackLink=this._createMethod("trackLink"),this.pageView=this._createMethod("pageview"),this.identify=this._createMethod("identify"),this.reset=this._createMethod("reset"),this.group=this._createMethod("group"),this.track=this._createMethod("track"),this.ready=this._createMethod("ready"),this.alias=this._createMethod("alias"),this.debug=this._createChainableMethod("debug"),this.page=this._createMethod("page"),this.once=this._createChainableMethod("once"),this.off=this._createChainableMethod("off"),this.on=this._createChainableMethod("on"),this.addSourceMiddleware=this._createMethod("addSourceMiddleware"),this.setAnonymousId=this._createMethod("setAnonymousId"),this.addDestinationMiddleware=this._createMethod("addDestinationMiddleware"),this.screen=this._createMethod("screen"),this.register=this._createMethod("register"),this.deregister=this._createMethod("deregister"),this.user=this._createMethod("user"),this.VERSION=Ee,this._promise=e(this._preInitBuffer),this._promise.then(function(n){var i=n[0],o=n[1];r.instance=i,r.ctx=o}).catch(function(){})}return t.prototype.then=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(e=this._promise).then.apply(e,r)},t.prototype.catch=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(e=this._promise).catch.apply(e,r)},t.prototype.finally=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(e=this._promise).finally.apply(e,r)},t.prototype._createMethod=function(e){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(r.instance){var a=(n=r.instance)[e].apply(n,i);return Promise.resolve(a)}return new Promise(function(s,u){r._preInitBuffer.push({method:e,args:i,resolve:s,reject:u,called:!1})})}},t.prototype._createChainableMethod=function(e){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return r.instance?((n=r.instance)[e].apply(n,i),r):(r._preInitBuffer.push({method:e,args:i,resolve:function(){},reject:console.error,called:!1}),r)}},t}();function Sa(t){var e=t[0],r=t.slice(1);return{method:e,resolve:function(){},reject:console.error,args:r,called:!1}}var Ca=function(t){return t.map(Sa)},Ut=function(){var t=window.analytics;if(!Array.isArray(t))return[];var e=t.splice(0,t.length);return Ca(e)};function Ia(t,e){var r=e!=null?e:hr();return $e("".concat(r,"/v1/projects/").concat(t,"/settings")).then(function(n){return n.ok?n.json():n.text().then(function(i){throw new Error(i)})}).catch(function(n){throw console.error(n.message),n})}function Ma(t){return bn().NODE_ENV!=="test"&&Object.keys(t.integrations).length>1}function Aa(t){var e,r,n;return bn().NODE_ENV!=="test"&&((n=(r=(e=t.middlewareSettings)===null||e===void 0?void 0:e.routingRules)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0)>0}function Pa(t,e){e.push.apply(e,Ut()),ba(t,e),ya(t,e)}function Ea(t,e){return A(this,void 0,void 0,function(){return P(this,function(r){switch(r.label){case 0:return e.push.apply(e,Ut()),[4,ga(t,e)];case 1:return r.sent(),e.push.apply(e,Ut()),_a(t,e),e.clear(),[2]}})})}function Oa(t,e,r,n,i){var o,a,s;return A(this,void 0,void 0,function(){var u,f,p,v,b,y,w,S,x,m,g,c=this;return P(this,function(l){switch(l.label){case 0:return Aa(t)?[4,J(()=>import("./index.0c5b062b.js"),["assets/index.0c5b062b.js","assets/index.27821d72.js","assets/index.1b45b39b.js","assets/index.08649806.css"]).then(function(h){return h.tsubMiddleware(t.middlewareSettings.routingRules)})]:[3,2];case 1:return f=l.sent(),[3,3];case 2:f=void 0,l.label=3;case 3:return u=f,Ma(t)?[4,J(()=>import("./index.24a102e7.js"),["assets/index.24a102e7.js","assets/index.27821d72.js","assets/is-plan-event-enabled.681b46ca.js","assets/index.1b45b39b.js","assets/index.08649806.css"]).then(function(h){return h.ajsDestinations(t,e.integrations,r,u)})]:[3,5];case 4:return v=l.sent(),[3,6];case 5:v=[],l.label=6;case 6:return p=v,t.legacyVideoPluginsEnabled?[4,J(()=>import("./index.e50321f4.js"),["assets/index.e50321f4.js","assets/index.27821d72.js"]).then(function(h){return h.loadLegacyVideoPlugins(e)})]:[3,8];case 7:l.sent(),l.label=8;case 8:return!((o=r.plan)===null||o===void 0)&&o.track?[4,J(()=>import("./index.1787c8e5.js"),["assets/index.1787c8e5.js","assets/index.27821d72.js","assets/is-plan-event-enabled.681b46ca.js"]).then(function(h){var d;return h.schemaFilter((d=r.plan)===null||d===void 0?void 0:d.track,t)})]:[3,10];case 9:return y=l.sent(),[3,11];case 10:y=void 0,l.label=11;case 11:return b=y,w=Qo(t,n),[4,aa(t,e.integrations,w,n.obfuscate,u).catch(function(){return[]})];case 12:return S=l.sent(),x=z(z(z([xi,ea],i,!0),p,!0),S,!0),b&&x.push(b),m=((a=r.integrations)===null||a===void 0?void 0:a.All)===!1&&!r.integrations["Segment.io"]||r.integrations&&r.integrations["Segment.io"]===!1,m||x.push(ma(e,w["Segment.io"],t.integrations)),[4,e.register.apply(e,x)];case 13:return g=l.sent(),Object.entries((s=t.enabledMiddleware)!==null&&s!==void 0?s:{}).some(function(h){var d=h[1];return d})?[4,J(()=>import("./index.ca339fe1.js"),["assets/index.ca339fe1.js","assets/index.27821d72.js","assets/index.1b45b39b.js","assets/index.08649806.css"]).then(function(h){var d=h.remoteMiddlewares;return A(c,void 0,void 0,function(){var E,$;return P(this,function(T){switch(T.label){case 0:return[4,d(g,t,n.obfuscate)];case 1:return E=T.sent(),$=E.map(function(B){return e.addSourceMiddleware(B)}),[2,Promise.all($)]}})})})]:[3,15];case 14:l.sent(),l.label=15;case 15:return[2,g]}})})}function $a(t,e,r){var n,i,o,a,s,u;return e===void 0&&(e={}),A(this,void 0,void 0,function(){var f,p,v,b,y,w,S,x,m,g;return P(this,function(c){switch(c.label){case 0:return t.cdnURL&&Wo(t.cdnURL),(n=t.cdnSettings)!==null&&n!==void 0?(p=n,[3,3]):[3,1];case 1:return[4,Ia(t.writeKey,t.cdnURL)];case 2:p=c.sent(),c.label=3;case 3:return f=p,v=(o=(i=f.integrations["Segment.io"])===null||i===void 0?void 0:i.retryQueue)!==null&&o!==void 0?o:!0,b=C({retryQueue:v},e),y=new Zo(t,b),w=(a=t.plugins)!==null&&a!==void 0?a:[],te.initMetrics(f.metrics),Pa(y,r),[4,Oa(f,y,b,e,w)];case 4:return S=c.sent(),x=(s=window.location.search)!==null&&s!==void 0?s:"",m=(u=window.location.hash)!==null&&u!==void 0?u:"",g=x.length?x:m.replace(/(?=#).*(?=\?)/,""),g.includes("ajs_")?[4,y.queryString(g).catch(console.error)]:[3,6];case 5:c.sent(),c.label=6;case 6:return y.initialized=!0,y.emit("initialize",t,e),e.initialPageview&&y.page().catch(console.error),[4,Ea(y,r)];case 7:return c.sent(),[2,[y,S]]}})})}var La=function(t){ne(e,t);function e(r){return t.call(this,r)||this}return e.load=function(r,n){return n===void 0&&(n={}),new this(function(i){return $a(r,n,i)})},e.standalone=function(r,n){return e.load({writeKey:r},n).then(function(i){return i[0]})},e}(xa);class Ta{constructor(){xr(this,"analytics");this.analytics=La.load({writeKey:"c0SISxJpICLXxstkrSppa4uxwYzBQbqf"})}trackPageLoad(){this.analytics.page()}trackEvent(e,r){this.analytics.track(e,{event_data:r,environment:"production"})}}const Da=new Ta,Pn=ie.createContext({}),Z=()=>M.exports.useContext(Pn),ka=(t,e)=>{switch(e.type){case"CATEGORY":return{...t,activeCategory:e.value};case"SCORE":{const r=qe.find(n=>e.value===""?n.value===t.activeCategory:n.scores.includes(e.value)).value;return{activeCategory:r,activeScoreByCategory:{...t.activeScoreByCategory,[r]:e.value}}}}},ja=({children:t})=>{const e=window.innerWidth<Jr.screenSizes.tablet?{activeCategory:"commute",activeScoreByCategory:{commute:"transit_friendly",amenities:"groceries",character:"quiet",nature:"parks",education:"primary_schools"}}:{activeCategory:"commute",activeScoreByCategory:{commute:"",amenities:"",character:"",nature:"",education:""}},[r,n]=M.exports.useReducer(ka,e),[i,o]=M.exports.useState(),[a,s]=M.exports.useState(),[u,f]=M.exports.useState(),[p,v]=M.exports.useState(),{activeCategory:b}=r,y=r.activeScoreByCategory[b],w=m=>{n({type:"SCORE",value:m})},S=m=>{n({type:"CATEGORY",value:m})},x=M.exports.useMemo(()=>({activeScore:y,setActiveScore:w,activeCategory:b,setActiveCategory:S,activePOI:i,setActivePOI:o,hoveredPOI:a,setHoveredPOI:s,commuteGeojson:u,setCommuteGeojson:f,destination:p,setDestination:v}),[y,w,b,S,i,o,a,s,u,f,p,v]);return _(Pn.Provider,{value:x,children:t})};function ct(t,e){if(!t)throw new Error(e)}let Fa=0;function Ra(t,e,r){if(t.style&&t.style._loaded){const n={...r};return delete n.id,delete n.children,t.addSource(e,n),t.getSource(e)}return null}function Na(t,e,r){ct(e.id===r.id,"source id changed"),ct(e.type===r.type,"source type changed");let n="",i=0;for(const a in e)a!=="children"&&a!=="id"&&!rt(r[a],e[a])&&(n=a,i++);if(!i)return;const o=e.type;if(o==="geojson")t.setData(e.data);else if(o==="image")t.updateImage({url:e.url,coordinates:e.coordinates});else if((o==="canvas"||o==="video")&&i===1&&n==="coordinates")t.setCoordinates(e.coordinates);else if(o==="vector"&&"setUrl"in t)switch(n){case"url":t.setUrl(e.url);break;case"tiles":t.setTiles(e.tiles);break}else console.warn(`Unable to update <Source> prop: ${n}`)}function za(t){const e=M.exports.useContext(Hr).map.getMap(),r=M.exports.useRef(t),[,n]=M.exports.useState(0),i=M.exports.useMemo(()=>t.id||`jsx-source-${Fa++}`,[]);M.exports.useEffect(()=>{if(e){const a=()=>n(s=>s+1);return e.on("styledata",a),a(),()=>{var s;if(e.off("styledata",a),e.style&&e.style._loaded&&e.getSource(i)){const u=(s=e.getStyle())===null||s===void 0?void 0:s.layers;if(u)for(const f of u)f.source===i&&e.removeLayer(f.id);e.removeSource(i)}}}},[e]);let o=e&&e.style&&e.getSource(i);return o?Na(o,t,r.current):o=Ra(e,i,t),r.current=t,o&&M.exports.Children.map(t.children,a=>a&&M.exports.cloneElement(a,{source:i}))||null}function Ba(t,e,r,n){if(ct(r.id===n.id,"layer id changed"),ct(r.type===n.type,"layer type changed"),r.type==="custom"||n.type==="custom")return;const{layout:i={},paint:o={},filter:a,minzoom:s,maxzoom:u,beforeId:f}=r;if(f!==n.beforeId&&t.moveLayer(e,f),i!==n.layout){const p=n.layout||{};for(const v in i)rt(i[v],p[v])||t.setLayoutProperty(e,v,i[v]);for(const v in p)i.hasOwnProperty(v)||t.setLayoutProperty(e,v,void 0)}if(o!==n.paint){const p=n.paint||{};for(const v in o)rt(o[v],p[v])||t.setPaintProperty(e,v,o[v]);for(const v in p)o.hasOwnProperty(v)||t.setPaintProperty(e,v,void 0)}rt(a,n.filter)||t.setFilter(e,a),(s!==n.minzoom||u!==n.maxzoom)&&t.setLayerZoomRange(e,s,u)}function Ua(t,e,r){if(t.style&&t.style._loaded&&(!("source"in r)||t.getSource(r.source))){const n={...r,id:e};delete n.beforeId,t.addLayer(n,r.beforeId)}}let Va=0;function qa(t){const e=M.exports.useContext(Hr).map.getMap(),r=M.exports.useRef(t),[,n]=M.exports.useState(0),i=M.exports.useMemo(()=>t.id||`jsx-layer-${Va++}`,[]);if(M.exports.useEffect(()=>{if(e){const a=()=>n(s=>s+1);return e.on("styledata",a),a(),()=>{e.off("styledata",a),e.style&&e.style._loaded&&e.getLayer(i)&&e.removeLayer(i)}}},[e]),e&&e.style&&e.getLayer(i))try{Ba(e,i,t,r.current)}catch(a){console.warn(a)}else Ua(e,i,t);return r.current=t,null}function En(t,e,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function Ot(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!jr(t[0])||!jr(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return En(n,e,r)}function Ga(t,e,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:t};return En(n,e,r)}function jr(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function On(t,e,r){if(t!==null)for(var n,i,o,a,s,u,f,p=0,v=0,b,y=t.type,w=y==="FeatureCollection",S=y==="Feature",x=w?t.features.length:1,m=0;m<x;m++){f=w?t.features[m].geometry:S?t.geometry:t,b=f?f.type==="GeometryCollection":!1,s=b?f.geometries.length:1;for(var g=0;g<s;g++){var c=0,l=0;if(a=b?f.geometries[g]:f,a!==null){u=a.coordinates;var h=a.type;switch(p=r&&(h==="Polygon"||h==="MultiPolygon")?1:0,h){case null:break;case"Point":if(e(u,v,m,c,l)===!1)return!1;v++,c++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(e(u[n],v,m,c,l)===!1)return!1;v++,h==="MultiPoint"&&c++}h==="LineString"&&c++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-p;i++){if(e(u[n][i],v,m,c,l)===!1)return!1;v++}h==="MultiLineString"&&c++,h==="Polygon"&&l++}h==="Polygon"&&c++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(l=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-p;o++){if(e(u[n][i][o],v,m,c,l)===!1)return!1;v++}l++}c++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(On(a.geometries[n],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Vt(t){var e=[1/0,1/0,-1/0,-1/0];return On(t,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}Vt.default=Vt;var Za="Expected a function",Fr=0/0,Ka="[object Symbol]",Ha=/^\s+|\s+$/g,Ja=/^[-+]0x[0-9a-f]+$/i,Wa=/^0b[01]+$/i,Qa=/^0o[0-7]+$/i,Ya=parseInt,Xa=typeof D=="object"&&D&&D.Object===Object&&D,es=typeof self=="object"&&self&&self.Object===Object&&self,ts=Xa||es||Function("return this")(),rs=Object.prototype,ns=rs.toString,is=Math.max,os=Math.min,$t=function(){return ts.Date.now()};function as(t,e,r){var n,i,o,a,s,u,f=0,p=!1,v=!1,b=!0;if(typeof t!="function")throw new TypeError(Za);e=Rr(e)||0,qt(r)&&(p=!!r.leading,v="maxWait"in r,o=v?is(Rr(r.maxWait)||0,e):o,b="trailing"in r?!!r.trailing:b);function y(d){var E=n,$=i;return n=i=void 0,f=d,a=t.apply($,E),a}function w(d){return f=d,s=setTimeout(m,e),p?y(d):a}function S(d){var E=d-u,$=d-f,T=e-E;return v?os(T,o-$):T}function x(d){var E=d-u,$=d-f;return u===void 0||E>=e||E<0||v&&$>=o}function m(){var d=$t();if(x(d))return g(d);s=setTimeout(m,S(d))}function g(d){return s=void 0,b&&n?y(d):(n=i=void 0,a)}function c(){s!==void 0&&clearTimeout(s),f=0,n=u=i=s=void 0}function l(){return s===void 0?a:g($t())}function h(){var d=$t(),E=x(d);if(n=arguments,i=this,u=d,E){if(s===void 0)return w(u);if(v)return s=setTimeout(m,e),y(u)}return s===void 0&&(s=setTimeout(m,e)),a}return h.cancel=c,h.flush=l,h}function qt(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function ss(t){return!!t&&typeof t=="object"}function us(t){return typeof t=="symbol"||ss(t)&&ns.call(t)==Ka}function Rr(t){if(typeof t=="number")return t;if(us(t))return Fr;if(qt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=qt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Ha,"");var r=Wa.test(t);return r||Qa.test(t)?Ya(t.slice(2),r?2:8):Ja.test(t)?Fr:+t}var ls=as;const gr=()=>{const[t,e]=M.exports.useState(!1);return M.exports.useLayoutEffect(()=>{const r=()=>{e(window.innerWidth<Jr.screenSizes.tablet)};return window.addEventListener("resize",ls(r,250)),r(),()=>window.removeEventListener("resize",r)},[]),t};function $n(){var s;const{client:t}=Zt(),{sdkState:e}=be(),r=Kt(e.options,250),{activeScore:n}=Z(),i=n?Be[n]:void 0,a={...M.exports.useMemo(()=>r!=null&&r.marker?r.marker:{lat:r==null?void 0:r.lat,lng:r==null?void 0:r.lng},[r]),limit:10,radius:2e3,include:i};return dt(Xn.list(a),async()=>t.getPois(a),{enabled:!!a&&!!((s=a.include)!=null&&s.length)&&!!a.lat&&!!a.lng})}function Ln(){const{client:t}=Zt(),{sdkState:e}=be(),r=Kt(e.options,250),{activeScore:n}=Z(),i=n==="high_schools"||n==="primary_schools",a={...M.exports.useMemo(()=>r!=null&&r.marker?r.marker:{lat:r==null?void 0:r.lat,lng:r==null?void 0:r.lng},[r]),limit:10,radius:2e3};return dt(ei.list(a),async()=>t.getSchools(a),{enabled:!!a&&!!a.lat&&!!a.lng&&i})}const Tn=ie.createContext({}),Dn=()=>M.exports.useContext(Tn),cs=({children:t,mapRef:e,mapPadding:r})=>_(Tn.Provider,{value:{mapRef:e,mapPadding:r},children:t});function Gt(t,e,r,n,i,o){if(i-n<=r)return;const a=n+i>>1;kn(t,e,a,n,i,o%2),Gt(t,e,r,n,a-1,o+1),Gt(t,e,r,a+1,i,o+1)}function kn(t,e,r,n,i,o){for(;i>n;){if(i-n>600){const f=i-n+1,p=r-n+1,v=Math.log(f),b=.5*Math.exp(2*v/3),y=.5*Math.sqrt(v*b*(f-b)/f)*(p-f/2<0?-1:1),w=Math.max(n,Math.floor(r-p*b/f+y)),S=Math.min(i,Math.floor(r+(f-p)*b/f+y));kn(t,e,r,w,S,o)}const a=e[2*r+o];let s=n,u=i;for(Ne(t,e,n,r),e[2*i+o]>a&&Ne(t,e,n,i);s<u;){for(Ne(t,e,s,u),s++,u--;e[2*s+o]<a;)s++;for(;e[2*u+o]>a;)u--}e[2*n+o]===a?Ne(t,e,n,u):(u++,Ne(t,e,u,i)),u<=r&&(n=u+1),r<=u&&(i=u-1)}}function Ne(t,e,r,n){Lt(t,r,n),Lt(e,2*r,2*n),Lt(e,2*r+1,2*n+1)}function Lt(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function fs(t,e,r,n,i,o,a){const s=[0,t.length-1,0],u=[];let f,p;for(;s.length;){const v=s.pop(),b=s.pop(),y=s.pop();if(b-y<=a){for(let x=y;x<=b;x++)f=e[2*x],p=e[2*x+1],f>=r&&f<=i&&p>=n&&p<=o&&u.push(t[x]);continue}const w=Math.floor((y+b)/2);f=e[2*w],p=e[2*w+1],f>=r&&f<=i&&p>=n&&p<=o&&u.push(t[w]);const S=(v+1)%2;(v===0?r<=f:n<=p)&&(s.push(y),s.push(w-1),s.push(S)),(v===0?i>=f:o>=p)&&(s.push(w+1),s.push(b),s.push(S))}return u}function ds(t,e,r,n,i,o){const a=[0,t.length-1,0],s=[],u=i*i;for(;a.length;){const f=a.pop(),p=a.pop(),v=a.pop();if(p-v<=o){for(let x=v;x<=p;x++)Nr(e[2*x],e[2*x+1],r,n)<=u&&s.push(t[x]);continue}const b=Math.floor((v+p)/2),y=e[2*b],w=e[2*b+1];Nr(y,w,r,n)<=u&&s.push(t[b]);const S=(f+1)%2;(f===0?r-i<=y:n-i<=w)&&(a.push(v),a.push(b-1),a.push(S)),(f===0?r+i>=y:n+i>=w)&&(a.push(b+1),a.push(p),a.push(S))}return s}function Nr(t,e,r,n){const i=t-r,o=e-n;return i*i+o*o}const ps=t=>t[0],hs=t=>t[1];class zr{constructor(e,r=ps,n=hs,i=64,o=Float64Array){this.nodeSize=i,this.points=e;const a=e.length<65536?Uint16Array:Uint32Array,s=this.ids=new a(e.length),u=this.coords=new o(e.length*2);for(let f=0;f<e.length;f++)s[f]=f,u[2*f]=r(e[f]),u[2*f+1]=n(e[f]);Gt(s,u,i,0,s.length-1,0)}range(e,r,n,i){return fs(this.ids,this.coords,e,r,n,i,this.nodeSize)}within(e,r,n){return ds(this.ids,this.coords,e,r,n,this.nodeSize)}}const vs={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},ft=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1));class ms{constructor(e){this.options=Ve(Object.create(vs),e),this.trees=new Array(this.options.maxZoom+1)}load(e){const{log:r,minZoom:n,maxZoom:i,nodeSize:o}=this.options;r&&console.time("total time");const a=`prepare ${e.length} points`;r&&console.time(a),this.points=e;let s=[];for(let u=0;u<e.length;u++)!e[u].geometry||s.push(ys(e[u],u));this.trees[i+1]=new zr(s,Ur,Vr,o,Float32Array),r&&console.timeEnd(a);for(let u=i;u>=n;u--){const f=+Date.now();s=this._cluster(s,u),this.trees[u]=new zr(s,Ur,Vr,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-f)}return r&&console.timeEnd("total time"),this}getClusters(e,r){let n=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let o=e[2]===180?180:((e[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,o=180;else if(n>o){const p=this.getClusters([n,i,180,a],r),v=this.getClusters([-180,i,o,a],r);return p.concat(v)}const s=this.trees[this._limitZoom(r)],u=s.range(at(n),st(a),at(o),st(i)),f=[];for(const p of u){const v=s.points[p];f.push(v.numPoints?Br(v):this.points[v.index])}return f}getChildren(e){const r=this._getOriginId(e),n=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(i);const a=o.points[r];if(!a)throw new Error(i);const s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),u=o.within(a.x,a.y,s),f=[];for(const p of u){const v=o.points[p];v.parentId===e&&f.push(v.numPoints?Br(v):this.points[v.index])}if(f.length===0)throw new Error(i);return f}getLeaves(e,r,n){r=r||10,n=n||0;const i=[];return this._appendLeaves(i,e,r,n,0),i}getTile(e,r,n){const i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:a,radius:s}=this.options,u=s/a,f=(n-u)/o,p=(n+1+u)/o,v={features:[]};return this._addTileFeatures(i.range((r-u)/o,f,(r+1+u)/o,p),i.points,r,n,o,v),r===0&&this._addTileFeatures(i.range(1-u/o,f,1,p),i.points,o,n,o,v),r===o-1&&this._addTileFeatures(i.range(0,f,u/o,p),i.points,-1,n,o,v),v.features.length?v:null}getClusterExpansionZoom(e){let r=this._getOriginZoom(e)-1;for(;r<=this.options.maxZoom;){const n=this.getChildren(e);if(r++,n.length!==1)break;e=n[0].properties.cluster_id}return r}_appendLeaves(e,r,n,i,o){const a=this.getChildren(r);for(const s of a){const u=s.properties;if(u&&u.cluster?o+u.point_count<=i?o+=u.point_count:o=this._appendLeaves(e,u.cluster_id,n,i,o):o<i?o++:e.push(s),e.length===n)break}return o}_addTileFeatures(e,r,n,i,o,a){for(const s of e){const u=r[s],f=u.numPoints;let p,v,b;if(f)p=jn(u),v=u.x,b=u.y;else{const S=this.points[u.index];p=S.properties,v=at(S.geometry.coordinates[0]),b=st(S.geometry.coordinates[1])}const y={type:1,geometry:[[Math.round(this.options.extent*(v*o-n)),Math.round(this.options.extent*(b*o-i))]],tags:p};let w;f?w=u.id:this.options.generateId?w=u.index:this.points[u.index].id&&(w=this.points[u.index].id),w!==void 0&&(y.id=w),a.features.push(y)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,r){const n=[],{radius:i,extent:o,reduce:a,minPoints:s}=this.options,u=i/(o*Math.pow(2,r));for(let f=0;f<e.length;f++){const p=e[f];if(p.zoom<=r)continue;p.zoom=r;const v=this.trees[r+1],b=v.within(p.x,p.y,u),y=p.numPoints||1;let w=y;for(const S of b){const x=v.points[S];x.zoom>r&&(w+=x.numPoints||1)}if(w>y&&w>=s){let S=p.x*y,x=p.y*y,m=a&&y>1?this._map(p,!0):null;const g=(f<<5)+(r+1)+this.points.length;for(const c of b){const l=v.points[c];if(l.zoom<=r)continue;l.zoom=r;const h=l.numPoints||1;S+=l.x*h,x+=l.y*h,l.parentId=g,a&&(m||(m=this._map(p,!0)),a(m,this._map(l)))}p.parentId=g,n.push(gs(S/w,x/w,g,w,m))}else if(n.push(p),w>1)for(const S of b){const x=v.points[S];x.zoom<=r||(x.zoom=r,n.push(x))}}return n}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,r){if(e.numPoints)return r?Ve({},e.properties):e.properties;const n=this.points[e.index].properties,i=this.options.map(n);return r&&i===n?Ve({},i):i}}function gs(t,e,r,n,i){return{x:ft(t),y:ft(e),zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function ys(t,e){const[r,n]=t.geometry.coordinates;return{x:ft(at(r)),y:ft(st(n)),zoom:1/0,index:e,parentId:-1}}function Br(t){return{type:"Feature",id:t.id,properties:jn(t),geometry:{type:"Point",coordinates:[bs(t.x),_s(t.y)]}}}function jn(t){const e=t.numPoints,r=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?`${Math.round(e/100)/10}k`:e;return Ve(Ve({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function at(t){return t/360+.5}function st(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function bs(t){return(t-.5)*360}function _s(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function Ve(t,e){for(const r in e)t[r]=e[r];return t}function Ur(t){return t.x}function Vr(t){return t.y}var qr=Object.prototype.hasOwnProperty;function Gr(t,e,r){for(r of t.keys())if(ve(r,e))return r}function ve(t,e){var r,n,i;if(t===e)return!0;if(t&&e&&(r=t.constructor)===e.constructor){if(r===Date)return t.getTime()===e.getTime();if(r===RegExp)return t.toString()===e.toString();if(r===Array){if((n=t.length)===e.length)for(;n--&&ve(t[n],e[n]););return n===-1}if(r===Set){if(t.size!==e.size)return!1;for(n of t)if(i=n,i&&typeof i=="object"&&(i=Gr(e,i),!i)||!e.has(i))return!1;return!0}if(r===Map){if(t.size!==e.size)return!1;for(n of t)if(i=n[0],i&&typeof i=="object"&&(i=Gr(e,i),!i)||!ve(n[1],e.get(i)))return!1;return!0}if(r===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(r===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return n===-1}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return n===-1}if(!r||typeof t=="object"){n=0;for(r in t)if(qr.call(t,r)&&++n&&!qr.call(e,r)||!(r in e)||!ve(t[r],e[r]))return!1;return Object.keys(e).length===n}}return t!==t&&e!==e}function ws(t){var e=M.exports.useRef(t),r=M.exports.useRef(0);return ve(t,e.current)||(e.current=t,r.current+=1),M.exports.useMemo(function(){return e.current},[r.current])}function xs(t,e){return M.exports.useEffect(t,ws(e))}var Ss=function(e){var r=e.points,n=e.bounds,i=e.zoom,o=e.options,a=M.exports.useRef(),s=M.exports.useRef(),u=M.exports.useState([]),f=u[0],p=u[1],v=Math.round(i);return xs(function(){(!a.current||!ve(s.current,r)||!ve(a.current.options,o))&&(a.current=new ms(o),a.current.load(r)),n&&p(a.current.getClusters(n,v)),s.current=r},[r,n,v,o]),{clusters:f,supercluster:a.current}};const Cs=L.div`
|
|
2
|
-
border-radius: 50%;
|
|
3
|
-
background: linear-gradient(
|
|
4
|
-
to top,
|
|
5
|
-
${I["--ll-color-primary-variant1"]},
|
|
6
|
-
${I["--ll-color-primary"]}
|
|
7
|
-
);
|
|
8
|
-
color: ${I["--ll-color-on-primary"]};
|
|
9
|
-
height: ${({diameter:t})=>t}px;
|
|
10
|
-
width: ${({diameter:t})=>t}px;
|
|
11
|
-
display: flex;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
align-items: center;
|
|
14
|
-
line-height: 1;
|
|
15
|
-
font-family: ${I["--ll-font-family"]};
|
|
16
|
-
font-size: ${({diameter:t})=>t/2.5}px;
|
|
17
|
-
border: 2px solid #fff;
|
|
18
|
-
box-shadow: ${I["--ll-shadow-small"]};
|
|
19
|
-
cursor: default;
|
|
20
|
-
`,Is=({cluster:t,pointsCount:e,onClick:r})=>{const i=20+t.properties.point_count/e*25;return _(Cs,{diameter:i,onClick:()=>r&&r(t),children:t.properties.point_count})};function Ms(t){return t.properties.cluster!==void 0}const Fn=ie.memo(({rect:t,zoom:e,mapRef:r,points:n,isMobile:i,activePOI:o,hoveredPOI:a,isMapMoving:s,setActivePOI:u})=>{var b;const f=(b=r==null?void 0:r.current)==null?void 0:b.getMap().getBounds().toArray().flat(),{clusters:p,supercluster:v}=Ss({points:n,bounds:f,zoom:e,options:{radius:50,maxZoom:18}});return _(Ge,{children:p.map((y,w)=>{const[S,x]=y.geometry.coordinates;if(Ms(y))return _(Sr,{latitude:x,longitude:S,children:_(Is,{cluster:y,pointsCount:n.length,onClick:()=>{var E;const d=Math.min(v.getClusterExpansionZoom(y.id),20);(E=r.current)==null||E.flyTo({zoom:d,center:[S,x],duration:1e3,essential:!0})}})},`cluster-${y.id}`);const{poi:m,type:g}=y.properties,c=o===m,l=a===m,h=["rapid_transit_stations"];return _(Sr,{latitude:m.lat,longitude:m.lng,style:{zIndex:c?1:0},children:F(St.Root,{options:{type:g,poi:m,isOpen:s?!1:c,isHovered:l,side:"top",size:h.includes(g)?"medium":"small",collisionPadding:i?{top:t.height+32,bottom:we*2,left:we*2,right:we*2}:{left:t.width+32,right:we*2,top:we*2,bottom:we*2}},onChange:d=>{d.type==="open-change"&&(d.data?setTimeout(()=>{u(m)},0):c&&u(void 0))},children:[_(St.Marker,{}),_(St.Content,{})]})},`${m.name}-${m.lat}-${m.lng}-${w}`)})})});Fn.displayName="Markers";const Rn=t=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},M.exports.createElement("path",{d:"M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2ZM12 11.5C10.62 11.5 9.5 10.38 9.5 9C9.5 7.62 10.62 6.5 12 6.5C13.38 6.5 14.5 7.62 14.5 9C14.5 10.38 13.38 11.5 12 11.5Z"})),Nn=t=>M.exports.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},M.exports.createElement("path",{d:"M10 20V14H14V20H19V12H22L12 3L2 12H5V20H10Z"}));function yr(t){const{client:e}=Zt(),{sdkState:r}=be(),n=Kt(r.options,250),o={...M.exports.useMemo(()=>n!=null&&n.marker?n.marker:{lat:n==null?void 0:n.lat,lng:n==null?void 0:n.lng},[n]),geographyLevels:["20","30"],locationScoresRounding:!1,include:t};return dt(ti.list(o),async()=>e.getScores(o),{enabled:!!o})}const As=L.div`
|
|
21
|
-
padding: ${I["--ll-spacing-small"]} ${I["--ll-spacing-medium"]};
|
|
22
|
-
background-color: ${I["--ll-color-surface"]};
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
flex: 1;
|
|
27
|
-
`,Ps=L.div`
|
|
28
|
-
display: grid;
|
|
29
|
-
grid-template-columns: min-content 1fr;
|
|
30
|
-
grid-gap: ${I["--ll-spacing-medium"]};
|
|
31
|
-
margin-bottom: ${I["--ll-spacing-medium"]};
|
|
32
|
-
`,Es=()=>{var a,s;const{sdkState:t}=be(),{activeCategory:e,activeScore:r}=Z(),n=qe.find(u=>u.value===e),{data:i,isLoading:o}=yr(n.scores);return r&&(i==null?void 0:i.location[r])?o?_("div",{children:"Loading"}):_(U.Root,{options:{score:r,scoresData:i},children:F(As,{children:[F(Ps,{children:[_(U.Badge,{}),_(U.BarChart,{options:{locationIcon:((s=(a=t.options)==null?void 0:a.marker)==null?void 0:s.icon)==="pin"?Rn:Nn}})]}),_(U.Description,{})]})}):null},Os=L.div`
|
|
33
|
-
display: flex;
|
|
34
|
-
overflow-x: scroll;
|
|
35
|
-
padding: ${I["--ll-spacing-x-small"]} ${I["--ll-spacing-medium"]};
|
|
36
|
-
flex-shrink: 0;
|
|
37
|
-
position: relative;
|
|
38
|
-
`,$s=L.button`
|
|
39
|
-
position: relative;
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-direction: column;
|
|
42
|
-
align-items: center;
|
|
43
|
-
background: none;
|
|
44
|
-
border: none;
|
|
45
|
-
min-width: 60px;
|
|
46
|
-
padding: 0;
|
|
47
|
-
margin: 0 8px;
|
|
48
|
-
flex-shrink: 0;
|
|
49
|
-
|
|
50
|
-
&:first-child {
|
|
51
|
-
margin-left: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&:last-child {
|
|
55
|
-
margin-right: 0;
|
|
56
|
-
}
|
|
57
|
-
`,Ls=L.div`
|
|
58
|
-
position: absolute;
|
|
59
|
-
top: -6px;
|
|
60
|
-
right: 4px;
|
|
61
|
-
border: 2px solid ${I["--ll-color-background"]};
|
|
62
|
-
border-radius: 6px;
|
|
63
|
-
`,Ts=L.div`
|
|
64
|
-
flex: 1;
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
`,Ds=L.div`
|
|
68
|
-
margin: 0 2px;
|
|
69
|
-
`,ks=({category:t})=>{const{data:e,isLoading:r,isFetching:n}=yr(t.scores),{activeScore:i,setActiveScore:o,setActiveCategory:a}=Z();return _(Os,{children:t.scores.map(s=>{const u=s===i,f=u?"--ll-color-primary":"--ll-color-disabled";return r||n?_(Ds,{children:_(Ze,{height:"44px",width:"60px"})},s):_(U.Root,{options:{score:s,scoresData:e},children:F($s,{onClick:()=>{a(t.value),o(s)},children:[_(U.Icon,{options:{color:f,height:28,width:28}}),_(Ts,{children:_(U.Title,{options:{variant:"caption1",color:f,noWrap:!0,noMargin:!0,weight:"--ll-font-weight-bold"}})}),_(Ls,{children:_(U.Badge,{options:{variant:"small",isPrimary:u}})})]})},s)})})},js=L.div`
|
|
70
|
-
display: flex;
|
|
71
|
-
padding: ${I["--ll-spacing-x-small"]} ${I["--ll-spacing-medium"]}
|
|
72
|
-
${I["--ll-spacing-xx-small"]} ${I["--ll-spacing-medium"]};
|
|
73
|
-
`,Fs=L.div`
|
|
74
|
-
position: absolute;
|
|
75
|
-
top: 0;
|
|
76
|
-
left: 0;
|
|
77
|
-
right: 0;
|
|
78
|
-
z-index: 3;
|
|
79
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
|
|
80
|
-
overflow: hidden;
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
background-color: ${I["--ll-color-background"]};
|
|
84
|
-
border: 1px solid ${I["--ll-color-border"]};
|
|
85
|
-
`,zn=ie.forwardRef((t,e)=>{const{activeCategory:r,setActiveCategory:n}=Z();return F(Fs,{ref:e,children:[_(js,{children:F(se.Root,{value:r,onValueChange:i=>n(i),children:[_(se.Trigger,{size:"large",children:_(Ye.Root,{options:{scoreCategory:r},children:_(Ye.Title,{options:{color:"inherit",noMargin:!0,variant:"h6",lineHeight:1}})},r)}),_(se.Content,{children:qe.map(i=>_(Ye.Root,{options:{scoreCategory:i.value},children:_(se.Item,{value:i.value,children:_(Ye.Title,{options:{color:"inherit",noMargin:!0,variant:"h6"}})})},i.value))})]})}),_(ks,{category:qe.find(i=>i.value===r)}),_(Es,{})]})});zn.displayName="MobileScores";const Rs=Wr({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Ns=Wr({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),zs=L(ri)`
|
|
86
|
-
margin: 0;
|
|
87
|
-
z-index: 1;
|
|
88
|
-
position: relative;
|
|
89
|
-
margin: 0 calc(-1 * ${I["--ll-spacing-medium"]});
|
|
90
|
-
padding: 0 ${I["--ll-spacing-medium"]};
|
|
91
|
-
|
|
92
|
-
&:hover {
|
|
93
|
-
background-color: ${I["--ll-color-surface"]};
|
|
94
|
-
box-shadow: ${I["--ll-shadow-small"]};
|
|
95
|
-
}
|
|
96
|
-
`,Bn=L(ni)`
|
|
97
|
-
background: none;
|
|
98
|
-
border: none;
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: center;
|
|
101
|
-
width: 100%;
|
|
102
|
-
padding: ${I["--ll-spacing-x-small"]} 0;
|
|
103
|
-
`,Bs=L(ii)`
|
|
104
|
-
background-color: ${I["--ll-color-surface"]};
|
|
105
|
-
position: relative;
|
|
106
|
-
overflow: hidden;
|
|
107
|
-
margin-left: calc(-1 * ${I["--ll-spacing-medium"]});
|
|
108
|
-
margin-right: calc(-1 * ${I["--ll-spacing-medium"]});
|
|
109
|
-
|
|
110
|
-
[data-state="open"] & {
|
|
111
|
-
animation: ${Rs} 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
[data-state="closed"] & {
|
|
115
|
-
animation: ${Ns} 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
116
|
-
}
|
|
117
|
-
`,Us=L.div`
|
|
118
|
-
padding: ${I["--ll-spacing-medium"]};
|
|
119
|
-
border-top: 1px solid ${I["--ll-color-border"]};
|
|
120
|
-
border-bottom: 1px solid ${I["--ll-color-border"]};
|
|
121
|
-
`,Vs=L.span`
|
|
122
|
-
${Bn}[data-state=open] & {
|
|
123
|
-
transform: rotate(90deg);
|
|
124
|
-
} ;
|
|
125
|
-
`;L.div`
|
|
126
|
-
display: flex;
|
|
127
|
-
align-items: flex-start;
|
|
128
|
-
justify-content: space-between;
|
|
129
|
-
`;const br=L.div`
|
|
130
|
-
margin: ${I["--ll-spacing-small"]} 0;
|
|
131
|
-
`,qs=L.div`
|
|
132
|
-
margin-top: ${I["--ll-spacing-large"]};
|
|
133
|
-
&:empty {
|
|
134
|
-
margin: 0;
|
|
135
|
-
}
|
|
136
|
-
`,Gs=({score:t})=>{const{data:e,isLoading:r}=Ln(),{activePOI:n,setActivePOI:i,hoveredPOI:o,setHoveredPOI:a}=Z(),{mapRef:s,mapPadding:u}=Dn();return r?_(Ge,{children:[...Array(10)].map((f,p)=>_(br,{children:_(Ze,{height:"34px",width:"100%"})},p))}):e?_(Qr.Root,{options:{type:"school",data:e==null?void 0:e[t],activePOI:n,hoveredPOI:o},onChange:f=>{var p;if(f.type==="poi-click"){const v=f.data;i(v);const b=window.innerWidth-u.left,y=window.innerWidth/2,w=b/2+u.left-y;v&&((p=s.current)==null||p.easeTo({zoom:18,center:[v.lng,v.lat],duration:1e3,offset:[w,0]}))}f.type==="poi-hover"&&a(f.data)}}):null},Un=ie.memo(({result:t,poi:e})=>{const{activePOI:r,setActivePOI:n,hoveredPOI:i,setHoveredPOI:o}=Z(),{mapRef:a,mapPadding:s}=Dn();return!t.data||!t.data[e]?null:_(kt.Content,{options:{value:e},children:_(Qr.Root,{options:{type:"poi",data:t.data[e],activePOI:r,hoveredPOI:i},onChange:u=>{var f;if(u.type==="poi-click"){const p=u.data;n(p);const v=window.innerWidth-s.left,b=window.innerWidth/2,y=v/2+s.left-b;p&&((f=a.current)==null||f.flyTo({zoom:18,center:[p.lng,p.lat],duration:1e3,offset:[y,0],essential:!0}))}u.type==="poi-hover"&&o(u.data)}})},e)});Un.displayName="POI";const Vn=ie.memo(({include:t})=>{const e=$n(),r=t==null?void 0:t.filter(n=>{var i;return(((i=e==null?void 0:e.data)==null?void 0:i[n])||[]).length>0});return e.isLoading&&r.length?_(Ge,{children:[...Array(10)].map((n,i)=>_(br,{children:_(Ze,{height:"34px",width:"100%"})},i))}):e.data?F(kt.Root,{options:{include:r},children:[_(kt.Tabs,{}),r.map(n=>_(Un,{poi:n,result:e},n))]}):null});Vn.displayName="POIs";const qn=ie.memo(({score:t,isLoading:e,scoresData:r})=>{var a,s;const{sdkState:n}=be(),{activeScore:i}=Z(),o=t===i;return e?_(br,{children:_(Ze,{height:"34px",width:"100%"},t)}):r!=null&&r.location[t]?_(oi,{value:t,children:F(U.Root,{options:{score:t,scoresData:r},children:[_(zs,{children:F(Bn,{children:[_(Vs,{children:_(Yr,{SVGElement:ai,fill:I["--ll-color-on-background-variant1"]})}),_(Ie,{spacing:"--ll-spacing-small"}),_(U.Icon,{}),_(Ie,{spacing:"--ll-spacing-small"}),_(U.Title,{}),_(Ie,{}),_(U.Badge,{options:{isPrimary:o}})]})}),_(Bs,{children:F(Us,{children:[_(U.Description,{}),_(Ie,{vertical:!0,spacing:"--ll-spacing-small"}),_(U.BarChart,{options:{locationIcon:((s=(a=n.options)==null?void 0:a.marker)==null?void 0:s.icon)==="pin"?Rn:Nn}}),_(qs,{children:t==="high_schools"||t==="primary_schools"?_(Gs,{score:t}):_(Vn,{include:Be[t]})})]})})]})},t):null});qn.displayName="Score";const Zs=L.div`
|
|
137
|
-
padding: ${I["--ll-spacing-small"]} ${I["--ll-spacing-medium"]};
|
|
138
|
-
`,Ks=L.div`
|
|
139
|
-
display: flex;
|
|
140
|
-
justify-content: space-between;
|
|
141
|
-
align-items: center;
|
|
142
|
-
`,Gn=ie.memo(({tabContent:t})=>{const{data:e,isLoading:r,isFetching:n}=yr(t.scores),{translations:i}=Ht();return F(Zs,{children:[F(Ks,{children:[_(nt.Title,{options:{variant:"h4",noMargin:!0,weight:"--ll-font-weight-medium"}}),n&&!r&&_(gi,{size:"small"})]}),_(Ie,{spacing:"--ll-spacing-small",vertical:!0}),!n&&!Object.keys((e==null?void 0:e.location)||{}).length&&_(ze,{color:"--ll-color-on-background-variant1",children:i.EMPTY_TEXT}),t.scores.map(o=>_(qn,{score:o,isLoading:r,scoresData:e},o))]})});Gn.displayName="ScoreCategory";const Zn=ie.memo(({tabContent:t})=>{const{activeScore:e,setActiveScore:r}=Z();return M.exports.useEffect(()=>{r(t.scores[0])},[]),_(si,{value:e,onValueChange:n=>{r(n)},type:"single",collapsible:!0,children:_(Gn,{tabContent:t})})});Zn.displayName="ScoreCategoryAccordion";const Hs=L.div`
|
|
143
|
-
overflow-y: auto;
|
|
144
|
-
`,Js=L.div`
|
|
145
|
-
position: absolute;
|
|
146
|
-
top: ${I["--ll-spacing-medium"]};
|
|
147
|
-
left: ${I["--ll-spacing-medium"]};
|
|
148
|
-
width: 360px;
|
|
149
|
-
max-height: calc(100% - 2 * ${I["--ll-spacing-medium"]});
|
|
150
|
-
z-index: 1;
|
|
151
|
-
border-radius: ${I["--ll-border-radius-medium"]};
|
|
152
|
-
box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;
|
|
153
|
-
background-color: #fff;
|
|
154
|
-
overflow: hidden;
|
|
155
|
-
display: flex;
|
|
156
|
-
flex-direction: column;
|
|
157
|
-
background-color: ${I["--ll-color-background"]};
|
|
158
|
-
border: 1px solid ${I["--ll-color-border"]};
|
|
159
|
-
`;L.div`
|
|
160
|
-
display: flex;
|
|
161
|
-
justify-content: center;
|
|
162
|
-
padding: ${I["--ll-spacing-small"]};
|
|
163
|
-
`;const Ws=L.div`
|
|
164
|
-
padding: ${I["--ll-spacing-xx-small"]};
|
|
165
|
-
border-bottom: 1px solid ${I["--ll-color-border"]};
|
|
166
|
-
`,Qs=L.div`
|
|
167
|
-
display: flex;
|
|
168
|
-
justify-content: center;
|
|
169
|
-
padding: ${I["--ll-spacing-small"]};
|
|
170
|
-
background-color: ${I["--ll-color-background"]};
|
|
171
|
-
`,Kn=()=>_(Qs,{children:_(yi.Root,{})}),Hn=ie.forwardRef((t,e)=>{const{activeCategory:r,setActiveCategory:n}=Z();return _(nt.Root,{options:{currentTab:r},onChange:i=>{n(i.data)},children:F(Js,{ref:e,children:[_(Ws,{children:_(nt.Tabs,{})}),_(Hs,{children:qe.map(i=>_(nt.Content,{options:{value:i.value},children:_(Zn,{tabContent:i},i.value)},i.value))}),_(Kn,{})]})})});Hn.displayName="DesktopScores";const Ys=L.div`
|
|
172
|
-
position: relative;
|
|
173
|
-
display: flex;
|
|
174
|
-
flex-direction: column;
|
|
175
|
-
height: 100vh;
|
|
176
|
-
`,Zr=t=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},M.exports.createElement("path",{d:"M22.4275 10.5938L13.4175 1.58383C12.6675 0.833834 11.3475 0.823834 10.5875 1.58383L1.58745 10.5838C0.807453 11.3638 0.807453 12.6238 1.58745 13.4038L10.5875 22.4038C10.9775 22.7938 11.4875 22.9838 11.9975 22.9838C12.5075 22.9838 13.0175 22.7938 13.4075 22.4038L22.3975 13.4138C23.1875 12.6538 23.1975 11.3938 22.4275 10.5938ZM12.0075 20.9938L3.00745 11.9938L12.0075 2.99383L21.0075 11.9938L12.0075 20.9938ZM7.99745 11.0038V15.0038H9.99745V12.0038H13.9975V14.5038L17.4975 11.0038L13.9975 7.50383V10.0038H8.99745C8.44745 10.0038 7.99745 10.4538 7.99745 11.0038Z"})),Xs=t=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},M.exports.createElement("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5H6.5C5.84 5 5.29 5.42 5.08 6.01L3 12V20C3 20.55 3.45 21 4 21H5C5.55 21 6 20.55 6 20V19H18V20C18 20.55 18.45 21 19 21H20C20.55 21 21 20.55 21 20V12L18.92 6.01ZM6.85 7H17.14L18.22 10.11H5.77L6.85 7ZM19 17H5V12H19V17Z"}),M.exports.createElement("path",{d:"M7.5 16C8.32843 16 9 15.3284 9 14.5C9 13.6716 8.32843 13 7.5 13C6.67157 13 6 13.6716 6 14.5C6 15.3284 6.67157 16 7.5 16Z"}),M.exports.createElement("path",{d:"M16.5 16C17.3284 16 18 15.3284 18 14.5C18 13.6716 17.3284 13 16.5 13C15.6716 13 15 13.6716 15 14.5C15 15.3284 15.6716 16 16.5 16Z"})),eu=t=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},M.exports.createElement("path",{d:"M13.5 5.5C14.6 5.5 15.5 4.6 15.5 3.5C15.5 2.4 14.6 1.5 13.5 1.5C12.4 1.5 11.5 2.4 11.5 3.5C11.5 4.6 12.4 5.5 13.5 5.5ZM9.8 8.9L7 23H9.1L10.9 15L13 17V23H15V15.5L12.9 13.5L13.5 10.5C14.8 12 16.8 13 19 13V11C17.1 11 15.5 10 14.7 8.6L13.7 7C13.14 6.11 12.02 5.75 11.05 6.16L6 8.3V13H8V9.6L9.8 8.9Z"})),tu=t=>M.exports.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...t},M.exports.createElement("path",{d:"M12,2C6.47,2,2,6.47,2,12s4.47,10,10,10s10-4.47,10-10S17.53,2,12,2z M17,15.59L15.59,17L12,13.41L8.41,17L7,15.59 L10.59,12L7,8.41L8.41,7L12,10.59L15.59,7L17,8.41L13.41,12L17,15.59z"})),Jn={all:()=>["commute-calc"],list:t=>[...Jn.all(),t]},ru="https://router.hereapi.com/v8/routes?";function nu({transportMode:t,origin:e,destination:r}){const n={return:"polyline,summary,typicalDuration",transportMode:t,origin:e,destination:`${r==null?void 0:r.lat},${r==null?void 0:r.lng}`,apiKey:"KDL0aAzsbOcv7p53P2ovno2izfDOe93hyzZRrayktbE"},i=()=>fetch(ru+new URLSearchParams(n)).then(o=>o.json()).then(o=>o.routes.length>0&&o.routes[0].sections.length>0?o.routes[0].sections[0]:[]).catch(o=>{bi(o)});return dt(Jn.list(n),i,{enabled:!!n&&!!r&&!!e})}const Tt=(t,e,r)=>e===1?t:r!=null?r:`${t}s`,iu=[62,-1,-1,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,63,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],ou=1,H=typeof BigInt<"u"?BigInt:Number;function au(t){const e=t.charCodeAt(0);return iu[e-45]}function su(t){let e=H(0),r=H(0);const n=[];if(t.split("").forEach(i=>{const o=H(au(i));e|=(o&H(31))<<r,(o&H(32))===H(0)?(n.push(e),e=H(0),r=H(0)):r+=H(5)}),r>0)throw new Error("Invalid encoding");return n}function uu(t,e){if(+t.toString()!==ou)throw new Error("Invalid format version");const r=+e.toString(),n=r&15,i=r>>4&7,o=r>>7&15;return{precision:n,thirdDim:i,thirdDimPrecision:o}}function Dt(t){let e=t;return e&H(1)&&(e=~e),e>>=H(1),+e.toString()}function lu(t){const e=su(t),r=uu(e[0],e[1]),n=10**r.precision,i=10**r.thirdDimPrecision,{thirdDim:o}=r;let a=0,s=0,u=0;const f=[];let p=2;for(;p<e.length;){const b=Dt(e[p])/n,y=Dt(e[p+1])/n;if(a+=b,s+=y,o){const w=Dt(e[p+2])/i;u+=w,f.push([s,a,u]),p+=3}else f.push([s,a]),p+=2}if(p!==e.length)throw new Error("Invalid encoding. Premature ending reached");return{type:"FeatureCollection",features:[{id:"route",type:"Feature",geometry:{type:"LineString",coordinates:f}}]}}const cu=L.div`
|
|
177
|
-
max-height: calc(100% - 2 * ${I["--ll-spacing-medium"]});
|
|
178
|
-
border-radius: ${I["--ll-border-radius-medium"]};
|
|
179
|
-
box-shadow: ${I["--ll-shadow-small"]};
|
|
180
|
-
background-color: ${I["--ll-color-background"]};
|
|
181
|
-
border: 1px solid ${I["--ll-color-border"]};
|
|
182
|
-
padding: ${I["--ll-spacing-x-small"]};
|
|
183
|
-
`,fu=L.div`
|
|
184
|
-
display: flex;
|
|
185
|
-
justify-content: space-between;
|
|
186
|
-
align-items: end;
|
|
187
|
-
|
|
188
|
-
${ui} {
|
|
189
|
-
width: 229px;
|
|
190
|
-
margin-right: ${I["--ll-spacing-x-small"]};
|
|
191
|
-
}
|
|
192
|
-
`,Kr=L.div`
|
|
193
|
-
background-color: ${I["--ll-color-surface"]};
|
|
194
|
-
padding: ${I["--ll-spacing-x-small"]} ${I["--ll-spacing-small"]} 0;
|
|
195
|
-
border-radius: ${I["--ll-border-radius-medium"]};
|
|
196
|
-
`,du=L(Xr)`
|
|
197
|
-
position: absolute;
|
|
198
|
-
right: ${I["--ll-spacing-xx-small"]};
|
|
199
|
-
top: ${I["--ll-spacing-xx-small"]};
|
|
200
|
-
`,Wn=({className:t,onClose:e})=>{var m,g,c,l;const{sdkState:r}=be(),{setCommuteGeojson:n,destination:i,setDestination:o}=Z(),[a,s]=M.exports.useState("pedestrian"),u=gr(),{translations:f}=Ht(),{data:p,isFetching:v,isFetched:b}=nu({destination:i,transportMode:a,origin:`${(g=(m=r==null?void 0:r.options)==null?void 0:m.marker)==null?void 0:g.lat},${(l=(c=r==null?void 0:r.options)==null?void 0:c.marker)==null?void 0:l.lng}`});M.exports.useEffect(()=>{!(p!=null&&p.summary)||n(lu(p.polyline))},[p]);const y={pedestrian:[f.WALKING,eu],car:[f.DRIVING,Xs]},w=M.exports.useMemo(()=>{if(!(p!=null&&p.summary))return null;const h=Math.floor(p.summary.typicalDuration/60/60),d=Math.floor(p.summary.typicalDuration/60%60);return h===0?`${d} ${Tt(f.MINUTE,d)}`:`${h} ${Tt(f.HOUR,h)} ${d} ${Tt(f.MINUTE,d)}`},[p]),S=M.exports.useMemo(()=>{if(!(p!=null&&p.summary))return null;const h=Math.floor(p.summary.length/1e3);return h===0?`${p.summary.length} m`:`${h} km`},[p]),x=()=>v?_(Ze,{height:"70.4px",width:"100%"}):p!=null&&p.summary?F(Kr,{children:[_(ze,{variant:"h5",children:w}),F(ze,{children:[S," \u2013 ",f.FAST_ROUTE]})]}):F(Kr,{children:[_(ze,{variant:"h5",children:f.NO_ROUTE}),_(ze,{children:f.TRY_SUGGESTION})]});return F(cu,{className:t,children:[_(du,{size:"medium",color:"neutral",onClick:e,SVGElement:tu}),F(fu,{children:[_(li,{label:f.CALCULATE_COMMUTE,placeholder:f.SEARCH_MAP,renderListBelow:u,renderListBelowPosition:30,onSearch:h=>{o({lat:h.latitude,lng:h.longitude})}}),_(se.Root,{value:a,onValueChange:h=>{s(h)},children:F(se.Trigger,{children:[_(Yr,{SVGElement:y[a][1],fill:I["--ll-color-on-background-variant1"],width:16}),y[a][0],F(se.Content,{children:[_(se.Item,{value:"car",children:f.DRIVING}),_(se.Item,{value:"pedestrian",children:f.WALKING})]})]})})]}),(b||v)&&F(Ge,{children:[_(Ie,{vertical:!0,spacing:"--ll-spacing-x-small"}),_(ci,{open:!!p,children:x()})]})]})},pu=L.div`
|
|
201
|
-
position: absolute;
|
|
202
|
-
bottom: 0;
|
|
203
|
-
right: 0;
|
|
204
|
-
left: 0;
|
|
205
|
-
z-index: 3;
|
|
206
|
-
`,hu=L.div`
|
|
207
|
-
position: absolute;
|
|
208
|
-
top: ${I["--ll-spacing-medium"]};
|
|
209
|
-
right: ${I["--ll-spacing-medium"]};
|
|
210
|
-
z-index: 3;
|
|
211
|
-
max-width: 356px;
|
|
212
|
-
`,vu=L(Xr)`
|
|
213
|
-
box-shadow: ${I["--ll-shadow-medium"]};
|
|
214
|
-
position: absolute;
|
|
215
|
-
bottom: ${I["--ll-spacing-medium"]};
|
|
216
|
-
right: ${I["--ll-spacing-medium"]};
|
|
217
|
-
`,mu=L(Wn)``,gu=L(Wn)`
|
|
218
|
-
border-radius: ${I["--ll-border-radius-small"]}
|
|
219
|
-
${I["--ll-border-radius-small"]} 0 0;
|
|
220
|
-
border: 0;
|
|
221
|
-
`,yu=()=>{const{setCommuteGeojson:t,setDestination:e}=Z(),[r,n]=M.exports.useState(!1),{translations:i}=Ht(),o=gr(),a=()=>{e(void 0),t(void 0),n(!1)},s=()=>{n(!0)};return o?_(Ge,{children:r?_(pu,{children:_(gu,{onClose:a})}):_(vu,{size:"large",SVGElement:Zr,onClick:s})}):_(hu,{children:r?_(mu,{onClose:a}):_(_i,{onClick:s,startAdornment:_(Zr,{}),children:i.CALCULATE_COMMUTE})})},bu=()=>{var T,B,Qe;const{sdkState:t,setSdkState:e}=be(),{activeScore:r,activePOI:n,setActivePOI:i,hoveredPOI:o,commuteGeojson:a,destination:s}=Z(),u=gr(),f=$n(),p=Ln(),v=((B=(T=t==null?void 0:t.globalOptions)==null?void 0:T.appearance)==null?void 0:B.theme)==="night"?"dd191599-2a92-49fc-9a33-e12391753ad5":"600d69cb-288d-445e-9839-3dfe4d76b31a",b={id:"point",type:"line",paint:{"line-width":6,"line-color":"#0056D3"}},[y,w]=M.exports.useState(!1),S=M.exports.useMemo(()=>{var N,K;return(r==="high_schools"||r==="primary_schools")&&!p.isFetching?{[r]:((N=p==null?void 0:p.data)==null?void 0:N[r])||[]}:!(Be&&r&&Be[r]&&((K=Be[r])==null?void 0:K.length))&&!f.isFetching?{[r]:[]}:f.data},[f.data,p.data,r]),x=M.exports.useMemo(()=>S?Object.entries(S).map(([K,le])=>le.map(X=>Ot([X.lng,X.lat],{poi:X,type:K}))).flat().filter((K,le,X)=>X.findIndex(xt=>["lat","lng","name"].every(ke=>xt.properties.poi[ke]===K.properties.poi[ke]))===le):[],[S]),m=M.exports.useMemo(()=>{var K,le,X;const N=((K=t==null?void 0:t.options)==null?void 0:K.marker)&&Ot([(le=t==null?void 0:t.options)==null?void 0:le.marker.lng,(X=t==null?void 0:t.options)==null?void 0:X.marker.lat]);return[...x,...N?[N]:[],...s?[Ot([s==null?void 0:s.lng,s==null?void 0:s.lat])]:[]]},[x,(Qe=t==null?void 0:t.options)==null?void 0:Qe.marker,s]),g=M.exports.useRef(),[c,l]=fi(),h=M.exports.useMemo(()=>({top:25+l.height,bottom:25,left:25,right:25}),[l.height]),d=M.exports.useMemo(()=>({top:50,bottom:50,left:l.width+32+50,right:50}),[l.width]),E=u?h:d,$=N=>{e({...t,options:{...t.options,lat:N.viewState.latitude,lng:N.viewState.longitude,zoom:N.viewState.zoom,bearing:N.viewState.bearing,pitch:N.viewState.pitch}})};return M.exports.useEffect(()=>{var ke,_r;if(!m.length||!((ke=t.options)!=null&&ke.marker))return;const N=Ga(m.map(({geometry:wr})=>[wr.coordinates[1],wr.coordinates[0]])),[K,le,X,xt]=Vt(N);(_r=g==null?void 0:g.current)==null||_r.fitBounds([[le,K],[xt,X]],{maxZoom:17,padding:E,duration:1e3})},[m,E]),t.options?_(cs,{mapRef:g,mapPadding:E,children:F(Ys,{children:[F(di,{ref:g,mapLib:pi,latitude:t.options.lat,longitude:t.options.lng,zoom:t.options.zoom,pitch:t.options.pitch,bearing:t.options.bearing,style:{flex:1,width:"100vw"},mapStyle:`https://api.maptiler.com/maps/${v}/style.json?key=9jNGatuzs05Q1oNlctEs`,onMove:$,cooperativeGestures:t.options.cooperativeGestures,onMoveStart:()=>w(!0),onMoveEnd:()=>w(!1),attributionControl:!1,children:[_(hi,{compact:!0,position:u?"bottom-left":"bottom-right"}),_(vi,{position:u?"top-right":"bottom-right",showCompass:!0,style:{marginTop:u?16+l.height:16,marginRight:16}}),t.options.marker&&_(Cr,{marker:t.options.marker}),_(Fn,{rect:l,zoom:t.options.zoom,mapRef:g,points:x,isMobile:u,activePOI:n,hoveredPOI:o,isMapMoving:y,setActivePOI:i}),u?_(zn,{ref:c}):_(Hn,{ref:c}),_(yu,{}),s&&_(Cr,{marker:{icon:"pin",...s}}),a&&_(za,{type:"geojson",data:a,children:_(qa,{...b})})]}),u&&_(Kn,{})]})}):_("div",{children:"No options provided."})},_u=()=>(Da.trackPageLoad(),_(ja,{children:_(bu,{})})),Pu=Object.freeze(Object.defineProperty({__proto__:null,default:_u},Symbol.toStringTag,{value:"Module"}));export{ge as C,fr as P,pt as a,Sn as b,fe as c,Iu as d,Cu as e,dr as f,Mu as g,Ue as h,ut as i,en as j,te as k,Et as l,Qo as m,Ii as n,Di as o,pa as p,Pu as q,Au as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as p,c as v}from"./index.27821d72.js";import{e as g,g as M,l as N}from"./index.99863166.js";import"./index.1b45b39b.js";function S(o,w,h){var i;return p(this,void 0,void 0,function(){var s,c,l,d,n,b=this;return v(this,function(u){switch(u.label){case 0:return g()?[2,[]]:(s=M(),c=(i=w.enabledMiddleware)!==null&&i!==void 0?i:{},l=Object.entries(c).filter(function(r){r[0];var e=r[1];return e}).map(function(r){var e=r[0];return e}),d=l.map(function(r){return p(b,void 0,void 0,function(){var e,a,m,f;return v(this,function(t){switch(t.label){case 0:e=r.replace("@segment/",""),a=e,h&&(a=btoa(e).replace(/=/g,"")),m="".concat(s,"/middleware/").concat(a,"/latest/").concat(a,".js.gz"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,N(m)];case 2:return t.sent(),[2,window["".concat(e,"Middleware")]];case 3:return f=t.sent(),o.log("error",f),o.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}})})}),[4,Promise.all(d)]);case 1:return n=u.sent(),n=n.filter(Boolean),[2,n]}})})}export{S as remoteMiddlewares};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as n,c as o,g as a}from"./index.27821d72.js";function u(i){return n(this,void 0,void 0,function(){var t;return o(this,function(e){switch(e.label){case 0:return[4,a(()=>import("./index.umd.703b7a5f.js").then(r=>r.i),["assets/index.umd.703b7a5f.js","assets/index.27821d72.js"])];case 1:return t=e.sent(),i._plugins=t,[2]}})})}export{u as loadLegacyVideoPlugins};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}System.register(["./index-legacy.4d95875e.js"],(function(e,a){"use strict";var n;return{setters:[function(t){n=t.ac}],execute:function(){function a(t,e){for(var a=function(){var a=e[n];if("string"!=typeof a&&!Array.isArray(a)){var i=function(e){if("default"!==e&&!(e in t)){var n=Object.getOwnPropertyDescriptor(a,e);n&&Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:function(){return a[e]}})}};for(var r in a)i(r)}},n=0;n<e.length;n++)a();return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var i={exports:{}};!function(e,a){window,e.exports=function(e){var a={};function n(t){if(a[t])return a[t].exports;var i=a[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=a,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(e,a){if(1&a&&(e=n(e)),8&a)return e;if(4&a&&"object"==t(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,a){a.r(e);var n="function"==typeof fetch?fetch.bind():function(t,e){return e=e||{},new Promise((function(a,n){var i=new XMLHttpRequest;for(var r in i.open(e.method||"get",t,!0),e.headers)i.setRequestHeader(r,e.headers[r]);function o(){var t,e=[],a=[],n={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(i,r,o){e.push(r=r.toLowerCase()),a.push([r,o]),t=n[r],n[r]=t?t+","+o:o})),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:o,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},headers:{keys:function(){return e},entries:function(){return a},get:function(t){return n[t.toLowerCase()]},has:function(t){return t.toLowerCase()in n}}}}i.withCredentials="include"==e.credentials,i.onload=function(){a(o())},i.onerror=n,i.send(e.body)}))};e.default=n},function(t,e,a){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}}(),i=function(){function t(e,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pluginName=e}return n(t,[{key:"track",value:function(t,e){window.analytics.track(t,e,{integration:{name:this.pluginName}})}}]),t}();e.default=i},function(t,e,a){Object.defineProperty(e,"__esModule",{value:!0}),e.YouTubeAnalytics=e.VimeoAnalytics=void 0;var n=r(a(3)),i=r(a(4));function r(t){return t&&t.__esModule?t:{default:t}}e.VimeoAnalytics=n.default,e.YouTubeAnalytics=i.default},function(e,a,n){Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function t(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}}(),r=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var s=function(e){function a(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);var i=function(e,a){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!=t(a)&&"function"!=typeof a?e:a}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"VimeoAnalytics"));return i.authToken=n,i.player=e,i.metadata={content:{},playback:{videoPlayer:"Vimeo"}},i.mostRecentHeartbeat=0,i.isPaused=!1,i}return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function, not "+t(a));e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(e,a):e.__proto__=a)}(a,e),i(a,[{key:"initialize",value:function(){var t=this,e={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var a in e)this.registerHandler(a,e[a]);this.player.getVideoId().then((function(e){t.retrieveMetadata({id:e})})).catch(console.error)}},{key:"registerHandler",value:function(t,e){var a=this;this.player.on(t,(function(t){a.updateMetadata(t),e.call(a,t)}))}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var t=this.mostRecentHeartbeat,e=this.metadata.playback.position;e!==t&&e-t>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(e))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(t){var e=this;return new Promise((function(a,n){var i=t.id;(0,r.default)("https://api.vimeo.com/videos/"+i,{headers:{Authorization:"Bearer "+e.authToken}}).then((function(t){return t.ok?t.json():n(t)})).then((function(t){e.metadata.content.title=t.name,e.metadata.content.description=t.description,e.metadata.content.publisher=t.user.name,e.metadata.playback.position=0,e.metadata.playback.totalLength=t.duration})).catch((function(t){return console.error("Request to Vimeo API Failed with: ",t),n(t)}))}))}},{key:"updateMetadata",value:function(t){var e=this;return new Promise((function(a,n){e.player.getVolume().then((function(n){n&&(e.metadata.playback.sound=100*n),e.metadata.playback.position=t.seconds,a()})).catch(n)}))}}]),a}(o(n(1)).default);a.default=s},function(e,a,n){Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function t(t,e){for(var a=0;a<e.length;a++){var n=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}}(),r=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var s=function(e){function a(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);var i=function(e,a){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!=t(a)&&"function"!=typeof a?e:a}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"YoutubeAnalytics"));return i.player=e,i.apiKey=n,i.playerLoaded=!1,i.playbackStarted=!1,i.contentStarted=!1,i.isPaused=!1,i.isBuffering=!1,i.isSeeking=!1,i.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},i.metadata=[{playback:{video_player:"youtube"},content:{}}],i.playlistIndex=0,i}return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function, not "+t(a));e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),a&&(Object.setPrototypeOf?Object.setPrototypeOf(e,a):e.__proto__=a)}(a,e),i(a,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(t){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(t){var e=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=e,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),t.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var t=this;return new Promise((function(e,a){var n=t.player.getVideoData(),i=t.player.getPlaylist()||[n.video_id],o=i.join();(0,r.default)("https://www.googleapis.com/youtube/v3/videos?id="+o+"&part=snippet,contentDetails&key="+t.apiKey).then((function(t){if(!t.ok){var e=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw e.response=t,e}return t.json()})).then((function(a){t.metadata=[];for(var n=0,r=0;r<i.length;r++){var o=a.items[r];t.metadata.push({content:{title:o.snippet.title,description:o.snippet.description,keywords:o.snippet.tags,channel:o.snippet.channelTitle,airdate:o.snippet.publishedAt}}),n+=l(o.contentDetails.duration)}for(r=0;r<i.length;r++)t.metadata[r].playback={total_length:n,video_player:"youtube"};e()})).catch((function(e){t.metadata=i.map((function(t){return{playback:{video_player:"youtube"},content:{}}})),a(e)}))}))}},{key:"handleBuffer",value:function(){var t=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),t&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var e=this.player.getPlaylist();e&&0===this.player.getCurrentTime()&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===e.length-1&&0===this.player.getPlaylistIndex()&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),-1===this.playlistIndex&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var t=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(t?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var t=this.player.getPlaylistIndex(),e=this.player.getPlaylist();(e&&t===e.length-1||-1===t)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var t=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,e=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(t-e)>2e3}}]),a}(o(n(1)).default);function l(t){var e=t.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return e=e.slice(1).map((function(t){if(null!=t)return t.replace(/\D/,"")})),3600*(parseInt(e[0])||0)+60*(parseInt(e[1])||0)+(parseInt(e[2])||0)}a.default=s}])}(i),e("i",a({__proto__:null,default:n(i.exports)},[i.exports]))}}}))}();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ac as x}from"./index.27821d72.js";function _(g,S){for(var f=0;f<S.length;f++){const l=S[f];if(typeof l!="string"&&!Array.isArray(l)){for(const s in l)if(s!=="default"&&!(s in g)){const i=Object.getOwnPropertyDescriptor(l,s);i&&Object.defineProperty(g,s,i.get?i:{enumerable:!0,get:()=>l[s]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}var w={exports:{}};(function(g,S){(function(f,l){g.exports=l()})(window,function(){return function(f){var l={};function s(i){if(l[i])return l[i].exports;var u=l[i]={i,l:!1,exports:{}};return f[i].call(u.exports,u,u.exports,s),u.l=!0,u.exports}return s.m=f,s.c=l,s.d=function(i,u,c){s.o(i,u)||Object.defineProperty(i,u,{enumerable:!0,get:c})},s.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},s.t=function(i,u){if(1&u&&(i=s(i)),8&u||4&u&&typeof i=="object"&&i&&i.__esModule)return i;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:i}),2&u&&typeof i!="string")for(var d in i)s.d(c,d,function(p){return i[p]}.bind(null,d));return c},s.n=function(i){var u=i&&i.__esModule?function(){return i.default}:function(){return i};return s.d(u,"a",u),u},s.o=function(i,u){return Object.prototype.hasOwnProperty.call(i,u)},s.p="",s(s.s=2)}([function(f,l,s){s.r(l);var i=typeof fetch=="function"?fetch.bind():function(u,c){return c=c||{},new Promise(function(d,p){var r=new XMLHttpRequest;for(var a in r.open(c.method||"get",u,!0),c.headers)r.setRequestHeader(a,c.headers[a]);function t(){var e,n=[],o=[],h={};return r.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(y,m,b){n.push(m=m.toLowerCase()),o.push([m,b]),e=h[m],h[m]=e?e+","+b:b}),{ok:(r.status/100|0)==2,status:r.status,statusText:r.statusText,url:r.responseURL,clone:t,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},headers:{keys:function(){return n},entries:function(){return o},get:function(y){return h[y.toLowerCase()]},has:function(y){return y.toLowerCase()in h}}}}r.withCredentials=c.credentials=="include",r.onload=function(){d(t())},r.onerror=p,r.send(c.body)})};l.default=i},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function c(d,p){for(var r=0;r<p.length;r++){var a=p[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(d,a.key,a)}}return function(d,p,r){return p&&c(d.prototype,p),r&&c(d,r),d}}(),u=function(){function c(d,p){(function(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")})(this,c),this.pluginName=d}return i(c,[{key:"track",value:function(d,p){window.analytics.track(d,p,{integration:{name:this.pluginName}})}}]),c}();l.default=u},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0}),l.YouTubeAnalytics=l.VimeoAnalytics=void 0;var i=c(s(3)),u=c(s(4));function c(d){return d&&d.__esModule?d:{default:d}}l.VimeoAnalytics=i.default,l.YouTubeAnalytics=u.default},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function p(r,a){for(var t=0;t<a.length;t++){var e=a[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,e.key,e)}}return function(r,a,t){return a&&p(r.prototype,a),t&&p(r,t),r}}(),u=c(s(0));function c(p){return p&&p.__esModule?p:{default:p}}var d=function(p){function r(a,t){(function(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")})(this,r);var e=function(n,o){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||typeof o!="object"&&typeof o!="function"?n:o}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,"VimeoAnalytics"));return e.authToken=t,e.player=a,e.metadata={content:{},playback:{videoPlayer:"Vimeo"}},e.mostRecentHeartbeat=0,e.isPaused=!1,e}return function(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(a,t):a.__proto__=t)}(r,p),i(r,[{key:"initialize",value:function(){var a=this,t={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var e in t)this.registerHandler(e,t[e]);this.player.getVideoId().then(function(n){a.retrieveMetadata({id:n})}).catch(console.error)}},{key:"registerHandler",value:function(a,t){var e=this;this.player.on(a,function(n){e.updateMetadata(n),t.call(e,n)})}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var a=this.mostRecentHeartbeat,t=this.metadata.playback.position;t!==a&&t-a>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(t))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(a){var t=this;return new Promise(function(e,n){var o=a.id;(0,u.default)("https://api.vimeo.com/videos/"+o,{headers:{Authorization:"Bearer "+t.authToken}}).then(function(h){return h.ok?h.json():n(h)}).then(function(h){t.metadata.content.title=h.name,t.metadata.content.description=h.description,t.metadata.content.publisher=h.user.name,t.metadata.playback.position=0,t.metadata.playback.totalLength=h.duration}).catch(function(h){return console.error("Request to Vimeo API Failed with: ",h),n(h)})})}},{key:"updateMetadata",value:function(a){var t=this;return new Promise(function(e,n){t.player.getVolume().then(function(o){o&&(t.metadata.playback.sound=100*o),t.metadata.playback.position=a.seconds,e()}).catch(n)})}}]),r}(c(s(1)).default);l.default=d},function(f,l,s){Object.defineProperty(l,"__esModule",{value:!0});var i=function(){function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}}(),u=d(s(0)),c=d(s(1));function d(a){return a&&a.__esModule?a:{default:a}}var p=function(a){function t(e,n){(function(h,y){if(!(h instanceof y))throw new TypeError("Cannot call a class as a function")})(this,t);var o=function(h,y){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!y||typeof y!="object"&&typeof y!="function"?h:y}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"YoutubeAnalytics"));return o.player=e,o.apiKey=n,o.playerLoaded=!1,o.playbackStarted=!1,o.contentStarted=!1,o.isPaused=!1,o.isBuffering=!1,o.isSeeking=!1,o.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},o.metadata=[{playback:{video_player:"youtube"},content:{}}],o.playlistIndex=0,o}return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}(t,a),i(t,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(e){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(e){var n=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=n,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),e.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var e=this;return new Promise(function(n,o){var h=e.player.getVideoData(),y=e.player.getPlaylist()||[h.video_id],m=y.join();(0,u.default)("https://www.googleapis.com/youtube/v3/videos?id="+m+"&part=snippet,contentDetails&key="+e.apiKey).then(function(b){if(!b.ok){var v=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw v.response=b,v}return b.json()}).then(function(b){e.metadata=[];for(var v=0,k=0;k<y.length;k++){var P=b.items[k];e.metadata.push({content:{title:P.snippet.title,description:P.snippet.description,keywords:P.snippet.tags,channel:P.snippet.channelTitle,airdate:P.snippet.publishedAt}}),v+=r(P.contentDetails.duration)}for(k=0;k<y.length;k++)e.metadata[k].playback={total_length:v,video_player:"youtube"};n()}).catch(function(b){e.metadata=y.map(function(v){return{playback:{video_player:"youtube"},content:{}}}),o(b)})})}},{key:"handleBuffer",value:function(){var e=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),e&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var n=this.player.getPlaylist();n&&this.player.getCurrentTime()===0&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===n.length-1&&this.player.getPlaylistIndex()===0&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),this.playlistIndex===-1&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var e=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(e?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var e=this.player.getPlaylistIndex(),n=this.player.getPlaylist();(n&&e===n.length-1||e===-1)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var e=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,n=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(e-n)>2e3}}]),t}(c.default);function r(a){var t=a.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return t=t.slice(1).map(function(e){if(e!=null)return e.replace(/\D/,"")}),3600*(parseInt(t[0])||0)+60*(parseInt(t[1])||0)+(parseInt(t[2])||0)}l.default=p}])})})(w);const I=x(w.exports),j=_({__proto__:null,default:I},[w.exports]);export{j as i};
|