PageSourceSearch

https://www.sporfie.com/_next/static/immutable/chunks/2ou9ohwte5ae4.js

js sporfie.com collected 2026-09-25 02:36:19 UTC 89,684 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="3a02ac45-2b13-b7ec-79dd-045d889c021a")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,502471,t=>{"use strict";function e(t,e){return new Promise(function(n,r){var i=setTimeout(function(){r(Error("Promise timed out"))},e);t.then(function(t){return clearTimeout(i),n(t)}).catch(r)})}t.s(["invokeCallback",0,function(t,n,r){var i=function(){try{return Promise.resolve(n(t))}catch(t){return Promise.reject(t)}};return new Promise(function(t){return setTimeout(t,r)}).then(function(){return e(i(),1e3)}).catch(function(e){null==t||t.log("warn","Callback Error",{error:e}),null==t||t.stats.increment("callback_error")}).then(function(){return t})},"pTimeout",0,e])},45493,t=>{"use strict";t.s(["exists",0,function(t){return null!=t},"isFunction",0,function(t){return"function"==typeof t},"isNumber",0,function(t){return"number"==typeof t},"isPlainObject",0,function(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()},"isString",0,function(t){return"string"==typeof t}])},222979,t=>{"use strict";var e,n,r=t.i(500075),i=t.i(290571),o=t.i(247167);function a(){return void 0!==o.default&&o.default.env?o.default.env:{}}var s=t.i(55605),u=t.i(45493);function c(t,e,n,r){var i,o=[t,e,n,r],a=(0,u.isPlainObject)(t)?t.event:t;if(!a||!(0,u.isString)(a))throw Error("Event missing");var s=(0,u.isPlainObject)(t)?null!=(i=t.properties)?i:{}:(0,u.isPlainObject)(e)?e:{},c={};return(0,u.isFunction)(n)||(c=null!=n?n:{}),(0,u.isPlainObject)(t)&&!(0,u.isFunction)(e)&&(c=null!=e?e:{}),[a,s,c,o.find(u.isFunction)]}function l(t,e,n,r,i){var o,a,s=null,c=null,l=[t,e,n,r,i],f=l.filter(u.isString);1===f.length?(c=(0,u.isString)(l[1])?l[1]:f[0],s=null):2===f.length&&("string"==typeof l[0]&&(s=l[0]),"string"==typeof l[1]&&(c=l[1]));var d=l.find(u.isFunction),h=l.filter(u.isPlainObject);return 1===h.length?(0,u.isPlainObject)(l[2])?(a={},o=l[2]):(0,u.isPlainObject)(l[3])?(o={},a=l[3]):(o=h[0],a={}):2===h.length&&(o=h[0],a=h[1]),[s,c,null!=o?o:o={},null!=a?a:a={},d]}var f=function(t){return function(){for(var e,n,r,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];for(var a={},s=["callback","options","traits","id"],c=0;c<i.length;c++){var l=i[c],f=s.pop();if("id"===f){if((0,u.isString)(l)||(0,u.isNumber)(l)){a.id=l.toString();continue}if(null==l)continue;f=s.pop()}if(("traits"===f||"options"===f)&&(null==l||(0,u.isPlainObject)(l))&&(a[f]=l),(0,u.isFunction)(l)){a.callback=l;break}}return[null!=(e=a.id)?e:t.id(),null!=(n=a.traits)?n:{},null!=(r=a.options)?r:{},a.callback]}};function d(t,e,n,r){(0,u.isNumber)(t)&&(t=t.toString()),(0,u.isNumber)(e)&&(e=e.toString());var i=[t,e,n,r],o=i.filter(u.isString),a=o[0],s=void 0===a?t:a,c=o[1],l=i.filter(u.isPlainObject)[0];return[s,void 0===c?null:c,void 0===l?{}:l,i.find(u.isFunction)]}var h=t.i(508991),p=t.i(683049),g=t.i(502471),v=t.i(416997),y=t.i(610991),_=function(t,e,n,r,i,o){return{__t:"bpc",c:e,p:r,u:t,s:n,t:i,r:o}},m=Object.keys(_("","","","","","")),b=function(t){var e=t.indexOf("#");return -1===e?t:t.slice(0,e)},w=function(t){try{return new URL(t).pathname}catch(e){return"/"===t[0]?t:"/"+t}},S=function(t){var e=t.c,n=t.p,r=t.s,i=t.u,o=t.r,a=t.t,s=e?w(e):n,u=e?e.indexOf("?")>-1?e:e+r:b(i);return{path:s,referrer:o,search:r,title:a,url:u}},A=function(){var t=document.querySelector("link[rel='canonical']");return _(location.href,t&&t.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)},k=function(t,e){void 0===e&&(e=S(A()));var n,r,o,a=t.context;"page"===t.type&&(o=t.properties&&(n=t.properties,r=Object.keys(e),Object.assign.apply(Object,(0,i.__spreadArray)([{}],r.map(function(t){var e;if(n&&Object.prototype.hasOwnProperty.call(n,t))return(e={})[t]=n[t],e}),!1))),t.properties=(0,i.__assign)((0,i.__assign)((0,i.__assign)({},e),t.properties),t.name?{name:t.name}:{})),a.page=(0,i.__assign)((0,i.__assign)((0,i.__assign)({},e),o),a.page)},C=t.i(708721),I=function(t){function e(e,n){var r=t.call(this,"".concat(e," ").concat(n))||this;return r.field=e,r}return(0,i.__extends)(e,t),e}(Error),E="is not a string",P="is not an object",O=function(t){var e,n;this.settings=t,this.createMessageId=t.createMessageId,this.onEventMethodCall=null!=(e=t.onEventMethodCall)?e:function(){},this.onFinishedEvent=null!=(n=t.onFinishedEvent)?n:function(){}},x=function(t){function e(e){var n=t.call(this,{createMessageId:function(){return"ajs-next-".concat(Date.now(),"-").concat((0,y.v4)())},onEventMethodCall:function(t){var e=t.options;n.maybeUpdateAnonId(e)},onFinishedEvent:function(t){return n.addIdentity(t),t}})||this;return n.user=e,n}return(0,i.__extends)(e,t),e.prototype.maybeUpdateAnonId=function(t){(null==t?void 0:t.anonymousId)&&this.user.anonymousId(t.anonymousId)},e.prototype.addIdentity=function(t){this.user.id()&&(t.userId=this.user.id()),this.user.anonymousId()&&(t.anonymousId=this.user.anonymousId())},e.prototype.track=function(e,n,r,i,o){var a=t.prototype.track.call(this,e,n,r,i);return k(a,o),a},e.prototype.page=function(e,n,r,i,o,a){var s=t.prototype.page.call(this,e,n,r,i,o);return k(s,a),s},e.prototype.screen=function(e,n,r,i,o,a){var s=t.prototype.screen.call(this,e,n,r,i,o);return k(s,a),s},e.prototype.identify=function(e,n,r,i,o){var a=t.prototype.identify.call(this,e,n,r,i);return k(a,o),a},e.prototype.group=function(e,n,r,i,o){var a=t.prototype.group.call(this,e,n,r,i);return k(a,o),a},e.prototype.alias=function(e,n,r,i,o){var a=t.prototype.alias.call(this,e,n,r,i);return k(a,o),a},e}(function(){function t(t){this.settings=new O(t)}return t.prototype.track=function(t,e,n,r){return this.settings.onEventMethodCall({type:"track",options:n}),this.normalize((0,i.__assign)((0,i.__assign)({},this.baseEvent()),{event:t,type:"track",properties:null!=e?e:{},options:(0,i.__assign)({},n),integrations:(0,i.__assign)({},r)}))},t.prototype.page=function(t,e,n,r,o){this.settings.onEventMethodCall({type:"page",options:r});var a,s={type:"page",properties:(0,i.__assign)({},n),options:(0,i.__assign)({},r),integrations:(0,i.__assign)({},o)};return null!==t&&(s.category=t,s.properties=null!=(a=s.properties)?a:{},s.properties.category=t),null!==e&&(s.name=e),this.normalize((0,i.__assign)((0,i.__assign)({},this.baseEvent()),s))},t.prototype.screen=function(t,e,n,r,o){this.settings.onEventMethodCall({type:"screen",options:r});var a={type:"screen",properties:(0,i.__assign)({},n),options:(0,i.__assign)({},r),integrations:(0,i.__assign)({},o)};return null!==t&&(a.category=t),null!==e&&(a.name=e),this.normalize((0,i.__assign)((0,i.__assign)({},this.baseEvent()),a))},t.prototype.identify=function(t,e,n,r){return this.settings.onEventMethodCall({type:"identify",options:n}),this.normalize((0,i.__assign)((0,i.__assign)({},this.baseEvent()),{type:"identify",userId:t,traits:null!=e?e:{},options:(0,i.__assign)({},n),integrations:r}))},t.prototype.group=function(t,e,n,r){return this.settings.onEventMethodCall({type:"group",options:n}),this.normalize((0,i.__assign)((0,i.__assign)({},this.baseEvent()),{type:"group",traits:null!=e?e:{},options:(0,i.__assign)({},n),integrations:(0,i.__assign)({},r),groupId:t}))},t.prototype.alias=function(t,e,n,r){this.settings.onEventMethodCall({type:"alias",options:n});var o={userId:t,type:"alias",options:(0,i.__assign)({},n),integrations:(0,i.__assign)({},r)};return(null!==e&&(o.previousId=e),void 0===t)?this.normalize((0,i.__assign)((0,i.__assign)({},o),this.baseEvent())):this.normalize((0,i.__assign)((0,i.__assign)({},this.baseEvent()),o))},t.prototype.baseEvent=function(){return{integrations:{},options:{}}},t.prototype.context=function(t){var e,n=["userId","anonymousId","timestamp","messageId"];delete t.integrations;var r=Object.keys(t),i=null!=(e=t.context)?e:{},o={};return r.forEach(function(e){"context"!==e&&(n.includes(e)?(0,C.dset)(o,e,t[e]):(0,C.dset)(i,e,t[e]))}),[i,o]},t.prototype.normalize=function(t){var e,n,o,a=Object.keys(null!=(n=t.integrations)?n:{}).reduce(function(e,n){var r,o;return(0,i.__assign)((0,i.__assign)({},e),((r={})[n]=!!(null==(o=t.integrations)?void 0:o[n]),r))},{});e=t.options||{},t.options=Object.keys(e).filter(function(t){return function(t,e){return void 0!==e}(t,e[t])}).reduce(function(t,n){return t[n]=e[n],t},{});var s=(0,i.__assign)((0,i.__assign)({},a),null==(o=t.options)?void 0:o.integrations),c=t.options?this.context(t.options):[],l=c[0],f=c[1],d=t.options,h=(0,i.__rest)(t,["options"]),p=(0,i.__assign)((0,i.__assign)((0,i.__assign)((0,i.__assign)({timestamp:new Date},h),{context:l,integrations:s}),f),{messageId:d.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(p),!function(t){if(!(0,u.exists)(t))throw new I("Event","is nil");if((void 0===t?"undefined":(0,r._)(t))!=="object")throw new I("Event",P);if(!(0,u.isString)(t.type))throw new I(".type",E);if(!(0,u.isString)(t.messageId))throw new I(".messageId",E);if("track"===t.type){if(!(0,u.isString)(t.event))throw new I(".event",E);if(!(0,u.isPlainObject)(t.properties))throw new I(".properties",P)}["group","identify"].includes(t.type)&&function(t){if(!(0,u.isPlainObject)(t.traits))throw new I(".traits",P)}(t)}(p),p},t}()),M=function(t){return"addMiddleware"in t&&"destination"===t.type},j=t.i(793783),T=t.i(108487),R=t.i(459912),L=t.i(382420),U=function(){var t,e,n=0;return{done:function(){return t},run:function(i){var o=i();return(void 0===o?"undefined":(0,r._)(o))==="object"&&null!==o&&"then"in o&&"function"==typeof o.then&&
2(1==++n&&(t=new Promise(function(t){return e=t})),o.finally(function(){return 0==--n&&e()})),o}}},N=t.i(587603),D=function(t){function e(e){return t.call(this,"string"==typeof e?new j.PersistedPriorityQueue(4,e):e)||this}return(0,i.__extends)(e,t),e.prototype.flush=function(){return(0,i.__awaiter)(this,void 0,void 0,function(){return(0,i.__generator)(this,function(e){return(0,h.isOffline)()?[2,[]]:[2,t.prototype.flush.call(this)]})})},e}(function(t){function e(e){var n=t.call(this)||this;return n.criticalTasks=U(),n.plugins=[],n.failedInitializations=[],n.flushing=!1,n.queue=e,n.queue.on(R.ON_REMOVE_FROM_FUTURE,function(){n.scheduleFlush(0)}),n}return(0,i.__extends)(e,t),e.prototype.register=function(t,e,n){return(0,i.__awaiter)(this,void 0,void 0,function(){var r,o,a=this;return(0,i.__generator)(this,function(i){switch(i.label){case 0:if(this.plugins.push(e),r=function(n){a.failedInitializations.push(e.name),a.emit("initialization_failure",e),console.warn(e.name,n),t.log("warn","Failed to load destination",{plugin:e.name,error:n}),a.plugins=a.plugins.filter(function(t){return t!==e})},"destination"!==e.type||"Segment.io"===e.name)return[3,1];return e.load(t,n).catch(r),[3,4];case 1:return i.trys.push([1,3,,4]),[4,e.load(t,n)];case 2:return i.sent(),[3,4];case 3:return o=i.sent(),r(o),[3,4];case 4:return[2]}})})},e.prototype.deregister=function(t,e,n){return(0,i.__awaiter)(this,void 0,void 0,function(){var r;return(0,i.__generator)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,3,,4]),!e.unload)return[3,2];return[4,Promise.resolve(e.unload(t,n))];case 1:i.sent(),i.label=2;case 2:return this.plugins=this.plugins.filter(function(t){return t.name!==e.name}),[3,4];case 3:return r=i.sent(),t.log("warn","Failed to unload destination",{plugin:e.name,error:r}),[3,4];case 4:return[2]}})})},e.prototype.dispatch=function(t){return(0,i.__awaiter)(this,void 0,void 0,function(){var e;return(0,i.__generator)(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),e=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,e]})})},e.prototype.subscribeToDelivery=function(t){return(0,i.__awaiter)(this,void 0,void 0,function(){var e=this;return(0,i.__generator)(this,function(n){return[2,new Promise(function(n){var r=function(i,o){i.isSame(t)&&(e.off("flush",r),n(i))};e.on("flush",r)})]})})},e.prototype.dispatchSingle=function(t){return(0,i.__awaiter)(this,void 0,void 0,function(){var e=this;return(0,i.__generator)(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch(function(n){return e.enqueuRetry(n,t)?e.subscribeToDelivery(t):(t.setFailedDelivery({reason:n}),t)})]})})},e.prototype.isEmpty=function(){return 0===this.queue.length},e.prototype.scheduleFlush=function(t){var e=this;void 0===t&&(t=500),this.flushing||(this.flushing=!0,setTimeout(function(){e.flush().then(function(){setTimeout(function(){e.flushing=!1,e.queue.length&&e.scheduleFlush(0)},0)})},t))},e.prototype.deliver=function(t){var e;return(0,i.__awaiter)(this,void 0,void 0,function(){var n,r,o,a,s;return(0,i.__generator)(this,function(i){switch(i.label){case 0:return[4,this.criticalTasks.done()];case 1:i.sent(),n=Date.now(),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:if(t=i.sent(),r=Date.now()-n,o=t.failedDelivery())return a=(0,T._)(o.reason,Error)?o.reason:Error(String(null!=(e=o.reason)?e:"Unknown delivery failure")),t.log("error","Failed to deliver",a),this.emit("delivery_failure",t,a),t.stats.increment("delivery_failed"),[2,t];return this.emit("delivery_success",t),t.stats.gauge("delivered",r),t.log("debug","Delivered",t.event),[2,t];case 4:throw a=s=i.sent(),t.log("error","Failed to deliver",a),this.emit("delivery_failure",t,a),t.stats.increment("delivery_failed"),s;case 5:return[2]}})})},e.prototype.enqueuRetry=function(t,e){return!!(!(0,T._)(t,L.ContextCancelation)||t.retry)&&this.queue.pushWithBackoff(e)},e.prototype.flush=function(){return(0,i.__awaiter)(this,void 0,void 0,function(){var t,e,n;return(0,i.__generator)(this,function(r){switch(r.label){case 0:if(0===this.queue.length||!(t=this.queue.pop())
2)return[2,[]];t.attempts=this.queue.getAttempts(t),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return e=!(t=r.sent()).failedDelivery(),this.emit("flush",t,e),[3,4];case 3:return n=r.sent(),this.enqueuRetry(n,t)||(t.setFailedDelivery({reason:n}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}})})},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(t){var e,n,r=(e="type",n={},this.plugins.filter(function(e){if("destination"!==e.type&&"Segment.io"!==e.name)return!0;var n,r,i,o=void 0;return null==(n=e.alternativeNames)||n.forEach(function(e){void 0!==t[e]&&(o=t[e])}),null!=(i=null!=(r=t[e.name])?r:o)?i:!1!==("Segment.io"===e.name||t.All)}).forEach(function(t){var r,o=void 0;if("string"==typeof e){var a=t[e];o="string"!=typeof a?JSON.stringify(a):a}else(0,T._)(e,Function)&&(o=e(t));void 0!==o&&(n[o]=(0,i.__spreadArray)((0,i.__spreadArray)([],null!=(r=n[o])?r:[],!0),[t],!1))}),n),o=r.before,a=r.enrichment,s=r.destination,u=r.after;return{before:void 0===o?[]:o,enrichment:void 0===a?[]:a,destinations:void 0===s?[]:s,after:void 0===u?[]:u}},e.prototype.flushOne=function(t){var e,n;return(0,i.__awaiter)(this,void 0,void 0,function(){var r,o,a,s,u,c,l,f,d,h,p,g,v;return(0,i.__generator)(this,function(i){switch(i.label){case 0:if(!this.isReady())throw Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),o=(r=this.availableExtensions(null!=(e=t.event.integrations)?e:{})).before,a=r.enrichment,s=0,u=o,i.label=1;case 1:if(!(s<u.length))return[3,4];return c=u[s],[4,(0,N.ensure)(t,c)];case 2:l=i.sent(),(0,T._)(l,L.CoreContext)&&(t=l),this.emit("message_enriched",t,c),i.label=3;case 3:return s++,[3,1];case 4:f=0,d=a,i.label=5;case 5:if(!(f<d.length))return[3,8];return h=d[f],[4,(0,N.attempt)(t,h)];case 6:l=i.sent(),(0,T._)(l,L.CoreContext)&&(t=l),this.emit("message_enriched",t,h),i.label=7;case 7:return f++,[3,5];case 8:return g=(p=this.availableExtensions(null!=(n=t.event.integrations)?n:{})).destinations,v=p.after,[4,new Promise(function(e,n){setTimeout(function(){Promise.all(g.map(function(e){return(0,N.attempt)(t,e)})).then(e).catch(n)},0)})];case 9:return i.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),[4,Promise.all(v.map(function(e){return(0,N.attempt)(t,e)}))];case 10:return i.sent(),[2,t]}})})},e}(v.Emitter));function F(t){for(var e=t.constructor.prototype,n=0,r=Object.getOwnPropertyNames(e);n<r.length;n++){var i=r[n];if("constructor"!==i){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);o&&"function"==typeof o.value&&(t[i]=t[i].bind(t))}}return t}var B=function(t,e,n,r){console.warn("".concat(t.constructor.name,": Can't ").concat(e,' key "').concat(n,'" | Err: ').concat(r))},K=function(){function t(t){this.stores=t}return t.prototype.get=function(t){for(var e=null,n=0,r=this.stores;n<r.length;n++){var i=r[n];try{if(null!=(e=i.get(t)))return e}catch(e){B(i,"get",t,e)}}return null},t.prototype.set=function(t,e){this.stores.forEach(function(n){try{n.set(t,e)}catch(e){B(n,"set",t,e)}})},t.prototype.clear=function(t){this.stores.forEach(function(e){try{e.remove(t)}catch(n){B(e,"remove",t,n)}})},t.prototype.getAndSync=function(t){var e=this.get(t),n="number"==typeof e?e.toString():e;return this.set(t,n),n},t}(),q=function(){function t(){this.cache={}}return t.prototype.get=function(t){var e;return null!=(e=this.cache[t])?e:null},t.prototype.set=function(t,e){this.cache[t]=e},t.prototype.remove=function(t){delete this.cache[t]},t}(),W={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"};function z(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var Q=function t(e,n){function r(t,r,i){if("u">typeof document){"number"==typeof(i=z({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var a in i)i[a]&&(o+="; "+a,!0!==i[a]&&(o+="="+i[a].split(";")[0]));return document.cookie=t+"="+e.write(r,t)+o}}return Object.create({set:r,get:function(t){if("u">typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(r[s]=e.read(a,s),t===s)break}catch(t){}}return t?r[t]:r}},remove:function(t,e){r(t,"",z({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,z({},this.attributes,e))},withConverter:function(e){return t(z({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}({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,decode
2URIComponent)}},{path:"/"});function G(t){var e=function(t){try{return new URL(t)}catch(t){return}}(t);if(e)for(var n=function(t){var e=t.hostname.split("."),n=e[e.length-1],r=[];if(4===e.length&&parseInt(n,10)>0||e.length<=1)return r;for(var i=e.length-2;i>=0;--i)r.push(e.slice(i).join("."));return r}(e),r=0;r<n.length;++r){var i="__tld__",o=n[r],a={domain:"."+o};try{if(Q.set(i,"1",a),Q.get(i))return Q.remove(i,a),o}catch(t){return}}}var V=function(){function t(e){void 0===e&&(e=t.defaults),this.options=(0,i.__assign)((0,i.__assign)({},t.defaults),e)}return Object.defineProperty(t,"defaults",{get:function(){return{maxage:365,domain:G(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),t.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},t.prototype.get=function(t){var e;try{var n=Q.get(t);if(null==n)return null;try{return null!=(e=JSON.parse(n))?e:null}catch(t){return null!=n?n:null}}catch(t){return null}},t.prototype.set=function(t,e){"string"==typeof e?Q.set(t,e,this.opts()):null===e?Q.remove(t,this.opts()):Q.set(t,JSON.stringify(e),this.opts())},t.prototype.remove=function(t){return Q.remove(t,this.opts())},t}(),J=function(){function t(){}return t.prototype.localStorageWarning=function(t,e){console.warn("Unable to access ".concat(t,", localStorage may be ").concat(e))},t.prototype.get=function(t){var e;try{var n=localStorage.getItem(t);if(null===n)return null;try{return null!=(e=JSON.parse(n))?e:null}catch(t){return null!=n?n:null}}catch(e){return this.localStorageWarning(t,"unavailable"),null}},t.prototype.set=function(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(e){this.localStorageWarning(t,"full")}},t.prototype.remove=function(t){try{return localStorage.removeItem(t)}catch(e){this.localStorageWarning(t,"unavailable")}},t}();function H(t){return t&&t.stores&&Array.isArray(t.stores)&&t.stores.every(function(t){return Object.values(W).includes(t)})}function X(t){return t.map(function(t){var e,n;switch((void 0===t?"undefined":(0,r._)(t))==="object"&&void 0!==t.name?(e=t.name,n=t.settings):e=t,e){case W.Cookie:return new V(n);case W.LocalStorage:return new J;case W.Memory:return new q;default:throw Error("Unknown Store Type: ".concat(t))}})}function Z(t,e){return t.map(function(t){return e&&t===W.Cookie?{name:t,settings:e}:t})}var Y={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},$=function(){function t(t,e){void 0===t&&(t=Y);var n,o,a,s,u=this;this.options={},this.id=function(t){if(u.options.disable)return null;var e=u.identityStore.getAndSync(u.idKey);void 0!==t&&(u.identityStore.set(u.idKey,t),t!==e&&null!==e&&null!==t&&u.anonymousId(null));var n=u.identityStore.getAndSync(u.idKey);if(n)return n;var i=u.legacyUserStore.get(Y.cookie.oldKey);return i?(void 0===i?"undefined":(0,r._)(i))==="object"?i.id:i:null},this.anonymousId=function(t){var e,n;if(u.options.disable)return null;if(void 0===t){var r=null!=(e=u.identityStore.getAndSync(u.anonKey))?e:null==(n=u.legacySIO())?void 0:n[0];if(r)return r}return null===t?u.identityStore.set(u.anonKey,null):u.identityStore.set(u.anonKey,null!=t?t:(0,y.v4)()),u.identityStore.getAndSync(u.anonKey)},this.traits=function(t){var e;if(!u.options.disable)return null===t&&(t={}),t&&u.traitsStore.set(u.traitsKey,null!=t?t:{}),null!=(e=u.traitsStore.get(u.traitsKey))?e:{}},this.options=(0,i.__assign)((0,i.__assign)({},Y),t),this.cookieOptions=e,this.idKey=null!=(o=null==(n=t.cookie)?void 0:n.key)?o:Y.cookie.key,this.traitsKey=null!=(s=null==(a=t.localStorage)?void 0:a.key)?s:Y.localStorage.key,this.anonKey="ajs_anonymous_id",this.identityStore=this.createStorage(this.options,e),this.legacyUserStore=this.createStorage(this.options,e,function(t){return t===W.Cookie}),this.traitsStore=this.createStorage(this.options,e,function(t){return t!==W.Cookie});var c=this.legacyUserStore.get(Y.cookie.oldKey);c&&(void 0===c?"undefined":(0,r._)(c))==="object"&&(c.id&&this.id(c.id),c.traits&&this.traits(c.traits)),F(this)}return t.prototype.legacySIO=function(){var t=this.legacyUserStore.get("_sio");if(!t)return null;var e=t.split("----");return[e[0],e[1]]},t.prototype.identify=function(t,e){if(!this.options.disable){e=null!=e?e:{};var n=this.id();(null===n||n===t)&&(e=(0,i.__assign)((0,i.__assign)({},this.traits()),e)),t&&this.id(t),this.traits(e)}},t.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},t.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.traitsStore.clear(this.traitsKey)},t.prototype.load=function(){return new t(this.options,this.cookieOptions)},t.prototype.save=function(){return!0},t.prototype.createStorage=function(t,e,n){var r=[W.LocalStorage,W.Cookie,W.Memory];return t.disable?new K([]):t.persist?(void 0!==t.storage&&null!==t.storage&&H(t.storage)&&(r=t.storage.stores),t.localStorageFallbackDisabled&&(r=r.filter(function(t){return t!==W.LocalStorage})),n&&(r=r.filter(n)),new K(X(Z(r,e)))):new K([new q])},t.defaults=Y,t}
2(),tt={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},te=function(t){function e(e,n){void 0===e&&(e=tt);var r=t.call(this,(0,i.__assign)((0,i.__assign)({},tt),e),n)||this;return r.anonymousId=function(t){},F(r),r}return(0,i.__extends)(e,t),e}($),tn=t.i(930694),tr=t.i(920611),ti=t.i(813113),to=t.i(134621),ta=function(t,e,n){n.getAndRemove(t).forEach(function(t){tp(e,t).catch(console.error)})},ts=ta.bind(void 0,"on"),tu=ta.bind(void 0,"setAnonymousId"),tc=function(t,e){Object.keys(e.calls).forEach(function(n){e.getAndRemove(n).forEach(function(e){setTimeout(function(){tp(t,e).catch(console.error)},0)})})},tl=function(t){if(tf(t))return S(t.pop())},tf=function(t){var e=t[t.length-1];if("object"!==Object.prototype.toString.call(e).slice(8,-1).toLowerCase()||"bpc"!==e.__t)return!1;for(var n in e)if(!m.includes(n))return!1;return!0},td=function(t,e,n,r){void 0===n&&(n=function(){}),void 0===r&&(r=console.error),this.method=t,this.resolve=n,this.reject=r,this.called=!1,this.args=e},th=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._callMap={},this.add.apply(this,t)}return Object.defineProperty(t.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(t){this._callMap=t},enumerable:!1,configurable:!0}),t.prototype.get=function(t){var e;return null!=(e=this.calls[t])?e:[]},t.prototype.getAndRemove=function(t){var e=this.get(t);return this.calls[t]=[],e},t.prototype.add=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach(function(e){["track","screen","alias","group","page","identify"].includes(e.method)&&!tf(e.args)&&(e.args=(0,i.__spreadArray)((0,i.__spreadArray)([],e.args,!0),[A()],!1)),t.calls[e.method]?t.calls[e.method].push(e):t.calls[e.method]=[e]})},t.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},t.prototype.toArray=function(){var t;return(t=[]).concat.apply(t,Object.values(this.calls))},t.prototype._pushSnippetWindowBuffer=function(){if("npm"!==(0,to.getVersionType)()){var t=(0,ti.getGlobalAnalytics)();if(Array.isArray(t)){var e=t.splice(0,t.length).map(function(t){return new td(t[0],t.slice(1))});this.add.apply(this,e)}}},t}();function tp(t,e){return(0,i.__awaiter)(this,void 0,void 0,function(){var n,o;return(0,i.__generator)(this,function(i){switch(i.label){case 0:var a;if(i.trys.push([0,3,,4]),e.called)return[2,void 0];if(e.called=!0,!((void 0===(a=n=t[e.method].apply(t,e.args))?"undefined":(0,r._)(a))==="object"&&null!==a&&"then"in a&&"function"==typeof a.then))return[3,2];return[4,n];case 1:i.sent(),i.label=2;case 2:return e.resolve(n),[3,4];case 3:return o=i.sent(),e.reject(o),[3,4];case 4:return[2]}})})}var tg=function(){function t(t){var e=this;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=tn.version,this._preInitBuffer=new th,this._promise=t(this._preInitBuffer),this._promise.then(function(t){var n=t[0],r=t[1];e.instance=n,e.ctx=r}).catch(function(){})}return t.prototype.then=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).then.apply(t,e)},t.prototype.catch=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).catch.apply(t,e)},t.prototype.finally=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).finally.apply(t,e)},t.prototype._createMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.instance?Promise.resolve((n=e.instance)[t].apply(n,r)):new Promise(function(n,i){e._preInitBuffer.add(new td(t,r,n,i))})}},t.prototype._createChainableMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.instance?(n=e.instance)[t].apply(n,r):e._preInitBuffer.add(new td(t,r)),e}},t}(),tv=t.i(319045),ty=t.i(570541),t_=function(t){var e=!1;window.addEventListener("pagehide",function(){e||t(e=!0)}),document.addEventListener("visibilitychange",function(){if("hidden"==document.visibilityState){if(e)return;e=!0}else e=!1;t(e)})},tm=function(t){function e(e,n,r){void 0===r&&(r=!1);var i=t.call(this,e)||this;return i.retryTimeout=n,i.isRetryableWithoutCount=r,i.name="RateLimitError",i}return(0,i.__extends)(e,t),e}(Error),tb=function(t){return(0,i.__assign)({"Content-Type":"text/plain"},"function"==typeof t?t():t)},tw={408:"retry",410:"retry",429:"retry",460:"retry",501:"drop",505:"drop",511:"drop"};function tS(t,e,n,r){return Math.min(Math.max(null!=t?t:e,n),r)}function tA(t,e){if(429!==t.status)return null;var n,r=null==(n=t.headers)?void 0:n.get("Retry-After");if(!r)return null;var i=parseInt(r,10);return Number.isNaN(i)?null:{retryAfterMs:1e3*Math.max(0,Math.min(i,e.maxRetryInterval)),fromHeader:!0}}function tk(t,e){var n=e.statusCodeOverrides[String(t)];return n||(t>=500?e.default5xxBehavior:t>=400?e.default4xxBehavior:"drop")}function tC(t,e){var n,r,o,a,s=t||e?{rateLimitConfig:(0,i.__assign)((0,i.__assign)({},null==t?void 0:t.rateLimitConfig),null==e?void 0:e.rateLimitConfig),backoffConfig:(0,i.__assign)((0,i.__assign)((0,i.__assign)({},null==t?void 0:t.backoffConfig),null==e?void 0:e.backoffConfig),{statusCodeOverrides:(0,i.__assign)((0,i.__assign)({},null==(n=null==t?void 0:t.backoffConfig)?void 0:n.statusCodeOverrides),null==(r=null==e?void 0:e.backoffConfig)?void 0:r.statusCodeOverrides)})}:void 0,u=null==s?void 0:s.rateLimitConfig,c=null==s?void 0:s.backoffConfig;return{rateLimitConfig:{maxRetryCount:tS(null==u?void 0:u.maxRetryCount,10,0,100),maxRetryInterval:tS(null==u?void 0:u.maxRetryInterval,300,.1,86400),maxRateLimitDuration:tS(null==u?void 0:u.maxRateLimitDuration,43200,10,86400)},backoffConfig:{maxRetryCount:tS(null==c?void 0:c.maxRetryCount,10,0,100),baseBackoffInterval:tS(null==c?void 0:c.baseBackoffInterval,.5,.1,300),maxBackoffInterval:tS(null==c?void 0:c.maxBackoffInterval,60,.1,86400),maxTotalBackoffDuration:tS(null==c?void 0:c.maxTotalBackoffDuration,43200,60,604800),jitterPercent:tS(null==c?void 0:c.jitterPercent,10,0,100),default4xxBehavior:null!=(o=null==c?void 0:c.default4xxBehavior)?o:"drop",default5xxBehavior:null!=(a=null==c?void 0:c.default5xxBehavior)?a:"retry",statusCodeOverrides:(0,i.__assign)((0,i.__assign)({},tw),null==c?void 0:c.statusCodeOverrides)}}}function tI(t){return(encodeURI(JSON.stringify(t)).split(/%..|./).length-1)/1024}var tE=t.i(785630);function tP(t,e,n,r){var o=this;t||setTimeout(function(){return(0,i.__awaiter)(o,void 0,void 0,function(){var t,o;return(0,i.__generator)(this,function(a){switch(a.label){case 0:return t=!0,[4,function(t,e){return(0,i.__awaiter)(this,void 0,void 0,function(){var n,r=this;return(0,i.__generator)(this,function(o){switch(o.label){case 0:if(n=[],(0,h.isOffline)())return[2,e];return[4,(0,tE.pWhile)(function(){return e.length>0&&!(0,h.isOffline)()},function(){return(0,i.__awaiter)(r,void 0,void 0,function(){var r,o;return(0,i.__generator)(this,function(i){switch(i.label){case 0:if(!(r=e.pop()))return[2];return[4,(0,N.attempt)(r,t)];case 1:return o=i.sent(),(0,T._)(o,p.Context)||n.push(r),[2]}})})})];case 1:return o.sent(),n.map(function(t){return e.pushWithBackoff(t)}),[2,e]}})})}(n,e)];case 1:return o=a.sent(),t=!1,e.todo>0&&r(t,o,n,r),[2]}})})},500*Math.random()+100)}var tO=t.i(133041),tx=function(t){return"Segment.io"===t.name},tM="This is being deprecated and will be not be available in future releases of Analytics JS",tj=(0,tr.getGlobal)(),tT=null==tj?void 0:tj.analytics,tR=function(){function t(t,e){var n;this.timeout=300,this._getSegmentPluginMetadata=function(){var t;return null==(t=e.plugins.find(tx))?void 0:t.metadata},this.writeKey=t.writeKey,this.cdnSettings=null!=(n=t.cdnSettings)?n:{integrations:{"Segment.io":{apiKey:""}}},this.cdnURL=t.cdnURL}return Object.defineProperty(t.prototype,"apiHost",{get:function(){var t,e;return null==(e=null==(t=this._getSegmentPluginMetadata)?void 0:t.call(this))?void 0:e.apiHost}
2,enumerable:!1,configurable:!0}),t}();function tL(){console.warn(tM)}var tU=function(e){function n(t,n,r,o,a){var s,u,c,l,f,d,h=this;(h=e.call(this)||this)._debug=!1,h.initialized=!1,h.user=function(){return h._user},h.init=h.initialize.bind(h),h.log=tL,h.addIntegrationMiddleware=tL,h.listeners=tL,h.addEventListener=tL,h.removeAllListeners=tL,h.removeListener=tL,h.removeEventListener=tL,h.hasListeners=tL,h.add=tL,h.addIntegration=tL;var p=null==n?void 0:n.cookie,g=null!=(f=null==n?void 0:n.disableClientPersistence)&&f;h.queue=null!=r?r:(s="".concat(t.writeKey,":event-queue"),void 0===(u=null==n?void 0:n.retryQueue)&&(u=!1),void 0===(c=g)&&(c=!1),l=u?10:1,new D(c?new R.PriorityQueue(l,[]):new j.PersistedPriorityQueue(l,s))),h.settings=new tR(t,h.queue);var v=null==n?void 0:n.storage;return h._universalStorage=h.createStore(g,v,p),h._user=null!=o?o:new $((0,i.__assign)({persist:!g,storage:null==n?void 0:n.storage},null==n?void 0:n.user),p).load(),h._group=null!=a?a:new te((0,i.__assign)({persist:!g,storage:null==n?void 0:n.storage},null==n?void 0:n.group),p).load(),h.eventFactory=new x(h._user),h.integrations=null!=(d=null==n?void 0:n.integrations)?d:{},h.options=null!=n?n:{},F(h),h}return(0,i.__extends)(n,e),n.prototype.createStore=function(t,e,n){return new K(t?[new q]:e&&H(e)?X(Z(e.stores,n)):X([W.LocalStorage,{name:W.Cookie,settings:n},W.Memory]))},Object.defineProperty(n.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),n.prototype.track=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,i.__awaiter)(this,void 0,void 0,function(){var e,n,r,o,a,s,u,l=this;return(0,i.__generator)(this,function(i){return e=tl(t),r=(n=c.apply(void 0,t))[0],o=n[1],a=n[2],s=n[3],u=this.eventFactory.track(r,o,a,this.integrations,e),[2,this._dispatch(u,s).then(function(t){return l.emit("track",r,t.event.properties,t.event.options),t})]})})},n.prototype.page=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,i.__awaiter)(this,void 0,void 0,function(){var e,n,r,o,a,s,u,c,f=this;return(0,i.__generator)(this,function(i){return e=tl(t),r=(n=l.apply(void 0,t))[0],o=n[1],a=n[2],s=n[3],u=n[4],c=this.eventFactory.page(r,o,a,s,this.integrations,e),[2,this._dispatch(c,u).then(function(t){return f.emit("page",r,o,t.event.properties,t.event.options),t})]})})},n.prototype.identify=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,i.__awaiter)(this,void 0,void 0,function(){var e,n,r,o,a,s,u,c=this;return(0,i.__generator)(this,function(i){return e=tl(t),r=(n=f(this._user).apply(void 0,t))[0],o=n[1],a=n[2],s=n[3],this._user.identify(r,o),u=this.eventFactory.identify(this._user.id(),this._user.traits(),a,this.integrations,e),[2,this._dispatch(u,s).then(function(t){return c.emit("identify",t.event.userId,t.event.traits,t.event.options),t})]})})},n.prototype.group=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=tl(e);if(0===e.length)return this._group;var i=f(this._group).apply(void 0,e),o=i[0],a=i[1],s=i[2],u=i[3];this._group.identify(o,a);var c=this._group.id(),l=this._group.traits(),d=this.eventFactory.group(c,l,s,this.integrations,r);return this._dispatch(d,u).then(function(e){return t.emit("group",e.event.groupId,e.event.traits,e.event.options),e})},n.prototype.alias=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,i.__awaiter)(this,void 0,void 0,function(){var e,n,r,o,a,s,u,c=this;return(0,i.__generator)(this,function(i){return e=tl(t),r=(n=d.apply(void 0,t))[0],o=n[1],a=n[2],s=n[3],u=this.eventFactory.alias(r,o,a,this.integrations,e),[2,this._dispatch(u,s).then(function(t){return c.emit("alias",r,o,t.event.options),t})]})})},n.prototype.screen=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,i.__awaiter)(this,void 0,void 0,function(){var e,n,r,o,a,s,u,c,f=this;return(0,i.__generator)(this,function(i){return e=tl(t),r=(n=l.apply(void 0,t))[0],o=n[1],a=n[2],s=n[3],u=n[4],c=this.eventFactory.screen(r,o,a,s,this.integrations,e),[2,this._dispatch(c,u).then(function(t){return f.emit("screen",r,o,t.event.properties,t.event.options),t})]})})},n.prototype.trackClick=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0,i.__awaiter)(this,void 0,void 0,function(){var n;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return[4,t.A(104098)];case 1:return[2,(n=r.sent().link).call.apply(n,(0,i.__spreadArray)([this],e,!1))]}})})},n.prototype.trackLink=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0,i.__awaiter)(this,void 0,void 0,function(){var n;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return[4,t.A(104098)];case 1:return[2,(n=r.sent().link).call.apply(n,(0,i.__spreadArray)([this],e,!1))]}})})},n.prototype.trackSubmit=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0,i.__awaiter)(this,void 0,void 0,function(){var n;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return[4,t.A(104098)];case 1:return[2,(n=r.sent().form).call.apply(n,(0,i.__spreadArray)([this],e,!1))]}})})},n.prototype.trackForm=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0,i.__awaiter)(this,void 0,void 0,function(){var n;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return[4,t.A(104098)];case 1:return[2,(n=r.sent().form).call.apply(n,(0,i.__spreadArray)([this],e,!1))]}})})},n.prototype.register=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,i.__awaiter)(this,void 0,void 0,function(){var e,n=this;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return e=p.Context.system(),[4,Promise.all(t.map(function(t){return n.queue.register(e,t,n)}))];case 1:return r.sent(),[2,e]}})})},n.prototype.deregister=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,i.__awaiter)(this,void 0,void 0,function(){var e,n=this;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return e=p.Context.system(),[4,Promise.all(t.map(function(t){var r=n.queue.plugins.find(function(e){return e.name===t});if(r)return n.queue.deregister(e,r,n);e.log("warn","plugin ".concat(t," not found"))}))];case 1:return r.sent(),[2,e]}})})},n.prototype.debug=function(t){return!1===t&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=t,this},n.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit
2("reset")},n.prototype.timeout=function(t){this.settings.timeout=t},n.prototype._dispatch=function(t,e){return(0,i.__awaiter)(this,void 0,void 0,function(){var n;return(0,i.__generator)(this,function(r){return((n=new p.Context(t)).stats.increment("analytics_js.invoke",1,[t.type]),(0,h.isOffline)()&&!this.options.retryQueue)?[2,n]:[2,function(t,e,n,r){return(0,i.__awaiter)(this,void 0,void 0,function(){var o,a;return(0,i.__generator)(this,function(i){switch(i.label){case 0:if(n.emit("dispatch_start",t),o=Date.now(),!e.isEmpty())return[3,2];return[4,e.dispatchSingle(t)];case 1:return a=i.sent(),[3,4];case 2:return[4,e.dispatch(t)];case 3:a=i.sent(),i.label=4;case 4:var s,u;if(!(null==r?void 0:r.callback))return[3,6];return[4,(0,g.invokeCallback)(a,r.callback,(s=o,Math.max((null!=(u=r.timeout)?u:300)-(Date.now()-s),0)))];case 5:a=i.sent(),i.label=6;case 6:return(null==r?void 0:r.debug)&&a.flush(),[2,a]}})})}(n,this.queue,this,{callback:e,debug:this._debug,timeout:this.settings.timeout})]})})},n.prototype.addSourceMiddleware=function(e){return(0,i.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return[4,this.queue.criticalTasks.run(function(){return(0,i.__awaiter)(n,void 0,void 0,function(){var n,r,o;return(0,i.__generator)(this,function(i){switch(i.label){case 0:return[4,t.A(971106)];case 1:return n=i.sent().sourceMiddlewarePlugin,r={},this.queue.plugins.forEach(function(t){if("destination"===t.type)return r[t.name]=!0}),o=n(e,r),[4,this.register(o)];case 2:return i.sent(),[2]}})})})];case 1:return r.sent(),[2,this]}})})},n.prototype.addDestinationMiddleware=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.queue.plugins.filter(M).forEach(function(n){("*"===t||n.name.toLowerCase()===t.toLowerCase())&&n.addMiddleware.apply(n,e)}),Promise.resolve(this)},n.prototype.setAnonymousId=function(t){return this._user.anonymousId(t)},n.prototype.queryString=function(e){return(0,i.__awaiter)(this,void 0,void 0,function(){return(0,i.__generator)(this,function(n){switch(n.label){case 0:if(!1===this.options.useQueryString)return[2,[]];return[4,t.A(216332)];case 1:return[2,(0,n.sent().queryString)(this,e)]}})})},n.prototype.use=function(t){return t(this),this},n.prototype.ready=function(t){return void 0===t&&(t=function(t){return t}),(0,i.__awaiter)(this,void 0,void 0,function(){return(0,i.__generator)(this,function(e){return[2,Promise.all(this.queue.plugins.map(function(t){return t.ready?t.ready():Promise.resolve()})).then(function(e){return t(e),e})]})})},n.prototype.noConflict=function(){return console.warn(tM),(0,ti.setGlobalAnalytics)(null!=tT?tT:this),this},n.prototype.normalize=function(t){return console.warn(tM),this.eventFactory.normalize(t)},Object.defineProperty(n.prototype,"failedInitializations",{get:function(){return console.warn(tM),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"VERSION",{get:function(){return tn.version},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,e){return(0,i.__awaiter)(this,void 0,void 0,function(){return(0,i.__generator)(this,function(t){return console.warn(tM),[2,Promise.resolve(this)]})})},n.prototype.pageview=function(t){return(0,i.__awaiter)(this,void 0,void 0,function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return console.warn(tM),[4,this.page({path:t})];case 1:return e.sent(),[2,this]}})})},Object.defineProperty(n.prototype,"plugins",{get:function(){var t;return console.warn(tM),null!=(t=this._plugins)?t:{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Integrations",{get:function(){return console.warn(tM),this.queue.plugins.filter(function(t){return"destination"===t.type}).reduce(function(t,e){var n="".concat(e.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),r=window[n];if(!r)return t;var i=r.Integration;return i?t[e.name]=i:t[e.name]=r,t},{})},enumerable:!1,configurable:!0}),n.prototype.push=function(t){var e=t.shift();(!e||this[e])&&this[e].apply(this,t)},n}(v.Emitter),tN=function(t){function e(){var e=t.call(this,{writeKey:""},{disableClientPersistence:!0})||this;return e.initialized=!0,e}return(0,i.__extends)(e,t),e}(tU),tD=t.i(652977),tF=t.i(681473),tB=t.i(845955),tK=function(t){try{var e=new URLSearchParams;return Object.entries(t).forEach(function(t){var n=t[0],r=t[1];Array.isArray(r)?r.forEach(function(t){return e.append(n,t)}):e.append(n,r)}),e.toString()}catch(t){return""}},tq=new function(){var t=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(e,n){return(0,i.__awaiter)(t,void 0,void 0,function(){var t;return(0,i.__generator)(this,function(e){switch(e.label){case 0:this.instance=n,e.label=1;case 1:return e.trys.push([1,3,,4]),t=this,[4,function(t){return(0,i.__awaiter)(this,void 0,void 0,function(){var e;return(0,i.__generator)(this,function(n){return(e=navigator.userAgentData)?t?[2,e.getHighEntropyValues(t).cat
2ch(function(){return e.toJSON()})]:[2,e.toJSON()]:[2,void 0]})})}(this.instance.options.highEntropyValuesClientHints)];case 2:return t.userAgentData=e.sent(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(n){var o,a,s,u,c,l,f=n.event.context,d=f.page.search||"",h=(void 0===d?"undefined":(0,r._)(d))==="object"?tK(d):d;f.userAgent=navigator.userAgent,f.userAgentData=t.userAgentData;var p=navigator.userLanguage||navigator.language;void 0===f.locale&&void 0!==p&&(f.locale=p),null!=f.library||(f.library={name:"analytics.js",version:"".concat("web"===(0,to.getVersionType)()?"next":"npm:next","-").concat(tn.version)}),h&&!f.campaign&&((o=h).startsWith("?")&&(o=o.substring(1)),f.campaign=(o=o.replace(/\?/g,"&")).split("&").reduce(function(t,e){var n=e.split("="),r=n[0],i=n[1];if(r.includes("utm_")&&r.length>4){var o=r.slice(4);"campaign"===o&&(o="name"),t[o]=(0,tB.gracefulDecodeURIComponent)(void 0===i?"":i)}return t},{}));var g=function(){var t=Q.get("_ga");if(t&&t.startsWith("amp"))return t}();g&&(f.amp={id:g}),u=(s=new K(null!=(l=t.instance.options.disableClientPersistence)&&l?[]:[new V(function(){if(e)return e;var t=G(window.location.href);return e={expires:31536e6,secure:!1,path:"/"},t&&(e.domain=t),e}())])).get("s:context.referrer"),(c=null!=(a=function(t){var e={btid:"dataxu",urid:"millennial-media"};t.startsWith("?")&&(t=t.substring(1));for(var n=(t=t.replace(/\?/g,"&")).split("&"),r=0;r<n.length;r++){var i=n[r].split("="),o=i[0],a=i[1];if(e[o])return{id:a,type:e[o]}}}(h))?a:u)&&(f&&(f.referrer=(0,i.__assign)((0,i.__assign)({},f.referrer),c)),s.set("s:context.referrer",c));try{f.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){}return n},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich},tW=t.i(380924),tz=t.i(824124),tQ=t.i(231320),tG=function(){function t(t,e){this.version="1.0.0",this.alternativeNames=[],this.loadPromise=(0,tF.createDeferred)(),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=e,this.name=t,this.type=e.type,this.alternativeNames.push(e.name)}return t.prototype.addMiddleware=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];"destination"===this.type&&(t=this.middleware).push.apply(t,e)},t.prototype.transform=function(t){return(0,i.__awaiter)(this,void 0,void 0,function(){var e;return(0,i.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,tz.applyDestinationMiddleware)(this.name,t.event,this.middleware)];case 1:return null===(e=n.sent())&&t.cancel(new L.ContextCancelation({retry:!1,reason:"dropped by destination middleware"})),[2,new p.Context(e)]}})})},t.prototype._createMethod=function(t){var e=this;return function(n){return(0,i.__awaiter)(e,void 0,void 0,function(){var e,r;return(0,i.__generator)(this,function(i){switch(i.label){case 0:if(!this.action[t])return[2,n];if(e=n,"destination"!==this.type)return[3,2];return[4,this.transform(n)];case 1:e=i.sent(),i.label=2;case 2:return i.trys.push([2,5,,6]),[4,this.ready()];case 3:if(!i.sent())throw Error("Something prevented the destination from getting ready");return(0,tQ.recordIntegrationMetric)(n,{integrationName:this.action.name,methodName:t,type:"action"}),[4,this.action[t](e)];case 4:return i.sent(),[3,6];case 5:throw r=i.sent(),(0,tQ.recordIntegrationMetric)(n,{integrationName:this.action.name,methodName:t,type:"action",didError:!0}),r;case 6:return[2,n]}})})}},t.prototype.isLoaded=function(){return this.action.isLoaded()},t.prototype.ready=function(){return(0,i.__awaiter)(this,void 0,void 0,function(){return(0,i.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.loadPromise.promise];case 1:return t.sent(),[2,!0];case 2:return t.sent(),[2,!1];case 3:return[2]}})})},t.prototype.load=function(t,e){return(0,i.__awaiter)(this,void 0,void 0,function(){var n,r,o,a;return(0,i.__generator)(this,function(i){switch(i.label){case 0:if(this.loadPromise.isSettled())return[2,this.loadPromise.promise];i.label=1;case 1:return i.trys.push([1,3,,4]),(0,tQ.recordIntegrationMetric)(t,{integrationName:this.action.name,methodName:"load",type:"action"}),n=this.action.load(t,e),o=(r=this.loadPromise).resolve,[4,n];case 2:return o.apply(r,[i.sent()]),[2,n];case 3:throw a=i.sent(),(0,tQ.recordIntegrationMetric)(t,{integrationName:this.action.name,methodName:"load",type:"action",didError:!0}),this.loadPromise.reject(a),a;case 4:return[2]}})})},t.prototype.unload=function(t,e){var n,r;return null==(r=(n=this.action).unload)?void 0:r.call(n,t,e)},t}(),tV=(0,tr.getGlobal)(),tJ=null!=(n=tV.__SEGMENT_INSPECTOR__)?n:tV.__SEGMENT_INSPECTOR__={},tH=function(t){var e;return null==(e=tJ.attach)?void 0:e.call(tJ,t)},tX=t.i(778302),tZ=function(){var t,e,n=null!=(t=window.location.hash)?t:"",r=null!=(e=window.location.search)?e:"";return r.length?r:n.replace(/(?=#).*(?=\?)/,"")},tY=function(e){function n(){var n=this,o=(0,tF.createDeferred)(),u=o.promise,c=o.resolve;return(n=e.call(this,function(e){return u.then(function(n){return function(e,n,o){var u,c,l,f,d,g,v,y,_;return void 0===n&&(n={}),(0,i.__awaiter)(this,void 0,void 0,function(){var m,b,w,S,A,k,C,I,E,P;return(0,i.__generator)(this,function(O){switch(O.label){case 0:if(!0===n.disable)return[2,[new tN,p.Context.system()]];if(n.globalAnalyticsKey&&(0,ti.setGlobalAnalyticsKey)(n.globalAnalyticsKey),e.cdnURL&&(0,s.setGlobalCDNUrl)(e.cdnURL),n.initialPageview&&o.add(new td("page",[])),m=tZ(),b=null!=(u=e.cdnURL)?u:(0,s.getCDN)(),null==(c=e.cdnSettings))return[3,1];return S=c,[3,3];case 1:var x,M;return[4,(x=e.writeKey,M=b,(0,ty.fetch)("".concat(M,"/v1/projects/").concat(x,"/settings")).then(function(t){return t.ok?t.json():t.text().then(function(t){throw Error(t)})}).catch(function(t){throw console.error(t.message),t}))];
2case 2:S=O.sent(),O.label=3;case 3:if(w=S,n.updateCDNSettings&&(w=n.updateCDNSettings(w)),"function"!=typeof n.disable)return[3,5];return[4,n.disable(w)];case 4:if(O.sent())return[2,[new tN,p.Context.system()]];O.label=5;case 5:return A=null==(f=null==(l=w.integrations["Segment.io"])?void 0:l.retryQueue)||f,n=(0,i.__assign)({retryQueue:A},n),tH(k=new tU((0,i.__assign)((0,i.__assign)({},e),{cdnSettings:w,cdnURL:b}),n)),C=null!=(d=e.plugins)?d:[],I=null!=(g=e.classicIntegrations)?g:[],E=null==(v=n.integrations)?void 0:v["Segment.io"],tX.Stats.initRemoteMetrics((0,i.__assign)((0,i.__assign)({},w.metrics),{host:null!=(y=null==E?void 0:E.apiHost)?y:null==(_=w.metrics)?void 0:_.host,protocol:null==E?void 0:E.protocol})),[4,function(e,n,o,u,c,l,f){var d,g,v;return void 0===c&&(c=[]),(0,i.__awaiter)(this,void 0,void 0,function(){var y,_,m,b,w,S,A,k,C,I,E,P,O,x,M=this;return(0,i.__generator)(this,function(T){var L,U,N;switch(T.label){case 0:if(tu(o,f),ts(o,f),y=null==c?void 0:c.filter(function(t){return(void 0===t?"undefined":(0,r._)(t))==="object"}),_=null==c?void 0:c.filter(function(t){return"function"==typeof t&&"string"==typeof t.pluginName}),"test"===a().NODE_ENV||!((null!=(N=null==(U=null==(L=n.middlewareSettings)?void 0:L.routingRules)?void 0:U.length)?N:0)>0))return[3,2];return[4,t.A(369583).then(function(t){return t.tsubMiddleware(n.middlewareSettings.routingRules)})];case 1:return b=T.sent(),[3,3];case 2:b=void 0,T.label=3;case 3:if(m=b,("test"===a().NODE_ENV||!(Object.keys(n.integrations).length>1))&&!(l.length>0))return[3,5];return[4,t.A(149122).then(function(t){return t.ajsDestinations(e,n,o.integrations,u,m,l)})];case 4:return S=T.sent(),[3,6];case 5:S=[],T.label=6;case 6:if(w=S,!n.legacyVideoPluginsEnabled)return[3,8];return[4,t.A(473470).then(function(t){return t.loadLegacyVideoPlugins(o)})];case 7:T.sent(),T.label=8;case 8:if(!(null==(d=u.plan)?void 0:d.track))return[3,10];return[4,t.A(128089).then(function(t){var e;return t.schemaFilter(null==(e=u.plan)?void 0:e.track,n)})];case 9:return k=T.sent(),[3,11];case 10:k=void 0,T.label=11;case 11:return A=k,C=(0,tD.mergedOptions)(n,u),[4,(function(t,e,n,r,o,a){var u,c,l;return(0,i.__awaiter)(this,void 0,void 0,function(){var f,d,h=this;return(0,i.__generator)(this,function(g){switch(g.label){case 0:return f=[],d=null!=(c=null==(u=t.middlewareSettings)?void 0:u.routingRules)?c:[],[4,Promise.all((null!=(l=t.remotePlugins)?l:[]).map(function(t){return(0,i.__awaiter)(h,void 0,void 0,function(){var u,c,l,h,g,v;return(0,i.__generator)(this,function(y){switch(y.label){case 0:var _,m;if(_=e[t.creationName],m=e[t.name],!1===e.All&&!_&&!m||!1===_||!1===m||0)return[2];y.label=1;case 1:if(y.trys.push([1,6,,7]),c=null==a?void 0:a.find(function(e){return e.pluginName===t.name}))return[3,3];return[4,function(t,e){return(0,i.__awaiter)(this,void 0,void 0,function(){var n,r,o,a,u,c;return(0,i.__generator)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,9,,10]),n=RegExp("https://cdn.segment.(com|build)"),r=(0,s.getCDN)(),!e)return[3,6];a=(o=t.url.split("/"))[o.length-2],u=t.url.replace(a,btoa(a).replace(/=/g,"")),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,(0,tW.loadScript)(u.replace(n,r))];case 2:case 4:return i.sent(),[3,5];case 3:return i.sent(),[4,(0,tW.loadScript)(t.url.replace(n,r))];case 5:return[3,8];case 6:return[4,(0,tW.loadScript)(t.url.replace(n,r))];case 7:i.sent(),i.label=8;case 8:if("function"==typeof window[t.libraryName])return[2,window[t.libraryName]];return[3,10];case 9:throw c=i.sent(),console.error("Failed to create PluginFactory",t),c;case 10:return[2]}})})}(t,null==r?void 0:r.obfuscate)];case 2:c=y.sent(),y.label=3;case 3:if(!(u=c))return[3,5];return l=n[t.name],[4,u((0,i.__assign)((0,i.__assign)({},t.settings),l))];case 4:!function(t){if(!Array.isArray(t))throw Error("Not a valid list of plugins");var e=["load","isLoaded","name","version","type"];t.forEach(function(t){e.forEach(function(e){var n;if(void 0===t[e])throw Error("Plugin: ".concat(null!=(n=t.name)?n:"unknown"," missing required function ").concat(e))})})}(g=Array.isArray(h=y.sent())?h:[h]),v=d.filter(function(e){return e.destinationName===t.creationName}),g.forEach(function(e){var n=new tG(t.creationName,e);
2v.length&&o&&n.addMiddleware(o),f.push(n)}),y.label=5;case 5:return[3,7];case 6:return console.warn("Failed to load Remote Plugin",y.sent()),(0,tQ.recordIntegrationMetric)(p.Context.system(),{integrationName:t.name,methodName:"load",type:"action",didError:!0}),[3,7];case 7:return[2]}})})}))];case 1:return g.sent(),[2,f.filter(Boolean)]}})})})(n,o.integrations,C,u,m,_).catch(function(t){return console.error("Failed to load remote plugins",t),[]})];case 12:if(I=T.sent(),E=(0,i.__spreadArray)((0,i.__spreadArray)([tq],w,!0),I,!0),A&&E.push(A),(null==(g=u.integrations)?void 0:g.All)===!1&&!u.integrations["Segment.io"]||u.integrations&&!1===u.integrations["Segment.io"])return[3,14];return O=(P=E).push,[4,function(t,e,n){window.addEventListener("pagehide",function(){l.push.apply(l,Array.from(f)),f.clear()});var r,o,a,s,u,c=null!=(o=null==e?void 0:e.apiKey)?o:"",l=t.options.disableClientPersistence?new R.PriorityQueue(t.queue.queue.maxAttempts,[]):new j.PersistedPriorityQueue(t.queue.queue.maxAttempts,"".concat(c,":dest-Segment.io")),f=new Set,d=new WeakMap,g=null!=(a=null==e?void 0:e.apiHost)?a:tO.SEGMENT_API_HOST,v=null!=(s=null==e?void 0:e.protocol)?s:"https",y="".concat(v,"://").concat(g),_=null==(u=null==n?void 0:n["Segment.io"])?void 0:u.httpConfig,m=tC(null==e?void 0:e.httpConfig,_);!1!==t.options.retryQueue&&(l.maxAttempts=m.backoffConfig.maxRetryCount);var b=null==e?void 0:e.deliveryStrategy,w=b&&"strategy"in b&&"batching"===b.strategy?function(t,e,n,r){void 0===r&&(r="https");var o,a,s,u=[],c=!1,l=null!=(o=null==e?void 0:e.size)?o:10,f=null!=(a=null==e?void 0:e.timeout)?a:5e3,d=null!=n?n:tC(),h=0,g=0,v=!1,y=!1,_=0,m=0,b=0;function w(n,o){if(0!==n.length){var a,s=null==(a=n[0])?void 0:a.writeKey,u=n.map(function(t){return t.sentAt,(0,i.__rest)(t,["sentAt"])}),l=tb(null==e?void 0:e.headers);if(o>0&&(l["X-Retry-Count"]=String(o)),s){var f=btoa(s+":");l.Authorization="Basic ".concat(f)}var h=t.startsWith("http://")||t.startsWith("https://")?"":"".concat(r,"://");return(0,ty.fetch)("".concat(h).concat(t,"/b"),{credentials:null==e?void 0:e.credentials,keepalive:(null==e?void 0:e.keepalive)||c,headers:l,method:"post",body:JSON.stringify({writeKey:s,batch:u,sentAt:new Date().toISOString()}),priority:null==e?void 0:e.priority}).then(function(t){var e=t.status;if(!(e<400)){var n=tk(e,d.backoffConfig);if("drop"!==n){var r=tA(t,d.rateLimitConfig);if(r)throw new tm("Rate limit exceeded: ".concat(e),r.retryAfterMs,r.fromHeader)}if("retry"===n)throw Error("Retryable error: ".concat(e))}})}}function S(){u.length>0&&k(1)}function A(t){var n;return void 0===t&&(t=1),(0,i.__awaiter)(this,void 0,void 0,function(){var r,o,a,s;return(0,i.__generator)(this,function(c){return(v||(g=0,_=0,m=0,b=0),v=!1,y=!0,u.length)?(o=(r=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],o=(0,i.__spreadArray)((0,i.__spreadArray)([],e,!0),[r],!1);if(e.length>0&&tI(o)>=450)return{batch:e,remaining:t.slice(n)};e.push(r)}return{batch:e,remaining:[]}}(u)).batch,a=r.remaining,0===o.length)?(y=!1,[2]):(u=a,s=g,g+=1,[2,null==(n=w(o,s))?void 0:n.then(function(t){return u.length>0&&k(1),t}).catch(function(n){p.Context.system().log("error","Error sending batch",n);var r=null!=(f=null==e?void 0:e.maxRetries)?f:d.backoffConfig.maxRetryCount,a="RateLimitError"===n.name,s=a&&n.isRetryableWithoutCount;if(!(s||t<=r))return S();if(s){if(++_>d.rateLimitConfig.maxRetryCount)return S();var c=n.retryTimeout;b+=c;var l=1e3*d.rateLimitConfig.maxRateLimitDuration;if(b>l)return S();h=c}if(!a){y=t,g=Math.max(0,Math.min(1e3*(w=d.backoffConfig).baseBackoffInterval*Math.pow(2,y-1),1e3*w.maxBackoffInterval)*(1+(Math.random()-.5)*2*(w.jitterPercent/100))),m+=g;var f,g,y,w,A=1e3*d.backoffConfig.maxTotalBackoffDuration;if(m>A)return S()}u=(0,i.__spreadArray)((0,i.__spreadArray)([],o,!0),u,!0),o.forEach(function(e){"_metadata"in e&&(e._metadata=(0,i.__assign)((0,i.__assign)({},e._metadata),{retryCount:t}))}),v=!0,k(s?t:t+1,g)}).finally(function(){y=!1})]):(y=!1,[2])})})}function k(t,e){void 0===t&&(t=1),s||(s=setTimeout(function(){s=void 0,A(t).catch(console.error)},h||e||f),h=0)}return t_(function(t){if((c=t)&&u.length){var e,n;
2Promise.all((e=[],n=0,u.forEach(function(t){tI(e[n])>=64&&n++,e[n]?e[n].push(t):e[n]=[t]}),e).map(function(t){return w(t,0)})).catch(console.error)}}),{dispatch:function(t,n,r){return(0,i.__awaiter)(this,void 0,void 0,function(){return(0,i.__generator)(this,function(t){if(u.push(n),v)return[2];return u.length>=l||tI(u)>=450||(null==e?void 0:e.keepalive)&&tI(u)>=54||c?[2,y?k():A()]:[2,k()]})})}}}(g,b.config,m,v):(r=null==b?void 0:b.config,{dispatch:function(t,e,n){var i=tb(null==r?void 0:r.headers),o=null==e?void 0:e.writeKey;if(o){var a=btoa(o+":");i.Authorization="Basic ".concat(a)}return n&&(i["X-Retry-Count"]=String(n)),(0,ty.fetch)(t,{credentials:null==r?void 0:r.credentials,keepalive:null==r?void 0:r.keepalive,headers:i,method:"post",body:JSON.stringify(e),priority:null==r?void 0:r.priority}).then(function(t){var e=t.status;if(!(e<400)){var n=null!=m?m:tC(),r=tk(e,n.backoffConfig);if("drop"!==r){var i=tA(t,n.rateLimitConfig);if(i)throw new tm("Rate limit exceeded: ".concat(e),i.retryAfterMs,i.fromHeader)}if("retry"===r)throw Error("Retryable error: ".concat(e));var o=Error("Non-retryable error: ".concat(e));throw o.name="NonRetryableError",o}})}});function S(r){return(0,i.__awaiter)(this,void 0,void 0,function(){var o,a,s,u;return(0,i.__generator)(this,function(c){var p,g,v,_,b,S;return(0,h.isOffline)()?(l.push(r),tP(!1,l,A,tP),[2,r]):(f.add(r),o=r.event.type.charAt(0),a=(0,tv.toFacade)(r.event).json(),"track"===r.event.type&&delete a.traits,"alias"===r.event.type&&(p=a,S=t.user(),p.previousId=null!=(_=null!=(v=null!=(g=p.previousId)?g:p.from)?v:S.id())?_:S.anonymousId(),p.userId=null!=(b=p.userId)?b:p.to,delete p.from,delete p.to,a=p),(s=l.getAttempts(r))>=l.maxAttempts)?(f.delete(r),u=Error("Retry attempts exhausted (".concat(s,"/").concat(l.maxAttempts,")")),r.setFailedDelivery({reason:u}),t.emit("error",{code:"delivery_failure",reason:u,ctx:r}),[2,r]):[2,w.dispatch("".concat(y,"/").concat(o),function(t,e,n,r,o){var a,s=t.user();delete e.options,e.writeKey=null==n?void 0:n.apiKey,e.userId=e.userId||s.id(),e.anonymousId=e.anonymousId||s.anonymousId(),e.sentAt=new Date;var u=t.queue.failedInitializations||[];u.length>0&&(e._metadata={failedInitializations:u}),null!=o&&(o.attempts>1&&(e._metadata=(0,i.__assign)((0,i.__assign)({},e._metadata),{retryCount:o.attempts})),o.attempts++);var c=[],l=[];for(var f in r){var d=r[f];"Segment.io"===f&&c.push(f),"bundled"===d.bundlingStatus&&c.push(f),"unbundled"===d.bundlingStatus&&l.push(f)}for(var h=0,p=(null==n?void 0:n.unbundledIntegrations)||[];h<p.length;h++){var g=p[h];l.includes(g)||l.push(g)}var v=null!=(a=null==n?void 0:n.maybeBundledConfigIds)?a:{},y=[];return c.sort().forEach(function(t){var e;
2(null!=(e=v[t])?e:[]).forEach(function(t){y.push(t)})}),(null==n?void 0:n.addBundledMetadata)!==!1&&(e._metadata=(0,i.__assign)((0,i.__assign)({},e._metadata),{bundled:c.sort(),unbundled:l.sort(),bundledIds:y})),e}(t,a,e,n,r),s).then(function(){return r}).catch(function(e){var n;if(r.log("error","Error sending event",e),"RateLimitError"===e.name){var i=(null!=(n=d.get(r))?n:0)+1;if(d.set(r,i),i>m.rateLimitConfig.maxRetryCount)r.setFailedDelivery({reason:e}),t.emit("error",{code:"delivery_failure",reason:e,ctx:r});else{var o=e.retryTimeout;l.pushWithDelay(r,o)}}else"NonRetryableError"===e.name?(r.setFailedDelivery({reason:e}),t.emit("error",{code:"delivery_failure",reason:e,ctx:r})):l.pushWithBackoff(r);return tP(!1,l,A,tP),r}).finally(function(){f.delete(r)})]})})}var A={metadata:{writeKey:c,apiHost:g,protocol:v},name:"Segment.io",type:"destination",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:S,identify:S,page:S,alias:S,group:S,screen:S};return l.todo&&tP(!1,l,A,tP),A}(o,C["Segment.io"],n.integrations)];case 13:O.apply(P,[T.sent()]),T.label=14;case 14:return[4,o.register.apply(o,(0,i.__spreadArray)((0,i.__spreadArray)([],E,!1),y,!1))];case 15:return x=T.sent(),[4,(0,i.__awaiter)(void 0,void 0,void 0,function(){var t,e;return(0,i.__generator)(this,function(n){switch(n.label){case 0:t=0,e=f.getAndRemove("register"),n.label=1;case 1:if(!(t<e.length))return[3,4];return[4,tp(o,e[t]).catch(console.error)];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[2]}})})];case 16:if(T.sent(),!Object.entries(null!=(v=n.enabledMiddleware)?v:{}).some(function(t){return t[1]}))return[3,18];return[4,t.A(414800).then(function(t){var e=t.remoteMiddlewares;return(0,i.__awaiter)(M,void 0,void 0,function(){return(0,i.__generator)(this,function(t){switch(t.label){case 0:return[4,e(x,n,u.obfuscate)];case 1:return[2,Promise.all(t.sent().map(function(t){return o.addSourceMiddleware(t)}))]}})})})];case 17:T.sent(),T.label=18;case 18:return[4,(0,i.__awaiter)(void 0,void 0,void 0,function(){var t,e;return(0,i.__generator)(this,function(n){switch(n.label){case 0:t=0,e=f.getAndRemove("addSourceMiddleware"),n.label=1;case 1:if(!(t<e.length))return[3,4];return[4,tp(o,e[t]).catch(console.error)];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[2]}})})];case 19:return T.sent(),[2,x]}})})}(e.writeKey,w,k,n,C,I,o)];case 6:return P=O.sent(),k.initialized=!0,k.emit("initialize",e,n),[4,function(t,e,n){return(0,i.__awaiter)(this,void 0,void 0,function(){return(0,i.__generator)(this,function(r){switch(r.label){case 0:var o,a;return[4,(o=t,a=e,(0,i.__awaiter)(void 0,void 0,void 0,function(){return(0,i.__generator)(this,function(t){switch(t.label){case 0:if(!a.includes("ajs_"))return[3,2];return[4,o.queryString(a).catch(console.error)];case 1:t.sent(),t.label=2;case 2:return[2]}})}))];case 1:return r.sent(),tc(t,n),[2]}})})}(k,m,o)];case 7:return O.sent(),[2,[k,P]]}})})}(n[0],n[1],e)})})||this)._resolveLoadStart=function(t,e){return c([t,e])},n}return(0,i.__extends)(n,e),n.prototype.load=function(t,e){return void 0===e&&(e={}),this._resolveLoadStart(t,e),this},n.load=function(t,e){return void 0===e&&(e={}),new n().load(t,e)},n.standalone=function(t,e){return n.load({writeKey:t},e).then(function(t){return t[0]})},n}(tg);t.s(["AnalyticsBrowser",0,tY],222979)},845955,t=>{"use strict";t.s(["gracefulDecodeURIComponent",0,function(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}}])},661196,t=>{"use strict";var e=t.i(522099),n=t.i(854201),r=t.i(515300),i=t.i(644071),o=n.default?n.default.isConcatSpreadable:void 0;let a=function(t){return(0,i.default)(t)||(0,r.default)(t)||!!(o&&t&&t[o])};t.s(["default",0,function t(n,r,i,o,s){var u=-1,c=n.length;for(i||(i=a),s||(s=[]);++u<c;){var l=n[u];r>0&&i(l)?r>1?t(l,r-1,i,o,s):(0,e.default)(s,l):o||(s[s.length]=l)}return s}],661196)},398545,t=>{"use strict";var e=t.i(369104),n=t.i(441338);t.s(["default",0,function(t,r){var i=-1,o=(0,n.default)(t)?Array(t.length):[];return(0,e.default)(t,function(t,e,n){o[++i]=r(t,e,n)}),o}])},930892,790947,t=>{"use strict";let e=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)};var n,r,i=Math.max;t.s(["default",0,function(t,n,r){return n=i(void 0===n?t.length-1:n,0),function(){for(var o=arguments,a=-1,s=i(o.length-n,0),u=Array(s);++a<s;)u[a]=o[n+a];a=-1;for(var c=Array(n+1);++a<n;)c[a]=o[a];return c[n]=r(u),e(t,this,c)}}],930892);var o=t.i(126200),a=t.i(910022),s=o.default?function(t,e){return(0,o.default)(t,"toString",{configurable:!0,enumerable:!1,value:function(){return e},writable:!0})}:a.default,u=Date.now,c=(n=0,r=0,function(){var t=u(),e=16-(t-r);if(r=t,e>0){if(++n>=800)return arguments[0]}else n=0;return s.apply(void 0,arguments)});t.s(["default",0,c],790947)},452587,885309,790104,t=>{"use strict";var e=t.i(661196),n=t.i(982735),r=t.i(426881),i=t.i(450266),o=t.i(398545);let a=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t};var s=t.i(894228),u=t.i(316827);let c=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=(0,u.default)(t),a=void 0!==e,s=null===e,c=e==e,l=(0,u.default)(e);if(!s&&!l&&!o&&t>e||o&&a&&c&&!s&&!l||r&&a&&c||!n&&c||!i)return 1;
2if(!r&&!o&&!l&&t<e||l&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!c)return -1}return 0},l=function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var u=c(i[r],o[r]);if(u){if(r>=s)return u;return u*("desc"==n[r]?-1:1)}}return t.index-e.index};var f=t.i(910022),d=t.i(644071);let h=function(t,e,u){e=e.length?(0,n.default)(e,function(t){return(0,d.default)(t)?function(e){return(0,r.default)(e,1===t.length?t[0]:t)}:t}):[f.default];var c=-1;return e=(0,n.default)(e,(0,s.default)(i.default)),a((0,o.default)(t,function(t,r,i){return{criteria:(0,n.default)(e,function(e){return e(t)}),index:++c,value:t}}),function(t,e){return l(t,e,u)})};t.s(["default",0,h],885309);var p=t.i(930892),g=t.i(790947);let v=function(t,e){return(0,g.default)((0,p.default)(t,e,f.default),t+"")};t.s(["default",0,v],790104);var y=t.i(327925),_=v(function(t,n){if(null==t)return[];var r=n.length;return r>1&&(0,y.default)(t,n[0],n[1])?n=[]:r>2&&(0,y.default)(n[0],n[1],n[2])&&(n=[n[0]]),h(t,(0,e.default)(n,1),[])});t.s(["sortBy",0,_],452587)},618566,(t,e,n)=>{e.exports=t.r(976562)},290571,t=>{"use strict";var e=t.i(108487);t.i(500075);var n=function(t,r){return(n=Object.setPrototypeOf||(0,e._)({__proto__:[]},Array)&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,r)},r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError,t.s(["__assign",()=>r,"__awaiter",0,function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function s(t){try{c(i.next(t))}catch(t){a(t)}}function u(t){try{c(i.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):(n=t.value,(0,e._)(n,r)?n:new r(function(t){t(n)})).then(s,u)}c((i=i.apply(t,n||[])).next())})},"__extends",0,function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},"__generator",0,function(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){var c=[s,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},"__rest",0,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},"__spreadArray",0,function(t,e,n){if(n||2==arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},"__values",0,function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}])},470167,t=>{"use strict";var e={dev:{apiKey:"AIzaSyAnFRns4FcF7AWUdigdebOTvdyM-T9Wz1I",authDomain:"dev-sporfie.firebaseapp.com",databaseURL:"https://dev-sp
2orfie.firebaseio.com",projectId:"dev-sporfie",storageBucket:"dev-sporfie.appspot.com",messagingSenderId:"992152366994",appId:"1:992152366994:web:03bdb8338b92544c271b4b",measurementId:"G-5NR461N7WT"},prod:{apiKey:"AIzaSyAn7_qLXPaHjPpIJEo8PrTpi_sSBpS7DMU",authDomain:"production-sporfie.firebaseapp.com",databaseURL:"https://production-sporfie.firebaseio.com",projectId:"production-sporfie",storageBucket:"production-sporfie.appspot.com",messagingSenderId:"309240856783",appId:"1:309240856783:web:e52c6441796bbfbcb977ba",measurementId:"G-6HJ0ZPHMBJ"}};e.local=e.dev;let n=e.prod;t.s(["default",0,n])},361308,t=>{"use strict";t.s(["AnalyticsContext",()=>f,"AnalyticsContextProvider",()=>h]);var e=t.i(991865),n=t.i(651682),r=t.i(500075),i=t.i(513935),o=t.i(843476),a=t.i(271645),s=t.i(222979),u=t.i(618566),c=t.i(46121),l=t.i(890533),f=(0,a.createContext)(void 0),d="AcIOGZyns00hI2LjZKfaXz8jaBVKTgC4",h=function(t){var h=(0,n._)((0,a.useState)(),2),p=h[0],g=h[1],v=(0,u.usePathname)(),y=(0,c.default)().isLoggedIn,_=(0,l.default)(),m=_.consent,b=_.hasConsent;return(0,a.useEffect)(function(){(0,e._)(function(){return(0,i._)(this,function(t){switch(t.label){case 0:if(!(d&&y&&b&&("all"===m||(void 0===m?"undefined":(0,r._)(m))==="object"&&null!=m&&m.analytics)))return[3,3];if(p)return[3,2];return[4,s.AnalyticsBrowser.load({writeKey:d})];case 1:g(n._.apply(void 0,[t.sent(),1])[0]),t.label=2;case 2:return[3,4];case 3:p&&console.log("Analytics consent not granted or revoked. Analytics not initialized or stopped."),g(void 0),t.label=4;case 4:return[2]}})})()},[y,m,b]),(0,a.useEffect)(function(){p&&v&&p.page(v)},[p,v]),(0,o.jsx)(f.Provider,{value:p,children:t.children})}},35249,t=>{"use strict";t.s(["AuthContextProvider",()=>C,"useAuth",()=>A,"useOptionalAuth",()=>k]);var e=t.i(991865),n=t.i(108487),r=t.i(120786),i=t.i(92808),o=t.i(513935),a=t.i(843476),s=t.i(271645),u=t.i(807578),c=t.i(986661),l=t.i(501562),f=t.i(846696),d=t.i(117595),h=t.i(912527),p=t.i(361308),g=t.i(639372),v=t.i(412290),y=t.i(685661),_=t.i(83501),m=t.i(398486),b=t.i(912598),w=t.i(470167),S=(0,s.createContext)(void 0);function A(){var t=(0,s.useContext)(S);if(!t)throw Error("useAuth must be used within AuthContextProvider");return t}function k(){var t;return null!=(t=(0,s.useContext)(S))?t:null}var C=function(t){var A=t.children,k=(0,s.useContext)(p.AnalyticsContext),C=(0,g.getDefaultStore)(),I=(0,b.useQueryClient)(),E=function(t){C.set(v.authStateAtom,t)},P=function(t){C.set(v.authUserAtom,t)},O=function(t){C.set(v.authUserProfileAtom,t?(0,_.normalizeCurrentUserProfile)(t):null)},x=function(t){C.set(v.authIdTokenAtom,t)},M=function(t){C.set(v.authErrorAtom,t)},j=function(){return(0,e._)(function(){var t,e,a,s,f,d,h,p,g,b;return(0,o._)(this,function(o){switch(o.label){case 0:E(m.AuthState.fetchingIdToken),o.label=1;case 1:if(o.trys.push([1,3,,9]),!(t=C.get(v.authUserAtom)))throw Error("MISSING_USER");return[4,t.getIdToken()];case 2:return e=o.sent(),(0,u.setAuthToken)(e),x(e),(0,c.rememberSsoLogoutBaseline)((0,u.getSsoLogoutAt)()),[3,9];case 3:console.error("Error in getIdToken:",a=o.sent()),o.label=4;case 4:return o.trys.push([4,7,,8]),[4,(0,y.getFirebaseAuthBundle)()];case 5:return f=(s=o.sent()).auth,[4,(0,s.signOut)(f)];case 6:case 7:return o.sent(),[3,8];case 8:return M((0,n._)(a,Error)?a:String(a)),E(m.AuthState.signedOut),[2];case 9:E(m.AuthState.fetchingUserProfile),o.label=10;case 10:o.trys.push([10,17,,18]),p=0,o.label=11;case 11:if(!(p<3))return[3,16];o.label=12;case 12:return o.trys.push([12,14,,15]),[4,I.fetchQuery((0,i._)((0,r._)({},(0,_.currentUserProfileQueryOptions)()),{staleTime:6e4*(0===p)}))];case 13:return d=o.sent(),h=void 0,[3,16];case 14:if(h=g=o.sent(),!(0,l.isQueryCancelledError)(g))throw g;return[3,15];case 15:return p++,[3,11];case 16:if(!d)throw null!=h?h:Error("MISSING_USER_PROFILE");return null==k||k.identify(d),O(d),E(m.AuthState.signedIn),[3,18];case 17:if(console.error("Error in getUserProfile:",b=o.sent()),(0,l.isQueryCancelledError)(b)&&C.get(v.authUserAtom))return[2];return M((0,n._)(b,Error)?b:String(b)),E(m.AuthState.signedOut),[3,18];case 18:return[2]}})})()},T=function(){I.removeQueries({queryKey:_.currentUserProfileQueryKey}),I.removeQueries({queryKey:["user-purchases"]}
2),I.removeQueries({queryKey:["user-subscriptions"]}),I.removeQueries({queryKey:["user-integrations"]}),I.removeQueries({queryKey:["circles"]}),I.removeQueries({queryKey:["followedCircles"]})},R=function(){T(),P(null),O(null),x(null),E(m.AuthState.signedOut)},L=function(){var t=C.get(v.authStateAtom);return t===m.AuthState.signingIn||t===m.AuthState.signingInWithCustomToken||t===m.AuthState.fetchingIdToken||t===m.AuthState.fetchingUserProfile},U=function(t){return(0,e._)(function(){var e,n,r,i,a;return(0,o._)(this,function(o){switch(o.label){case 0:if(L()||!(e=(0,u.getSsoLogoutAt)()))return[2,!1];o.label=1;case 1:return o.trys.push([1,5,,6]),[4,t.getIdTokenResult()];case 2:if(n=new Date(o.sent().authTime).getTime(),!(0,c.shouldInvalidateSessionForSsoLogout)({logoutAtMs:e,authTimeMs:n,baselineLogoutAtMs:(0,c.readSsoLogoutBaseline)()}))return[2,!1];return[4,(0,y.getFirebaseAuthBundle)()];case 3:return i=(r=o.sent()).auth,a=r.signOut,(0,u.setAuthToken)(void 0),[4,a(i)];case 4:return o.sent(),[2,!0];case 5:return console.error("Error checking cross-subdomain logout:",o.sent()),[2,!1];case 6:return[2]}})})()},N=(0,s.useMemo)(function(){return{login:function(t,r){return(0,e._)(function(){var e,i,a;return(0,o._)(this,function(o){switch(o.label){case 0:E(m.AuthState.signingIn),M(null),o.label=1;case 1:return o.trys.push([1,5,,6]),[4,(0,y.getFirebaseAuthBundle)()];case 2:return i=(e=o.sent()).auth,[4,(0,e.signInWithEmailAndPassword)(i,t,r)];case 3:return P(o.sent().user),[4,j()];case 4:return o.sent(),[3,6];case 5:return console.error("Error in signInWithEmailAndPassword:",a=o.sent()),M((0,n._)(a,Error)?a:String(a)),E(m.AuthState.signedOut),[3,6];case 6:return[2]}})})()},loginWithCustomToken:function(t){return(0,e._)(function(){var e,r,i;return(0,o._)(this,function(o){switch(o.label){case 0:E(m.AuthState.signingInWithCustomToken),o.label=1;case 1:return o.trys.push([1,5,,6]),[4,(0,y.getFirebaseAuthBundle)()];case 2:return r=(e=o.sent()).auth,[4,(0,e.signInWithCustomToken)(r,t)];case 3:return P(o.sent().user),M(null),[4,j()];case 4:return o.sent(),[3,6];case 5:return console.error("Error in signInWithCustomToken:",i=o.sent()),M((0,n._)(i,Error)?i:String(i)),E(m.AuthState.signedOut),[3,6];case 6:return[2]}})})()},logout:function(){return(0,e._)(function(){var t,e,n;return(0,o._)(this,function(r){switch(r.label){case 0:E(m.AuthState.signingOut),r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,(0,y.getFirebaseAuthBundle)()];case 2:return e=(t=r.sent()).auth,n=t.signOut,(0,u.setAuthToken)(void 0),(0,u.markSsoLogout)(),(0,c.rememberSsoLogoutBaseline)((0,u.getSsoLogoutAt)()),[4,n(e)];case 3:return r.sent(),[3,6];case 4:return console.error("Error in signOut:",r.sent()),[3,6];case 5:return(0,f.toast)("You are now signed out"),T(),P(null),O(null),x(null),E(m.AuthState.signedOut),[7];case 6:return[2]}})})()},checkAuthStatus:function(){return(0,e._)(function(){var t,n,r;return(0,o._)(this,function(i){switch(i.label){case 0:(t=C.get(v.authStateAtom))===m.AuthState.initial&&E(m.AuthState.checkingAuthStatus),i.label=1;case 1:return i.trys.push([1,9,,10]),[4,(0,y.getFirebaseAuthBundle)()];case 2:var a;return[4,(a=i.sent().auth,(0,e._)(function(){var t;return(0,o._)(this,function(e){switch(e.label){case 0:if("function"!=typeof(t=a).authStateReady)return[3,2];return[4,t.authStateReady()];case 1:return e.sent(),[2,a.currentUser];case 2:return[2,new Promise(function(t){var e=window.setTimeout(function(){n(),t(a.currentUser)},1500),n=a.onIdTokenChanged(function(r){r&&(window.clearTimeout(e),n(),t(r))},function(){window.clearTimeout(e),n(),t(a.currentUser)})})]}})})())];case 3:if(n=i.sent(),!(r=t===m.AuthState.initial&&n))return[3,5];return[4,U(n)];case 4:r=i.sent(),i.label=5;case 5:if(r&&(n=null),n)return[3,7];return[4,(0,e._)(function(){var t,e,n,r,i,a;return(0,o._)(this,function(o){switch(o.label){case 0:if(!(t=d.default.get(h.ID_TOKEN))||(e=function(t){try{var e=t.split(".")[1];if(!e)return null;var n=e.replace(/-/g,"+").replace(/_/g,"/"),r=atob(n.padEnd(4*Math.ceil(n.length/4),"=")),i=JSON.parse(r);return"string"==typeof i.aud?i.aud:null}catch(t){return null}}(t))&&e!==w.default.projectId)return[2,null];o.label=1;case 1:return o.trys.push([1,6,,7]),[4,fetch("/api/auth/custom-token",{method:"POST",headers:{"x-auth-token":t}})];case 2:if(!(n=o.sent()).ok)return 401===n.status&&(0,u.setAuthToken)(void 0),[2,null];return[4,n.json()];case 3:if(!(r=o.sent()).customToken)return[2,null];return[4,(0,y.getFirebaseAuthBundle)()];case 4:return a=(i=o.sent()).auth,[4,(0,i.signInWithCustomToken)(a,r.customToken)];case 5:return[2,o.sent().user];case 6:return console.error("Error bootstrapping auth from shared cookie:",o.sent()),[2,null];case 7:return[2]}})})()];case 6:n=i.sent(),i.label=7;case 7:if(!n)throw Error("NO_USER");return P(n),t!==m.AuthState.initial&&E(m.AuthState.fetchingIdToken),[4,j()];case 8:return i.sent(),[3,10];case 9:return i.sent(),P(null),O(null),x(null),E(m.AuthState.signedOut),[3,10];case 10:return[2]}})})()},refreshToken:function(){return(0,e._)(function(){var t,e,r;return(0,o._)(this,function(i){switch(i.label){case 0:if(!(t=C.get(v.authUserAtom)))return E(m.AuthState.signedOut),[2];return[4,U(t)];case 1:if(i.sent())return R(),[2];E(m.AuthState.refreshingIdToken),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,t.getIdToken()];case 3:return e=i.sent(),(0,u.setAuthToken)(e),x(e),E(m.AuthState.signedIn),[3,5];case 4:return console.error("Error in refreshing token:",r=i.sent()),M((0,n._)(r,Error)?r:String(r)),E(m.AuthState.signedOut),[3,5];case 5:return[2]}})})()},refreshUserProfile:function(){return(0,e._)(function(){var t,e;return(0,o._)(this,function(r){switch(r.label){case 0:E(m.AuthState.fetchingUserProfile),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,I.invalidateQueries({queryKey:_.currentUserProfileQueryKey})];case 2:return r.sent(),[4,I.fetchQuery((0,_.currentUserProfileQueryOptions)())];case 3:return t=r.sent(),null==k||k.identify(t),O(t),E(m.AuthState.signedIn),[3,5];case 4:if(console.error("Error in getUserProfile:",e=r.sent()),(0,l.isQueryCancelledError)(e)&&C.get(v.authUserAtom))return[2];return M((0,n._)(e,Error)?e:String(e)),E(m.AuthState.signedOut),[3,5];case 5:return[2]}})})()}}},[k,I]);return(0,s.useEffect)(function(){navigator.onLine&&N.checkAuthStatus(),(0,u.setAuthRefreshToken)(N.refreshToken);var t,n=!1,r=function(){if(!("visible"!==document.visibilityState||L())
2){var t=C.get(v.authUserAtom);t&&U(t).then(function(t){t&&R()})}};return(0,e._)(function(){var r;return(0,o._)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(0,y.getFirebaseAuthBundle)()];case 1:if(r=i.sent().auth,n)return[2];return t=r.onIdTokenChanged(function(t){return(0,e._)(function(){return(0,o._)(this,function(n){switch(n.label){case 0:if(!t)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(0,e._)(function(){var e;return(0,o._)(this,function(n){switch(n.label){case 0:return[4,U(t)];case 1:if(n.sent())return R(),[2];return[4,t.getIdToken()];case 2:return e=n.sent(),(0,u.setAuthToken)(e),x(e),[2]}})})()];case 2:return n.sent(),[3,4];case 3:return console.error("Error syncing refreshed ID token to cookie:",n.sent()),[3,4];case 4:return[2]}})})()}),[3,3];case 2:return console.error("Error attaching ID token listener:",i.sent()),[3,3];case 3:return[2]}})})(),document.addEventListener("visibilitychange",r),function(){n=!0,null==t||t(),document.removeEventListener("visibilitychange",r)}},[N]),(0,a.jsx)(S.Provider,{value:N,children:A})}},890533,t=>{"use strict";var e=t.i(651682),n=t.i(271645),r=t.i(117595),i="cookieConsent";t.s(["default",0,function(){var t=(0,e._)((0,n.useState)(null),2),o=t[0],a=t[1],s=(0,e._)((0,n.useState)(!1),2),u=s[0],c=s[1];return(0,n.useEffect)(function(){var t=r.default.get(i);if(t){try{a(JSON.parse(t))}catch(e){a(t)}c(!0)}else c(!1)},[]),{consent:o,hasConsent:u,setConsent:(0,n.useCallback)(function(t){a(t),c(!0),"string"==typeof t?r.default.set(i,t,{expires:365}):r.default.set(i,JSON.stringify(t),{expires:365})},[])}}])},46121,t=>{"use strict";t.s(["default",()=>v]);var e=t.i(991865),n=t.i(513935),r=t.i(271645),i=t.i(35249),o=t.i(639372),a=t.i(672464),s=t.i(412290),u=t.i(760095),c=t.i(812319),l=t.i(615308),f=t.i(452587),d=t.i(83501),h=(0,o.getDefaultStore)(),p=[{key:"red",value:"Red"},{key:"blue",value:"Blue"},{key:"green",value:"Green"}],g={login:function(){return(0,e._)(function(){return(0,n._)(this,function(t){return[2]})})()},loginWithCustomToken:function(){return(0,e._)(function(){return(0,n._)(this,function(t){return[2]})})()},logout:function(){return(0,e._)(function(){return(0,n._)(this,function(t){return[2]})})()},checkAuthStatus:function(){return(0,e._)(function(){return(0,n._)(this,function(t){return[2]})})()},refreshToken:function(){return(0,e._)(function(){return(0,n._)(this,function(t){return[2]})})()},refreshUserProfile:function(){return(0,e._)(function(){return(0,n._)(this,function(t){return[2]})})()}};let v=function(){var t,e,n,o,v,y=null!=(t=(0,i.useOptionalAuth)())?t:g,_=(0,a.useAtomValue)(s.authIsLoggedInAtom,{store:h}),m=(0,a.useAtomValue)(s.authIsGuestAtom,{store:h}),b=(0,a.useAtomValue)(s.authUserProfileAtom,{store:h}),w=(0,r.useMemo)(function(){return b?(0,d.normalizeCurrentUserProfile)(b):null},[b]),S=(0,a.useAtomValue)(s.authUserAtom,{store:h}),A=(0,a.useAtomValue)(s.authDidCheckAtom,{store:h}),k=(0,r.useMemo)(function(){return w&&(0,u.default)(w.avatarURL)},[null==w?void 0:w.avatarURL]),C=y.logout,I=y.refreshUserProfile,E=y.checkAuthStatus,P=y.loginWithCustomToken,O=null==w||null==(e=w.userClaimRoles)?void 0:e.includes("admin"),x=O||(null==w||null==(n=w.userClaimRoles)?void 0:n.includes("ops")),M=null==w||null==(o=w.userClaimRoles)?void 0:o.includes("pinCodeBypass"),j=null==w||null==(v=w.userClaimRoles)?void 0:v.includes("developer"),T=(0,r.useMemo)(function(){return(0,l.isEmpty)(null==w?void 0:w.customTags)?p:(0,f.sortBy)((0,c.filter)(w.customTags,function(t){return"custom"!==t.key}),"key")},[w]),R=function(t,e){if(!t||!(null==w?void 0:w.companies))return!1;var n,r=w.companies.find(function(e){return e.key===t});if(!r)return!1;var i=null==(n=r.members)?void 0:n.find(function(t){return t.userID===w.id});return"owner"===e?r.ownerID===w.userID:(null==i?void 0:i.role)===e},L=function(t){return!!x||!!t&&(R(t,"owner")||R(t,"admin"))};return{isGuest:m,isLoggedIn:_,userProfile:w,avatarURL:k,user:S,logOut:C,isSporfieAdmin:O,isAtLeastSporfieOps:x,isDeveloper:j,canBypassPincode:M,didCheckAuthStatus:A,refreshUserProfile:I,checkAuthStatus:E,loginWithCustomToken:P,canManageCompany:L,canManageScope:function(t){var e;return!!O||!!t&&!!(null==w||null==(e=w.companies)?void 0:e.some(function(e){return e.key===t}))},canManagePhotos:function(t){return!!O||!!t&&(L(t)||R(t,"photo_manager"))},hasRoleWithinCompany:R,availableTags:T}}},760095,t=>{"use strict";var e=t.i(651682);t.s(["default",0,function(t){if(!t)return"";if(!t.startsWith("gs://"))return t;var n=(0,e._)(/gs:\/\/([^/]*)\/(.*)/.exec(t),3),r=(n[0],n[1]),i=n[2];return"https://".concat("firebasestorage.googleapis.com","/v0/b/").concat(r,"/o/").concat(encodeURIComponent(i),"?alt=media")}
2])},685661,t=>{"use strict";var e=t.i(991865),n=t.i(651682),r=t.i(513935),i=null;t.s(["getFirebaseAuthBundle",0,function(){return(0,e._)(function(){return(0,r._)(this,function(o){return i||(i=(0,e._)(function(){var e,i,o,a,s,u,c,l,f;return(0,r._)(this,function(r){switch(r.label){case 0:return[4,Promise.all([t.A(128515),t.A(403975),t.A(256491)])];case 1:return o=(i=(e=n._.apply(void 0,[r.sent(),3]))[0]).getApp,a=i.getApps,s=i.initializeApp,u=e[1],c=e[2],l=a().length?o():s(c.default),f=u.getAuth(l),[4,u.setPersistence(f,u.browserLocalPersistence).catch(function(t){console.error("Auth persistence error:",t)})];case 2:return r.sent(),[2,{auth:f,signInWithEmailAndPassword:u.signInWithEmailAndPassword,signOut:u.signOut,signInWithCustomToken:u.signInWithCustomToken,signInWithPopup:u.signInWithPopup,GoogleAuthProvider:u.GoogleAuthProvider}]}})})()),[2,i]})})()}])},986661,501562,t=>{"use strict";var e=t.i(912527),n="".concat(e.SSO_LOGOUT_AT,"_baseline");t.s(["readSsoLogoutBaseline",0,function(){try{var t=window.localStorage.getItem(n);if(null===t)return;if(""===t)return null;var e=Number(t);return Number.isFinite(e)?e:void 0}catch(t){return}},"rememberSsoLogoutBaseline",0,function(t){try{window.localStorage.setItem(n,null==t?"":String(t))}catch(t){}},"shouldInvalidateSessionForSsoLogout",0,function(t){var e=t.logoutAtMs,n=t.authTimeMs,r=t.baselineLogoutAtMs;return null!=e&&(void 0!==r?e!==r:e>n)}],986661);var r=t.i(500075);t.s(["isQueryCancelledError",0,function(t){return!!t&&(void 0===t?"undefined":(0,r._)(t))==="object"&&"CancelledError"===t.message}],501562)},83501,t=>{"use strict";var e=t.i(991865);t.i(120786),t.i(92808);var n=t.i(500075),r=t.i(513935);t.i(266027);var i=t.i(427945),o=["current-user-profile"],a=function(t){return t&&(void 0===t?"undefined":(0,n._)(t))==="object"&&"data"in t&&t.data?t.data:t};function s(){return(0,e._)(function(){return(0,r._)(this,function(t){switch(t.label){case 0:return[4,i.default.get("/user/profile")];case 1:return[2,a(t.sent())]}})})()}var u=function(t,e,n){return i.default.put("/users/".concat(t).concat(n?"?applyDefaultPinCodes=true":""),e)};t.s(["addToMyEvents",0,function(t,e){return i.default.put("/users/".concat(t,"/events/").concat(e),{add:!0})},"currentUserProfileQueryKey",0,o,"currentUserProfileQueryOptions",0,function(){return{queryKey:o,queryFn:s,staleTime:6e4}},"deleteAccount",0,function(){return i.default.delete("/user")},"normalizeCurrentUserProfile",0,a,"removeFromMyEvents",0,function(t,e){return i.default.delete("/users/".concat(t,"/events/").concat(e))},"update",0,u,"updateCoachLogicPreferences",0,function(t,e){return i.default.put("/users/".concat(t),{coachLogic:e})},"updateUserBalltimePreferences",0,function(t,e){return u(t,{balltime:e},!1)},"updateUserPBVisionPreferences",0,function(t,e){return u(t,{pbVision:e},!1)},"updateUserProfile",0,function(t){return(0,e._)(function(){return(0,r._)(this,function(e){switch(e.label){case 0:return[4,i.default.put("/user/profile",t)];case 1:return[2,e.sent().data]}})})()}])}]);
3
4//# debugId=3a02ac45-2b13-b7ec-79dd-045d889c021a

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.