!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="34cc8c50-0a80-4e7f-9fd6-c34d2973da31",e._sentryDebugIdIdentifier="sentry-dbid-34cc8c50-0a80-4e7f-9fd6-c34d2973da31")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{69004:function(e,t,n){"use strict";var r=n(1567);Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastChannel=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nextauth.message";return{receive:function(t){var n=function(n){if(n.key===e){var r,i=JSON.parse(null!==(r=n.newValue)&&void 0!==r?r:"{}");(null==i?void 0:i.event)==="session"&&null!=i&&i.data&&t(i)}};return window.addEventListener("storage",n),function(){return window.removeEventListener("storage",n)}},post:function(t){if("undefined"!=typeof window)try{localStorage.setItem(e,JSON.stringify(l(l({},t),{},{timestamp:d()})))}catch(e){}}}},t.apiBaseUrl=c,t.fetchData=function(e,t,n){return u.apply(this,arguments)},t.now=d;var i=r(n(59268)),s=r(n(88544)),o=r(n(52881));function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){(0,s.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(){return(u=(0,o.default)(i.default.mark(function e(t,n,r){var s,o,a,u,d,h,f,p,m,g=arguments;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=(s=g.length>3&&void 0!==g[3]?g[3]:{}).ctx,u=void 0===(a=s.req)?null==o?void 0:o.req:a,d="".concat(c(n),"/").concat(t),e.prev=2,f={headers:l({"Content-Type":"application/json"},null!=u&&null!==(h=u.headers)&&void 0!==h&&h.cookie?{cookie:u.headers.cookie}:{})},null!=u&&u.body&&(f.body=JSON.stringify(u.body),f.method="POST"),e.next=7,fetch(d,f);case 7:return p=e.sent,e.next=10,p.json();case 10:if(m=e.sent,p.ok){e.next=13;break}throw m;case 13:return e.abrupt("return",Object.keys(m).length>0?m:null);case 16:return e.prev=16,e.t0=e.catch(2),r.error("CLIENT_FETCH_ERROR",{error:e.t0,url:d}),e.abrupt("return",null);case 20:case"end":return e.stop()}},e,null,[[2,16]])}))).apply(this,arguments)}function c(e){return"undefined"==typeof window?"".concat(e.baseUrlServer).concat(e.basePathServer):e.basePath}function d(){return Math.floor(Date.now()/1e3)}},26701:function(e,t,n){"use strict";var r=n(1567);Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedStrategy=t.UnknownError=t.OAuthCallbackError=t.MissingSecret=t.MissingAuthorize=t.MissingAdapterMethods=t.MissingAdapter=t.MissingAPIRoute=t.InvalidCallbackUrl=t.AccountNotLinkedError=void 0,t.adapterErrorHandler=function(e,t){if(e)return Object.keys(e).reduce(function(n,r){return n[r]=(0,s.default)(i.default.mark(function n(){var s,o,a,l,u,c=arguments;return i.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:for(n.prev=0,o=Array(s=c.length),a=0;a<s;a++)o[a]=c[a];return t.debug("adapter_".concat(r),{args:o}),l=e[r],n.next=6,l.apply(void 0,o);case 6:return n.abrupt("return",n.sent);case 9:throw n.prev=9,n.t0=n.catch(0),t.error("adapter_error_".concat(r),n.t0),(u=new m(n.t0)).name="".concat(v(r),"Error"),u;case 15:case"end":return n.stop()}},n,null,[[0,9]])})),n},{})},t.capitalize=v,t.eventsErrorHandler=function(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=(0,s.default)(i.default.mark(function n(){var s,o=arguments;return i.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,s=e[r],n.next=4,s.apply(void 0,o);case 4:return n.abrupt("return",n.sent);case 7:n.prev=7,n.t0=n.catch(0),t.error("".concat(g(r),"_EVENT_ERROR"),n.t0);case 10:case"end":return n.stop()}},n,null,[[0,7]])})),n},{})},t.upperSnake=g;var i=r(n(59268)),s=r(n(52881)),o=r(n(88544)),a=r(n(56731)),l=r(n(48013)),u=r(n(22535)),c=r(n(81593)),d=r(n(48368)),h=r(n(20112));function f(e,t,n){return t=(0,c.default)(t),(0,u.default)(e,p()?Reflect.construct(t,n||[],(0,c.default)(e).constructor):t.apply(e,n))}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var m=t.UnknownError=function(e){function t(e){var n,r;return(0,a.default)(this,t),(r=f(this,t,[null!==(n=null==e?void 0:e.message)&&void 0!==n?n:e])).name="UnknownError",r.code=e.code,e instanceof Error&&(r.stack=e.stack),r}return(0,d.default)(t,e),(0,l.default)(t,[{key:"toJSON",value:function(){return{name:this.name,message:this.message,stack:this.stack}}}])}((0,h.default)(Error));function g(e){return e.replace(/([A-Z])/g,"_$1").toUpperCase()}function v(e){return"".concat(e[0].toUpperCase()).concat(e.slice(1))}t.OAuthCallbackError=function(e){function t(){var e;(0,a.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=f(this,t,[].concat(r)),(0,o.default)(e,"name","OAuthCallbackError"),e}return(0,d.default)(t,e),(0,l.default)(t)}(m),t.AccountNotLinkedError=function(e){function t(){var e;(0,a.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=f(this,t,[].concat(r)),(0,o.default)(e,"name","AccountNotLinkedError"),e}return(0,d.default)(t,e),(0,l.default)(t)}(m),t.MissingAPIRoute=function(e){function t(){var e;(0,a.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=f(this,t,[].concat(r)),(0,o.default)(e,"name","MissingAPIRouteError"),(0,o.default)(e,"code","MISSING_NEXTAUTH_API_ROUTE_ERROR"),e}return(0,d.default)(t,e),(0,l.default)(t)}(m),t.MissingSecret=function(e){function t(){var e;(0,a.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=f(this,t,[].concat(r)),(0,o.default)(e,"name","MissingSecretError"),(0,o.default)(e,"code","NO_SECRET"),e}return(0,d.default)(t,e),(0,l.default)(t)}(m),t.MissingAuthorize=function(e){function t(){var e;(0,a.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=f(this,t,[].concat(r)),(0,o.default)(e,"name","MissingAuthorizeError"),(0,o.default)(e,"code","CALLBACK_CREDENTIALS_HANDLER_ERROR"),e}return(0,d.default)(t,e),(0,l.default)(t)}(m),t.MissingAdapter=function(e){function t(){var e;(0,a.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=f(this,t,[].concat(r)),(0,o.default)(e,"name","MissingAdapterError"),(0,o.default)(e,"code","EMAIL_REQUIRES_ADAPTER_ERROR"),e}return(0,d.default)(t,e),(0,l.default)(t)}(m),t.MissingAdapterMethods=function(e){function t(){var e;(0,a.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=f(this,t,[].concat(r)),(0,o.default)(e,"name","MissingAdapterMethodsError"),(0,o.default)(e,"code","MISSING_ADAPTER_METHODS_ERROR"),e}return(0,d.default)(t,e),(0,l.default)(t)}(m),t.UnsupportedStrategy=function(e){function t(){var e;(0,a.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=f(this,t,[].concat(r)),(0,o.default)(e,"name","UnsupportedStrategyError"),(0,o.default)(e,"code","CALLBACK_CREDENTIALS_JWT_ERROR"),e}return(0,d.default)(t,e),(0,l.default)(t)}(m),t.InvalidCallbackUrl=function(e){function t(){var e;(0,a.default)(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=f(this,t,[].concat(r)),(0,o.default)(e,"name","InvalidCallbackUrl"),(0,o.default)(e,"code","INVALID_CALLBACK_URL_ERROR"),e}return(0,d.default)(t,e),(0,l.default)(t)}(m)},71930:function(e,t,n){"use strict";var r,i,s,o,a,l=n(14224),u=n(1567),c=n(83084);Object.defineProperty(t,"__esModule",{value:!0});var d={SessionContext:!0,useSession:!0,getSession:!0,getCsrfToken:!0,getProviders:!0,signIn:!0,signOut:!0,SessionProvider:!0};t.SessionContext=void 0,t.SessionProvider=function(e){if(!C)throw Error("React Context is unavailable in Server Components");var t,n,r,i,s,o,a=e.children,l=e.basePath,u=e.refetchInterval,c=e.refetchWhenOffline;l&&(T.basePath=l);var d=void 0!==e.session;T._lastSync=d?(0,_.now)():0;var f=g.useState(function(){return d&&(T._session=e.session),e.session}),v=(0,m.default)(f,2),y=v[0],w=v[1],S=g.useState(!d),E=(0,m.default)(S,2),x=E[0],k=E[1];g.useEffect(function(){return T._getSession=(0,p.default)(h.default.mark(function e(){var t,n,r=arguments;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(r.length>0&&void 0!==r[0]?r[0]:{}).event,e.prev=1,!((n="storage"===t)||void 0===T._session)){e.next=10;break}return T._lastSync=(0,_.now)(),e.next=7,R({broadcast:!n});case 7:return T._session=e.sent,w(T._session),e.abrupt("return");case 10:if(!(!t||null===T._session||(0,_.now)()<T._lastSync)){e.next=12;break}return e.abrupt("return");case 12:return T._lastSync=(0,_.now)(),e.next=15,R();case 15:T._session=e.sent,w(T._session),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(1),I.error("CLIENT_SESSION_ERROR",e.t0);case 22:return e.prev=22,k(!1),e.finish(22);case 25:case"end":return e.stop()}},e,null,[[1,19,22,25]])})),T._getSession(),function(){T._lastSync=0,T._session=void 0,T._getSession=function(){}}},[]),g.useEffect(function(){var e=O.receive(function(){return T._getSession({event:"storage"})});return function(){return e()}},[]),g.useEffect(function(){var t=e.refetchOnWindowFocus,n=void 0===t||t,r=function(){n&&"visible"===document.visibilityState&&T._getSession({event:"visibilitychange"})};return document.addEventListener("visibilitychange",r,!1),function(){return document.removeEventListener("visibilitychange",r,!1)}},[e.refetchOnWindowFocus]);var A=(t=g.useState("undefined"!=typeof navigator&&navigator.onLine),r=(n=(0,m.default)(t,2))[0],i=n[1],s=function(){return i(!0)},o=function(){return i(!1)},g.useEffect(function(){return window.addEventListener("online",s),window.addEventListener("offline",o),function(){window.removeEventListener("online",s),window.removeEventListener("offline",o)}},[]),r),M=!1!==c||A;g.useEffect(function(){if(u&&M){var e=setInterval(function(){T._session&&T._getSession({event:"poll"})},1e3*u);return function(){return clearInterval(e)}}},[u,M]);var L=g.useMemo(function(){return{data:y,status:x?"loading":y?"authenticated":"unauthenticated",update:function(e){return(0,p.default)(h.default.mark(function t(){var n;return h.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(x||!y)){t.next=2;break}return t.abrupt("return");case 2:return k(!0),t.t0=_.fetchData,t.t1=T,t.t2=I,t.next=8,P();case 8:return t.t3=t.sent,t.t4=e,t.t5={csrfToken:t.t3,data:t.t4},t.t6={body:t.t5},t.t7={req:t.t6},t.next=15,(0,t.t0)("session",t.t1,t.t2,t.t7);case 15:return n=t.sent,k(!1),n&&(w(n),O.post({event:"session",data:{trigger:"getSession"}})),t.abrupt("return",n);case 19:case"end":return t.stop()}},t)}))()}}},[y,x]);return(0,b.jsx)(C.Provider,{value:L,children:a})},t.getCsrfToken=P,t.getProviders=L,t.getSession=R,t.signIn=function(e,t,n){return D.apply(this,arguments)},t.signOut=function(e){return $.apply(this,arguments)},t.useSession=function(e){if(!C)throw Error("React Context is unavailable in Server Components");var t=g.useContext(C),n=null!=e?e:{},r=n.required,i=n.onUnauthenticated,s=r&&"unauthenticated"===t.status;return(g.useEffect(function(){if(s){var e="/api/auth/signin?".concat(new URLSearchParams({error:"SessionRequired",callbackUrl:window.location.href}));i?i():window.location.href=e}},[s,i]),s)?{data:t.data,update:t.update,status:"loading"}:t};var h=u(n(59268)),f=u(n(88544)),p=u(n(52881)),m=u(n(78834)),g=E(n(75271)),v=E(n(59451)),y=u(n(5597)),_=n(69004),b=n(52676),w=n(75962);function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(S=function(e){return e?n:t})(e)}function E(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=c(e)&&"function"!=typeof e)return{default:e};var n=S(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&({}).hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}return r.default=e,n&&n.set(e,r),r}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach(function(t){(0,f.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Object.keys(w).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(d,e))&&(e in t&&t[e]===w[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return w[e]}}))});var T={baseUrl:(0,y.default)(null!==(r=l.env.NEXTAUTH_URL)&&void 0!==r?r:l.env.VERCEL_URL).origin,basePath:(0,y.default)(l.env.NEXTAUTH_URL).path,baseUrlServer:(0,y.default)(null!==(i=null!==(s=l.env.NEXTAUTH_URL_INTERNAL)&&void 0!==s?s:l.env.NEXTAUTH_URL)&&void 0!==i?i:l.env.VERCEL_URL).origin,basePathServer:(0,y.default)(null!==(o=l.env.NEXTAUTH_URL_INTERNAL)&&void 0!==o?o:l.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:function(){}},O=(0,_.BroadcastChannel)(),I=(0,v.proxyLogger)(v.default,T.basePath),C=t.SessionContext=null===(a=g.createContext)||void 0===a?void 0:a.call(g,void 0);function R(e){return A.apply(this,arguments)}function A(){return(A=(0,p.default)(h.default.mark(function e(t){var n,r;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.fetchData)("session",T,I,t);case 2:return r=e.sent,(null===(n=null==t?void 0:t.broadcast)||void 0===n||n)&&O.post({event:"session",data:{trigger:"getSession"}}),e.abrupt("return",r);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function P(e){return M.apply(this,arguments)}function M(){return(M=(0,p.default)(h.default.mark(function e(t){var n;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.fetchData)("csrf",T,I,t);case 2:return n=e.sent,e.abrupt("return",null==n?void 0:n.csrfToken);case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function L(){return N.apply(this,arguments)}function N(){return(N=(0,p.default)(h.default.mark(function e(){return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.fetchData)("providers",T,I);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function D(){return(D=(0,p.default)(h.default.mark(function e(t,n,r){var i,s,o,a,l,u,c,d,f,p,m,g,v,y,b,w,S;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=void 0===(s=(i=null!=n?n:{}).callbackUrl)?window.location.href:s,l=void 0===(a=i.redirect)||a,u=(0,_.apiBaseUrl)(T),e.next=4,L();case 4:if(c=e.sent){e.next=8;break}return window.location.href="".concat(u,"/error"),e.abrupt("return");case 8:if(!(!t||!(t in c))){e.next=11;break}return window.location.href="".concat(u,"/signin?").concat(new URLSearchParams({callbackUrl:o})),e.abrupt("return");case 11:return d="credentials"===c[t].type,f="email"===c[t].type,p=d||f,m="".concat(u,"/").concat(d?"callback":"signin","/").concat(t),g="".concat(m).concat(r?"?".concat(new URLSearchParams(r)):""),e.t0=fetch,e.t1=g,e.t2={"Content-Type":"application/x-www-form-urlencoded"},e.t3=URLSearchParams,e.t4=k,e.t5=k({},n),e.t6={},e.next=25,P();case 25:return e.t7=e.sent,e.t8=o,e.t9={csrfToken:e.t7,callbackUrl:e.t8,json:!0},e.t10=(0,e.t4)(e.t5,e.t6,e.t9),e.t11=new e.t3(e.t10),e.t12={method:"post",headers:e.t2,body:e.t11},e.next=33,(0,e.t0)(e.t1,e.t12);case 33:return v=e.sent,e.next=36,v.json();case 36:if(y=e.sent,!(l||!p)){e.next=42;break}return w=null!==(b=y.url)&&void 0!==b?b:o,window.location.href=w,w.includes("#")&&window.location.reload(),e.abrupt("return");case 42:if(S=new URL(y.url).searchParams.get("error"),!v.ok){e.next=46;break}return e.next=46,T._getSession({event:"storage"});case 46:return e.abrupt("return",{error:S,status:v.status,ok:v.ok,url:S?null:y.url});case 47:case"end":return e.stop()}},e)}))).apply(this,arguments)}function $(){return($=(0,p.default)(h.default.mark(function e(t){var n,r,i,s,o,a,l,u,c;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=void 0===(r=(null!=t?t:{}).callbackUrl)?window.location.href:r,s=(0,_.apiBaseUrl)(T),e.t0={"Content-Type":"application/x-www-form-urlencoded"},e.t1=URLSearchParams,e.next=6,P();case 6:return e.t2=e.sent,e.t3=i,e.t4={csrfToken:e.t2,callbackUrl:e.t3,json:!0},e.t5=new e.t1(e.t4),o={method:"post",headers:e.t0,body:e.t5},e.next=13,fetch("".concat(s,"/signout"),o);case 13:return a=e.sent,e.next=16,a.json();case 16:if(l=e.sent,O.post({event:"session",data:{trigger:"signout"}}),!(null===(n=null==t?void 0:t.redirect)||void 0===n||n)){e.next=23;break}return c=null!==(u=l.url)&&void 0!==u?u:i,window.location.href=c,c.includes("#")&&window.location.reload(),e.abrupt("return");case 23:return e.next=25,T._getSession({event:"storage"});case 25:return e.abrupt("return",l);case 26:case"end":return e.stop()}},e)}))).apply(this,arguments)}},75962:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},59451:function(e,t,n){"use strict";var r=n(1567);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.proxyLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;try{if("undefined"==typeof window)return e;var n={},r=function(e){n[e]=function(n,r){l[e](n,r),"error"===e&&(r=a(r)),r.client=!0;var s="".concat(t,"/_log"),u=new URLSearchParams(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){(0,i.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({level:e,code:n},r));return navigator.sendBeacon?navigator.sendBeacon(s,u):fetch(s,{method:"POST",body:u,keepalive:!0})}};for(var s in e)r(s);return n}catch(e){return l}},t.setLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t||(l.debug=function(){}),e.error&&(l.error=e.error),e.warn&&(l.warn=e.warn),e.debug&&(l.debug=e.debug)};var i=r(n(88544)),s=n(26701);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){var t;return e instanceof Error&&!(e instanceof s.UnknownError)?{message:e.message,stack:e.stack,name:e.name}:(null!=e&&e.error&&(e.error=a(e.error),e.message=null!==(t=e.message)&&void 0!==t?t:e.error.message),e)}var l={error:function(e,t){t=a(t),console.error("[next-auth][error][".concat(e,"]"),"\nhttps://next-auth.js.org/errors#".concat(e.toLowerCase()),t.message,t)},warn:function(e){console.warn("[next-auth][warn][".concat(e,"]"),"\nhttps://next-auth.js.org/warnings#".concat(e.toLowerCase()))},debug:function(e,t){console.log("[next-auth][debug][".concat(e,"]"),t)}};t.default=l},5597:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;let n=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e=`https://${e}`);let r=new URL(null!==(t=e)&&void 0!==t?t:n),i=("/"===r.pathname?n.pathname:r.pathname).replace(/\/$/,""),s=`${r.origin}${i}`;return{origin:r.origin,host:r.host,path:i,base:s,toString:()=>s}}},51845:function(e,t,n){"use strict";var r=n(14224),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.isEdgeRuntime=t.isBrowser=t.isWebWorker=t.isNetlify=t.isVercel=t.isVercelIntegration=t.Version=void 0;let s=i(n(65665)),o=i(n(81954)),a=i(n(75511));t.Version=n(89356).version,t.isVercelIntegration="https://axiom-vitals.com/api/v1/send?configurationId=icfg_2WTC6xdJMiTZFp3XitqhmAdt&projectId=fa7cb16a-1301-45fd-bac0-fb7d4fd7df6a&type=web-vitals",t.isVercel=r.env.NEXT_PUBLIC_VERCEL||r.env.VERCEL,t.isNetlify="true"==r.env.NETLIFY,t.isWebWorker="undefined"!=typeof self&&void 0!==globalThis.WorkerGlobalScope&&self instanceof WorkerGlobalScope,t.isBrowser="undefined"!=typeof window||t.isWebWorker,t.isEdgeRuntime=!!globalThis.EdgeRuntime;let l=new s.default;t.config=l,t.isVercelIntegration?t.config=l=new o.default:t.isNetlify&&(t.config=l=new a.default)},43130:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useLogger=void 0;let r=n(96970),i=n(31360),s=n(75271),o=n(41329);t.useLogger=function(e={}){let t=(0,r.usePathname)(),n=(0,o.useDeepCompareMemo)(()=>{var n;return Object.assign(Object.assign({},e),{args:Object.assign(Object.assign({},null!==(n=e.args)&&void 0!==n?n:{}),{path:t})})},[e,t]),a=(0,s.useMemo)(()=>new i.Logger(n),[n]);return(0,s.useEffect)(()=>()=>{a&&a.flush()},[t]),a}},22903:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.useLogger=t.withAxiomRouteHandler=t.withAxiomNextConfig=t.withAxiom=t.throttle=t.EndpointType=t.LogLevel=t.Logger=t.log=void 0;var s=n(31360);Object.defineProperty(t,"log",{enumerable:!0,get:function(){return s.log}}),Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return s.Logger}}),Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return s.LogLevel}});var o=n(91674);Object.defineProperty(t,"EndpointType",{enumerable:!0,get:function(){return o.EndpointType}}),Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return o.throttle}}),i(n(68316),t),i(n(51845),t);var a=n(45307);Object.defineProperty(t,"withAxiom",{enumerable:!0,get:function(){return a.withAxiom}}),Object.defineProperty(t,"withAxiomNextConfig",{enumerable:!0,get:function(){return a.withAxiomNextConfig}}),Object.defineProperty(t,"withAxiomRouteHandler",{enumerable:!0,get:function(){return a.withAxiomRouteHandler}}),i(n(21251),t);var l=n(43130);Object.defineProperty(t,"useLogger",{enumerable:!0,get:function(){return l.useLogger}})},31360:function(e,t,n){"use strict";var r,i,s=n(14224),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.prettyPrint=t.log=t.Logger=t.LogLevel=void 0;let a=n(51845),l=n(91674),u=a.config.getLogsEndpoint(),c=s.env.NEXT_PUBLIC_AXIOM_LOG_LEVEL||"debug";(r=i||(t.LogLevel=i={}))[r.debug=0]="debug",r[r.info=1]="info",r[r.warn=2]="warn",r[r.error=3]="error",r[r.off=100]="off";class d{constructor(e={}){this.initConfig=e,this.logEvents=[],this.throttledSendLogs=(0,l.throttle)(this.sendLogs,1e3),this.children=[],this.logLevel=i.debug,this.config={autoFlush:!0,source:"frontend-log",prettyPrint:f},this.debug=(e,t={})=>{this._log(i.debug,e,t)},this.info=(e,t={})=>{this._log(i.info,e,t)},this.warn=(e,t={})=>{this._log(i.warn,e,t)},this.error=(e,t={})=>{this._log(i.error,e,t)},this.with=e=>{let t=new d(Object.assign(Object.assign({},this.config),{args:Object.assign(Object.assign({},this.config.args),e)}));return this.children.push(t),t},this.withRequest=e=>new d(Object.assign(Object.assign({},this.config),{req:Object.assign(Object.assign({},this.config.req),e)})),this._transformEvent=(e,t,n={})=>{let r={level:i[e].toString(),message:t,_time:new Date(Date.now()).toISOString(),source:this.config.source,fields:this.config.args||{},"@app":{"next-axiom-version":a.Version}};if(n instanceof Error)r.fields=Object.assign(Object.assign({},r.fields),{message:n.message,stack:n.stack,name:n.name});else if("object"==typeof n&&null!==n&&Object.keys(n).length>0){let e=JSON.parse(JSON.stringify(n,p));r.fields=Object.assign(Object.assign({},r.fields),e)}else n&&n.length&&(r.fields=Object.assign(Object.assign({},r.fields),{args:n}));return a.config.injectPlatformMetadata(r,this.config.source),null!=this.config.req&&(r.request=this.config.req,r.platform?r.platform.route=this.config.req.path:r.vercel&&(r.vercel.route=this.config.req.path)),r},this._log=(e,t,n={})=>{if(e<this.logLevel)return;let r=this._transformEvent(e,t,n);this.logEvents.push(r),this.config.autoFlush&&this.throttledSendLogs()},this.attachResponseStatus=e=>{this.logEvents=this.logEvents.map(t=>(t.request&&(t.request.statusCode=e),t))},this.flush=()=>o(this,void 0,void 0,function*(){yield Promise.all([this.sendLogs(),...this.children.map(e=>e.flush())])}),void 0!=this.initConfig.logLevel&&this.initConfig.logLevel>=0?this.logLevel=this.initConfig.logLevel:c&&(this.logLevel=i[c]),this.config=Object.assign(Object.assign({},this.config),e)}logHttpRequest(e,t,n,r){let i=this._transformEvent(e,t,r);i.request=n,this.logEvents.push(i),this.config.autoFlush&&this.throttledSendLogs()}middleware(e){var t;let n={ip:e.ip,region:null===(t=e.geo)||void 0===t?void 0:t.region,method:e.method,host:e.nextUrl.hostname,path:e.nextUrl.pathname,scheme:e.nextUrl.protocol.split(":")[0],referer:e.headers.get("Referer"),userAgent:e.headers.get("user-agent")},r=`[${e.method}] [middleware: "middleware"] ${e.nextUrl.pathname}`;return this.logHttpRequest(i.info,r,n,{})}sendLogs(){return o(this,void 0,void 0,function*(){if(!this.logEvents.length)return;if(!a.config.isEnvVarsSet()){this.logEvents.forEach(e=>this.config.prettyPrint?this.config.prettyPrint(e):f(e)),this.logEvents=[];return}let e=JSON.stringify(this.logEvents);this.logEvents=[];let t={"Content-Type":"application/json","User-Agent":"next-axiom/v"+a.Version};a.config.token&&(t.Authorization=`Bearer ${a.config.token}`);let r={body:e,method:"POST",keepalive:!0,headers:t};function i(){return fetch(u,r).catch(console.error)}try{if("undefined"==typeof fetch)return(yield n(1158))(u,r).catch(console.error);if(!a.isBrowser||!a.isVercelIntegration||!navigator.sendBeacon)return i();try{if(!navigator.sendBeacon.bind(navigator)(u,e))return i()}catch(e){return i()}}catch(t){console.warn(`Failed to send logs to Axiom: ${t}`),this.logEvents=[...this.logEvents,JSON.parse(e)]}})}}t.Logger=d,t.log=new d({});let h={info:{terminal:"32",browser:"lightgreen"},debug:{terminal:"36",browser:"lightblue"},warn:{terminal:"33",browser:"yellow"},error:{terminal:"31",browser:"red"}};function f(e){let t=Object.keys(e.fields).length>0;if(l.isNoPrettyPrint){let n=`${e.level} - ${e.message}`;t&&(n+=" "+JSON.stringify(e.fields)),console.log(n);return}let n="",r=[e.level,e.message];a.isBrowser?(n="%c%s - %s",r=[`color: ${h[e.level].browser};`,...r]):n=`\x1b[${h[e.level].terminal}m%s\x1b[0m - %s`,t&&(n+=" %o",r.push(e.fields)),e.request&&(n+=" %o",r.push(e.request)),console.log.apply(console,[n,...r])}function p(e,t){return t instanceof Error?Object.assign(Object.assign({},t),{name:t.name,message:t.message,stack:t.stack}):t}t.prettyPrint=f},68316:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},65665:function(e,t,n){"use strict";var r=n(14224);Object.defineProperty(t,"__esModule",{value:!0});let i=n(91674),s=n(51845);class o{constructor(){this.proxyPath="/_axiom",this.shouldSendEdgeReport=!1,this.token="xaat-52407191-b905-442a-92fd-2046948fc984",this.dataset="backend",this.environment="production",this.axiomUrl=r.env.NEXT_PUBLIC_AXIOM_URL||r.env.AXIOM_URL||"https://api.axiom.co",this.region=r.env.REGION||void 0,this.customEndpoint=r.env.NEXT_PUBLIC_AXIOM_CUSTOM_ENDPOINT}isEnvVarsSet(){return!!(this.axiomUrl&&this.dataset&&this.token)||!!this.customEndpoint}getIngestURL(e){return`${this.axiomUrl}/v1/datasets/${this.dataset}/ingest`}getLogsEndpoint(){return s.isBrowser&&this.customEndpoint?this.customEndpoint:s.isBrowser?`${this.proxyPath}/logs`:this.getIngestURL(i.EndpointType.logs)}getWebVitalsEndpoint(){return s.isBrowser&&this.customEndpoint?this.customEndpoint:s.isBrowser?`${this.proxyPath}/web-vitals`:this.getIngestURL(i.EndpointType.webVitals)}wrapWebVitalsObject(e){return e.map(e=>({webVital:e,_time:new Date().getTime(),platform:{environment:this.environment,source:"web-vital"},source:"web-vital"}))}injectPlatformMetadata(e,t){let n="platform";s.isVercel&&(n="vercel"),e.source=t,e[n]={environment:this.environment,region:this.region,source:t},s.isVercel&&(e[n].region=r.env.VERCEL_REGION,e[n].deploymentId=r.env.VERCEL_DEPLOYMENT_ID,e[n].deploymentUrl="awen-gl7a7yf8a-awen-ai-s-team.vercel.app",e[n].project="www.awen.ai",e.git={commit:"4cbc739be4f0daaaa23b02c74b8b01057d55e749",repo:"awen",ref:"production"})}getHeaderOrDefault(e,t,n){return e.headers[t]?e.headers[t]:n}}t.default=o},75511:function(e,t,n){"use strict";var r=n(14224),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let s=i(n(65665)),o=r.env.SITE_ID,a=r.env.BUILD_ID,l=r.env.CONTEXT,u=r.env.DEPLOYMENT_URL,c=r.env.DEPLOYMENT_ID;class d extends s.default{wrapWebVitalsObject(e){return e.map(e=>({webVital:e,_time:new Date().getTime(),netlify:{environment:this.environment,source:"web-vital",siteId:o,buildId:a,context:l,deploymentUrl:u,deploymentId:c}}))}injectPlatformMetadata(e,t){e.netlify={environment:this.environment,region:"edge"===t?r.env.DENO_REGION:r.env.AWS_REGION,source:t,siteId:o,buildId:a,context:l,deploymentUrl:u,deploymentId:"edge"===t?r.env.DENO_DEPLOYMENT_ID:c}}}t.default=d},81954:function(e,t,n){"use strict";var r=n(14224),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let s=n(51845),o=n(91674),a=i(n(65665)),l="https://axiom-vitals.com/api/v1/send?configurationId=icfg_2WTC6xdJMiTZFp3XitqhmAdt&projectId=fa7cb16a-1301-45fd-bac0-fb7d4fd7df6a&type=web-vitals";class u extends a.default{constructor(){super(...arguments),this.provider="vercel",this.shouldSendEdgeReport=!0,this.region=r.env.VERCEL_REGION||void 0,this.environment=r.env.VERCEL_ENV||"production",this.token=void 0,this.axiomUrl=l}isEnvVarsSet(){return void 0!=l||!!this.customEndpoint}getIngestURL(e){let t=new URL(this.axiomUrl);return t.searchParams.set("type",e.toString()),t.toString()}getWebVitalsEndpoint(){return s.isBrowser&&this.customEndpoint?this.customEndpoint:`${this.proxyPath}/web-vitals`}getLogsEndpoint(){return s.isBrowser&&this.customEndpoint?this.customEndpoint:s.isBrowser?`${this.proxyPath}/logs`:this.getIngestURL(o.EndpointType.logs)}wrapWebVitalsObject(e){return{webVitals:e,environment:this.environment}}injectPlatformMetadata(e,t){e.vercel={environment:this.environment,region:this.region,source:t}}}t.default=u},91674:function(e,t,n){"use strict";var r,i,s=n(14224);Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=t.EndpointType=t.isNoPrettyPrint=void 0,t.isNoPrettyPrint="true"==s.env.AXIOM_NO_PRETTY_PRINT,(r=i||(t.EndpointType=i={})).webVitals="web-vitals",r.logs="logs",t.throttle=(e,t)=>{let n,r;return function(){let i=this,s=arguments;null==r&&(r=Date.now()),clearTimeout(n),n=setTimeout(()=>{Date.now()-r>=t&&(e.apply(i,s),r=Date.now())},Math.max(t-(Date.now()-r),0))}}},51604:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AxiomWebVitals=void 0;let i=r(n(75271)),s=n(21251);t.AxiomWebVitals=function({path:e}){return(0,s.useReportWebVitals)(e),i.default.createElement(i.default.Fragment,null)}},21251:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useReportWebVitals=t.AxiomWebVitals=void 0;let r=n(96970),i=n(86980),s=n(30614);var o=n(51604);Object.defineProperty(t,"AxiomWebVitals",{enumerable:!0,get:function(){return o.AxiomWebVitals}}),t.useReportWebVitals=function(e){let t=(0,r.usePathname)();(0,i.useReportWebVitals)(n=>(0,s.reportWebVitalsWithPath)(n,e||t))}},30614:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportWebVitalsWithPath=void 0;let r=n(51845),i=n(91674),s=r.config.getWebVitalsEndpoint(),o=(0,i.throttle)(function(){let e=JSON.stringify(r.config.wrapWebVitalsObject(a)),t={"Content-Type":"application/json","User-Agent":"next-axiom/v"+r.Version};r.config.token&&(t.Authorization=`Bearer ${r.config.token}`);let n={body:e,method:"POST",keepalive:!0,headers:t};function i(){fetch(s,n).catch(console.error)}if(r.isBrowser&&r.isVercelIntegration&&navigator.sendBeacon)try{navigator.sendBeacon.bind(navigator)(s,e)}catch(e){i()}else i();a=[]},1e3),a=[];t.reportWebVitalsWithPath=function(e,t){a.push(Object.assign({route:t},e)),r.config.isEnvVarsSet()&&o()}},45307:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.withAxiom=t.withAxiomRouteHandler=t.withAxiomNextConfig=void 0;let i=n(51845),s=n(31360),o=n(29994),a=n(91674);function l(e){return Object.assign(Object.assign({},e),{rewrites:()=>r(this,void 0,void 0,function*(){var t;let n=yield null===(t=e.rewrites)||void 0===t?void 0:t.call(e),r=i.config.getIngestURL(a.EndpointType.webVitals),o=i.config.getIngestURL(a.EndpointType.logs);if(!r&&!o){let e=new s.Logger;return e.warn("axiom: Envvars not detected. If this is production please see https://github.com/axiomhq/next-axiom for help"),e.warn("axiom: Sending Web Vitals to /dev/null"),e.warn("axiom: Sending logs to console"),n||[]}let l=[{source:`${i.config.proxyPath}/web-vitals`,destination:r,basePath:!1},{source:`${i.config.proxyPath}/logs`,destination:o,basePath:!1}];return n?Array.isArray(n)?n.concat(l):(n.afterFiles=(n.afterFiles||[]).concat(l),n):l})})}function u(e){return(t,n)=>r(this,void 0,void 0,function*(){var r,a;let l="";"geo"in t&&(l=null!==(a=null===(r=t.geo)||void 0===r?void 0:r.region)&&void 0!==a?a:"");let u="";t instanceof o.NextRequest?u=t.nextUrl.pathname:t instanceof Request&&(u=new URL(t.url).pathname);let d={startTime:new Date().getTime(),endTime:new Date().getTime(),path:u,method:t.method,host:t.headers.get("host"),userAgent:t.headers.get("user-agent"),scheme:t.url.split("://")[0],ip:t.headers.get("x-forwarded-for"),region:l},h=new s.Logger({req:d,source:i.isEdgeRuntime?"edge":"lambda"}),f=h.with({});f.config.source=i.isEdgeRuntime?"edge-log":"lambda-log",t.log=f;try{let r=yield e(t,n);return d.endTime=new Date().getTime(),d.statusCode=r.status,d.durationMs=d.endTime-d.startTime,h.logHttpRequest(s.LogLevel.info,`[${t.method}] ${d.path} ${d.statusCode} ${d.endTime-d.startTime}ms`,d,{}),f.attachResponseStatus(r.status),yield h.flush(),i.isEdgeRuntime&&i.isVercelIntegration&&c(d),r}catch(e){throw d.endTime=new Date().getTime(),d.statusCode=500,d.durationMs=d.endTime-d.startTime,h.logHttpRequest(s.LogLevel.error,`[${t.method}] ${d.path} ${d.statusCode} ${d.endTime-d.startTime}ms`,d,{}),f.error(e.message,{error:e}),f.attachResponseStatus(500),yield h.flush(),i.isEdgeRuntime&&i.isVercelIntegration&&c(d),e}})}function c(e){console.log(`AXIOM_EDGE_REPORT::${JSON.stringify(e)}`)}t.withAxiomNextConfig=l,t.withAxiomRouteHandler=u,t.withAxiom=function(e){if("function"==typeof e);else if("object"==typeof e)return l(e);return u(e)}},1158:function(e,t){"use strict";t.Headers=self.Headers,t.Request=self.Request,t.Response=self.Response,t.fetch=self.fetch},96011:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(40913)}])},26843:function(e,t,n){"use strict";n.d(t,{JL:function(){return a},Lp:function(){return u},Ww:function(){return o},cc:function(){return l}});var r=n(60840),i=n(66569),s=n(74942);s.ZP.init("phc_3xUJbT2XtO1LuaJdVI96NYEE6oLnzJmxsQiedZpne7o",{api_host:"/ingest",ui_host:"https://eu.posthog.com",debug:!1,loaded:e=>{}});let o=async e=>{(0,r.av)({id:e.user.id}),s.ZP.identify(e.user.id,{name:e.user.name,role:e.user.role,deactivated:e.user.deactivated,organisationId:e.user.organisationId}),s.ZP.group("organisation",e.user.organisationId)},a=async(e,t)=>{(0,i.n)({message:e,category:"analytics",level:"info",data:t}),s.ZP.capture(e,t)},l=async e=>{(0,i.n)({message:"Client Error",category:"exception",level:"error",data:{error:e.toString()}}),(0,r.Tb)(e)},u=s.ZP},3238:function(e,t,n){"use strict";n.d(t,{ET:function(){return o},KQ:function(){return l},Lp:function(){return u},X5:function(){return d},jD:function(){return i},kz:function(){return c},mO:function(){return s}});var r=n(27822);let i=async e=>{let{userIds:t}=e,n=new URLSearchParams(t.map(e=>["userIds",e])),r=await fetch(a+"/users?".concat(n));if(!r.ok)throw Error("Problem resolving users");return await r.json()},s=async e=>{let{roomIds:t}=e,n=new URLSearchParams(t.map(e=>["roomIds",e])),r=await fetch(a+"/rooms?".concat(n));if(!r.ok)throw Error("Problem resolving rooms info");return await r.json()},o=async e=>{let{text:t}=e,n=await fetch(a+"/users/search?text=".concat(encodeURIComponent(t)));if(!n.ok)throw Error("Problem resolving mention suggestions");return await n.json()},a="/api/liveblocks",l="/api/liveblocks/auth",u=(0,r.eI)({authEndpoint:l,resolveUsers:i,resolveRoomsInfo:s,resolveMentionSuggestions:o}),c={cursor:null,selectedNodes:[],selectedEdges:[]},d={nodes:new r.as([]),edges:new r.as([])}},19215:function(e,t,n){"use strict";n.d(t,{S:function(){return eV}});var r,i,s=n(83760);class o{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class a{constructor(e){this.generateIdentifier=e,this.kv=new o}register(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}}class l extends a{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){"object"==typeof t?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}}function u(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function c(e,t){return -1!==e.indexOf(t)}function d(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}class h{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return function(e,t){let n=function(e){if("values"in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}(e);if("find"in n)return n.find(t);for(let e=0;e<n.length;e++){let r=n[e];if(t(r))return r}}(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}}let f=e=>Object.prototype.toString.call(e).slice(8,-1),p=e=>void 0===e,m=e=>null===e,g=e=>"object"==typeof e&&null!==e&&e!==Object.prototype&&(null===Object.getPrototypeOf(e)||Object.getPrototypeOf(e)===Object.prototype),v=e=>g(e)&&0===Object.keys(e).length,y=e=>Array.isArray(e),_=e=>"string"==typeof e,b=e=>"number"==typeof e&&!isNaN(e),w=e=>"boolean"==typeof e,S=e=>e instanceof Map,E=e=>e instanceof Set,x=e=>"Symbol"===f(e),k=e=>"number"==typeof e&&isNaN(e),T=e=>w(e)||m(e)||p(e)||b(e)||_(e)||x(e),O=e=>e===1/0||e===-1/0,I=e=>e.replace(/\./g,"\\."),C=e=>e.map(String).map(I).join("."),R=e=>{let t=[],n="";for(let r=0;r<e.length;r++){let i=e.charAt(r);if("\\"===i&&"."===e.charAt(r+1)){n+=".",r++;continue}if("."===i){t.push(n),n="";continue}n+=i}let r=n;return t.push(r),t};function A(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}let P=[A(p,"undefined",()=>null,()=>void 0),A(e=>"bigint"==typeof e,"bigint",e=>e.toString(),e=>"undefined"!=typeof BigInt?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),A(e=>e instanceof Date&&!isNaN(e.valueOf()),"Date",e=>e.toISOString(),e=>new Date(e)),A(e=>e instanceof Error,"Error",(e,t)=>{let n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),A(e=>e instanceof RegExp,"regexp",e=>""+e,e=>new RegExp(e.slice(1,e.lastIndexOf("/")),e.slice(e.lastIndexOf("/")+1))),A(E,"set",e=>[...e.values()],e=>new Set(e)),A(S,"map",e=>[...e.entries()],e=>new Map(e)),A(e=>k(e)||O(e),"number",e=>k(e)?"NaN":e>0?"Infinity":"-Infinity",Number),A(e=>0===e&&1/e==-1/0,"number",()=>"-0",Number),A(e=>e instanceof URL,"URL",e=>e.toString(),e=>new URL(e))];function M(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}let L=M((e,t)=>!!x(e)&&!!t.symbolRegistry.getIdentifier(e),(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error("Trying to deserialize unknown symbol");return r}),N=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),D=M(e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{let n=N[t[1]];if(!n)throw Error("Trying to deserialize unknown typed array");return new n(e)});function $(e,t){return!!e?.constructor&&!!t.classRegistry.getIdentifier(e.constructor)}let j=M($,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),F=M((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),U=[j,L,F,D],q=(e,t)=>{let n=d(U,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=d(P,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},B={};P.forEach(e=>{B[e.annotation]=e});let H=(e,t,n)=>{if(y(t))switch(t[0]){case"symbol":return L.untransform(e,t,n);case"class":return j.untransform(e,t,n);case"custom":return F.untransform(e,t,n);case"typed-array":return D.untransform(e,t,n);default:throw Error("Unknown transformation: "+t)}else{let r=B[t];if(!r)throw Error("Unknown transformation: "+t);return r.untransform(e,n)}},z=(e,t)=>{let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function W(e){if(c(e,"__proto__"))throw Error("__proto__ is not allowed as a property");if(c(e,"prototype"))throw Error("prototype is not allowed as a property");if(c(e,"constructor"))throw Error("constructor is not allowed as a property")}let V=(e,t)=>{W(t);for(let n=0;n<t.length;n++){let r=t[n];if(E(e))e=z(e,+r);else if(S(e)){let i=+r,s=0==+t[++n]?"key":"value",o=z(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o)}}else e=e[r]}return e},G=(e,t,n)=>{if(W(t),0===t.length)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(y(r))r=r[+n];else if(g(r))r=r[n];else if(E(r))r=z(r,+n);else if(S(r)){if(e===t.length-2)break;let i=+n,s=0==+t[++e]?"key":"value",o=z(r,i);switch(s){case"key":r=o;break;case"value":r=r.get(o)}}}let i=t[t.length-1];if(y(r)?r[+i]=n(r[+i]):g(r)&&(r[i]=n(r[i])),E(r)){let e=z(r,+i),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(S(r)){let e=z(r,+t[t.length-2]);switch(0==+i?"key":"value"){case"key":{let t=n(e);r.set(t,r.get(e)),t!==e&&r.delete(e);break}case"value":r.set(e,n(r.get(e)))}}return e},Q=(e,t)=>g(e)||y(e)||S(e)||E(e)||$(e,t),K=(e,t,n,r,i=[],s=[],o=new Map)=>{let a=T(e);if(!a){!function(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}(e,i,t);let n=o.get(e);if(n)return r?{transformedValue:null}:n}if(!Q(e,n)){let t=q(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return a||o.set(e,r),r}if(c(s,e))return{transformedValue:null};let l=q(e,n),d=l?.value??e,h=y(d)?[]:{},f={};u(d,(a,l)=>{if("__proto__"===l||"constructor"===l||"prototype"===l)throw Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`);let c=K(a,t,n,r,[...i,l],[...s,e],o);h[l]=c.transformedValue,y(c.annotations)?f[l]=c.annotations:g(c.annotations)&&u(c.annotations,(e,t)=>{f[I(l)+"."+t]=e})});let p=v(f)?{transformedValue:h,annotations:l?[l.type]:void 0}:{transformedValue:h,annotations:l?[l.type,f]:f};return a||o.set(e,p),p};function J(e){return Object.prototype.toString.call(e).slice(8,-1)}function X(e){return"Array"===J(e)}r=function(e){return"Null"===J(e)},i=function(e){return"Undefined"===J(e)},e=>r(e)||i(e)||!1;class Z{constructor({dedupe:e=!1}={}){this.classRegistry=new l,this.symbolRegistry=new a(e=>e.description??""),this.customTransformerRegistry=new h,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=K(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let i=function(e,t){let n;let r={};return(e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[i,...s]=e;0===i.length?n=s.map(C):r[C(i)]=s.map(C)}),n)?v(r)?[n]:[n,r]:v(r)?void 0:r}(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){let{json:t,meta:n}=e,r=function e(t,n={}){return X(t)?t.map(t=>e(t,n)):!function(e){if("Object"!==J(e))return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}(t)?t:[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)].reduce((r,i)=>{if(X(n.props)&&!n.props.includes(i))return r;let s=e(t[i],n);return function(e,t,n,r,i){let s=({}).propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";"enumerable"===s&&(e[t]=n),i&&"nonenumerable"===s&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}(r,i,s,t,n.nonenumerable),r},{})}(t);if(n?.values){var i,s,o;i=r,s=n.values,o=this,function e(t,n,r=[]){if(!t)return;if(!y(t)){u(t,(t,i)=>e(t,n,[...r,...R(i)]));return}let[i,s]=t;s&&u(s,(t,i)=>{e(t,n,[...r,...R(i)])}),n(i,r)}(s,(e,t)=>{i=G(i,t,t=>H(t,e,o))}),r=i}return n?.referentialEqualities&&(r=function(e,t){function n(t,n){let r=V(e,R(n));t.map(R).forEach(t=>{e=G(e,t,()=>r)})}if(y(t)){let[r,i]=t;r.forEach(t=>{e=G(e,R(t),()=>e)}),i&&u(i,n)}else u(t,n);return e}(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}}Z.defaultInstance=new Z,Z.serialize=Z.defaultInstance.serialize.bind(Z.defaultInstance),Z.deserialize=Z.defaultInstance.deserialize.bind(Z.defaultInstance),Z.stringify=Z.defaultInstance.stringify.bind(Z.defaultInstance),Z.parse=Z.defaultInstance.parse.bind(Z.defaultInstance),Z.registerClass=Z.defaultInstance.registerClass.bind(Z.defaultInstance),Z.registerSymbol=Z.defaultInstance.registerSymbol.bind(Z.defaultInstance),Z.registerCustom=Z.defaultInstance.registerCustom.bind(Z.defaultInstance),Z.allowErrorProps=Z.defaultInstance.allowErrorProps.bind(Z.defaultInstance),Z.serialize,Z.deserialize,Z.stringify,Z.parse,Z.registerClass,Z.registerCustom,Z.registerSymbol,Z.allowErrorProps;var Y=n(80707),ee=n(75271);function et(e){return e}function en(e,t,n){if("object"!=typeof t||null===t)return;let r=e.getMutationCache(),i=e.getQueryCache(),s=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData??et,o=t.mutations||[],a=t.queries||[];o.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),a.forEach(({queryKey:t,state:r,queryHash:o,meta:a,promise:l})=>{let u=i.get(o),c=void 0===r.data?r.data:s(r.data);if(u){if(u.state.dataUpdatedAt<r.dataUpdatedAt){let{fetchStatus:e,...t}=r;u.setState({...t,data:c})}}else u=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:a},{...r,data:c,fetchStatus:"idle"});if(l){let e=Promise.resolve(l).then(s);u.fetch(void 0,{initialPromise:e})}})}var er=({children:e,options:t={},state:n,queryClient:r})=>{let i=(0,Y.NL)(r),[s,o]=ee.useState(),a=ee.useRef(t);return a.current=t,ee.useMemo(()=>{if(n){if("object"!=typeof n)return;let e=i.getQueryCache(),t=n.queries||[],r=[],l=[];for(let n of t){let t=e.get(n.queryHash);if(t){let e=n.state.dataUpdatedAt>t.state.dataUpdatedAt,r=s?.find(e=>e.queryHash===n.queryHash);e&&(!r||n.state.dataUpdatedAt>r.state.dataUpdatedAt)&&l.push(n)}else r.push(n)}r.length>0&&en(i,{queries:r},a.current),l.length>0&&o(e=>e?[...e,...l]:l)}},[i,s,n]),ee.useEffect(()=>{s&&(en(i,{queries:s},a.current),o(void 0))},[i,s]),e},ei=n(33015),es=n(28913);let eo=["client","ssrContext","ssrState","abortOnUnmount"],ea=ee.createContext?.(null);var el=n(48842);function eu(e,t,n){let r=e.flatMap(e=>e.split("."));if(!t&&(!n||"any"===n))return r.length?[r]:[];if("infinite"===n&&(0,es.Kn)(t)&&("direction"in t||"cursor"in t)){let{cursor:e,direction:n,...i}=t;return[r,{input:i,type:"infinite"}]}return[r,{...void 0!==t&&t!==el.CN&&{input:t},...n&&"any"!==n&&{type:n}}]}function ec(e){return eu(e,void 0,"any")}let ed=e=>{switch(e){case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function eh(e){return(0,es.IX)(t=>{let n=t.path,r=n.join("."),[i,s]=t.args;return{queryKey:eu(n,i,"query"),queryFn:()=>e.query(r,i,s?.trpc),...s}})}var ef=n(94973),ep=n(42611),em=n(26720),eg=n(37811),ev=n(88506),ey=n(19737),e_=n(75865),eb=class extends ey.F{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||ew(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=(0,e_.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#r({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let t="pending"===this.state.status,n=!this.#n.canStart();try{if(!t){this.#r({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#r({type:"pending",context:t,variables:e,isPaused:n})}let r=await this.#n.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#r({type:"success",data:r}),r}catch(t){try{throw await this.#t.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#t.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#r({type:"error",error:t})}}finally{this.#t.runNext(this)}}#r(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),ev.V.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function ew(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var eS=n(33485),eE=class extends eS.l{#i;#s=void 0;#o;#a;constructor(e,t){super(),this.#i=e,this.setOptions(t),this.bindMethods(),this.#l()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#i.defaultMutationOptions(e),(0,el.VS)(this.options,t)||this.#i.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#o,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,el.Ym)(t.mutationKey)!==(0,el.Ym)(this.options.mutationKey)?this.reset():this.#o?.state.status==="pending"&&this.#o.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#o?.removeObserver(this)}onMutationUpdate(e){this.#l(),this.#u(e)}getCurrentResult(){return this.#s}reset(){this.#o?.removeObserver(this),this.#o=void 0,this.#l(),this.#u()}mutate(e,t){return this.#a=t,this.#o?.removeObserver(this),this.#o=this.#i.getMutationCache().build(this.#i,this.options),this.#o.addObserver(this),this.#o.execute(e)}#l(){let e=this.#o?.state??ew();this.#s={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#u(e){ev.V.batch(()=>{if(this.#a&&this.hasListeners()){let t=this.#s.variables,n=this.#s.context;e?.type==="success"?(this.#a.onSuccess?.(e.data,t,n),this.#a.onSettled?.(e.data,null,t,n)):e?.type==="error"&&(this.#a.onError?.(e.error,t,n),this.#a.onSettled?.(void 0,e.error,t,n))}this.listeners.forEach(e=>{e(this.#s)})})}},ex=n(20942);function ek(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],o=t.state.data?.pageParams||[],a={pages:[],pageParams:[]},l=0,u=async()=>{let n=!1,u=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener("abort",()=>{n=!0}),t.signal)})},c=(0,el.cG)(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let s={queryKey:t.queryKey,pageParam:r,direction:i?"backward":"forward",meta:t.options.meta};u(s);let o=await c(s),{maxPages:a}=t.options,l=i?el.Ht:el.VX;return{pages:l(e.pages,o,a),pageParams:l(e.pageParams,r,a)}};if(i&&s.length){let e="backward"===i,t={pages:s,pageParams:o},n=(e?eO:eT)(r,t);a=await d(t,n,e)}else{let t=e??s.length;do{let e=0===l?o[0]??r.initialPageParam:eT(r,a);if(l>0&&null==e)break;a=await d(a,e),l++}while(l<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function eT(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function eO(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var eI=class extends ep.z{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:ek()},t)}getOptimisticResult(e){return e.behavior=ek(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var n,r;let{state:i}=e,s=super.createResult(e,t),{isFetching:o,isRefetching:a,isError:l,isRefetchError:u}=s,c=i.fetchMeta?.fetchMore?.direction,d=l&&"forward"===c,h=o&&"forward"===c,f=l&&"backward"===c,p=o&&"backward"===c;return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:!!(n=i.data)&&null!=eT(t,n),hasPreviousPage:!!(r=i.data)&&!!t.getPreviousPageParam&&null!=eO(t,r),isFetchNextPageError:d,isFetchingNextPage:h,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:u&&!d&&!f,isRefetching:a&&!h&&!p}}};function eC(e,t){return e.filter(e=>!t.includes(e))}var eR=class extends eS.l{#i;#c;#d;#h;#e;#f;#p;#m;constructor(e,t,n){super(),this.#i=e,this.#h=n,this.#d=[],this.#e=[],this.#c=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#e.forEach(e=>{e.subscribe(t=>{this.#g(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(e=>{e.destroy()})}setQueries(e,t,n){this.#d=e,this.#h=t,ev.V.batch(()=>{let e=this.#e,t=this.#v(this.#d);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions,n));let r=t.map(e=>e.observer),i=r.map(e=>e.getCurrentResult()),s=r.some((t,n)=>t!==e[n]);(e.length!==r.length||s)&&(this.#e=r,this.#c=i,this.hasListeners()&&(eC(e,r).forEach(e=>{e.destroy()}),eC(r,e).forEach(e=>{e.subscribe(t=>{this.#g(e,t)})}),this.#u()))})}getCurrentResult(){return this.#c}getQueries(){return this.#e.map(e=>e.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(e,t){let n=this.#v(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[r,e=>this.#y(e??r,t),()=>n.map((e,t)=>{let i=r[t];return e.defaultedQueryOptions.notifyOnChangeProps?i:e.observer.trackResult(i,e=>{n.forEach(t=>{t.observer.trackProp(e)})})})]}#y(e,t){return t?(this.#f&&this.#c===this.#m&&t===this.#p||(this.#p=t,this.#m=this.#c,this.#f=(0,el.Q$)(this.#f,t(e))),this.#f):e}#v(e){let t=new Map(this.#e.map(e=>[e.options.queryHash,e])),n=[];return e.forEach(e=>{let r=this.#i.defaultQueryOptions(e),i=t.get(r.queryHash);if(i)n.push({defaultedQueryOptions:r,observer:i});else{let e=this.#e.find(e=>e.options.queryHash===r.queryHash);n.push({defaultedQueryOptions:r,observer:e??new ep.z(this.#i,r)})}}),n.sort((t,n)=>e.findIndex(e=>e.queryHash===t.defaultedQueryOptions.queryHash)-e.findIndex(e=>e.queryHash===n.defaultedQueryOptions.queryHash))}#g(e,t){let n=this.#e.indexOf(e);-1!==n&&(this.#c=function(e,t,n){let r=e.slice(0);return r[t]=n,r}(this.#c,n,t),this.#u())}#u(){this.hasListeners()&&this.#f!==this.#y(this.#c,this.#h?.combine)&&ev.V.batch(()=>{this.listeners.forEach(e=>{e(this.#c)})})}},eA=n(11317),eP=n(1561),eM=n(37968);function eL({queries:e,...t},n){let r=(0,Y.NL)(n),i=(0,eA.S)(),s=(0,eP._)(),o=ee.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?"isRestoring":"optimistic",t}),[e,r,i]);o.forEach(e=>{(0,eg.A8)(e),(0,eM.pf)(e,s)}),(0,eM.JN)(s);let[a]=ee.useState(()=>new eR(r,o,t)),[l,u,c]=a.getOptimisticResult(o,t.combine);ee.useSyncExternalStore(ee.useCallback(e=>i?()=>void 0:a.subscribe(ev.V.batchCalls(e)),[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ee.useEffect(()=>{a.setQueries(o,t,{listeners:!1})},[o,t,a]);let d=l.some((e,t)=>(0,eg.SB)(o[t],e))?l.flatMap((e,t)=>{let n=o[t];if(n){let t=new ep.z(r,n);if((0,eg.SB)(n,e))return(0,eg.j8)(n,t,s);(0,eg.Z$)(e,i)&&(0,eg.j8)(n,t,s)}return[]}):[];if(d.length>0)throw Promise.all(d);let h=l.find((e,t)=>{let n=o[t];return n&&(0,eM.KJ)({result:e,errorResetBoundary:s,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash)})});if(h?.error)throw h.error;return u(c())}function eN(e,t,n){let r=e[0],i=e[1]?.input;return n&&(i={...i??{},...n.pageParam?{cursor:n.pageParam}:{},direction:n.direction}),[r.join("."),i,t?.trpc]}function eD(e){let t=e.path.join(".");return ee.useMemo(()=>({path:t}),[t])}function e$(e){let t=e?.overrides?.useMutation?.onSuccess??(e=>e.originalFn()),n=e?.context??ea;function r(){let e=ee.useContext(n);if(!e)throw Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return e}function i(e,t){let{queryClient:n,ssrState:i}=r();return i&&"mounted"!==i&&n.getQueryCache().find({queryKey:e})?.state.status==="error"?{retryOnMount:!1,...t}:t}return{Provider:e=>{let{abortOnUnmount:t=!1,client:r,queryClient:i,ssrContext:o}=e,[a,l]=ee.useState(e.ssrState??!1),u=ee.useMemo(()=>(function(e){let{client:t,queryClient:n}=e,r=t instanceof s.NT?t:(0,s.ny)(t);return{fetchQuery:(e,t)=>n.fetchQuery({...t,queryKey:e,queryFn:()=>r.query(...eN(e,t))}),fetchInfiniteQuery:(e,t)=>n.fetchInfiniteQuery({...t,queryKey:e,queryFn:({pageParam:n,direction:i})=>r.query(...eN(e,t,{pageParam:n,direction:i})),initialPageParam:t?.initialCursor??null}),prefetchQuery:(e,t)=>n.prefetchQuery({...t,queryKey:e,queryFn:()=>r.query(...eN(e,t))}),prefetchInfiniteQuery:(e,t)=>n.prefetchInfiniteQuery({...t,queryKey:e,queryFn:({pageParam:n,direction:i})=>r.query(...eN(e,t,{pageParam:n,direction:i})),initialPageParam:t?.initialCursor??null}),ensureQueryData:(e,t)=>n.ensureQueryData({...t,queryKey:e,queryFn:()=>r.query(...eN(e,t))}),invalidateQueries:(e,t,r)=>n.invalidateQueries({...t,queryKey:e},r),resetQueries:(e,t,r)=>n.resetQueries({...t,queryKey:e},r),refetchQueries:(e,t,r)=>n.refetchQueries({...t,queryKey:e},r),cancelQuery:(e,t)=>n.cancelQueries({queryKey:e},t),setQueryData:(e,t,r)=>n.setQueryData(e,t,r),setQueriesData:(e,t,r,i)=>n.setQueriesData({...t,queryKey:e},r,i),getQueryData:e=>n.getQueryData(e),setInfiniteQueryData:(e,t,r)=>n.setQueryData(e,t,r),getInfiniteQueryData:e=>n.getQueryData(e),setMutationDefaults:(t,i)=>{let s=t[0];return n.setMutationDefaults(t,"function"==typeof i?i({canonicalMutationFn:t=>r.mutation(...eN([s,{input:t}],e))}):i)},getMutationDefaults:e=>n.getMutationDefaults(e),isMutating:e=>n.isMutating({...e,exact:!0})}})({client:r,queryClient:i}),[r,i]),c=ee.useMemo(()=>({abortOnUnmount:t,queryClient:i,client:r,ssrContext:o??null,ssrState:a,...u}),[t,r,u,i,o,a]);return ee.useEffect(()=>{l(e=>!!e&&"mounted")},[]),ee.createElement(n.Provider,{value:c},e.children)},createClient:e=>(0,s.fE)(e),useContext:r,useUtils:r,useQuery:function(t,n,s){let{abortOnUnmount:o,client:a,ssrState:l,queryClient:u,prefetchQuery:c}=r(),d=eu(t,n,"query"),h=u.getQueryDefaults(d),f=n===el.CN;"undefined"!=typeof window||"prepass"!==l||s?.trpc?.ssr===!1||(s?.enabled??h?.enabled)===!1||f||u.getQueryCache().find({queryKey:d})||c(d,s);let p=i(d,{...h,...s}),m=s?.trpc?.abortOnUnmount??e?.abortOnUnmount??o,g=(0,ef.a)({...p,queryKey:d,queryFn:f?n:async e=>{let t={...p,trpc:{...p?.trpc,...m?{signal:e.signal}:{signal:null}}},n=await a.query(...eN(d,t));if((0,es.D0)(n)){let t=u.getQueryCache().build(e.queryKey,{queryKey:d});t.setState({data:[],status:"success"});let r=[];for await(let e of n)r.push(e),t.setState({data:[...r]});return r}return n}},u);return g.trpc=eD({path:t}),g},usePrefetchQuery:function(t,n,i){let s=r(),o=eu(t,n,"query"),a=n===el.CN,l=i?.trpc?.abortOnUnmount??e?.abortOnUnmount??s.abortOnUnmount;!function(e,t){let n=(0,Y.NL)(void 0);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}({...i,queryKey:o,queryFn:a?n:e=>{let t={trpc:{...l?{signal:e.signal}:{}}};return s.client.query(...eN(o,t))}})},useSuspenseQuery:function(t,n,i){var s,o;let a=r(),l=eu(t,n,"query"),u=i?.trpc?.abortOnUnmount??e?.abortOnUnmount??a.abortOnUnmount,c=(s={...i,queryKey:l,queryFn:e=>{let t={trpc:{...u?{signal:e.signal}:{signal:null}}};return a.client.query(...eN(l,t))}},o=a.queryClient,(0,em.r)({...s,enabled:!0,suspense:!0,throwOnError:eg.Ct,placeholderData:void 0},ep.z,o));return c.trpc=eD({path:t}),[c.data,c]},useQueries:e=>{let{ssrState:t,queryClient:n,prefetchQuery:i,client:s}=r(),o=e(eh(s));if("undefined"==typeof window&&"prepass"===t)for(let e of o)e.trpc?.ssr===!1||n.getQueryCache().find({queryKey:e.queryKey})||i(e.queryKey,e);return eL({queries:o.map(e=>({...e,queryKey:e.queryKey}))},n)},useSuspenseQueries:e=>{var t;let{queryClient:n,client:i}=r(),s=eL({...t={queries:e(eh(i)).map(e=>({...e,queryKey:e.queryKey}))},queries:t.queries.map(e=>({...e,suspense:!0,throwOnError:eg.Ct,enabled:!0,placeholderData:void 0}))},n);return[s.map(e=>e.data),s]},useMutation:function(e,n){let{client:i,queryClient:s}=r(),o=ec(e),a=s.defaultMutationOptions(s.getMutationDefaults(o)),l=function(e,t){let n=(0,Y.NL)(t),[r]=ee.useState(()=>new eE(n,e));ee.useEffect(()=>{r.setOptions(e)},[r,e]);let i=ee.useSyncExternalStore(ee.useCallback(e=>r.subscribe(ev.V.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=ee.useCallback((e,t)=>{r.mutate(e,t).catch(ex.Z)},[r]);if(i.error&&(0,ex.L)(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}({...n,mutationKey:o,mutationFn:t=>i.mutation(...eN([e,{input:t}],n)),onSuccess:(...e)=>t({originalFn:()=>n?.onSuccess?.(...e)??a?.onSuccess?.(...e),queryClient:s,meta:n?.meta??a?.meta??{}})},s);return l.trpc=eD({path:e}),l},useSubscription:function(e,t,n){let i=n?.enabled??t!==el.CN,s=(0,el.Ym)(eu(e,t,"any")),{client:o}=r(),a=ee.useRef(n);a.current=n,ee.useEffect(()=>{if(!i)return;let n=!1,r=o.subscription(e.join("."),t??void 0,{onStarted:()=>{n||a.current.onStarted?.()},onData:e=>{n||a.current.onData(e)},onError:e=>{n||a.current.onError?.(e)}});return()=>{n=!0,r.unsubscribe()}},[s,i])},useInfiniteQuery:function(e,t,n){var s;let{client:o,ssrState:a,prefetchInfiniteQuery:l,queryClient:u,abortOnUnmount:c}=r(),d=eu(e,t,"infinite"),h=u.getQueryDefaults(d),f=t===el.CN;"undefined"!=typeof window||"prepass"!==a||n?.trpc?.ssr===!1||(n?.enabled??h?.enabled)===!1||f||u.getQueryCache().find({queryKey:d})||l(d,{...h,...n});let p=i(d,{...h,...n}),m=n?.trpc?.abortOnUnmount??c,g=(s={...p,initialPageParam:n.initialCursor??null,persister:n.persister,queryKey:d,queryFn:f?t:e=>{let t={...p,trpc:{...p?.trpc,...m?{signal:e.signal}:{signal:null}}};return o.query(...eN(d,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}},(0,em.r)(s,eI,u));return g.trpc=eD({path:e}),g},usePrefetchInfiniteQuery:function(e,t,n){let s=r(),o=eu(e,t,"infinite"),a=s.queryClient.getQueryDefaults(o),l=t===el.CN,u=i(o,{...a,...n}),c=n?.trpc?.abortOnUnmount??s.abortOnUnmount;!function(e,t){let n=(0,Y.NL)(void 0);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}({...n,initialPageParam:n.initialCursor??null,queryKey:o,queryFn:l?t:e=>{let t={...u,trpc:{...u?.trpc,...c?{signal:e.signal}:{}}};return s.client.query(...eN(o,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}})},useSuspenseInfiniteQuery:function(e,t,n){var s,o;let a=r(),l=eu(e,t,"infinite"),u=a.queryClient.getQueryDefaults(l),c=i(l,{...u,...n}),d=n?.trpc?.abortOnUnmount??a.abortOnUnmount,h=(s={...n,initialPageParam:n.initialCursor??null,queryKey:l,queryFn:e=>{let t={...c,trpc:{...c?.trpc,...d?{signal:e.signal}:{}}};return a.client.query(...eN(l,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}},o=a.queryClient,(0,em.r)({...s,enabled:!0,suspense:!0,throwOnError:eg.Ct},eI,o));return h.trpc=eD({path:e}),[h.data,h]}}}var ej=n(43489),eF=class extends eS.l{constructor(e={}){super(),this.config=e,this.#d=new Map}#d;build(e,t,n){let r=t.queryKey,i=t.queryHash??(0,el.Rm)(r,t),s=this.get(i);return s||(s=new ej.A({cache:this,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#d.has(e.queryHash)||(this.#d.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#d.get(e.queryHash);t&&(e.destroy(),t===e&&this.#d.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ev.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#d.get(e)}getAll(){return[...this.#d.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,el._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,el._x)(e,t)):t}notify(e){ev.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ev.V.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ev.V.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},eU=class extends eS.l{constructor(e={}){super(),this.config=e,this.#_=new Map,this.#b=Date.now()}#_;#b;build(e,t,n){let r=new eb({mutationCache:this,mutationId:++this.#b,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){let t=eq(e),n=this.#_.get(t)??[];n.push(e),this.#_.set(t,n),this.notify({type:"added",mutation:e})}remove(e){let t=eq(e);if(this.#_.has(t)){let n=this.#_.get(t)?.filter(t=>t!==e);n&&(0===n.length?this.#_.delete(t):this.#_.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){let t=this.#_.get(eq(e))?.find(e=>"pending"===e.state.status);return!t||t===e}runNext(e){let t=this.#_.get(eq(e))?.find(t=>t!==e&&t.state.isPaused);return t?.continue()??Promise.resolve()}clear(){ev.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#_.values()].flat()}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,el.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,el.X7)(e,t))}notify(e){ev.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ev.V.batch(()=>Promise.all(e.map(e=>e.continue().catch(el.ZT))))}};function eq(e){return e.options.scope?.id??String(e.mutationId)}var eB=n(26566),eH=n(17343),ez=class{#w;#t;#S;#E;#x;#k;#T;#O;constructor(e={}){this.#w=e.queryCache||new eF,this.#t=e.mutationCache||new eU,this.#S=e.defaultOptions||{},this.#E=new Map,this.#x=new Map,this.#k=0}mount(){this.#k++,1===this.#k&&(this.#T=eB.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#w.onFocus())}),this.#O=eH.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#w.onOnline())}))}unmount(){this.#k--,0===this.#k&&(this.#T?.(),this.#T=void 0,this.#O?.(),this.#O=void 0)}isFetching(e){return this.#w.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#w.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.getQueryData(e.queryKey);if(void 0===t)return this.fetchQuery(e);{let n=this.defaultQueryOptions(e),r=this.#w.build(this,n);return e.revalidateIfStale&&r.isStaleByTime((0,el.KC)(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return this.#w.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#w.get(r.queryHash),s=i?.state.data,o=(0,el.SE)(t,s);if(void 0!==o)return this.#w.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ev.V.batch(()=>this.#w.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#w.get(t.queryHash)?.state}removeQueries(e){let t=this.#w;ev.V.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#w,r={type:"active",...e};return ev.V.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){let n={revert:!0,...t};return Promise.all(ev.V.batch(()=>this.#w.findAll(e).map(e=>e.cancel(n)))).then(el.ZT).catch(el.ZT)}invalidateQueries(e={},t={}){return ev.V.batch(()=>{if(this.#w.findAll(e).forEach(e=>{e.invalidate()}),"none"===e.refetchType)return Promise.resolve();let n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){let n={...t,cancelRefetch:t?.cancelRefetch??!0};return Promise.all(ev.V.batch(()=>this.#w.findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(el.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(el.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let n=this.#w.build(this,t);return n.isStaleByTime((0,el.KC)(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(el.ZT).catch(el.ZT)}fetchInfiniteQuery(e){return e.behavior=ek(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(el.ZT).catch(el.ZT)}ensureInfiniteQueryData(e){return e.behavior=ek(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return eH.N.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#w}getMutationCache(){return this.#t}getDefaultOptions(){return this.#S}setDefaultOptions(e){this.#S=e}setQueryDefaults(e,t){this.#E.set((0,el.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#E.values()],n={};return t.forEach(t=>{(0,el.to)(e,t.queryKey)&&(n={...n,...t.defaultOptions})}),n}setMutationDefaults(e,t){this.#x.set((0,el.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#x.values()],n={};return t.forEach(t=>{(0,el.to)(e,t.mutationKey)&&(n={...n,...t.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#S.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,el.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),!0!==t.enabled&&t.queryFn===el.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#S.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#w.clear(),this.#t.clear()}};let eW=e=>e.queryClient??new ez(e.queryClientConfig);n(14224);let eV=function(e){let t=e$(e),n=function(e){let{config:t}=e,n=(0,ei.S)(e.transformer);return r=>{let i=e$(e),s=s=>{let[o]=(0,ee.useState)(()=>{if(s.trpc)return s.trpc;let n=t({}),r=eW(n),o=i.createClient(n);return{abortOnUnmount:n.abortOnUnmount,queryClient:r,trpcClient:o,ssrState:!!e.ssr&&"mounting",ssrContext:null}}),{queryClient:a,trpcClient:l,ssrState:u,ssrContext:c}=o,d=s.pageProps?.trpcState,h=ee.useMemo(()=>d?n.input.deserialize(d):d,[d,l]);return ee.createElement(i.Provider,{abortOnUnmount:o.abortOnUnmount??!1,client:l,queryClient:a,ssrState:u,ssrContext:c},ee.createElement(Y.aH,{client:a},ee.createElement(er,{state:h},ee.createElement(r,Object.assign({},s)))))};e.ssr?e.ssrPrepass({parent:e,AppOrPage:r,WithTRPC:s}):r.getInitialProps&&(s.getInitialProps=async e=>{let t;let n=!!e.Component,i={},s=await r.getInitialProps(e);return t=i={...n?s.pageProps??{}:s,...i},n?{pageProps:t}:t});let o=r.displayName??r.name??"Component";return s.displayName=`withTRPC(${o})`,s}}(e),r=(0,es.IX)(({path:e,args:n})=>{let r=[...e],i=r.pop();if("useMutation"===i)return t[i](r,...n);if("_def"===i)return{path:r};let[s,...o]=n,a=o[0]||{};return t[i](r,s,a)});return(0,es.yh)(e=>"useContext"===e||"useUtils"===e?()=>{let e=t.useUtils();return(0,ee.useMemo)(()=>(function(e){let t=(0,s.Bm)(e.client),n=(0,es.IX)(t=>{let n=[...t.path],r=n.pop(),i=[...t.args],s=i.shift(),o=eu(n,s,ed(r));return({fetch:()=>e.fetchQuery(o,...i),fetchInfinite:()=>e.fetchInfiniteQuery(o,i[0]),prefetch:()=>e.prefetchQuery(o,...i),prefetchInfinite:()=>e.prefetchInfiniteQuery(o,i[0]),ensureData:()=>e.ensureQueryData(o,...i),invalidate:()=>e.invalidateQueries(o,...i),reset:()=>e.resetQueries(o,...i),refetch:()=>e.refetchQueries(o,...i),cancel:()=>e.cancelQuery(o,...i),setData:()=>{e.setQueryData(o,i[0],i[1])},setQueriesData:()=>e.setQueriesData(o,i[0],i[1],i[2]),setInfiniteData:()=>{e.setInfiniteQueryData(o,i[0],i[1])},getData:()=>e.getQueryData(o),getInfiniteData:()=>e.getInfiniteQueryData(o),setMutationDefaults:()=>e.setMutationDefaults(ec(n),s),getMutationDefaults:()=>e.getMutationDefaults(ec(n)),isMutating:()=>e.isMutating({mutationKey:ec(n)})})[r]()});return(0,es.yh)(r=>"client"===r?t:eo.includes(r)?e[r]:n[r])})(e),[e])}:"useQueries"===e?t.useQueries:"useSuspenseQueries"===e?t.useSuspenseQueries:"withTRPC"===e?n:r[e])}({config:()=>({links:[(0,s.ch)({url:"".concat("","/api/trpc"),transformer:Z})]}),ssr:!1})},55134:function(e,t,n){"use strict";let r,i,s,o,a,l,u,c,d,h,f,p,m,g,v,y,_,b,w;var S,E,x,k,T,O,I,C,R,A=n(14841);function P(e,t,n=[t],r="npm"){let i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:A.J})),version:A.J}),e._metadata=i}var M=n(60840),L=n(2005),N=n(46410),D=n(70077),$=n(95050);let j=[];function F(e,t){for(let n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function U(e,t,n){if(n[t.name]){$.X&&L.kg.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,-1===j.indexOf(t.name)&&"function"==typeof t.setupOnce&&(t.setupOnce(),j.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){let n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}$.X&&L.kg.log(`Integration installed: ${t.name}`)}let q=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler"],B=(e={})=>({name:"InboundFilters",processEvent:(t,n,r)=>{var i,s;return((i=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:q],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,r.getOptions())).ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(t)?($.X&&L.kg.warn(`Event dropped due to being internal Sentry Error.
Event: ${(0,N.jH)(t)}`),0):(s=i.ignoreErrors,!t.type&&s&&s.length&&(function(e){let t;let n=[];e.message&&n.push(e.message);try{t=e.exception.values[e.exception.values.length-1]}catch(e){}return t&&t.value&&(n.push(t.value),t.type&&n.push(`${t.type}: ${t.value}`)),n})(t).some(e=>(0,D.U0)(e,s)))?($.X&&L.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${(0,N.jH)(t)}`),0):t.type||!t.exception||!t.exception.values||0===t.exception.values.length||t.message||t.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value)?!function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;let n=e.transaction;return!!n&&(0,D.U0)(n,t)}(t,i.ignoreTransactions)?!function(e,t){if(!t||!t.length)return!1;let n=H(e);return!!n&&(0,D.U0)(n,t)}(t,i.denyUrls)?function(e,t){if(!t||!t.length)return!0;let n=H(e);return!n||(0,D.U0)(n,t)}(t,i.allowUrls)||($.X&&L.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${(0,N.jH)(t)}.
Url: ${H(t)}`),0):($.X&&L.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${(0,N.jH)(t)}.
Url: ${H(t)}`),0):($.X&&L.kg.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${(0,N.jH)(t)}`),0):($.X&&L.kg.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${(0,N.jH)(t)}`),0))?t:null}});function H(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return $.X&&L.kg.error(`Cannot extract url for event ${(0,N.jH)(e)}`),null}}var z=n(39388),W=n(20618);let V=new WeakMap,G=()=>({name:"FunctionToString",setupOnce(){r=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=(0,z.HK)(this),n=V.has((0,W.s3)())&&void 0!==t?t:this;return r.apply(n,e)}}catch(e){}},setup(e){V.set(e,!0)}});var Q=n(22611);let K=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{var n;if((n=e)&&(function(e,t){let n=e.message,r=t.message;return!!((n||r)&&(!n||r)&&(n||!r)&&n===r&&X(e,t)&&J(e,t))}(t,n)||function(e,t){let n=Z(t),r=Z(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&X(e,t)&&J(e,t))}(t,n)))return $.X&&L.kg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return e=t}}};function J(e,t){let n=(0,Q.Fr)(e),r=(0,Q.Fr)(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function X(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function Z(e){return e.exception&&e.exception.values&&e.exception.values[0]}var Y=n(9259),ee=n(86516);let et=ee.GLOBAL_OBJ;function en(){if(!("fetch"in et))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function er(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}let ei={},es={};function eo(e,t){ei[e]=ei[e]||[],ei[e].push(t)}function ea(e,t){es[e]||(t(),es[e]=!0)}function el(e,t){let n=e&&ei[e];if(n)for(let r of n)try{r(t)}catch(t){Y.X&&L.kg.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${(0,Q.$P)(r)}
Error:`,t)}}let eu=ee.GLOBAL_OBJ,ec=ee.GLOBAL_OBJ;function ed(e){let t="history";eo(t,e),ea(t,eh)}function eh(){if(!function(){let e=eu.chrome,t=e&&e.app&&e.app.runtime,n="history"in eu&&!!eu.history.pushState&&!!eu.history.replaceState;return!t&&n}())return;let e=ec.onpopstate;function t(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let e=i,t=String(n);i=t,el("history",{from:e,to:t})}return e.apply(this,t)}}ec.onpopstate=function(...t){let n=ec.location.href,r=i;if(i=n,el("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(e){}},(0,z.hl)(ec.history,"pushState",t),(0,z.hl)(ec.history,"replaceState",t)}let ef=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ep(e,t=!1){let{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${o}`}function em(e){let t=ef.exec(e);if(!t){(0,L.Cf)(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i="",s="",o="",a=""]=t.slice(1),l="",u=a,c=u.split("/");if(c.length>1&&(l=c.slice(0,-1).join("/"),u=c.pop()),u){let e=u.match(/^\d+/);e&&(u=e[0])}return eg({host:s,pass:i,path:l,projectId:u,port:o,protocol:n,publicKey:r})}function eg(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}var ev=n(79836),ey=n(26013),e_=n(2341);function eb(e,t=[]){return[e,t]}function ew(e,t){for(let n of e[1]){let e=n[0].type;if(t(n,e))return!0}return!1}function eS(e){return ee.GLOBAL_OBJ.__SENTRY__&&ee.GLOBAL_OBJ.__SENTRY__.encodePolyfill?ee.GLOBAL_OBJ.__SENTRY__.encodePolyfill(e):new TextEncoder().encode(e)}let eE={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function ex(e){if(!e||!e.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function ek(e,t,n,r){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:ep(r)},...i&&{trace:(0,z.Jr)({...i})}}}class eT extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}var eO=n(95153),eI=n(45049),eC=n(90512),eR=n(59892);function eA(e){if("boolean"==typeof e)return Number(e);let t="string"==typeof e?parseFloat(e):e;if("number"!=typeof t||isNaN(t)||t<0||t>1){$.X&&L.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`);return}return t}var eP=n(74761);let eM="Not capturing exception because it's already been captured.";class eL{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){let t="string"==typeof e?em(e):eg(e);if(t&&function(e){if(!Y.X)return!0;let{port:t,projectId:n,protocol:r}=e;return!["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(L.kg.error(`Invalid Sentry Dsn: ${t} missing`),!0))&&(n.match(/^\d+$/)?"http"===r||"https"===r?!(t&&isNaN(parseInt(t,10)))||(L.kg.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):(L.kg.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(L.kg.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1))}(t))return t}(e.dsn):$.X&&L.kg.warn("No DSN provided, client will not send events."),this._dsn){var t,n,r;let i=(t=this._dsn,n=e.tunnel,r=e._metadata?e._metadata.sdk:void 0,n||`${function(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(t)}${t.projectId}/envelope/?${(0,z._j)({sentry_key:t.publicKey,sentry_version:"7",...r&&{sentry_client:`${r.name}/${r.version}`}})}`);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:i})}}captureException(e,t,n){let r=(0,N.DM)();if((0,N.YO)(e))return $.X&&L.kg.log(eM),r;let i={event_id:r,...t};return this._process(this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n))),i.event_id}captureMessage(e,t,n,r){let i={event_id:(0,N.DM)(),...n},s=(0,ev.Le)(e)?e:String(e),o=(0,ev.pt)(e)?this.eventFromMessage(s,t,i):this.eventFromException(e,i);return this._process(o.then(e=>this._captureEvent(e,i,r))),i.event_id}captureEvent(e,t,n){let r=(0,N.DM)();if(t&&t.originalException&&(0,N.YO)(t.originalException))return $.X&&L.kg.log(eM),r;let i={event_id:r,...t},s=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,i,s||n)),i.event_id}captureSession(e){"string"!=typeof e.release?$.X&&L.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),(0,eR.CT)(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?(this.emit("flush"),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):(0,ey.WD)(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.emit("close"),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];U(this,e,this._integrations),t||F(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){var i;let s=ex(n),o=e.type&&"replay_event"!==e.type?e.type:"event";(i=n&&n.sdk)&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||i.name,e.sdk.version=e.sdk.version||i.version,e.sdk.integrations=[...e.sdk.integrations||[],...i.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...i.packages||[]]);let a=ek(e,s,r,t);return delete e.sdkProcessingMetadata,eb(a,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=function(e,t){let[n,r]=e;return[n,[...r,t]]}(n,function(e){let t="string"==typeof e.data?eS(e.data):e.data;return[(0,z.Jr)({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}(e));let r=this.sendEnvelope(n);r&&r.then(t=>this.emit("afterSendEvent",e,t),null)}sendSession(e){let t=function(e,t,n,r){let i=ex(n);return eb({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:ep(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){let r="number"==typeof n?n:1,i=`${e}:${t}`;$.X&&L.kg.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}on(e,t){let n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{let e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}sendEnvelope(e){return(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)?this._transport.send(e).then(null,e=>($.X&&L.kg.error("Error while sending event:",e),e)):($.X&&L.kg.error("Transport disabled"),(0,ey.WD)({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=function(e,t){let n={};return t.forEach(t=>{t&&U(e,t,n)}),n}(this,e),F(this,e)}_updateSessionFromEvent(e,t){let n=!1,r=!1,i=t.exception&&t.exception.values;if(i)for(let e of(r=!0,i)){let t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}let s="ok"===e.status;(s&&0===e.errors||s&&n)&&((0,eR.CT)(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new ey.cW(t=>{let n=0,r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r=(0,W.aF)()){let i=this.getOptions(),s=Object.keys(this._integrations);return!t.integrations&&s.length>0&&(t.integrations=s),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),(0,eP.R)(i,e,t,n,this,r).then(e=>{if(null===e)return e;let t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if(!(e.contexts&&e.contexts.trace)&&t){let{traceId:n,spanId:r,parentSpanId:i,dsc:s}=t;e.contexts={trace:(0,z.Jr)({trace_id:n,span_id:r,parent_span_id:i}),...e.contexts};let o=s||(0,eI._l)(n,this);e.sdkProcessingMetadata={dynamicSamplingContext:o,...e.sdkProcessingMetadata}}return e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{$.X&&("log"===e.logLevel?L.kg.log(e.message):L.kg.warn(e))})}_processEvent(e,t,n){let r=this.getOptions(),{sampleRate:i}=r,s=eD(e),o=eN(e),a=e.type||"error",l=`before send for type \`${a}\``,u=void 0===i?void 0:eA(i);if(o&&"number"==typeof u&&Math.random()>u)return this.recordDroppedEvent("sample_rate","error",e),(0,ey.$2)(new eT(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let c="replay_event"===a?"replay":a,d=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,d).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",c,e),new eT("An event processor returned `null`, will not send event.","log");return t.data&&!0===t.data.__sentry__?n:function(e,t){let n=`${t} must return \`null\` or a valid event.`;if((0,ev.J8)(e))return e.then(e=>{if(!(0,ev.PO)(e)&&null!==e)throw new eT(n);return e},e=>{throw new eT(`${t} rejected with ${e}`)});if(!(0,ev.PO)(e)&&null!==e)throw new eT(n);return e}(function(e,t,n,r){let{beforeSend:i,beforeSendTransaction:s,beforeSendSpan:o}=t;if(eN(n)&&i)return i(n,r);if(eD(n)){if(n.spans&&o){let t=[];for(let r of n.spans){let n=o(r);n?t.push(n):e.recordDroppedEvent("before_send","span")}n.spans=t}if(s){if(n.spans){let e=n.spans.length;n.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return s(n,r)}}return n}(this,r,n,t),l)}).then(r=>{if(null===r){if(this.recordDroppedEvent("before_send",c,e),s){let t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw new eT(`${l} returned \`null\`, will not send event.`,"log")}let i=n&&n.getSession();if(!s&&i&&this._updateSessionFromEvent(i,r),s){let e=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}let o=r.transaction_info;return s&&o&&r.transaction!==e.transaction&&(r.transaction_info={...o,source:"custom"}),this.sendEvent(r,t),r}).then(null,e=>{if(e instanceof eT)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new eT(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${e}`)})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){var e;$.X&&L.kg.log("Flushing outcomes...");let t=this._clearOutcomes();if(0===t.length){$.X&&L.kg.log("No outcomes to send");return}if(!this._dsn){$.X&&L.kg.log("No dsn provided, will not send outcomes");return}$.X&&L.kg.log("Sending outcomes:",t);let n=eb((e=this._options.tunnel&&ep(this._dsn))?{dsn:e}:{},[[{type:"client_report"},{timestamp:(0,eO.yW)(),discarded_events:t}]]);this.sendEnvelope(n)}}function eN(e){return void 0===e.type}function eD(e){return"transaction"===e.type}let e$="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function ej(e,t){let n=eU(e,t),r={type:function(e){let t=e&&e.name;return!t&&eB(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}(t),value:function(e){let t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:eB(e)&&Array.isArray(e.message)&&2==e.message.length?e.message[1]:t:"No error message"}(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function eF(e,t){return{exception:{values:[ej(e,t)]}}}function eU(e,t){let n=t.stacktrace||t.stack||"",r=t&&eq.test(t.message)?1:0,i="number"==typeof t.framesToPop?t.framesToPop:0;try{return e(n,r,i)}catch(e){}return[]}let eq=/Minified React error #\d+;/i;function eB(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function eH(e,t,n,r,i){let s;if((0,ev.VW)(t)&&t.error)return eF(e,t.error);if((0,ev.TX)(t)||(0,ev.fm)(t)){if("stack"in t)s=eF(e,t);else{let i=t.name||((0,ev.TX)(t)?"DOMError":"DOMException"),o=t.message?`${i}: ${t.message}`:i;s=ez(e,o,n,r),(0,N.Db)(s,o)}return"code"in t&&(s.tags={...s.tags,"DOMException.code":`${t.code}`}),s}return(0,ev.VZ)(t)?eF(e,t):((0,ev.PO)(t)||(0,ev.cO)(t)?s=function(e,t,n,r){let i=(0,W.s3)(),s=i&&i.getOptions().normalizeDepth,o=function(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}(t),a={__serialized__:(0,e_.Qy)(t,s)};if(o)return{exception:{values:[ej(e,o)]},extra:a};let l={exception:{values:[{type:(0,ev.cO)(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:function(e,{isUnhandledRejection:t}){let n=(0,z.zf)(e),r=t?"promise rejection":"exception";if((0,ev.VW)(e))return`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``;if((0,ev.cO)(e)){let t=function(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e);return`Event \`${t}\` (type=${e.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}(t,{isUnhandledRejection:r})}]},extra:a};if(n){let t=eU(e,n);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}(e,t,n,i):(s=ez(e,t,n,r),(0,N.Db)(s,`${t}`,void 0)),(0,N.EG)(s,{synthetic:!0}),s)}function ez(e,t,n,r){let i={};if(r&&n){let r=eU(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}if((0,ev.Le)(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}let eW=ee.GLOBAL_OBJ,eV=0;function eG(e,t={},n){if("function"!=typeof e)return e;try{let t=e.__sentry_wrapped__;if(t){if("function"==typeof t)return t;return e}if((0,z.HK)(e))return e}catch(t){return e}let r=function(){let r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);let i=r.map(e=>eG(e,t));return e.apply(this,i)}catch(e){throw eV++,setTimeout(()=>{eV--}),(0,W.$e)(n=>{n.addEventProcessor(e=>(t.mechanism&&((0,N.Db)(e,void 0,void 0),(0,N.EG)(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),(0,M.Tb)(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(e){}(0,z.$Q)(r,e),(0,z.xp)(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(e){}return r}class eQ extends eL{constructor(e){let t={parentSpanIsAlwaysRootSpan:!0,...e};P(t,"browser",["browser"],eW.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&eW.document&&eW.document.addEventListener("visibilitychange",()=>{"hidden"===eW.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){let i=eH(e,t,n&&n.syntheticException||void 0,r);return(0,N.EG)(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),(0,ey.WD)(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){let s=ez(e,t,r&&r.syntheticException||void 0,i);return s.level=n,r&&r.event_id&&(s.event_id=r.event_id),(0,ey.WD)(s)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){e$&&L.kg.warn("SDK not enabled, will not capture user feedback.");return}let t=function(e,{metadata:t,tunnel:n,dsn:r}){return eb({event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:ep(r)}},[[{type:"user_report"},e]])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}}function eK(e){eo("dom",e),ea("dom",eJ)}function eJ(){if(!ec.document)return;let e=el.bind(null,"dom"),t=eX(e,!0);ec.document.addEventListener("click",t,!1),ec.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{let n=ec[t]&&ec[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,z.hl)(n,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},s=r[n]=r[n]||{refCount:0};if(!s.handler){let r=eX(e);s.handler=r,t.call(this,n,r,i)}s.refCount++}catch(e){}return t.call(this,n,r,i)}}),(0,z.hl)(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}}))})}function eX(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=function(e){try{return e.target}catch(e){return null}}(n);if("keypress"===n.type&&(!r||!r.tagName||"INPUT"!==r.tagName&&"TEXTAREA"!==r.tagName&&!r.isContentEditable))return;(0,z.xp)(n,"_sentryCaptured",!0),r&&!r._sentryId&&(0,z.xp)(r,"_sentryId",(0,N.DM)());let i="keypress"===n.type?"input":n.type;!function(e){if(e.type!==o)return!1;try{if(!e.target||e.target._sentryId!==a)return!1}catch(e){}return!0}(n)&&(e({event:n,name:i,global:t}),o=n.type,a=r?r._sentryId:void 0),clearTimeout(s),s=ec.setTimeout(()=>{a=void 0,o=void 0},1e3)}}let eZ="__sentry_xhr_v3__";function eY(e){eo("xhr",e),ea("xhr",e0)}function e0(){if(!ec.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=1e3*(0,eO.ph)(),i=(0,ev.HD)(n[0])?n[0].toUpperCase():void 0,s=function(e){if((0,ev.HD)(e))return e;try{return e.toString()}catch(e){}}(n[1]);if(!i||!s)return e.apply(t,n);t[eZ]={method:i,url:s,request_headers:{}},"POST"===i&&s.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let o=()=>{let e=t[eZ];if(e&&4===t.readyState){try{e.status_code=t.status}catch(e){}el("xhr",{endTimestamp:1e3*(0,eO.ph)(),startTimestamp:r,xhr:t})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(o(),e.apply(t,n))}):t.addEventListener("readystatechange",o),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,s=t[eZ];return s&&(0,ev.HD)(r)&&(0,ev.HD)(i)&&(s.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[eZ];return r&&(void 0!==n[0]&&(r.body=n[0]),el("xhr",{startTimestamp:1e3*(0,eO.ph)(),xhr:t})),e.apply(t,n)}})}var e1=n(66569);function e2(){"console"in ee.GLOBAL_OBJ&&L.RU.forEach(function(e){e in ee.GLOBAL_OBJ.console&&(0,z.hl)(ee.GLOBAL_OBJ.console,e,function(t){return L.LD[e]=t,function(...t){el("console",{args:t,level:e});let n=L.LD[e];n&&n.apply(ee.GLOBAL_OBJ.console,t)}})})}function e3(e,t){let n="fetch";eo(n,e),ea(n,()=>e5(void 0,t))}function e5(e,t=!1){(!t||function(){if("string"==typeof EdgeRuntime)return!0;if(!en())return!1;if(er(et.fetch))return!0;let e=!1,t=et.document;if(t&&"function"==typeof t.createElement)try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=er(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){Y.X&&L.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}())&&(0,z.hl)(ee.GLOBAL_OBJ,"fetch",function(t){return function(...n){let{method:r,url:i}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){let[t,n]=e;return{url:e7(t),method:e8(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:e7(t),method:e8(t,"method")?String(t.method).toUpperCase():"GET"}}(n),s={args:n,fetchData:{method:r,url:i},startTimestamp:1e3*(0,eO.ph)()};e||el("fetch",{...s});let o=Error().stack;return t.apply(ee.GLOBAL_OBJ,n).then(async t=>(e?e(t):el("fetch",{...s,endTimestamp:1e3*(0,eO.ph)(),response:t}),t),e=>{throw el("fetch",{...s,endTimestamp:1e3*(0,eO.ph)(),error:e}),(0,ev.VZ)(e)&&void 0===e.stack&&(e.stack=o,(0,z.xp)(e,"framesToPop",1)),e})}})}async function e4(e,t){if(e&&e.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},9e4),s=!0;for(;s;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),s=!1)}catch(e){s=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function e6(e){let t;try{t=e.clone()}catch(e){return}e4(t,()=>{el("fetch-body-resolved",{endTimestamp:1e3*(0,eO.ph)(),response:e})})}function e8(e,t){return!!e&&"object"==typeof e&&!!e[t]}function e7(e){return"string"==typeof e?e:e?e8(e,"url")?e.url:e.toString?e.toString():"":""}var e9=n(85026);let te=["fatal","error","warning","log","info","debug"];function tt(e){return"warn"===e?"warning":te.includes(e)?e:"log"}function tn(e){if(void 0!==e)return e>=400&&e<500?"warning":e>=500?"error":void 0}function tr(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}let ti=(e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){let t="console";eo(t,e),ea(t,e2)}(function(t){if((0,W.s3)()!==e)return;let n={category:"console",data:{arguments:t.args,logger:"console"},level:tt(t.level),message:(0,D.nK)(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${(0,D.nK)(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}(0,e1.n)(n,{input:t.args,level:t.level})}),t.dom&&eK((n=t.dom,function(t){let r,i;if((0,W.s3)()!==e)return;let s="object"==typeof n?n.serializeAttribute:void 0,o="object"==typeof n&&"number"==typeof n.maxStringLength?n.maxStringLength:void 0;o&&o>1024&&(e$&&L.kg.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof s&&(s=[s]);try{let e=t.event,n=e&&e.target?e.target:e;r=(0,e9.Rt)(n,{keyAttrs:s,maxStringLength:o}),i=(0,e9.iY)(n)}catch(e){r="<unknown>"}if(0===r.length)return;let a={category:`ui.${t.name}`,message:r};i&&(a.data={"ui.component_name":i}),(0,e1.n)(a,{event:t.event,name:t.name,global:t.global})})),t.xhr&&eY(function(t){if((0,W.s3)()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[eZ];if(!n||!r||!i)return;let{method:s,url:o,status_code:a,body:l}=i,u={xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r},c=tn(a);(0,e1.n)({category:"xhr",data:{method:s,url:o,status_code:a},type:"http",level:c},u)}),t.fetch&&e3(function(t){if((0,W.s3)()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(!(!r||t.fetchData.url.match(/sentry_key/)&&"POST"===t.fetchData.method)){if(t.error){let e=t.fetchData,i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r};(0,e1.n)({category:"fetch",data:e,level:"error",type:"http"},i)}else{let e=t.response,i={...t.fetchData,status_code:e&&e.status},s={input:t.args,response:e,startTimestamp:n,endTimestamp:r},o=tn(i.status_code);(0,e1.n)({category:"fetch",data:i,type:"http",level:o},s)}}}),t.history&&ed(function(t){if((0,W.s3)()!==e)return;let n=t.from,r=t.to,i=tr(eW.location.href),s=n?tr(n):void 0,o=tr(r);s&&s.path||(s=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===s.protocol&&i.host===s.host&&(n=s.relative),(0,e1.n)({category:"navigation",data:{from:n,to:r}})}),t.sentry&&e.on("beforeSendEvent",function(t){(0,W.s3)()===e&&(0,e1.n)({category:`sentry.${"transaction"===t.type?"transaction":"event"}`,event_id:t.event_id,level:t.level,message:(0,N.jH)(t)},{event:t})})}}},ts=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],to=(e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&(0,z.hl)(eW,"setTimeout",ta),t.setInterval&&(0,z.hl)(eW,"setInterval",ta),t.requestAnimationFrame&&(0,z.hl)(eW,"requestAnimationFrame",tl),t.XMLHttpRequest&&"XMLHttpRequest"in eW&&(0,z.hl)(XMLHttpRequest.prototype,"send",tu);let e=t.eventTarget;e&&(Array.isArray(e)?e:ts).forEach(tc)}}};function ta(e){return function(...t){let n=t[0];return t[0]=eG(n,{mechanism:{data:{function:(0,Q.$P)(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function tl(e){return function(t){return e.apply(this,[eG(t,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,Q.$P)(e)},handled:!1,type:"instrument"}})])}}function tu(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&(0,z.hl)(n,e,function(t){let n={mechanism:{data:{function:e,handler:(0,Q.$P)(t)},handled:!1,type:"instrument"}},r=(0,z.HK)(t);return r&&(n.mechanism.data.handler=(0,Q.$P)(r)),eG(t,n)})}),e.apply(this,t)}}function tc(e){let t=eW[e]&&eW[e].prototype;t&&t.hasOwnProperty&&t.hasOwnProperty("addEventListener")&&((0,z.hl)(t,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=eG(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,Q.$P)(r),target:e},handled:!1,type:"instrument"}}))}catch(e){}return t.apply(this,[n,eG(r,{mechanism:{data:{function:"addEventListener",handler:(0,Q.$P)(r),target:e},handled:!1,type:"instrument"}}),i])}}),(0,z.hl)(t,"removeEventListener",function(e){return function(t,n,r){try{let i=n&&n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(e){}return e.call(this,t,n,r)}}))}let td=null;function th(e){let t="error";eo(t,e),ea(t,tf)}function tf(){td=ee.GLOBAL_OBJ.onerror,ee.GLOBAL_OBJ.onerror=function(e,t,n,r,i){return el("error",{column:r,error:i,line:n,msg:e,url:t}),!!td&&!td.__SENTRY_LOADER__&&td.apply(this,arguments)},ee.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__=!0}let tp=null;function tm(e){let t="unhandledrejection";eo(t,e),ea(t,tg)}function tg(){tp=ee.GLOBAL_OBJ.onunhandledrejection,ee.GLOBAL_OBJ.onunhandledrejection=function(e){return el("unhandledrejection",e),!tp||!!tp.__SENTRY_LOADER__||tp.apply(this,arguments)},ee.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let tv=(e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(th(t=>{let{stackParser:n,attachStacktrace:r}=t_();if((0,W.s3)()!==e||eV>0)return;let{msg:i,url:s,line:o,column:a,error:l}=t,u=function(e,t,n,r){let i=e.exception=e.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},a=o.stacktrace=o.stacktrace||{},l=a.frames=a.frames||[],u=isNaN(parseInt(r,10))?void 0:r,c=isNaN(parseInt(n,10))?void 0:n,d=(0,ev.HD)(t)&&t.length>0?t:(0,e9.l4)();return 0===l.length&&l.push({colno:u,filename:d,function:Q.Fi,in_app:!0,lineno:c}),e}(eH(n,l||i,void 0,r,!1),s,o,a);u.level="error",(0,M.eN)(u,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}),ty("onerror")),t.onunhandledrejection&&(tm(t=>{let{stackParser:n,attachStacktrace:r}=t_();if((0,W.s3)()!==e||eV>0)return;let i=function(e){if((0,ev.pt)(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t),s=(0,ev.pt)(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:eH(n,i,void 0,r,!0);s.level="error",(0,M.eN)(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})}),ty("onunhandledrejection"))}}};function ty(e){e$&&L.kg.log(`Global Handler attached: ${e}`)}function t_(){let e=(0,W.s3)();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}let tb=()=>({name:"HttpContext",preprocessEvent(e){if(!eW.navigator&&!eW.location&&!eW.document)return;let t=e.request&&e.request.url||eW.location&&eW.location.href,{referrer:n}=eW.document||{},{userAgent:r}=eW.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...e.request,...t&&{url:t},headers:i};e.request=s}});function tw(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function tS(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}let tE=(e={})=>{let t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,i){let s=i.getOptions();!function(e,t,n=250,r,i,s,o){if(!s.exception||!s.exception.values||!o||!(0,ev.V9)(o.originalException,Error))return;let a=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;a&&(s.exception.values=(function e(t,n,r,i,s,o,a,l){if(o.length>=r+1)return o;let u=[...o];if((0,ev.V9)(i[s],Error)){tw(a,l);let o=t(n,i[s]),c=u.length;tS(o,s,c,l),u=e(t,n,r,i[s],s,[o,...u],o,c)}return Array.isArray(i.errors)&&i.errors.forEach((i,o)=>{if((0,ev.V9)(i,Error)){tw(a,l);let c=t(n,i),d=u.length;tS(c,`errors[${o}]`,d,l),u=e(t,n,r,i,s,[c,...u],c,d)}}),u})(e,t,i,o.originalException,r,s.exception.values,a,0).map(e=>(e.value&&(e.value=(0,D.$G)(e.value,n)),e)))}(ej,s.stackParser,s.maxValueLength,n,t,e,r)}}};function tx(e,t,n,r){let i={filename:e,function:"<anonymous>"===t?Q.Fi:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}let tk=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tO=/\((\S*)(?::(\d+))(?::(\d+))\)/,tI=[30,e=>{let t=tk.exec(e);if(t){let[,e,n,r]=t;return tx(e,Q.Fi,+n,+r)}let n=tT.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){let e=tO.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}let[e,t]=tM(n[1]||Q.Fi,n[2]);return tx(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],tC=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tR=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tA=[50,e=>{let t=tC.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let e=tR.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Q.Fi;return[n,e]=tM(n,e),tx(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],tP=(0,Q.pE)(tI,tA),tM=(e,t)=>{let n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Q.Fi,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},tL="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,tN={};function tD(e){let t=tN[e];if(t)return t;let n=ec[e];if(er(n))return tN[e]=n.bind(ec);let r=ec.document;if(r&&"function"==typeof r.createElement)try{let t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){tL&&L.kg.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?tN[e]=n.bind(ec):n}function t$(...e){return tD("setTimeout")(...e)}function tj(e,t,n=Date.now()){return(e[t]||e.all||0)>n}function tF(e,{statusCode:t,headers:n},r=Date.now()){let i={...e},s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(let e of s.trim().split(",")){let[t,n,,,s]=e.split(":",5),o=parseInt(t,10),a=(isNaN(o)?60:o)*1e3;if(n)for(let e of n.split(";"))"metric_bucket"===e?(!s||s.split(";").includes("custom"))&&(i[e]=r+a):i[e]=r+a;else i.all=r+a}else o?i.all=r+function(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,r):429===t&&(i.all=r+6e4);return i}function tU(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function tq(e,t=tD("fetch")){let n=0,r=0;return function(e,t,n=function(e){let t=[];function n(e){return t.splice(t.indexOf(e),1)[0]||Promise.resolve(void 0)}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return(0,ey.$2)(new eT("Not adding Promise because buffer limit was reached."));let i=r();return -1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new ey.cW((n,r)=>{let i=t.length;if(!i)return n(!0);let s=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{(0,ey.WD)(e).then(()=>{--i||(clearTimeout(s),n(!0))},r)})})}}}(e.bufferSize||64)){let r={};return{send:function(i){let s=[];if(ew(i,(t,n)=>{let i=eE[n];if(tj(r,i)){let r=tU(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else s.push(t)}),0===s.length)return(0,ey.WD)({});let o=eb(i[0],s),a=t=>{ew(o,(n,r)=>{let i=tU(n,r);e.recordDroppedEvent(t,eE[r],i)})};return n.add(()=>t({body:function(e){let[t,n]=e,r=JSON.stringify(t);function i(e){"string"==typeof r?r="string"==typeof e?r+e:[eS(r),e]:r.push("string"==typeof e?eS(e):e)}for(let e of n){let[t,n]=e;if(i(`
${JSON.stringify(t)}
`),"string"==typeof n||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch(t){e=JSON.stringify((0,e_.Fv)(n))}i(e)}}return"string"==typeof r?r:function(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}(r)}(o)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&$.X&&L.kg.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=tF(r,e),e),e=>{throw a("network_error"),e})).then(e=>e,e=>{if(e instanceof eT)return $.X&&L.kg.error("Skipped sending event because buffer is full."),a("queue_overflow"),(0,ey.WD)({});throw e})},flush:e=>n.drain(e)}}(e,function(i){let s=i.body.length;n+=s,r++;let o={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return tN.fetch=void 0,(0,ey.$2)("No fetch implementation available");try{return t(e.url,o).then(e=>(n-=s,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(e){return tN.fetch=void 0,n-=s,r--,(0,ey.$2)(e)}})}function tB(e){return[B(),G(),to(),ti(),tv(),tE(),K(),tb()]}var tH=n(75271),tz=n(14224),tW=n(71270),tV=n(81198),tG=n(99173),tQ=n(63119),tK=n(35378);class tJ{constructor(e={}){this._traceId=e.traceId||(0,N.DM)(),this._spanId=e.spanId||(0,N.DM)().substring(16)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:eC.ve}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}}var tX=n(37833);function tZ(e){if(!e||0===e.length)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[tG.E1],i=n[tG.Wb];"string"==typeof r&&"number"==typeof i&&(t[e.name]={value:i,unit:r})}),t}let tY="_sentryScope",t0="_sentryIsolationScope";function t1(e){return{scope:e[tY],isolationScope:e[t0]}}class t2{constructor(e={}){this._traceId=e.traceId||(0,N.DM)(),this._spanId=e.spanId||(0,N.DM)().substring(16),this._startTime=e.startTimestamp||(0,eO.ph)(),this._attributes={},this.setAttributes({[tG.S3]:"manual",[tG.$J]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this}addLinks(e){return this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:n?eC.i0:eC.ve}}setAttribute(e,t){return void 0===t?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=(0,eC.$k)(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this}end(e){this._endTime||(this._endTime=(0,eC.$k)(e),function(e){if(!$.X)return;let{description:t="< unknown name >",op:n="< unknown op >"}=(0,eC.XU)(e),{spanId:r}=e.spanContext(),i=(0,eC.Gx)(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;L.kg.log(s)}(this),this._onSpanEnded())}getSpanJSON(){return(0,z.Jr)({data:this._attributes,description:this._name,op:this._attributes[tG.$J],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:(0,eC._4)(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[tG.S3],_metrics_summary:(0,tX.y)(this),profile_id:this._attributes[tG.p6],exclusive_time:this._attributes[tG.JQ],measurements:tZ(this._events),is_segment:this._isStandaloneSpan&&(0,eC.Gx)(this)===this||void 0,segment_id:this._isStandaloneSpan?(0,eC.Gx)(this).spanContext().spanId:void 0})}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){$.X&&L.kg.log("[Tracing] Adding an event to span:",e);let r=t3(t)?t:n||(0,eO.ph)(),i=t3(t)?{}:t||{},s={name:e,time:(0,eC.$k)(r),attributes:i};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=(0,W.s3)();if(e&&e.emit("spanEnd",this),!(this._isStandaloneSpan||this===(0,eC.Gx)(this)))return;if(this._isStandaloneSpan){this._sampled?function(e){let t=(0,W.s3)();if(!t)return;let n=e[1];if(!n||0===n.length){t.recordDroppedEvent("before_send","span");return}let r=t.getTransport();r&&r.send(e).then(null,e=>{$.X&&L.kg.error("Error while sending span:",e)})}(function(e,t){let n=(0,eI.jC)(e[0]),r=t&&t.getDsn(),i=t&&t.getOptions().tunnel,s={sent_at:new Date().toISOString(),...!!n.trace_id&&!!n.public_key&&{trace:n},...!!i&&r&&{dsn:ep(r)}},o=t&&t.getOptions().beforeSendSpan,a=o?e=>o((0,eC.XU)(e)):e=>(0,eC.XU)(e),l=[];for(let t of e){let e=a(t);e&&l.push([{type:"span"},e])}return eb(s,l)}([this],e)):($.X&&L.kg.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}let t=this._convertSpanToTransaction();t&&(t1(this).scope||(0,W.nZ)()).captureEvent(t)}_convertSpanToTransaction(){if(!t5((0,eC.XU)(this)))return;this._name||($.X&&L.kg.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:e,isolationScope:t}=t1(this),n=(e||(0,W.nZ)()).getClient()||(0,W.s3)();if(!0!==this._sampled){$.X&&L.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}let r=(0,eC.Dp)(this).filter(e=>e!==this&&!(e instanceof t2&&e.isStandaloneSpan())).map(e=>(0,eC.XU)(e)).filter(t5),i=this._attributes[tG.Zj],s={contexts:{trace:(0,eC.HR)(this)},spans:r.length>1e3?r.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,1e3):r,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,...(0,z.Jr)({dynamicSamplingContext:(0,eI.jC)(this)})},_metrics_summary:(0,tX.y)(this),...i&&{transaction_info:{source:i}}},o=tZ(this._events);return o&&Object.keys(o).length&&($.X&&L.kg.log("[Measurements] Adding measurements to transaction event",JSON.stringify(o,void 0,2)),s.measurements=o),s}}function t3(e){return e&&"number"==typeof e||e instanceof Date||Array.isArray(e)}function t5(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}let t4="__SENTRY_SUPPRESS_TRACING__";function t6(e){let t=t7();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=function(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=(0,eC.$k)(e.startTime),delete n.startTime,n}return t}(e),{forceTransaction:r,parentSpan:i}=e;return(e.scope?t=>(0,W.$e)(e.scope,t):void 0!==i?e=>t8(i,e):e=>e())(()=>{let t=(0,W.nZ)(),i=function(e){let t=(0,tK.Y)(e);if(!t)return;let n=(0,W.s3)();return(n?n.getOptions():{}).parentSpanIsAlwaysRootSpan?(0,eC.Gx)(t):t}(t);return e.onlyIfParent&&!i?new tJ:function({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){var i;let s;if(!(0,tQ.z)())return new tJ;let o=(0,W.aF)();if(e&&!n)s=function(e,t,n){let{spanId:r,traceId:i}=e.spanContext(),s=!t.getScopeData().sdkProcessingMetadata[t4]&&(0,eC.Tt)(e),o=s?new t2({...n,parentSpanId:r,traceId:i,sampled:s}):new tJ({traceId:i});(0,eC.j5)(e,o);let a=(0,W.s3)();return a&&(a.emit("spanStart",o),n.endTimestamp&&a.emit("spanEnd",o)),o}(e,r,t),(0,eC.j5)(e,s);else if(e){let n=(0,eI.jC)(e),{traceId:i,spanId:o}=e.spanContext(),a=(0,eC.Tt)(e);s=t9({traceId:i,parentSpanId:o,...t},r,a),(0,eI.Lh)(s,n)}else{let{traceId:e,dsc:n,parentSpanId:i,sampled:a}={...o.getPropagationContext(),...r.getPropagationContext()};s=t9({traceId:e,parentSpanId:i,...t},r,a),n&&(0,eI.Lh)(s,n)}return function(e){if(!$.X)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=(0,eC.XU)(e),{spanId:i}=e.spanContext(),s=(0,eC.Tt)(e),o=(0,eC.Gx)(e),a=o===e,l=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&u.push(`parent ID: ${r}`),!a){let{op:e,description:t}=(0,eC.XU)(o);u.push(`root ID: ${o.spanContext().spanId}`),e&&u.push(`root op: ${e}`),t&&u.push(`root description: ${t}`)}L.kg.log(`${l}
  ${u.join("\n  ")}`)}(s),(i=s)&&((0,z.xp)(i,t0,o),(0,z.xp)(i,tY,r)),s}({parentSpan:i,spanArguments:n,forceTransaction:r,scope:t})})}function t8(e,t){let n=t7();return n.withActiveSpan?n.withActiveSpan(e,t):(0,W.$e)(n=>((0,tK.D)(n,e||void 0),t(n)))}function t7(){let e=(0,tW.c)();return(0,tV.G)(e)}function t9(e,t,n){let r=(0,W.s3)(),i=r&&r.getOptions()||{},{name:s="",attributes:o}=e,[a,l]=t.getScopeData().sdkProcessingMetadata[t4]?[!1]:function(e,t){let n;if(!(0,tQ.z)(e))return[!1];let r=eA(n="function"==typeof e.tracesSampler?e.tracesSampler(t):void 0!==t.parentSampled?t.parentSampled:void 0!==e.tracesSampleRate?e.tracesSampleRate:1);return void 0===r?($.X&&L.kg.warn("[Tracing] Discarding transaction because of invalid sample rate."),[!1]):r?Math.random()<r?[!0,r]:($.X&&L.kg.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(n)})`),[!1,r]):($.X&&L.kg.log(`[Tracing] Discarding transaction because ${"function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,r])}(i,{name:s,parentSampled:n,attributes:o,transactionContext:{name:s,parentSampled:n}}),u=new t2({...e,attributes:{[tG.Zj]:"custom",...e.attributes},sampled:a});return void 0!==l&&u.setAttribute(tG.TE,l),r&&r.emit("spanStart",u),u}function ne(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):("call"===i||"optionalCall"===i)&&(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}let nt=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",nn=(e,t,n,r)=>{let i,s;return o=>{t.value>=0&&(o||r)&&((s=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=s,t.rating=nt(t.value,n),e(t))}},nr=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,ni=()=>ec.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],ns=()=>{let e=ni();return e&&e.activationStart||0},no=(e,t)=>{let n=ni(),r="navigate";return n&&(ec.document&&ec.document.prerendering||ns()>0?r="prerender":ec.document&&ec.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:nr(),navigationType:r}},na=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},nl=e=>{let t=t=>{("pagehide"===t.type||ec.document&&"hidden"===ec.document.visibilityState)&&e(t)};ec.document&&(addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0))},nu=e=>{let t=!1;return n=>{t||(e(n),t=!0)}},nc=-1,nd=()=>{nc="hidden"!==ec.document.visibilityState||ec.document.prerendering?1/0:0},nh=e=>{"hidden"===ec.document.visibilityState&&nc>-1&&(nc="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("visibilitychange",nh,!0),removeEventListener("prerenderingchange",nh,!0))},nf=()=>{addEventListener("visibilitychange",nh,!0),addEventListener("prerenderingchange",nh,!0)},np=()=>(ec.document&&nc<0&&(nd(),nf()),{get firstHiddenTime(){return nc}}),nm=e=>{ec.document&&ec.document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},ng=[1800,3e3],nv=(e,t={})=>{nm(()=>{let n;let r=np(),i=no("FCP"),s=na("paint",e=>{e.forEach(e=>{"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-ns(),0),i.entries.push(e),n(!0)))})});s&&(n=nn(e,i,ng,t.reportAllChanges))})},ny=[.1,.25],n_=(e,t={})=>{nv(nu(()=>{let n;let r=no("CLS",0),i=0,s=[],o=e=>{e.forEach(e=>{if(!e.hadRecentInput){let t=s[0],n=s[s.length-1];i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,s.push(e)):(i=e.value,s=[e])}}),i>r.value&&(r.value=i,r.entries=s,n())},a=na("layout-shift",o);a&&(n=nn(e,r,ny,t.reportAllChanges),nl(()=>{o(a.takeRecords()),n(!0)}),setTimeout(n,0))}))},nb=[100,300],nw=(e,t={})=>{nm(()=>{let n;let r=np(),i=no("FID"),s=e=>{e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},o=e=>{e.forEach(s)},a=na("first-input",o);n=nn(e,i,nb,t.reportAllChanges),a&&nl(nu(()=>{o(a.takeRecords()),a.disconnect()}))})},nS=0,nE=1/0,nx=0,nk=e=>{e.forEach(e=>{e.interactionId&&(nE=Math.min(nE,e.interactionId),nS=(nx=Math.max(nx,e.interactionId))?(nx-nE)/7+1:0)})},nT=()=>l?nS:performance.interactionCount||0,nO=()=>{"interactionCount"in performance||l||(l=na("event",nk,{type:"event",buffered:!0,durationThreshold:0}))},nI=[200,500],nC=()=>nT()-0,nR=[],nA={},nP=e=>{let t=nR[nR.length-1],n=nA[e.interactionId];if(n||nR.length<10||t&&e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{let t={id:e.interactionId,latency:e.duration,entries:[e]};nA[t.id]=t,nR.push(t)}nR.sort((e,t)=>t.latency-e.latency),nR.splice(10).forEach(e=>{delete nA[e.id]})}},nM=()=>{let e=Math.min(nR.length-1,Math.floor(nC()/50));return nR[e]},nL=(e,t={})=>{nm(()=>{let n;nO();let r=no("INP"),i=e=>{e.forEach(e=>{e.interactionId&&nP(e),"first-input"!==e.entryType||nR.some(t=>t.entries.some(t=>e.duration===t.duration&&e.startTime===t.startTime))||nP(e)});let t=nM();t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,n())},s=na("event",i,{durationThreshold:null!=t.durationThreshold?t.durationThreshold:40});n=nn(e,r,nI,t.reportAllChanges),s&&("PerformanceEventTiming"in ec&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),nl(()=>{i(s.takeRecords()),r.value<0&&nC()>0&&(r.value=0,r.entries=[]),n(!0)}))})},nN=[2500,4e3],nD={},n$=(e,t={})=>{nm(()=>{let n;let r=np(),i=no("LCP"),s=e=>{let t=e[e.length-1];t&&t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-ns(),0),i.entries=[t],n())},o=na("largest-contentful-paint",s);if(o){n=nn(e,i,nN,t.reportAllChanges);let r=nu(()=>{nD[i.id]||(s(o.takeRecords()),o.disconnect(),nD[i.id]=!0,n(!0))});["keydown","click"].forEach(e=>{ec.document&&addEventListener(e,()=>setTimeout(r,0),!0)}),nl(r)}})},nj=[800,1800],nF=e=>{ec.document&&ec.document.prerendering?nm(()=>nF(e)):ec.document&&"complete"!==ec.document.readyState?addEventListener("load",()=>nF(e),!0):setTimeout(e,0)},nU=(e,t={})=>{let n=no("TTFB"),r=nn(e,n,nj,t.reportAllChanges);nF(()=>{let e=ni();if(e){let t=e.responseStart;if(t<=0||t>performance.now())return;n.value=Math.max(t-ns(),0),n.entries=[e],r(!0)}})},nq={},nB={};function nH(e,t=!1){return n0("cls",e,nK,u,t)}function nz(e,t=!1){return n0("lcp",e,nX,d,t)}function nW(e){return n0("fid",e,nJ,c)}function nV(e){return n0("inp",e,nY,f)}function nG(e,t){return n1(e,t),nB[e]||(function(e){let t={};"event"===e&&(t.durationThreshold=0),na(e,t=>{nQ(e,{entries:t})},t)}(e),nB[e]=!0),n2(e,t)}function nQ(e,t){let n=nq[e];if(n&&n.length)for(let r of n)try{r(t)}catch(t){tL&&L.kg.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${(0,Q.$P)(r)}
Error:`,t)}}function nK(){return n_(e=>{nQ("cls",{metric:e}),u=e},{reportAllChanges:!0})}function nJ(){return nw(e=>{nQ("fid",{metric:e}),c=e})}function nX(){return n$(e=>{nQ("lcp",{metric:e}),d=e},{reportAllChanges:!0})}function nZ(){return nU(e=>{nQ("ttfb",{metric:e}),h=e})}function nY(){return nL(e=>{nQ("inp",{metric:e}),f=e})}function n0(e,t,n,r,i=!1){let s;return n1(e,t),nB[e]||(s=n(),nB[e]=!0),r&&t({metric:r}),n2(e,t,i?s:void 0)}function n1(e,t){nq[e]=nq[e]||[],nq[e].push(t)}function n2(e,t,n){return()=>{n&&n();let r=nq[e];if(!r)return;let i=r.indexOf(t);-1!==i&&r.splice(i,1)}}function n3(e){return"number"==typeof e&&isFinite(e)}function n5(e,t,n,{...r}){let i=(0,eC.XU)(e).start_timestamp;return i&&i>t&&"function"==typeof e.updateStartTime&&e.updateStartTime(t),t8(e,()=>{let e=t6({startTime:t,...r});return e&&e.end(n),e})}function n4(e){let t;let n=(0,W.s3)();if(!n)return;let{name:r,transaction:i,attributes:s,startTime:o}=e,{release:a,environment:l}=n.getOptions(),u=n.getIntegrationByName("Replay"),c=u&&u.getReplayId(),d=(0,W.nZ)(),h=d.getUser(),f=void 0!==h?h.email||h.id||h.ip_address:void 0;try{t=d.getScopeData().contexts.profile.profile_id}catch(e){}return t6({name:r,attributes:{release:a,environment:l,user:f||void 0,profile_id:t||void 0,replay_id:c||void 0,transaction:i,"user_agent.original":ec.navigator&&ec.navigator.userAgent,...s},startTime:o,experimental:{standalone:!0}})}function n6(){return ec&&ec.addEventListener&&ec.performance}function n8(e){return e/1e3}let n7=0,n9={};function re(e,t,n,r,i,s){let o=s?t[s]:t[`${n}End`],a=t[`${n}Start`];a&&o&&n5(e,r+n8(a),r+n8(o),{op:`browser.${i||n}`,name:t.name,attributes:{[tG.S3]:"auto.ui.browser.metrics"}})}function rt(e,t,n,r){let i=t[n];null!=i&&i<2147483647&&(e[r]=i)}let rn=[],rr=new Map,ri={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};var rs=n(61572);let ro={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3};function ra(e,t={}){let n;let r=new Map,i=!1,s="externalFinish",o=!t.disableAutoFinish,a=[],{idleTimeout:l=ro.idleTimeout,finalTimeout:u=ro.finalTimeout,childSpanTimeout:c=ro.childSpanTimeout,beforeSpanEnd:d}=t,h=(0,W.s3)();if(!h||!(0,tQ.z)())return new tJ;let f=(0,W.nZ)(),p=(0,eC.HN)(),m=function(e){let t=t6(e);return(0,tK.D)((0,W.nZ)(),t),$.X&&L.kg.log("[Tracing] Started span is an idle span"),t}(e);function g(){n&&(clearTimeout(n),n=void 0)}function v(e){g(),n=setTimeout(()=>{!i&&0===r.size&&o&&(s="idleTimeout",m.end(e))},l)}function y(e){n=setTimeout(()=>{!i&&o&&(s="heartbeatFailed",m.end(e))},c)}function _(e){i=!0,r.clear(),a.forEach(e=>e()),(0,tK.D)(f,p);let t=(0,eC.XU)(m),{start_timestamp:n}=t;if(!n)return;(t.data||{})[tG.ju]||m.setAttribute(tG.ju,s),L.kg.log(`[Tracing] Idle span "${t.op}" finished`);let o=(0,eC.Dp)(m).filter(e=>e!==m),c=0;o.forEach(t=>{t.isRecording()&&(t.setStatus({code:rs.jt,message:"cancelled"}),t.end(e),$.X&&L.kg.log("[Tracing] Cancelling span since span ended early",JSON.stringify(t,void 0,2)));let{timestamp:n=0,start_timestamp:r=0}=(0,eC.XU)(t),i=r<=e,s=n-r<=(u+l)/1e3;if($.X){let e=JSON.stringify(t,void 0,2);i?s||L.kg.log("[Tracing] Discarding span since it finished after idle span final timeout",e):L.kg.log("[Tracing] Discarding span since it happened after idle span was finished",e)}(!s||!i)&&((0,eC.ed)(m,t),c++)}),c>0&&m.setAttribute("sentry.idle_span_discarded_spans",c)}return m.end=new Proxy(m.end,{apply(e,t,n){d&&d(m);let[r,...i]=n,s=r||(0,eO.ph)(),o=(0,eC.$k)(s),a=(0,eC.Dp)(m).filter(e=>e!==m);if(!a.length)return _(o),Reflect.apply(e,t,[o,...i]);let l=a.map(e=>(0,eC.XU)(e).timestamp).filter(e=>!!e),c=l.length?Math.max(...l):void 0,h=(0,eC.XU)(m).start_timestamp,f=Math.min(h?h+u/1e3:1/0,Math.max(h||-1/0,Math.min(o,c||1/0)));return _(f),Reflect.apply(e,t,[f,...i])}}),a.push(h.on("spanStart",e=>{if(!i&&e!==m&&!(0,eC.XU)(e).timestamp&&(0,eC.Dp)(m).includes(e)){var t;t=e.spanContext().spanId,g(),r.set(t,!0),y((0,eO.ph)()+c/1e3)}})),a.push(h.on("spanEnd",e=>{var t;i||(t=e.spanContext().spanId,r.has(t)&&r.delete(t),0===r.size&&v((0,eO.ph)()+l/1e3))})),a.push(h.on("idleSpanEnableAutoFinish",e=>{e===m&&(o=!0,v(),r.size&&y())})),t.disableAutoFinish||v(),setTimeout(()=>{i||(m.setStatus({code:rs.jt,message:"deadline_exceeded"}),s="finalTimeout",m.end())},u),m}let rl=!1;function ru(){let e=(0,eC.HN)(),t=e&&(0,eC.Gx)(e);if(t){let e="internal_error";$.X&&L.kg.log(`[Tracing] Root span: ${e} -> Global error occured`),t.setStatus({code:rs.jt,message:e})}}ru.tag="sentry_tracingErrorCallback";var rc=n(56792),rd=n(48938),rh=n(49110);function rf(e){return e.split(",").filter(e=>!e.split("=")[0].startsWith(rh.lq)).join(",")}let rp=new WeakMap,rm=new Map,rg={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function rv(e){let{url:t}=(0,eC.XU)(e).data||{};if(!t||"string"!=typeof t)return;let n=nG("resource",({entries:r})=>{r.forEach(r=>{"resource"===r.entryType&&"initiatorType"in r&&"string"==typeof r.nextHopProtocol&&("fetch"===r.initiatorType||"xmlhttprequest"===r.initiatorType)&&r.name.endsWith(t)&&((function(e){let{name:t,version:n}=function(e){let t="unknown",n="unknown",r="";for(let i of e){if("/"===i){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t="h"===r?"http":r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}(e.nextHopProtocol),r=[];return(r.push(["network.protocol.version",n],["network.protocol.name",t]),eO.Z1)?[...r,["http.request.redirect_start",ry(e.redirectStart)],["http.request.fetch_start",ry(e.fetchStart)],["http.request.domain_lookup_start",ry(e.domainLookupStart)],["http.request.domain_lookup_end",ry(e.domainLookupEnd)],["http.request.connect_start",ry(e.connectStart)],["http.request.secure_connection_start",ry(e.secureConnectionStart)],["http.request.connection_end",ry(e.connectEnd)],["http.request.request_start",ry(e.requestStart)],["http.request.response_start",ry(e.responseStart)],["http.request.response_end",ry(e.responseEnd)]]:r})(r).forEach(t=>e.setAttribute(...t)),setTimeout(n))})})}function ry(e=0){return((eO.Z1||performance.timeOrigin)+e)/1e3}function r_(e){try{return new URL(e,eW.location.origin).href}catch(e){return}}let rb={...ro,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...rg},rw=(e={})=>{rl||(rl=!0,th(ru),tm(ru));let{enableInp:t,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:i,enableStandaloneClsSpans:s},beforeStartSpan:o,idleTimeout:a,finalTimeout:l,childSpanTimeout:u,markBackgroundSpan:c,traceFetch:d,traceXHR:f,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:v,enableHTTPTimings:y,instrumentPageLoad:_,instrumentNavigation:b}={...rb,...e},w=function({recordClsStandaloneSpans:e}){let t=n6();if(t&&eO.Z1){t.mark&&ec.performance.mark("sentry-tracing-init");let n=nW(({metric:e})=>{let t=e.entries[e.entries.length-1];if(!t)return;let n=n8(eO.Z1),r=n8(t.startTime);tL&&L.kg.log("[Measurements] Adding FID"),n9.fid={value:e.value,unit:"millisecond"},n9["mark.fid"]={value:n+r,unit:"second"}}),r=nz(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(tL&&L.kg.log("[Measurements] Adding LCP"),n9.lcp={value:e.value,unit:"millisecond"},p=t)},!0),i=n0("ttfb",({metric:e})=>{e.entries[e.entries.length-1]&&(tL&&L.kg.log("[Measurements] Adding TTFB"),n9.ttfb={value:e.value,unit:"millisecond"})},nZ,h),s=e?function(){let e,t,n=0;if(!function(){try{return ne([PerformanceObserver,"access",e=>e.supportedEntryTypes,"optionalAccess",e=>e.includes,"call",e=>e("layout-shift")])}catch(e){return!1}}())return;let r=!1;function i(){r||(r=!0,t&&function(e,t,n){tL&&L.kg.log(`Sending CLS span (${e})`);let r=n8((eO.Z1||0)+(ne([t,"optionalAccess",e=>e.startTime])||0)),i=(0,W.nZ)().getScopeData().transactionName,s=n4({name:t?(0,e9.Rt)(ne([t,"access",e=>e.sources,"access",e=>e[0],"optionalAccess",e=>e.node])):"Layout shift",transaction:i,attributes:(0,z.Jr)({[tG.S3]:"auto.http.browser.cls",[tG.$J]:"ui.webvital.cls",[tG.JQ]:ne([t,"optionalAccess",e=>e.duration])||0,"sentry.pageload.span_id":n}),startTime:r});ne([s,"optionalAccess",e=>e.addEvent,"call",t=>t("cls",{[tG.E1]:"",[tG.Wb]:e})]),ne([s,"optionalAccess",e=>e.end,"call",e=>e(r)])}(n,e,t),s())}let s=nH(({metric:t})=>{let r=t.entries[t.entries.length-1];r&&(n=t.value,e=r)},!0);nl(()=>{i()}),setTimeout(()=>{let e=ne([(0,W.s3)(),"optionalAccess",e=>e.on,"call",t=>t("startNavigationSpan",()=>{i(),e&&e()})]),n=(0,eC.HN)(),r=n&&(0,eC.Gx)(n),s=r&&(0,eC.XU)(r);s&&"pageload"===s.op&&(t=r.spanContext().spanId)},0)}():nH(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(tL&&L.kg.log(`[Measurements] Adding CLS ${e.value}`),n9.cls={value:e.value,unit:""},m=t)},!0);return()=>{n(),r(),i(),s&&s()}}return()=>void 0}({recordClsStandaloneSpans:s||!1});t&&function(){if(n6()&&eO.Z1){let e=nV(({metric:e})=>{if(void 0==e.value)return;let t=e.entries.find(t=>t.duration===e.value&&ri[t.name]);if(!t)return;let{interactionId:n}=t,r=ri[t.name],i=n8(eO.Z1+t.startTime),s=n8(e.value),o=(0,eC.HN)(),a=o?(0,eC.Gx)(o):void 0,l=(null!=n?rr.get(n):void 0)||a,u=l?(0,eC.XU)(l).description:(0,W.nZ)().getScopeData().transactionName,c=n4({name:(0,e9.Rt)(t.target),transaction:u,attributes:(0,z.Jr)({[tG.S3]:"auto.http.browser.inp",[tG.$J]:`ui.interaction.${r}`,[tG.JQ]:t.duration}),startTime:i});ne([c,"optionalAccess",e=>e.addEvent,"call",t=>t("inp",{[tG.E1]:"millisecond",[tG.Wb]:e.value})]),ne([c,"optionalAccess",e=>e.end,"call",e=>e(i+s)])})}}(),r&&ee.GLOBAL_OBJ.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?new PerformanceObserver(e=>{if((0,eC.HN)())for(let t of e.getEntries()){if(!t.scripts[0])continue;let e=n8(eO.Z1+t.startTime),n=n8(t.duration),r={[tG.S3]:"auto.ui.browser.metrics"},{invoker:i,invokerType:s,sourceURL:o,sourceFunctionName:a,sourceCharPosition:l}=t.scripts[0];r["browser.script.invoker"]=i,r["browser.script.invoker_type"]=s,o&&(r["code.filepath"]=o),a&&(r["code.function"]=a),-1!==l&&(r["browser.script.source_char_position"]=l);let u=t6({name:"Main UI thread blocked",op:"ui.long-animation-frame",startTime:e,attributes:r});u&&u.end(e+n)}}).observe({type:"long-animation-frame",buffered:!0}):n&&nG("longtask",({entries:e})=>{if((0,eC.HN)())for(let t of e){let e=n8(eO.Z1+t.startTime),n=n8(t.duration),r=t6({name:"Main UI thread blocked",op:"ui.long-task",startTime:e,attributes:{[tG.S3]:"auto.ui.browser.metrics"}});r&&r.end(e+n)}}),i&&nG("event",({entries:e})=>{if((0,eC.HN)()){for(let t of e)if("click"===t.name){let e=n8(eO.Z1+t.startTime),n=n8(t.duration),r={name:(0,e9.Rt)(t.target),op:`ui.interaction.${t.name}`,startTime:e,attributes:{[tG.S3]:"auto.ui.browser.metrics"}},i=(0,e9.iY)(t.target);i&&(r.attributes["ui.component_name"]=i);let s=t6(r);s&&s.end(e+n)}}});let S={name:void 0,source:void 0};function E(e,t){let n="pageload"===t.op,r=o?o(t):t,i=r.attributes||{};t.name!==r.name&&(i[tG.Zj]="custom",r.attributes=i),S.name=r.name,S.source=i[tG.Zj];let c=ra(r,{idleTimeout:a,finalTimeout:l,childSpanTimeout:u,disableAutoFinish:n,beforeSpanEnd:e=>{w(),function(e,t){let n=n6();if(!n||!ec.performance.getEntries||!eO.Z1)return;tL&&L.kg.log("[Tracing] Adding & adjusting spans using Performance API");let r=n8(eO.Z1),i=n.getEntries(),{op:s,start_timestamp:o}=(0,eC.XU)(e);if(i.slice(n7).forEach(t=>{let n=n8(t.startTime),i=n8(Math.max(0,t.duration));if("navigation"!==s||!o||!(r+n<o))switch(t.entryType){case"navigation":["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{re(e,t,n,r)}),re(e,t,"secureConnection",r,"TLS/SSL","connectEnd"),re(e,t,"fetch",r,"cache","domainLookupStart"),re(e,t,"domainLookup",r,"DNS"),function(e,t,n){let r=n+n8(t.requestStart),i=n+n8(t.responseEnd),s=n+n8(t.responseStart);t.responseEnd&&(n5(e,r,i,{op:"browser.request",name:t.name,attributes:{[tG.S3]:"auto.ui.browser.metrics"}}),n5(e,s,i,{op:"browser.response",name:t.name,attributes:{[tG.S3]:"auto.ui.browser.metrics"}}))}(e,t,r);break;case"mark":case"paint":case"measure":{(function(e,t,n,r,i){let s=ni(),o=i+Math.max(n,n8(s?s.requestStart:0)),a=i+n,l={[tG.S3]:"auto.resource.browser.metrics"};o!==a&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=o),n5(e,o,a+r,{name:t.name,op:t.entryType,attributes:l})})(e,t,n,i,r);let s=np(),o=t.startTime<s.firstHiddenTime;"first-paint"===t.name&&o&&(tL&&L.kg.log("[Measurements] Adding FP"),n9.fp={value:t.startTime,unit:"millisecond"}),"first-contentful-paint"===t.name&&o&&(tL&&L.kg.log("[Measurements] Adding FCP"),n9.fcp={value:t.startTime,unit:"millisecond"});break}case"resource":(function(e,t,n,r,i,s){if("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType)return;let o=tr(n),a={[tG.S3]:"auto.resource.browser.metrics"};rt(a,t,"transferSize","http.response_transfer_size"),rt(a,t,"encodedBodySize","http.response_content_length"),rt(a,t,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in t&&(a["resource.render_blocking_status"]=t.renderBlockingStatus),o.protocol&&(a["url.scheme"]=o.protocol.split(":").pop()),o.host&&(a["server.address"]=o.host),a["url.same_origin"]=n.includes(ec.location.origin);let l=s+r;n5(e,l,l+i,{name:n.replace(ec.location.origin,""),op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",attributes:a})})(e,t,t.name,n,i,r)}}),n7=Math.max(i.length-1,0),function(e){let t=ec.navigator;if(!t)return;let n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),n3(n.rtt)&&(n9["connection.rtt"]={value:n.rtt,unit:"millisecond"})),n3(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),n3(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}(e),"pageload"===s){(function(e){let t=ni();if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(tL&&L.kg.log("[Measurements] Adding TTFB Request Time"),e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})})(n9);let n=n9["mark.fid"];n&&n9.fid&&(n5(e,n.value,n.value+n8(n9.fid.value),{name:"first input delay",op:"ui.action",attributes:{[tG.S3]:"auto.ui.browser.metrics"}}),delete n9["mark.fid"]),"fcp"in n9&&t.recordClsOnPageloadSpan||delete n9.cls,Object.entries(n9).forEach(([e,t])=>{!function(e,t,n,r=(0,eC.HN)()){let i=r&&(0,eC.Gx)(r);i&&i.addEvent(e,{[tG.Wb]:t,[tG.E1]:n})}(e,t.value,t.unit)}),e.setAttribute("performance.timeOrigin",r),e.setAttribute("performance.activationStart",ns()),p&&(tL&&L.kg.log("[Measurements] Adding LCP Data"),p.element&&e.setAttribute("lcp.element",(0,e9.Rt)(p.element)),p.id&&e.setAttribute("lcp.id",p.id),p.url&&e.setAttribute("lcp.url",p.url.trim().slice(0,200)),e.setAttribute("lcp.size",p.size)),m&&m.sources&&(tL&&L.kg.log("[Measurements] Adding CLS Data"),m.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,(0,e9.Rt)(t.node))))}p=void 0,m=void 0,n9={}}(e,{recordClsOnPageloadSpan:!s})}});function d(){["interactive","complete"].includes(eW.document.readyState)&&e.emit("idleSpanEnableAutoFinish",c)}return n&&eW.document&&(eW.document.addEventListener("readystatechange",()=>{d()}),d()),c}return{name:"BrowserTracing",afterAllSetup(e){let n,r;let s=eW.location&&eW.location.href;e.on("startNavigationSpan",t=>{(0,W.s3)()===e&&(n&&!(0,eC.XU)(n).timestamp&&(e$&&L.kg.log(`[Tracing] Finishing current root span with op: ${(0,eC.XU)(n).op}`),n.end()),n=E(e,{op:"navigation",...t}))}),e.on("startPageLoadSpan",(t,r={})=>{if((0,W.s3)()!==e)return;n&&!(0,eC.XU)(n).timestamp&&(e$&&L.kg.log(`[Tracing] Finishing current root span with op: ${(0,eC.XU)(n).op}`),n.end());let i=r.sentryTrace||rx("sentry-trace"),s=r.baggage||rx("baggage"),o=(0,rc.pT)(i,s);(0,W.nZ)().setPropagationContext(o),n=E(e,{op:"pageload",...t})}),e.on("spanEnd",e=>{let t=(0,eC.XU)(e).op;if(e!==(0,eC.Gx)(e)||"navigation"!==t&&"pageload"!==t)return;let n=(0,W.nZ)(),r=n.getPropagationContext();n.setPropagationContext({...r,sampled:void 0!==r.sampled?r.sampled:(0,eC.Tt)(e),dsc:r.dsc||(0,eI.jC)(e)})}),eW.location&&(_&&rS(e,{name:eW.location.pathname,startTime:eO.Z1?eO.Z1/1e3:void 0,attributes:{[tG.Zj]:"url",[tG.S3]:"auto.pageload.browser"}}),b&&ed(({to:t,from:n})=>{if(void 0===n&&s&&-1!==s.indexOf(t)){s=void 0;return}n!==t&&(s=void 0,rE(e,{name:eW.location.pathname,attributes:{[tG.Zj]:"url",[tG.S3]:"auto.navigation.browser"}}))})),c&&(eW&&eW.document?eW.document.addEventListener("visibilitychange",()=>{let e=(0,eC.HN)();if(!e)return;let t=(0,eC.Gx)(e);if(eW.document.hidden&&t){let e="cancelled",{op:n,status:r}=(0,eC.XU)(t);e$&&L.kg.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:rs.jt,message:e}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):e$&&L.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")),i&&eW.document&&addEventListener("click",()=>{let e="ui.action.click",t=(0,eC.HN)(),n=t&&(0,eC.Gx)(t);if(n&&["navigation","pageload"].includes((0,eC.XU)(n).op)){e$&&L.kg.warn(`[Tracing] Did not create ${e} span because a pageload or navigation span is in progress.`);return}if(r&&(r.setAttribute(tG.ju,"interactionInterrupted"),r.end(),r=void 0),!S.name){e$&&L.kg.warn(`[Tracing] Did not create ${e} transaction because _latestRouteName is missing.`);return}r=ra({name:S.name,op:e,attributes:{[tG.Zj]:S.source||"url"}},{idleTimeout:a,finalTimeout:l,childSpanTimeout:u})},{once:!1,capture:!0}),t&&function(){let e=({entries:e})=>{let t=(0,eC.HN)(),n=t&&(0,eC.Gx)(t);e.forEach(e=>{if(!("duration"in e)||!n)return;let t=e.interactionId;if(!(null==t||rr.has(t))){if(rn.length>10){let e=rn.shift();rr.delete(e)}rn.push(t),rr.set(t,n)}})};nG("event",e),nG("first-input",e)}(),function(e,t){let{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o,tracePropagationTargets:a}={traceFetch:rg.traceFetch,traceXHR:rg.traceXHR,trackFetchStreamPerformance:rg.trackFetchStreamPerformance,...t},l="function"==typeof s?s:e=>!0,u=e=>(function(e,t){let n=eW.location&&eW.location.href;if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch(e){return!1}let s=r.origin===i;return t?(0,D.U0)(r.toString(),t)||s&&(0,D.U0)(r.pathname,t):s}{let n=!!e.match(/^\/(?!\/)/);return t?(0,D.U0)(e,t):n}})(e,a),c={};n&&(e.addEventProcessor(e=>("transaction"===e.type&&e.spans&&e.spans.forEach(e=>{if("http.client"===e.op){let t=rm.get(e.span_id);t&&(e.timestamp=t/1e3,rm.delete(e.span_id))}}),e)),i&&function(e){let t="fetch-body-resolved";eo(t,e),ea(t,()=>e5(e6))}(e=>{if(e.response){let t=rp.get(e.response);t&&e.endTimestamp&&rm.set(t,e.endTimestamp)}}),e3(e=>{let t=function(e,t,n,r,i="auto.http.browser"){if(!e.fetchData)return;let s=(0,tQ.z)()&&t(e.fetchData.url);if(e.endTimestamp&&s){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(function(e,t){if(t.response){(0,rs.Q0)(e,t.response.status);let n=t.response&&t.response.headers&&t.response.headers.get("content-length");if(n){let t=parseInt(n);t>0&&e.setAttribute("http.response_content_length",t)}}else t.error&&e.setStatus({code:rs.jt,message:"internal_error"});e.end()}(n,e),delete r[t]);return}let o=(0,W.nZ)(),a=(0,W.s3)(),{method:l,url:u}=e.fetchData,c=function(e){try{return new URL(e).href}catch(e){return}}(u),d=c?tr(c).host:void 0,h=!!(0,eC.HN)(),f=s&&h?t6({name:`${l} ${u}`,attributes:{url:u,type:"fetch","http.method":l,"http.url":c,"server.address":d,[tG.S3]:i,[tG.$J]:"http.client"}}):new tJ;if(e.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(e.fetchData.url)&&a){let t=e.args[0];e.args[1]=e.args[1]||{};let n=e.args[1];n.headers=function(e,t,n,r,i){let{traceId:s,spanId:o,sampled:a,dsc:l}={...(0,W.aF)().getPropagationContext(),...n.getPropagationContext()},u=i?(0,eC.Hb)(i):(0,rc.$p)(s,o,a),c=(0,rh.IQ)(l||(i?(0,eI.jC)(i):(0,eI._l)(s,t))),d=r.headers||("undefined"!=typeof Request&&(0,ev.V9)(e,Request)?e.headers:void 0);if(!d)return{"sentry-trace":u,baggage:c};if("undefined"!=typeof Headers&&(0,ev.V9)(d,Headers)){let e=new Headers(d);if(e.set("sentry-trace",u),c){let t=e.get(rh.bU);if(t){let n=rf(t);e.set(rh.bU,n?`${n},${c}`:c)}else e.set(rh.bU,c)}return e}if(Array.isArray(d)){let e=[...d.filter(e=>!(Array.isArray(e)&&"sentry-trace"===e[0])).map(e=>{if(!Array.isArray(e)||e[0]!==rh.bU||"string"!=typeof e[1])return e;{let[t,n,...r]=e;return[t,rf(n),...r]}}),["sentry-trace",u]];return c&&e.push([rh.bU,c]),e}{let e="baggage"in d?d.baggage:void 0,t=[];return Array.isArray(e)?t=e.map(e=>"string"==typeof e?rf(e):e).filter(e=>""===e):e&&t.push(rf(e)),c&&t.push(c),{...d,"sentry-trace":u,baggage:t.length>0?t.join(","):void 0}}}(t,a,o,n,(0,tQ.z)()&&h?f:void 0)}return f}(e,l,u,c);if(e.response&&e.fetchData.__span&&rp.set(e.response,e.fetchData.__span),t){let n=r_(e.fetchData.url),r=n?tr(n).host:void 0;t.setAttributes({"http.url":n,"server.address":r})}o&&t&&rv(t)})),r&&eY(e=>{let t=function(e,t,n,r){let i=e.xhr,s=i&&i[eZ];if(!i||i.__sentry_own_request__||!s)return;let o=(0,tQ.z)()&&t(s.url);if(e.endTimestamp&&o){let e=i.__sentry_xhr_span_id__;if(!e)return;let t=r[e];t&&void 0!==s.status_code&&((0,rs.Q0)(t,s.status_code),t.end(),delete r[e]);return}let a=r_(s.url),l=a?tr(a).host:void 0,u=!!(0,eC.HN)(),c=o&&u?t6({name:`${s.method} ${s.url}`,attributes:{type:"xhr","http.method":s.method,"http.url":a,url:s.url,"server.address":l,[tG.S3]:"auto.http.browser",[tG.$J]:"http.client"}}):new tJ;i.__sentry_xhr_span_id__=c.spanContext().spanId,r[i.__sentry_xhr_span_id__]=c;let d=(0,W.s3)();return i.setRequestHeader&&n(s.url)&&d&&function(e,t,n){let r=(0,W.nZ)(),{traceId:i,spanId:s,sampled:o,dsc:a}={...(0,W.aF)().getPropagationContext(),...r.getPropagationContext()};(function(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader(rh.bU,n)}catch(e){}})(e,n&&(0,tQ.z)()?(0,eC.Hb)(n):(0,rc.$p)(i,s,o),(0,rh.IQ)(a||(n?(0,eI.jC)(n):(0,eI._l)(i,t))))}(i,d,(0,tQ.z)()&&u?c:void 0),c}(e,l,u,c);o&&t&&rv(t)})}(e,{traceFetch:d,traceXHR:f,trackFetchStreamPerformance:g,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:v,enableHTTPTimings:y})}}};function rS(e,t,n){e.emit("startPageLoadSpan",t,n),(0,W.nZ)().setTransactionName(t.name);let r=(0,eC.HN)();return"pageload"===(r&&(0,eC.XU)(r).op)?r:void 0}function rE(e,t){(0,W.aF)().setPropagationContext((0,rd.Q)()),(0,W.nZ)().setPropagationContext((0,rd.Q)()),e.emit("startNavigationSpan",t),(0,W.nZ)().setTransactionName(t.name);let n=(0,eC.HN)();return"navigation"===(n&&(0,eC.XU)(n).op)?n:void 0}function rx(e){let t=(0,e9.qT)(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}let rk="incomplete-app-router-transaction",rT=ee.GLOBAL_OBJ;function rO(e){try{return new URL(e,"http://some-random-base.com/").pathname}catch(e){return"/"}}var rI=n(62058),rC=n(50380);let rR=rI.events?rI:rI.default;function rA(e={}){let t=rw({...e,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:n=!0,instrumentNavigation:r=!0}=e;return{...t,afterAllSetup(e){var i;r&&(i=e,eW.document.getElementById("__NEXT_DATA__")?rR.events.on("routeChangeStart",e=>{let t,n;let r=e.split(/[?#]/,1)[0],s=function(e){let t=(eW.__BUILD_MANIFEST||{}).sortedPages;if(t)return t.find(t=>{let n=function(e){let t=e.split("/"),n="";ne([t,"access",e=>e[t.length-1],"optionalAccess",e=>e.match,"call",e=>e(/^\[\[\.\.\..+\]\]$/)])&&(t.pop(),n="(?:/(.+?))?");let r=t.map(e=>e.replace(/^\[\.\.\..+\]$/,"(.+?)").replace(/^\[.*\]$/,"([^/]+?)")).join("/");return RegExp(`^${r}${n}(?:/)?$`)}(t);return e.match(n)})}(r);s?(t=s,n="route"):(t=r,n="url"),rE(i,{name:t,attributes:{[tG.$J]:"navigation",[tG.S3]:"auto.navigation.nextjs.pages_router_instrumentation",[tG.Zj]:n}})}):function(e){let t;eW.addEventListener("popstate",()=>{t&&t.isRecording()?t.updateName(eW.location.pathname):t=rE(e,{name:eW.location.pathname,attributes:{[tG.$J]:"navigation",[tG.S3]:"auto.navigation.nextjs.app_router_instrumentation",[tG.Zj]:"url","navigation.type":"browser.popstate"}})});let n=!1,r=0,i=setInterval(()=>{var s,o;r++;let a=(s=ne([rT,"optionalAccess",e=>e.next,"optionalAccess",e=>e.router]),o=()=>ne([rT,"optionalAccess",e=>e.nd,"optionalAccess",e=>e.router]),null!=s?s:o());n||r>500?clearInterval(i):a&&(clearInterval(i),n=!0,["back","forward","push","replace"].forEach(n=>{ne([a,"optionalAccess",e=>e[n]])&&(a[n]=new Proxy(a[n],{apply(r,i,s){let o=rE(e,{name:rk,attributes:{[tG.$J]:"navigation",[tG.S3]:"auto.navigation.nextjs.app_router_instrumentation",[tG.Zj]:"url"}});return t=o,"push"===n?(ne([o,"optionalAccess",e=>e.updateName,"call",e=>e(rO(s[0]))]),ne([o,"optionalAccess",e=>e.setAttribute,"call",e=>e("navigation.type","router.push")])):"replace"===n?(ne([o,"optionalAccess",e=>e.updateName,"call",e=>e(rO(s[0]))]),ne([o,"optionalAccess",e=>e.setAttribute,"call",e=>e("navigation.type","router.replace")])):"back"===n?ne([o,"optionalAccess",e=>e.setAttribute,"call",e=>e("navigation.type","router.back")]):"forward"===n&&ne([o,"optionalAccess",e=>e.setAttribute,"call",e=>e("navigation.type","router.forward")]),r.apply(i,s)}}))}))},20)}(i)),t.afterAllSetup(e),n&&(eW.document.getElementById("__NEXT_DATA__")?function(e){let{route:t,params:n,sentryTrace:r,baggage:i}=function(){let e;let t=eW.document.getElementById("__NEXT_DATA__");if(t&&t.innerHTML)try{e=JSON.parse(t.innerHTML)}catch(e){rC.X&&L.kg.warn("Could not extract __NEXT_DATA__")}if(!e)return{};let n={},{page:r,query:i,props:s}=e;return n.route=r,n.params=i,s&&s.pageProps&&(n.sentryTrace=s.pageProps._sentryTraceData,n.baggage=s.pageProps._sentryBaggage),n}();rS(e,{name:t||eW.location.pathname,startTime:eO.Z1?eO.Z1/1e3:void 0,attributes:{[tG.$J]:"pageload",[tG.S3]:"auto.pageload.nextjs.pages_router_instrumentation",[tG.Zj]:t?"route":"url",...n&&e.getOptions().sendDefaultPii&&{...n}}},{sentryTrace:r,baggage:i})}(e):rS(e,{name:eW.location.pathname,startTime:eO.Z1?eO.Z1/1e3:void 0,attributes:{[tG.$J]:"pageload",[tG.S3]:"auto.pageload.nextjs.app_router_instrumentation",[tG.Zj]:"url"}}))}}}let rP=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function rM(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:"/";i&&(t=`${i}/${t}`,n="/"===i.charAt(0))}return t=(function(e,t){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t];"."===r?e.splice(t,1):".."===r?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;n)e.unshift("..");return e})(t.split("/").filter(e=>!!e),!n).join("/"),(n?"/":"")+t||"."}function rL(e){let t=0;for(;t<e.length&&""===e[t];t++);let n=e.length-1;for(;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}let rN=(e={})=>{let t=e.root,n=e.prefix||"app:///",r="window"in ee.GLOBAL_OBJ&&void 0!==ee.GLOBAL_OBJ.window,i=e.iteratee||function({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let i=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),s=/^\//.test(r.filename);if(e){if(t){let e=r.filename;0===e.indexOf(t)&&(r.filename=e.replace(t,n))}}else if(i||s){let e;let s=i?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,o=t?function(e,t){e=rM(e).slice(1),t=rM(t).slice(1);let n=rL(e.split("/")),r=rL(t.split("/")),i=Math.min(n.length,r.length),s=i;for(let e=0;e<i;e++)if(n[e]!==r[e]){s=e;break}let o=[];for(let e=s;e<n.length;e++)o.push("..");return(o=o.concat(r.slice(s))).join("/")}(t,s):function(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=rP.exec(t);return n?n.slice(1):[]}(s)[2]||"";r.filename=`${n}${o}`}return r}}({isBrowser:r,root:t,prefix:n});return{name:"RewriteFrames",processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=function(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>{var t;return{...e,...e.stacktrace&&{stacktrace:{...t=e.stacktrace,frames:t&&t.frames&&t.frames.map(e=>i(e))}}}})}}}catch(t){return e}}(t)),t}}},rD=({assetPrefixPath:e})=>({...rN({iteratee:t=>{try{let{origin:n}=new URL(t.filename);t.filename=ne([t,"access",e=>e.filename,"optionalAccess",e=>e.replace,"call",e=>e(n,"app://"),"access",e=>e.replace,"call",t=>t(e,"")])}catch(e){}return t.filename&&t.filename.startsWith("app:///_next")&&(t.filename=decodeURI(t.filename)),t.filename&&t.filename.match(/^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/)&&(t.in_app=!1),t}}),name:"NextjsClientStackFrameNormalization"}),r$=ee.GLOBAL_OBJ,rj=ee.GLOBAL_OBJ;var rF=n(50814);let rU=String(0),rq="",rB="",rH="",rz=eW.navigator&&eW.navigator.userAgent||"",rW="",rV=eW.navigator&&eW.navigator.language||eW.navigator&&eW.navigator.languages&&eW.navigator.languages[0]||"",rG=eW.navigator&&eW.navigator.userAgentData;function rQ(e){return"pageload"===(0,eC.XU)(e).op}"object"==typeof rG&&null!==rG&&"getHighEntropyValues"in rG&&rG.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(rq=e.platform||"",rH=e.architecture||"",rW=e.model||"",rB=e.platformVersion||"",e.fullVersionList&&e.fullVersionList.length>0){let t=e.fullVersionList[e.fullVersionList.length-1];rz=`${t.brand} ${t.version}`}}).catch(e=>void 0);let rK=new WeakMap,rJ=!1;function rX(e){if(rJ)return e$&&L.kg.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return e$&&L.kg.log("[Profiling] Discarding profile because transaction was not sampled."),!1;let t=(0,W.s3)(),n=t&&t.getOptions();if(!n)return e$&&L.kg.log("[Profiling] Profiling disabled, no options found."),!1;let r=n.profilesSampleRate;return("number"!=typeof r&&"boolean"!=typeof r||"number"==typeof r&&isNaN(r)?(e$&&L.kg.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(r)} of type ${JSON.stringify(typeof r)}.`),1):!0!==r&&!1!==r&&(r<0||r>1)&&(e$&&L.kg.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${r}.`),1))?(e$&&L.kg.warn("[Profiling] Discarding profile because of invalid sample rate."),!1):r?!!(!0===r||Math.random()<r)||(e$&&L.kg.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(e$&&L.kg.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1)}let rZ=new Map;function rY(e){let t;rQ(e)&&(t=1e3*(0,eO.ph)());let n=function(){let e=eW.Profiler;if("function"!=typeof e){e$&&L.kg.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}try{return new e({sampleInterval:10,maxBufferSize:Math.floor(3e3)})}catch(e){e$&&(L.kg.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),L.kg.log("[Profiling] Disabling profiling for current user session.")),rJ=!0}}();if(!n)return;e$&&L.kg.log(`[Profiling] started profiling span: ${(0,eC.XU)(e).description}`);let r=(0,N.DM)();async function i(){if(e&&n)return n.stop().then(t=>{if(s&&(eW.clearTimeout(s),s=void 0),e$&&L.kg.log(`[Profiling] stopped profiling of span: ${(0,eC.XU)(e).description}`),!t){e$&&L.kg.log(`[Profiling] profiler returned null profile for: ${(0,eC.XU)(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}!function(e,t){if(rZ.set(e,t),rZ.size>30){let e=rZ.keys().next().value;rZ.delete(e)}}(r,t)}).catch(e=>{e$&&L.kg.log("[Profiling] error while stopping profiler:",e)})}(0,W.nZ)().setContext("profile",{profile_id:r,start_timestamp:t});let s=eW.setTimeout(()=>{e$&&L.kg.log("[Profiling] max profile duration elapsed, stopping profiling for:",(0,eC.XU)(e).description),i()},3e4),o=e.end.bind(e);e.end=function(){return e?(i().then(()=>{o()},()=>{o()}),e):o()}}function r0(e){return"/"===e[e.length-1]?e.slice(0,-1):e}var r1=n(14224);function r2(){return"undefined"!=typeof window&&(!(!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call(void 0!==r1?r1:0))||void 0!==ee.GLOBAL_OBJ.process&&"renderer"===ee.GLOBAL_OBJ.process.type)}let r3=ee.GLOBAL_OBJ,r5="sentryReplaySession",r4="Unable to send Replay";function r6(e,t){return null!=e?e:t()}function r8(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):("call"===i||"optionalCall"===i)&&(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}function r7(e){let t=r8([e,"optionalAccess",e=>e.host]);return r8([t,"optionalAccess",e=>e.shadowRoot])===e}function r9(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function ie(e){try{var t;let n=e.rules||e.cssRules;return n?((t=Array.from(n,it).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}}function it(e){let t;if("styleSheet"in e)try{t=ie(e.styleSheet)||function(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if("selectorText"in e&&e.selectorText.includes(":"))return e.cssText.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2");return t||e.cssText}(S=I||(I={}))[S.Document=0]="Document",S[S.DocumentType=1]="DocumentType",S[S.Element=2]="Element",S[S.Text=3]="Text",S[S.CDATA=4]="CDATA",S[S.Comment=5]="Comment";class ir{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){return e?r6(r8([this,"access",e=>e.getMeta,"call",t=>t(e),"optionalAccess",e=>e.id]),()=>-1):-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ii({maskInputOptions:e,tagName:t,type:n}){return"OPTION"===t&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||"password"===n||"INPUT"===t&&!n&&e.text)}function is({isMasked:e,element:t,value:n,maskInputFn:r}){let i=n||"";return e?(r&&(i=r(i,t)),"*".repeat(i.length)):i}function io(e){return e.toLowerCase()}function ia(e){return e.toUpperCase()}let il="__rrweb_original__";function iu(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?io(t):null}function ic(e,t,n){return"INPUT"===t&&("radio"===n||"checkbox"===n)?e.getAttribute("value")||"":e.value}function id(e,t){let n;try{n=new URL(e,r6(t,()=>window.location.href))}catch(e){return null}return r6(r8([n.pathname.match(/\.([0-9a-z]+)(?:$)/i),"optionalAccess",e=>e[1]]),()=>null)}let ih={};function ip(e){let t=ih[e];if(t)return t;let n=window.document,r=window[e];if(n&&"function"==typeof n.createElement)try{let t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch(e){}return ih[e]=r.bind(window)}function im(...e){return ip("setTimeout")(...e)}function ig(...e){return ip("clearTimeout")(...e)}let iv=1,iy=RegExp("[^a-z0-9-_:]");function i_(){return iv++}let ib=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,iw=/^(?:[a-z+]+:)?\/\//i,iS=/^www\..*/i,iE=/^(data:)([^,]*),(.*)/i;function ix(e,t){return(e||"").replace(ib,(e,n,r,i,s,o)=>{let a=r||s||o,l=n||i||"";if(!a)return e;if(iw.test(a)||iS.test(a)||iE.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${(t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0]).split("?")[0]+a}${l})`;let u=t.split("/"),c=a.split("/");for(let e of(u.pop(),c))"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${l})`})}let ik=/^[^ \t\n\r\u000c]+/,iT=/^[, \t\n\r\u000c]+/,iO=new WeakMap;function iI(e,t){return t&&""!==t.trim()?iC(e,t):t}function iC(e,t){let n=iO.get(e);if(n||(n=e.createElement("a"),iO.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function iR(e,t,n,r,i,s){return r?"src"!==n&&("href"!==n||"use"===t&&"#"===r[0])&&("xlink:href"!==n||"#"===r[0])&&("background"!==n||"table"!==t&&"td"!==t&&"th"!==t)?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;let i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}let i=[];for(;r(iT),!(n>=t.length);){let s=r(ik);if(","===s.slice(-1))s=iI(e,s.substring(0,s.length-1)),i.push(s);else{let r="";s=iI(e,s);let o=!1;for(;;){let e=t.charAt(n);if(""===e){i.push((s+r).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){n+=1,i.push((s+r).trim());break}"("===e&&(o=!0)}r+=e,n+=1}}}return i.join(", ")}(e,r):"style"===n?ix(r,iC(e)):"object"===t&&"data"===n?iI(e,r):"function"==typeof s?s(n,r,i):r:iI(e,r):r}function iA(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function iP(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:iP(e.parentNode,t,n,r+1)}function iM(e,t){return n=>{if(null===n)return!1;try{if(e){if("string"==typeof e){if(n.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}(n,e))return!0}if(t&&n.matches(t))return!0;return!1}catch(e){return!1}}}function iL(e,t,n,r,i,s){try{let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("INPUT"===o.tagName){let e=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let a=-1,l=-1;if(s){if((l=iP(o,iM(r,i)))<0)return!0;a=iP(o,iM(t,n),l>=0?l:1/0)}else{if((a=iP(o,iM(t,n)))<0)return!1;l=iP(o,iM(r,i),a>=0?a:1/0)}return a>=0?!(l>=0)||a<=l:!(l>=0)&&!!s}catch(e){}return!!s}function iN(e){return null==e?"":e.toLowerCase()}function iD(e,t){let n;let{doc:r,mirror:i,blockClass:s,blockSelector:o,unblockSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:y,maskTextFn:_,maskInputFn:b,slimDOMOptions:w,dataURLOptions:S={},inlineImages:E=!1,recordCanvas:x=!1,onSerialize:k,onIframeLoad:T,iframeLoadTimeout:O=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:R=5e3,keepIframeSrcFn:A=()=>!1,newlyAddedElement:P=!1}=t,{preserveWhiteSpace:M=!0}=t,L=function(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskAttributeFn:l,maskTextClass:u,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:f,maskInputOptions:p={},maskTextFn:m,maskInputFn:y,dataURLOptions:_={},inlineImages:b,recordCanvas:w,keepIframeSrcFn:S,newlyAddedElement:E=!1}=t,x=function(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:if("CSS1Compat"!==e.compatMode)return{type:I.Document,childNodes:[],compatMode:e.compatMode};return{type:I.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:I.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:x};case e.ELEMENT_NODE:return function(e,t){let n;let{doc:r,blockClass:i,blockSelector:s,unblockSelector:o,inlineStylesheet:a,maskInputOptions:l={},maskAttributeFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:y,maskAllText:_,maskTextClass:b,unmaskTextClass:w,maskTextSelector:S,unmaskTextSelector:E}=t,x=function(e,t,n,r){try{if(r&&e.matches(r))return!1;if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,s,o),k=function(e){if(e instanceof HTMLFormElement)return"form";let t=io(e.tagName);return iy.test(t)?"div":t}(e),T={},O=e.attributes.length;for(let t=0;t<O;t++){let n=e.attributes[t];n.name&&!iA(k,n.name,n.value)&&(T[n.name]=iR(r,k,io(n.name),n.value,e,u))}if("link"===k&&a){let t=Array.from(r.styleSheets).find(t=>t.href===e.href),n=null;t&&(n=ie(t)),n&&(delete T.rel,delete T.href,T._cssText=ix(n,t.href))}if("style"===k&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let t=ie(e.sheet);t&&(T._cssText=ix(t,iC(r)))}if("input"===k||"textarea"===k||"select"===k||"option"===k){let t=iu(e),n=ic(e,ia(k),t),r=e.checked;if("submit"!==t&&"button"!==t&&n){let r=iL(e,b,S,w,E,ii({type:t,tagName:ia(k),maskInputOptions:l}));T.value=is({isMasked:r,element:e,value:n,maskInputFn:c})}r&&(T.checked=r)}if("option"===k&&(e.selected&&!l.select?T.selected=!0:delete T.selected),"canvas"===k&&f){if("2d"===e.__context)!function(e){let t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData;if(new Uint32Array((il in i?i[il]:i).call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0}(e)&&(T.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){let t=e.toDataURL(d.type,d.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height,t!==n.toDataURL(d.type,d.quality)&&(T.rr_dataURL=t)}}if("img"===k&&h){g||(v=(g=r.createElement("canvas")).getContext("2d"));let t=e.currentSrc||e.getAttribute("src")||"<unknown-src>",n=e.crossOrigin,i=()=>{e.removeEventListener("load",i);try{g.width=e.naturalWidth,g.height=e.naturalHeight,v.drawImage(e,0,0),T.rr_dataURL=g.toDataURL(d.type,d.quality)}catch(n){if("anonymous"!==e.crossOrigin){e.crossOrigin="anonymous",e.complete&&0!==e.naturalWidth?i():e.addEventListener("load",i);return}console.warn(`Cannot inline img src=${t}! Error: ${n}`)}"anonymous"===e.crossOrigin&&(n?T.crossOrigin=n:e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?i():e.addEventListener("load",i)}if(("audio"===k||"video"===k)&&(T.rr_mediaState=e.paused?"paused":"played",T.rr_mediaCurrentTime=e.currentTime),!m&&(e.scrollLeft&&(T.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(T.rr_scrollTop=e.scrollTop)),x){let{width:t,height:n}=e.getBoundingClientRect();T={class:T.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==k||p(T.src)||(x||e.contentDocument||(T.rr_src=T.src),delete T.src);try{customElements.get(k)&&(n=!0)}catch(e){}return{type:I.Element,tagName:k,attributes:T,childNodes:[],isSVG:!!("svg"===e.tagName||e.ownerSVGElement)||void 0,needBlock:x,rootId:y,isCustom:n}}(e,{doc:n,blockClass:i,blockSelector:s,unblockSelector:o,inlineStylesheet:f,maskAttributeFn:l,maskInputOptions:p,maskInputFn:y,dataURLOptions:_,inlineImages:b,recordCanvas:w,keepIframeSrcFn:S,newlyAddedElement:E,rootId:x,maskAllText:a,maskTextClass:u,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h});case e.TEXT_NODE:return function(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:s,unmaskTextSelector:o,maskTextFn:a,maskInputOptions:l,maskInputFn:u,rootId:c}=t,d=e.parentNode&&e.parentNode.tagName,h=e.textContent,f="STYLE"===d||void 0,p="SCRIPT"===d||void 0,m="TEXTAREA"===d||void 0;if(f&&h){try{e.nextSibling||e.previousSibling||r8([e,"access",e=>e.parentNode,"access",e=>e.sheet,"optionalAccess",e=>e.cssRules])&&(h=ie(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}h=ix(h,iC(t.doc))}p&&(h="SCRIPT_PLACEHOLDER");let g=iL(e,r,s,i,o,n);return f||p||m||!h||!g||(h=a?a(h,e.parentElement):h.replace(/[\S]/g,"*")),m&&h&&(l.textarea||g)&&(h=u?u(h,e.parentNode):h.replace(/[\S]/g,"*")),"OPTION"===d&&h&&(h=is({isMasked:iL(e,r,s,i,o,ii({type:null,tagName:d,maskInputOptions:l})),element:e,value:h,maskInputFn:u})),{type:I.Text,textContent:h||"",isStyle:f,rootId:c}}(e,{doc:n,maskAllText:a,maskTextClass:u,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,maskTextFn:m,maskInputOptions:p,maskInputFn:y,rootId:x});case e.CDATA_SECTION_NODE:return{type:I.CDATA,textContent:"",rootId:x};case e.COMMENT_NODE:return{type:I.Comment,textContent:e.textContent||"",rootId:x};default:return!1}}(e,{doc:r,mirror:i,blockClass:s,blockSelector:o,maskAllText:l,unblockSelector:a,maskTextClass:u,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:y,maskTextFn:_,maskInputFn:b,dataURLOptions:S,inlineImages:E,recordCanvas:x,keepIframeSrcFn:A,newlyAddedElement:P});if(!L)return console.warn(e,"not serialized"),null;n=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===I.Comment)return!0;if(e.type===I.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===id(e.attributes.href))||t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(iN(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===iN(e.attributes.name)||"icon"===iN(e.attributes.rel)||"apple-touch-icon"===iN(e.attributes.rel)||"shortcut icon"===iN(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&iN(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(iN(e.attributes.property).match(/^(og|twitter|fb):/)||iN(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===iN(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===iN(e.attributes.name)||"googlebot"===iN(e.attributes.name)||"bingbot"===iN(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;else if(t.headMetaAuthorship&&("author"===iN(e.attributes.name)||"generator"===iN(e.attributes.name)||"framework"===iN(e.attributes.name)||"publisher"===iN(e.attributes.name)||"progid"===iN(e.attributes.name)||iN(e.attributes.property).match(/^article:/)||iN(e.attributes.property).match(/^product:/)))return!0;else if(t.headMetaVerification&&("google-site-verification"===iN(e.attributes.name)||"yandex-verification"===iN(e.attributes.name)||"csrf-token"===iN(e.attributes.name)||"p:domain_verify"===iN(e.attributes.name)||"verify-v1"===iN(e.attributes.name)||"verification"===iN(e.attributes.name)||"shopify-checkout-api-token"===iN(e.attributes.name)))return!0}}return!1}(L,w)&&(M||L.type!==I.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?i_():-2;let N=Object.assign(L,{id:n});if(i.add(e,N),-2===n)return null;k&&k(e);let D=!f;if(N.type===I.Element){D=D&&!N.needBlock,delete N.needBlock;let t=e.shadowRoot;t&&r9(t)&&(N.isShadowHost=!0)}if((N.type===I.Document||N.type===I.Element)&&D){w.headWhitespace&&N.type===I.Element&&"head"===N.tagName&&(M=!1);let t={doc:r,mirror:i,blockClass:s,blockSelector:o,maskAllText:l,unblockSelector:a,maskTextClass:u,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,skipChild:f,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:y,maskTextFn:_,maskInputFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:E,recordCanvas:x,preserveWhiteSpace:M,onSerialize:k,onIframeLoad:T,iframeLoadTimeout:O,onStylesheetLoad:C,stylesheetLoadTimeout:R,keepIframeSrcFn:A};for(let n of Array.from(e.childNodes)){let e=iD(n,t);e&&N.childNodes.push(e)}if(e.nodeType===e.ELEMENT_NODE&&e.shadowRoot)for(let n of Array.from(e.shadowRoot.childNodes)){let r=iD(n,t);r&&(r9(e.shadowRoot)&&(r.isShadow=!0),N.childNodes.push(r))}}return e.parentNode&&r7(e.parentNode)&&r9(e.parentNode)&&(N.isShadow=!0),N.type===I.Element&&"iframe"===N.tagName&&function(e,t,n){let r;let i=e.contentWindow;if(!i)return;let s=!1;try{r=i.document.readyState}catch(e){return}if("complete"!==r){let r=im(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{ig(r),s=!0,t()});return}let o="about:blank";if(i.location.href!==o||e.src===o||""===e.src)return im(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{let t=e.contentDocument;if(t&&T){let n=iD(t,{doc:t,mirror:i,blockClass:s,blockSelector:o,unblockSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:y,maskTextFn:_,maskInputFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:E,recordCanvas:x,preserveWhiteSpace:M,onSerialize:k,onIframeLoad:T,iframeLoadTimeout:O,onStylesheetLoad:C,stylesheetLoadTimeout:R,keepIframeSrcFn:A});n&&T(e,n)}},O),N.type===I.Element&&"link"===N.tagName&&"string"==typeof N.attributes.rel&&("stylesheet"===N.attributes.rel||"preload"===N.attributes.rel&&"string"==typeof N.attributes.href&&"css"===id(N.attributes.href))&&function(e,t,n){let r,i=!1;try{r=e.sheet}catch(e){return}if(r)return;let s=im(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{ig(s),i=!0,t()})}(e,()=>{if(C){let t=iD(e,{doc:r,mirror:i,blockClass:s,blockSelector:o,unblockSelector:a,maskAllText:l,maskTextClass:u,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:y,maskTextFn:_,maskInputFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:E,recordCanvas:x,preserveWhiteSpace:M,onSerialize:k,onIframeLoad:T,iframeLoadTimeout:O,onStylesheetLoad:C,stylesheetLoadTimeout:R,keepIframeSrcFn:A});t&&C(e,t)}},R),N}function i$(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):("call"===i||"optionalCall"===i)&&(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}function ij(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}let iF="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",iU={map:{},getId:()=>(console.error(iF),-1),getNode:()=>(console.error(iF),null),removeNodeFromMap(){console.error(iF)},has:()=>(console.error(iF),!1),reset(){console.error(iF)}};function iq(e,t,n={}){let r=null,i=0;return function(...s){let o=Date.now();i||!1!==n.leading||(i=o);let a=t-(o-i),l=this;a<=0||a>t?(r&&(function(...e){i5("clearTimeout")(...e)}(r),r=null),i=o,e.apply(l,s)):r||!1===n.trailing||(r=i4(()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(l,s)},a))}}function iB(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(iU=new Proxy(iU,{get:(e,t,n)=>("map"===t&&console.error(iF),Reflect.get(e,t,n))}));let iH=Date.now;function iz(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i$([t,"optionalAccess",e=>e.documentElement,"access",e=>e.scrollLeft])||i$([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.parentElement,"optionalAccess",e=>e.scrollLeft])||i$([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.scrollLeft])||0,top:t.scrollingElement?t.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:i$([t,"optionalAccess",e=>e.documentElement,"access",e=>e.scrollTop])||i$([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.parentElement,"optionalAccess",e=>e.scrollTop])||i$([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.scrollTop])||0}}function iW(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function iV(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function iG(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function iQ(e,t,n,r,i){if(!e)return!1;let s=iG(e);if(!s)return!1;let o=iM(t,n);if(!i){let e=r&&s.matches(r);return o(s)&&!e}let a=iP(s,o),l=-1;return!(a<0)&&(r&&(l=iP(s,iM(null,r))),a>-1&&l<0||a<l)}function iK(e,t){return -2===t.getId(e)}function iJ(e){return!!e.changedTouches}function iX(e,t){return!!("IFRAME"===e.nodeName&&t.getMeta(e))}function iZ(e,t){return!!("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function iY(e){return!!i$([e,"optionalAccess",e=>e.shadowRoot])}/[1-9][0-9]{12}/.test(Date.now().toString())||(iH=()=>new Date().getTime());class i0{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return t=this.styleIDMap.get(e),null!=t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){let n;return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n)}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function i1(e){let t=null;return i$([e,"access",e=>e.getRootNode,"optionalCall",e=>e(),"optionalAccess",e=>e.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function i2(e){let t=e.ownerDocument;return!!t&&(t.contains(e)||function(e){let t=e.ownerDocument;if(!t)return!1;let n=function(e){let t,n=e;for(;t=i1(n);)n=t;return n}(e);return t.contains(n)}(e))}let i3={};function i5(e){let t=i3[e];if(t)return t;let n=window.document,r=window[e];if(n&&"function"==typeof n.createElement)try{let t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch(e){}return i3[e]=r.bind(window)}function i4(...e){return i5("setTimeout")(...e)}var i6=((E=i6||{})[E.DomContentLoaded=0]="DomContentLoaded",E[E.Load=1]="Load",E[E.FullSnapshot=2]="FullSnapshot",E[E.IncrementalSnapshot=3]="IncrementalSnapshot",E[E.Meta=4]="Meta",E[E.Custom=5]="Custom",E[E.Plugin=6]="Plugin",E),i8=((x=i8||{})[x.Mutation=0]="Mutation",x[x.MouseMove=1]="MouseMove",x[x.MouseInteraction=2]="MouseInteraction",x[x.Scroll=3]="Scroll",x[x.ViewportResize=4]="ViewportResize",x[x.Input=5]="Input",x[x.TouchMove=6]="TouchMove",x[x.MediaInteraction=7]="MediaInteraction",x[x.StyleSheetRule=8]="StyleSheetRule",x[x.CanvasMutation=9]="CanvasMutation",x[x.Font=10]="Font",x[x.Log=11]="Log",x[x.Drag=12]="Drag",x[x.StyleDeclaration=13]="StyleDeclaration",x[x.Selection=14]="Selection",x[x.AdoptedStyleSheet=15]="AdoptedStyleSheet",x[x.CustomElement=16]="CustomElement",x),i7=((k=i7||{})[k.MouseUp=0]="MouseUp",k[k.MouseDown=1]="MouseDown",k[k.Click=2]="Click",k[k.ContextMenu=3]="ContextMenu",k[k.DblClick=4]="DblClick",k[k.Focus=5]="Focus",k[k.Blur=6]="Blur",k[k.TouchStart=7]="TouchStart",k[k.TouchMove_Departed=8]="TouchMove_Departed",k[k.TouchEnd=9]="TouchEnd",k[k.TouchCancel=10]="TouchCancel",k),i9=((T=i9||{})[T.Mouse=0]="Mouse",T[T.Pen=1]="Pen",T[T.Touch=2]="Touch",T);class se{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=function(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):("call"===i||"optionalCall"===i)&&(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.next])||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&"__ln"in e.previousSibling){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&"__ln"in e.nextSibling&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}let st=(e,t)=>`${e}@${t}`;class sn{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new se,r=e=>{let t=e,n=-2;for(;-2===n;)n=(t=t&&t.nextSibling)&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!i2(i))return;let s=r7(i.parentNode)?this.mirror.getId(i1(i)):this.mirror.getId(i.parentNode),o=r(i);if(-1===s||-1===o)return n.addNode(i);let a=iD(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{iX(e,this.mirror)&&!iQ(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),iZ(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),iY(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{iQ(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(e,t),e.contentWindow&&this.canvasManager.addWindow(e.contentWindow),this.shadowDomManager.observeAttachShadow(e))},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});a&&(e.push({parentId:s,nextId:o,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)(!si(this.removes,e,this.mirror)||this.movedSet.has(e.parentNode))&&i(e);for(let e of this.addedSet)ss(this.droppedSet,e)||si(this.removes,e,this.mirror)?ss(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let s=null;for(;n.length;){let e=null;if(s){let t=this.mirror.getId(s.value.parentNode),n=r(s.value);-1!==t&&-1!==n&&(e=s)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{let t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}s=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if("string"==typeof t.style){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!iK(e.target,this.mirror))switch(e.type){case"characterData":{let t=e.target.textContent;iQ(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||t===e.oldValue||this.texts.push({value:iL(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,iG(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){let n=iu(t),i=t.tagName;r=ic(t,i,n);let s=ii({maskInputOptions:this.maskInputOptions,tagName:i,type:n});r=is({isMasked:iL(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,s),element:t,value:r,maskInputFn:this.maskInputFn})}if(iQ(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!iA(t.tagName,n)&&(i.attributes[n]=iR(this.doc,io(t.tagName),io(n),r,t,this.maskAttributeFn),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement("span");for(let r of(e.oldValue&&n.setAttribute("style",e.oldValue),Array.from(t.style))){let e=t.style.getPropertyValue(r),s=t.style.getPropertyPriority(r);e!==n.style.getPropertyValue(r)||s!==n.style.getPropertyPriority(r)?""===s?i.styleDiff[r]=e:i.styleDiff[r]=[e,s]:i._unchangedStyles[r]=[e,s]}for(let e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}break}case"childList":if(iQ(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=r7(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);iQ(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||iK(t,this.mirror)||-1===this.mirror.getId(t)||(this.addedSet.has(t)?(sr(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||function e(t,n){if(r7(t))return!1;let r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))}(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[st(n,r)]?sr(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!!(r7(e.target)&&r9(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(iK(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[st(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);!iQ(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&(e.childNodes.forEach(e=>this.genAdds(e)),iY(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function sr(e,t){e.delete(t),t.childNodes.forEach(t=>sr(e,t))}function si(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){let t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}(e,t,n)}function ss(e,t){return 0!==e.size&&function e(t,n){let{parentNode:r}=n;return!!r&&(!!t.has(r)||e(t,r))}(e,t)}let so=e=>y?(...t)=>{try{return e(...t)}catch(e){if(y&&!0===y(e))return()=>{};throw e}}:e;function sa(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):("call"===i||"optionalCall"===i)&&(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}let sl=[];function su(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function sc(e,t){let n=new sn;sl.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,i=sa([window,"optionalAccess",e=>e.Zone,"optionalAccess",e=>e.__symbol__,"optionalCall",e=>e("MutationObserver")]);i&&window[i]&&(r=window[i]);let s=new r(so(t=>{e.onMutation&&!1===e.onMutation(t)||n.processMutations.bind(n)(t)}));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function sd({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){return ij("scroll",so(iq(so(o=>{let a=su(o);if(!a||iQ(a,r,i,s,!0))return;let l=n.getId(a);if(a===t&&t.defaultView){let n=iz(t.defaultView);e({id:l,x:n.left,y:n.top})}else e({id:l,x:a.scrollLeft,y:a.scrollTop})}),o.scroll||100)),t)}let sh=["INPUT","TEXTAREA","SELECT"],sf=new WeakMap;function sp(e){var t;return t=[],sy("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||sy("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||sy("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||sy("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule?t.unshift(Array.from(e.parentRule.cssRules).indexOf(e)):e.parentStyleSheet&&t.unshift(Array.from(e.parentStyleSheet.cssRules).indexOf(e)),t}function sm(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function sg({mirror:e,stylesheetManager:t},n){let r=null;r="#document"===n.nodeName?e.getId(n):e.getId(n.host);let i="#document"===n.nodeName?sa([n,"access",e=>e.defaultView,"optionalAccess",e=>e.Document]):sa([n,"access",e=>e.ownerDocument,"optionalAccess",e=>e.defaultView,"optionalAccess",e=>e.ShadowRoot]),s=sa([i,"optionalAccess",e=>e.prototype])?Object.getOwnPropertyDescriptor(sa([i,"optionalAccess",e=>e.prototype]),"adoptedStyleSheets"):void 0;return null!==r&&-1!==r&&i&&s?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return sa([s,"access",e=>e.get,"optionalAccess",e=>e.call,"call",e=>e(this)])},set(e){let n=sa([s,"access",e=>e.set,"optionalAccess",e=>e.call,"call",t=>t(this,e)]);if(null!==r&&-1!==r)try{t.adoptStyleSheets(e,r)}catch(e){}return n}}),so(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})})):()=>{}}function sv(e,t={}){let n;let r=e.doc.defaultView;if(!r)return()=>{};e.recordDOM&&(n=sc(e,e.doc));let i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){let i;if(!1===t.mousemove)return()=>{};let s="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500,a=[],l=iq(so(t=>{let n=Date.now()-i;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],i=null}),o),u=so(iq(so(e=>{let t=su(e),{clientX:n,clientY:s}=iJ(e)?e.changedTouches[0]:e;i||(i=iH()),a.push({x:n,y:s,id:r.getId(t),timeOffset:iH()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?i8.Drag:e instanceof MouseEvent?i8.MouseMove:i8.TouchMove)}),s,{trailing:!1})),c=[ij("mousemove",u,n),ij("touchmove",u,n),ij("drag",u,n)];return so(()=>{c.forEach(e=>e())})}(e),s=function({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,sampling:o}){if(!1===o.mouseInteraction)return()=>{};let a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,l=[],u=null,c=t=>o=>{let a=su(o);if(iQ(a,r,i,s,!0))return;let l=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":l=i9.Mouse;break;case"touch":l=i9.Touch;break;case"pen":l=i9.Pen}l===i9.Touch?i7[t]===i7.MouseDown?c="TouchStart":i7[t]===i7.MouseUp&&(c="TouchEnd"):i9.Pen}else iJ(o)&&(l=i9.Touch);null!==l?(u=l,(c.startsWith("Touch")&&l===i9.Touch||c.startsWith("Mouse")&&l===i9.Mouse)&&(l=null)):i7[t]===i7.Click&&(l=u,u=null);let d=iJ(o)?o.changedTouches[0]:o;if(!d)return;let h=n.getId(a),{clientX:f,clientY:p}=d;so(e)({type:i7[c],id:h,x:f,y:p,...null!==l&&{pointerType:l}})};return Object.keys(i7).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]).forEach(e=>{let n=io(e),r=c(e);if(window.PointerEvent)switch(i7[e]){case i7.MouseDown:case i7.MouseUp:n=n.replace("mouse","pointer");break;case i7.TouchStart:case i7.TouchEnd:return}l.push(ij(n,r,t))}),so(()=>{l.forEach(e=>e())})}(e),o=sd(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return ij("resize",so(iq(so(()=>{let t=iW(),i=iV();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:l,maskInputFn:u,sampling:c,userTriggeredOnInput:d,maskTextClass:h,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:m}){function g(e){let n=su(e),c=e.isTrusted,g=n&&ia(n.tagName);if("OPTION"===g&&(n=n.parentElement),!n||!g||0>sh.indexOf(g)||iQ(n,r,i,s,!0))return;let y=n;if(y.classList.contains(o)||a&&y.matches(a))return;let _=iu(n),b=ic(y,g,_),w=!1,S=ii({maskInputOptions:l,tagName:g,type:_}),E=iL(n,h,p,f,m,S);("radio"===_||"checkbox"===_)&&(w=n.checked),b=is({isMasked:E,element:n,value:b,maskInputFn:u}),v(n,d?{text:b,isChecked:w,userTriggered:c}:{text:b,isChecked:w});let x=n.name;"radio"===_&&x&&w&&t.querySelectorAll(`input[type="radio"][name="${x}"]`).forEach(e=>{if(e!==n){let t=is({isMasked:E,element:e,value:ic(e,g,_),maskInputFn:u});v(e,d?{text:t,isChecked:!w,userTriggered:!1}:{text:t,isChecked:!w})}})}function v(t,r){let i=sf.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){sf.set(t,r);let i=n.getId(t);so(e)({...r,id:i})}}let y=("last"===c.input?["change"]:["input","change"]).map(e=>ij(e,so(g),t)),_=t.defaultView;if(!_)return()=>{y.forEach(e=>e())};let b=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value"),w=[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&y.push(...w.map(e=>(function e(t,n,r,i,s=window){let o=s.Object.getOwnPropertyDescriptor(t,n);return s.Object.defineProperty(t,n,i?r:{set(e){i4(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,n,o||{},!0)})(e[0],e[1],{set(){so(g)({target:this,isTrusted:!1})}},!1,_))),so(()=>{y.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:s,doc:o}){let a=so(o=>iq(so(s=>{let a=su(s);if(!a||iQ(a,t,n,r,!0))return;let{currentTime:l,volume:u,muted:c,playbackRate:d}=a;e({type:o,id:i.getId(a),currentTime:l,volume:u,muted:c,playbackRate:d})}),s.media||500)),l=[ij("play",a(0),o),ij("pause",a(1),o),ij("seeked",a(2),o),ij("volumechange",a(3),o),ij("ratechange",a(4),o)];return so(()=>{l.forEach(e=>e())})}(e),c=()=>{},d=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(c=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){let i,s;if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:so((r,i,s)=>{let[o,a]=s,{id:l,styleId:u}=sm(i,t,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:o,index:a}]}),r.apply(i,s)})});let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:so((r,i,s)=>{let[o]=s,{id:a,styleId:l}=sm(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:o}]}),r.apply(i,s)})}),r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:so((r,i,s)=>{let[o]=s,{id:a,styleId:l}=sm(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:o}),r.apply(i,s)})})),r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:so((r,i,s)=>{let[o]=s,{id:a,styleId:l}=sm(i,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),r.apply(i,s)})}));let l={};s_("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(s_("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),s_("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),s_("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(l).forEach(([r,i])=>{u[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(u[r].insertRule,{apply:so((r,i,s)=>{let[o,a]=s,{id:l,styleId:u}=sm(i.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:o,index:[...sp(i),a||0]}]}),r.apply(i,s)})}),i.prototype.deleteRule=new Proxy(u[r].deleteRule,{apply:so((r,i,s)=>{let[o]=s,{id:a,styleId:l}=sm(i.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...sp(i),o]}]}),r.apply(i,s)})})}),so(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=a,i&&(r.CSSStyleSheet.prototype.replace=i),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule})})}(e,{win:r}),d=sg(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:so((i,o,a)=>{let[l,u,c]=a;if(n.has(l))return s.apply(o,[l,u,c]);let{id:d,styleId:h}=sm(sa([o,"access",e=>e.parentRule,"optionalAccess",e=>e.parentStyleSheet]),t,r.styleMirror);return(d&&-1!==d||h&&-1!==h)&&e({id:d,styleId:h,set:{property:l,value:u,priority:c},index:sp(o.parentRule)}),i.apply(o,a)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:so((i,s,a)=>{let[l]=a;if(n.has(l))return o.apply(s,[l]);let{id:u,styleId:c}=sm(sa([s,"access",e=>e.parentRule,"optionalAccess",e=>e.parentStyleSheet]),t,r.styleMirror);return(u&&-1!==u||c&&-1!==c)&&e({id:u,styleId:c,remove:{property:l},index:sp(s.parentRule)}),i.apply(s,a)})}),so(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=o})}(e,{win:r}),e.collectFonts&&(f=function({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,n){let r=new s(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=iB(t.fonts,"add",function(t){return function(n){return i4(so(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=s}),r.push(o),so(()=>{r.forEach(e=>e())})}(e)));let p=function(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,selectionCb:o}=e,a=!0,l=so(()=>{let e=t.getSelection();if(!e||a&&sa([e,"optionalAccess",e=>e.isCollapsed]))return;a=e.isCollapsed||!1;let l=[],u=e.rangeCount||0;for(let t=0;t<u;t++){let{startContainer:o,startOffset:a,endContainer:u,endOffset:c}=e.getRangeAt(t);iQ(o,r,i,s,!0)||iQ(u,r,i,s,!0)||l.push({start:n.getId(o),startOffset:a,end:n.getId(u),endOffset:c})}o({ranges:l})});return l(),ij("selectionchange",l)}(e),m=function({doc:e,customElementCb:t}){let n=e.defaultView;return n&&n.customElements?iB(n.customElements,"define",function(e){return function(n,r,i){try{t({define:{name:n}})}catch(e){}return e.apply(this,[n,r,i])}}):()=>{}}(e),g=[];for(let t of e.plugins)g.push(t.observer(t.callback,r,t.options));return so(()=>{sl.forEach(e=>e.reset()),sa([n,"optionalAccess",e=>e.disconnect,"call",e=>e()]),i(),s(),o(),a(),l(),u(),c(),d(),h(),f(),p(),m(),g.forEach(e=>e())})}function sy(e){return void 0!==window[e]}function s_(e){return!!(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class sb{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),s.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:r.get(t)||-1}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}function sw(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):("call"===i||"optionalCall"===i)&&(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}class sS{constructor(){this.crossOriginIframeMirror=new sb(i_),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class sE{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new sb(i_),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new sb(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),sw([this,"access",e=>e.loadListener,"optionalCall",t=>t(e)]),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"!==e.data.type||e.origin!==e.data.origin||!e.source)return;let t=this.crossOriginIframeMap.get(e.source);if(!t)return;let n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case i6.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:i6.IncrementalSnapshot,data:{source:i8.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case i6.Meta:case i6.Load:case i6.DomContentLoaded:break;case i6.Plugin:return t;case i6.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case i6.IncrementalSnapshot:switch(t.data.source){case i8.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case i8.Drag:case i8.TouchMove:case i8.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case i8.ViewportResize:return!1;case i8.MediaInteraction:case i8.MouseInteraction:case i8.Scroll:case i8.CanvasMutation:case i8.Input:return this.replaceIds(t.data,e,["id"]),t;case i8.StyleSheetRule:case i8.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case i8.Font:return t;case i8.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case i8.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),sw([t,"access",e=>e.data,"access",e=>e.styles,"optionalAccess",e=>e.forEach,"call",t=>t(t=>{this.replaceStyleIds(t,e,["styleId"])})]),t}}return!1}replace(e,t,n,r){for(let i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===I.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class sx{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class sk{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!r9(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let n=sc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(sd({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),i4(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(sg({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(iB(e.prototype,"attachShadow",function(e){return function(r){let i=e.call(this,r);return this.shadowRoot&&i2(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class sT{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class sO{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new i0,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:it(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class sI{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,function(...e){i5("requestAnimationFrame")(...e)}(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}try{if(2!==Array.from([1],e=>2*e)[0]){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=ne([e,"access",e=>e.contentWindow,"optionalAccess",e=>e.Array,"access",e=>e.from])||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}let sC=new ir;function sR(e={}){let t;let{emit:n,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:o=null,unblockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:u=null,maskAllText:c=!1,maskTextClass:d="rr-mask",unmaskTextClass:h=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:g,maskInputOptions:v,slimDOMOptions:w,maskAttributeFn:S,maskInputFn:E,maskTextFn:x,maxCanvasSize:k=null,packFn:T,sampling:O={},dataURLOptions:I={},mousemoveWait:C,recordDOM:R=!0,recordCanvas:A=!1,recordCrossOriginIframes:P=!1,recordAfter:M="DOMContentLoaded"===e.recordAfter?e.recordAfter:"load",userTriggeredOnInput:L=!1,collectFonts:N=!1,inlineImages:D=!1,plugins:$,keepIframeSrcFn:j=()=>!1,ignoreCSSAttributes:F=new Set([]),errorHandler:U,onMutation:q,getCanvasManager:B}=e;y=U;let H=!P||window.parent===window,z=!1;if(!H)try{window.parent.document&&(z=!1)}catch(e){z=!0}if(H&&!n)throw Error("emit function is required");if(!H&&!z)return()=>{};void 0!==C&&void 0===O.mousemove&&(O.mousemove=C),sC.reset();let W=!0===g?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==v?v:{},V=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}();let G=0,Q=e=>{for(let t of $||[])t.eventProcessor&&(e=t.eventProcessor(e));return T&&!z&&(e=T(e)),e};_=(e,s)=>{if(e.timestamp=iH(),ne([sl,"access",e=>e[0],"optionalAccess",e=>e.isFrozen,"call",e=>e()])&&e.type!==i6.FullSnapshot&&!(e.type===i6.IncrementalSnapshot&&e.data.source===i8.Mutation)&&sl.forEach(e=>e.unfreeze()),H)ne([n,"optionalCall",t=>t(Q(e),s)]);else if(z){let t={type:"rrweb",event:Q(e),origin:window.location.origin,isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===i6.FullSnapshot)t=e,G=0;else if(e.type===i6.IncrementalSnapshot){if(e.data.source===i8.Mutation&&e.data.isAttachIframe)return;G++;let n=i&&G>=i,s=r&&t&&e.timestamp-t.timestamp>r;(n||s)&&er(!0)}};let K=e=>{_({type:i6.IncrementalSnapshot,data:{source:i8.Mutation,...e}})},J=e=>_({type:i6.IncrementalSnapshot,data:{source:i8.Scroll,...e}}),X=e=>_({type:i6.IncrementalSnapshot,data:{source:i8.CanvasMutation,...e}}),Z=new sO({mutationCb:K,adoptedStyleSheetCb:e=>_({type:i6.IncrementalSnapshot,data:{source:i8.AdoptedStyleSheet,...e}})}),Y="boolean"==typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new sS:new sE({mirror:sC,mutationCb:K,stylesheetManager:Z,recordCrossOriginIframes:P,wrappedEmit:_});for(let e of $||[])e.getMirror&&e.getMirror({nodeMirror:sC,crossOriginIframeMirror:Y.crossOriginIframeMirror,crossOriginIframeStyleMirror:Y.crossOriginIframeStyleMirror});let ee=new sI,et=function(e,t){try{return e?e(t):new sT}catch(e){return console.warn("Unable to initialize CanvasManager"),new sT}}(B,{mirror:sC,win:window,mutationCb:e=>_({type:i6.IncrementalSnapshot,data:{source:i8.CanvasMutation,...e}}),recordCanvas:A,blockClass:s,blockSelector:o,unblockSelector:a,maxCanvasSize:k,sampling:O.canvas,dataURLOptions:I,errorHandler:U}),en="boolean"==typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new sx:new sk({mutationCb:K,scrollCb:J,bypassOptions:{onMutation:q,blockClass:s,blockSelector:o,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:h,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:W,dataURLOptions:I,maskAttributeFn:S,maskTextFn:x,maskInputFn:E,recordCanvas:A,inlineImages:D,sampling:O,slimDOMOptions:V,iframeManager:Y,stylesheetManager:Z,canvasManager:et,keepIframeSrcFn:j,processedNodeManager:ee},mirror:sC}),er=(e=!1)=>{if(!R)return;_({type:i6.Meta,data:{href:window.location.href,width:iV(),height:iW()}},e),Z.reset(),en.init(),sl.forEach(e=>e.lock());let t=function(e,t){let{mirror:n=new ir,blockClass:r="rr-block",blockSelector:i=null,unblockSelector:s=null,maskAllText:o=!1,maskTextClass:a="rr-mask",unmaskTextClass:l=null,maskTextSelector:u=null,unmaskTextSelector:c=null,inlineStylesheet:d=!0,inlineImages:h=!1,recordCanvas:f=!1,maskAllInputs:p=!1,maskAttributeFn:m,maskTextFn:g,maskInputFn:v,slimDOM:y=!1,dataURLOptions:_,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:E,onStylesheetLoad:x,stylesheetLoadTimeout:k,keepIframeSrcFn:T=()=>!1}=t||{};return iD(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,maskAllText:o,maskTextClass:a,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===p?{}:p,maskAttributeFn:m,maskTextFn:g,maskInputFn:v,slimDOMOptions:!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===y,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===y?{}:y,dataURLOptions:_,inlineImages:h,recordCanvas:f,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:E,onStylesheetLoad:x,stylesheetLoadTimeout:k,keepIframeSrcFn:T,newlyAddedElement:!1})}(document,{mirror:sC,blockClass:s,blockSelector:o,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:h,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:W,maskAttributeFn:S,maskInputFn:E,maskTextFn:x,slimDOM:V,dataURLOptions:I,recordCanvas:A,inlineImages:D,onSerialize:e=>{iX(e,sC)&&Y.addIframe(e),iZ(e,sC)&&Z.trackLinkElement(e),iY(e)&&en.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{Y.attachIframe(e,t),e.contentWindow&&et.addWindow(e.contentWindow),en.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Z.attachLinkElement(e,t)},keepIframeSrcFn:j});if(!t)return console.warn("Failed to snapshot the document");_({type:i6.FullSnapshot,data:{node:t,initialOffset:iz(window)}}),sl.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Z.adoptStyleSheets(document.adoptedStyleSheets,sC.getId(document))};b=er;try{let e=[],t=e=>so(sv)({onMutation:q,mutationCb:K,mousemoveCb:(e,t)=>_({type:i6.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_({type:i6.IncrementalSnapshot,data:{source:i8.MouseInteraction,...e}}),scrollCb:J,viewportResizeCb:e=>_({type:i6.IncrementalSnapshot,data:{source:i8.ViewportResize,...e}}),inputCb:e=>_({type:i6.IncrementalSnapshot,data:{source:i8.Input,...e}}),mediaInteractionCb:e=>_({type:i6.IncrementalSnapshot,data:{source:i8.MediaInteraction,...e}}),styleSheetRuleCb:e=>_({type:i6.IncrementalSnapshot,data:{source:i8.StyleSheetRule,...e}}),styleDeclarationCb:e=>_({type:i6.IncrementalSnapshot,data:{source:i8.StyleDeclaration,...e}}),canvasMutationCb:X,fontCb:e=>_({type:i6.IncrementalSnapshot,data:{source:i8.Font,...e}}),selectionCb:e=>{_({type:i6.IncrementalSnapshot,data:{source:i8.Selection,...e}})},customElementCb:e=>{_({type:i6.IncrementalSnapshot,data:{source:i8.CustomElement,...e}})},blockClass:s,ignoreClass:l,ignoreSelector:u,maskAllText:c,maskTextClass:d,unmaskTextClass:h,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:W,inlineStylesheet:m,sampling:O,recordDOM:R,recordCanvas:A,inlineImages:D,userTriggeredOnInput:L,collectFonts:N,doc:e,maskAttributeFn:S,maskInputFn:E,maskTextFn:x,keepIframeSrcFn:j,blockSelector:o,unblockSelector:a,slimDOMOptions:V,dataURLOptions:I,mirror:sC,iframeManager:Y,stylesheetManager:Z,shadowDomManager:en,processedNodeManager:ee,canvasManager:et,ignoreCSSAttributes:F,plugins:ne([$,"optionalAccess",e=>e.filter,"call",e=>e(e=>e.observer),"optionalAccess",e=>e.map,"call",e=>e(e=>({observer:e.observer,options:e.options,callback:t=>_({type:i6.Plugin,data:{plugin:e.name,payload:t}})}))])||[]},{});Y.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{er(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(ij("DOMContentLoaded",()=>{_({type:i6.DomContentLoaded,data:{}}),"DOMContentLoaded"===M&&n()})),e.push(ij("load",()=>{_({type:i6.Load,data:{}}),"load"===M&&n()},window))),()=>{e.forEach(e=>e()),ee.destroy(),b=void 0,y=void 0}}catch(e){console.warn(e)}}sR.mirror=sC,sR.takeFullSnapshot=function(e){if(!b)throw Error("please take full snapshot after start recording");b(e)};let sA="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,sP=["info","warn","error","log"],sM="[Replay] ";function sL(e,t="info"){(0,e1.n)({category:"console",data:{logger:"replay"},level:t,message:`${sM}${e}`},{level:t})}let sN=function(){let e=!1,t=!1,n={exception:()=>void 0,infoTick:()=>void 0,setConfig:n=>{e=n.captureExceptions,t=n.traceInternals}};return sA?(sP.forEach(e=>{n[e]=(...n)=>{L.kg[e](sM,...n),t&&sL(n.join(""),tt(e))}}),n.exception=(r,...i)=>{i.length&&n.error&&n.error(...i),L.kg.error(sM,r),e?(0,M.Tb)(r):t&&sL(r,"error")},n.infoTick=(...e)=>{L.kg.info(sM,...e),t&&setTimeout(()=>sL(e[0]),0)}):sP.forEach(e=>{n[e]=()=>void 0}),n}();function sD(e){return e>9999999999?e:1e3*e}function s$(e){return e>9999999999?e/1e3:e}function sj(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:i6.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:(0,e_.Fv)(t,10,1e3)}}),"console"===t.category)))}function sF(e){return e.closest("button,a")||e}function sU(e){let t=sq(e);return t&&t instanceof Element?sF(t):t}function sq(e){return"object"==typeof e&&e&&"target"in e?e.target:e}let sB=new Set([i8.Mutation,i8.StyleSheetRule,i8.StyleDeclaration,i8.AdoptedStyleSheet,i8.CanvasMutation,i8.Selection,i8.MediaInteraction]);class sH{constructor(e,t,n=sj){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){var e;let t=(e=()=>{this._lastMutation=sW()},w||(w=[],(0,z.hl)(r3,"open",function(e){return function(...t){if(w)try{w.forEach(e=>e())}catch(e){}return e.apply(r3,t)}})),w.push(e),()=>{let t=w?w.indexOf(e):-1;t>-1&&w.splice(t,1)});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){var n;if(n=this._ignoreSelector,!sz.includes(t.tagName)||"INPUT"===t.tagName&&!["submit","button"].includes(t.getAttribute("type")||"")||"A"===t.tagName&&(t.hasAttribute("download")||t.hasAttribute("target")&&"_self"!==t.getAttribute("target"))||n&&t.matches(n)||!(e.data&&"number"==typeof e.data.nodeId&&e.timestamp))return;let r={timestamp:s$(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===r.node&&1>Math.abs(e.timestamp-r.timestamp))||(this._clicks.push(r),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=s$(e)}registerScroll(e=Date.now()){this._lastScroll=s$(e)}registerClick(e){let t=sF(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){let e=[],t=sW();for(let n of(this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)}),e)){let e=this._clicks.indexOf(n);e>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,{clickCount:i,clickBreadcrumb:s}=e;if(!n&&!r){let n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",o={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.slowClickDetected",data:{...s.data,url:r3.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:i||1}};this._addBreadcrumbEvent(t,o);return}if(i>1){let e={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.multiClick",data:{...s.data,url:r3.location.href,route:t.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=t$(()=>this._checkClicks(),1e3)}}let sz=["A","BUTTON","INPUT"];function sW(){return Date.now()/1e3}function sV(e){return{timestamp:Date.now()/1e3,type:"default",...e}}(O=C||(C={}))[O.Document=0]="Document",O[O.DocumentType=1]="DocumentType",O[O.Element=2]="Element",O[O.Text=3]="Text",O[O.CDATA=4]="CDATA",O[O.Comment=5]="Comment";let sG=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]),sQ=e=>t=>{if(!e.isEnabled())return;let n=function(e){let{target:t,message:n}=function(e){let t;let n="click"===e.name,r=null;try{r=n?sU(e.event):sq(e.event),t=(0,e9.Rt)(r,{maxStringLength:200})||"<unknown>"}catch(e){t="<unknown>"}return{target:r,message:t}}(e);return sV({category:`ui.${e.name}`,...sK(t,n)})}(t);if(!n)return;let r="click"===t.name,i=r?t.event:void 0;r&&e.clickDetector&&i&&i.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&function(e,t,n){e.handleClick(t,n)}(e.clickDetector,n,sU(t.event)),sj(e,n)};function sK(e,t){let n=sR.mirror.getId(e),r=n&&sR.mirror.getNode(n),i=r&&sR.mirror.getMeta(r),s=i&&i.type===C.Element?i:null;return{message:t,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(e=>e.type===C.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(""),attributes:function(e){let t={};for(let n in!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]),e)if(sG.has(n)){let r=n;("data-testid"===n||"data-test-id"===n)&&(r="testId"),t[r]=e[n]}return t}(s.attributes)}}:{}}}let sJ={resource:function(e){let{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:s,decodedBodySize:o,encodedBodySize:a,responseStatus:l,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:sY(s),end:sY(i),name:r,data:{size:u,statusCode:l,decodedBodySize:o,encodedBodySize:a}}},paint:function(e){let{duration:t,entryType:n,name:r,startTime:i}=e,s=sY(i);return{type:n,name:r,start:s,end:s+t,data:void 0}},navigation:function(e){let{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:s,encodedBodySize:o,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,domInteractive:u,loadEventStart:c,loadEventEnd:d,redirectCount:h,startTime:f,transferSize:p,type:m}=e;return 0===i?null:{type:`${t}.${m}`,start:sY(f),end:sY(s),name:n,data:{size:p,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,loadEventStart:c,loadEventEnd:d,domComplete:s,redirectCount:h}}}};function sX(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function sZ(e){let t=sJ[e.entryType];return t?t(e):null}function sY(e){return((eO.Z1||r3.performance.timeOrigin)+e)/1e3}function s0(e){let t=e.entries[e.entries.length-1];return s5(e,"largest-contentful-paint",t&&t.element?[t.element]:void 0)}function s1(e){let t=[],n=[];for(let r of e.entries)if(void 0!==r.sources){let e=[];for(let t of r.sources)if(t.node){n.push(t.node);let r=sR.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return s5(e,"cumulative-layout-shift",n,t)}function s2(e){let t=e.entries[e.entries.length-1];return s5(e,"first-input-delay",t&&t.target?[t.target]:void 0)}function s3(e){let t=e.entries[e.entries.length-1];return s5(e,"interaction-to-next-paint",t&&t.target?[t.target]:void 0)}function s5(e,t,n,r){let i=e.value,s=e.rating,o=sY(i);return{type:"web-vital",name:t,start:o,end:o,data:{value:i,size:i,rating:s,nodeIds:n?n.map(e=>sR.mirror.getId(e)):void 0,attributions:r}}}class s4 extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class s6{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){let t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>2e7)throw new s4;this.events.push(e)}finish(){return new Promise(e=>{let t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=this.events.map(e=>e.timestamp).sort()[0];return e?sD(e):null}}class s8{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise((e,t)=>{this._worker.addEventListener("message",({data:n})=>{n.success?e():t()},{once:!0}),this._worker.addEventListener("error",e=>{t(e)},{once:!0})})),this._ensureReadyPromise}destroy(){sA&&sN.info("Destroying compression worker"),this._worker.terminate()}postMessage(e,t){let n=this._getAndIncrementId();return new Promise((r,i)=>{let s=({data:t})=>{if(t.method===e&&t.id===n){if(this._worker.removeEventListener("message",s),!t.success){sA&&sN.error("Error in compression worker: ",t.response),i(Error("Error in compression worker"));return}r(t.response)}};this._worker.addEventListener("message",s),this._worker.postMessage({id:n,method:e,arg:t})})}_getAndIncrementId(){return this._id++}}class s7{constructor(e){this._worker=new s8(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){let t=sD(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);let n=JSON.stringify(e);return(this._totalSize+=n.length,this._totalSize>2e7)?Promise.reject(new s4):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{sA&&sN.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){let e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class s9{constructor(e){this._fallback=new s6,this._compression=new s7(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){sA&&sN.exception(e,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:t}=this._fallback,n=[];for(let t of e)n.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._used=this._compression;try{await Promise.all(n),this._fallback.clear()}catch(e){sA&&sN.exception(e,"Failed to add events when switching buffers.")}}}function oe(){try{return"sessionStorage"in r3&&!!r3.sessionStorage}catch(e){return!1}}function ot(e){return void 0!==e&&Math.random()<e}function on(e){let t=Date.now(),n=e.id||(0,N.DM)(),r=e.started||t,i=e.lastActivity||t;return{id:n,started:r,lastActivity:i,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId}}function or(e){if(oe())try{r3.sessionStorage.setItem(r5,JSON.stringify(e))}catch(e){}}function oi({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let i=on({sampled:ot(e)?"session":!!t&&"buffer",previousSessionId:r});return n&&or(i),i}function os(e,t,n=+new Date){return null===e||void 0===t||t<0||0!==t&&e+t<=n}function oo(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return os(e.started,t,r)||os(e.lastActivity,n,r)}function oa(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!!oo(e,{sessionIdleExpire:t,maxReplayDuration:n})&&("buffer"!==e.sampled||0!==e.segmentId)}function ol({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let i=r.stickySession&&function(){if(!oe())return null;try{let e=r3.sessionStorage.getItem(r5);if(!e)return null;let t=JSON.parse(e);return sA&&sN.infoTick("Loading existing session"),on(t)}catch(e){return null}}();return i?oa(i,{sessionIdleExpire:e,maxReplayDuration:t})?(sA&&sN.infoTick("Session in sessionStorage is expired, creating new one..."),oi(r,{previousSessionId:i.id})):i:(sA&&sN.infoTick("Creating new session"),oi(r,{previousSessionId:n}))}function ou(e,t,n){return!!od(e,t)&&(oc(e,t,n),!0)}async function oc(e,t,n){if(!e.eventBuffer)return null;try{n&&"buffer"===e.recordingMode&&e.eventBuffer.clear(),n&&(e.eventBuffer.hasCheckout=!0);let r=e.getOptions(),i=function(e,t){try{if("function"==typeof t&&e.type===i6.Custom)return t(e)}catch(e){return sA&&sN.exception(e,"An error occured in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}(t,r.beforeAddRecordingEvent);if(!i)return;return await e.eventBuffer.addEvent(i)}catch(r){let t=r&&r instanceof s4?"addEventSizeExceeded":"addEvent";e.handleException(r),await e.stop({reason:t});let n=(0,W.s3)();n&&n.recordDroppedEvent("internal_sdk_error","replay")}}function od(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=sD(t.timestamp);return!(n+e.timeouts.sessionIdlePause<Date.now())&&(!(n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration)||(sA&&sN.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1))}function oh(e){return"transaction"===e.type}function of(e){return"feedback"===e.type}function op(e){return!!e.category}function om(e,t){return t.map(({type:t,start:n,end:r,name:i,data:s})=>{let o=e.throttledAddEvent({type:i6.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:s}}});return"string"==typeof o?Promise.resolve(null):o})}function og(e,t){var n;e.isEnabled()&&null!==t&&(n=t.name,(!sA||!e.getOptions()._experiments.traceInternals)&&function(e,t){let n=t&&t.getDsn(),r=t&&t.getOptions().tunnel;return!!n&&e.includes(n.host)||!!r&&r0(e)===r0(r)}(n,(0,W.s3)())||e.addUpdate(()=>(om(e,[t]),!0)))}function ov(e){if(!e)return;let t=new TextEncoder;try{if("string"==typeof e)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=ok(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch(e){}}function oy(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function o_(e){try{if("string"==typeof e)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[ok(e)];if(!e)return[void 0]}catch(t){return sA&&sN.exception(t,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return sA&&sN.info("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function ob(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function ow(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:i,method:s,statusCode:o,request:a,response:l}=t;return{type:e,start:n/1e3,end:r/1e3,name:i,data:(0,z.Jr)({method:s,statusCode:o,request:a,response:l})}}function oS(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function oE(e,t,n){if(!t&&0===Object.keys(e).length)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:i,warnings:s}=function(e){if(!e||"string"!=typeof e)return{body:e};let t=e.length>15e4,n=function(e){let t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e);if(t){let t=e.slice(0,15e4);return n?{body:t,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${t}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch(e){}return{body:e}}(n);return r.body=i,s&&s.length>0&&(r._meta={warnings:s}),r}function ox(e,t){return Object.entries(e).reduce((n,[r,i])=>{let s=r.toLowerCase();return t.includes(s)&&e[r]&&(n[s]=i),n},{})}function ok(e){return new URLSearchParams(e).toString()}function oT(e,t){let n=function(e,t=r3.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(r3.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}(e);return(0,D.U0)(n,t)}async function oO(e,t,n){try{let r=await oI(e,t,n),i=ow("resource.fetch",r);og(n.replay,i)}catch(e){sA&&sN.exception(e,"Failed to capture fetch breadcrumb")}}async function oI(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r}=t,{url:o,method:a,status_code:l=0,request_body_size:u,response_body_size:c}=e.data,d=oT(o,n.networkDetailAllowUrls)&&!oT(o,n.networkDetailDenyUrls);return{startTimestamp:i,endTimestamp:s,url:o,method:a,statusCode:l,request:d?function({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let i=n?1===n.length&&"string"!=typeof n[0]?oM(n[0],t):2===n.length?oM(n[1],t):{}:{};if(!e)return oE(i,r,void 0);let[s,o]=o_(oA(n)),a=oE(i,r,s);return o?ob(a,o):a}(n,t.input,u):oS(u),response:await oC(d,n,t.response,c)}}async function oC(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,i){if(!e&&void 0!==i)return oS(i);let s=r?oP(r.headers,n):{};if(!r||!t&&void 0!==i)return oE(s,i,void 0);let[o,a]=await oR(r),l=function(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:i}){try{let s=e&&e.length&&void 0===n?ov(e):n;if(!r)return oS(s);if(t)return oE(i,s,e);return oE(i,s,void 0)}catch(e){return sA&&sN.exception(e,"Failed to serialize response body"),oE(i,n,void 0)}}(o,{networkCaptureBodies:t,responseBodySize:i,captureDetails:e,headers:s});return a?ob(l,a):l}async function oR(e){let t=function(e){try{return e.clone()}catch(e){sA&&sN.exception(e,"Failed to clone response body")}}(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await new Promise((e,n)=>{let r=t$(()=>n(Error("Timeout while trying to read response body")),500);oL(t).then(t=>e(t),e=>n(e)).finally(()=>clearTimeout(r))})]}catch(e){if(e instanceof Error&&e.message.indexOf("Timeout")>-1)return sA&&sN.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"];return sA&&sN.exception(e,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"]}}function oA(e=[]){if(2===e.length&&"object"==typeof e[1])return e[1].body}function oP(e,t){let n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function oM(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?oP(n,t):Array.isArray(n)?{}:ox(n,t):{}}async function oL(e){return await e.text()}async function oN(e,t,n){try{let r=function(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r,input:o,xhr:a}=t,{url:l,method:u,status_code:c=0,request_body_size:d,response_body_size:h}=e.data;if(!l)return null;if(!a||!oT(l,n.networkDetailAllowUrls)||oT(l,n.networkDetailDenyUrls)){let e=oS(d);return{startTimestamp:i,endTimestamp:s,url:l,method:u,statusCode:c,request:e,response:oS(h)}}let f=a[eZ],p=f?ox(f.request_headers,n.networkRequestHeaders):{},m=ox(function(e){let t=e.getAllResponseHeaders();return t?t.split("\r\n").reduce((e,t)=>{let[n,r]=t.split(": ");return r&&(e[n.toLowerCase()]=r),e},{}):{}}(a),n.networkResponseHeaders),[g,v]=n.networkCaptureBodies?o_(o):[void 0],[y,_]=n.networkCaptureBodies?function(e){let t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return function(e,t){try{if("string"==typeof e)return[e];if(e instanceof Document)return[e.body.outerHTML];if("json"===t&&e&&"object"==typeof e)return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return sA&&sN.exception(t,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return sA&&sN.info("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}(e.response,e.responseType)}catch(e){t.push(e)}return sA&&sN.warn("Failed to get xhr response body",...t),[void 0]}(a):[void 0],b=oE(p,d,g),w=oE(m,h,y);return{startTimestamp:i,endTimestamp:s,url:l,method:u,statusCode:c,request:v?ob(b,v):b,response:_?ob(w,_):w}}(e,t,n),i=ow("resource.xhr",r);og(n.replay,i)}catch(e){sA&&sN.exception(e,"Failed to capture xhr breadcrumb")}}async function oD(e){try{return Promise.all(om(e,[function(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}(r3.performance.memory)]))}catch(e){return[]}}async function o$({client:e,scope:t,replayId:n,event:r}){let i={event_id:n,integrations:"object"!=typeof e._integrations||null===e._integrations||Array.isArray(e._integrations)?void 0:Object.keys(e._integrations)};e.emit("preprocessEvent",r,i);let s=await (0,eP.R)(e.getOptions(),r,i,t,e,(0,W.aF)());if(!s)return null;s.platform=s.platform||"javascript";let o=e.getSdkMetadata(),{name:a,version:l}=o&&o.sdk||{};return s.sdk={...s.sdk,name:a||"sentry.javascript.unknown",version:l||"0.0.0"},s}async function oj({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:s}){var o;let a;let l=function({recordingData:e,headers:t}){let n;let r=`${JSON.stringify(t)}
`;if("string"==typeof e)n=`${r}${e}`;else{let t=new TextEncoder().encode(r);(n=new Uint8Array(t.length+e.length)).set(t),n.set(e,t.length)}return n}({recordingData:e,headers:{segment_id:n}}),{urls:u,errorIds:c,traceIds:d,initialTimestamp:h}=r,f=(0,W.s3)(),p=(0,W.nZ)(),m=f&&f.getTransport(),g=f&&f.getDsn();if(!f||!m||!g||!s.sampled)return(0,ey.WD)({});let v={type:"replay_event",replay_start_timestamp:h/1e3,timestamp:i/1e3,error_ids:c,trace_ids:d,urls:u,replay_id:t,segment_id:n,replay_type:s.sampled},y=await o$({scope:p,client:f,replayId:t,event:v});if(!y)return f.recordDroppedEvent("event_processor","replay",v),sA&&sN.info("An event processor returned `null`, will not send event."),(0,ey.WD)({});delete y.sdkProcessingMetadata;let _=(o=f.getOptions().tunnel,eb(ek(y,ex(y),o,g),[[{type:"replay_event"},y],[{type:"replay_recording",length:"string"==typeof l?new TextEncoder().encode(l).length:l.length},l]]));try{a=await m.send(_)}catch(t){let e=Error(r4);try{e.cause=t}catch(e){}throw e}if("number"==typeof a.statusCode&&(a.statusCode<200||a.statusCode>=300))throw new oF(a.statusCode);let b=tF({},a);if(tj(b,"replay"))throw new oU(b);return a}class oF extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class oU extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function oq(e,t={count:0,interval:5e3}){let{recordingData:n,onError:r}=e;if(n.length)try{return await oj(e),!0}catch(n){if(n instanceof oF||n instanceof oU)throw n;if((0,M.v)("Replays",{_retryCount:t.count}),r&&r(n),t.count>=3){let e=Error(`${r4} - max retries exceeded`);try{e.cause=n}catch(e){}throw e}return t.interval*=++t.count,new Promise((n,r)=>{t$(async()=>{try{await oq(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}let oB="__THROTTLED";class oH{constructor({options:e,recordingOptions:t}){oH.prototype.__init.call(this),oH.prototype.__init2.call(this),oH.prototype.__init3.call(this),oH.prototype.__init4.call(this),oH.prototype.__init5.call(this),oH.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=t,this._options=e,this._debouncedFlush=function(e,t,n){let r,i,s;let o=n&&n.maxWait?Math.max(n.maxWait,t):0;function a(){return l(),r=e()}function l(){void 0!==i&&clearTimeout(i),void 0!==s&&clearTimeout(s),i=s=void 0}function u(){return i&&clearTimeout(i),i=t$(a,t),o&&void 0===s&&(s=t$(a,o)),r}return u.cancel=l,u.flush=function(){return void 0!==i||void 0!==s?a():r},u}(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=function(e,t,n){let r=new Map,i=e=>{let t=e-5;r.forEach((e,n)=>{n<t&&r.delete(n)})},s=()=>[...r.values()].reduce((e,t)=>e+t,0),o=!1;return(...t)=>{let n=Math.floor(Date.now()/1e3);if(i(n),s()>=300){let e=o;return o=!0,e?"__SKIPPED":oB}o=!1;let a=r.get(n)||0;return r.set(n,a+1),e(...t)}}((e,t)=>od(this,e)?oc(this,e,t):Promise.resolve(null),0,0);let{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;if(i&&(this.clickDetector=new sH(this,i)),sA){let t=e._experiments;sN.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){sA&&sN.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;if(this._requiresManualStart=r,!r){if(this._initializeSessionForSampling(e),!this.session){sA&&sN.exception(Error("Unable to initialize and create session"));return}!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",sA&&sN.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&"session"===this.recordingMode){sA&&sN.info("Recording is already in progress");return}if(this._isEnabled&&"buffer"===this.recordingMode){sA&&sN.info("Buffering is in progress, call `flush()` to save the replay");return}sA&&sN.infoTick("Starting replay in session mode"),this._updateUserActivity();let e=ol({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled){sA&&sN.info("Buffering is in progress, call `flush()` to save the replay");return}sA&&sN.infoTick("Starting replay in buffer mode");let e=ol({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{var e;let t;let n=this._canvas;this._stopRecording=sR({...this._recordingOptions,..."buffer"===this.recordingMode?{checkoutEveryNms:6e4}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:(e=this,t=!1,(n,r)=>{if(!e.checkAndHandleExpiredSession()){sA&&sN.warn("Received replay event after session expired.");return}let i=r||!t;t=!0,e.clickDetector&&function(e,t){try{if(3!==t.type)return;let{source:n}=t.data;if(sB.has(n)&&e.registerMutation(t.timestamp),n===i8.Scroll&&e.registerScroll(t.timestamp),t.data.source===i8.MouseInteraction){let{type:n,id:r}=t.data,i=sR.mirror.getNode(r);i instanceof HTMLElement&&n===i7.Click&&e.registerClick(i)}}catch(e){}}(e.clickDetector,n),e.addUpdate(()=>{if("buffer"===e.recordingMode&&i&&e.setInitialState(),!ou(e,n,i))return!0;if(!i)return!1;let t=e.session;if(i&&e.session&&0===e.session.segmentId&&ou(e,function(e){let t=e.getOptions();return{type:i6.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:!!e.eventBuffer&&"worker"===e.eventBuffer.type,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}(e),!1),"buffer"===e.recordingMode&&t&&e.eventBuffer){let n=e.eventBuffer.getEarliestTimestamp();n&&(sA&&sN.info(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&or(t))}return!!t&&!!t.previousSessionId||("session"===e.recordingMode&&e.flush(),!0)})}),onMutation:this._onMutationHandler,...n?{recordCanvas:n.recordCanvas,getCanvasManager:n.getCanvasManager,sampling:n.sampling,dataURLOptions:n.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(this._isEnabled){this._isEnabled=!1;try{sA&&sN.info(`Stopping Replay${t?` triggered by ${t}`:""}`),function(){let e=(0,W.nZ)().getPropagationContext().dsc;e&&delete e.replay_id;let t=(0,eC.HN)();if(t){let e=(0,eI.jC)(t);delete e.replay_id}}(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,function(){if(oe())try{r3.sessionStorage.removeItem(r5)}catch(e){}}(),this.session=void 0}catch(e){this.handleException(e)}}}pause(){!this._isPaused&&(this._isPaused=!0,this.stopRecording(),sA&&sN.info("Pausing replay"))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),sA&&sN.info("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();let t=Date.now();sA&&sN.info("Converting buffer to session"),await this.flushImmediate();let n=this.stopRecording();e&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){let t=e();"buffer"!==this.recordingMode&&!0!==t&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&os(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${r3.location.pathname}${r3.location.hash}${r3.location.search}`,t=`${r3.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){let n=this._throttledAddEvent(e,t);if(n===oB){let e=sV({category:"replay.throttled"});this.addUpdate(()=>!ou(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}}))}return n}getCurrentRoute(){let e=this.lastActiveSpan||(0,eC.HN)(),t=e&&(0,eC.Gx)(e),n=(t&&(0,eC.XU)(t).data||{})[tG.Zj];if(t&&n&&["route","custom"].includes(n))return(0,eC.XU)(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=function({useCompression:e,workerUrl:t}){if(e&&window.Worker){let e=function(e){try{let t=e||("undefined"!=typeof __SENTRY_EXCLUDE_REPLAY_WORKER__&&__SENTRY_EXCLUDE_REPLAY_WORKER__?"":function(){let e=new Blob(['var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}},L=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},O=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},j=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},q=function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&j(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}},B=function(t){return 10+(t.filename?t.filename.length+1:0)},G=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(O(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();var H=function(){function t(t,n){this.c=L(),this.v=1,G.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),G.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=O(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=L();i.p(n.dictionary),j(t,2,i.d())}}(r,this.o),this.v=0),n&&j(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),J="undefined"!=typeof TextEncoder&&new TextEncoder,K="undefined"!=typeof TextDecoder&&new TextDecoder;try{K.decode(F,{stream:!0})}catch(t){}var N=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(P(t),this.d=n||!1)},t}();function P(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(J)return J.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}function Q(t){return function(t,n){n||(n={});var r=S(),e=t.length;r.p(t);var i=O(t,n,B(n),8),a=i.length;return q(i,n),j(i,a-8,r.d()),j(i,a-4,e),i}(P(t))}const R=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new H,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new N(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},V={clear:()=>{R.clear()},addEvent:t=>R.addEvent(t),finish:()=>R.finish(),compress:t=>Q(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in V&&"function"==typeof V[n])try{const t=V[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});']);return URL.createObjectURL(e)}());if(!t)return;sA&&sN.info(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new s9(n)}catch(e){sA&&sN.exception(e,"Failed to create compression worker")}}(t);if(e)return e}return sA&&sN.info("Using simple buffer"),new s6}({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(e){let t=this._options.errorSampleRate>0,n=ol({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;let e=this.session;return!oa(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{r3.document.addEventListener("visibilitychange",this._handleVisibilityChange),r3.addEventListener("blur",this._handleWindowBlur),r3.addEventListener("focus",this._handleWindowFocus),r3.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(function(e){let t=(0,W.s3)();eK(sQ(e)),ed(t=>{if(!e.isEnabled())return;let n=function(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}(t);null!==n&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(om(e,[n]),!1)))}),function(e){let t=(0,W.s3)();t&&t.on("beforeAddBreadcrumb",t=>(function(e,t){if(!e.isEnabled()||!op(t))return;let n=!op(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui.")?null:"console"===t.category?function(e){let t=e.data&&e.data.arguments;if(!Array.isArray(t)||0===t.length)return sV(e);let n=!1,r=t.map(e=>{if(!e)return e;if("string"==typeof e)return e.length>5e3?(n=!0,`${e.slice(0,5e3)}…`):e;if("object"==typeof e)try{let t=(0,e_.Fv)(e,7);if(JSON.stringify(t).length>5e3)return n=!0,`${JSON.stringify(t,null,2).slice(0,5e3)}…`;return t}catch(e){}return e});return sV({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(t):sV(t);n&&sj(e,n)})(e,t))}(e),function(e){let t=(0,W.s3)();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:s,networkResponseHeaders:o}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:s,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(e,t)=>(function(e,t,n){if(t.data)try{var r,i;"xhr"===t.category&&(r=n)&&r.xhr&&(function(e,t){let{xhr:n,input:r}=t;if(!n)return;let i=ov(r),s=n.getResponseHeader("content-length")?oy(n.getResponseHeader("content-length")):function(e,t){try{let n="json"===t&&e&&"object"==typeof e?JSON.stringify(e):e;return ov(n)}catch(e){return}}(n.response,n.responseType);void 0!==i&&(e.data.request_body_size=i),void 0!==s&&(e.data.response_body_size=s)}(t,n),oN(t,n,e)),"fetch"===t.category&&(i=n)&&i.response&&(function(e,t){let{input:n,response:r}=t,i=ov(n?oA(n):void 0),s=r?oy(r.headers.get("content-length")):void 0;void 0!==i&&(e.data.request_body_size=i),void 0!==s&&(e.data.response_body_size=s)}(t,n),oO(t,n,e))}catch(e){sA&&sN.exception(e,"Error when enriching network breadcrumb")}})(a,e,t))}catch(e){}}(e);let n=Object.assign((t,n)=>!e.isEnabled()||e.isPaused()?t:"replay_event"===t.type?(delete t.breadcrumbs,t):(!t.type||oh(t)||of(t))&&e.checkAndHandleExpiredSession()?of(t)?(e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:i6.Custom,timestamp:1e3*t.timestamp,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1)),t):!t.type&&t.exception&&t.exception.values&&t.exception.values.length&&n.originalException&&n.originalException.__rrweb__&&!e.getOptions()._experiments.captureExceptions?(sA&&sN.log("Ignoring error from rrweb internals",t),null):(("buffer"===e.recordingMode&&t.message!==r4&&t.exception&&!t.type&&ot(e.getOptions().errorSampleRate)||"session"===e.recordingMode)&&(t.tags={...t.tags,replayId:e.getSessionId()}),t):t,{id:"Replay"});(0,M.Qy)(n),t&&(t.on("beforeSendEvent",t=>{e.isEnabled()&&!t.type&&function(e,t){let n=t.exception&&t.exception.values&&t.exception.values[0]&&t.exception.values[0].value;"string"==typeof n&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))&&sj(e,sV({category:"replay.hydrate-error",data:{url:(0,e9.l4)()}}))}(e,t)}),t.on("afterSendEvent",(t,n)=>{if(!e.isEnabled()||t.type&&!oh(t))return;let r=n&&n.statusCode;if(r&&!(r<200)&&!(r>=300)){if(oh(t)){(function(e,t){let n=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)})(e,t);return}(function(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),"buffer"!==e.recordingMode||!t.tags||!t.tags.replayId)return;let{beforeErrorSampling:r}=e.getOptions();("function"!=typeof r||r(t))&&t$(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}})})(e,t)}}),t.on("createDsc",t=>{let n=e.getSessionId();n&&e.isEnabled()&&"session"===e.recordingMode&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),t.on("spanStart",t=>{e.lastActiveSpan=t}),t.on("spanEnd",t=>{e.lastActiveSpan=t}),t.on("beforeSendFeedback",(t,n)=>{let r=e.getSessionId();n&&n.includeReplay&&e.isEnabled()&&r&&t.contexts&&t.contexts.feedback&&(t.contexts.feedback.replay_id=r)}))}(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=function(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}let r=[];return["navigation","paint","resource"].forEach(e=>{r.push(nG(e,n))}),r.push(nz(sX(s0,e)),nH(sX(s1,e)),nW(sX(s2,e)),nV(sX(s3,e))),()=>{r.forEach(e=>e())}}(this)}_removeListeners(){try{r3.document.removeEventListener("visibilitychange",this._handleVisibilityChange),r3.removeEventListener("blur",this._handleWindowBlur),r3.removeEventListener("focus",this._handleWindowFocus),r3.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}__init(){this._handleVisibilityChange=()=>{"visible"===r3.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{let e=sV({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{let e=sV({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{!function(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=function(e){var t;let{metaKey:n,shiftKey:r,ctrlKey:i,altKey:s,key:o,target:a}=e;if(!a||"INPUT"===(t=a).tagName||"TEXTAREA"===t.tagName||t.isContentEditable||!o)return null;let l=n||i||s,u=1===o.length;if(!l&&u)return null;let c=(0,e9.Rt)(a,{maxStringLength:200})||"<unknown>",d=sK(a,c);return sV({category:"ui.keyDown",message:c,data:{...d.data,metaKey:n,shiftKey:r,ctrlKey:i,altKey:s,key:o}})}(t);n&&sj(e,n)}(this,e)}}_doChangeToBackgroundTasks(e){!this.session||oo(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){sA&&sN.info("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:i6.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=this.performanceEntries.map(sZ).filter(Boolean).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let t=this._context.initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(om(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart||e.segmentId)return;let n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){sA&&sN.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),this.eventBuffer&&this.eventBuffer.hasEvents&&(await oD(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw Error("Session is too long, not sending replay");let n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await oq({replayId:e,recordingData:i,segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(t){this.handleException(t),this.stop({reason:"sendReplay"});let e=(0,W.s3)();e&&e.recordDroppedEvent(t instanceof oU?"ratelimit_backoff":"send_error","replay")}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){sA&&sN.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;let t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();let r=n<this._options.minReplayDuration,i=n>this._options.maxReplayDuration+5e3;if(r||i){sA&&sN.info(`Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`),r&&this._debouncedFlush();return}let s=this.eventBuffer;s&&0===this.session.segmentId&&!s.hasCheckout&&sA&&sN.info("Flushing initial segment without checkout.");let o=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,o&&this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&or(this.session)}__init6(){this._onMutationHandler=e=>{let t=e.length,n=this._options.mutationLimit,r=this._options.mutationBreadcrumbLimit,i=n&&t>n;if(t>r||i){let e=sV({category:"replay.mutations",data:{count:t,limit:i}});this._createCustomBreadcrumb(e)}return!i||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}}function oz(e,t){return[...e,...t].join(",")}let oW='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',oV=["content-length","content-type","accept"],oG=!1;class oQ{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=5e3,flushMaxDelay:t=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:i=!0,useCompression:s=!0,workerUrl:o,_experiments:a={},maskAllText:l=!0,maskAllInputs:u=!0,blockAllMedia:c=!0,mutationBreadcrumbLimit:d=750,mutationLimit:h=1e4,slowClickTimeout:f=7e3,slowClickIgnoreSelectors:p=[],networkDetailAllowUrls:m=[],networkDetailDenyUrls:g=[],networkCaptureBodies:v=!0,networkRequestHeaders:y=[],networkResponseHeaders:_=[],mask:b=[],maskAttributes:w=["title","placeholder"],unmask:S=[],block:E=[],unblock:x=[],ignore:k=[],maskFn:T,beforeAddRecordingEvent:O,beforeErrorSampling:I}={}){this.name=oQ.id;let C=function({mask:e,unmask:t,block:n,unblock:r,ignore:i}){return{maskTextSelector:oz(e,[".sentry-mask","[data-sentry-mask]"]),unmaskTextSelector:oz(t,[]),blockSelector:oz(n,[".sentry-block","[data-sentry-block]",'base[href="/"]']),unblockSelector:oz(r,[]),ignoreSelector:oz(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}({mask:b,unmask:S,block:E,unblock:x,ignore:k});if(this._recordingOptions={maskAllInputs:u,maskAllText:l,maskInputOptions:{password:!0},maskTextFn:T,maskInputFn:T,maskAttributeFn:(e,t,n)=>(function({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:i,value:s}){return!r||i.unmaskTextSelector&&e.matches(i.unmaskTextSelector)?s:n.includes(t)||"value"===t&&"INPUT"===e.tagName&&["submit","button"].includes(e.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s})({maskAttributes:w,maskAllText:l,privacyOptions:C,key:e,value:t,el:n}),...C,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch(e){}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,36e5),stickySession:i,useCompression:s,workerUrl:o,blockAllMedia:c,maskAllInputs:u,maskAllText:l,mutationBreadcrumbLimit:d,mutationLimit:h,slowClickTimeout:f,slowClickIgnoreSelectors:p,networkDetailAllowUrls:m,networkDetailDenyUrls:g,networkCaptureBodies:v,networkRequestHeaders:oK(y),networkResponseHeaders:oK(_),beforeAddRecordingEvent:O,beforeErrorSampling:I,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${oW}`:oW),this._isInitialized&&r2())throw Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return oG}set _isInitialized(e){oG=e}afterAllSetup(e){r2()&&!this._replay&&(this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(){if(this._replay&&this._replay.isEnabled())return this._replay.getSessionId()}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let t=function(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...(0,z.Jr)(e)},i=eA(n.replaysSessionSampleRate),s=eA(n.replaysOnErrorSampleRate);return null==i&&null==s&&(0,L.Cf)(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),null!=i&&(r.sessionSampleRate=i),null!=s&&(r.errorSampleRate=s),r}(this._initialOptions,e);this._replay=new oH({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let t=e.getIntegrationByName("ReplayCanvas");if(!t)return;this._replay._canvas=t.getOptions()}catch(e){}}}function oK(e){return[...oV,...e.map(e=>e.toLowerCase())]}oQ.__initStatic();var oJ=n(74942),oX=n(14224);globalThis.__sentryRewritesTunnelPath__=void 0,globalThis.SENTRY_RELEASE={id:"4cbc739be4f0daaaa23b02c74b8b01057d55e749"},globalThis.__sentryBasePath=void 0,globalThis.__rewriteFramesAssetPrefixPath__="",function(e){let t={environment:function(e){let t=e?"production":tz.env.VERCEL_ENV;return t?`vercel-${t}`:void 0}(!0)||"production",defaultIntegrations:function(e){let t=tB(e);("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&t.push(rA());let n=rj.__rewriteFramesAssetPrefixPath__||"";return t.push(rD({assetPrefixPath:n})),t}(e),...e};(function(e){let t=r$.__sentryRewritesTunnelPath__;if(t&&e.dsn){let n=em(e.dsn);if(!n)return;let r=n.host.match(/^o(\d+)\.ingest(?:\.([a-z]{2}))?\.sentry\.io$/);if(r){let i=r[1],s=r[2],o=`${t}?o=${i}&p=${n.projectId}`;s&&(o+=`&r=${s}`),e.tunnel=o,rC.X&&L.kg.info(`Tunneling events to "${o}"`)}else rC.X&&L.kg.warn("Provided DSN is not a Sentry SaaS DSN. Will not tunnel events.")}})(t),P(t,"nextjs",["nextjs","react"]),function(e){let t={...e};P(t,"react"),(0,M.v)("react",{version:tH.version}),function(e={}){let t=function(e={}){let t={defaultIntegrations:tB(),release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:eW.SENTRY_RELEASE&&eW.SENTRY_RELEASE.id?eW.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return null==e.defaultIntegrations&&delete e.defaultIntegrations,{...t,...e}}(e);if(function(){let e=void 0!==eW.window&&eW;if(!e)return!1;let t=e.chrome?"chrome":"browser",n=e[t],r=n&&n.runtime&&n.runtime.id,i=eW.location&&eW.location.href||"",s=!!r&&eW===eW.top&&["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"].some(e=>i.startsWith(`${e}//`)),o=void 0!==e.nw;return!!r&&!s&&!o}()){(0,L.Cf)(()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")});return}e$&&!en()&&L.kg.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill."),function(e,t){!0===t.debug&&($.X?L.kg.enable():(0,L.Cf)(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),(0,W.nZ)().update(t.initialScope);let n=new e(t);(0,W.nZ)().setClient(n),n.init()}(eQ,{...t,stackParser:(0,Q.Sq)(t.stackParser||tP),integrations:function(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r=function(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(Array.isArray(n)?[...t,...n]:"function"==typeof n?(0,N.lE)(n(t)):t),i=r.findIndex(e=>"Debug"===e.name);if(i>-1){let[e]=r.splice(i,1);r.push(e)}return r}(t),transport:t.transport||tq}),t.autoSessionTracking&&function(){if(void 0===eW.document){e$&&L.kg.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}(0,M.yj)({ignoreDuration:!0}),(0,M.cg)(),ed(({from:e,to:t})=>{void 0!==e&&e!==t&&((0,M.yj)({ignoreDuration:!0}),(0,M.cg)())})}()}(t)}(t);let n=e=>"transaction"===e.type&&"/404"===e.transaction?null:e;n.id="NextClient404Filter",(0,M.Qy)(n);let r=e=>"transaction"===e.type&&e.transaction===rk?null:e;r.id="IncompleteTransactionFilter",(0,M.Qy)(r)}({dsn:"https://b422fa51007cd51ae40f052a254130e3@o4505147662270464.ingest.sentry.io/4506348417777664",tracesSampleRate:1,enabled:!0,debug:!1,replaysOnErrorSampleRate:1,replaysSessionSampleRate:0,integrations:[rA(),{name:"BrowserProfiling",setup(e){let t=(0,eC.HN)(),n=t&&(0,eC.Gx)(t);n&&rQ(n)&&rX(n)&&rY(n),e.on("spanStart",e=>{e===(0,eC.Gx)(e)&&rX(e)&&rY(e)}),e.on("beforeEnvelope",e=>{if(!rZ.size)return;let t=function(e){let t=[];return ew(e,(e,n)=>{if("transaction"===n)for(let n=1;n<e.length;n++){let r=e[n];r&&r.contexts&&r.contexts.profile&&r.contexts.profile.profile_id&&t.push(e[n])}}),t}(e);if(!t.length)return;let n=[];for(let e of t){var r,i,s,o;let t=e&&e.contexts,a=t&&t.profile&&t.profile.profile_id,l=t&&t.profile&&t.profile.start_timestamp;if("string"!=typeof a||!a){e$&&L.kg.log("[Profiling] cannot find profile for a span without a profile context");continue}t&&t.profile&&delete t.profile;let u=function(e){let t=rZ.get(e);return t&&rZ.delete(e),t}(a);if(!u){e$&&L.kg.log(`[Profiling] Could not retrieve profile for span: ${a}`);continue}let c=(r=a,i=l,s=u,o=e,(s.samples.length<2?(e$&&L.kg.log("[Profiling] Discarding profile because it contains less than 2 samples"),1):!s.frames.length&&(e$&&L.kg.log("[Profiling] Discarding profile because it contains no frames"),1))?null:function(e,t,n,r){if("transaction"!==r.type)throw TypeError("Profiling events may only be attached to transactions, this should never occur.");if(null==n)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let i=function(e){let t=e&&e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id;return("string"==typeof t&&32!==t.length&&e$&&L.kg.log(`[Profiling] Invalid traceId: ${t} on profiled event`),"string"!=typeof t)?"":t}(r),s="thread_metadata"in n?n:function(e){let t;let n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[rU]:{name:"main"}}},i=e.samples[0];if(!i)return r;let s=i.timestamp,o="number"==typeof performance.timeOrigin?performance.timeOrigin:eO.Z1||0,a=o-(eO.Z1||o);return e.samples.forEach((i,o)=>{if(void 0===i.stackId){void 0===t&&(t=n,r.stacks[t]=[],n++),r.samples[o]={elapsed_since_start_ns:((i.timestamp+a-s)*1e6).toFixed(0),stack_id:t,thread_id:rU};return}let l=e.stacks[i.stackId],u=[];for(;l;){u.push(l.frameId);let t=e.frames[l.frameId];t&&void 0===r.frames[l.frameId]&&(r.frames[l.frameId]={function:t.name,abs_path:"number"==typeof t.resourceId?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),l=void 0===l.parentId?void 0:e.stacks[l.parentId]}let c={elapsed_since_start_ns:((i.timestamp+a-s)*1e6).toFixed(0),stack_id:n,thread_id:rU};r.stacks[n]=u,r.samples[o]=c,n++}),r}(n),o=t||("number"==typeof r.start_timestamp?1e3*r.start_timestamp:1e3*(0,eO.ph)()),a="number"==typeof r.timestamp?1e3*r.timestamp:1e3*(0,eO.ph)();return{event_id:e,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||rF.J,runtime:{name:"javascript",version:eW.navigator.userAgent},os:{name:rq,version:rB,build_number:rz},device:{locale:rV,model:rW,manufacturer:rz,architecture:rH,is_emulator:!1},debug_meta:{images:function(e){let t;let n=ee.GLOBAL_OBJ._sentryDebugIds;if(!n)return[];let r=(0,W.s3)(),i=r&&r.getOptions(),s=i&&i.stackParser;if(!s)return[];let o=rK.get(s);o?t=o:(t=new Map,rK.set(s,t));let a=Object.keys(n).reduce((e,r)=>{let i;let o=t.get(r);o?i=o:(i=s(r),t.set(r,i));for(let t=i.length-1;t>=0;t--){let s=i[t],o=s&&s.filename;if(s&&o){e[o]=n[r];break}}return e},{}),l=[];for(let t of e)t&&a[t]&&l.push({type:"sourcemap",code_file:t,debug_id:a[t]});return l}(n.resources)},profile:s,transactions:[{name:r.transaction||"",id:r.event_id||(0,N.DM)(),trace_id:i,active_thread_id:rU,relative_start_ns:"0",relative_end_ns:((a-o)*1e6).toFixed(0)}]}}(r,i,s,o));c&&n.push(c)}!function(e,t){if(t.length)for(let n of t)e[1].push([{type:"profile"},n])}(e,n)})}},new oQ({maskAllText:!1,blockAllMedia:!0}),oJ.ZP.sentryIntegration({organization:oX.env.SENTRY_ORG,projectId:+(null!==(R=oX.env.SENTRY_PROJECT_ID)&&void 0!==R?R:"0"),severityAllowList:["error","warning","info"]})]})},30489:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return l.ReadonlyURLSearchParams},RedirectType:function(){return l.RedirectType},ServerInsertedHTMLContext:function(){return u.ServerInsertedHTMLContext},notFound:function(){return l.notFound},permanentRedirect:function(){return l.permanentRedirect},redirect:function(){return l.redirect},useParams:function(){return f},usePathname:function(){return d},useRouter:function(){return h},useSearchParams:function(){return c},useSelectedLayoutSegment:function(){return m},useSelectedLayoutSegments:function(){return p},useServerInsertedHTML:function(){return u.useServerInsertedHTML}});let r=n(75271),i=n(16548),s=n(88699),o=n(32335),a=n(97361),l=n(49633),u=n(30695);function c(){let e=(0,r.useContext)(s.SearchParamsContext);return(0,r.useMemo)(()=>e?new l.ReadonlyURLSearchParams(e):null,[e])}function d(){return(0,r.useContext)(s.PathnameContext)}function h(){let e=(0,r.useContext)(i.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function f(){return(0,r.useContext)(s.PathParamsContext)}function p(e){void 0===e&&(e="children");let t=(0,r.useContext)(i.LayoutRouterContext);return t?function e(t,n,r,i){let s;if(void 0===r&&(r=!0),void 0===i&&(i=[]),r)s=t[1][n];else{var l;let e=t[1];s=null!=(l=e.children)?l:Object.values(e)[0]}if(!s)return i;let u=s[0],c=(0,o.getSegmentValue)(u);return!c||c.startsWith(a.PAGE_SEGMENT_KEY)?i:(i.push(c),e(s,n,!1,i))}(t.tree,e):null}function m(e){void 0===e&&(e="children");let t=p(e);if(!t||0===t.length)return null;let n="children"===e?t[0]:t[t.length-1];return n===a.DEFAULT_SEGMENT_KEY?null:n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},49633:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return o},RedirectType:function(){return r.RedirectType},notFound:function(){return i.notFound},permanentRedirect:function(){return r.permanentRedirect},redirect:function(){return r.redirect}});let r=n(20456),i=n(81088);class s extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class o extends URLSearchParams{append(){throw new s}delete(){throw new s}set(){throw new s}sort(){throw new s}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81088:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{isNotFoundError:function(){return i},notFound:function(){return r}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function i(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},42417:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return n}}),(r=n||(n={}))[r.SeeOther=303]="SeeOther",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20456:function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return u},getRedirectStatusCodeFromError:function(){return m},getRedirectTypeFromError:function(){return p},getURLFromRedirectError:function(){return f},isRedirectError:function(){return h},permanentRedirect:function(){return d},redirect:function(){return c}});let s=n(54089),o=n(29753),a=n(42417),l="NEXT_REDIRECT";function u(e,t,n){void 0===n&&(n=a.RedirectStatusCode.TemporaryRedirect);let r=Error(l);r.digest=l+";"+t+";"+e+";"+n+";";let i=s.requestAsyncStorage.getStore();return i&&(r.mutableCookies=i.mutableCookies),r}function c(e,t){void 0===t&&(t="replace");let n=o.actionAsyncStorage.getStore();throw u(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.TemporaryRedirect)}function d(e,t){void 0===t&&(t="replace");let n=o.actionAsyncStorage.getStore();throw u(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.PermanentRedirect)}function h(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,n,r,i]=e.digest.split(";",4),s=Number(i);return t===l&&("replace"===n||"push"===n)&&"string"==typeof r&&!isNaN(s)&&s in a.RedirectStatusCode}function f(e){return h(e)?e.digest.split(";",3)[2]:null}function p(e){if(!h(e))throw Error("Not a redirect error");return e.digest.split(";",2)[1]}function m(e){if(!h(e))throw Error("Not a redirect error");return Number(e.digest.split(";",4)[3])}(i=r||(r={})).push="push",i.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},32335:function(e,t){"use strict";function n(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},32699:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useReportWebVitals",{enumerable:!0,get:function(){return s}});let r=n(75271),i=n(12107);function s(e){(0,r.useEffect)(()=>{(0,i.onCLS)(e),(0,i.onFID)(e),(0,i.onLCP)(e),(0,i.onINP)(e),(0,i.onFCP)(e),(0,i.onTTFB)(e)},[e])}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},83064:function(e,t){"use strict";function n(e,t){let n;if((null==t?void 0:t.host)&&!Array.isArray(t.host))n=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;n=e.hostname}return n.toLowerCase()}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getHostname",{enumerable:!0,get:function(){return n}})},68831:function(e,t){"use strict";function n(e,t,n){if(e)for(let s of(n&&(n=n.toLowerCase()),e)){var r,i;if(t===(null==(r=s.domain)?void 0:r.split(":",1)[0].toLowerCase())||n===s.defaultLocale.toLowerCase()||(null==(i=s.locales)?void 0:i.some(e=>e.toLowerCase()===n)))return s}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return n}})},30695:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return i},useServerInsertedHTML:function(){return s}});let r=n(11778)._(n(75271)),i=r.default.createContext(null);function s(e){let t=(0,r.useContext)(i);t&&t(e)}},40913:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eI}});var r=n(52676),i=n(157),s=n.n(i),o=n(17134),a=n(75271),l=n(12033);function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,u(e,t)}var d=n(30967),h={disabled:!1},f=a.createContext(null),p="unmounted",m="exited",g="entering",v="entered",y="exiting",_=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,i,s=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?s?(i=m,r.appearStatus=g):i=v:i=t.unmountOnExit||t.mountOnEnter?p:m,r.state={status:i},r.nextCallback=null,r}c(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===p?{status:m}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==g&&n!==v&&(t=g):(n===g||n===v)&&(t=y)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){if(this.cancelNextCallback(),t===g){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:d.findDOMNode(this);n&&n.scrollTop}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===m&&this.setState({status:p})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[d.findDOMNode(this),r],s=i[0],o=i[1],a=this.getTimeouts(),l=r?a.appear:a.enter;if(!e&&!n||h.disabled){this.safeSetState({status:v},function(){t.props.onEntered(s)});return}this.props.onEnter(s,o),this.safeSetState({status:g},function(){t.props.onEntering(s,o),t.onTransitionEnd(l,function(){t.safeSetState({status:v},function(){t.props.onEntered(s,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:d.findDOMNode(this);if(!t||h.disabled){this.safeSetState({status:m},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:y},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:m},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:d.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],s=i[0],o=i[1];this.props.addEndListener(s,o)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===p)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,l.Z)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a.createElement(f.Provider,{value:null},"function"==typeof n?n(e,r):a.cloneElement(a.Children.only(n),r))},t}(a.Component);function b(){}_.contextType=f,_.propTypes={},_.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:b,onEntering:b,onEntered:b,onExit:b,onExiting:b,onExited:b},_.UNMOUNTED=p,_.EXITED=m,_.ENTERING=g,_.ENTERED=v,_.EXITING=y;var w=n(79482);function S(e,t){var n=Object.create(null);return e&&a.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=t&&(0,a.isValidElement)(e)?t(e):e}),n}function E(e,t,n){return null!=n[t]?n[t]:e.props[t]}var x=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},k=function(e){function t(t,n){var r,i=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}c(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,i=t.children,s=t.handleExited;return{children:t.firstRender?S(e.children,function(t){return(0,a.cloneElement)(t,{onExited:s.bind(null,t),in:!0,appear:E(t,"appear",e),enter:E(t,"enter",e),exit:E(t,"exit",e)})}):(Object.keys(r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),s=[];for(var o in e)o in t?s.length&&(i[o]=s,s=[]):s.push(o);var a={};for(var l in t){if(i[l])for(r=0;r<i[l].length;r++){var u=i[l][r];a[i[l][r]]=n(u)}a[l]=n(l)}for(r=0;r<s.length;r++)a[s[r]]=n(s[r]);return a}(i,n=S(e.children))).forEach(function(t){var o=r[t];if((0,a.isValidElement)(o)){var l=t in i,u=t in n,c=i[t],d=(0,a.isValidElement)(c)&&!c.props.in;u&&(!l||d)?r[t]=(0,a.cloneElement)(o,{onExited:s.bind(null,o),in:!0,exit:E(o,"exit",e),enter:E(o,"enter",e)}):u||!l||d?u&&l&&(0,a.isValidElement)(c)&&(r[t]=(0,a.cloneElement)(o,{onExited:s.bind(null,o),in:c.props.in,exit:E(o,"exit",e),enter:E(o,"enter",e)})):r[t]=(0,a.cloneElement)(o,{in:!1})}}),r),firstRender:!1}},n.handleExited=function(e,t){var n=S(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=(0,w.Z)({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=(0,l.Z)(e,["component","childFactory"]),i=this.state.contextValue,s=x(this.state.children).map(n);return(delete r.appear,delete r.enter,delete r.exit,null===t)?a.createElement(f.Provider,{value:i},s):a.createElement(f.Provider,{value:i},a.createElement(t,r,s))},t}(a.Component);k.propTypes={},k.defaultProps={component:"div",childFactory:function(e){return e}};var T=n(33059),O=n(305),I=n(26414),C=n(1271),R=n(80258),A=n(54136),P=n(39367),M=n(63418),L=n(76140);let N=e=>(e+1)%1e6;var D=n(78399),$=n(52635);let j=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"],F={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},U={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};var q=n(95105),B=n(67387),H=n(22888),z=n(32498),W={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};let V={withCloseButton:!0},G=(0,O.Z)((e,{radius:t,color:n})=>({root:{"--notification-radius":void 0===t?void 0:(0,q.H5)(t),"--notification-color":n?(0,B.p)(n,e):void 0}})),Q=(0,C.d5)((e,t)=>{let n=(0,R.w)("Notification",V,e),{className:i,color:s,radius:o,loading:a,withCloseButton:l,withBorder:u,title:c,icon:d,children:h,onClose:f,closeButtonProps:p,classNames:m,style:g,styles:v,unstyled:y,variant:_,vars:b,mod:w,...S}=n,E=(0,P.y)({name:"Notification",classes:W,props:n,className:i,style:g,classNames:m,styles:v,unstyled:y,vars:b,varsResolver:G});return(0,r.jsxs)(L.x,{...E("root"),mod:[{"data-with-icon":!!d||a,"data-with-border":u},w],ref:t,variant:_,...S,role:"alert",children:[d&&!a&&(0,r.jsx)("div",{...E("icon"),children:d}),a&&(0,r.jsx)(z.a,{size:28,color:s,...E("loader")}),(0,r.jsxs)("div",{...E("body"),children:[c&&(0,r.jsx)("div",{...E("title"),children:c}),(0,r.jsx)(L.x,{...E("description"),mod:{"data-with-title":!!c},children:h})]}),l&&(0,r.jsx)(H.P,{iconSize:16,color:"gray",...p,unstyled:y,onClick:f,...E("closeButton")})]})});Q.classes=W,Q.displayName="@mantine/core/Notification";let K=(0,a.forwardRef)(({data:e,onHide:t,autoClose:n,...i},s)=>{var o;let{autoClose:l,message:u,...c}=e,d="number"==typeof(o=e.autoClose)?o:!1!==o&&!1!==n&&n,h=(0,a.useRef)(),f=()=>window.clearTimeout(h.current),p=()=>{t(e.id),f()},m=()=>{"number"==typeof d&&(h.current=window.setTimeout(p,d))};return(0,a.useEffect)(()=>{e.onOpen?.(e)},[]),(0,a.useEffect)(()=>(m(),f),[d]),(0,r.jsx)(Q,{...i,...c,onClose:p,ref:s,onMouseEnter:f,onMouseLeave:m,children:u})});K.displayName="@mantine/notifications/NotificationContainer";var J=n(16023),X={root:"m_b37d9ac7",notification:"m_5ed0edd0"};let Z={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:(0,T.w)("overlay"),store:J.Ps,withinPortal:!0},Y=(0,O.Z)((e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":(0,I.h)(n)}})),ee=(0,C.d5)((e,t)=>{let n=(0,R.w)("Notifications",Z,e),{classNames:i,className:s,style:o,styles:l,unstyled:u,vars:c,position:d,autoClose:h,transitionDuration:f,containerWidth:p,notificationMaxHeight:m,limit:g,zIndex:v,store:y,portalProps:b,withinPortal:w,...S}=n,E=(0,A.rZ)(),x=(0,J.zn)(y),T=function(){let[,e]=(0,a.useReducer)(N,0);return e}(),O=(0,D.J)(),I=(0,a.useRef)({}),C=(0,a.useRef)(0),q=E.respectReducedMotion&&O?1:f,B=(0,P.y)({name:"Notifications",classes:X,props:n,className:s,style:o,classNames:i,styles:l,unstyled:u,vars:c,varsResolver:Y});(0,a.useEffect)(()=>{y?.updateState(e=>({...e,limit:g||5,defaultPosition:d}))},[g,d]),(0,$.l)(()=>{x.notifications.length>C.current&&setTimeout(()=>T(),0),C.current=x.notifications.length},[x.notifications]);let H=x.notifications.reduce((e,t)=>(e[t.position||d].push(t),e),j.reduce((e,t)=>(e[t]=[],e),{})),z=j.reduce((e,t)=>(e[t]=H[t].map(({style:e,...n})=>(0,r.jsx)(_,{timeout:q,onEnter:()=>I.current[n.id].offsetHeight,nodeRef:{current:I.current[n.id]},children:i=>(0,r.jsx)(K,{ref:e=>{I.current[n.id]=e},data:n,onHide:e=>(0,J.yK)(e,y),autoClose:h,...B("notification",{style:{...function({state:e,maxHeight:t,position:n,transitionDuration:r}){let[i,s]=n.split("-"),o="center"===s?`${i}-center`:s,a={opacity:0,maxHeight:t,transform:F[o],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},l={opacity:1,transform:U[o]},u={opacity:0,maxHeight:0,transform:F[o]};return{...a,...{entering:l,entered:l,exiting:u,exited:u}[e]}}({state:i,position:t,transitionDuration:q,maxHeight:m}),...e}})})},n.id)),e),{});return(0,r.jsxs)(M.q,{withinPortal:w,...b,children:[(0,r.jsx)(L.x,{...B("root"),"data-position":"top-center",ref:t,...S,children:(0,r.jsx)(k,{children:z["top-center"]})}),(0,r.jsx)(L.x,{...B("root"),"data-position":"top-left",...S,children:(0,r.jsx)(k,{children:z["top-left"]})}),(0,r.jsx)(L.x,{...B("root"),"data-position":"top-right",...S,children:(0,r.jsx)(k,{children:z["top-right"]})}),(0,r.jsx)(L.x,{...B("root"),"data-position":"bottom-right",...S,children:(0,r.jsx)(k,{children:z["bottom-right"]})}),(0,r.jsx)(L.x,{...B("root"),"data-position":"bottom-left",...S,children:(0,r.jsx)(k,{children:z["bottom-left"]})}),(0,r.jsx)(L.x,{...B("root"),"data-position":"bottom-center",...S,children:(0,r.jsx)(k,{children:z["bottom-center"]})})]})});ee.classes=X,ee.displayName="@mantine/notifications/Notifications",ee.show=J.N9.show,ee.hide=J.N9.hide,ee.update=J.N9.update,ee.clean=J.N9.clean,ee.cleanQueue=J.N9.cleanQueue,ee.updateState=J.N9.updateState;var et=n(96970),en=()=>{window.si||(window.si=function(...e){(window.siq=window.siq||[]).push(e)})};function er(){return false}function ei(e){return RegExp(`/${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=[/?#]|$)`)}var es="https://va.vercel-scripts.com/v1/speed-insights",eo=`${es}/script.js`,ea=`${es}/script.debug.js`;function el(e){let t=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(t.current)e.route&&t.current(e.route);else{let n=function(e={}){var t;if(!("undefined"!=typeof window)||null===e.route)return null;en();let n=!!e.dsn,r=e.scriptSrc||(n?eo:"/_vercel/speed-insights/script.js");if(document.head.querySelector(`script[src*="${r}"]`))return null;e.beforeSend&&(null==(t=window.si)||t.call(window,"beforeSend",e.beforeSend));let i=document.createElement("script");return i.src=r,i.defer=!0,i.dataset.sdkn="@vercel/speed-insights"+(e.framework?`/${e.framework}`:""),i.dataset.sdkv="1.0.13",e.sampleRate&&(i.dataset.sampleRate=e.sampleRate.toString()),e.route&&(i.dataset.route=e.route),e.endpoint&&(i.dataset.endpoint=e.endpoint),e.dsn&&(i.dataset.dsn=e.dsn),i.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${r}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(i),{setRoute:e=>{i.dataset.route=e??void 0}}}({framework:e.framework||"react",...e});n&&(t.current=n.setRoute)}},[e.route]),null}var eu=()=>{let e=(0,et.useParams)(),t=(0,et.useSearchParams)()||new URLSearchParams,n=(0,et.usePathname)(),r={...Object.fromEntries(t.entries()),...e||{}};return e?function(e,t){if(!e||!t)return e;let n=e;try{let e=Object.entries(t);for(let[t,r]of e)if(!Array.isArray(r)){let e=ei(r);e.test(n)&&(n=n.replace(e,`/[${t}]`))}for(let[t,r]of e)if(Array.isArray(r)){let e=ei(r.join("/"));e.test(n)&&(n=n.replace(e,`/[...${t}]`))}return n}catch(t){return e}}(n,r):null};function ec(e){let t=eu();return a.createElement(el,{route:t,...e,framework:"next"})}function ed(e){return a.createElement(a.Suspense,{fallback:null},a.createElement(ec,{...e}))}var eh=n(71930),ef=n(22903),ep=n(5460),em=n.n(ep),eg=n(62058),ev=n(74942),ey=(0,a.createContext)({client:ev.ZP});function e_(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,s=(0,a.useMemo)(function(){return(n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&i&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n)?n:(r&&(ev.ZP.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),ev.ZP.init(r,i)),ev.ZP)},[n,r]);return a.createElement(ey.Provider,{value:{client:s}},t)}var eb=n(26843);let ew=()=>{let e=(0,eg.useRouter)(),{data:t}=(0,eh.useSession)();(0,a.useEffect)(()=>{let t=()=>null===eb.Lp||void 0===eb.Lp?void 0:eb.Lp.capture("$pageview");return e.events.on("routeChangeComplete",t),()=>{e.events.off("routeChangeComplete",t)}},[]),(0,a.useEffect)(()=>{t&&(0,eb.Ww)(t)},[t])},eS=e=>{let{children:t}=e;return ew(),(0,r.jsx)(e_,{client:eb.Lp,children:t})};var eE=n(19215);let ex=(0,a.forwardRef)((e,t)=>{let{style:n,...i}=e;return(0,r.jsx)("svg",{...i,ref:t,style:{width:"var(--loader-size)",height:"var(--loader-size)",stroke:"var(--loader-color)",...n},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#fff",children:(0,r.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,r.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,r.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,r.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,r.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,r.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,r.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}),ek={fontFamily:"NeuePro",primaryColor:"bright-blue",colors:{"bright-blue":["#EEF4FE","#DEEAFD","#CDDFFC","#BDD5FB","#ADCBFB","#9CC0FA","#8CB6F9","#7BABF8","#6BA1F7","#5b97f7"]},components:{Loader:z.a.extend({defaultProps:{loaders:{...z.a.defaultLoaders,ring:ex}}})}};n(2780),n(82295),n(96909),n(53340),n(70010);var eT=n(3238),eO=n(27690),eI=eE.S.withTRPC(function(e){let{Component:t,pageProps:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(em(),{children:[(0,r.jsx)("title",{children:"awen"}),(0,r.jsx)("meta",{name:"description",content:"the generative suite to develop new ideas into unique content"}),(0,r.jsx)("meta",{property:"og:title",content:"awen"}),(0,r.jsx)("meta",{property:"og:description",content:"the generative suite to develop new ideas into unique content"}),(0,r.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,r.jsxs)("main",{className:s().className,children:[(0,r.jsx)(ed,{}),(0,r.jsx)(ef.AxiomWebVitals,{}),(0,r.jsx)(o.M,{theme:ek,defaultColorScheme:"light",children:(0,r.jsx)(eh.SessionProvider,{session:n.session,refetchInterval:300,refetchOnWindowFocus:!1,refetchWhenOffline:!1,children:(0,r.jsx)(eO.WT,{authEndpoint:eT.KQ,resolveUsers:eT.jD,resolveRoomsInfo:eT.mO,resolveMentionSuggestions:eT.ET,children:(0,r.jsxs)(eS,{children:[(0,r.jsx)(t,{...n}),(0,r.jsx)(ee,{})]})})})})]})]})})},2397:function(e){"use strict";var t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s={};function o(e){var t;let n=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),r=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===n.length?r:`${r}; ${n.join("; ")}`}function a(e){let t=new Map;for(let n of e.split(/; */)){if(!n)continue;let e=n.indexOf("=");if(-1===e){t.set(n,"true");continue}let[r,i]=[n.slice(0,e),n.slice(e+1)];try{t.set(r,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function l(e){var t,n;if(!e)return;let[[r,i],...s]=a(e),{domain:o,expires:l,httponly:d,maxage:h,path:f,samesite:p,secure:m,partitioned:g,priority:v}=Object.fromEntries(s.map(([e,t])=>[e.toLowerCase(),t]));return function(e){let t={};for(let n in e)e[n]&&(t[n]=e[n]);return t}({name:r,value:decodeURIComponent(i),domain:o,...l&&{expires:new Date(l)},...d&&{httpOnly:!0},..."string"==typeof h&&{maxAge:Number(h)},path:f,...p&&{sameSite:u.includes(t=(t=p).toLowerCase())?t:void 0},...m&&{secure:!0},...v&&{priority:c.includes(n=(n=v).toLowerCase())?n:void 0},...g&&{partitioned:!0}})}((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})(s,{RequestCookies:()=>d,ResponseCookies:()=>h,parseCookie:()=>a,parseSetCookie:()=>l,stringifyCookie:()=>o}),e.exports=((e,s,o,a)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let l of r(s))i.call(e,l)||l===o||t(e,l,{get:()=>s[l],enumerable:!(a=n(s,l))||a.enumerable});return e})(t({},"__esModule",{value:!0}),s);var u=["strict","lax","none"],c=["low","medium","high"],d=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,n]of a(t))this._parsed.set(e,{name:e,value:n})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let n=Array.from(this._parsed);if(!e.length)return n.map(([e,t])=>t);let r="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return n.filter(([e])=>e===r).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,n]=1===e.length?[e[0].name,e[0].value]:e,r=this._parsed;return r.set(t,{name:t,value:n}),this._headers.set("cookie",Array.from(r).map(([e,t])=>o(t)).join("; ")),this}delete(e){let t=this._parsed,n=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>o(t)).join("; ")),n}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},h=class{constructor(e){var t,n,r;this._parsed=new Map,this._headers=e;let i=null!=(r=null!=(n=null==(t=e.getSetCookie)?void 0:t.call(e))?n:e.get("set-cookie"))?r:[];for(let e of Array.isArray(i)?i:function(e){if(!e)return[];var t,n,r,i,s,o=[],a=0;function l(){for(;a<e.length&&/\s/.test(e.charAt(a));)a+=1;return a<e.length}for(;a<e.length;){for(t=a,s=!1;l();)if(","===(n=e.charAt(a))){for(r=a,a+=1,l(),i=a;a<e.length&&"="!==(n=e.charAt(a))&&";"!==n&&","!==n;)a+=1;a<e.length&&"="===e.charAt(a)?(s=!0,a=i,o.push(e.substring(t,r)),t=a):a=r+1}else a+=1;(!s||a>=e.length)&&o.push(e.substring(t,e.length))}return o}(i)){let t=l(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let n=Array.from(this._parsed.values());if(!e.length)return n;let r="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return n.filter(e=>e.name===r)}has(e){return this._parsed.has(e)}set(...e){let[t,n,r]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:n,...r})),function(e,t){for(let[,n]of(t.delete("set-cookie"),e)){let e=o(n);t.append("set-cookie",e)}}(i,this._headers),this}delete(...e){let[t,n,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:n,domain:r,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(o).join("; ")}}},53340:function(){},2780:function(){},82295:function(){},96909:function(){},70010:function(){},157:function(e){e.exports={style:{fontFamily:"'__neuePro_a6db0f', '__neuePro_Fallback_a6db0f'"},className:"__className_a6db0f"}},39370:function(e,t,n){var r;(()=>{var i={226:function(i,s){!function(o,a){"use strict";var l="function",u="undefined",c="object",d="string",h="major",f="model",p="name",m="type",g="vendor",v="version",y="architecture",_="console",b="mobile",w="tablet",S="smarttv",E="wearable",x="embedded",k="Amazon",T="Apple",O="ASUS",I="BlackBerry",C="Browser",R="Chrome",A="Firefox",P="Google",M="Huawei",L="Microsoft",N="Motorola",D="Opera",$="Samsung",j="Sharp",F="Sony",U="Xiaomi",q="Zebra",B="Facebook",H="Chromium OS",z="Mac OS",W=function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},V=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},G=function(e,t){return typeof e===d&&-1!==Q(t).indexOf(Q(e))},Q=function(e){return e.toLowerCase()},K=function(e,t){if(typeof e===d)return e=e.replace(/^\s\s*/,""),typeof t===u?e:e.substring(0,350)},J=function(e,t){for(var n,r,i,s,o,u,d=0;d<t.length&&!o;){var h=t[d],f=t[d+1];for(n=r=0;n<h.length&&!o&&h[n];)if(o=h[n++].exec(e))for(i=0;i<f.length;i++)u=o[++r],typeof(s=f[i])===c&&s.length>0?2===s.length?typeof s[1]==l?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:3===s.length?typeof s[1]!==l||s[1].exec&&s[1].test?this[s[0]]=u?u.replace(s[1],s[2]):void 0:this[s[0]]=u?s[1].call(this,u,s[2]):void 0:4===s.length&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):void 0):this[s]=u||a;d+=2}},X=function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(G(t[n][r],e))return"?"===n?a:n}else if(G(t[n],e))return"?"===n?a:n;return e},Z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[v,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[v,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,v],[/opios[\/ ]+([\w\.]+)/i],[v,[p,D+" Mini"]],[/\bopr\/([\w\.]+)/i],[v,[p,D]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,v],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[v,[p,"UC"+C]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[v,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[v,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[v,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[v,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[v,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+C],v],[/\bfocus\/([\w\.]+)/i],[v,[p,A+" Focus"]],[/\bopt\/([\w\.]+)/i],[v,[p,D+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[v,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[v,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[v,[p,D+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[v,[p,"MIUI "+C]],[/fxios\/([-\w\.]+)/i],[v,[p,A]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 "+C]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 "+C],v],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],v],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,v],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,B],v],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,v],[/\bgsa\/([\w\.]+) .*safari\//i],[v,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[v,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[v,[p,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,R+" WebView"],v],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[v,[p,"Android "+C]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,v],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[v,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[v,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[v,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[p,v],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],v],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[v,[p,A+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[p,v],[/(cobalt)\/([\w\.]+)/i],[p,[v,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[y,"amd64"]],[/(ia32(?=;))/i],[[y,Q]],[/((?:i[346]|x)86)[;\)]/i],[[y,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/windows (ce|mobile); ppc;/i],[[y,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[y,/ower/,"",Q]],[/(sun4\w)[;\)]/i],[[y,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[y,Q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[g,$],[m,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[g,$],[m,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[f,[g,T],[m,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[g,T],[m,w]],[/(macintosh);/i],[f,[g,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[g,j],[m,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[g,M],[m,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[g,M],[m,b]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g," "],[g,U],[m,b]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[g,U],[m,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[g,"OPPO"],[m,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[g,"Vivo"],[m,b]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[g,"Realme"],[m,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[g,N],[m,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[g,N],[m,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[g,"LG"],[m,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[g,"LG"],[m,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[g,"Lenovo"],[m,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[g,"Nokia"],[m,b]],[/(pixel c)\b/i],[f,[g,P],[m,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[g,P],[m,b]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[g,F],[m,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[g,F],[m,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[g,"OnePlus"],[m,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[g,k],[m,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[g,k],[m,b]],[/(playbook);[-\w\),; ]+(rim)/i],[f,g,[m,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[g,I],[m,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[g,O],[m,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[g,O],[m,b]],[/(nexus 9)/i],[f,[g,"HTC"],[m,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[f,/_/g," "],[m,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[g,"Acer"],[m,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[g,"Meizu"],[m,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[g,f,[m,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,f,[m,w]],[/(surface duo)/i],[f,[g,L],[m,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[g,"Fairphone"],[m,b]],[/(u304aa)/i],[f,[g,"AT&T"],[m,b]],[/\bsie-(\w*)/i],[f,[g,"Siemens"],[m,b]],[/\b(rct\w+) b/i],[f,[g,"RCA"],[m,w]],[/\b(venue[\d ]{2,7}) b/i],[f,[g,"Dell"],[m,w]],[/\b(q(?:mv|ta)\w+) b/i],[f,[g,"Verizon"],[m,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[g,"Barnes & Noble"],[m,w]],[/\b(tm\d{3}\w+) b/i],[f,[g,"NuVision"],[m,w]],[/\b(k88) b/i],[f,[g,"ZTE"],[m,w]],[/\b(nx\d{3}j) b/i],[f,[g,"ZTE"],[m,b]],[/\b(gen\d{3}) b.+49h/i],[f,[g,"Swiss"],[m,b]],[/\b(zur\d{3}) b/i],[f,[g,"Swiss"],[m,w]],[/\b((zeki)?tb.*\b) b/i],[f,[g,"Zeki"],[m,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],f,[m,w]],[/\b(ns-?\w{0,9}) b/i],[f,[g,"Insignia"],[m,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[g,"NextBook"],[m,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],f,[m,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],f,[m,b]],[/\b(ph-1) /i],[f,[g,"Essential"],[m,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[g,"Envizen"],[m,w]],[/\b(trio[-\w\. ]+) b/i],[f,[g,"MachSpeed"],[m,w]],[/\btu_(1491) b/i],[f,[g,"Rotor"],[m,w]],[/(shield[\w ]+) b/i],[f,[g,"Nvidia"],[m,w]],[/(sprint) (\w+)/i],[g,f,[m,b]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[g,L],[m,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[g,q],[m,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[g,q],[m,b]],[/smart-tv.+(samsung)/i],[g,[m,S]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[g,$],[m,S]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,"LG"],[m,S]],[/(apple) ?tv/i],[g,[f,T+" TV"],[m,S]],[/crkey/i],[[f,R+"cast"],[g,P],[m,S]],[/droid.+aft(\w)( bui|\))/i],[f,[g,k],[m,S]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[g,j],[m,S]],[/(bravia[\w ]+)( bui|\))/i],[f,[g,F],[m,S]],[/(mitv-\w{5}) bui/i],[f,[g,U],[m,S]],[/Hbbtv.*(technisat) (.*);/i],[g,f,[m,S]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,K],[f,K],[m,S]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,S]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,f,[m,_]],[/droid.+; (shield) bui/i],[f,[g,"Nvidia"],[m,_]],[/(playstation [345portablevi]+)/i],[f,[g,F],[m,_]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[g,L],[m,_]],[/((pebble))app/i],[g,f,[m,E]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[f,[g,T],[m,E]],[/droid.+; (glass) \d/i],[f,[g,P],[m,E]],[/droid.+; (wt63?0{2,3})\)/i],[f,[g,q],[m,E]],[/(quest( 2| pro)?)/i],[f,[g,B],[m,E]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[m,x]],[/(aeobc)\b/i],[f,[g,k],[m,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[m,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[m,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,b]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[v,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[v,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,v],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[v,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,v],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[v,X,Z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,"Windows"],[v,X,Z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[v,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,z],[v,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[v,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,v],[/\(bb(10);/i],[v,[p,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[v,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[v,[p,A+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[v,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[v,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[v,[p,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,H],v],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,v],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],v],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,v]]},ee=function(e,t){if(typeof e===c&&(t=e,e=a),!(this instanceof ee))return new ee(e,t).getResult();var n=typeof o!==u&&o.navigator?o.navigator:a,r=e||(n&&n.userAgent?n.userAgent:""),i=n&&n.userAgentData?n.userAgentData:a,s=t?W(Y,t):Y,_=n&&n.userAgent==r;return this.getBrowser=function(){var e,t={};return t[p]=a,t[v]=a,J.call(t,r,s.browser),t[h]=typeof(e=t[v])===d?e.replace(/[^\d\.]/g,"").split(".")[0]:a,_&&n&&n.brave&&typeof n.brave.isBrave==l&&(t[p]="Brave"),t},this.getCPU=function(){var e={};return e[y]=a,J.call(e,r,s.cpu),e},this.getDevice=function(){var e={};return e[g]=a,e[f]=a,e[m]=a,J.call(e,r,s.device),_&&!e[m]&&i&&i.mobile&&(e[m]=b),_&&"Macintosh"==e[f]&&n&&typeof n.standalone!==u&&n.maxTouchPoints&&n.maxTouchPoints>2&&(e[f]="iPad",e[m]=w),e},this.getEngine=function(){var e={};return e[p]=a,e[v]=a,J.call(e,r,s.engine),e},this.getOS=function(){var e={};return e[p]=a,e[v]=a,J.call(e,r,s.os),_&&!e[p]&&i&&"Unknown"!=i.platform&&(e[p]=i.platform.replace(/chrome os/i,H).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===d&&e.length>350?K(e,350):e,this},this.setUA(r),this};ee.VERSION="1.0.35",ee.BROWSER=V([p,v,h]),ee.CPU=V([y]),ee.DEVICE=V([f,g,m,_,b,S,w,E,x]),ee.ENGINE=ee.OS=V([p,v]),typeof s!==u?(i.exports&&(s=i.exports=ee),s.UAParser=ee):n.amdO?void 0!==(r=(function(){return ee}).call(t,n,t,e))&&(e.exports=r):typeof o!==u&&(o.UAParser=ee);var et=typeof o!==u&&(o.jQuery||o.Zepto);if(et&&!et.ua){var en=new ee;et.ua=en.getResult(),et.ua.get=function(){return en.getUA()},et.ua.set=function(e){en.setUA(e);var t=en.getResult();for(var n in t)et.ua[n]=t[n]}}}("object"==typeof window?window:this)}},s={};function o(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}},r=!0;try{i[e].call(n.exports,n,n.exports,o),r=!1}finally{r&&delete s[e]}return n.exports}o.ab="//";var a=o(226);e.exports=a})()},48853:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PageSignatureError:function(){return n},RemovedPageError:function(){return r},RemovedUAError:function(){return i}});class n extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form:
  
  export function middleware(request, event) {
    return NextResponse.redirect('/new-location')
  }
  
  Read more: https://nextjs.org/docs/messages/middleware-new-signature
  `)}}class r extends Error{constructor(){super(`The request.page has been deprecated in favour of \`URLPattern\`.
  Read more: https://nextjs.org/docs/messages/middleware-request-page
  `)}}class i extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
  Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
  `)}}},8294:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NextURL",{enumerable:!0,get:function(){return c}});let r=n(68831),i=n(85216),s=n(83064),o=n(66586),a=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function l(e,t){return new URL(String(e).replace(a,"localhost"),t&&String(t).replace(a,"localhost"))}let u=Symbol("NextURLInternal");class c{constructor(e,t,n){let r,i;"object"==typeof t&&"pathname"in t||"string"==typeof t?(r=t,i=n||{}):i=n||t||{},this[u]={url:l(e,r??i.base),options:i,basePath:""},this.analyze()}analyze(){var e,t,n,i,a;let l=(0,o.getNextPathnameInfo)(this[u].url.pathname,{nextConfig:this[u].options.nextConfig,parseData:!0,i18nProvider:this[u].options.i18nProvider}),c=(0,s.getHostname)(this[u].url,this[u].options.headers);this[u].domainLocale=this[u].options.i18nProvider?this[u].options.i18nProvider.detectDomainLocale(c):(0,r.detectDomainLocale)(null==(t=this[u].options.nextConfig)?void 0:null==(e=t.i18n)?void 0:e.domains,c);let d=(null==(n=this[u].domainLocale)?void 0:n.defaultLocale)||(null==(a=this[u].options.nextConfig)?void 0:null==(i=a.i18n)?void 0:i.defaultLocale);this[u].url.pathname=l.pathname,this[u].defaultLocale=d,this[u].basePath=l.basePath??"",this[u].buildId=l.buildId,this[u].locale=l.locale??d,this[u].trailingSlash=l.trailingSlash}formatPathname(){return(0,i.formatNextPathnameInfo)({basePath:this[u].basePath,buildId:this[u].buildId,defaultLocale:this[u].options.forceLocale?void 0:this[u].defaultLocale,locale:this[u].locale,pathname:this[u].url.pathname,trailingSlash:this[u].trailingSlash})}formatSearch(){return this[u].url.search}get buildId(){return this[u].buildId}set buildId(e){this[u].buildId=e}get locale(){return this[u].locale??""}set locale(e){var t,n;if(!this[u].locale||!(null==(n=this[u].options.nextConfig)?void 0:null==(t=n.i18n)?void 0:t.locales.includes(e)))throw TypeError(`The NextURL configuration includes no locale "${e}"`);this[u].locale=e}get defaultLocale(){return this[u].defaultLocale}get domainLocale(){return this[u].domainLocale}get searchParams(){return this[u].url.searchParams}get host(){return this[u].url.host}set host(e){this[u].url.host=e}get hostname(){return this[u].url.hostname}set hostname(e){this[u].url.hostname=e}get port(){return this[u].url.port}set port(e){this[u].url.port=e}get protocol(){return this[u].url.protocol}set protocol(e){this[u].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[u].url=l(e),this.analyze()}get origin(){return this[u].url.origin}get pathname(){return this[u].url.pathname}set pathname(e){this[u].url.pathname=e}get hash(){return this[u].url.hash}set hash(e){this[u].url.hash=e}get search(){return this[u].url.search}set search(e){this[u].url.search=e}get password(){return this[u].url.password}set password(e){this[u].url.password=e}get username(){return this[u].url.username}set username(e){this[u].url.username=e}get basePath(){return this[u].basePath}set basePath(e){this[u].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new c(String(this),this[u].options)}}},52745:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,n){let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}static set(e,t,n,r){return Reflect.set(e,t,n,r)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},52839:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RequestCookies:function(){return r.RequestCookies},ResponseCookies:function(){return r.ResponseCookies},stringifyCookie:function(){return r.stringifyCookie}});let r=n(2397)},17602:function(e,t){"use strict";function n(){throw Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead')}Object.defineProperty(t,"E",{enumerable:!0,get:function(){return n}})},98583:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{INTERNALS:function(){return a},NextRequest:function(){return l}});let r=n(8294),i=n(37303),s=n(48853),o=n(52839),a=Symbol("internal request");class l extends Request{constructor(e,t={}){let n="string"!=typeof e&&"url"in e?e.url:String(e);(0,i.validateURL)(n),e instanceof Request?super(e,t):super(n,t);let s=new r.NextURL(n,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[a]={cookies:new o.RequestCookies(this.headers),geo:t.geo||{},ip:t.ip,nextUrl:s,url:s.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[a].cookies}get geo(){return this[a].geo}get ip(){return this[a].ip}get nextUrl(){return this[a].nextUrl}get page(){throw new s.RemovedPageError}get ua(){throw new s.RemovedUAError}get url(){return this[a].url}}},67773:function(e,t,n){"use strict";Object.defineProperty(t,"x",{enumerable:!0,get:function(){return d}});let r=n(52839),i=n(8294),s=n(37303),o=n(52745),a=n(52839),l=Symbol("internal response"),u=new Set([301,302,303,307,308]);function c(e,t){var n;if(null==e?void 0:null==(n=e.request)?void 0:n.headers){if(!(e.request.headers instanceof Headers))throw Error("request.headers must be an instance of Headers");let n=[];for(let[r,i]of e.request.headers)t.set("x-middleware-request-"+r,i),n.push(r);t.set("x-middleware-override-headers",n.join(","))}}class d extends Response{constructor(e,t={}){super(e,t);let n=this.headers,u=new Proxy(new a.ResponseCookies(n),{get(e,i,s){switch(i){case"delete":case"set":return(...s)=>{let o=Reflect.apply(e[i],e,s),l=new Headers(n);return o instanceof a.ResponseCookies&&n.set("x-middleware-set-cookie",o.getAll().map(e=>(0,r.stringifyCookie)(e)).join(",")),c(t,l),o};default:return o.ReflectAdapter.get(e,i,s)}}});this[l]={cookies:u,url:t.url?new i.NextURL(t.url,{headers:(0,s.toNodeOutgoingHttpHeaders)(n),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[l].cookies}static json(e,t){let n=Response.json(e,t);return new d(n.body,n)}static redirect(e,t){let n="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!u.has(n))throw RangeError('Failed to execute "redirect" on "response": Invalid status code');let r="object"==typeof t?t:{},i=new Headers(null==r?void 0:r.headers);return i.set("Location",(0,s.validateURL)(e)),new d(null,{...r,headers:i,status:n})}static rewrite(e,t){let n=new Headers(null==t?void 0:t.headers);return n.set("x-middleware-rewrite",(0,s.validateURL)(e)),c(t,n),new d(null,{...t,headers:n})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),c(e,t),new d(null,{...e,headers:t})}}},93017:function(e,t){"use strict";Object.defineProperty(t,"o",{enumerable:!0,get:function(){return n}});let n="undefined"==typeof URLPattern?void 0:URLPattern},53329:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{isBot:function(){return s},userAgent:function(){return a},userAgentFromString:function(){return o}});let i=(r=n(39370))&&r.__esModule?r:{default:r};function s(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}function o(e){return{...(0,i.default)(e),isBot:void 0!==e&&s(e)}}function a({headers:e}){return o(e.get("user-agent")||void 0)}},37303:function(e,t){"use strict";function n(e){let t=new Headers;for(let[n,r]of Object.entries(e))for(let e of Array.isArray(r)?r:[r])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(n,e));return t}function r(e){var t,n,r,i,s,o=[],a=0;function l(){for(;a<e.length&&/\s/.test(e.charAt(a));)a+=1;return a<e.length}for(;a<e.length;){for(t=a,s=!1;l();)if(","===(n=e.charAt(a))){for(r=a,a+=1,l(),i=a;a<e.length&&"="!==(n=e.charAt(a))&&";"!==n&&","!==n;)a+=1;a<e.length&&"="===e.charAt(a)?(s=!0,a=i,o.push(e.substring(t,r)),t=a):a=r+1}else a+=1;(!s||a>=e.length)&&o.push(e.substring(t,e.length))}return o}function i(e){let t={},n=[];if(e)for(let[i,s]of e.entries())"set-cookie"===i.toLowerCase()?(n.push(...r(s)),t[i]=1===n.length?n[0]:n):t[i]=s;return t}function s(e){try{return String(new URL(String(e)))}catch(t){throw Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t})}}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{fromNodeOutgoingHttpHeaders:function(){return n},splitCookiesString:function(){return r},toNodeOutgoingHttpHeaders:function(){return i},validateURL:function(){return s}})},5460:function(e,t,n){e.exports=n(12636)},96970:function(e,t,n){e.exports=n(30489)},62058:function(e,t,n){e.exports=n(64046)},29994:function(e,t,n){let r={NextRequest:n(98583).NextRequest,NextResponse:n(67773).x,ImageResponse:n(17602).E,userAgentFromString:n(53329).userAgentFromString,userAgent:n(53329).userAgent,URLPattern:n(93017).o};e.exports=r,t.NextRequest=r.NextRequest,t.NextResponse=r.NextResponse,t.ImageResponse=r.ImageResponse,t.userAgentFromString=r.userAgentFromString,t.userAgent=r.userAgent,t.URLPattern=r.URLPattern},86980:function(e,t,n){e.exports=n(32699)},74942:function(e,t,n){"use strict";let r,i,s,o,a,l,u,c;n.d(t,{ZP:function(){return iu}});let d="undefined"!=typeof window?window:void 0,h="undefined"!=typeof globalThis?globalThis:d,f=Array.prototype,p=f.forEach,m=f.indexOf,g=null==h?void 0:h.navigator,v=null==h?void 0:h.document,y=null==h?void 0:h.location,_=null==h?void 0:h.fetch,b=null!=h&&h.XMLHttpRequest&&"withCredentials"in new h.XMLHttpRequest?h.XMLHttpRequest:void 0,w=null==h?void 0:h.AbortController,S=null==g?void 0:g.userAgent,E=null!=d?d:{},x={DEBUG:!1,LIB_VERSION:"1.174.3"},k=Array.isArray,T=Object.prototype,O=T.hasOwnProperty,I=T.toString,C=k||function(e){return"[object Array]"===I.call(e)},R=function(e){return"function"==typeof e},A=function(e){return e===Object(e)&&!C(e)},P=function(e){if(A(e)){for(let t in e)if(O.call(e,t))return!1;return!0}return!1},M=function(e){return void 0===e},L=function(e){return"[object String]"==I.call(e)},N=function(e){return L(e)&&0===e.trim().length},D=function(e){return null===e},$=function(e){return M(e)||D(e)},j=function(e){return"[object Number]"==I.call(e)},F=function(e){return"[object Boolean]"===I.call(e)},U=e=>e instanceof FormData,q="[PostHog.js]",B={_log:function(e){if(d&&(x.DEBUG||E.POSTHOG_DEBUG)&&!M(d.console)&&d.console){let i="__rrweb_original__"in d.console[e]?d.console[e].__rrweb_original__:d.console[e];for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i(q,...n)}},info:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];B._log("log",...t)},warn:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];B._log("warn",...t)},error:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];B._log("error",...t)},critical:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];console.error(q,...t)},uninitializedWarning:e=>{B.error(`You must initialize PostHog before calling ${e}`)}},H=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return B.warn(`${t} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");let r=()=>{var e;if(!v)return n("document not found");let r=v.createElement("script");r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>n(void 0,e),r.onerror=e=>n(e);let i=v.querySelectorAll("body > script");i.length>0?null===(e=i[0].parentNode)||void 0===e||e.insertBefore(r,i[0]):v.body.appendChild(r)};null!=v&&v.body?r():null==v||v.addEventListener("DOMContentLoaded",r)};E.__PosthogExtensions__=E.__PosthogExtensions__||{},E.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{let r=`/static/${t}.js?v=${e.version}`;"toolbar"===t&&(r=`${r}?&=${3e5*Math.floor(Date.now()/3e5)}`);let i=e.requestRouter.endpointFor("assets",r);H(e,i,n)},E.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{let r=e.requestRouter.endpointFor("api",t);H(e,r,n)};let z={},W=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function V(e,t,n){if(C(e)){if(p&&e.forEach===p)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(let r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===z)return}}}function G(e,t,n){if(!$(e)){if(C(e))return V(e,t,n);if(U(e)){for(let r of e.entries())if(t.call(n,r[1],r[0])===z)return}else for(let r in e)if(O.call(e,r)&&t.call(n,e[r],r)===z)return}}let Q=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return V(n,function(t){for(let n in t)void 0!==t[n]&&(e[n]=t[n])}),e};function K(e,t){return -1!==e.indexOf(t)}function J(e){let t=Object.keys(e),n=t.length,r=Array(n);for(;n--;)r[n]=[t[n],e[t[n]]];return r}let X=function(e){try{return e()}catch{return}},Z=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){B.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),B.critical(e)}}},Y=function(e){let t={};return G(e,function(e,n){L(e)&&e.length>0&&(t[n]=e)}),t},ee=function(e){return e.replace(/^\$/,"")},et=function(e){let t,n,r,i="",s=0;for(t=n=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<s;r++){let s=e.charCodeAt(r),o=null;s<128?n++:o=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),D(o)||(n>t&&(i+=e.substring(t,n)),i+=o,t=n=r+1)}return n>t&&(i+=e.substring(t,e.length)),i},en=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,s){if(t){if(t.addEventListener&&!i)t.addEventListener(n,r,!!s);else{let i="on"+n,s=t[i];t[i]=function(n){if(!(n=n||e(null==d?void 0:d.event)))return;let i,o=!0;R(s)&&(i=s(n));let a=r.call(t,n);return!1!==i&&!1!==a||(o=!1),o}}}else B.error("No valid element provided to register_event")}}();function er(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}(nt=r||(r={})).GZipJS="gzip-js",nt.Base64="base64";let ei="$people_distinct_id",es="__alias",eo="__timers",ea="$autocapture_disabled_server_side",el="$heatmaps_enabled_server_side",eu="$exception_capture_enabled_server_side",ec="$exception_capture_endpoint_suffix",ed="$web_vitals_enabled_server_side",eh="$web_vitals_allowed_metrics",ef="$session_recording_enabled_server_side",ep="$console_log_recording_enabled_server_side",em="$session_recording_network_payload_capture",eg="$session_recording_canvas_recording",ev="$replay_sample_rate",ey="$replay_minimum_duration",e_="$sesid",eb="$session_is_sampled",ew="$session_recording_url_trigger_activated_session",eS="$session_recording_url_trigger_status",eE="$enabled_feature_flags",ex="$early_access_features",ek="$stored_person_properties",eT="$stored_group_properties",eO="$surveys",eI="$surveys_activated",eC="$flag_call_reported",eR="$user_state",eA="$client_session_props",eP="$capture_rate_limit",eM="$initial_campaign_params",eL="$initial_referrer_info",eN="$initial_person_info",eD="$epp",e$="__POSTHOG_TOOLBAR__",ej=[ei,es,"__cmpns",eo,ef,el,e_,eE,eR,ex,eT,ek,eO,eC,eA,eP,eM,eL,eD],eF="$active_feature_flags",eU="$override_feature_flags",eq="$feature_flag_payloads",eB=e=>{let t={};for(let[n,r]of J(e||{}))r&&(t[n]=r);return t};class eH{constructor(e){this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){let e=this.instance.get_property(eE),t=this.instance.get_property(eU);if(!t)return e||{};let n=Q({},e),r=Object.keys(t);for(let e=0;e<r.length;e++)n[r[e]]=t[r[e]];return this._override_warning||(B.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}getFlagPayloads(){return this.instance.get_property(eq)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.reloadFeatureFlagsInAction=e}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())},5)}_reloadFeatureFlagsRequest(){if(this.instance.config.advanced_disable_feature_flags)return;this.setReloadingPaused(!0);let e=this.instance.config.token,t=this.instance.get_property(ek),n=this.instance.get_property(eT),i={token:e,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:t,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:r.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t;this.setReloadingPaused(!1);let n=!0;200===e.statusCode&&(this.$anon_distinct_id=void 0,n=!1),this.receivedFeatureFlags(null!==(t=e.json)&&void 0!==t?t:{},n),this._startReloadTimer()}})}getFeatureFlag(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0))return void B.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.");let r=this.getFlagVariants()[e],i=`${r}`,s=this.instance.get_property(eC)||{};return!n.send_event&&"send_event"in n||e in s&&s[e].includes(i)||(C(s[e])?s[e].push(i):s[e]=[i],null===(t=this.instance.persistence)||void 0===t||t.register({[eC]:s}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);B.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(!this.instance.persistence)return;this.instance.decideEndpointWasHit=!0;let n=this.getFlagVariants(),r=this.getFlagPayloads();(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e.featureFlags,s=e.featureFlagPayloads;if(!i)return;if(C(i)){let e={};if(i)for(let t=0;t<i.length;t++)e[i[t]]=!0;return void(t&&t.register({[eF]:i,[eE]:e}))}let o=i,a=s;e.errorsWhileComputingFlags&&(o={...n,...o},a={...r,...a}),t&&t.register({[eF]:Object.keys(eB(o)),[eE]:o||{},[eq]:a||{}})})(e,this.instance.persistence,n,r),this._fireFeatureFlagsCallbacks(t)}override(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return B.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(eU);else if(C(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register({[eU]:t})}else this.instance.persistence.register({[eU]:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){let{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n;let r={[`$feature_enrollment/${e}`]:t};this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:r}),this.setPersonPropertiesForFlags(r,!1);let i={...this.getFlagVariants(),[e]:t};null===(n=this.instance.persistence)||void 0===n||n.register({[eF]:Object.keys(eB(i)),[eE]:i}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.instance.get_property(ex);if(n&&!t)return e(n);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api",`/api/early_access_features/?token=${this.instance.config.token}`),method:"GET",callback:t=>{var n;if(!t.json)return;let r=t.json.earlyAccessFeatures;return null===(n=this.instance.persistence)||void 0===n||n.register({[ex]:r}),e(r)}})}_prepareFeatureFlagsForCallbacks(){let e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,n)=>(e[n]=t[n],e),{})}}_fireFeatureFlagsCallbacks(e){let{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(ek)||{};this.instance.register({[ek]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(ek)}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(eT)||{};0!==Object.keys(n).length&&Object.keys(n).forEach(t=>{n[t]={...n[t],...e[t]},delete e[t]}),this.instance.register({[eT]:{...n,...e}}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){let t=this.instance.get_property(eT)||{};this.instance.register({[eT]:{...t,[e]:{}}})}else this.instance.unregister(eT)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return j(e)&&isFinite(e)&&Math.floor(e)===e});let ez="0123456789abcdef";class eW{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,n,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||e<0||t<0||n<0||r<0||e>0xffffffffffff||t>4095||n>1073741823||r>4294967295)throw RangeError("invalid field value");let i=new Uint8Array(16);return i[0]=e/1099511627776,i[1]=e/4294967296,i[2]=e/16777216,i[3]=e/65536,i[4]=e/256,i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r,new eW(i)}toString(){let e="";for(let t=0;t<this.bytes.length;t++)e=e+ez.charAt(this.bytes[t]>>>4)+ez.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new eW(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;t<16;t++){let n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}class eV{timestamp=0;counter=0;random=new eK;generate(){let e=this.generateOrAbort();if(M(e)){this.timestamp=0;let e=this.generateOrAbort();if(M(e))throw Error("Could not generate UUID after timestamp reset");return e}return e}generateOrAbort(){let e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return eW.fromFieldsV7(this.timestamp,Math.trunc(this.counter/1073741824),this.counter&1073741824-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}let eG,eQ=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(let t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};d&&!M(d.crypto)&&crypto.getRandomValues&&(eQ=e=>crypto.getRandomValues(e));class eK{buffer=new Uint32Array(8);cursor=1/0;nextUint32(){return this.cursor>=this.buffer.length&&(eQ(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}let eJ=()=>eX().toString(),eX=()=>(eG||(eG=new eV)).generate(),eZ="",eY=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,e0={is_supported:()=>!!v,error:function(e){B.error("cookieStore error: "+e)},get:function(e){if(v){try{let t=e+"=",n=v.cookie.split(";").filter(e=>e.length);for(let e=0;e<n.length;e++){let r=n[e];for(;" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch{}return null}},parse:function(e){let t;try{t=JSON.parse(e0.get(e))||{}}catch{}return t},set:function(e,t,n,r,i){if(v)try{let s="",o="",a=function(e,t){if(t){let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;if(eZ)return eZ;if(!t||["localhost","127.0.0.1"].includes(e))return"";let n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+eJ(),s=RegExp("(^|;)\\s*"+i+"=1");for(;!eZ&&r--;){let e=n.slice(r).join("."),o=i+"=1;domain=."+e;t.cookie=o,s.test(t.cookie)&&(t.cookie=o+";expires=Thu, 01 Jan 1970 00:00:00 GMT",eZ=e)}return eZ}(e);if(!t){let n=(e=>{let t=e.match(eY);return t?t[0]:""})(e);n!==t&&B.info("Warning: cookie subdomain discovery mismatch",n,t),t=n}return t?"; domain=."+t:""}return""}(v.location.hostname,r);if(n){let e=new Date;e.setTime(e.getTime()+24*n*36e5),s="; expires="+e.toUTCString()}i&&(o="; secure");let l=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&B.warn("cookieStore warning: large cookie, len="+l.length),v.cookie=l,l}catch{return}},remove:function(e,t){try{e0.set(e,"",-1,t)}catch{return}}},e1=null,e2={is_supported:function(){if(!D(e1))return e1;let e=!0;if(M(d))e=!1;else try{let t="__mplssupport__";e2.set(t,"xyz"),'"xyz"'!==e2.get(t)&&(e=!1),e2.remove(t)}catch{e=!1}return e||B.error("localStorage unsupported; falling back to cookie store"),e1=e,e},error:function(e){B.error("localStorage error: "+e)},get:function(e){try{return null==d?void 0:d.localStorage.getItem(e)}catch(e){e2.error(e)}return null},parse:function(e){try{return JSON.parse(e2.get(e))||{}}catch{}return null},set:function(e,t){try{null==d||d.localStorage.setItem(e,JSON.stringify(t))}catch(e){e2.error(e)}},remove:function(e){try{null==d||d.localStorage.removeItem(e)}catch(e){e2.error(e)}}},e3=["distinct_id",e_,eb,eD],e5={...e2,parse:function(e){try{let t={};try{t=e0.parse(e)||{}}catch{}let n=Q(t,JSON.parse(e2.get(e)||"{}"));return e2.set(e,n),n}catch{}return null},set:function(e,t,n,r,i,s){try{e2.set(e,t,void 0,void 0,s);let o={};e3.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&e0.set(e,o,n,r,i,s)}catch(e){e2.error(e)}},remove:function(e,t){try{null==d||d.localStorage.removeItem(e),e0.remove(e,t)}catch(e){e2.error(e)}}},e4={},e6={is_supported:function(){return!0},error:function(e){B.error("memoryStorage error: "+e)},get:function(e){return e4[e]||null},parse:function(e){return e4[e]||null},set:function(e,t){e4[e]=t},remove:function(e){delete e4[e]}},e8=null,e7={is_supported:function(){if(!D(e8))return e8;if(e8=!0,M(d))e8=!1;else try{let e="__support__";e7.set(e,"xyz"),'"xyz"'!==e7.get(e)&&(e8=!1),e7.remove(e)}catch{e8=!1}return e8},error:function(e){B.error("sessionStorage error: ",e)},get:function(e){try{return null==d?void 0:d.sessionStorage.getItem(e)}catch(e){e7.error(e)}return null},parse:function(e){try{return JSON.parse(e7.get(e))||null}catch{}return null},set:function(e,t){try{null==d||d.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){e7.error(e)}},remove:function(e){try{null==d||d.sessionStorage.removeItem(e)}catch(e){e7.error(e)}}},e9=["localhost","127.0.0.1"],te=e=>{let t=null==v?void 0:v.createElement("a");return M(t)?null:(t.href=e,t)},tt=function(e,t){return!!function(e){try{new RegExp(e)}catch{return!1}return!0}(t)&&new RegExp(t).test(e)},tn=function(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return G(e,function(e,r){M(e)||M(r)||"undefined"===r||(t=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)}),i.join(r)},tr=function(e,t){let n;let r=((e.split("#")[0]||"").split("?")[1]||"").split("&");for(let e=0;e<r.length;e++){let i=r[e].split("=");if(i[0]===t){n=i;break}}if(!C(n)||n.length<2)return"";{let e=n[1];try{e=decodeURIComponent(e)}catch{B.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},ti=function(e,t){let n=e.match(RegExp(t+"=([^&]*)"));return n?n[1]:null},ts="Mobile",to="Android",ta="Tablet",tl=to+" "+ta,tu="iPad",tc="Apple",td=tc+" Watch",th="Safari",tf="BlackBerry",tp="Samsung",tm=tp+"Browser",tg=tp+" Internet",tv="Chrome",ty=tv+" OS",t_=tv+" iOS",tb="Internet Explorer",tw=tb+" "+ts,tS="Opera",tE=tS+" Mini",tx="Edge",tk="Microsoft "+tx,tT="Firefox",tO=tT+" iOS",tI="Nintendo",tC="PlayStation",tR="Xbox",tA=to+" "+ts,tP=ts+" "+th,tM="Windows",tL=tM+" Phone",tN="Nokia",tD="Ouya",t$="Generic",tj=t$+" "+ts.toLowerCase(),tF=t$+" "+ta.toLowerCase(),tU="Konqueror",tq="(\\d+(\\.\\d+)?)",tB=RegExp("Version/"+tq),tH=RegExp(tR,"i"),tz=RegExp(tC+" \\w+","i"),tW=RegExp(tI+" \\w+","i"),tV=RegExp(tf+"|PlayBook|BB10","i"),tG={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},tQ=(e,t)=>t&&K(t,tc)||K(e,th)&&!K(e,tv)&&!K(e,to),tK=function(e,t){return t=t||"",K(e," OPR/")&&K(e,"Mini")?tE:K(e," OPR/")?tS:tV.test(e)?tf:K(e,"IE"+ts)||K(e,"WPDesktop")?tw:K(e,tm)?tg:K(e,tx)||K(e,"Edg/")?tk:K(e,"FBIOS")?"Facebook "+ts:K(e,"UCWEB")||K(e,"UCBrowser")?"UC Browser":K(e,"CriOS")?t_:K(e,"CrMo")?tv:K(e,to)&&K(e,th)?tA:K(e,tv)?tv:K(e,"FxiOS")?tO:K(e.toLowerCase(),tU.toLowerCase())?tU:tQ(e,t)?K(e,ts)?tP:th:K(e,tT)?tT:K(e,"MSIE")||K(e,"Trident/")?tb:K(e,"Gecko")?tT:""},tJ={[tw]:[RegExp("rv:"+tq)],[tk]:[RegExp(tx+"?\\/"+tq)],[tv]:[RegExp("("+tv+"|CrMo)\\/"+tq)],[t_]:[RegExp("CriOS\\/"+tq)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+tq)],[th]:[tB],[tP]:[tB],[tS]:[RegExp("(Opera|OPR)\\/"+tq)],[tT]:[RegExp(tT+"\\/"+tq)],[tO]:[RegExp("FxiOS\\/"+tq)],[tU]:[RegExp("Konqueror[:/]?"+tq,"i")],[tf]:[RegExp(tf+" "+tq),tB],[tA]:[RegExp("android\\s"+tq,"i")],[tg]:[RegExp(tm+"\\/"+tq)],[tb]:[RegExp("(rv:|MSIE )"+tq)],Mozilla:[RegExp("rv:"+tq)]},tX=[[RegExp(tR+"; "+tR+" (.*?)[);]","i"),e=>[tR,e&&e[1]||""]],[RegExp(tI,"i"),[tI,""]],[RegExp(tC,"i"),[tC,""]],[tV,[tf,""]],[RegExp(tM,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[tL,""];if(new RegExp(ts).test(t)&&!/IEMobile\b/.test(t))return[tM+" "+ts,""];let n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){let e=tG[n[1]]||"";return/arm/i.test(t)&&(e="RT"),[tM,e]}return[tM,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=M(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+to+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+to+")","i"),e=>e&&e[2]?[to,[e[2],e[3],e[4]||"0"].join(".")]:[to,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];if(e&&e[1]){let n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ty,""]],[/Linux|debian/i,["Linux",""]]],tZ=function(e){return tW.test(e)?tI:tz.test(e)?tC:tH.test(e)?tR:RegExp(tD,"i").test(e)?tD:RegExp("("+tL+"|WPDesktop)","i").test(e)?tL:/iPad/.test(e)?tu:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?td:tV.test(e)?tf:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(tN,"i").test(e)?tN:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(ts).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?to:tl:to:RegExp("(pda|"+ts+")","i").test(e)?tj:RegExp(ta,"i").test(e)&&!RegExp(ta+" pc","i").test(e)?tF:""},tY="https?://(.*)",t0=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],t1={campaignParams:function(e){return v?this._campaignParamsFromUrl(v.URL,e):{}},_campaignParamsFromUrl:function(e,t){let n=t0.concat(t||[]),r={};return G(n,function(t){let n=tr(e,t);r[t]=n||null}),r},_searchEngine:function(e){return e?0===e.search(tY+"google.([^/?]*)")?"google":0===e.search(tY+"bing.com")?"bing":0===e.search(tY+"yahoo.com")?"yahoo":0===e.search(tY+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){let t=t1._searchEngine(e),n={};if(!D(t)){n.$search_engine=t;let e=v?tr(v.referrer,"yahoo"!=t?"q":"p"):"";e.length&&(n.ph_keyword=e)}return n},searchInfo:function(){let e=null==v?void 0:v.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:tK,browserVersion:function(e,t){let n=tJ[tK(e,t)];if(M(n))return null;for(let t=0;t<n.length;t++){let r=n[t],i=e.match(r);if(i)return parseFloat(i[i.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(let t=0;t<tX.length;t++){let[n,r]=tX[t],i=n.exec(e),s=i&&(R(r)?r(i,e):r);if(s)return s}return["",""]},device:tZ,deviceType:function(e){let t=tZ(e);return t===tu||t===tl||"Kobo"===t||"Kindle Fire"===t||t===tF?ta:t===tI||t===tR||t===tC||t===tD?"Console":t===td?"Wearable":t?ts:"Desktop"},referrer:function(){return(null==v?void 0:v.referrer)||"$direct"},referringDomain:function(){var e;return null!=v&&v.referrer&&(null===(e=te(v.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==y?void 0:y.href}},initialPersonPropsFromInfo:function(e){var t;let{r:n,u:r}=e,i={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=te(n))||void 0===t?void 0:t.host};if(r){i.$initial_current_url=r;let e=te(r);i.$initial_host=null==e?void 0:e.host,i.$initial_pathname=null==e?void 0:e.pathname,G(this._campaignParamsFromUrl(r),function(e,t){i["$initial_"+ee(t)]=e})}return n&&G(this._searchInfoFromReferrer(n),function(e,t){i["$initial_"+ee(t)]=e}),i},properties:function(){if(!S)return{};let[e,t]=t1.os(S);return Q(Y({$os:e,$os_version:t,$browser:t1.browser(S,navigator.vendor),$device:t1.device(S),$device_type:t1.deviceType(S)}),{$current_url:null==y?void 0:y.href,$host:null==y?void 0:y.host,$pathname:null==y?void 0:y.pathname,$raw_user_agent:S.length>1e3?S.substring(0,997)+"...":S,$browser_version:t1.browserVersion(S,navigator.vendor),$browser_language:t1.browserLanguage(),$screen_height:null==d?void 0:d.screen.height,$screen_width:null==d?void 0:d.screen.width,$viewport_height:null==d?void 0:d.innerHeight,$viewport_width:null==d?void 0:d.innerWidth,$lib:"web",$lib_version:x.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!S)return{};let[e,t]=t1.os(S);return Q(Y({$os:e,$os_version:t,$browser:t1.browser(S,navigator.vendor)}),{$browser_version:t1.browserVersion(S,navigator.vendor)})}},t2=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class t3{constructor(e){let t;this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(t="",e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"),this.storage=this.buildStorage(e),this.load(),e.debug&&B.info("Persistence loaded",e.persistence,{...this.props}),this.update_config(e,e),this.save()}buildStorage(e){-1===t2.indexOf(e.persistence.toLowerCase())&&(B.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");let t=e.persistence.toLowerCase();return"localstorage"===t&&e2.is_supported()?e2:"localstorage+cookie"===t&&e5.is_supported()?e5:"sessionstorage"===t&&e7.is_supported()?e7:"memory"===t?e6:"cookie"===t?e0:e5.is_supported()?e5:e0}properties(){let e={};return G(this.props,function(t,n){if(n===eE&&A(t)){let n=Object.keys(t);for(let r=0;r<n.length;r++)e[`$feature/${n[r]}`]=t[n[r]]}else{let r;r=!1,(D(ej)?r:m&&ej.indexOf===m?-1!=ej.indexOf(n):(G(ej,function(e){if(r||(r=e===n))return z}),r))||(e[n]=t)}}),e}load(){if(this.disabled)return;let e=this.storage.parse(this.name);e&&(this.props=Q({},e))}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(A(e)){M(t)&&(t="None"),this.expire_days=M(n)?this.default_expiry:n;let r=!1;if(G(e,(e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(A(e)){this.expire_days=M(t)?this.default_expiry:t;let n=!1;if(G(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){this.campaign_params_saved||(this.register(t1.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}update_search_keyword(){this.register(t1.searchInfo())}update_referrer_info(){this.register_once(t1.referrerInfo(),void 0)}set_initial_person_info(){this.props[eM]||this.props[eL]||this.register_once({[eN]:t1.initialPersonInfo()},void 0)}get_referrer_info(){return Y({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){let e={};G([eL,eM],t=>{let n=this.props[t];n&&G(n,function(t,n){e["$initial_"+ee(n)]=t})});let t=this.props[eN];return t&&Q(e,t1.initialPersonPropsFromInfo(t)),e}safe_merge(e){return G(this.props,function(t,n){n in e||(e[n]=t)}),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){let t=this.buildStorage(e),n=this.props;this.clear(),this.storage=t,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){let n=this.props[eo]||{};n[e]=t,this.props[eo]=n,this.save()}remove_event_timer(e){let t=(this.props[eo]||{})[e];return M(t)||(delete this.props[eo][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function t5(e){var t;return(null===(t=JSON.stringify(e,function(){let e=[];return function(t,n){if(A(n)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}return n}}()))||void 0===t?void 0:t.length)||0}var t4,t6,t8,t7,t9,ne,nt,nn,nr=((u=nr||{})[u.DomContentLoaded=0]="DomContentLoaded",u[u.Load=1]="Load",u[u.FullSnapshot=2]="FullSnapshot",u[u.IncrementalSnapshot=3]="IncrementalSnapshot",u[u.Meta=4]="Meta",u[u.Custom=5]="Custom",u[u.Plugin=6]="Plugin",u),ni=((c=ni||{})[c.Mutation=0]="Mutation",c[c.MouseMove=1]="MouseMove",c[c.MouseInteraction=2]="MouseInteraction",c[c.Scroll=3]="Scroll",c[c.ViewportResize=4]="ViewportResize",c[c.Input=5]="Input",c[c.TouchMove=6]="TouchMove",c[c.MediaInteraction=7]="MediaInteraction",c[c.StyleSheetRule=8]="StyleSheetRule",c[c.CanvasMutation=9]="CanvasMutation",c[c.Font=10]="Font",c[c.Log=11]="Log",c[c.Drag=12]="Drag",c[c.StyleDeclaration=13]="StyleDeclaration",c[c.Selection=14]="Selection",c[c.AdoptedStyleSheet=15]="AdoptedStyleSheet",c[c.CustomElement=16]="CustomElement",c);function ns(e){return e?W(e).split(/\s+/):[]}function no(e){let t=null==d?void 0:d.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function na(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return ns(t)}function nl(e){return $(e)?null:W(e).split(/(\s+)/).filter(e=>nk(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function nu(e){let t="";return nv(e)&&!ny(e)&&e.childNodes&&e.childNodes.length&&G(e.childNodes,function(e){var n;nf(e)&&e.textContent&&(t+=null!==(n=nl(e.textContent))&&void 0!==n?n:"")}),W(t)}function nc(e){var t;return M(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}function nd(e){return!!e&&1===e.nodeType}function nh(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function nf(e){return!!e&&3===e.nodeType}function np(e){return!!e&&11===e.nodeType}let nm=["a","button","form","input","select","textarea","label"];function ng(e){let t=e.parentNode;return!(!t||!nd(t))&&t}function nv(e){for(let t=e;t.parentNode&&!nh(t,"body");t=t.parentNode){let e=na(t);if(K(e,"ph-sensitive")||K(e,"ph-no-capture"))return!1}if(K(na(e),"ph-include"))return!0;let t=e.type||"";if(L(t))switch(t.toLowerCase()){case"hidden":case"password":return!1}let n=e.name||e.id||"";return!(L(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function ny(e){return!!(nh(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||nh(e,"select")||nh(e,"textarea")||"true"===e.getAttribute("contenteditable"))}let n_="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",nb=RegExp(`^(?:${n_})$`),nw=new RegExp(n_),nS="\\d{3}-?\\d{2}-?\\d{4}",nE=RegExp(`^(${nS})$`),nx=RegExp(`(${nS})`);function nk(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!($(e)||L(e)&&(e=W(e),(t?nb:nw).test((e||"").replace(/[- ]/g,""))||(t?nE:nx).test(e)))}function nT(e){let t=nu(e);return nk(t=`${t} ${(function e(t){let n="";return t&&t.childNodes&&t.childNodes.length&&G(t.childNodes,function(t){var r;if(t&&"span"===(null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase()))try{let r=nu(t);n=`${n} ${r}`.trim(),t.childNodes&&t.childNodes.length&&(n=`${n} ${e(t)}`.trim())}catch(e){B.error(e)}}),n})(e)}`.trim())?t:""}function nO(e){return e.replace(/"|\\"/g,'\\"')}let nI="[SessionRecording]",nC="redacted",nR={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},nA=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],nP=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],nM=["/s/","/e/","/i/"];function nL(e,t,n,r){if($(e))return e;let i=(null==t?void 0:t["content-length"])||new Blob([e]).size;return L(i)&&(i=parseInt(i)),i>n?nI+` ${r} body too large to record (${i} bytes)`:e}function nN(e,t){if($(e))return e;let n=e;return nk(n,!1)||(n=nI+" "+t+" body "+nC),G(nP,e=>{var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=nI+" "+t+" body "+nC+" as might contain: "+e)}),n}let nD=(e,t)=>{let n={payloadSizeLimitBytes:nR.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...nR.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...nR.payloadHostDenyList]},r=!1!==e.session_recording.recordHeaders&&t.recordHeaders,i=!1!==e.session_recording.recordBody&&t.recordBody,s=!1!==e.capture_performance&&t.recordPerformance,o=(e=>{var t;let n=Math.min(1e6,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:1e6);return e=>(null!=e&&e.requestBody&&(e.requestBody=nL(e.requestBody,e.requestHeaders,n,"Request")),null!=e&&e.responseBody&&(e.responseBody=nL(e.responseBody,e.responseHeaders,n,"Response")),e)})(n),a=e=>o((e=>{let t=te(e.name);if(!(t&&t.pathname&&nM.some(e=>0===t.pathname.indexOf(e))))return e})((e=>{let t=e.requestHeaders;return $(t)||G(Object.keys(null!=t?t:{}),e=>{nA.includes(e.toLowerCase())&&(t[e]=nC)}),e})(e))),l=R(e.session_recording.maskNetworkRequestFn);return l&&R(e.session_recording.maskCapturedNetworkRequestFn)&&B.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),l&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{let n=e.session_recording.maskNetworkRequestFn({url:t.name});return{...t,name:null==n?void 0:n.url}}),n.maskRequestFn=R(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,r,i;let s=a(t);return s&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,s))&&void 0!==n?n:void 0}:e=>(function(e){if(!M(e))return e.requestBody=nN(e.requestBody,"Request"),e.responseBody=nN(e.responseBody,"Response"),e})(a(e)),{...nR,...n,recordHeaders:r,recordBody:i,recordPerformance:s,recordInitialRequests:s}};class n${bucketSize=100;refillRate=10;mutationBuckets={};loggedTracker={};constructor(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.rrweb=e,this.options=r,this.refillRate=null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,this.bucketSize=null!==(n=this.options.bucketSize)&&void 0!==n?n:this.bucketSize,setInterval(()=>{this.refillBuckets()},1e3)}refillBuckets=()=>{Object.keys(this.mutationBuckets).forEach(e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]})};getNodeOrRelevantParent=e=>{let t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){let e=t.closest("svg");if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]};numberOfChanges=e=>{var t,n,r,i,s,o,a,l;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(s=null===(o=e.texts)||void 0===o?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)};throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;let t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t,n,r;let[i,s]=this.getNodeOrRelevantParent(e.id);return 0!==this.mutationBuckets[i]&&(this.mutationBuckets[i]=null!==(t=this.mutationBuckets[i])&&void 0!==t?t:this.bucketSize,this.mutationBuckets[i]=Math.max(this.mutationBuckets[i]-1,0),0===this.mutationBuckets[i]&&(this.loggedTracker[i]||(this.loggedTracker[i]=!0,null===(n=(r=this.options).onBlockedNode)||void 0===n||n.call(r,i,s))),e)}));let r=this.numberOfChanges(t);return 0!==r||n===r?e:void 0}}var nj=Uint8Array,nF=Uint16Array,nU=Uint32Array,nq=new nj([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nB=new nj([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),nH=new nj([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nz=function(e,t){for(var n=new nF(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new nU(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},nW=nz(nq,2),nV=nW[0],nG=nW[1];nV[28]=258,nG[258]=28;for(var nQ=nz(nB,0)[1],nK=new nF(32768),nJ=0;nJ<32768;++nJ){var nX=(43690&nJ)>>>1|(21845&nJ)<<1;nX=(61680&(nX=(52428&nX)>>>2|(13107&nX)<<2))>>>4|(3855&nX)<<4,nK[nJ]=((65280&nX)>>>8|(255&nX)<<8)>>>1}var nZ=function(e,t,n){for(var r=e.length,i=0,s=new nF(t);i<r;++i)++s[e[i]-1];var o,a=new nF(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;if(n){o=new nF(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],d=a[e[i]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)o[nK[d]>>>l]=u}else for(o=new nF(r),i=0;i<r;++i)o[i]=nK[a[e[i]-1]++]>>>15-e[i];return o},nY=new nj(288);for(nJ=0;nJ<144;++nJ)nY[nJ]=8;for(nJ=144;nJ<256;++nJ)nY[nJ]=9;for(nJ=256;nJ<280;++nJ)nY[nJ]=7;for(nJ=280;nJ<288;++nJ)nY[nJ]=8;var n0=new nj(32);for(nJ=0;nJ<32;++nJ)n0[nJ]=5;var n1=nZ(nY,9,0),n2=nZ(n0,5,0),n3=function(e){return(e/8>>0)+(7&e&&1)},n5=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof nF?nF:e instanceof nU?nU:nj)(n-t);return r.set(e.subarray(t,n)),r},n4=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},n6=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},n8=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new nj(0),0];if(1==i){var o=new nj(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[d].f?u++:d++],l=n[u!=c&&n[u].f<n[d].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(r=1;r<i;++r)s[r].s>h&&(h=s[r].s);var f=new nF(h+1),p=n7(n[c-1],f,0);if(p>t){r=0;var m=0,g=p-t,v=1<<g;for(s.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r<i;++r){var y=s[r].s;if(!(f[y]>t))break;m+=v-(1<<p-f[y]),f[y]=t}for(m>>>=g;m>0;){var _=s[r].s;f[_]<t?m-=1<<t-f[_]++-1:++r}for(;r>=0&&m;--r){var b=s[r].s;f[b]==t&&(--f[b],++m)}p=t}return[new nj(f),p]},n7=function(e,t,n){return -1==e.s?Math.max(n7(e.l,t,n+1),n7(e.r,t,n+1)):t[e.s]=n},n9=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new nF(++t),r=0,i=e[0],s=1,o=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},re=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},rt=function(e,t,n){var r=n.length,i=n3(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<r;++s)e[i+s+4]=n[s];return 8*(i+4+r)},rn=function(e,t,n,r,i,s,o,a,l,u,c){n4(t,c++,n),++i[256];for(var d=n8(i,15),h=d[0],f=d[1],p=n8(s,15),m=p[0],g=p[1],v=n9(h),y=v[0],_=v[1],b=n9(m),w=b[0],S=b[1],E=new nF(19),x=0;x<y.length;++x)E[31&y[x]]++;for(x=0;x<w.length;++x)E[31&w[x]]++;for(var k=n8(E,7),T=k[0],O=k[1],I=19;I>4&&!T[nH[I-1]];--I);var C,R,A,P,M=u+5<<3,L=re(i,nY)+re(s,n0)+o,N=re(i,h)+re(s,m)+o+14+3*I+re(E,T)+(2*E[16]+3*E[17]+7*E[18]);if(M<=L&&M<=N)return rt(t,c,e.subarray(l,l+u));if(n4(t,c,1+(N<L)),c+=2,N<L){C=nZ(h,f,0),R=h,A=nZ(m,g,0),P=m;var D=nZ(T,O,0);for(n4(t,c,_-257),n4(t,c+5,S-1),n4(t,c+10,I-4),c+=14,x=0;x<I;++x)n4(t,c+3*x,T[nH[x]]);c+=3*I;for(var $=[y,w],j=0;j<2;++j){var F=$[j];for(x=0;x<F.length;++x){var U=31&F[x];n4(t,c,D[U]),c+=T[U],U>15&&(n4(t,c,F[x]>>>5&127),c+=F[x]>>>12)}}}else C=n1,R=nY,A=n2,P=n0;for(x=0;x<a;++x)if(r[x]>255){n6(t,c,C[(U=r[x]>>>18&31)+257]),c+=R[U+257],U>7&&(n4(t,c,r[x]>>>23&31),c+=nq[U]);var q=31&r[x];n6(t,c,A[q]),c+=P[q],q>3&&(n6(t,c,r[x]>>>5&8191),c+=nB[q])}else n6(t,c,C[r[x]]),c+=R[r[x]];return n6(t,c,C[256]),c+R[256]},rr=new nU([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ri=function(){for(var e=new nU(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),rs=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=ri[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},ro=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},ra=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&ro(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}};function rl(e,t){void 0===t&&(t={});var n,r,i,s=rs(),o=e.length;s.p(e);var a=(r=t,i=10+((n=t).filename&&n.filename.length+1||0),function(e,t,n,r,i,s){var o=e.length,a=new nj(r+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(r,a.length-8),u=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d<o?u=rt(l,u,e.subarray(c,d)):(l[c]=s,u=rt(l,u,e.subarray(c,o)))}else{for(var h=rr[t-1],f=h>>>13,p=8191&h,m=(1<<n)-1,g=new nF(32768),v=new nF(m+1),y=Math.ceil(n/3),_=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<_)&m},w=new nU(25e3),S=new nF(288),E=new nF(32),x=0,k=0,T=(c=0,0),O=0,I=0;c<o;++c){var C=b(c),R=32767&c,A=v[C];if(g[R]=A,v[C]=R,O<=c){var P=o-c;if((x>7e3||T>24576)&&P>423){u=rn(e,l,0,w,S,E,k,T,I,c-I,u),T=x=k=0,I=c;for(var M=0;M<286;++M)S[M]=0;for(M=0;M<30;++M)E[M]=0}var L=2,N=0,D=p,$=R-A&32767;if(P>2&&C==b(c-$))for(var j=Math.min(f,P)-1,F=Math.min(32767,c),U=Math.min(258,P);$<=F&&--D&&R!=A;){if(e[c+L]==e[c+L-$]){for(var q=0;q<U&&e[c+q]==e[c+q-$];++q);if(q>L){if(L=q,N=$,q>j)break;var B=Math.min($,q-2),H=0;for(M=0;M<B;++M){var z=c-$+M+32768&32767,W=z-g[z]+32768&32767;W>H&&(H=W,A=z)}}}$+=(R=A)-(A=g[R])+32768&32767}if(N){w[T++]=268435456|nG[L]<<18|nQ[N];var V=31&nG[L],G=31&nQ[N];k+=nq[V]+nB[G],++S[257+V],++E[G],O=c+L,++x}else w[T++]=e[c],++S[e[c]]}}u=rn(e,l,s,w,S,E,k,T,I,c-I,u)}return n5(a,0,r+n3(u)+i)}(e,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+r.mem,i,8,!0)),l=a.length;return ra(a,t),ro(a,l-8,s.d()),ro(a,l-4,o),a}function ru(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new nj(e.length+(e.length>>>1)),i=0,s=function(e){r[i++]=e},o=0;o<n;++o){if(i+5>r.length){var a=new nj(i+8+(n-o<<1));a.set(r),r=a}var l=e.charCodeAt(o);l<128||t?s(l):(l<2048?s(192|l>>>6):(l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63)):s(224|l>>>12),s(128|l>>>6&63)),s(128|63&l))}return n5(r,0,i)}let rc=[ni.MouseMove,ni.MouseInteraction,ni.Scroll,ni.ViewportResize,ni.Input,ni.TouchMove,ni.MediaInteraction,ni.Drag],rd=["trigger_activated","trigger_pending","trigger_disabled"],rh=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}),rf="[SessionRecording]";function rp(e){return function(e,t){for(var n="",r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):n+=String.fromCharCode(55296|(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536)>>10,56320|1023&i)}return n}(rl(ru(JSON.stringify(e))),!0)}function rm(e){return e.type===nr.Custom&&"sessionIdle"===e.data.tag}class rg{queuedRRWebEvents=[];isIdle=!1;_linkedFlagSeen=!1;_lastActivityTimestamp=Date.now();_linkedFlag=null;_removePageViewCaptureHook=void 0;_onSessionIdListener=void 0;_persistDecideOnSessionListener=void 0;_samplingSessionListener=void 0;_urlTriggers=[];_forceAllowLocalhostNetworkCapture=!1;get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==E||null===(e=E.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw Error(rf+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.urlTriggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:3e5}get isSampled(){let e=this.instance.get_property(eb);return F(e)?e:null}get sessionDuration(){var e,t;let n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],{sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return n?n.timestamp-r:null}get isRecordingEnabled(){let e=!!this.instance.get_property(ef),t=!this.instance.config.disable_session_recording;return d&&e&&t}get isConsoleLogCaptureEnabled(){let e=!!this.instance.get_property(ep),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){let e=this.instance.get_property(eg);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}get networkPayloadCapture(){var e,t;let n=this.instance.get_property(em),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),o=A(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(F(o)?o:null==n?void 0:n.capturePerformance);return i||s||a?{recordHeaders:i,recordBody:s,recordPerformance:a}:void 0}get sampleRate(){let e=this.instance.get_property(ev);return j(e)?e:null}get minimumDuration(){let e=this.instance.get_property(ey);return j(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?$(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.urlTriggerStatus?"buffering":F(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e,t,n,r,i,s;if(this.receivedDecide&&0===this._urlTriggers.length)return"trigger_disabled";let o=null===(e=this.instance)||void 0===e?void 0:e.get_property(eS);return(null===(t=this.instance)||void 0===t?void 0:t.get_property(ew))!==this.sessionId?(null===(n=this.instance)||void 0===n||null===(r=n.persistence)||void 0===r||r.unregister(ew),null===(i=this.instance)||void 0===i||null===(s=i.persistence)||void 0===s||s.unregister(eS),"trigger_pending"):rd.includes(o)?o:"trigger_pending"}set urlTriggerStatus(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[ew]:this.sessionId,[eS]:e})}constructor(e){if(this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw B.error(rf+" started without valid sessionManager"),Error(rf+" started without valid sessionManager. This is a bug.");let{sessionId:t,windowId:n}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=n,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&B.warn(rf+` session_idle_threshold_ms (${this.sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this.sessionManager.sessionTimeoutMs}). Session will never be detected as idle`)}_onBeforeUnload=()=>{this._flushBuffer()};_onOffline=()=>{this._tryAddCustomEvent("browser offline",{})};_onOnline=()=>{this._tryAddCustomEvent("browser online",{})};_onVisibilityChange=()=>{if(null!=v&&v.visibilityState){let e="window "+v.visibilityState;this._tryAddCustomEvent(e,{})}};startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),null==d||d.addEventListener("beforeunload",this._onBeforeUnload),null==d||d.addEventListener("offline",this._onOffline),null==d||d.addEventListener("online",this._onOnline),null==d||d.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),$(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook(e=>{try{if("$pageview"===e){let e=d?this._maskUrl(d.location.href):"";if(!e)return;this._tryAddCustomEvent("$pageview",{href:e})}}catch(e){B.error("Could not add $pageview to rrweb session",e)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((e,t,n)=>{var r,i,s,o;n&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:n}),null===(r=this.instance)||void 0===r||null===(i=r.persistence)||void 0===i||i.unregister(ew),null===(s=this.instance)||void 0===s||null===(o=s.persistence)||void 0===o||o.unregister(eS))}))):this.stopRecording()}stopRecording(){var e,t,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==d||d.removeEventListener("beforeunload",this._onBeforeUnload),null==d||d.removeEventListener("offline",this._onOffline),null==d||d.removeEventListener("online",this._onOnline),null==d||d.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._onSessionIdListener)||void 0===t||t.call(this),this._onSessionIdListener=void 0,null===(n=this._samplingSessionListener)||void 0===n||n.call(this),this._samplingSessionListener=void 0,B.info(rf+" stopped"))}makeSamplingDecision(e){var t,n;let r;let i=this.sessionId!==e,s=this.sampleRate;if(!j(s))return void(null===(n=this.instance.persistence)||void 0===n||n.register({[eb]:null}));let o=this.isSampled,a=i||!F(o);r=a?Math.random()<s:o,a&&(r?this._reportStarted("sampling"):B.warn(rf+` Sample rate (${s}) has determined that this sessionId (${e}) will not be sent to the server.`),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:s,isSampled:r})),null===(t=this.instance.persistence)||void 0===t||t.register({[eb]:r})}afterDecideResponse(e){var t,n,r,i;if(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint&&(this._endpoint=null===(i=e.sessionRecording)||void 0===i?void 0:i.endpoint),this._setupSampling(),!$(this._linkedFlag)&&!this._linkedFlagSeen){let e=L(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,t=L(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((n,r)=>{let i=A(r)&&e in r,s=t?r[e]===t:i;if(s){let n={linkedFlag:e,linkedVariant:t},r="linked flag matched";B.info(rf+" "+r,n),this._tryAddCustomEvent(r,n),this._reportStarted("linked_flag_match")}this._linkedFlagSeen=s})}null!==(r=e.sessionRecording)&&void 0!==r&&r.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){j(this.sampleRate)&&$(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(e=>{this.makeSamplingDecision(e)}))}_persistDecideResponse(e){if(this.instance.persistence){var t;let n=this.instance.persistence,r=()=>{var t,r,i,s,o,a,l;let u=null===(t=e.sessionRecording)||void 0===t?void 0:t.sampleRate,c=$(u)?null:parseFloat(u),d=null===(r=e.sessionRecording)||void 0===r?void 0:r.minimumDurationMilliseconds;n.register({[ef]:!!e.sessionRecording,[ep]:null===(i=e.sessionRecording)||void 0===i?void 0:i.consoleLogRecordingEnabled,[em]:{capturePerformance:e.capturePerformance,...null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture},[eg]:{enabled:null===(o=e.sessionRecording)||void 0===o?void 0:o.recordCanvas,fps:null===(a=e.sessionRecording)||void 0===a?void 0:a.canvasFps,quality:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasQuality},[ev]:c,[ey]:M(d)?null:d})};r(),null===(t=this._persistDecideOnSessionListener)||void 0===t||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(r)}}log(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!M(Object.assign)&&!M(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,n;(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)?this._onScriptLoaded():null===(t=E.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"recorder",e=>{if(e)return B.error(rf+" could not load recorder",e);this._onScriptLoaded()}),B.info(rf+" starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}isInteractiveEvent(e){var t;return 3===e.type&&-1!==rc.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}_updateWindowAndSessionIds(e){let t=this.isInteractiveEvent(e);t||this.isIdle||!(e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds)||(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());let n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),this.isIdle)return;let{windowId:r,sessionId:i}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=this.sessionId!==i,o=this.windowId!==r;this.windowId=r,this.sessionId=i,s||o?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):B.warn(rf+" could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(rh(()=>this.rrwebRecord.addCustomEvent(e,t)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(rh(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var e;let t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};for(let[e,n]of Object.entries(this.instance.config.session_recording||{}))e in t&&("maskInputOptions"===e?t.maskInputOptions={password:!0,...n}:t[e]=n);if(this.canvasRecording&&this.canvasRecording.enabled&&(t.recordCanvas=!0,t.sampling={canvas:this.canvasRecording.fps},t.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),!this.rrwebRecord)return void B.error(rf+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.");this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new n$(this.rrwebRecord,{onBlockedNode:(e,t)=>{let n=`Too many mutations on node '${e}'. Rate limiting. This could be due to SVG animations or something similar`;B.info(n,{node:t}),this.log(rf+" "+n,"warn")}});let n=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord({emit:e=>{this.onRRwebEmit(e)},plugins:n,...t}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:t,activePlugins:n.map(e=>null==e?void 0:e.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle)return;let e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},e))}_gatherRRWebPlugins(){var e,t,n,r;let i=[],s=null===(e=E.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;s&&this.isConsoleLogCaptureEnabled&&i.push(s());let o=null===(n=E.__PosthogExtensions__)||void 0===n||null===(r=n.rrwebPlugins)||void 0===r?void 0:r.getRecordNetworkPlugin;return this.networkPayloadCapture&&R(o)&&(!e9.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(o(nD(this.instance.config,this.networkPayloadCapture))):B.info(rf+" NetworkCapture not started because we are on localhost.")),i}onRRwebEmit(e){var t;if(this._processQueuedEvents(),!e||!A(e))return;if(e.type===nr.Meta){let t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();this._checkUrlTrigger(),e.type===nr.FullSnapshot&&this._scheduleFullSnapshot(),e.type===nr.FullSnapshot&&"trigger_pending"===this.urlTriggerStatus&&this.clearBuffer();let n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(!n)return;let r=function(e){if(e&&A(e)&&6===e.type&&A(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));let t=[];for(let n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(n);if(this._updateWindowAndSessionIds(r),this.isIdle&&!rm(r))return;if(rm(r)){let e=r.data.payload;if(e){let t=e.lastActivityTimestamp,n=e.threshold;r.timestamp=t+n}}let i=null===(t=this.instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(1024>t5(e))return e;try{if(e.type===nr.FullSnapshot)return{...e,data:rp(e.data),cv:"2024-10"};if(e.type===nr.IncrementalSnapshot&&e.data.source===ni.Mutation)return{...e,cv:"2024-10",data:{...e.data,texts:rp(e.data.texts),attributes:rp(e.data.attributes),removes:rp(e.data.removes),adds:rp(e.data.adds)}};if(e.type===nr.IncrementalSnapshot&&e.data.source===ni.StyleSheetRule)return{...e,cv:"2024-10",data:{...e.data,adds:rp(e.data.adds),removes:rp(e.data.removes)}}}catch(e){B.error(rf+" could not compress event - will use uncompressed event",e)}return e}(r):r,s={$snapshot_bytes:t5(i),$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(s):this.clearBuffer()}_pageViewFallBack(){if(this.instance.config.capture_pageview||!d)return;let e=this._maskUrl(d.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}_processQueuedEvents(){if(this.queuedRRWebEvents.length){let e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach(e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)})}}_maskUrl(e){let t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n;let r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);let e=this.minimumDuration,t=this.sessionDuration,n=j(t)&&t>=0,r=j(e)&&n&&t<e;return"buffering"===this.status||r?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&(function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(t.size>=n&&t.data.length>1){let n=Math.floor(t.data.length/2),r=t.data.slice(0,n),i=t.data.slice(n);return[e({size:t5(r),data:r,sessionId:t.sessionId,windowId:t.windowId}),e({size:t5(i),data:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(e=>e)}return[t]})(this.buffer).forEach(e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId})}),this.clearBuffer())}_captureSnapshotBuffered(e){var t;let n=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTrigger(){if(void 0===d||!d.location.href)return;let e=d.location.href;this._urlTriggers.some(t=>"regex"===t.matching&&new RegExp(t.url).test(e))&&this._activateUrlTrigger()}_activateUrlTrigger(){"trigger_pending"===this.urlTriggerStatus&&(this.urlTriggerStatus="trigger_activated",this._tryAddCustomEvent("url trigger activated",{}),this._flushBuffer(),B.info(rf+" recording triggered by URL pattern match"))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_override")}overrideSampling(){var e;null===(e=this.instance.persistence)||void 0===e||e.register({[eb]:!0}),this._reportStarted("sampling_override")}_reportStarted(e){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0)()&&this.instance.register_for_session({$session_recording_start_reason:e})}}class rv{constructor(e){this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}call(){let e={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(ek),group_properties:this.instance.get_property(eT),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:e,compression:this.instance.config.disable_compression?void 0:r.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>this.parseDecideResponse(e.json)})}parseDecideResponse(e){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();let t=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},t),t)B.error("Failed to fetch feature flags from PostHog.");else{if(!v||!v.body)return B.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps){if(this.instance.config.opt_in_site_apps)for(let{id:t,url:s}of e.siteApps){var n,r,i;E[`__$$ph_site_app_${t}`]=this.instance,null===(n=E.__PosthogExtensions__)||void 0===n||null===(r=(i=n).loadSiteApp)||void 0===r||r.call(i,this.instance,s,e=>{if(e)return B.error(`Error while initializing PostHog app with config id ${t}`,e)})}else e.siteApps.length>0&&B.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}}let ry=null!=d&&d.location?ti(d.location.hash,"__posthog")||ti(location.hash,"state"):null,r_="_postHogToolbarParams";(t4=nn||(nn={}))[t4.UNINITIALIZED=0]="UNINITIALIZED",t4[t4.LOADING=1]="LOADING",t4[t4.LOADED=2]="LOADED";class rb{constructor(e){this.instance=e}setToolbarState(e){E.ph_toolbar_state=e}getToolbarState(){var e;return null!==(e=E.ph_toolbar_state)&&void 0!==e?e:nn.UNINITIALIZED}maybeLoadToolbar(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!d||!v)return!1;n=null!==(e=n)&&void 0!==e?e:d.location,i=null!==(t=i)&&void 0!==t?t:d.history;try{let e;if(!r){try{d.localStorage.setItem("test","test"),d.localStorage.removeItem("test")}catch{return!1}r=null==d?void 0:d.localStorage}let t=ry||ti(n.hash,"__posthog")||ti(n.hash,"state"),s=t?X(()=>JSON.parse(atob(decodeURIComponent(t))))||X(()=>JSON.parse(decodeURIComponent(t))):null;return s&&"ph_authorize"===s.action?((e=s).source="url",e&&Object.keys(e).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState(i.state,"",n.pathname+n.search):n.hash="")):((e=JSON.parse(r.getItem(r_)||"{}")).source="localstorage",delete e.userIntent),!(!e.token||this.instance.config.token!==e.token)&&(this.loadToolbar(e),!0)}catch{return!1}}_callLoadToolbar(e){(E.ph_load_toolbar||E.ph_load_editor)(e,this.instance)}loadToolbar(e){let t=!(null==v||!v.getElementById(e$));if(!d||t)return!1;let n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r={token:this.instance.config.token,...e,apiURL:this.instance.requestRouter.endpointFor("ui"),...n?{instrument:!1}:{}};if(d.localStorage.setItem(r_,JSON.stringify({...r,source:void 0})),this.getToolbarState()===nn.LOADED)this._callLoadToolbar(r);else if(this.getToolbarState()===nn.UNINITIALIZED){var i,s;this.setToolbarState(nn.LOADING),null===(i=E.__PosthogExtensions__)||void 0===i||null===(s=i.loadExternalDependency)||void 0===s||s.call(i,this.instance,"toolbar",e=>{if(e)return B.error("Failed to load toolbar",e),void this.setToolbarState(nn.UNINITIALIZED);this.setToolbarState(nn.LOADED),this._callLoadToolbar(r)}),en(d,"turbolinks:load",()=>{this.setToolbarState(nn.UNINITIALIZED),this.loadToolbar(r)})}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}class rw{isPaused=!0;queue=[];flushTimeoutMs=3e3;constructor(e){this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();let e=Object.values(this.queue.length>0?this.formatQueue():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.sendRequest({...e,transport:"sendBeacon"})})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){let e=this.formatQueue();for(let t in e){let n=e[t],r=(new Date).getTime();n.data&&C(n.data)&&G(n.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),this.sendRequest(n)}}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){let e={};return G(this.queue,t=>{var n;let r=(t?t.batchKey:null)||t.url;M(e[r])&&(e[r]={...t,data:[]}),null===(n=e[r].data)||void 0===n||n.push(t.data)}),this.queue=[],e}}let rS=!!b||!!_,rE="text/plain",rx=(e,t)=>{let[n,r]=e.split("?"),i={...t};null==r||r.split("&").forEach(e=>{let[t]=e.split("=");delete i[t]});let s=tn(i);return s=s?(r?r+"&":"")+s:r,`${n}?${s}`},rk=e=>{let{data:t,compression:n}=e;if(!t)return;if(n===r.GZipJS){let e=new Blob([rl(ru(JSON.stringify(t)),{mtime:0})],{type:rE});return{contentType:rE,body:e,estimatedSize:e.size}}if(n===r.Base64){let e;let n="data="+encodeURIComponent("string"==typeof(e=function(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n,r,i,s,o,a=0,l=0,u="",c=[];if(!e)return e;e=et(e);do n=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=o>>12&63,i=o>>6&63,s=63&o,c[l++]=t.charAt(n)+t.charAt(r)+t.charAt(i)+t.charAt(s);while(a<e.length);switch(u=c.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(JSON.stringify(t)))?e:JSON.stringify(e));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}let i=JSON.stringify(t);return{contentType:"application/json",body:i,estimatedSize:new Blob([i]).size}},rT=[];b&&rT.push({transport:"XHR",method:e=>{var t;let n=new b;n.open(e.method||"GET",e.url,!0);let{contentType:r,body:i}=null!==(t=rk(e))&&void 0!==t?t:{};G(e.headers,function(e,t){n.setRequestHeader(t,e)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(4===n.readyState){var t;let r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch{}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(i)}}),_&&rT.push({transport:"fetch",method:e=>{var t,n;let{contentType:r,body:i,estimatedSize:s}=null!==(t=rk(e))&&void 0!==t?t:{},o=new Headers;G(e.headers,function(e,t){o.append(t,e)}),r&&o.append("Content-Type",r);let a=e.url,l=null;if(w){let t=new w;l={signal:t.signal,timeout:setTimeout(()=>t.abort(),e.timeout)}}_(a,{method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&65536>(s||0),body:i,signal:null===(n=l)||void 0===n?void 0:n.signal}).then(t=>t.text().then(n=>{var r;let i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){B.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)})).catch(t=>{var n;B.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),null!=g&&g.sendBeacon&&rT.push({transport:"sendBeacon",method:e=>{let t=rx(e.url,{beacon:"1"});try{var n;let{contentType:r,body:i}=null!==(n=rk(e))&&void 0!==n?n:{},s="string"==typeof i?new Blob([i],{type:r}):i;g.sendBeacon(t,s)}catch{}}});class rO{isPolling=!1;pollIntervalMs=3e3;queue=[];constructor(e){this.instance=e,this.queue=[],this.areWeOnline=!0,!M(d)&&"onLine"in d.navigator&&(this.areWeOnline=d.navigator.onLine,d.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),d.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(e){let{retriesPerformedSoFar:t,...n}=e;j(t)&&t>0&&(n.url=rx(n.url,{retry_count:t})),this.instance._send_request({...n,callback:e=>{var r;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.enqueue({retriesPerformedSoFar:t,...n}):null===(r=n.callback)||void 0===r||r.call(n,e)}})}enqueue(e){let t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;let n=function(e){let t=3e3*2**e,n=Math.min(18e5,t),r=(Math.random()-.5)*(n-t/2);return Math.ceil(n+r)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});let i=`Enqueued failed request for retry in ${n}`;navigator.onLine||(i+=" (Browser is offline)"),B.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){let e=Date.now(),t=[],n=this.queue.filter(n=>n.retryAt<e||(t.push(n),!1));if(this.queue=t,n.length>0)for(let{requestOptions:e}of n)this.retriableRequest(e)}unload(){for(let{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request({...e,transport:"sendBeacon"})}catch(e){B.error(e)}this.queue=[]}}class rI{_sessionIdChangedHandlers=[];constructor(e,t,n,r){var i;this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||eJ,this._windowIdGenerator=r||eJ;let s=e.persistence_name||e.token,o=e.session_idle_timeout_seconds||1800;if(j(o)?o>1800?B.warn("session_idle_timeout_seconds cannot be  greater than 30 minutes. Using 30 minutes instead."):o<60&&B.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(B.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),o=1800),this._sessionTimeoutMs=1e3*Math.min(Math.max(o,60),1800),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){let e=e7.parse(this._window_id_storage_key),t=e7.parse(this._primary_window_exists_storage_key);e&&!t?this._windowId=e:e7.remove(this._window_id_storage_key),e7.set(this._primary_window_exists_storage_key,!0)}if(null!==(i=this.config.bootstrap)&&void 0!==i&&i.sessionID)try{let e=(e=>{let t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),e)}catch(e){B.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return M(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(t=>t!==e)}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&e7.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&e7.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?e7.parse(this._window_id_storage_key):null}_setSessionId(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[e_]:[t,e,n]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];let e=this.persistence.props[e_];return C(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==d||d.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&e7.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),[n,r,i]=this._getSessionId(),s=this._getWindowId(),o=j(i)&&i>0&&Math.abs(t-i)>864e5,a=!1,l=!r,u=!e&&Math.abs(t-n)>this.sessionTimeoutMs;l||u||o?(r=this._sessionIdGenerator(),s=this._windowIdGenerator(),B.info("[SessionId] new session ID generated",{sessionId:r,windowId:s,changeReason:{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:o}}),i=t,a=!0):s||(s=this._windowIdGenerator(),a=!0);let c=0===n||!e||o?t:n,d=0===i?(new Date).getTime():i;return this._setWindowId(s),this._setSessionId(r,c,d),a&&this._sessionIdChangedHandlers.forEach(e=>e(r,s,a?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:o}:void 0)),{sessionId:r,windowId:s,sessionStartTimestamp:d,changeReason:a?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:o}:void 0}}}(t6=i||(i={})).US="us",t6.EU="eu",t6.CUSTOM="custom";let rC="i.posthog.com";class rR{_regionCache={};constructor(e){this.instance=e}get apiHost(){let e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e;let t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${rC}`,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=i.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=i.EU:this._regionCache[this.apiHost]=i.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:`/${t}`),"ui"===e)return this.uiHost+t;if(this.region===i.CUSTOM)return this.apiHost+t;let n=rC+t;switch(e){case"assets":return`https://${this.region}-assets.${n}`;case"api":return`https://${this.region}.${n}`}}}let rA="posthog-js";function rP(e){let{organization:t,projectId:n,prefix:r,severityAllowList:i=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s=>{var o,a,l,u,c;if(!("*"===i||i.includes(s.level))||!e.__loaded)return s;s.tags||(s.tags={});let d=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);s.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));let h=(null===(o=s.exception)||void 0===o?void 0:o.values)||[],f={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||s.message,$exception_type:null===(l=h[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:s.level,$exception_list:h,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:(null===(u=h[0])||void 0===u?void 0:u.value)||s.message,$sentry_exception_type:null===(c=h[0])||void 0===c?void 0:c.type,$sentry_tags:s.tags,$level:s.level};return t&&n&&(f.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+s.event_id),e.exceptions.sendExceptionEvent(f),s}}class rM{constructor(e,t,n,r,i){this.name=rA,this.setupOnce=function(s){s(rP(e,{organization:t,projectId:n,prefix:r,severityAllowList:i}))}}}class rL{constructor(e){this._instance=e}doPageView(e){var t;let n=this._previousPageViewProperties(e);return this._currentPath=null!==(t=null==d?void 0:d.location.pathname)&&void 0!==t?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,n}doPageLeave(e){return this._previousPageViewProperties(e)}_previousPageViewProperties(e){let t=this._currentPath,n=this._prevPageviewTimestamp,r=this._instance.scrollManager.getContext();if(!n)return{};let i={};if(r){let{maxScrollHeight:e,lastScrollY:t,maxScrollY:n,maxContentHeight:s,lastContentY:o,maxContentY:a}=r;M(e)||M(t)||M(n)||M(s)||M(o)||M(a)||(e=Math.ceil(e),t=Math.ceil(t),n=Math.ceil(n),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),i={$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:e<=1?1:rN(t/e,0,1),$prev_pageview_max_scroll:n,$prev_pageview_max_scroll_percentage:e<=1?1:rN(n/e,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:s<=1?1:rN(o/s,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:s<=1?1:rN(a/s,0,1)})}return t&&(i.$prev_pageview_pathname=t),n&&(i.$prev_pageview_duration=(e.getTime()-n.getTime())/1e3),i}}function rN(e,t,n){return Math.max(t,Math.min(e,n))}(t8=s||(s={})).Popover="popover",t8.API="api",t8.Widget="widget",(t7=o||(o={})).Open="open",t7.MultipleChoice="multiple_choice",t7.SingleChoice="single_choice",t7.Rating="rating",t7.Link="link",(t9=a||(a={})).NextQuestion="next_question",t9.End="end",t9.ResponseBased="response_based",t9.SpecificQuestion="specific_question";class rD{events={};constructor(){this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(e=>e!==t)}}emit(e,t){for(let n of this.events[e]||[])n(t);for(let n of this.events["*"]||[])n(e,t)}}class r${_debugEventEmitter=new rD;constructor(e){this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e,t;M(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)||null===(t=this.instance)||void 0===t||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,n,r;if(!M(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,n;null===(t=this.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach(e=>{var t;null===(t=this.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")})}),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){let t=new Set;e.forEach(e=>{var n;null===(n=e.steps)||void 0===n||n.forEach(e=>{null!=e&&e.selector&&t.add(null==e?void 0:e.selector)})}),null===(r=this.instance)||void 0===r||r.autocapture.setElementSelectors(t)}}on(e,t){var n;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach(e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)})}_addActionHook(e){this.onAction("actionCaptured",t=>e(t))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(let n of t.steps)if(this.checkStep(e,n))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStep=(e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t);checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event);checkStepUrl(e,t){if(null!=t&&t.url){var n;let r=null==e||null===(n=e.properties)||void 0===n?void 0:n.$current_url;if(!r||"string"!=typeof r||!r$.matchString(r,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,n){switch(n){case"regex":return!!d&&tt(e,t);case"exact":return t===e;case"contains":return tt(e,r$.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.getElementsList(e).some(e=>!(null!=t&&t.href&&!r$.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&(null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!r$.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!r$.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))return!1;if(null!=t&&t.selector){var n;let r=null==e||null===(n=e.properties)||void 0===n?void 0:n.$element_selectors;if(!r||!r.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class rj{static SURVEY_SHOWN_EVENT_NAME="survey shown";constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;M(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){let t=e.filter(e=>{var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(r=n.actions)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0});0!==t.length&&(null==this.actionMatcher&&(this.actionMatcher=new r$(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(e=>{this.onAction(e)})),t.forEach(e=>{var t,n,r,i,s,o,a,l,u,c;e.conditions&&null!==(t=e.conditions)&&void 0!==t&&t.actions&&null!==(n=e.conditions)&&void 0!==n&&null!==(r=n.actions)&&void 0!==r&&r.values&&(null===(i=e.conditions)||void 0===i||null===(s=i.actions)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0&&(null===(a=this.actionMatcher)||void 0===a||a.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(u=l.actions)||void 0===u||null===(c=u.values)||void 0===c||c.forEach(t=>{if(t&&t.name){let n=this.actionToSurveys.get(t.name);n&&n.push(e.id),this.actionToSurveys.set(t.name,n||[e.id])}}))}))}setupEventBasedSurveys(e){var t;0!==e.filter(e=>{var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0}).length&&(null===(t=this.instance)||void 0===t||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),e.forEach(e=>{var t,n,r;null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r||r.forEach(t=>{if(t&&t.name){let n=this.eventToSurveys.get(t.name);n&&n.push(e.id),this.eventToSurveys.set(t.name,n||[e.id])}})}))}onEvent(e,t){var n,r,i;let s=(null===(n=this.instance)||void 0===n||null===(r=n.persistence)||void 0===r?void 0:r.props[eI])||[];if(rj.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){let e=null==t||null===(i=t.properties)||void 0===i?void 0:i.$survey_id;if(e){let t=s.indexOf(e);t>=0&&(s.splice(t,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,n;let r=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[eI])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register({[eI]:[...new Set(e)]})}getSurveys(){var e,t;return(null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[eI])||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}let rF="[Surveys]",rU={icontains:e=>!!d&&d.location.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:e=>!!d&&-1===d.location.href.toLowerCase().indexOf(e.toLowerCase()),regex:e=>!!d&&tt(d.location.href,e),not_regex:e=>!!d&&!tt(d.location.href,e),exact:e=>(null==d?void 0:d.location.href)===e,is_not:e=>(null==d?void 0:d.location.href)!==e};class rq{constructor(e){this.instance=e,this._surveyEventReceiver=null}afterDecideResponse(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}loadIfEnabled(){var e,t,n;let r=null==E||null===(e=E.__PosthogExtensions__)||void 0===e?void 0:e.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||r||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new rj(this.instance)),null===(t=E.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"surveys",e=>{var t,n;if(e)return B.error(rF,"Could not load surveys script",e);this._surveyManager=null===(t=E.__PosthogExtensions__)||void 0===t||null===(n=t.generateSurveys)||void 0===n?void 0:n.call(t,this.instance)}))}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new rj(this.instance));let n=this.instance.get_property(eO);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/surveys/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>{var n,r;if(200!==t.statusCode||!t.json)return e([]);let i=t.json.surveys||[],s=i.filter(e=>{var t,n,r,i,s,o,a,l,u,c,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(i=e.conditions)||void 0===i||null===(s=i.events)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(u=l.actions)||void 0===u?void 0:u.values)&&(null===(c=e.conditions)||void 0===c||null===(d=c.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0});return s.length>0&&(null===(r=this._surveyEventReceiver)||void 0===r||r.register(s)),null===(n=this.instance.persistence)||void 0===n||n.register({[eO]:i}),e(i)}})}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys(t=>{var n;let r=t.filter(e=>!(!e.start_date||e.end_date)).filter(e=>{var t,n,r,i;if(!e.conditions)return!0;let s=null===(t=e.conditions)||void 0===t||!t.url||rU[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),o=null===(i=e.conditions)||void 0===i||!i.selector||(null==v?void 0:v.querySelector(e.conditions.selector));return s&&o}),i=null===(n=this._surveyEventReceiver)||void 0===n?void 0:n.getSurveys();return e(r.filter(e=>{var t,n,r,s,o,a,l,u,c,d;if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;let h=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),f=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),p=(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(s=e.conditions)||void 0===s||null===(o=s.events)||void 0===o?void 0:o.values.length)>0,m=(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(u=l.actions)||void 0===u?void 0:u.values)&&(null===(c=e.conditions)||void 0===c||null===(d=c.actions)||void 0===d?void 0:d.values.length)>0,g=!p&&!m||(null==i?void 0:i.includes(e.id)),v=this._canActivateRepeatedly(e),y=!(e.internal_targeting_flag_key&&!v)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return h&&f&&y&&g}))},t)}getNextSurveyStep(e,t,n){var r,i,s,l,u;let c=e.questions[t],d=t+1;if(null===(r=c.branching)||void 0===r||!r.type)return t===e.questions.length-1?a.End:d;if(c.branching.type===a.End)return a.End;if(c.branching.type===a.SpecificQuestion){if(Number.isInteger(c.branching.index))return c.branching.index}else if(c.branching.type===a.ResponseBased){if(c.type===o.SingleChoice){let e=c.choices.indexOf(`${n}`);if(null!==(i=c.branching)&&void 0!==i&&null!==(s=i.responseValues)&&void 0!==s&&s.hasOwnProperty(e)){let t=c.branching.responseValues[e];return Number.isInteger(t)?t:t===a.End?a.End:d}}else if(c.type===o.Rating){if("number"!=typeof n||!Number.isInteger(n))throw Error("The response type must be an integer");let e=function(e,t){if(3===t){if(e<1||e>3)throw Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw Error("The scale must be one of: 3, 5, 7, 10")}(n,c.scale);if(null!==(l=c.branching)&&void 0!==l&&null!==(u=l.responseValues)&&void 0!==u&&u.hasOwnProperty(e)){let t=c.branching.responseValues[e];return Number.isInteger(t)?t:t===a.End?a.End:d}}return d}return B.warn(rF,"Falling back to next question index due to unexpected branching type"),d}_canActivateRepeatedly(e){var t;return $(null===(t=E.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(B.warn(rF,"canActivateRepeatedly is not defined, must init before calling"),!1):E.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){$(this._surveyManager)?B.warn(rF,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(t=>{let n=t.filter(t=>t.id===e)[0];this._surveyManager.canRenderSurvey(n)})}renderSurvey(e,t){$(this._surveyManager)?B.warn(rF,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(n=>{let r=n.filter(t=>t.id===e)[0];this._surveyManager.renderSurvey(r,null==v?void 0:v.querySelector(t))})}}class rB{serverLimits={};lastEventRateLimited=!1;constructor(e){var t,n;this.instance=e,this.captureEventsPerSecond=(null===(t=e.config.rate_limiting)||void 0===t?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(n=e.config.rate_limiting)||void 0===n?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,n;let r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),s=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(eP))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};s.tokens+=(i-s.last)/1e3*this.captureEventsPerSecond,s.last=i,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);let o=s.tokens<1;return o||r||(s.tokens=Math.max(0,s.tokens-1)),!o||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to ${this.captureEventsPerSecond} events per second and ${this.captureEventsBurstLimit} events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null===(n=this.instance.persistence)||void 0===n||n.set_property(eP,s),{isRateLimited:o,remainingTokens:s.tokens}}isServerRateLimited(e){let t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}checkForLimiting=e=>{let t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{B.info(`[RateLimiter] ${e||"events"} is quota limited.`),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void B.warn(`[RateLimiter] could not rate limit - continuing. Error: "${null==e?void 0:e.message}"`,{text:t})}}}let rH=()=>({initialPathName:(null==y?void 0:y.pathname)||"",referringDomain:t1.referringDomain(),...t1.campaignParams()});class rz{constructor(e,t,n){this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=n||rH,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[eA]}_onSessionIdCallback=e=>{let t=this._getStoredProps();if(t&&t.sessionId===e)return;let n={sessionId:e,props:this._sessionSourceParamGenerator()};this._persistence.register({[eA]:n})};getSessionProps(){var e;let t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}let rW=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],rV=function(e,t){if(!e)return!1;let n=e.toLowerCase();return rW.concat(t||[]).some(e=>{let t=e.toLowerCase();return -1!==n.indexOf(t)})},rG=function(e,t){if(!e)return!1;let n=e.userAgent;if(n&&rV(n,t))return!0;try{let n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some(e=>rV(null==e?void 0:e.brand,t)))return!0}catch{}return!!e.webdriver};class rQ{constructor(){this.clicks=[]}isRageClick(e,t,n){let r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}function rK(e){var t;return e.id===e$||!(null===(t=e.closest)||void 0===t||!t.call(e,"#"+e$))}class rJ{rageclicks=new rQ;_enabledServerSide=!1;_initialized=!1;_flushInterval=null;constructor(e){var t;this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[el]),null==d||d.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){let e=5e3;return A(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return M(this.instance.config.capture_heatmaps)?M(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this._initialized||(B.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds));else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this.getAndClearBuffer()}}afterDecideResponse(e){let t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[el]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){let e=this.buffer;return this.buffer=void 0,e}_setupListeners(){d&&v&&(en(v,"click",e=>this._onClick(e||(null==d?void 0:d.event)),!1,!0),en(v,"mousemove",e=>this._onMouseMove(e||(null==d?void 0:d.event)),!1,!0),this._initialized=!0)}_getProperties(e,t){let n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=function(e,t,n){let r=e;for(;r&&nd(r)&&!nh(r,"body")&&r!==n;){if(K(t,null==d?void 0:d.getComputedStyle(r).position))return!0;r=ng(r)}return!1}(nc(e),["fixed","sticky"],i);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}_onClick(e){var t;if(rK(e.target))return;let n=this._getProperties(e,"click");null!==(t=this.rageclicks)&&void 0!==t&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture({...n,type:"rageclick"}),this._capture(n)}_onMouseMove(e){rK(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(e,"mousemove"))},500))}_capture(e){if(!d)return;let t=d.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}flush(){this.buffer&&!P(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class rX{constructor(e){this.instance=e}getContext(){return this.context}resetContext(){let e=this.context;return setTimeout(this._updateScrollData,0),e}_updateScrollData=()=>{var e,t,n,r;this.context||(this.context={});let i=this.scrollElement(),s=this.scrollY(),o=i?Math.max(0,i.scrollHeight-i.clientHeight):0,a=s+((null==i?void 0:i.clientHeight)||0),l=(null==i?void 0:i.scrollHeight)||0;this.context.lastScrollY=Math.ceil(s),this.context.maxScrollY=Math.max(s,null!==(e=this.context.maxScrollY)&&void 0!==e?e:0),this.context.maxScrollHeight=Math.max(o,null!==(t=this.context.maxScrollHeight)&&void 0!==t?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!==(n=this.context.maxContentY)&&void 0!==n?n:0),this.context.maxContentHeight=Math.max(l,null!==(r=this.context.maxContentHeight)&&void 0!==r?r:0)};startMeasuringScrollPosition(){null==d||d.addEventListener("scroll",this._updateScrollData,!0),null==d||d.addEventListener("scrollend",this._updateScrollData,!0),null==d||d.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==d?void 0:d.document.documentElement;for(let e of C(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]){let t=null==d?void 0:d.document.querySelector(e);if(t)return t}}scrollY(){if(this.instance.config.scroll_root_selector){let e=this.scrollElement();return e&&e.scrollTop||0}return d&&(d.scrollY||d.pageYOffset||d.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){let e=this.scrollElement();return e&&e.scrollLeft||0}return d&&(d.scrollX||d.pageXOffset||d.document.documentElement.scrollLeft)||0}}let rZ="$copy_autocapture";function rY(e,t){return t.length>e?t.slice(0,e)+"...":t}class r0{_initialized=!1;_isDisabledServerSide=null;rageclicks=new rQ;_elementsChainAsString=!1;constructor(e){this.instance=e,this._elementSelectors=null}get config(){var e,t;let n=A(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map(e=>new RegExp(e)),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map(e=>new RegExp(e)),n}_addDomEventHandlers(){if(!this.isBrowserSupported())return void B.info("Disabling Automatic Event Collection because this browser is not supported");if(!d||!v)return;let e=e=>{e=e||(null==d?void 0:d.event);try{this._captureEvent(e)}catch(e){B.error("Failed to capture event",e)}},t=e=>{e=e||(null==d?void 0:d.event),this._captureEvent(e,rZ)};en(v,"submit",e,!1,!0),en(v,"change",e,!1,!0),en(v,"click",e,!1,!0),this.config.capture_copied_text&&(en(v,"copy",t,!1,!0),en(v,"cut",t,!1,!0))}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ea]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t;let n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach(t=>{let r=null==v?void 0:v.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&n.push(t)})}),n}get isEnabled(){var e,t;let n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[ea];if(D(this._isDisabledServerSide)&&!F(n)&&!this.instance.config.advanced_disable_decide)return!1;let r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}_previousElementSibling(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!nd(t));return t}_getAugmentPropertiesFromElement(e){if(!nv(e))return{};let t={};return G(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){let n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&nk(r)&&(t[n]=r)}}),t}_getPropertiesFromElement(e,t,n){var r;let i=e.tagName.toLowerCase(),s={tag_name:i};nm.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?s.$el_text=rY(1024,nT(e)):s.$el_text=rY(1024,nu(e)));let o=na(e);o.length>0&&(s.classes=o.filter(function(e){return""!==e}));let a=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;G(e.attributes,function(n){var r;if((!ny(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==a||!a.includes(n.name))&&!t&&nk(n.value)&&(!L(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){let e=n.value;"class"===n.name&&(e=ns(e).join(" ")),s["attr__"+n.name]=rY(1024,e)}});let l=1,u=1,c=e;for(;c=this._previousElementSibling(c);)l++,c.tagName===e.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}_getDefaultProperties(e){return{$event_type:e,$ce_version:1}}_captureEvent(e){var t,n,r,i,s,o;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(!this.isEnabled)return;let l=nc(e);nf(l)&&(l=l.parentNode||null),"$autocapture"===a&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!==(t=this.rageclicks)&&void 0!==t&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");let u=a===rZ;if(l&&function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!d||!e||nh(e,"html")||!nd(e)||null!=n&&n.url_allowlist&&!no(n.url_allowlist)||null!=n&&n.url_ignorelist&&no(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){let e=n.dom_event_allowlist;if(e&&!e.some(e=>t.type===e))return!1}let s=!1,o=[e],a=!0,l=e;for(;l.parentNode&&!nh(l,"body");)if(np(l.parentNode))o.push(l.parentNode.host),l=l.parentNode.host;else{if(!(a=ng(l)))break;if(r||nm.indexOf(a.tagName.toLowerCase())>-1)s=!0;else{let e=d.getComputedStyle(a);e&&"pointer"===e.getPropertyValue("cursor")&&(s=!0)}o.push(a),l=a}if(!function(e,t){let n=null==t?void 0:t.element_allowlist;if(M(n))return!0;for(let t of e)if(n.some(e=>t.tagName.toLowerCase()===e))return!0;return!1}(o,n)||!function(e,t){let n=null==t?void 0:t.css_selector_allowlist;if(M(n))return!0;for(let t of e)if(n.some(e=>t.matches(e)))return!0;return!1}(o,n))return!1;let u=d.getComputedStyle(e);if(u&&"pointer"===u.getPropertyValue("cursor")&&"click"===t.type)return!0;let c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return s?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(nm.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(l,e,this.config,u,u?["copy","cut"]:void 0)){let t=[l],u=l;for(;u.parentNode&&!nh(u,"body");)np(u.parentNode)?(t.push(u.parentNode.host),u=u.parentNode.host):(t.push(u.parentNode),u=u.parentNode);let c=[],h={},f,p,m=!1;if(G(t,e=>{let t=nv(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=t&&nk(f)&&f),K(na(e),"ph-no-capture")&&(m=!0),c.push(this._getPropertiesFromElement(e,this.instance.config.mask_all_element_attributes,this.instance.config.mask_all_text)),Q(h,this._getAugmentPropertiesFromElement(e))}),this.instance.config.mask_all_text||("a"===l.tagName.toLowerCase()||"button"===l.tagName.toLowerCase()?c[0].$el_text=nT(l):c[0].$el_text=nu(l)),f){c[0].attr__href=f;let e=null===(i=te(f))||void 0===i?void 0:i.host,t=null==d||null===(s=d.location)||void 0===s?void 0:s.host;e&&t&&e!==t&&(p=f)}if(m)return!1;let g=Q(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:c.map(e=>{var t,n;let r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:function(e){let t=e.attr__class;return t?C(t)?t:ns(t):void 0}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return J(e).filter(e=>{let[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{let[t,n]=e;return r.attributes[t]=n}),r}).map(e=>{var t,n;let r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(let t of(e.attr_class.sort(),e.attr_class))r+=`.${t.replace(/"/g,"")}`;let i={...e.text?{text:e.text}:{},"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0,...e.href?{href:e.href}:{},...e.attr_id?{attr_id:e.attr_id}:{},...e.attributes},s={};return J(i).sort((e,t)=>{let[n]=e,[r]=t;return n.localeCompare(r)}).forEach(e=>{let[t,n]=e;return s[nO(t.toString())]=nO(n.toString())}),r+=":"+J(i).map(e=>{let[t,n]=e;return`${t}="${n}"`}).join("")}).join(";")}:{$elements:c},null!==(n=c[0])&&void 0!==n&&n.$el_text?{$el_text:null===(r=c[0])||void 0===r?void 0:r.$el_text}:{},p&&"click"===e.type?{$external_click_url:p}:{},h),v=this.getElementSelectors(l);if(v&&v.length>0&&(g.$element_selectors=v),a===rZ){let t=nl(null==d||null===(o=d.getSelection())||void 0===o?void 0:o.toString()),n=e.type||"clipboard";if(!t)return!1;g.$selected_content=t,g.$copy_type=n}return this.instance.capture(a,g),!0}}isBrowserSupported(){return R(null==v?void 0:v.querySelectorAll)}}class r1{_restoreXHRPatch=void 0;_restoreFetchPatch=void 0;constructor(e){this.instance=e}_loadScript(e){var t,n,r;null!==(t=E.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(n=E.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"tracing-headers",t=>{if(t)return B.error("[TRACING-HEADERS] failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}_startCapturing=()=>{var e,t,n,r;M(this._restoreXHRPatch)&&(null===(e=E.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager)),M(this._restoreFetchPatch)&&(null===(n=E.__PosthogExtensions__)||void 0===n||null===(r=n.tracingHeadersPatchFns)||void 0===r||r._patchFetch(this.instance.sessionManager))}}(ne=l||(l={}))[ne.PENDING=-1]="PENDING",ne[ne.DENIED=0]="DENIED",ne[ne.GRANTED=1]="GRANTED";class r2{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?l.DENIED:this.storedConsent}isOptedOut(){return this.consent===l.DENIED||this.consent===l.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){let{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){let e=this.storage.get(this.storageKey);return"1"===e?l.GRANTED:"0"===e?l.DENIED:l.PENDING}get storage(){if(!this._storage){let e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?e2:e0;let t="localStorage"===e?e0:e2;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!er([null==g?void 0:g.doNotTrack,null==g?void 0:g.msDoNotTrack,E.doNotTrack],e=>K([!0,1,"1","yes"],e))}}let r3="[Exception Autocapture]";class r5{originalOnUnhandledRejectionHandler=void 0;constructor(e){var t;this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[eu]),this.startIfEnabled()}get isEnabled(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}get isCapturing(){var e;return!(null==d||null===(e=d.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(B.info(r3+" enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,n;this.hasHandlers&&e(),null===(t=E.__PosthogExtensions__)||void 0===t||null===(n=t.loadExternalDependency)||void 0===n||n.call(t,this.instance,"exception-autocapture",t=>{if(t)return B.error(r3+" failed to load script",t);e()})}startCapturing=()=>{var e,t,n,r;if(!d||!this.isEnabled||this.hasHandlers||this.isCapturing)return;let i=null===(e=E.__PosthogExtensions__)||void 0===e||null===(t=e.errorWrappingFunctions)||void 0===t?void 0:t.wrapOnError,s=null===(n=E.__PosthogExtensions__)||void 0===n||null===(r=n.errorWrappingFunctions)||void 0===r?void 0:r.wrapUnhandledRejection;if(i&&s)try{this.unwrapOnError=i(this.captureException.bind(this)),this.unwrapUnhandledRejection=s(this.captureException.bind(this))}catch(e){B.error(r3+" failed to start",e),this.stopCapturing()}else B.error(r3+" failed to load error wrapping functions - cannot start")};stopCapturing(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}afterDecideResponse(e){let t=e.autocaptureExceptions;this.remoteEnabled=!!t,this.instance.persistence&&this.instance.persistence.register({[eu]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){let t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL=`${t}/project/${this.instance.config.token}/person/${this.instance.get_distinct_id()}`,this.instance.exceptions.sendExceptionEvent(e)}}let r4="[Web Vitals]";class r6{_enabledServerSide=!1;_initialized=!1;buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0};constructor(e){var t;this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ed]),this.startIfEnabled()}get allowedMetrics(){var e,t;let n=A(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return M(n)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[eh])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(A(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){let e=A(this.instance.config.capture_performance)&&j(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){let e=A(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return F(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(B.info(r4+" enabled, starting..."),this.loadScript(this._startCapturing))}afterDecideResponse(e){let t=A(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=A(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[ed]:t}),this.instance.persistence.register({[eh]:n})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,n,r;null!==(t=E.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(n=E.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this.instance,"web-vitals",t=>{t?B.error(r4+" failed to load script",t):e()})}_currentURL(){let e=d?d.location.href:void 0;return e||B.error(r4+"Could not determine current URL"),e}_flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((e,t)=>({...e,[`$web_vitals_${t.name}_event`]:{...t},[`$web_vitals_${t.name}_value`]:t.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})};_addToBuffer=e=>{var t;let n=null===(t=this.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);if(M(n))return void B.error(r4+"Could not read session ID. Dropping metrics!");this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};let r=this._currentURL();if(!M(r)){if($(null==e?void 0:e.name)||$(null==e?void 0:e.value))return void B.error(r4+"Invalid metric received",e);if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)return void B.error(r4+"Ignoring metric with value >= "+this._maxAllowedValue,e);this.buffer.url!==r&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),M(this.buffer.url)&&(this.buffer.url=r),this.buffer.firstMetricTimestamp=M(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push({...e,$current_url:r,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()}),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}};_startCapturing=()=>{let e,t,n,r;let i=E.__PosthogExtensions__;M(i)||M(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this._addToBuffer.bind(this)),this._initialized=!0):B.error(r4+"web vitals callbacks not loaded - not starting")}}let r8={icontains:(e,t)=>!!d&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!d&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!d&&tt(t.href,e),not_regex:(e,t)=>!!d&&!tt(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class r7{constructor(e){this.instance=e,this.instance.onFeatureFlags&&this.instance.onFeatureFlags(e=>{this.applyFeatureFlagChanges(e)}),this._flagToExperiments=new Map}applyFeatureFlagChanges(e){$(this._flagToExperiments)||this.instance.config.disable_web_experiments||(r7.logInfo("applying feature flags",e),e.forEach(e=>{var t,n;if(this._flagToExperiments&&null!==(t=this._flagToExperiments)&&void 0!==t&&t.has(e)){let t=this.instance.getFeatureFlag(e),r=null===(n=this._flagToExperiments)||void 0===n?void 0:n.get(e);t&&null!=r&&r.variants[t]&&this.applyTransforms(r.name,t,r.variants[t].transforms)}}))}afterDecideResponse(e){this._is_bot()?r7.logInfo("Refusing to render web experiment since the viewer is a likely bot"):(this._featureFlags=e.featureFlags,this.loadIfEnabled(),this.previewWebExperiment())}previewWebExperiment(){let e=r7.getWindowLocation();if(null!=e&&e.search){let t=tr(null==e?void 0:e.search,"__experiment_id"),n=tr(null==e?void 0:e.search,"__experiment_variant");t&&n&&(r7.logInfo(`previewing web experiments ${t} && ${n}`),this.getWebExperiments(e=>{this.showPreviewWebExperiment(parseInt(t),n,e)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperimentsAndEvaluateDisplayLogic=(()=>{var e=this;return function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.getWebExperiments(t=>{r7.logInfo("retrieved web experiments from the server"),e._flagToExperiments=new Map,t.forEach(t=>{if(t.feature_flag_key&&e._featureFlags&&e._featureFlags[t.feature_flag_key]){var n;e._flagToExperiments&&(r7.logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null===(n=e._flagToExperiments)||void 0===n||n.set(t.feature_flag_key,t));let r=e._featureFlags[t.feature_flag_key];r&&t.variants[r]&&e.applyTransforms(t.name,r,t.variants[r].transforms)}else if(t.variants)for(let n in t.variants){let r=t.variants[n];r7.matchesTestVariant(r)&&e.applyTransforms(t.name,n,r.transforms)}})},t)}})();getWebExperiments(e,t,n){if(this.instance.config.disable_web_experiments&&!n)return e([]);let r=this.instance.get_property("$web_experiments");if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}showPreviewWebExperiment(e,t,n){let r=n.filter(t=>t.id===e);r&&r.length>0&&(r7.logInfo(`Previewing web experiment [${r[0].name}] with variant [${t}]`),this.applyTransforms(r[0].name,t,r[0].variants[t].transforms,!0))}static matchesTestVariant(e){return!$(e.conditions)&&r7.matchUrlConditions(e)&&r7.matchUTMConditions(e)}static matchUrlConditions(e){var t,n,r,i;if($(e.conditions)||$(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;let s=r7.getWindowLocation();return!!s&&(null===(n=e.conditions)||void 0===n||!n.url||r8[null!==(r=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,s))}static getWindowLocation(){return null==d?void 0:d.location}static matchUTMConditions(e){var t,n,r,i,s,o,a,l,u,c,d,h,f,p,m,g,v;if($(e.conditions)||$(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;let y=t1.campaignParams();if(y.utm_source){let t=null===(n=e.conditions)||void 0===n||null===(r=n.utm)||void 0===r||!r.utm_campaign||(null===(i=e.conditions)||void 0===i||null===(s=i.utm)||void 0===s?void 0:s.utm_campaign)==y.utm_campaign,_=null===(o=e.conditions)||void 0===o||null===(a=o.utm)||void 0===a||!a.utm_source||(null===(l=e.conditions)||void 0===l||null===(u=l.utm)||void 0===u?void 0:u.utm_source)==y.utm_source,b=null===(c=e.conditions)||void 0===c||null===(d=c.utm)||void 0===d||!d.utm_medium||(null===(h=e.conditions)||void 0===h||null===(f=h.utm)||void 0===f?void 0:f.utm_medium)==y.utm_medium,w=null===(p=e.conditions)||void 0===p||null===(m=p.utm)||void 0===m||!m.utm_term||(null===(g=e.conditions)||void 0===g||null===(v=g.utm)||void 0===v?void 0:v.utm_term)==y.utm_term;return t&&b&&w&&_}return!1}static logInfo(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];B.info(`[WebExperiments] ${e}`,n)}applyTransforms(e,t,n,r){var i;this._is_bot()?r7.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?n.forEach(n=>{if(n.selector){var i,s;r7.logInfo(`applying transform of variant ${t} for experiment ${e} `,n);let o=0,a=null===(i=document)||void 0===i?void 0:i.querySelectorAll(n.selector);null==a||a.forEach(e=>{o+=1,n.attributes&&n.attributes.forEach(t=>{switch(t.name){case"text":e.innerText=t.value;break;case"html":e.innerHTML=t.value;break;case"cssClass":e.className=t.value;break;default:e.setAttribute(t.name,t.value)}}),n.text&&(e.innerText=n.text),n.html&&(e.parentElement?e.parentElement.innerHTML=n.html:e.innerHTML=n.html),n.css&&e.setAttribute("style",n.css)}),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_variant:t,$web_experiment_preview:r,$web_experiment_document_url:null===(s=r7.getWindowLocation())||void 0===s?void 0:s.href,$web_experiment_elements_modified:o})}}):(r7.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:e,$web_experiment_preview:r,$web_experiment_variant:t,$web_experiment_document_url:null===(i=r7.getWindowLocation())||void 0===i?void 0:i.href,$web_experiment_elements_modified:0}))}_is_bot(){return g&&this.instance?rG(g,this.instance.config.custom_blocked_useragents):void 0}}class r9{constructor(e){var t;this.instance=e,this._endpointSuffix=(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[ec])||"/e/"}get endpoint(){return this.instance.requestRouter.endpointFor("api",this._endpointSuffix)}afterDecideResponse(e){let t=e.autocaptureExceptions;this._endpointSuffix=A(t)&&t.endpoint||"/e/",this.instance.persistence&&this.instance.persistence.register({[ec]:this._endpointSuffix})}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}let ie={},it=()=>{},ir="posthog",ii=!rS&&-1===(null==S?void 0:S.indexOf("MSIE"))&&-1===(null==S?void 0:S.indexOf("Mozilla")),is=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:function(e){let t=null==e?void 0:e.hostname;return!!L(t)&&"herokuapp.com"!==t.split(".").slice(-2).join(".")}(null==v?void 0:v.location),persistence:"localStorage+cookie",persistence_name:"",loaded:it,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:y&&L(null==y?void 0:y.search)&&-1!==y.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==d||null===(e=d.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{let t="Bad HTTP status: "+e.statusCode+" "+e.text;B.error(t)},get_device_id:e=>e,_onCapture:it,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1}},io=e=>{let t={};M(e.process_person)||(t.person_profiles=e.process_person),M(e.xhr_headers)||(t.request_headers=e.xhr_headers),M(e.cookie_name)||(t.persistence_name=e.cookie_name),M(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);let n=Q({},t,e);return C(e.property_blacklist)&&(M(e.property_denylist)?n.property_denylist=e.property_blacklist:C(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:B.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class ia{get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){B.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}__forceAllowLocalhost=!1}class il{webPerformance=new ia;version=x.LIB_VERSION;_internalEventEmitter=new rD;constructor(){this.config=is(),this.decideEndpointWasHit=!1,this.SentryIntegration=rM,this.sentryIntegration=e=>(function(e,t){let n=rP(e,t);return{name:rA,processEvent:e=>n(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new eH(this),this.toolbar=new rb(this),this.scrollManager=new rX(this),this.pageViewManager=new rL(this),this.surveys=new rq(this),this.experiments=new r7(this),this.exceptions=new r9(this),this.rateLimiter=new rB(this),this.requestRouter=new rR(this),this.consent=new r2(this),this.people={set:(e,t,n)=>{let r=L(e)?{[e]:t}:e;this.setPersonProperties(r),null==n||n({})},set_once:(e,t,n)=>{let r=L(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==n||n({})}},this.on("eventCaptured",e=>B.info(`send "${null==e?void 0:e.event}"`,e))}init(e,t,n){if(n&&n!==ir){var r;let i=null!==(r=ie[n])&&void 0!==r?r:new il;return i._init(e,t,n),ie[n]=i,ie[ir][n]=i,i}return this._init(e,t,n)}_init(e){var t,n,i,s,o,a;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=arguments.length>2?arguments[2]:void 0;if(M(e)||N(e))return B.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return B.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],l.person_profiles&&(this._initialPersonProfilesConfig=l.person_profiles),this.set_config(Q({},is(),io(l),{name:u,token:e})),this.config.on_xhr_error&&B.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=l.disable_compression?void 0:r.GZipJS,this.persistence=new t3(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new t3({...this.config,persistence:"sessionStorage"});let c={...this.persistence.props},h={...this.sessionPersistence.props};if(this._requestQueue=new rw(e=>this._send_retriable_request(e)),this._retryQueue=new rO(this),this.__request_queue=[],this.sessionManager=new rI(this.config,this.persistence),this.sessionPropsManager=new rz(this.sessionManager,this.persistence),new r1(this).startIfEnabledOrStop(),this.sessionRecording=new rg(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new r0(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new rJ(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new r6(this),this.exceptionObserver=new r5(this),this.exceptionObserver.startIfEnabled(),x.DEBUG=x.DEBUG||this.config.debug,x.DEBUG&&B.info("Starting in debug mode",{this:this,config:l,thisC:{...this.config},p:c,s:h}),this._sync_opt_out_with_persistence(),void 0!==(null===(t=l.bootstrap)||void 0===t?void 0:t.distinctID)){let e=this.config.get_device_id(eJ()),t=null!==(i=l.bootstrap)&&void 0!==i&&i.isIdentifiedID?e:l.bootstrap.distinctID;this.persistence.set_property(eR,null!==(s=l.bootstrap)&&void 0!==s&&s.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:l.bootstrap.distinctID,$device_id:t})}if(this._hasBootstrappedFeatureFlags()){let e=Object.keys((null===(o=l.bootstrap)||void 0===o?void 0:o.featureFlags)||{}).filter(e=>{var t,n;return!(null===(t=l.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])}).reduce((e,t)=>{var n,r;return e[t]=(null===(n=l.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e},{}),t=Object.keys((null===(a=l.bootstrap)||void 0===a?void 0:a.featureFlagPayloads)||{}).filter(t=>e[t]).reduce((e,t)=>{var n,r,i,s;return null!==(n=l.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=l.bootstrap)||void 0===i||null===(s=i.featureFlagPayloads)||void 0===s?void 0:s[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:e,featureFlagPayloads:t})}if(!this.get_distinct_id()){let e=this.config.get_device_id(eJ());this.register_once({distinct_id:e,$device_id:e},""),this.persistence.set_property(eR,"anonymous")}return null==d||null===(n=d.addEventListener)||void 0===n||n.call(d,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),l.segment?function(e,t){let n=e.config.segment;if(!n)return t();!function(e,t){let n=e.config.segment;if(!n)return t();let r=n=>{let r=()=>n.anonymousId()||eJ();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(eR,"identified")),t()},i=n.user();"then"in i&&R(i.then)?i.then(e=>r(e)):r(i)}(e,()=>{n.register((e=>{Promise&&Promise.resolve||B.warn("This browser does not have Promise support, and can not use the segment integration");let t=(t,n)=>{var r;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(B.info("Segment integration does not have a userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(B.info("Segment integration has a userId set, identifying with PostHog"),e.identify(t.event.userId));let i=e._calculate_event_properties(n,null!==(r=t.event.properties)&&void 0!==r?r:{},new Date);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this._loaded()):this._loaded(),R(this.config._onCapture)&&this.on("eventCaptured",e=>this.config._onCapture(e.event,e)),this}_afterDecideResponse(e){var t,n,i,s,o,a,l,u,c;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=K(e.supportedCompression,r.GZipJS)?r.GZipJS:K(e.supportedCompression,r.Base64)?r.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:e.defaultIdentifiedOnly?"identified_only":"always"}),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(i=this.autocapture)||void 0===i||i.afterDecideResponse(e),null===(s=this.heatmaps)||void 0===s||s.afterDecideResponse(e),null===(o=this.experiments)||void 0===o||o.afterDecideResponse(e),null===(a=this.surveys)||void 0===a||a.afterDecideResponse(e),null===(l=this.webVitalsAutocapture)||void 0===l||l.afterDecideResponse(e),null===(u=this.exceptions)||void 0===u||u.afterDecideResponse(e),null===(c=this.exceptionObserver)||void 0===c||c.afterDecideResponse(e)}_loaded(){let e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){B.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),e||(new rv(this).call(),this.featureFlags.resetRequestQueue())}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||V(this.__request_queue,e=>this._send_retriable_request(e)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(ii?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=rx(e.url,{ip:this.config.ip?1:0}),e.headers={...this.config.request_headers},e.compression="best-available"===e.compression?this.compression:e.compression,(e=>{var t,n,r;let i={...e};i.timeout=i.timeout||6e4,i.url=rx(i.url,{_:(new Date).getTime().toString(),ver:x.LIB_VERSION,compression:i.compression});let s=null!==(t=i.transport)&&void 0!==t?t:"XHR",o=null!==(n=null===(r=er(rT,e=>e.transport===s))||void 0===r?void 0:r.method)&&void 0!==n?n:rT[0].method;if(!o)throw Error("No available transport method");o(i)})({...e,callback:t=>{var n,r,i;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null===(r=(i=this.config).on_request_error)||void 0===r||r.call(i,t)),null===(n=e.callback)||void 0===n||n.call(e,t)}})))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){let t;let n=[],r=[],i=[];V(e,e=>{e&&(C(t=e[0])?i.push(e):R(e)?e.call(this):C(e)&&"alias"===t?n.push(e):C(e)&&-1!==t.indexOf("capture")&&R(this[t])?i.push(e):r.push(e))});let s=function(e,t){V(e,function(e){if(C(e[0])){let n=t;G(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};s(n,this),s(r,this),s(i,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){var r,i,s;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return void B.uninitializedWarning("posthog.capture");if(this.consent.isOptedOut())return;if(M(e)||!L(e))return void B.error("No event name provided to posthog.capture");if(!this.config.opt_out_useragent_filter&&this._is_bot())return;let o=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null!=o&&o.isRateLimited)return void B.critical("This capture call is ignored due to client rate limiting.");this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();let a=new Date,l=(null==n?void 0:n.timestamp)||a,u={uuid:eJ(),event:e,properties:this._calculate_event_properties(e,t||{},l)};o&&(u.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==n?void 0:n.$set)&&(u.$set=null==n?void 0:n.$set);let c=this._calculate_set_once_properties(null==n?void 0:n.$set_once);c&&(u.$set_once=c),i=u,s=null!=n&&n._noTruncate?null:this.config.properties_string_max_length,(u=function(e,t){let n=new Set;return function e(r,i){let s;return r!==Object(r)?t?t(r,i):r:n.has(r)?void 0:(n.add(r),C(r)?(s=[],V(r,t=>{s.push(e(t))})):(s={},G(r,(t,r)=>{n.has(t)||(s[r]=e(t,r))})),s)}(e)}(i,e=>L(e)&&!D(s)?e.slice(0,s):e)).timestamp=l,M(null==n?void 0:n.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a);let d={...u.properties.$set,...u.$set};P(d)||this.setPersonPropertiesForFlags(d),this._internalEventEmitter.emit("eventCaptured",u);let h={method:"POST",url:null!==(r=null==n?void 0:n._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(h):this._requestQueue.enqueue(h),u}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}_calculate_event_properties(e,t,n){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;let r=this.persistence.remove_event_timer(e),s={...t};if(s.token=this.config.token,"$snapshot"===e){let e={...this.persistence.properties(),...this.sessionPersistence.properties()};return s.distinct_id=e.distinct_id,(!L(s.distinct_id)&&!j(s.distinct_id)||N(s.distinct_id))&&B.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}let o=t1.properties();if(this.sessionManager){let{sessionId:e,windowId:t}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=e,s.$window_id=t}if(this.requestRouter.region===i.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){let e=this.sessionPropsManager.getSessionProps();s=Q(s,e)}if(!this.config.disable_scroll_properties){let t={};"$pageview"===e?t=this.pageViewManager.doPageView(n):"$pageleave"===e&&(t=this.pageViewManager.doPageLeave(n)),s=Q(s,t)}if("$pageview"===e&&v&&(s.title=v.title),!M(r)){let e=n.getTime()-r;s.$duration=parseFloat((e/1e3).toFixed(3))}S&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=Q({},o,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),C(this.config.property_denylist)?G(this.config.property_denylist,function(e){delete s[e]}):B.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let a=this.config.sanitize_properties;a&&(s=a(s,e));let l=this._hasPersonProcessing();return s.$process_person_profile=l,l&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;let t=Q({},this.persistence.get_initial_props(),e||{}),n=this.config.sanitize_properties;return n&&(t=n(t,"$set_once")),P(t)?void 0:t}register(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}register_once(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}register_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){let t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}identify(e,t,n){if(!this.__loaded||!this.persistence)return B.uninitializedWarning("posthog.identify");if(j(e)&&(e=e.toString(),B.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!e)return void B.error("Unique user id has not been set in posthog.identify");if(["distinct_id","distinctid"].includes(e.toLowerCase()))return void B.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`);if(!this._requirePersonProcessing("posthog.identify"))return;let r=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(es)&&(this.unregister(es),this.register({distinct_id:e}));let i="anonymous"===(this.persistence.get_property(eR)||"anonymous");e!==r&&i?(this.persistence.set_property(eR,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(eC))}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}group(e,t,n){if(!e||!t)return void B.error("posthog.group requires a group type and group key");if(!this._requirePersonProcessing("posthog.group"))return;let r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:{...r,[e]:t}}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===t||n||this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i;if(B.info("reset"),!this.__loaded)return B.uninitializedWarning("posthog.reset");let s=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_property(eR,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();let o=this.config.get_device_id(eJ());this.register_once({distinct_id:o,$device_id:e?o:s},"")}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";let{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${t}`);if(null!=e&&e.withTimestamp&&n){var i;let t=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!n)return r;r+=`?t=${Math.max(Math.floor(((new Date).getTime()-n)/1e3)-t,0)}`}return r}alias(e,t){return e===this.get_property(ei)?(B.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(M(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(es,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(B.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,n,r,i;let s={...this.config};A(e)&&(Q(this.config,io(e)),null===(t=this.persistence)||void 0===t||t.update_config(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new t3({...this.config,persistence:"sessionStorage"}),e2.is_supported()&&"true"===e2.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(x.DEBUG=!0,B.info("set_config",{config:e,oldConfig:s,newConfig:{...this.config}})),null===(n=this.sessionRecording)||void 0===n||n.startIfEnabledOrStop(),null===(r=this.autocapture)||void 0===r||r.startIfEnabled(),null===(i=this.heatmaps)||void 0===i||i.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){let t=F(e)&&e;if(t||null!=e&&e.sampling||null!=e&&e.linked_flag){var n,r,i;let s=null===(n=this.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId();(t||null!=e&&e.sampling)&&(null===(r=this.sessionRecording)||void 0===r||r.overrideSampling(),B.info("Session recording started with sampling override for session: ",null==s?void 0:s.sessionId)),(t||null!=e&&e.linked_flag)&&(null===(i=this.sessionRecording)||void 0===i||i.overrideLinkedFlag(),B.info("Session recording started with linked_flags override"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}captureException(e,t){var n;let r=Error("PostHog syntheticException"),i=R(null===(n=E.__PosthogExtensions__)||void 0===n?void 0:n.parseErrorAsProperties)?E.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:r}):{$exception_level:"error",$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}],...t};this.exceptions.sendExceptionEvent(i)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e;let t=null!==(e=this.config.name)&&void 0!==e?e:ir;return t!==ir&&(t=ir+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(eR))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(eR))}_hasPersonProcessing(){var e,t,n,r;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&P(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[es])&&(null===(n=this.persistence)||void 0===n||null===(r=n.props)||void 0===r||!r[eD]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(B.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(eD,!0),!0)}_sync_opt_out_with_persistence(){var e,t,n,r;let i=this.consent.isOptedOut(),s=this.config.opt_out_persistence_by_default,o=this.config.disable_persistence||i&&!!s;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==o&&(null===(n=this.persistence)||void 0===n||n.set_disabled(o)),(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==o&&(null===(r=this.sessionPersistence)||void 0===r||r.set_disabled(o))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(M(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return g?rG(g,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){v&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:v.title},{send_instantly:!0}))}debug(e){!1===e?(null==d||d.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==d||d.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}!function(e,t){for(let n=0;n<t.length;n++)e.prototype[t[n]]=Z(e.prototype[t[n]])}(il,["identify"]);let iu=function(){let e=ie[ir]=new il;return function(){function e(){e.done||(e.done=!0,ii=!1,G(ie,function(e){e._dom_loaded()}))}null!=v&&v.addEventListener&&("complete"===v.readyState?e():v.addEventListener("DOMContentLoaded",e,!1)),d&&en(d,"load",e,!0)}(),e}()},14224:function(e){var t,n,r,i=e.exports={};function s(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var l=[],u=!1,c=-1;function d(){u&&r&&(u=!1,r.length?l=r.concat(l):c=-1,l.length&&h())}function h(){if(!u){var e=a(d);u=!0;for(var t=l.length;t;){for(r=l,l=[];++c<t;)r&&r[c].run();c=-1,t=l.length}r=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}},41329:function(e,t,n){"use strict";n.r(t),n.d(t,{useDeepCompareCallback:function(){return l},useDeepCompareEffect:function(){return u},useDeepCompareImperativeHandle:function(){return c},useDeepCompareLayoutEffect:function(){return d},useDeepCompareMemo:function(){return h}});var r=n(75271),i=Object.prototype.hasOwnProperty;function s(e,t,n){for(n of e.keys())if(o(n,t))return n}function o(e,t){var n,r,a;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&o(e[r],t[r]););return -1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if((a=r)&&"object"==typeof a&&!(a=s(t,a))||!t.has(a))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if((a=r[0])&&"object"==typeof a&&!(a=s(t,a))||!o(r[1],t.get(a)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return -1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return -1===r}if(!n||"object"==typeof e){for(n in r=0,e)if(i.call(e,n)&&++r&&!i.call(t,n)||!(n in t)||!o(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}function a(e){let t=r.useRef(e),n=r.useRef(0);return o(e,t.current)||(t.current=e,n.current+=1),r.useMemo(()=>t.current,[n.current])}function l(e,t){return r.useCallback(e,a(t))}function u(e,t){r.useEffect(e,a(t))}function c(e,t,n){r.useImperativeHandle(e,t,a(n))}function d(e,t){r.useLayoutEffect(e,a(t))}function h(e,t){return r.useMemo(e,a(t))}},99752:function(e,t,n){"use strict";var r=n(75271),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,o=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return a(function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})},[e,n,t]),o(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},44250:function(e,t,n){"use strict";var r=n(75271),i=n(48488),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=i.useSyncExternalStore,a=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;var f=o(e,(d=u(function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&h.hasValue){var t=h.value;if(i(t,e))return a=t}return a=e}if(t=a,s(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(o=e,a=n)}var o,a,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,n,r,i]))[0],d[1]);return l(function(){h.hasValue=!0,h.value=f},[f]),c(f),f}},48488:function(e,t,n){"use strict";e.exports=n(99752)},8769:function(e,t,n){"use strict";e.exports=n(44250)},38715:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(47139).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29753:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return r.actionAsyncStorage}});let r=n(38715);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},47139:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAsyncLocalStorage",{enumerable:!0,get:function(){return s}});let n=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}}let i=globalThis.AsyncLocalStorage;function s(){return i?new i:new r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},22912:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"requestAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(47139).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54089:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getExpectedRequestStore:function(){return i},requestAsyncStorage:function(){return r.requestAsyncStorage}});let r=n(22912);function i(e){let t=r.requestAsyncStorage.getStore();if(t)return t;throw Error("`"+e+"` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53023:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},48243:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},90405:function(e){e.exports=function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},52881:function(e){function t(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,s){var o=e.apply(n,r);function a(e){t(o,i,s,a,l,"next",e)}function l(e){t(o,i,s,a,l,"throw",e)}a(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},56731:function(e){e.exports=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},25188:function(e,t,n){var r=n(242),i=n(55285);e.exports=function(e,t,n){if(r())return Reflect.construct.apply(null,arguments);var s=[null];s.push.apply(s,t);var o=new(e.bind.apply(e,s));return n&&i(o,n.prototype),o},e.exports.__esModule=!0,e.exports.default=e.exports},48013:function(e,t,n){var r=n(312);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},88544:function(e,t,n){var r=n(312);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},81593:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},48368:function(e,t,n){var r=n(55285);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},1567:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},43181:function(e){e.exports=function(e){try{return -1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},242:function(e){function t(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(e.exports=t=function(){return!!n},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},84888:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports},73165:function(e){e.exports=function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},22535:function(e,t,n){var r=n(83084).default,i=n(90405);e.exports=function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},50653:function(e,t,n){var r=n(83084).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},s=Object.prototype,o=s.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function h(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,n){return e[t]=n}}function f(e,n,r,i){var s,o,l=Object.create((n&&n.prototype instanceof _?n:_).prototype);return a(l,"_invoke",{value:(s=new R(i||[]),o=m,function(n,i){if(o===g)throw Error("Generator is already running");if(o===v){if("throw"===n)throw i;return{value:t,done:!0}}for(s.method=n,s.arg=i;;){var a=s.delegate;if(a){var l=function e(n,r){var i=r.method,s=n.iterator[i];if(s===t)return r.delegate=null,"throw"===i&&n.iterator.return&&(r.method="return",r.arg=t,e(n,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+i+"' method")),y;var o=p(s,n.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var a=o.arg;return a?a.done?(r[n.resultName]=a.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(a,s);if(l){if(l===y)continue;return l}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(o===m)throw o=v,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);o=g;var u=p(e,r,s);if("normal"===u.type){if(o=s.done?v:"suspendedYield",u.arg===y)continue;return{value:u.arg,done:s.done}}"throw"===u.type&&(o=v,s.method="throw",s.arg=u.arg)}})}),l}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var m="suspendedStart",g="executing",v="completed",y={};function _(){}function b(){}function w(){}var S={};h(S,u,function(){return this});var E=Object.getPrototypeOf,x=E&&E(E(A([])));x&&x!==s&&o.call(x,u)&&(S=x);var k=w.prototype=_.prototype=Object.create(S);function T(e){["next","throw","return"].forEach(function(t){h(e,t,function(e){return this._invoke(t,e)})})}function O(e,t){var n;a(this,"_invoke",{value:function(i,s){function a(){return new t(function(n,a){!function n(i,s,a,l){var u=p(e[i],e,s);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==r(d)&&o.call(d,"__await")?t.resolve(d.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(d).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(u.arg)}(i,s,n,a)})}return n=n?n.then(a,a):a()}})}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}throw TypeError(r(e)+" is not iterable")}return b.prototype=w,a(k,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:b,configurable:!0}),b.displayName=h(w,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,h(e,d,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},T(O.prototype),h(O.prototype,c,function(){return this}),n.AsyncIterator=O,n.async=function(e,t,r,i,s){void 0===s&&(s=Promise);var o=new O(f(e,t,r,i),s);return n.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},T(k),h(k,d,"Generator"),h(k,u,function(){return this}),h(k,"toString",function(){return"[object Generator]"}),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=A,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return a.type="throw",a.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var l=o.call(s,"catchLoc"),u=o.call(s,"finallyLoc");if(l&&u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},55285:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},78834:function(e,t,n){var r=n(48243),i=n(84888),s=n(40310),o=n(73165);e.exports=function(e,t){return r(e)||i(e,t)||s(e,t)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},1306:function(e,t,n){var r=n(83084).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},312:function(e,t,n){var r=n(83084).default,i=n(1306);e.exports=function(e){var t=i(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},83084:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},40310:function(e,t,n){var r=n(53023);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},20112:function(e,t,n){var r=n(81593),i=n(55285),s=n(43181),o=n(25188);function a(t){var n="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!s(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return o(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,a(t)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},59268:function(e,t,n){var r=n(50653)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},79482:function(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}n.d(t,{Z:function(){return r}})},12033:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}n.d(t,{Z:function(){return r}})},27822:function(e,t,n){"use strict";n.d(t,{F0:function(){return tr},Fp:function(){return tL},HF:function(){return tD},MC:function(){return e9},MT:function(){return ev},OU:function(){return A},PO:function(){return P},Pz:function(){return ef},Q8:function(){return L},QZ:function(){return tF},VB:function(){return tO},W_:function(){return eh},Xd:function(){return tq},Zb:function(){return _},Ze:function(){return tg},as:function(){return eq},dT:function(){return tj},du:function(){return e7},eI:function(){return tT},hu:function(){return m},iK:function(){return tn},iV:function(){return b},iz:function(){return tk},l8:function(){return f},nn:function(){return g},vE:function(){return p},wn:function(){return tP},x0:function(){return ej},x3:function(){return tU},yO:function(){return q},yg:function(){return j},yo:function(){return te}});var r,i,s,o,a,l=Object.defineProperty,u="@liveblocks/core",c="2.10.0",d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function h(e){console.error(e)}function f(e,t,n){let r=Symbol.for(e),i=n?`${t||"dev"} (${n})`:t||"dev";d[r]?d[r]===i||h(`Multiple copies of Liveblocks are being loaded in your project. This will cause issues! See https://liveblocks.io/docs/errors/dupes 

Conflicts:
- ${e} ${d[r]} (already loaded)
- ${e} ${i} (trying to load this now)`):d[r]=i,t&&c&&t!==c&&h(`Cross-linked versions of Liveblocks found, which will cause issues! See https://liveblocks.io/docs/errors/cross-linked 

Conflicts:
- ${u} is at ${c}
- ${e} is at ${t}

Always upgrade all Liveblocks packages to the same version number.`)}function p(e,t){throw Error(t)}function m(e,t){}function g(e,t="Expected value to be non-nullable"){return e}function v(){let e,t;return[new Promise((n,r)=>{e=n,t=r}),e,t]}function y(){let[e,t,n]=v();return{promise:e,resolve:t,reject:n}}function _(){let e=new Set,t=new Set,n=null;function r(e){return t.add(e),()=>t.delete(e)}function i(t){return e.add(t),()=>e.delete(t)}async function s(e){let t;return new Promise(n=>{t=r(t=>{(void 0===e||e(t))&&n(t)})}).finally(()=>t?.())}function o(n){e.forEach(e=>e(n)),e.clear(),t.forEach(e=>e(n))}return{notify:function(e){null!==n?n.push(e):o(e)},subscribe:r,subscribeOnce:i,_forceClear:function(){e.clear(),t.clear()},count:function(){return e.size+t.size},waitUntil:s,pause:function(){n=[]},unpause:function(){if(null!==n){for(let e of n)o(e);n=null}},observable:{subscribe:r,subscribeOnce:i,waitUntil:s}}}var b={};((e,t)=>{for(var n in t)l(e,n,{get:t[n],enumerable:!0})})(b,{error:()=>x,errorWithTitle:()=>O,warn:()=>E,warnWithTitle:()=>T});var w="background:#0e0d12;border-radius:9999px;color:#fff;padding:3px 7px;font-family:sans-serif;font-weight:600;";function S(e){return"undefined"==typeof window?console[e]:(t,...n)=>console[e]("%cLiveblocks",w,t,...n)}var E=S("warn"),x=S("error");function k(e){return"undefined"==typeof window?console[e]:(t,n,...r)=>console[e](`%cLiveblocks%c ${t}`,w,"font-weight:600",n,...r)}var T=k("warn"),O=k("error"),I=class{constructor(e){this.curr=e}get current(){return this.curr}allowPatching(e){let t=this,n=!0;e({...this.curr,patch(e){if(n)for(let n of(t.curr=Object.assign({},t.curr,e),Object.entries(e))){let[e,t]=n;"patch"!==e&&(this[e]=t)}else throw Error("Can no longer patch stale context")}}),n=!1}},C=1,R=class{get initialState(){let e=this.states.values()[Symbol.iterator]().next();if(!e.done)return e.value;throw Error("No states defined yet")}get currentState(){if(null===this.currentStateOrNull){if(0===this.runningState)throw Error("Not started yet");throw Error("Already stopped")}return this.currentStateOrNull}start(){if(0!==this.runningState)throw Error("State machine has already started");return this.runningState=1,this.currentStateOrNull=this.initialState,this.enter(null),this}stop(){if(1!==this.runningState)throw Error("Cannot stop a state machine that hasn't started yet");this.exit(null),this.runningState=2,this.currentStateOrNull=null}constructor(e){this.id=C++,this.runningState=0,this.currentStateOrNull=null,this.states=new Set,this.enterFns=new Map,this.cleanupStack=[],this.knownEventTypes=new Set,this.allowedTransitions=new Map,this.currentContext=new I(e),this.eventHub={didReceiveEvent:_(),willTransition:_(),didIgnoreEvent:_(),willExitState:_(),didEnterState:_()},this.events={didReceiveEvent:this.eventHub.didReceiveEvent.observable,willTransition:this.eventHub.willTransition.observable,didIgnoreEvent:this.eventHub.didIgnoreEvent.observable,willExitState:this.eventHub.willExitState.observable,didEnterState:this.eventHub.didEnterState.observable}}get context(){return this.currentContext.current}addState(e){if(0!==this.runningState)throw Error("Already started");return this.states.add(e),this}onEnter(e,t){if(0!==this.runningState)throw Error("Already started");if(this.enterFns.has(e))throw Error(`enter/exit function for ${e} already exists`);return this.enterFns.set(e,t),this}onEnterAsync(e,t,n,r){return this.onEnter(e,()=>{let e=new AbortController,i=e.signal,s=!1;return t(this.currentContext.current,i).then(e=>{i.aborted||(s=!0,this.transition({type:"ASYNC_OK",data:e},n))},e=>{i.aborted||(s=!0,this.transition({type:"ASYNC_ERROR",reason:e},r))}),()=>{s||e.abort()}})}getStatesMatching(e){let t=[];if("*"===e)for(let e of this.states)t.push(e);else if(e.endsWith(".*")){let n=e.slice(0,-1);for(let e of this.states)e.startsWith(n)&&t.push(e)}else this.states.has(e)&&t.push(e);if(0===t.length)throw Error(`No states match ${JSON.stringify(e)}`);return t}addTransitions(e,t){if(0!==this.runningState)throw Error("Already started");for(let n of this.getStatesMatching(e)){let r=this.allowedTransitions.get(n);for(let[i,s]of(void 0===r&&(r=new Map,this.allowedTransitions.set(n,r)),Object.entries(t))){if(r.has(i))throw Error(`Trying to set transition "${i}" on "${n}" (via "${e}"), but a transition already exists there.`);let t=s;if(this.knownEventTypes.add(i),void 0!==t){let e="function"==typeof t?t:()=>t;r.set(i,e)}}}return this}addTimedTransition(e,t,n){return this.onEnter(e,()=>{let e=setTimeout(()=>{this.transition({type:"TIMER"},n)},"function"==typeof t?t(this.currentContext.current):t);return()=>{clearTimeout(e)}})}getTargetFn(e){return this.allowedTransitions.get(this.currentState)?.get(e)}exit(e){this.eventHub.willExitState.notify(this.currentState),this.currentContext.allowPatching(t=>{e=e??this.cleanupStack.length;for(let n=0;n<e;n++)this.cleanupStack.pop()?.(t)})}enter(e){let t=function(e,t){let n=e.split(".");if(t<1||t>n.length+1)throw Error("Invalid number of levels");let r=[];t>n.length&&r.push("*");for(let e=n.length-t+1;e<n.length;e++){let t=n.slice(0,e);t.length>0&&r.push(t.join(".")+".*")}return r.push(e),r}(this.currentState,e??this.currentState.split(".").length+1);this.currentContext.allowPatching(e=>{for(let n of t){let t=this.enterFns.get(n),r=t?.(e);"function"==typeof r?this.cleanupStack.push(r):this.cleanupStack.push(null)}}),this.eventHub.didEnterState.notify(this.currentState)}send(e){if(!this.knownEventTypes.has(e.type))throw Error(`Invalid event ${JSON.stringify(e.type)}`);if(2===this.runningState)return;let t=this.getTargetFn(e.type);if(void 0!==t)return this.transition(e,t);this.eventHub.didIgnoreEvent.notify(e)}transition(e,t){let n,r;this.eventHub.didReceiveEvent.notify(e);let i=this.currentState,s=("function"==typeof t?t:()=>t)(e,this.currentContext.current);if(null===s){this.eventHub.didIgnoreEvent.notify(e);return}if("string"==typeof s?n=s:(n=s.target,r=Array.isArray(s.effect)?s.effect:[s.effect]),!this.states.has(n))throw Error(`Invalid next state name: ${JSON.stringify(n)}`);this.eventHub.willTransition.notify({from:i,to:n});let[o,a]=function(e,t){if(e===t)return[0,0];let n=e.split("."),r=t.split("."),i=Math.min(n.length,r.length),s=0;for(;s<i&&n[s]===r[s];s++);return[n.length-s,r.length-s]}(this.currentState,n);if(o>0&&this.exit(o),this.currentStateOrNull=n,void 0!==r){let t=r;this.currentContext.allowPatching(n=>{for(let r of t)"function"==typeof r?r(n,e):n.patch(r)})}a>0&&this.enter(a)}};function A(e){throw Error(e)}function P(e){return null!==e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)}function M(e){return Object.entries(e)}function L(e,t){let n={};for(let r of Object.entries(e)){let e=r[0];if("__proto__"===e)continue;let i=r[1];n[e]=t(i,e)}return n}function N(e){try{return JSON.parse(e)}catch(e){return}}function D(e){return JSON.parse(JSON.stringify(e))}function $(e){return e.filter(e=>null!=e)}function j(e){let t={...e};return Object.keys(e).forEach(e=>{void 0===t[e]&&delete t[e]}),t}async function F(e,t,n){let r;return Promise.race([e,new Promise((e,i)=>{r=setTimeout(()=>{i(Error(n))},t)})]).finally(()=>clearTimeout(r))}function U(e){let t=null;return()=>(null===t&&(t=e().catch(e=>{throw setTimeout(()=>{t=null},5e3),e})),t)}var q=((r=q||{})[r.UPDATE_PRESENCE=100]="UPDATE_PRESENCE",r[r.USER_JOINED=101]="USER_JOINED",r[r.USER_LEFT=102]="USER_LEFT",r[r.BROADCASTED_EVENT=103]="BROADCASTED_EVENT",r[r.ROOM_STATE=104]="ROOM_STATE",r[r.INITIAL_STORAGE_STATE=200]="INITIAL_STORAGE_STATE",r[r.UPDATE_STORAGE=201]="UPDATE_STORAGE",r[r.REJECT_STORAGE_OP=299]="REJECT_STORAGE_OP",r[r.UPDATE_YDOC=300]="UPDATE_YDOC",r[r.THREAD_CREATED=400]="THREAD_CREATED",r[r.THREAD_DELETED=407]="THREAD_DELETED",r[r.THREAD_METADATA_UPDATED=401]="THREAD_METADATA_UPDATED",r[r.THREAD_UPDATED=408]="THREAD_UPDATED",r[r.COMMENT_CREATED=402]="COMMENT_CREATED",r[r.COMMENT_EDITED=403]="COMMENT_EDITED",r[r.COMMENT_DELETED=404]="COMMENT_DELETED",r[r.COMMENT_REACTION_ADDED=405]="COMMENT_REACTION_ADDED",r[r.COMMENT_REACTION_REMOVED=406]="COMMENT_REACTION_REMOVED",r),B=((i=B||{})[i.CLOSE_NORMAL=1e3]="CLOSE_NORMAL",i[i.CLOSE_ABNORMAL=1006]="CLOSE_ABNORMAL",i[i.UNEXPECTED_CONDITION=1011]="UNEXPECTED_CONDITION",i[i.TRY_AGAIN_LATER=1013]="TRY_AGAIN_LATER",i[i.INVALID_MESSAGE_FORMAT=4e3]="INVALID_MESSAGE_FORMAT",i[i.NOT_ALLOWED=4001]="NOT_ALLOWED",i[i.MAX_NUMBER_OF_MESSAGES_PER_SECONDS=4002]="MAX_NUMBER_OF_MESSAGES_PER_SECONDS",i[i.MAX_NUMBER_OF_CONCURRENT_CONNECTIONS=4003]="MAX_NUMBER_OF_CONCURRENT_CONNECTIONS",i[i.MAX_NUMBER_OF_MESSAGES_PER_DAY_PER_APP=4004]="MAX_NUMBER_OF_MESSAGES_PER_DAY_PER_APP",i[i.MAX_NUMBER_OF_CONCURRENT_CONNECTIONS_PER_ROOM=4005]="MAX_NUMBER_OF_CONCURRENT_CONNECTIONS_PER_ROOM",i[i.ROOM_ID_UPDATED=4006]="ROOM_ID_UPDATED",i[i.KICKED=4100]="KICKED",i[i.TOKEN_EXPIRED=4109]="TOKEN_EXPIRED",i[i.CLOSE_WITHOUT_RETRY=4999]="CLOSE_WITHOUT_RETRY",i);function H(e){return 4999===e||e>=4e3&&e<4100}function z(e){return 1013===e||e>=4200&&e<4300}function W(e){let t=e.currentState;switch(t){case"@ok.connected":case"@ok.awaiting-pong":return"connected";case"@idle.initial":return"initial";case"@auth.busy":case"@auth.backoff":case"@connecting.busy":case"@connecting.backoff":case"@idle.zombie":return e.context.successCount>0?"reconnecting":"connecting";case"@idle.failed":return"disconnected";default:return p(t,"Unknown state")}}var V=[250,500,1e3,2e3,4e3,8e3,1e4],G=V[0]-1,Q=[2e3,3e4,6e4,3e5],K=class extends Error{constructor(e){super(e)}},J=class extends Error{constructor(e,t){super(e),this.code=t}};function X(e,t){return t.find(t=>t>e)??t[t.length-1]}function Z(e){e.patch({backoffDelay:X(e.backoffDelay,V)})}function Y(e){e.patch({backoffDelay:X(e.backoffDelay,Q)})}function ee(e){e.patch({successCount:0})}function et(e,t){let n=2===e?x:1===e?E:()=>{};return()=>{n(t)}}function en(e){let t="Connection to Liveblocks websocket server";return n=>{e instanceof Error?E(`${t} could not be established. ${String(e)}`):E(es(e)?`${t} closed prematurely (code: ${e.code}). Retrying in ${n.backoffDelay}ms.`:`${t} could not be established.`)}}function er(e){let t=[`code: ${e.code}`];return e.reason&&t.push(`reason: ${e.reason}`),e=>{E(`Connection to Liveblocks websocket server closed (${t.join(", ")}). Retrying in ${e.backoffDelay}ms.`)}}var ei=et(1,"Connection to WebSocket closed permanently. Won't retry.");function es(e){return!(e instanceof Error)&&"close"===e.type}var eo=e=>t=>t.patch(e),ea=class{constructor(e,t=!1,n=!0){let{machine:r,events:i,cleanups:s}=function(e,t){let n=_();n.pause();let r=_();function i(e,t){return()=>{let n=new J(e,t);r.notify(n)}}let s=new R({successCount:0,authValue:null,socket:null,backoffDelay:G}).addState("@idle.initial").addState("@idle.failed").addState("@idle.zombie").addState("@auth.busy").addState("@auth.backoff").addState("@connecting.busy").addState("@connecting.backoff").addState("@ok.connected").addState("@ok.awaiting-pong");s.addTransitions("*",{RECONNECT:{target:"@auth.backoff",effect:[Z,ee]},DISCONNECT:"@idle.initial"}),s.onEnter("@idle.*",ee).addTransitions("@idle.*",{CONNECT:(e,t)=>null!==t.authValue?"@connecting.busy":"@auth.busy"}),s.addTransitions("@auth.backoff",{NAVIGATOR_ONLINE:{target:"@auth.busy",effect:eo({backoffDelay:G})}}).addTimedTransition("@auth.backoff",e=>e.backoffDelay,"@auth.busy").onEnterAsync("@auth.busy",()=>F(e.authenticate(),1e4,"Timed out during auth"),e=>({target:"@connecting.busy",effect:eo({authValue:e.data})}),e=>e.reason instanceof K?{target:"@idle.failed",effect:[et(2,e.reason.message),i(e.reason.message,-1)]}:{target:"@auth.backoff",effect:[Z,et(2,`Authentication failed: ${e.reason instanceof Error?e.reason.message:String(e.reason)}`)]});let o=e=>s.send({type:"EXPLICIT_SOCKET_ERROR",event:e}),a=e=>s.send({type:"EXPLICIT_SOCKET_CLOSE",event:e}),l=e=>"pong"===e.data?s.send({type:"PONG"}):n.notify(e);function u(e){e&&(e.removeEventListener("error",o),e.removeEventListener("close",a),e.removeEventListener("message",l),e.close())}s.addTransitions("@connecting.backoff",{NAVIGATOR_ONLINE:{target:"@connecting.busy",effect:eo({backoffDelay:G})}}).addTimedTransition("@connecting.backoff",e=>e.backoffDelay,"@connecting.busy").onEnterAsync("@connecting.busy",async(n,r)=>{let i=null,s=null;return F(new Promise((r,u)=>{if(null===n.authValue)throw Error("No auth authValue");let c=e.createSocket(n.authValue);function d(e){i=e,c.removeEventListener("message",l),u(e)}s=c;let[h,f]=v();function p(e){let t=N(e.data);t?.type===104&&f()}t.waitForActorId||f(),c.addEventListener("message",l),t.waitForActorId&&c.addEventListener("message",p),c.addEventListener("error",d),c.addEventListener("close",d),c.addEventListener("open",()=>{c.addEventListener("error",o),c.addEventListener("close",a);let e=()=>{c.removeEventListener("error",d),c.removeEventListener("close",d),c.removeEventListener("message",p)};h.then(()=>{r([c,e])})})}),1e4,"Timed out during websocket connection").then(([e,t])=>{if(t(),r.aborted)throw Error("Aborted");if(i)throw i;return e}).catch(e=>{throw u(s),e})},e=>({target:"@ok.connected",effect:eo({socket:e.data,backoffDelay:G})}),e=>{let t=e.reason;if(t instanceof K)return{target:"@idle.failed",effect:[et(2,t.message),i(t.message,-1)]};if(es(t)){if(4109===t.code)return"@auth.busy";if(z(t.code))return{target:"@connecting.backoff",effect:[Y,en(t)]};if(H(t.code))return{target:"@idle.failed",effect:[et(2,t.reason),i(t.reason,t.code)]}}return{target:"@auth.backoff",effect:[Z,en(t)]}});let c={target:"@ok.awaiting-pong",effect:e=>{e.socket?.send("ping")}},d=()=>{let t="undefined"!=typeof document?document:void 0;return t?.visibilityState==="hidden"&&e.canZombie()?"@idle.zombie":c};if(s.addTimedTransition("@ok.connected",3e4,d).addTransitions("@ok.connected",{NAVIGATOR_OFFLINE:d,WINDOW_GOT_FOCUS:c}),s.addTransitions("@idle.zombie",{WINDOW_GOT_FOCUS:"@connecting.backoff"}),s.onEnter("@ok.*",e=>{e.patch({successCount:e.successCount+1});let t=setTimeout(n.unpause,0);return e=>{u(e.socket),e.patch({socket:null}),clearTimeout(t),n.pause()}}).addTransitions("@ok.awaiting-pong",{PONG:"@ok.connected"}).addTimedTransition("@ok.awaiting-pong",2e3,{target:"@connecting.busy",effect:et(1,"Received no pong from server, assume implicit connection loss.")}).addTransitions("@ok.*",{EXPLICIT_SOCKET_ERROR:(e,t)=>t.socket?.readyState===1?null:{target:"@connecting.backoff",effect:Z},EXPLICIT_SOCKET_CLOSE:e=>{var t;return H(e.event.code)?{target:"@idle.failed",effect:[ei,i(e.event.reason,e.event.code)]}:(t=e.event.code)>=4100&&t<4200?4109===e.event.code?"@auth.busy":{target:"@auth.backoff",effect:[Z,er(e.event)]}:z(e.event.code)?{target:"@connecting.backoff",effect:[Y,er(e.event)]}:{target:"@connecting.backoff",effect:[Z,er(e.event)]}}}),"undefined"!=typeof document){let e="undefined"!=typeof document?document:void 0,t="undefined"!=typeof window?window:void 0,n=t??e;s.onEnter("*",r=>{function i(){s.send({type:"NAVIGATOR_OFFLINE"})}function o(){s.send({type:"NAVIGATOR_ONLINE"})}function a(){e?.visibilityState==="visible"&&s.send({type:"WINDOW_GOT_FOCUS"})}return t?.addEventListener("online",o),t?.addEventListener("offline",i),n?.addEventListener("visibilitychange",a),()=>{n?.removeEventListener("visibilitychange",a),t?.removeEventListener("online",o),t?.removeEventListener("offline",i),u(r.socket)}})}let h=[],{statusDidChange:f,didConnect:p,didDisconnect:m,unsubscribe:g}=function(e){let t=_(),n=_(),r=_(),i=null,s=e.events.didEnterState.subscribe(()=>{let s=W(e);s!==i&&t.notify(s),"connected"===i&&"connected"!==s?r.notify():"connected"!==i&&"connected"===s&&n.notify(),i=s});return{statusDidChange:t.observable,didConnect:n.observable,didDisconnect:r.observable,unsubscribe:s}}(s);return h.push(g),t.enableDebugLogging&&h.push(function(e){let t=new Date().getTime();function n(...r){E(`${((new Date().getTime()-t)/1e3).toFixed(2)} [FSM #${e.id}]`,...r)}let r=[e.events.didReceiveEvent.subscribe(e=>n(`Event ${e.type}`)),e.events.willTransition.subscribe(({from:e,to:t})=>n("Transitioning",e,"→",t)),e.events.didIgnoreEvent.subscribe(e=>n("Ignored event",e.type,e,"(current state won't handle it)"))];return()=>{for(let e of r)e()}}(s)),s.start(),{machine:s,cleanups:h,events:{statusDidChange:f,didConnect:p,didDisconnect:m,onMessage:n.observable,onLiveblocksError:r.observable}}}(e,{waitForActorId:n,enableDebugLogging:t});this.machine=r,this.events=i,this.cleanups=s}getStatus(){try{return W(this.machine)}catch{return"initial"}}get authValue(){return this.machine.context.authValue}connect(){this.machine.send({type:"CONNECT"})}reconnect(){this.machine.send({type:"RECONNECT"})}disconnect(){this.machine.send({type:"DISCONNECT"})}destroy(){let e;for(this.machine.stop();e=this.cleanups.pop();)e()}send(e){let t=this.machine.context?.socket;null===t?E("Cannot send: not connected yet",e):1!==t.readyState?E("Cannot send: WebSocket no longer open",e):t.send(e)}_privateSendMachineEvent(e){this.machine.send(e)}};function el(e){return e.includes("room:write")}function eu(e){return e.includes("comments:write")||e.includes("room:write")}function ec(e){var t;let n=e.split(".");if(3!==n.length)throw Error("Authentication error: invalid JWT token");let r=N(function(e){try{let t=e.replace(/-/g,"+").replace(/_/g,"/");return decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}catch(t){return atob(e)}}(n[1]));if(!(r&&P(t=r)&&("acc"===t.k||"id"===t.k||"sec-legacy"===t.k)))throw Error("Authentication error: expected a valid token but did not get one. Hint: if you are using a callback, ensure the room is passed when creating the token. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientCallback");return{raw:e,parsed:r}}async function ed(e,t,n){let r;let i=await e(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok){let e=`${(await i.text()).trim()||"reason not provided in auth response"} (${i.status} returned by POST ${t})`;if(401===i.status||403===i.status)throw new K(`Unauthorized: ${e}`);throw Error(`Failed to authenticate: ${e}`)}try{r=await i.json()}catch(e){throw Error(`Expected a JSON response when doing a POST request on "${t}". ${String(e)}`)}if(!P(r)||"string"!=typeof r.token)throw Error(`Expected a JSON response of the form \`{ token: "..." }\` when doing a POST request on "${t}", but got ${JSON.stringify(r)}`);let{token:s}=r;return{token:s}}var eh=Symbol();function ef(e,...t){return"object"!=typeof e||null===e||Array.isArray(e)?JSON.stringify(e,...t):JSON.stringify(Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}),...t)}_().observable,Date.now();var ep=class{constructor(e){this.input=e;let{promise:t,resolve:n,reject:r}=y();this.promise=t,this.resolve=n,this.reject=r}},em=class{constructor(e,t){this.queue=[],this.error=!1,this.callback=e,this.size=t.size??50,this.delay=t.delay}clearDelayTimeout(){void 0!==this.delayTimeoutId&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0)}schedule(){this.queue.length===this.size?this.flush():1===this.queue.length&&(this.clearDelayTimeout(),this.delayTimeoutId=setTimeout(()=>void this.flush(),this.delay))}async flush(){if(0===this.queue.length)return;let e=this.queue.splice(0),t=e.map(e=>e.input);try{let n=await this.callback(t);this.error=!1,e.forEach((t,r)=>{let i=n?.[r];Array.isArray(n)?e.length!==n.length?t.reject(Error(`Callback must return an array of the same length as the number of provided items. Expected ${e.length}, but got ${n.length}.`)):i instanceof Error?t.reject(i):t.resolve(i):t.reject(Error("Callback must return an array."))})}catch(t){this.error=!0,e.forEach(e=>{e.reject(t)})}}get(e){let t=this.queue.find(t=>ef(t.input)===ef(e));if(t)return t.promise;let n=new ep(e);return this.queue.push(n),this.schedule(),n.promise}clear(){this.queue=[],this.error=!1,this.clearDelayTimeout()}};function eg(e){let t=new Map,n=_();function r(e,r){t.set(e,r),n.notify()}async function i(n){let i=ef(n);if(!t.has(i))try{r(i,{isLoading:!0});let t=await e.get(n);r(i,{isLoading:!1,data:t})}catch(e){r(i,{isLoading:!1,error:e})}}return{...n.observable,get:i,getState:function(e){let n=ef(e);return t.get(n)},invalidate:function(e){if(Array.isArray(e))for(let n of e)t.delete(ef(n));else t.clear();n.notify()},_cacheKeys:function(){return[...t.keys()]}}}function ev(e){let t=!0,n=!1,r=e,i=new Set;function s(){if(n)for(let e of(n=!1,i))e(r)}return{get:function(){return r},set:function(e){let i=r,o=e(i);o!==i&&(r=o,n=!0),t&&s()},batch:function(e){if(!1===t)return e();t=!1;try{e()}finally{t=!0,s()}},subscribe:function(e){return i.add(e),()=>{i.delete(e)}}}}function ey(e){let t=e.editedAt?new Date(e.editedAt):void 0,n=new Date(e.createdAt),r=e.reactions.map(e=>({...e,createdAt:new Date(e.createdAt)}));if(e.body)return{...e,reactions:r,createdAt:n,editedAt:t};{let i=new Date(e.deletedAt);return{...e,reactions:r,createdAt:n,editedAt:t,deletedAt:i}}}function e_(e){let t=new Date(e.createdAt),n=new Date(e.updatedAt),r=e.comments.map(e=>ey(e));return{...e,createdAt:t,updatedAt:n,comments:r}}function eb(e){let t=new Date(e.notifiedAt),n=e.readAt?new Date(e.readAt):null;if("activities"in e){let r=e.activities.map(e=>({...e,createdAt:new Date(e.createdAt)}));return{...e,notifiedAt:t,readAt:n,activities:r}}return{...e,notifiedAt:t,readAt:n}}function ew(e){let t=new Date(e.deletedAt);return{...e,deletedAt:t}}function eS(e){let t=new Date(e.deletedAt);return{...e,deletedAt:t}}function eE(e){return"public"===e.type?e.publicApiKey:e.token.raw}function ex(e,t,n){let r=new URL(t,e);return void 0!==n&&(r.search=(n instanceof URLSearchParams?n:function(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))null!=r&&t.set(n,r.toString());return t}(n)).toString()),r.toString()}function ek(e,...t){return e.reduce((e,n,r)=>e+encodeURIComponent(t[r-1]??"")+n)}var eT=eC(0),eO=eC(1),eI=eT+eC(-1);function eC(e){let t=32+(e<0?95+e:e);if(t<32||t>126)throw Error(`Invalid n value: ${e}`);return String.fromCharCode(t)}function eR(e,t){return void 0!==e&&void 0!==t?function(e,t){if(e<t)return eA(e,t);if(e>t)return eA(t,e);throw Error("Cannot compute value between two equal positions")}(e,t):void 0!==e?function(e){for(let t=0;t<=e.length-1;t++){let n=e.charCodeAt(t);if(!(n>=126))return e.substring(0,t)+String.fromCharCode(n+1)}return e+eO}(e):void 0!==t?function(e){let t=e.length-1;for(let n=0;n<=t;n++){let r=e.charCodeAt(n);if(!(r<=32)){if(n!==t)return e.substring(0,n+1);if(33===r)return e.substring(0,n)+eI;return e.substring(0,n)+String.fromCharCode(r-1)}}return eO}(t):eO}function eA(e,t){let n=0,r=e.length,i=t.length;for(;;){let o=n<r?e.charCodeAt(n):32,a=n<i?t.charCodeAt(n):126;if(o===a){n++;continue}if(a-o!=1){var s;return((s=n)<e.length?e.substring(0,s):e+eT.repeat(s-e.length))+String.fromCharCode(a+o>>1)}{let t=n+1,r=e.substring(0,t);return r.length<t&&(r+=eT.repeat(t-r.length)),r+eA(e.substring(t),"")}}}function eP(e){return!function(e){if(""===e)return!1;let t=e.length-1,n=e.charCodeAt(t);if(n<33||n>126)return!1;for(let n=0;n<t;n++){let t=e.charCodeAt(n);if(t<32||t>126)return!1}return!0}(e)?function(e){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t.push(r<32?32:r>126?126:r)}for(;t.length>0&&32===t[t.length-1];)t.length--;return t.length>0?String.fromCharCode(...t):eO}(e):e}var eM=((s=eM||{})[s.INIT=0]="INIT",s[s.SET_PARENT_KEY=1]="SET_PARENT_KEY",s[s.CREATE_LIST=2]="CREATE_LIST",s[s.UPDATE_OBJECT=3]="UPDATE_OBJECT",s[s.CREATE_OBJECT=4]="CREATE_OBJECT",s[s.DELETE_CRDT=5]="DELETE_CRDT",s[s.DELETE_OBJECT_KEY=6]="DELETE_OBJECT_KEY",s[s.CREATE_MAP=7]="CREATE_MAP",s[s.CREATE_REGISTER=8]="CREATE_REGISTER",s);function eL(e,t,n=eP(t)){return Object.freeze({type:"HasParent",node:e,key:t,pos:n})}var eN=Object.freeze({type:"NoParent"}),eD=class{constructor(){this._parent=eN}_getParentKeyOrThrow(){switch(this.parent.type){case"HasParent":return this.parent.key;case"NoParent":throw Error("Parent key is missing");case"Orphaned":return this.parent.oldKey;default:return p(this.parent,"Unknown state")}}get _parentPos(){switch(this.parent.type){case"HasParent":return this.parent.pos;case"NoParent":throw Error("Parent key is missing");case"Orphaned":return this.parent.oldPos;default:return p(this.parent,"Unknown state")}}get _pool(){return this.__pool}get roomId(){return this.__pool?this.__pool.roomId:null}get _id(){return this.__id}get parent(){return this._parent}get _parentKey(){switch(this.parent.type){case"HasParent":return this.parent.key;case"NoParent":return null;case"Orphaned":return this.parent.oldKey;default:return p(this.parent,"Unknown state")}}_apply(e,t){return 5===e.type&&"HasParent"===this.parent.type?this.parent.node._detachChild(this):{modified:!1}}_setParentLink(e,t){switch(this.parent.type){case"HasParent":if(this.parent.node!==e)throw Error("Cannot set parent: node already has a parent");this._parent=eL(e,t);return;case"Orphaned":case"NoParent":this._parent=eL(e,t);return;default:return p(this.parent,"Unknown state")}}_attach(e,t){if(this.__id||this.__pool)throw Error("Cannot attach node: already attached");t.addNode(e,this),this.__id=e,this.__pool=t}_detach(){switch(this.__pool&&this.__id&&this.__pool.deleteNode(this.__id),this.parent.type){case"HasParent":this._parent=function(e,t=eP(e)){return Object.freeze({type:"Orphaned",oldKey:e,oldPos:t})}(this.parent.key,this.parent.pos);break;case"NoParent":this._parent=eN;break;case"Orphaned":break;default:p(this.parent,"Unknown state")}this.__pool=void 0}invalidate(){(void 0!==this._cachedImmutable||void 0!==this._cachedTreeNode)&&(this._cachedImmutable=void 0,this._cachedTreeNode=void 0,"HasParent"===this.parent.type&&this.parent.node.invalidate())}toTreeNode(e){return(void 0===this._cachedTreeNode||this._cachedTreeNodeKey!==e)&&(this._cachedTreeNodeKey=e,this._cachedTreeNode=this._toTreeNode(e)),this._cachedTreeNode}toImmutable(){return void 0===this._cachedImmutable&&(this._cachedImmutable=this._toImmutable()),this._cachedImmutable}},e$=((o=e$||{})[o.OBJECT=0]="OBJECT",o[o.LIST=1]="LIST",o[o.MAP=2]="MAP",o[o.REGISTER=3]="REGISTER",o),ej=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t<63?"_":"-",""),eF=class e extends eD{constructor(e){super(),this._data=e}get data(){return this._data}static _deserialize([t,n],r,i){let s=new e(n.data);return s._attach(t,i),s}_toOps(e,t,n){if(void 0===this._id)throw Error("Cannot serialize register if parentId or parentKey is undefined");return[{type:8,opId:n?.generateOpId(),id:this._id,parentId:e,parentKey:t,data:this.data}]}_serialize(){if("HasParent"!==this.parent.type)throw Error("Cannot serialize LiveRegister if parent is missing");return{type:3,parentId:g(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key,data:this.data}}_attachChild(e){throw Error("Method not implemented.")}_detachChild(e){throw Error("Method not implemented.")}_apply(e,t){return super._apply(e,t)}_toTreeNode(e){return{type:"Json",id:this._id??ej(),key:e,payload:this._data}}_toImmutable(){return this._data}clone(){return D(this.data)}};function eU(e,t){let n=e._parentPos,r=t._parentPos;return n===r?0:n<r?-1:1}var eq=class e extends eD{constructor(e){let t;for(let n of(super(),this._items=[],this._implicitlyDeletedItems=new WeakSet,this._unacknowledgedSets=new Map,e)){let e=eR(t),r=e6(n);r._setParentLink(this,e),this._items.push(r),t=e}}static _deserialize([t],n,r){let i=new e([]);i._attach(t,r);let s=n.get(t);if(void 0===s)return i;for(let[e,t]of s){let s=e0([e,t],n,r);s._setParentLink(i,t.parentKey),i._insertAndSort(s)}return i}_toOps(e,t,n){if(void 0===this._id)throw Error("Cannot serialize item is not attached");let r=[],i={id:this._id,opId:n?.generateOpId(),type:2,parentId:e,parentKey:t};for(let e of(r.push(i),this._items)){let t=e._getParentKeyOrThrow(),i=eQ(e._toOps(this._id,t,n),void 0),s=i[0].opId;void 0!==s&&this._unacknowledgedSets.set(t,s),r.push(...i)}return r}_insertAndSort(e){this._items.push(e),this._sortItems()}_sortItems(){this._items.sort(eU),this.invalidate()}_indexOfPosition(e){return this._items.findIndex(t=>t._getParentKeyOrThrow()===e)}_attach(e,t){for(let n of(super._attach(e,t),this._items))n._attach(t.generateId(),t)}_detach(){for(let e of(super._detach(),this._items))e._detach()}_applySetRemote(e){if(void 0===this._pool)throw Error("Can't attach child if managed pool is not present");let{id:t,parentKey:n}=e,r=eZ(e);r._attach(t,this._pool),r._setParentLink(this,n);let i=e.deletedId,s=this._indexOfPosition(n);if(-1!==s){let t=this._items[s];if(t._id===i)return t._detach(),this._items[s]=r,{modified:eH(this,[ez(s,r)]),reverse:[]};{this._implicitlyDeletedItems.add(t),this._items[s]=r;let n=[ez(s,r)],i=this._detachItemAssociatedToSetOperation(e.deletedId);return i&&n.push(i),{modified:eH(this,n),reverse:[]}}}{let t=[],i=this._detachItemAssociatedToSetOperation(e.deletedId);return i&&t.push(i),this._insertAndSort(r),t.push(eV(this._indexOfPosition(n),r)),{reverse:[],modified:eH(this,t)}}}_applySetAck(e){if(void 0===this._pool)throw Error("Can't attach child if managed pool is not present");let t=[],n=this._detachItemAssociatedToSetOperation(e.deletedId);n&&t.push(n);let r=this._unacknowledgedSets.get(e.parentKey);if(void 0!==r){if(r!==e.opId)return 0===t.length?{modified:!1}:{modified:eH(this,t),reverse:[]};this._unacknowledgedSets.delete(e.parentKey)}let i=this._indexOfPosition(e.parentKey),s=this._items.find(t=>t._id===e.id);if(void 0!==s){if(s._parentKey===e.parentKey)return{modified:t.length>0&&eH(this,t),reverse:[]};if(-1!==i){this._implicitlyDeletedItems.add(this._items[i]);let[e]=this._items.splice(i,1);t.push(eW(i,e))}let n=this._items.indexOf(s);s._setParentLink(this,e.parentKey),this._sortItems();let r=this._items.indexOf(s);return r!==n&&t.push(eG(n,r,s)),{modified:t.length>0&&eH(this,t),reverse:[]}}{let n=this._pool.getNode(e.id);if(n&&this._implicitlyDeletedItems.has(n)){n._setParentLink(this,e.parentKey),this._implicitlyDeletedItems.delete(n),this._insertAndSort(n);let r=this._items.indexOf(n);return{modified:eH(this,[-1===i?eV(r,n):ez(r,n),...t]),reverse:[]}}{-1!==i&&this._items.splice(i,1);let{newItem:n,newIndex:r}=this._createAttachItemAndSort(e,e.parentKey);return{modified:eH(this,[-1===i?eV(r,n):ez(r,n),...t]),reverse:[]}}}}_detachItemAssociatedToSetOperation(e){if(void 0===e||void 0===this._pool)return null;let t=this._pool.getNode(e);if(void 0===t)return null;let n=this._detachChild(t);return!1===n.modified?null:n.modified.updates[0]}_applyRemoteInsert(e){if(void 0===this._pool)throw Error("Can't attach child if managed pool is not present");let t=eP(e.parentKey),n=this._indexOfPosition(t);-1!==n&&this._shiftItemPosition(n,t);let{newItem:r,newIndex:i}=this._createAttachItemAndSort(e,t);return{modified:eH(this,[eV(i,r)]),reverse:[]}}_applyInsertAck(e){let t=this._items.find(t=>t._id===e.id),n=eP(e.parentKey),r=this._indexOfPosition(n);if(t){if(t._parentKey===n)return{modified:!1};{let e=this._items.indexOf(t);-1!==r&&this._shiftItemPosition(r,n),t._setParentLink(this,n),this._sortItems();let i=this._indexOfPosition(n);return i===e?{modified:!1}:{modified:eH(this,[eG(e,i,t)]),reverse:[]}}}{let t=g(this._pool).getNode(e.id);if(t&&this._implicitlyDeletedItems.has(t))return t._setParentLink(this,n),this._implicitlyDeletedItems.delete(t),this._insertAndSort(t),{modified:eH(this,[eV(this._indexOfPosition(n),t)]),reverse:[]};{-1!==r&&this._shiftItemPosition(r,n);let{newItem:t,newIndex:i}=this._createAttachItemAndSort(e,n);return{modified:eH(this,[eV(i,t)]),reverse:[]}}}}_applyInsertUndoRedo(e){let{id:t,parentKey:n}=e,r=eZ(e);if(this._pool?.getNode(t)!==void 0)return{modified:!1};r._attach(t,g(this._pool)),r._setParentLink(this,n);let i=this._indexOfPosition(n),s=n;return -1!==i&&(s=eR(this._items[i]?._parentPos,this._items[i+1]?._parentPos),r._setParentLink(this,s)),this._insertAndSort(r),{modified:eH(this,[eV(this._indexOfPosition(s),r)]),reverse:[{type:5,id:t}]}}_applySetUndoRedo(e){let{id:t,parentKey:n}=e,r=eZ(e);if(this._pool?.getNode(t)!==void 0)return{modified:!1};this._unacknowledgedSets.set(n,g(e.opId));let i=this._indexOfPosition(n);if(r._attach(t,g(this._pool)),r._setParentLink(this,n),-1===i)return this._insertAndSort(r),this._detachItemAssociatedToSetOperation(e.deletedId),{reverse:[{type:5,id:t}],modified:eH(this,[eV(this._indexOfPosition(n),r)])};{let t=this._items[i];t._detach(),this._items[i]=r;let s=eQ(t._toOps(g(this._id),n,this._pool),e.id),o=[ez(i,r)],a=this._detachItemAssociatedToSetOperation(e.deletedId);return a&&o.push(a),{modified:eH(this,o),reverse:s}}}_attachChild(e,t){let n;if(void 0===this._pool)throw Error("Can't attach child if managed pool is not present");return!1!==(n="set"===e.intent?1===t?this._applySetRemote(e):2===t?this._applySetAck(e):this._applySetUndoRedo(e):1===t?this._applyRemoteInsert(e):2===t?this._applyInsertAck(e):this._applyInsertUndoRedo(e)).modified&&this.invalidate(),n}_detachChild(e){if(e){let t=g(e._parentKey),n=e._toOps(g(this._id),t,this._pool),r=this._items.indexOf(e);if(-1===r)return{modified:!1};let[i]=this._items.splice(r,1);return this.invalidate(),e._detach(),{modified:eH(this,[eW(r,i)]),reverse:n}}return{modified:!1}}_applySetChildKeyRemote(e,t){if(this._implicitlyDeletedItems.has(t))return this._implicitlyDeletedItems.delete(t),t._setParentLink(this,e),this._insertAndSort(t),{modified:eH(this,[eV(this._items.indexOf(t),t)]),reverse:[]};if(e===t._parentKey)return{modified:!1};let n=this._indexOfPosition(e);if(-1===n){let n=this._items.indexOf(t);t._setParentLink(this,e),this._sortItems();let r=this._items.indexOf(t);return r===n?{modified:!1}:{modified:eH(this,[eG(n,r,t)]),reverse:[]}}{this._items[n]._setParentLink(this,eR(e,this._items[n+1]?._parentPos));let r=this._items.indexOf(t);t._setParentLink(this,e),this._sortItems();let i=this._items.indexOf(t);return i===r?{modified:!1}:{modified:eH(this,[eG(r,i,t)]),reverse:[]}}}_applySetChildKeyAck(e,t){let n=g(t._parentKey);if(this._implicitlyDeletedItems.has(t)){let n=this._indexOfPosition(e);return this._implicitlyDeletedItems.delete(t),-1!==n&&this._items[n]._setParentLink(this,eR(e,this._items[n+1]?._parentPos)),t._setParentLink(this,e),this._insertAndSort(t),{modified:!1}}{if(e===n)return{modified:!1};let r=this._items.indexOf(t),i=this._indexOfPosition(e);-1!==i&&this._items[i]._setParentLink(this,eR(e,this._items[i+1]?._parentPos)),t._setParentLink(this,e),this._sortItems();let s=this._items.indexOf(t);return r===s?{modified:!1}:{modified:eH(this,[eG(r,s,t)]),reverse:[]}}}_applySetChildKeyUndoRedo(e,t){let n=g(t._parentKey),r=this._items.indexOf(t),i=this._indexOfPosition(e);-1!==i&&this._items[i]._setParentLink(this,eR(e,this._items[i+1]?._parentPos)),t._setParentLink(this,e),this._sortItems();let s=this._items.indexOf(t);return r===s?{modified:!1}:{modified:eH(this,[eG(r,s,t)]),reverse:[{type:1,id:g(t._id),parentKey:n}]}}_setChildKey(e,t,n){return 1===n?this._applySetChildKeyRemote(e,t):2===n?this._applySetChildKeyAck(e,t):this._applySetChildKeyUndoRedo(e,t)}_apply(e,t){return super._apply(e,t)}_serialize(){if("HasParent"!==this.parent.type)throw Error("Cannot serialize LiveList if parent is missing");return{type:1,parentId:g(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key}}get length(){return this._items.length}push(e){return this._pool?.assertStorageIsWritable(),this.insert(e,this.length)}insert(e,t){if(this._pool?.assertStorageIsWritable(),t<0||t>this._items.length)throw Error(`Cannot insert list item at index "${t}". index should be between 0 and ${this._items.length}`);let n=eR(this._items[t-1]?this._items[t-1]._parentPos:void 0,this._items[t]?this._items[t]._parentPos:void 0),r=e6(e);if(r._setParentLink(this,n),this._insertAndSort(r),this._pool&&this._id){let e=this._pool.generateId();r._attach(e,this._pool),this._pool.dispatch(r._toOps(this._id,n,this._pool),[{type:5,id:e}],new Map([[this._id,eH(this,[eV(t,r)])]]))}}move(e,t){if(this._pool?.assertStorageIsWritable(),t<0)throw Error("targetIndex cannot be less than 0");if(t>=this._items.length)throw Error("targetIndex cannot be greater or equal than the list length");if(e<0)throw Error("index cannot be less than 0");if(e>=this._items.length)throw Error("index cannot be greater or equal than the list length");let n=null,r=null;e<t?(r=t===this._items.length-1?void 0:this._items[t+1]._parentPos,n=this._items[t]._parentPos):(r=this._items[t]._parentPos,n=0===t?void 0:this._items[t-1]._parentPos);let i=eR(n,r),s=this._items[e],o=s._getParentKeyOrThrow();if(s._setParentLink(this,i),this._sortItems(),this._pool&&this._id){let n=new Map([[this._id,eH(this,[eG(e,t,s)])]]);this._pool.dispatch([{type:1,id:g(s._id),opId:this._pool.generateOpId(),parentKey:i}],[{type:1,id:g(s._id),parentKey:o}],n)}}delete(e){if(this._pool?.assertStorageIsWritable(),e<0||e>=this._items.length)throw Error(`Cannot delete list item at index "${e}". index should be between 0 and ${this._items.length-1}`);let t=this._items[e];t._detach();let[n]=this._items.splice(e,1);if(this.invalidate(),this._pool){let r=t._id;if(r){let i=new Map;i.set(g(this._id),eH(this,[eW(e,n)])),this._pool.dispatch([{id:r,opId:this._pool.generateOpId(),type:5}],t._toOps(g(this._id),t._getParentKeyOrThrow()),i)}}}clear(){if(this._pool?.assertStorageIsWritable(),this._pool){let e=[],t=[],n=[];for(let r of this._items){r._detach();let i=r._id;i&&(e.push({type:5,id:i,opId:this._pool.generateOpId()}),t.push(...r._toOps(g(this._id),r._getParentKeyOrThrow())),n.push(eW(0,r)))}this._items=[],this.invalidate();let r=new Map;r.set(g(this._id),eH(this,n)),this._pool.dispatch(e,t,r)}else{for(let e of this._items)e._detach();this._items=[],this.invalidate()}}set(e,t){if(this._pool?.assertStorageIsWritable(),e<0||e>=this._items.length)throw Error(`Cannot set list item at index "${e}". index should be between 0 and ${this._items.length-1}`);let n=this._items[e],r=n._getParentKeyOrThrow(),i=n._id;n._detach();let s=e6(t);if(s._setParentLink(this,r),this._items[e]=s,this.invalidate(),this._pool&&this._id){let t=this._pool.generateId();s._attach(t,this._pool);let o=new Map;o.set(this._id,eH(this,[ez(e,s)]));let a=eQ(s._toOps(this._id,r,this._pool),i);this._unacknowledgedSets.set(r,g(a[0].opId));let l=eQ(n._toOps(this._id,r,void 0),t);this._pool.dispatch(a,l,o)}}toArray(){return this._items.map(e=>e4(e))}every(e){return this.toArray().every(e)}filter(e){return this.toArray().filter(e)}find(e){return this.toArray().find(e)}findIndex(e){return this.toArray().findIndex(e)}forEach(e){return this.toArray().forEach(e)}get(e){if(!(e<0)&&!(e>=this._items.length))return e4(this._items[e])}indexOf(e,t){return this.toArray().indexOf(e,t)}lastIndexOf(e,t){return this.toArray().lastIndexOf(e,t)}map(e){return this._items.map((t,n)=>e(e4(t),n))}some(e){return this.toArray().some(e)}[Symbol.iterator](){return new eB(this._items)}_createAttachItemAndSort(e,t){let n=eZ(e);return n._attach(e.id,g(this._pool)),n._setParentLink(this,t),this._insertAndSort(n),{newItem:n,newIndex:this._indexOfPosition(t)}}_shiftItemPosition(e,t){let n=eR(t,this._items.length>e+1?this._items[e+1]?._parentPos:void 0);this._items[e]._setParentLink(this,n)}_toTreeNode(e){return{type:"LiveList",id:this._id??ej(),key:e,payload:this._items.map((e,t)=>e.toTreeNode(t.toString()))}}toImmutable(){return super.toImmutable()}_toImmutable(){return this._items.map(e=>e.toImmutable())}clone(){return new e(this._items.map(e=>e.clone()))}},eB=class{constructor(e){this._innerIterator=e[Symbol.iterator]()}[Symbol.iterator](){return this}next(){let e=this._innerIterator.next();return e.done?{done:!0,value:void 0}:{value:e4(e.value)}}};function eH(e,t){return{node:e,type:"LiveList",updates:t}}function ez(e,t){return{index:e,type:"set",item:t instanceof eF?t.data:t}}function eW(e,t){return{type:"delete",index:e,deletedItem:t instanceof eF?t.data:t}}function eV(e,t){return{index:e,type:"insert",item:t instanceof eF?t.data:t}}function eG(e,t,n){return{type:"move",index:t,item:n instanceof eF?n.data:n,previousIndex:e}}function eQ(e,t){return e.map((e,n)=>0===n?{...e,intent:"set",deletedId:t}:e)}var eK=e=>e,eJ=class e extends eD{constructor(e){if(super(),this.unacknowledgedSet=new Map,e){let t=[];for(let[n,r]of e){let e=e6(r);e._setParentLink(this,n),t.push([n,e])}this._map=new Map(t)}else this._map=new Map}_toOps(e,t,n){if(void 0===this._id)throw Error("Cannot serialize item is not attached");let r=[],i={id:this._id,opId:n?.generateOpId(),type:7,parentId:e,parentKey:t};for(let[e,t]of(r.push(i),this._map))r.push(...t._toOps(this._id,e,n));return r}static _deserialize([t,n],r,i){let s=new e;s._attach(t,i);let o=r.get(t);if(void 0===o)return s;for(let[e,t]of o){let n=e0([e,t],r,i);n._setParentLink(s,t.parentKey),s._map.set(t.parentKey,n),s.invalidate()}return s}_attach(e,t){for(let[n,r]of(super._attach(e,t),this._map))e2(r)&&r._attach(t.generateId(),t)}_attachChild(e,t){let n;if(void 0===this._pool)throw Error("Can't attach child if managed pool is not present");let{id:r,parentKey:i,opId:s}=e,o=eZ(e);if(void 0!==this._pool.getNode(r))return{modified:!1};if(2===t){let e=this.unacknowledgedSet.get(i);if(e===s)return this.unacknowledgedSet.delete(i),{modified:!1};if(void 0!==e)return{modified:!1}}else 1===t&&this.unacknowledgedSet.delete(i);let a=this._map.get(i);if(a){let e=g(this._id);n=a._toOps(e,i),a._detach()}else n=[{type:5,id:r}];return o._setParentLink(this,i),o._attach(r,this._pool),this._map.set(i,o),this.invalidate(),{modified:{node:this,type:"LiveMap",updates:{[i]:{type:"update"}}},reverse:n}}_detach(){for(let e of(super._detach(),this._map.values()))e._detach()}_detachChild(e){let t=g(this._id),n=g(e._parentKey),r=e._toOps(t,n,this._pool);for(let[t,n]of this._map)n===e&&(this._map.delete(t),this.invalidate());return e._detach(),{modified:{node:this,type:"LiveMap",updates:{[n]:{type:"delete"}}},reverse:r}}_serialize(){if("HasParent"!==this.parent.type)throw Error("Cannot serialize LiveMap if parent is missing");return{type:2,parentId:g(this.parent.node._id,"Parent node expected to have ID"),parentKey:this.parent.key}}get(e){let t=this._map.get(e);if(void 0!==t)return e4(t)}set(e,t){this._pool?.assertStorageIsWritable();let n=this._map.get(e);n&&n._detach();let r=e6(t);if(r._setParentLink(this,e),this._map.set(e,r),this.invalidate(),this._pool&&this._id){let t=this._pool.generateId();r._attach(t,this._pool);let i=new Map;i.set(this._id,{node:this,type:"LiveMap",updates:{[e]:{type:"update"}}});let s=r._toOps(this._id,e,this._pool);this.unacknowledgedSet.set(e,g(s[0].opId)),this._pool.dispatch(r._toOps(this._id,e,this._pool),n?n._toOps(this._id,e):[{type:5,id:t}],i)}}get size(){return this._map.size}has(e){return this._map.has(e)}delete(e){this._pool?.assertStorageIsWritable();let t=this._map.get(e);if(void 0===t)return!1;if(t._detach(),this._map.delete(e),this.invalidate(),this._pool&&t._id){let n=g(this._id),r=new Map;r.set(n,{node:this,type:"LiveMap",updates:{[e]:{type:"delete"}}}),this._pool.dispatch([{type:5,id:t._id,opId:this._pool.generateOpId()}],t._toOps(n,e),r)}return!0}entries(){let e=this._map.entries();return{[Symbol.iterator](){return this},next(){let t=e.next();return t.done?{done:!0,value:void 0}:{value:[t.value[0],e4(t.value[1])]}}}}[Symbol.iterator](){return this.entries()}keys(){return this._map.keys()}values(){let e=this._map.values();return{[Symbol.iterator](){return this},next(){let t=e.next();return t.done?{done:!0,value:void 0}:{value:e4(t.value)}}}}forEach(e){for(let t of this)e(t[1],t[0],this)}_toTreeNode(e){return{type:"LiveMap",id:this._id??ej(),key:e,payload:Array.from(this._map.entries()).map(([e,t])=>t.toTreeNode(e))}}toImmutable(){return super.toImmutable()}_toImmutable(){let e=new Map;for(let[t,n]of this._map)e.set(t,n.toImmutable());return eK(e)}clone(){return new e(Array.from(this._map).map(([e,t])=>[e,t.clone()]))}},eX=class e extends eD{static _buildRootAndParentToChildren(e){let t=new Map,n=null;for(let[r,i]of e)if(0!==i.type||void 0!==i.parentId&&void 0!==i.parentKey){let e=[r,i],n=t.get(i.parentId);void 0!==n?n.push(e):t.set(i.parentId,[e])}else n=[r,i];if(null===n)throw Error("Root can't be null");return[n,t]}static _fromItems(t,n){let[r,i]=e._buildRootAndParentToChildren(t);return e._deserialize(r,i,n)}constructor(e={}){super(),this._propToLastUpdate=new Map;let t=j(e);for(let e of Object.keys(t)){let n=t[e];e2(n)&&n._setParentLink(this,e)}this._map=new Map(Object.entries(t))}_toOps(e,t,n){if(void 0===this._id)throw Error("Cannot serialize item is not attached");let r=n?.generateOpId(),i=[],s={type:4,id:this._id,opId:r,parentId:e,parentKey:t,data:{}};for(let[e,t]of(i.push(s),this._map))e2(t)?i.push(...t._toOps(this._id,e,n)):s.data[e]=t;return i}static _deserialize([t,n],r,i){let s=new e(n.data);return s._attach(t,i),this._deserializeChildren(s,r,i)}static _deserializeChildren(e,t,n){let r=t.get(g(e._id));if(void 0===r)return e;for(let[i,s]of r){let r=function([e,t],n,r){switch(t.type){case 0:return eX._deserialize([e,t],n,r);case 1:return eq._deserialize([e,t],n,r);case 2:return eJ._deserialize([e,t],n,r);case 3:return t.data;default:throw Error("Unexpected CRDT type")}}([i,s],t,n);e1(r)&&r._setParentLink(e,s.parentKey),e._map.set(s.parentKey,r),e.invalidate()}return e}_attach(e,t){for(let[n,r]of(super._attach(e,t),this._map))e2(r)&&r._attach(t.generateId(),t)}_attachChild(e,t){let n;if(void 0===this._pool)throw Error("Can't attach child if managed pool is not present");let{id:r,opId:i,parentKey:s}=e,o=eY(e);if(void 0!==this._pool.getNode(r))return this._propToLastUpdate.get(s)===i&&this._propToLastUpdate.delete(s),{modified:!1};if(0===t)this._propToLastUpdate.set(s,g(i));else if(void 0===this._propToLastUpdate.get(s));else if(this._propToLastUpdate.get(s)===i)return this._propToLastUpdate.delete(s),{modified:!1};else return{modified:!1};let a=g(this._id),l=this._map.get(s);return e2(l)?(n=l._toOps(a,s),l._detach()):n=void 0===l?[{type:6,id:a,key:s}]:[{type:3,id:a,data:{[s]:l}}],this._map.set(s,o),this.invalidate(),e1(o)&&(o._setParentLink(this,s),o._attach(r,this._pool)),{reverse:n,modified:{node:this,type:"LiveObject",updates:{[s]:{type:"update"}}}}}_detachChild(e){if(e){let t=g(this._id),n=g(e._parentKey),r=e._toOps(t,n,this._pool);for(let[t,n]of this._map)n===e&&(this._map.delete(t),this.invalidate());return e._detach(),{modified:{node:this,type:"LiveObject",updates:{[n]:{type:"delete"}}},reverse:r}}return{modified:!1}}_detach(){for(let e of(super._detach(),this._map.values()))e2(e)&&e._detach()}_apply(e,t){return 3===e.type?this._applyUpdate(e,t):6===e.type?this._applyDeleteObjectKey(e,t):super._apply(e,t)}_serialize(){let e={};for(let[t,n]of this._map)e2(n)||(e[t]=n);return"HasParent"===this.parent.type&&this.parent.node._id?{type:0,parentId:this.parent.node._id,parentKey:this.parent.key,data:e}:{type:0,data:e}}_applyUpdate(e,t){let n=!1,r=g(this._id),i=[],s={type:3,id:r,data:{}};for(let t in e.data){let e=this._map.get(t);e2(e)?(i.push(...e._toOps(r,t)),e._detach()):void 0!==e?s.data[t]=e:void 0===e&&i.push({type:6,id:r,key:t})}let o={};for(let r in e.data){let i=e.data[r];if(void 0===i)continue;if(t)this._propToLastUpdate.set(r,g(e.opId));else if(void 0===this._propToLastUpdate.get(r))n=!0;else{if(this._propToLastUpdate.get(r)!==e.opId)continue;this._propToLastUpdate.delete(r);continue}let s=this._map.get(r);e2(s)&&s._detach(),n=!0,o[r]={type:"update"},this._map.set(r,i),this.invalidate()}return 0!==Object.keys(s.data).length&&i.unshift(s),n?{modified:{node:this,type:"LiveObject",updates:o},reverse:i}:{modified:!1}}_applyDeleteObjectKey(e,t){let n=e.key;if(!1===this._map.has(n)||!t&&void 0!==this._propToLastUpdate.get(n))return{modified:!1};let r=this._map.get(n),i=g(this._id),s=[];return e2(r)?(s=r._toOps(i,e.key),r._detach()):void 0!==r&&(s=[{type:3,id:i,data:{[n]:r}}]),this._map.delete(n),this.invalidate(),{modified:{node:this,type:"LiveObject",updates:{[e.key]:{type:"delete"}}},reverse:s}}toObject(){return Object.fromEntries(this._map)}set(e,t){this._pool?.assertStorageIsWritable(),this.update({[e]:t})}get(e){return this._map.get(e)}delete(e){let t;this._pool?.assertStorageIsWritable();let n=this._map.get(e);if(void 0===n)return;if(void 0===this._pool||void 0===this._id){e2(n)&&n._detach(),this._map.delete(e),this.invalidate();return}e2(n)?(n._detach(),t=n._toOps(this._id,e)):t=[{type:3,data:{[e]:n},id:this._id}],this._map.delete(e),this.invalidate();let r=new Map;r.set(this._id,{node:this,type:"LiveObject",updates:{[e]:{type:"delete"}}}),this._pool.dispatch([{type:6,key:e,id:this._id,opId:this._pool.generateOpId()}],t,r)}update(e){if(this._pool?.assertStorageIsWritable(),void 0===this._pool||void 0===this._id){for(let t in e){let n=e[t];if(void 0===n)continue;let r=this._map.get(t);e2(r)&&r._detach(),e2(n)&&n._setParentLink(this,t),this._map.set(t,n),this.invalidate()}return}let t=[],n=[],r=this._pool.generateOpId(),i={},s={id:this._id,type:3,data:{}},o={};for(let a in e){let l=e[a];if(void 0===l)continue;let u=this._map.get(a);if(e2(u)?(n.push(...u._toOps(this._id,a)),u._detach()):void 0===u?n.push({type:6,id:this._id,key:a}):s.data[a]=u,e2(l)){l._setParentLink(this,a),l._attach(this._pool.generateId(),this._pool);let e=l._toOps(this._id,a,this._pool),n=e.find(e=>e.parentId===this._id);n&&this._propToLastUpdate.set(a,g(n.opId)),t.push(...e)}else i[a]=l,this._propToLastUpdate.set(a,r);this._map.set(a,l),this.invalidate(),o[a]={type:"update"}}0!==Object.keys(s.data).length&&n.unshift(s),0!==Object.keys(i).length&&t.unshift({opId:r,id:this._id,type:3,data:i});let a=new Map;a.set(this._id,{node:this,type:"LiveObject",updates:o}),this._pool.dispatch(t,n,a)}toImmutable(){return super.toImmutable()}toTreeNode(e){return super.toTreeNode(e)}_toTreeNode(e){let t=this._id??ej();return{type:"LiveObject",id:t,key:e,payload:Array.from(this._map.entries()).map(([e,n])=>e2(n)?n.toTreeNode(e):{type:"Json",id:`${t}:${e}`,key:e,payload:n})}}_toImmutable(){let e={};for(let[t,n]of this._map)e[t]=e1(n)?n.toImmutable():n;return e}clone(){return new e(Object.fromEntries(Array.from(this._map).map(([e,t])=>[e,e1(t)?t.clone():D(t)])))}};function eZ(e){return e6(eY(e))}function eY(e){switch(e.type){case 8:return e.data;case 4:return new eX(e.data);case 7:return new eJ;case 2:return new eq([]);default:return p(e,"Unknown creation Op")}}function e0([e,t],n,r){switch(t.type){case 0:return eX._deserialize([e,t],n,r);case 1:return eq._deserialize([e,t],n,r);case 2:return eJ._deserialize([e,t],n,r);case 3:return eF._deserialize([e,t],n,r);default:throw Error("Unexpected CRDT type")}}function e1(e){return e3(e)||e instanceof eJ||e5(e)}function e2(e){return e1(e)||e instanceof eF}function e3(e){return e instanceof eq}function e5(e){return e instanceof eX}function e4(e){return e instanceof eF?e.data:e instanceof eq||e instanceof eJ||e instanceof eX?e:p(e,"Unknown AbstractCrdt")}function e6(e){return e instanceof eX||e instanceof eJ||e instanceof eq?e:new eF(e)}function e8(e,t){return void 0===e?t:"LiveObject"===e.type&&"LiveObject"===t.type?function(e,t){let n=e.updates;for(let[e,r]of M(t.updates))n[e]=r;return{...t,updates:n}}(e,t):"LiveMap"===e.type&&"LiveMap"===t.type?function(e,t){let n=e.updates;for(let[e,r]of M(t.updates))n[e]=r;return{...t,updates:n}}(e,t):"LiveList"===e.type&&"LiveList"===t.type?function(e,t){let n=e.updates;return{...t,updates:n.concat(t.updates)}}(e,t):t}async function e7(e,t,n,r){let i=n.length>0?n[n.length-1]:0,s=0;for(;;){s++;let o=e();try{return await o}catch(e){if(r?.(e)||e instanceof e9)throw e;if(s>=t)throw Error(`Failed after ${t} attempts: ${String(e)}`)}let a=n[s-1]??i;E(`Attempt ${s} was unsuccessful. Retrying in ${a} milliseconds.`),await function(e){return new Promise(t=>setTimeout(t,e))}(a)}}var e9=class extends Error{constructor(e){super(e)}};function te(e,t){let n=[];for(let r=0,i=e.length;r<i;r+=t)n.push(e.slice(r,r+t));return n}function tt(e){return`${e}_${ej()}`}function tn(){return tt("th")}function tr(){return tt("cm")}function ti(e){return Array.isArray(e)}function ts(e){return!(null===e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e)&&!ti(e)}var to=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function ta(e){let t=[],n=Object.entries(e),r=[],i=[],s=[];return n.forEach(([e,t])=>{if(!to.test(e))throw Error("Key must only contain letters, numbers, _");tc(t)?r.push([e,t]):td(t)?i.push([e,t]):"object"!=typeof t||"startsWith"in t||s.push([e,t])}),t=[...tl(r),...tu(i)],s.forEach(([e,n])=>{let r=Object.entries(n),i=[],s=[];r.forEach(([t,n])=>{if(tm(t))throw Error("Key cannot be empty");tc(n)?i.push([tf(e,t),n]):td(n)&&s.push([tf(e,t),n])}),t=[...t,...tl(i),...tu(s)]}),t.map(({key:e,operator:t,value:n})=>th(e,t,tp(n))).join(" AND ")}var tl=e=>{let t=[];return e.forEach(([e,n])=>{t.push({key:e,operator:":",value:n})}),t},tu=e=>{let t=[];return e.forEach(([e,n])=>{"startsWith"in n&&"string"==typeof n.startsWith&&t.push({key:e,operator:"^",value:n.startsWith})}),t},tc=e=>"string"==typeof e||"number"==typeof e||"boolean"==typeof e,td=e=>"object"==typeof e&&null!==e&&"startsWith"in e,th=(e,t,n)=>`${e}${t}${n}`,tf=(e,t)=>t?`${e}[${JSON.stringify(t)}]`:e,tp=e=>{if("string"==typeof e){if(tm(e))throw Error("Value cannot be empty");return JSON.stringify(e)}return e.toString()},tm=e=>!e||""===e.toString().trim(),tg=((a=tg||{})[a.UPDATE_PRESENCE=100]="UPDATE_PRESENCE",a[a.BROADCAST_EVENT=103]="BROADCAST_EVENT",a[a.FETCH_STORAGE=200]="FETCH_STORAGE",a[a.UPDATE_STORAGE=201]="UPDATE_STORAGE",a[a.FETCH_YDOC=300]="FETCH_YDOC",a[a.UPDATE_YDOC=301]="UPDATE_YDOC",a);function tv(e,t){let n=!1,r={...e};return Object.keys(t).forEach(e=>{let i=t[e];r[e]!==i&&(void 0===i?delete r[e]:r[e]=i,n=!0)}),n?r:e}var ty=class{constructor(){this._ev=_()}get didInvalidate(){return this._ev.observable}invalidate(){void 0!==this._cache&&(this._cache=void 0,this._ev.notify())}get current(){return this._cache??(this._cache=this._toImmutable())}},t_=class extends ty{constructor(){super(),this._connections=new Map,this._presences=new Map,this._users=new Map}connectionIds(){return this._connections.keys()}_toImmutable(){return $(Array.from(this._presences.keys()).map(e=>this.getUser(Number(e))))}clearOthers(){this._connections=new Map,this._presences=new Map,this._users=new Map,this.invalidate()}_getUser(e){let t=this._connections.get(e),n=this._presences.get(e);if(void 0!==t&&void 0!==n)return function(e,t){let{connectionId:n,id:r,info:i}=e,s=el(e.scopes);return eK(j({connectionId:n,id:r,info:i,canWrite:s,canComment:eu(e.scopes),isReadOnly:!s,presence:t}))}(t,n)}getUser(e){let t=this._users.get(e);if(t)return t;let n=this._getUser(e);if(n)return this._users.set(e,n),n}_invalidateUser(e){this._users.has(e)&&this._users.delete(e),this.invalidate()}setConnection(e,t,n,r){this._connections.set(e,eK({connectionId:e,id:t,info:n,scopes:r})),this._presences.has(e)&&this._invalidateUser(e)}removeConnection(e){this._connections.delete(e),this._presences.delete(e),this._invalidateUser(e)}setOther(e,t){this._presences.set(e,eK(j(t))),this._connections.has(e)&&this._invalidateUser(e)}patchOther(e,t){let n=this._presences.get(e);if(void 0===n)return;let r=tv(n,t);n!==r&&(this._presences.set(e,eK(r)),this._invalidateUser(e))}},tb=class extends ty{constructor(e){super(),this._data=eK(j(e))}_toImmutable(){return this._data}patch(e){let t=this._data,n=tv(t,e);t!==n&&(this._data=eK(n),this.invalidate())}},tw=class extends ty{constructor(e){super(),this._value=eK(e)}_toImmutable(){return this._value}set(e){this._value=eK(e),this.invalidate()}},tS=class extends ty{constructor(...e){super();let t=e.pop();this._refs=e,this._refs.forEach(e=>{e.didInvalidate.subscribe(()=>this.invalidate())}),this._transform=t}_toImmutable(){return this._transform(...this._refs.map(e=>e.current))}};function tE(e,t){return{type:"User",id:`${t.connectionId}`,key:e,payload:{connectionId:t.connectionId,id:t.id,info:t.info,presence:t.presence,isReadOnly:!t.canWrite}}}var tx=[2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3,2e3],tk=class extends Error{constructor(e,t,n){super(e),this.message=e,this.status=t,this.details=n}};function tT(e){var t;let n=tI("throttle",e.throttle??100,16,1e3),r=tI("lostConnectionTimeout",e.lostConnectionTimeout??5e3,200,3e4,1e3),i=function(e){if(void 0!==e)return tI("backgroundKeepAliveTimeout",e,15e3)}(e.backgroundKeepAliveTimeout),s="string"==typeof(t=e.baseUrl)&&t.startsWith("http")?t:"https://api.liveblocks.io",o=function(e){let t=function(e){let{publicApiKey:t,authEndpoint:n}=e;if(void 0!==n&&void 0!==t)throw Error("You cannot simultaneously use `publicApiKey` and `authEndpoint` options. Please pick one and leave the other option unspecified. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClient");if("string"==typeof t){if(t.startsWith("sk_"))throw Error("Invalid `publicApiKey` option. The value you passed is a secret key, which should not be used from the client. Please only ever pass a public key here. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientPublicKey");if(!t.startsWith("pk_"))throw Error("Invalid key. Please use the public key format: pk_<public key>. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientPublicKey");return{type:"public",publicApiKey:t}}if("string"==typeof n)return{type:"private",url:n};if("function"==typeof n)return{type:"custom",callback:n};if(void 0!==n)throw Error("The `authEndpoint` option must be a string or a function. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClientAuthEndpoint");throw Error("Invalid Liveblocks client options. Please provide either a `publicApiKey` or `authEndpoint` option. They cannot both be empty. For more information: https://liveblocks.io/docs/api-reference/liveblocks-client#createClient")}(e),n=new Set,r=[],i=[],s=new Map;function o(e,t){return"comments:read"===e?t.includes("comments:read")||t.includes("comments:write")||t.includes("room:read")||t.includes("room:write"):"room:read"===e&&(t.includes("room:read")||t.includes("room:write"))}async function a(r){let i=e.polyfills?.fetch??("undefined"==typeof window?void 0:window.fetch);if("private"===t.type){if(void 0===i)throw new K("To use Liveblocks client in a non-DOM environment with a url as auth endpoint, you need to provide a fetch polyfill.");let e=ec((await ed(i,t.url,{room:r.roomId})).token);if(n.has(e.raw))throw new K("The same Liveblocks auth token was issued from the backend before. Caching Liveblocks tokens is not supported.");return e}if("custom"===t.type){let e=await t.callback(r.roomId);if(e&&"object"==typeof e){if("string"==typeof e.token)return ec(e.token);if("string"==typeof e.error){let t=`Authentication failed: ${"reason"in e&&"string"==typeof e.reason?e.reason:"Forbidden"}`;if("forbidden"===e.error)throw new K(t);throw Error(t)}}throw Error('Your authentication callback function should return a token, but it did not. Hint: the return value should look like: { token: "..." }')}throw Error("Unexpected authentication type. Must be private or custom.")}return{reset:function(){n.clear(),r.length=0,i.length=0,s.clear()},getAuthValue:async function(e){let l;if("public"===t.type)return{type:"public",publicApiKey:t.publicApiKey};let u=function(e){let t=Math.ceil(Date.now()/1e3);for(let n=r.length-1;n>=0;n--){let s=r[n];if(i[n]<=t){r.splice(n,1),i.splice(n,1);continue}if("id"===s.parsed.k)return s;if("acc"===s.parsed.k){if(!e.roomId&&0===Object.entries(s.parsed.perms).length)return s;for(let[t,n]of Object.entries(s.parsed.perms))if(e.roomId){if(t.includes("*")&&e.roomId.startsWith(t.replace("*",""))||e.roomId===t&&o(e.requestedScope,n))return s}else if(t.includes("*")&&o(e.requestedScope,n))return s}}}(e);if(void 0!==u)return{type:"secret",token:u};e.roomId?void 0===(l=s.get(e.roomId))&&(l=a(e),s.set(e.roomId,l)):void 0===(l=s.get("liveblocks-user-token"))&&(l=a(e),s.set("liveblocks-user-token",l));try{let e=await l,t=Math.floor(Date.now()/1e3)+(e.parsed.exp-e.parsed.iat)-30;return n.add(e.raw),"sec-legacy"!==e.parsed.k&&(r.push(e),i.push(t)),{type:"secret",token:e}}finally{e.roomId?s.delete(e.roomId):s.delete("liveblocks-user-token")}}}}(e),a=new Map;function l(e){let t=()=>{if(e.unsubs.delete(t)){if(0===e.unsubs.size){var n;(n=e.room).id,a.delete(n.id),n.destroy()}}else E("This leave function was already called. Calling it more than once has no effect.")};return e.unsubs.add(t),{room:e.room,leave:t}}let u=ev(null),d=function({baseUrl:e,authManager:t,currentUserIdStore:n,fetcher:r}){async function i(i,s,o){let a;i.startsWith("/v2/c/")||A("Expected a /v2/c/* endpoint");let l=await t.getAuthValue({requestedScope:"comments:read"});if("secret"===l.type&&"acc"===l.token.parsed.k){let e=l.token.parsed.uid;n.set(()=>e)}let u=ex(e,i,o),d=await r(u.toString(),{...s,headers:{...s?.headers,Authorization:`Bearer ${eE(l)}`,"X-LB-Client":c||"dev"}});if(!d.ok&&d.status>=400&&d.status<600){let e;try{let t=await d.json();e=new tO(t.message,d.status,t)}catch{e=new tO(d.statusText,d.status)}throw e}try{a=await d.json()}catch{a={}}return a}async function s(e){let t=await i(ek`/v2/c/inbox-notifications`,void 0,{cursor:e?.cursor,limit:50});return{inboxNotifications:t.inboxNotifications.map(eb),threads:t.threads.map(e_),nextCursor:t.meta.nextCursor,requestedAt:new Date(t.meta.requestedAt)}}async function o(e){let t=await i(ek`/v2/c/inbox-notifications/delta`,void 0,{since:e.toISOString()});return{inboxNotifications:{updated:t.inboxNotifications.map(eb),deleted:t.deletedInboxNotifications.map(eS)},threads:{updated:t.threads.map(e_),deleted:t.deletedThreads.map(ew)},requestedAt:new Date(t.meta.requestedAt)}}async function a(){let{count:e}=await i(ek`/v2/c/inbox-notifications/count`);return e}async function l(){await i(ek`/v2/c/inbox-notifications/read`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inboxNotificationIds:"all"})})}async function u(e){await i(ek`/v2/c/inbox-notifications/read`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inboxNotificationIds:e})})}let d=new em(async e=>{let t=e.flat();return await u(t),t},{delay:50});return{getInboxNotifications:s,getInboxNotificationsSince:o,getUnreadInboxNotificationsCount:a,markAllInboxNotificationsAsRead:l,markInboxNotificationAsRead:async function(e){await d.get(e)},deleteAllInboxNotifications:async function(){await i(ek`/v2/c/inbox-notifications`,{method:"DELETE"})},deleteInboxNotification:async function(e){await i(ek`/v2/c/inbox-notifications/${e}`,{method:"DELETE"})},getUserThreads_experimental:async function(e){let t;e?.query&&(t=ta(e.query));let n=await i(ek`/v2/c/threads`,void 0,{cursor:e.cursor,query:t,limit:50});return{threads:n.threads.map(e_),inboxNotifications:n.inboxNotifications.map(eb),nextCursor:n.meta.nextCursor,requestedAt:new Date(n.meta.requestedAt)}},getUserThreadsSince_experimental:async function(e){let t=await i(ek`/v2/c/threads/delta`,void 0,{since:e.since.toISOString()});return{threads:{updated:t.threads.map(e_),deleted:t.deletedThreads.map(ew)},inboxNotifications:{updated:t.inboxNotifications.map(eb),deleted:t.deletedInboxNotifications.map(eS)},requestedAt:new Date(t.meta.requestedAt)}}}}({baseUrl:s,fetcher:e.polyfills?.fetch||fetch,authManager:o,currentUserIdStore:u}),h=e.resolveUsers,f=tC(()=>!h,"Set the resolveUsers option in createClient to specify user info."),m=eg(new em(async e=>{let t=e.flat(),n=await h?.({userIds:t});return f(),n??t.map(()=>void 0)},{delay:50})),v=e.resolveRoomsInfo,b=tC(()=>!v,"Set the resolveRoomsInfo option in createClient to specify room info."),w=eg(new em(async e=>{let t=e.flat(),n=await v?.({roomIds:t});return b(),n??t.map(()=>void 0)},{delay:50})),S=new Map;return Object.defineProperty({enterRoom:function(t,...u){var d;let h=a.get(t);if(void 0!==h)return l(h);let f=u[0]??{},m=function(e,t){let n,r,i;let s=e.initialPresence,o=e.initialStorage,[a,l]=function(){let e="undefined"!=typeof document?document:void 0,t={current:null};function n(){e?.visibilityState==="hidden"?t.current=t.current??Date.now():t.current=null}return e?.addEventListener("visibilitychange",n),[t,()=>{e?.removeEventListener("visibilitychange",n)}]}(),u={...t.delegates,canZombie:()=>void 0!==t.backgroundKeepAliveTimeout&&null!==a.current&&Date.now()>a.current+t.backgroundKeepAliveTimeout&&"synchronizing"!==eo()},d=new ea(u,t.enableDebugLogging),h={buffer:{flushTimerID:void 0,lastFlushedAt:0,presenceUpdates:{type:"full",data:s},messages:[],storageOperations:[]},staticSessionInfo:new tw(null),dynamicSessionInfo:new tw(null),myPresence:new tb(s),others:new t_,initialStorage:o,idFactory:null,provider:void 0,onProviderUpdate:_(),clock:0,opClock:0,nodes:new Map,root:void 0,undoStack:[],redoStack:[],pausedHistory:null,activeBatch:null,unacknowledgedOps:new Map,opStackTraces:void 0},f=e=>e(),m=t.unstable_batchedUpdates??f,v=!1;d.events.onMessage.subscribe(function(e){if("string"!=typeof e.data)return;let t=function(e){var t;let n=N(e);return void 0===n?null:ti(n)?$(n.map(e=>{var t;return ts(t=e)?t:null})):$([ts(t=n)?t:null])}(e.data);if(null===t||0===t.length)return;let n={storageUpdates:new Map,others:[]};m(()=>{for(let e of t)switch(e.type){case 101:{let t=function(e){h.others.setConnection(e.actor,e.id,e.info,e.scopes),h.buffer.messages.push({type:100,data:h.myPresence.current,targetActor:e.actor}),J();let t=h.others.getUser(e.actor);return t?{type:"enter",user:t}:void 0}(e);t&&n.others.push(t);break}case 100:{let t=function(e){if(void 0!==e.targetActor){let t=h.others.getUser(e.actor);h.others.setOther(e.actor,e.data);let n=h.others.getUser(e.actor);if(void 0===t&&void 0!==n)return{type:"enter",user:n}}else h.others.patchOther(e.actor,e.data);let t=h.others.getUser(e.actor);return t?{type:"update",updates:e.data,user:t}:void 0}(e);t&&n.others.push(t);break}case 103:{let t=h.others.current;w.customEvent.notify({connectionId:e.actor,user:e.actor<0?null:t.find(t=>t.connectionId===e.actor)??null,event:e.event});break}case 102:{let t=function(e){let t=h.others.getUser(e.actor);return t?(h.others.removeConnection(e.actor),{type:"leave",user:t}):null}(e);t&&n.others.push(t);break}case 300:w.ydoc.notify(e);break;case 104:n.others.push(function(e,t){var n;let r;for(let i of(h.dynamicSessionInfo.set({actor:e.actor,nonce:e.nonce,scopes:e.scopes}),h.idFactory=(n=e.actor,r=0,()=>`${n}:${r++}`),F(t),h.others.connectionIds()))void 0===e.users[i]&&h.others.removeConnection(i);for(let t in e.users){let n=e.users[t],r=Number(t);h.others.setConnection(r,n.id,n.info,n.scopes)}return{type:"reset"}}(e,f));break;case 200:ee(e);break;case 201:for(let[t,r]of V(e.ops,!1).updates.storageUpdates)n.storageUpdates.set(t,e8(n.storageUpdates.get(t),r));break;case 299:O("Storage mutation rejection error",e.reason);break;case 400:case 407:case 401:case 408:case 405:case 406:case 402:case 403:case 404:w.comments.notify(e)}z(n,f)})}),d.events.statusDidChange.subscribe(function(e){let t=d.authValue;if(null!==t){let e=eE(t);if(e!==n){if(n=e,"secret"===t.type){let e=t.token.parsed;h.staticSessionInfo.set({userId:"sec-legacy"===e.k?e.id:e.uid,userInfo:"sec-legacy"===e.k?e.info:e.ui})}else h.staticSessionInfo.set({userId:void 0,userInfo:void 0})}}m(()=>{w.status.notify(e),F(f)})}),d.events.statusDidChange.subscribe(function(e){"reconnecting"===e?r=setTimeout(()=>{m(()=>{w.lostConnection.notify("lost"),v=!0,h.others.clearOthers(),z({others:[{type:"reset"}]},f)})},t.lostConnectionTimeout):(clearTimeout(r),v&&("disconnected"===e?m(()=>{w.lostConnection.notify("failed")}):m(()=>{w.lostConnection.notify("restored")}),v=!1))}),d.events.didConnect.subscribe(function(){h.buffer.presenceUpdates={type:"full",data:{...h.myPresence.current}},null!==Z&&en({flush:!1}),J()}),d.events.didDisconnect.subscribe(function(){clearTimeout(h.buffer.flushTimerID)}),d.events.onLiveblocksError.subscribe(e=>{m(()=>{w.error.notify(e)})});let b={roomId:t.roomId,getNode:e=>h.nodes.get(e),addNode:(e,t)=>void h.nodes.set(e,t),deleteNode:e=>void h.nodes.delete(e),generateId:()=>`${W()}:${h.clock++}`,generateOpId:()=>`${W()}:${h.opClock++}`,dispatch(e,t,n){let r=h.activeBatch;if(r){for(let t of e)r.ops.push(t);for(let[e,t]of n)r.updates.storageUpdates.set(e,e8(r.updates.storageUpdates.get(e),t));r.reverseOps.unshift(...t)}else m(()=>{H(t,f),h.redoStack.length=0,X(e),z({storageUpdates:n},f)})},assertStorageIsWritable:()=>{let e=h.dynamicSessionInfo.current?.scopes;if(void 0!==e&&!el(e))throw Error("Cannot write to storage with a read only user, please ensure the user has write permissions")}},w={status:_(),lostConnection:_(),customEvent:_(),self:_(),myPresence:_(),others:_(),error:_(),storageBatch:_(),history:_(),storageDidLoad:_(),storageStatus:_(),ydoc:_(),comments:_()};async function S(e,n,r,i){e.startsWith("/v2/c/rooms/")||A("Expected a /v2/c/rooms/* endpoint");let s=ex(t.baseUrl,e,i),o=t.polyfills?.fetch||fetch;return await o(s,{...r,headers:{...r?.headers,Authorization:`Bearer ${eE(n)}`,"X-LB-Client":c||"dev"}})}async function x(e,t){return S(ek`/v2/c/rooms/${t}/storage`,e,{method:"GET",headers:{"Content-Type":"application/json"}})}async function k(e,n){if(!d.authValue)throw Error("Not authorized");return S("/send-message"===e?ek`/v2/c/rooms/${t.roomId}/send-message`:ek`/v2/c/rooms/${t.roomId}/text-metadata`,d.authValue,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async function T(e,n){if(!d.authValue)throw Error("Not authorized");return S(ek`/v2/c/rooms/${t.roomId}/text-mentions`,d.authValue,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,mentionId:n})})}async function I(e){if(!d.authValue)throw Error("Not authorized");return S(ek`/v2/c/rooms/${t.roomId}/text-mentions/${e}`,d.authValue,{method:"DELETE"})}async function C(e,n){let r=await u.authenticate();return S(ek`/v2/c/rooms/${t.roomId}/text-metadata`,r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e,rootKey:n})})}async function R(){let e=await u.authenticate();return S(ek`/v2/c/rooms/${t.roomId}/versions`,e,{method:"GET"})}async function P(e){let n=await u.authenticate();return S(ek`/v2/c/rooms/${t.roomId}/y-version/${e}`,n,{method:"GET"})}async function M(){let e=await u.authenticate();return S(ek`/v2/c/rooms/${t.roomId}/version`,e,{method:"POST"})}function L(e){let n=JSON.stringify(e),r=h.dynamicSessionInfo.current?.nonce;if(t.unstable_fallbackToHTTP&&r&&new TextEncoder().encode(n).length>1047552){k("/send-message",{nonce:r,messages:e}).then(e=>{e.ok||403!==e.status||d.reconnect()}),E("Message was too large for websockets and sent over HTTP instead");return}d.send(n)}let j=new tS(h.staticSessionInfo,h.dynamicSessionInfo,h.myPresence,(e,t,n)=>{if(null===e||null===t)return null;{let r=el(t.scopes);return{connectionId:t.actor,id:e.userId,info:e.userInfo,presence:n,canWrite:r,canComment:eu(t.scopes)}}});function F(e){let t=j.current;null!==t&&t!==i&&(e(()=>{w.self.notify(t)}),i=t)}let q=new tS(j,e=>null!==e?tE("Me",e):null);function B(e,t){h.undoStack.length>=50&&h.undoStack.shift(),h.undoStack.push(e),K(t)}function H(e,t){null!==h.pausedHistory?h.pausedHistory.unshift(...e):B(e,t)}function z(e,t){let n=e.storageUpdates,r=e.others;t(()=>{if(void 0!==r&&r.length>0){let e=h.others.current;for(let t of r)w.others.notify({...t,others:e})}if(e.presence&&(F(f),w.myPresence.notify(h.myPresence.current)),void 0!==n&&n.size>0){let e=Array.from(n.values());w.storageBatch.notify(e)}ed()})}function W(){let e=h.dynamicSessionInfo.current;if(e)return e.actor;throw Error("Internal. Tried to get connection id but connection was never open")}function V(e,t){let n={reverse:[],storageUpdates:new Map,presence:!1},r=new Set,i=e.map(e=>"presence"===e.type||e.opId?e:{...e,opId:b.generateOpId()});for(let e of i)if("presence"===e.type){let t={type:"presence",data:{}};for(let n in e.data)t.data[n]=h.myPresence.current[n];if(h.myPresence.patch(e.data),null===h.buffer.presenceUpdates)h.buffer.presenceUpdates={type:"partial",data:e.data};else for(let t in e.data)h.buffer.presenceUpdates.data[t]=e.data[t];n.reverse.unshift(t),n.presence=!0}else{let i;if(t)i=0;else{let t=g(e.opId);i=h.unacknowledgedOps.delete(t)?2:1}let s=function(e,t){if(5===e.type&&"ACK"===e.id)return{modified:!1};switch(e.type){case 6:case 3:case 5:{let n=h.nodes.get(e.id);if(void 0===n)return{modified:!1};return n._apply(e,0===t)}case 1:{let n=h.nodes.get(e.id);if(void 0===n)return{modified:!1};if("HasParent"===n.parent.type&&e3(n.parent.node))return n.parent.node._setChildKey(eP(e.parentKey),n,t);return{modified:!1}}case 4:case 2:case 7:case 8:{if(void 0===e.parentId)return{modified:!1};let n=h.nodes.get(e.parentId);if(void 0===n)return{modified:!1};return n._attachChild(e,t)}}}(e,i);if(s.modified){let t=s.modified.node._id;t&&r.has(t)||(n.storageUpdates.set(g(s.modified.node._id),e8(n.storageUpdates.get(g(s.modified.node._id)),s.modified)),n.reverse.unshift(...s.reverse)),(2===e.type||7===e.type||4===e.type)&&r.add(g(e.id))}}return{ops:i,reverse:n.reverse,updates:{storageUpdates:n.storageUpdates,presence:n.presence}}}function G(){return h.undoStack.length>0}function Q(){return h.redoStack.length>0}function K(e){e(()=>{w.history.notify({canUndo:G(),canRedo:Q()})})}function J(){let e=h.buffer.storageOperations;if(e.length>0){for(let t of e)h.unacknowledgedOps.set(g(t.opId),t);ed()}if("connected"!==d.getStatus()){h.buffer.storageOperations=[];return}let n=Date.now(),r=n-h.buffer.lastFlushedAt;if(r>=t.throttleDelay){let e=function(){let e=[];for(let t of(h.buffer.presenceUpdates&&e.push("full"===h.buffer.presenceUpdates.type?{type:100,targetActor:-1,data:h.buffer.presenceUpdates.data}:{type:100,data:h.buffer.presenceUpdates.data}),h.buffer.messages))e.push(t);return h.buffer.storageOperations.length>0&&e.push({type:201,ops:h.buffer.storageOperations}),e}();if(0===e.length)return;L(e),h.buffer={flushTimerID:void 0,lastFlushedAt:n,messages:[],storageOperations:[],presenceUpdates:null}}else clearTimeout(h.buffer.flushTimerID),h.buffer.flushTimerID=setTimeout(J,t.throttleDelay-r)}function X(e){let{storageOperations:t}=h.buffer;for(let n of e)t.push(n);J()}let Z=null,Y=null;function ee(e){let t=new Map(h.unacknowledgedOps);(function(e,t){if(0===e.items.length)throw Error("Internal error: cannot load storage without items");void 0!==h.root?function(e,t){if(void 0===h.root)return;let n=new Map;for(let[e,t]of h.nodes)n.set(e,t._serialize());z(V(function(e,t){let n=[];return e.forEach((e,r)=>{t.get(r)||n.push({type:5,id:r})}),t.forEach((t,r)=>{let i=e.get(r);if(i)0===t.type&&(0!==i.type||JSON.stringify(t.data)!==JSON.stringify(i.data))&&n.push({type:3,id:r,data:t.data}),t.parentKey!==i.parentKey&&n.push({type:1,id:r,parentKey:g(t.parentKey,"Parent key must not be missing")});else switch(t.type){case 3:n.push({type:8,id:r,parentId:t.parentId,parentKey:t.parentKey,data:t.data});break;case 1:n.push({type:2,id:r,parentId:t.parentId,parentKey:t.parentKey});break;case 0:if(void 0===t.parentId||void 0===t.parentKey)throw Error("Internal error. Cannot serialize storage root into an operation");n.push({type:4,id:r,parentId:t.parentId,parentKey:t.parentKey,data:t.data});break;case 2:n.push({type:7,id:r,parentId:t.parentId,parentKey:t.parentKey})}}),n}(n,new Map(e)),!1).updates,t)}(e.items,t):h.root=eX._fromItems(e.items,b);let n=j.current?.canWrite??!0,r=h.undoStack.length;for(let e in h.initialStorage)if(void 0===h.root.get(e)){if(n){var i;h.root.set(e,void 0===(i=h.initialStorage[e])?void 0:e1(i)?i.clone():D(i))}else E(`Attempted to populate missing storage key '${e}', but current user has no write access`)}h.undoStack.length=r})(e,f),function(e,t){if(0===e.size)return;let n=[],r=V(Array.from(e.values()),!0);n.push({type:201,ops:r.ops}),z(r.updates,t),L(n)}(t,f),Y?.(),ed(),w.storageDidLoad.notify()}async function et(){if(!d.authValue)return;let e=await x(d.authValue,t.roomId);ee({type:200,items:await e.json()})}function en(e){let n=h.buffer.messages;t.unstable_streamData?et():n.some(e=>200===e.type)||n.push({type:200}),e.flush&&J()}function er(){return null===Z&&(en({flush:!0}),Z=new Promise(e=>{Y=e}),ed()),Z}function ei(){let e=h.root;return void 0!==e?e:(er(),null)}async function es(){return void 0!==h.root?Promise.resolve({root:h.root}):(await er(),{root:g(h.root)})}function eo(){return void 0===h.root?null===Z?"not-loaded":"loading":0===h.unacknowledgedOps.size?"synchronized":"synchronizing"}let ec=eo();function ed(){let e=eo();ec!==e&&(ec=e,w.storageStatus.notify(e))}function ef(){return null!==j.current}async function ep(){for(;!ef();){let{promise:e,resolve:t}=y(),n=eI.self.subscribeOnce(t),r=eI.status.subscribeOnce(t);await e,n(),r()}}function ev(){return null!==ei()}async function eT(){for(;!ev();)await es()}let eO=new tS(h.others,e=>e.map((e,t)=>tE(`Other ${t}`,e))),eI={status:w.status.observable,lostConnection:w.lostConnection.observable,customEvent:w.customEvent.observable,others:w.others.observable,self:w.self.observable,myPresence:w.myPresence.observable,error:w.error.observable,storage:w.storageBatch.observable,storageBatch:w.storageBatch.observable,history:w.history.observable,storageDidLoad:w.storageDidLoad.observable,storageStatus:w.storageStatus.observable,ydoc:w.ydoc.observable,comments:w.comments.observable};async function eC(e,t,n){return S(e,await u.authenticate(),n,t)}async function eR(e,t,n){let r;let i=await eC(e,n,t);if(!i.ok&&i.status>=400&&i.status<600){let e;try{let t=await i.json();e=new tk(t.message,i.status,t)}catch{e=new tk(i.statusText,i.status)}throw e}try{r=await i.json()}catch{r={}}return r}async function eA(e){let n=await eC(ek`/v2/c/rooms/${t.roomId}/threads/delta`,{since:e?.since?.toISOString()},{headers:{"Content-Type":"application/json"}});if(n.ok){let e=await n.json();return{threads:{updated:e.data.map(e_),deleted:e.deletedThreads.map(ew)},inboxNotifications:{updated:e.inboxNotifications.map(eb),deleted:e.deletedInboxNotifications.map(eS)},requestedAt:new Date(e.meta.requestedAt)}}if(404===n.status)return{threads:{updated:[],deleted:[]},inboxNotifications:{updated:[],deleted:[]},requestedAt:new Date};throw Error("There was an error while getting threads.")}async function eM(e){let n;e?.query&&(n=ta(e.query));let r=await eC(ek`/v2/c/rooms/${t.roomId}/threads`,{cursor:e?.cursor,query:n,limit:50},{headers:{"Content-Type":"application/json"}});if(r.ok){let e=await r.json();return{threads:e.data.map(e_),inboxNotifications:e.inboxNotifications.map(eb),nextCursor:e.meta.nextCursor,requestedAt:new Date(e.meta.requestedAt)}}if(404===r.status)return{threads:[],inboxNotifications:[],deletedThreads:[],deletedInboxNotifications:[],nextCursor:null,requestedAt:new Date};throw Error("There was an error while getting threads.")}async function eL(e){let n=await eC(ek`/v2/c/rooms/${t.roomId}/thread-with-notification/${e}`);if(n.ok){let e=await n.json();return{thread:e_(e.thread),inboxNotification:e.inboxNotification?eb(e.inboxNotification):void 0}}if(404===n.status)return{thread:void 0,inboxNotification:void 0};throw Error(`There was an error while getting thread ${e}.`)}async function eN({metadata:e,body:n,commentId:r=tr(),threadId:i=tn(),attachmentIds:s}){return e_(await eR(ek`/v2/c/rooms/${t.roomId}/threads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:i,comment:{id:r,body:n,attachmentIds:s},metadata:e})}))}async function eD(e){await eR(ek`/v2/c/rooms/${t.roomId}/threads/${e}`,{method:"DELETE"})}async function e$({metadata:e,threadId:n}){return await eR(ek`/v2/c/rooms/${t.roomId}/threads/${n}/metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function ej(e){await eR(ek`/v2/c/rooms/${t.roomId}/threads/${e}/mark-as-resolved`,{method:"POST"})}async function eF(e){await eR(ek`/v2/c/rooms/${t.roomId}/threads/${e}/mark-as-unresolved`,{method:"POST"})}async function eU({threadId:e,commentId:n=tr(),body:r,attachmentIds:i}){return ey(await eR(ek`/v2/c/rooms/${t.roomId}/threads/${e}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n,body:r,attachmentIds:i})}))}async function eq({threadId:e,commentId:n,body:r,attachmentIds:i}){return ey(await eR(ek`/v2/c/rooms/${t.roomId}/threads/${e}/comments/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:r,attachmentIds:i})}))}async function eB({threadId:e,commentId:n}){await eR(ek`/v2/c/rooms/${t.roomId}/threads/${e}/comments/${n}`,{method:"DELETE"})}async function eH({threadId:e,commentId:n,emoji:r}){var i;return{...i=await eR(ek`/v2/c/rooms/${t.roomId}/threads/${e}/comments/${n}/reactions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({emoji:r})}),createdAt:new Date(i.createdAt)}}async function ez({threadId:e,commentId:n,emoji:r}){await eR(ek`/v2/c/rooms/${t.roomId}/threads/${e}/comments/${n}/reactions/${r}`,{method:"DELETE"})}async function eW(e,n={}){let r=n.signal,i=r?new DOMException(`Upload of attachment ${e.id} was aborted.`,"AbortError"):void 0;if(r?.aborted)throw i;let s=e=>{if(r?.aborted)throw i;if(e instanceof tk&&413===e.status)throw e;return!1};if(e.size<=5242880)return e7(()=>eR(ek`/v2/c/rooms/${t.roomId}/attachments/${e.id}/upload/${encodeURIComponent(e.name)}`,{method:"PUT",body:e.file,signal:r},{fileSize:e.size}),10,tx,s);{let n;let o=[],a=await e7(()=>eR(ek`/v2/c/rooms/${t.roomId}/attachments/${e.id}/multipart/${encodeURIComponent(e.name)}`,{method:"POST",signal:r},{fileSize:e.size}),10,tx,s);try{n=a.uploadId;let l=function(e){let t=[],n=0;for(;n<e.size;){let r=Math.min(n+5242880,e.size);t.push({partNumber:t.length+1,part:e.slice(n,r)}),n=r}return t}(e.file);if(r?.aborted)throw i;for(let n of te(l,5)){let i=[];for(let{part:o,partNumber:l}of n)i.push(e7(()=>eR(ek`/v2/c/rooms/${t.roomId}/attachments/${e.id}/multipart/${a.uploadId}/${String(l)}`,{method:"PUT",body:o,signal:r}),10,tx,s));o.push(...await Promise.all(i))}if(r?.aborted)throw i;let u=o.sort((e,t)=>e.partNumber-t.partNumber);return eR(ek`/v2/c/rooms/${t.roomId}/attachments/${e.id}/multipart/${n}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parts:u}),signal:r})}catch(r){if(n&&r?.name&&("AbortError"===r.name||"TimeoutError"===r.name))try{await eC(ek`/v2/c/rooms/${t.roomId}/attachments/${e.id}/multipart/${n}`,void 0,{method:"DELETE"})}catch(e){}throw r}}}async function eV(e){let{urls:n}=await eR(ek`/v2/c/rooms/${t.roomId}/attachments/presigned-urls`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attachmentIds:e})});return n}let eG=new em(async e=>{let t=e.flat();return(await eV(t)).map(e=>e??Error("There was an error while getting this attachment's URL"))},{delay:50}),eQ=eg(eG);async function eK(e,t){let n;let r=await u.authenticate(),i=await S(e,r,t);if(!i.ok&&i.status>=400&&i.status<600){let e;try{let t=await i.json();e=new tO(t.message,i.status,t)}catch{e=new tO(i.statusText,i.status)}throw e}try{n=await i.json()}catch{n={}}return n}async function eJ(e){await eK(ek`/v2/c/rooms/${t.roomId}/inbox-notifications/read`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inboxNotificationIds:e})})}let eZ=new em(async e=>{let t=e.flat();return await eJ(t),t},{delay:50});async function eY(e){await eZ.get(e)}return Object.defineProperty({[eh]:{get presenceBuffer(){return D(h.buffer.presenceUpdates?.data??null)},get undoStack(){return D(h.undoStack)},get nodeCount(){return h.nodes.size},getProvider:()=>h.provider,setProvider(e){h.provider=e,h.onProviderUpdate.notify()},onProviderUpdate:h.onProviderUpdate.observable,reportTextEditor:C,createTextMention:T,deleteTextMention:I,listTextVersions:R,getTextVersion:P,createTextVersion:M,getSelf_forDevTools:()=>q.current,getOthers_forDevTools:()=>eO.current,simulate:{explicitClose:e=>d._privateSendMachineEvent({type:"EXPLICIT_SOCKET_CLOSE",event:e}),rawSend:e=>d.send(e)},attachmentUrlsStore:eQ},id:t.roomId,subscribe:function(e,t,n){if("string"==typeof e&&("my-presence"===e||"others"===e||"event"===e||"error"===e||"history"===e||"status"===e||"storage-status"===e||"lost-connection"===e||"connection"===e||"comments"===e)){if("function"!=typeof t)throw Error("Second argument must be a callback function");switch(e){case"event":return eI.customEvent.subscribe(t);case"my-presence":return eI.myPresence.subscribe(t);case"others":return eI.others.subscribe(e=>{let{others:n,...r}=e;return t(n,r)});case"error":return eI.error.subscribe(t);case"status":return eI.status.subscribe(t);case"lost-connection":return eI.lostConnection.subscribe(t);case"history":return eI.history.subscribe(t);case"storage-status":return eI.storageStatus.subscribe(t);case"comments":return eI.comments.subscribe(t);default:return p(e,`"${String(e)}" is not a valid event name`)}}if(void 0===t||"function"==typeof e){if("function"==typeof e)return eI.storageBatch.subscribe(e);throw Error("Please specify a listener callback")}if(e2(e))return n?.isDeep?eI.storageBatch.subscribe(n=>{let r=n.filter(t=>(function e(t,n){return t===n||"HasParent"===t.parent.type&&e(t.parent.node,n)})(t.node,e));r.length>0&&t(r)}):eI.storageBatch.subscribe(n=>{for(let r of n)r.node._id===e._id&&t(r.node)});throw Error(`${String(e)} is not a value that can be subscribed to.`)},connect:()=>d.connect(),reconnect:()=>d.reconnect(),disconnect:()=>d.disconnect(),destroy:()=>{l(),d.destroy()},updatePresence:function(e,t){let n={};for(let t in null===h.buffer.presenceUpdates&&(h.buffer.presenceUpdates={type:"partial",data:{}}),e){let r=e[t];void 0!==r&&(h.buffer.presenceUpdates.data[t]=r,n[t]=h.myPresence.current[t])}h.myPresence.patch(e),h.activeBatch?(t?.addToHistory&&h.activeBatch.reverseOps.unshift({type:"presence",data:n}),h.activeBatch.updates.presence=!0):(J(),m(()=>{t?.addToHistory&&H([{type:"presence",data:n}],f),z({presence:!0},f)}))},updateYDoc:function(e,t){let n={type:301,update:e,guid:t};h.buffer.messages.push(n),w.ydoc.notify(n),J()},broadcastEvent:function(e,t={shouldQueueEventIfNotReady:!1}){("connected"===d.getStatus()||t.shouldQueueEventIfNotReady)&&(h.buffer.messages.push({type:103,event:e}),J())},batch:function(e){let t;return h.activeBatch?e():(m(()=>{h.activeBatch={ops:[],updates:{storageUpdates:new Map,presence:!1,others:[]},reverseOps:[]};try{t=e()}finally{let e=h.activeBatch;h.activeBatch=null,e.reverseOps.length>0&&H(e.reverseOps,f),e.ops.length>0&&(h.redoStack.length=0),e.ops.length>0&&X(e.ops),z(e.updates,f),J()}}),t)},history:{undo:function(){if(h.activeBatch)throw Error("undo is not allowed during a batch");let e=h.undoStack.pop();if(void 0===e)return;h.pausedHistory=null;let t=V(e,!0);for(let e of(m(()=>{z(t.updates,f),h.redoStack.push(t.reverse),K(f)}),t.ops))"presence"!==e.type&&h.buffer.storageOperations.push(e);J()},redo:function(){if(h.activeBatch)throw Error("redo is not allowed during a batch");let e=h.redoStack.pop();if(void 0===e)return;h.pausedHistory=null;let t=V(e,!0);for(let e of(m(()=>{z(t.updates,f),h.undoStack.push(t.reverse),K(f)}),t.ops))"presence"!==e.type&&h.buffer.storageOperations.push(e);J()},canUndo:G,canRedo:Q,clear:function(){h.undoStack.length=0,h.redoStack.length=0},pause:function(){null===h.pausedHistory&&(h.pausedHistory=[])},resume:function(){let e=h.pausedHistory;h.pausedHistory=null,null!==e&&e.length>0&&B(e,m)}},fetchYDoc:function(e,t){h.buffer.messages.find(n=>300===n.type&&n.vector===e&&n.guid===t)||h.buffer.messages.push({type:300,vector:e,guid:t}),J()},getStorage:es,getStorageSnapshot:ei,getStorageStatus:eo,isPresenceReady:ef,isStorageReady:ev,waitUntilPresenceReady:U(ep),waitUntilStorageReady:U(eT),events:eI,getStatus:()=>d.getStatus(),getSelf:()=>j.current,getPresence:()=>h.myPresence.current,getOthers:()=>h.others.current,getThreads:eM,getThreadsSince:eA,getThread:eL,createThread:eN,deleteThread:eD,editThreadMetadata:e$,markThreadAsResolved:ej,markThreadAsUnresolved:eF,createComment:eU,editComment:eq,deleteComment:eB,addReaction:eH,removeReaction:ez,prepareAttachment:function(e){return{type:"localAttachment",status:"idle",id:tt("at"),name:e.name,size:e.size,mimeType:e.type,file:e}},uploadAttachment:eW,getAttachmentUrl:function(e){return eG.get(e)},getNotificationSettings:function(){return eK(ek`/v2/c/rooms/${t.roomId}/notification-settings`)},updateNotificationSettings:function(e){return eK(ek`/v2/c/rooms/${t.roomId}/notification-settings`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},markInboxNotificationAsRead:eY},eh,{enumerable:!1})}({initialPresence:("function"==typeof f.initialPresence?f.initialPresence(t):f.initialPresence)??{},initialStorage:("function"==typeof f.initialStorage?f.initialStorage(t):f.initialStorage)??{}},{roomId:t,throttleDelay:n,lostConnectionTimeout:r,backgroundKeepAliveTimeout:i,polyfills:e.polyfills,delegates:e.mockedDelegates??{createSocket:(d=e.polyfills?.WebSocket,e=>{let n=d??("undefined"==typeof WebSocket?void 0:WebSocket);if(void 0===n)throw new K("To use Liveblocks client in a non-DOM environment, you need to provide a WebSocket polyfill.");let r=new URL(s);if(r.protocol="http:"===r.protocol?"ws":"wss",r.pathname="/v7",r.searchParams.set("roomId",t),"secret"===e.type)r.searchParams.set("tok",e.token.raw);else{if("public"!==e.type)return p(e,"Unhandled case");r.searchParams.set("pubkey",e.publicApiKey)}return r.searchParams.set("version",c||"dev"),new n(r.toString())}),authenticate:async()=>o.getAuthValue({requestedScope:"room:read",roomId:t})},enableDebugLogging:e.enableDebugLogging,unstable_batchedUpdates:f?.unstable_batchedUpdates,baseUrl:s,unstable_fallbackToHTTP:!!e.unstable_fallbackToHTTP,unstable_streamData:!!e.unstable_streamData}),v={room:m,unsubs:new Set};if(a.set(t,v),f.autoConnect??!0){if("undefined"==typeof atob){if(e.polyfills?.atob===void 0)throw Error("You need to polyfill atob to use the client in your environment. Please follow the instructions at https://liveblocks.io/docs/errors/liveblocks-client/atob-polyfill");global.atob=e.polyfills.atob}m.connect()}return l(v)},getRoom:function(e){return a.get(e)?.room||null},logout:function(){for(let{room:t}of(o.reset(),a.values())){var e;"initial"===(e=t.getStatus())||"disconnected"===e||t.reconnect()}},...d,resolvers:{invalidateUsers:function(e){m.invalidate(e)},invalidateRoomsInfo:function(e){w.invalidate(e)},invalidateMentionSuggestions:function(){S.clear()}},[eh]:{currentUserIdStore:u,mentionSuggestionsCache:S,resolveMentionSuggestions:e.resolveMentionSuggestions,usersStore:m,roomsInfoStore:w,getRoomIds:()=>Array.from(a.keys()),getUserThreads_experimental:d.getUserThreads_experimental,getUserThreadsSince_experimental:d.getUserThreadsSince_experimental}},eh,{enumerable:!1})}var tO=class extends Error{constructor(e,t,n){super(e),this.message=e,this.status=t,this.details=n}};function tI(e,t,n,r,i){if("number"!=typeof t||t<n||void 0!==r&&t>r)throw Error(void 0!==r?`${e} should be between ${i??n} and ${r}.`:`${e} should be at least ${i??n}.`);return t}function tC(e,...t){return()=>{}}var tR={paragraph:function(e){return"type"in e&&"paragraph"===e.type},text:function(e){return!("type"in e)&&"text"in e&&"string"==typeof e.text},link:function(e){return"type"in e&&"link"===e.type},mention:function(e){return"type"in e&&"mention"===e.type}},tA={paragraph:"block",text:"inline",link:"inline",mention:"inline"};function tP(e){let t=new Set;return function(e,t,n){if(!e||!e?.content)return;let r="string"==typeof t?t:void 0,i=r?tA[r]:"all",s=r?tR[r]:()=>!0,o="function"==typeof t?t:n;for(let t of e.content)if(("all"===i||"block"===i)&&s(t)&&o?.(t),"all"===i||"inline"===i)for(let e of t.children)s(e)&&o?.(e)}(e,"mention",e=>t.add(e.id)),Array.from(t)}function tM(e){let t={};for(let n in e){let r=e[n];void 0!==r&&(t[n]=tL(r))}return t}function tL(e){return e instanceof eX?tM(e.toObject()):e instanceof eq?e.toArray().map(tL):e instanceof eJ?function(e){let t={};for(let[n,r]of e.entries())t[n]=tL(r);return t}(e):e instanceof eF?e.data:Array.isArray(e)?e.map(tL):P(e)?tM(e):e}function tN(e){if(Array.isArray(e))return new eq(e.map(tN));if(!P(e))return e;{let t={};for(let n in e){let r=e[n];void 0!==r&&(t[n]=tN(r))}return new eX(t)}}function tD(e,t,n,r){let i=e.get(t);if(void 0===r)e.delete(t);else if(void 0===i)e.set(t,tN(r));else{if(n===r)return;e3(i)&&Array.isArray(n)&&Array.isArray(r)?function(e,t,n){let r=0,i=t.length-1,s=n.length-1,o=t[0],a=n[0];e:{for(;o===a;){if(++r>i||r>s)break e;o=t[r],a=n[r]}for(o=t[i],a=n[s];o===a;){if(i--,s--,r>i||r>s)break e;o=t[i],a=n[s]}}if(r>i){if(r<=s)for(;r<=s;)e.insert(tN(n[r]),r),r++}else if(r>s){let t=r;for(;t<=i;)e.delete(r),t++}else{for(;r<=i&&r<=s;){o=t[r],a=n[r];let i=e.get(r);e5(i)&&P(o)&&P(a)?t$(i,o,a):e.set(r,tN(a)),r++}for(;r<=s;)e.insert(tN(n[r]),r),r++;let l=r;for(;l<=i;)e.delete(r),l++}}(i,n,r):e5(i)&&P(n)&&P(r)?t$(i,n,r):e.set(t,tN(r))}}function t$(e,t,n){let r={};for(let r in n)tD(e,r,t[r],n[r]);for(let r in t)void 0===n[r]&&e.delete(r);Object.keys(r).length>0&&e.update(r)}function tj(e,t){return t.reduce((e,t)=>(function e(t,n,r){let i=n.pop();if(void 0===i)switch(r.type){case"LiveObject":{if(!ts(t))throw Error("Internal: received update on LiveObject but state was not an object");let e=Object.assign({},t);for(let t in r.updates)if(r.updates[t]?.type==="update"){let n=r.node.get(t);void 0!==n&&(e[t]=tL(n))}else r.updates[t]?.type==="delete"&&delete e[t];return e}case"LiveList":{if(!Array.isArray(t))throw Error("Internal: received update on LiveList but state was not an array");let e=t.map(e=>e);for(let t of r.updates)"set"===t.type?e=e.map((e,n)=>n===t.index?tL(t.item):e):"insert"===t.type?t.index===e.length?e.push(tL(t.item)):e=[...e.slice(0,t.index),tL(t.item),...e.slice(t.index)]:"delete"===t.type?e.splice(t.index,1):"move"===t.type&&(e=t.previousIndex>t.index?[...e.slice(0,t.index),tL(t.item),...e.slice(t.index,t.previousIndex),...e.slice(t.previousIndex+1)]:[...e.slice(0,t.previousIndex),...e.slice(t.previousIndex+1,t.index+1),tL(t.item),...e.slice(t.index+1)]);return e}case"LiveMap":{if(!ts(t))throw Error("Internal: received update on LiveMap but state was not an object");let e=Object.assign({},t);for(let t in r.updates)if(r.updates[t]?.type==="update"){let n=r.node.get(t);void 0!==n&&(e[t]=tL(n))}else r.updates[t]?.type==="delete"&&delete e[t];return e}}if(Array.isArray(t)){let s=[...t];return s[i]=e(t[i],n,r),s}if(!ts(t))return t;{let s=t[i];return void 0===s?t:{...t,[i]:e(s,n,r)}}})(e,function(e){let t=[];for(;"HasParent"===e.parent.type;)e3(e.parent.node)?t.push(e.parent.node._indexOfPosition(e.parent.key)):t.push(e.parent.key),e=e.parent.node;return t}(t.node),t),e)}function tF(e,t){}function tU(e,t){let n={state:"stopped"};function r(){"running"===n.state&&i(),e()}function i(){n={state:"running",lastScheduledAt:performance.now(),timeoutHandle:setTimeout(r,t)}}return{enable:function(e){e?"running"!==n.state&&i():"stopped"!==n.state&&(n.timeoutHandle&&clearTimeout(n.timeoutHandle),n={state:"stopped"})}}}function tq(e,t){if(Object.is(e,t))return!0;let n=Array.isArray(e),r=Array.isArray(t);return n||r?!!n&&!!r&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}(e,t):function(e,t){if(!P(e)||!P(t))return!1;let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&Object.is(e[n],t[n]))}(e,t)}RegExp(["&","<",">",'"',"'"].map(e=>`\\${e}`).join("|"),"g"),RegExp(["_","*","#","`","~","!","|","(",")","{","}","[","]"].map(e=>`\\${e}`).join("|"),"g"),f(u,c,"esm")},27690:function(e,t,n){"use strict";n.d(t,{$$:function(){return eI},BU:function(){return a},Bc:function(){return eL},J6:function(){return ek},LL:function(){return eN},NX:function(){return eD},QU:function(){return ex},RN:function(){return eO},RY:function(){return M},Uw:function(){return J},WT:function(){return W},WX:function(){return Q},X0:function(){return eE},_A:function(){return eA},_Z:function(){return e$},aA:function(){return ee},bN:function(){return ew},d3:function(){return eR},d7:function(){return eT},f8:function(){return eF},gV:function(){return K},k3:function(){return V},k9:function(){return Z},kB:function(){return eP},m8:function(){return H},mL:function(){return G},mT:function(){return eM},qf:function(){return Y},us:function(){return eS},v_:function(){return ej},xS:function(){return X}});var r=n(75271),i=n(27822),s=n(48488),o=n(8769),a=r.createContext(null);function l(){return r.useContext(a)}function u(e){let t=new Set;t.add("constructor");let n=e.constructor.prototype;do for(let r of Reflect.ownKeys(n)){if(t.has(r))continue;let i=Reflect.getOwnPropertyDescriptor(n,r);"function"==typeof i?.value&&(t.add(r),e[r]=e[r].bind(e))}while((n=Reflect.getPrototypeOf(n))&&n!==Object.prototype)}function c(e,t){return e.createdAt.getTime()-t.createdAt.getTime()}function d(e,t){return t.updatedAt.getTime()-e.updatedAt.getTime()}function h(e){return"string"==typeof e}var f=Object.freeze({isLoading:!1,data:void 0});function p(e,t){return`${e}-${(0,i.Pz)(t??{})}`}function m(e){return`USER_THREADS:${(0,i.Pz)(e??{})}`}function g(e){return`${e}:NOTIFICATION_SETTINGS`}function v(e){return`${e}-VERSIONS`}function y(e,t){let n=e.threads;null!==t.roomId&&(n=n.filter(e=>e.roomId===t.roomId));let r=t.query;return r&&(n=n.filter(e=>(void 0===r.resolved||e.resolved===r.resolved)&&function(e,t){let n=e.metadata;return void 0===t.metadata||Object.entries(t.metadata).every(([e,t])=>{var r,s;return r=n[e],s=t,(0,i.PO)(s)&&h(s.startsWith)?h(r)&&r.startsWith(s.startsWith):r===s})}(e,r))),n.sort("last-update"===t.orderBy?d:c)}var _=Promise.resolve(),b=Object.freeze({isLoading:!0}),w=class{constructor(e){this._cachedPromise=null,this._paginationState=null,this._fetchPage=e,this._eventSource=(0,i.Zb)(),this._pendingFetchMore=null,this.observable=this._eventSource.observable,u(this)}patchPaginationState(e){let t=this._paginationState;null!==t&&(this._paginationState={...t,...e},this._eventSource.notify())}async _fetchMore(){let e=this._paginationState;if(e?.cursor){this.patchPaginationState({isFetchingMore:!0});try{let t=await this._fetchPage(e.cursor);this.patchPaginationState({cursor:t,fetchMoreError:void 0,isFetchingMore:!1})}catch(e){this.patchPaginationState({isFetchingMore:!1,fetchMoreError:e})}}}fetchMore(){let e=this._paginationState;return e?.cursor===null?_:(this._pendingFetchMore||(this._pendingFetchMore=this._fetchMore().finally(()=>{this._pendingFetchMore=null})),this._pendingFetchMore)}get(){let e=this._cachedPromise;if(null===e||"pending"===e.status)return b;if("rejected"===e.status)return{isLoading:!1,error:e.reason};let t=this._paginationState;return{isLoading:!1,data:{fetchMore:this.fetchMore,isFetchingMore:t.isFetchingMore,fetchMoreError:t.fetchMoreError,hasFetchedAll:null===t.cursor}}}waitUntilLoaded(){var e;if(this._cachedPromise)return this._cachedPromise;let t=("status"in(e=(0,i.du)(()=>this._fetchPage(void 0),5,[5e3,5e3,1e4,15e3]).then(e=>{this._paginationState={cursor:e,isFetchingMore:!1,fetchMoreError:void 0}}))||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})),e);return t.then(()=>this._eventSource.notify(),()=>{this._eventSource.notify(),setTimeout(()=>{this._cachedPromise=null,this._eventSource.notify()},5e3)}),this._cachedPromise=t,t}},S=class{constructor(e){this._prevState=null,this._stateCached=null,this._notificationsLastRequestedAt=null,this._roomThreadsLastRequestedAtByRoom=new Map,this._roomThreads=new Map,this._userThreadsLastRequestedAt=null,this._userThreads=new Map;let t=async t=>{if(void 0===e)throw new i.MC("Client is required in order to load threads for the room");let n=await e.getInboxNotifications({cursor:t});return this.updateThreadsAndNotifications(n.threads,n.inboxNotifications),null===this._notificationsLastRequestedAt&&(this._notificationsLastRequestedAt=n.requestedAt),n.nextCursor};this._client=e,this._notifications=new w(t),this._notifications.observable.subscribe(()=>this._store.set(e=>({...e}))),this._store=(0,i.MT)({rawThreadsById:{},queries3:{},queries4:{},optimisticUpdates:[],notificationsById:{},settingsByRoomId:{},versionsByRoomId:{}}),u(this)}get(){let e=this._store.get();return(this._prevState!==e||null===this._stateCached)&&(this._prevState=e,this._stateCached=function(e){let t={threadsById:{...e.rawThreadsById},notificationsById:{...e.notificationsById},settingsByRoomId:{...e.settingsByRoomId}};for(let n of e.optimisticUpdates)switch(n.type){case"create-thread":t.threadsById[n.thread.id]=n.thread;break;case"edit-thread-metadata":{let e=t.threadsById[n.threadId];if(void 0===e||void 0!==e.deletedAt||e.updatedAt>n.updatedAt)break;t.threadsById[e.id]={...e,updatedAt:n.updatedAt,metadata:{...e.metadata,...n.metadata}};break}case"mark-thread-as-resolved":{let e=t.threadsById[n.threadId];if(void 0===e||void 0!==e.deletedAt)break;t.threadsById[e.id]={...e,resolved:!0};break}case"mark-thread-as-unresolved":{let e=t.threadsById[n.threadId];if(void 0===e||void 0!==e.deletedAt)break;t.threadsById[e.id]={...e,resolved:!1};break}case"create-comment":{let e=t.threadsById[n.comment.threadId];if(void 0===e)break;t.threadsById[e.id]=E(e,n.comment);let r=Object.values(t.notificationsById).find(t=>"thread"===t.kind&&t.threadId===e.id);if(void 0===r)break;t.notificationsById[r.id]={...r,notifiedAt:n.comment.createdAt,readAt:n.comment.createdAt};break}case"edit-comment":{let e=t.threadsById[n.comment.threadId];if(void 0===e)break;t.threadsById[e.id]=E(e,n.comment);break}case"delete-comment":{let e=t.threadsById[n.threadId];if(void 0===e)break;t.threadsById[e.id]=x(e,n.commentId,n.deletedAt);break}case"delete-thread":{let e=t.threadsById[n.threadId];if(void 0===e)break;t.threadsById[n.threadId]={...e,deletedAt:n.deletedAt,updatedAt:n.deletedAt,comments:[]};break}case"add-reaction":{let e=t.threadsById[n.threadId];if(void 0===e)break;t.threadsById[e.id]=k(e,n.commentId,n.reaction);break}case"remove-reaction":{let e=t.threadsById[n.threadId];if(void 0===e)break;t.threadsById[e.id]=T(e,n.commentId,n.emoji,n.userId,n.removedAt);break}case"mark-inbox-notification-as-read":{let e=t.notificationsById[n.inboxNotificationId];if(void 0===e)break;t.notificationsById[n.inboxNotificationId]={...e,readAt:n.readAt};break}case"mark-all-inbox-notifications-as-read":for(let e in t.notificationsById){let r=t.notificationsById[e];if(void 0===r)break;t.notificationsById[e]={...r,readAt:n.readAt}}break;case"delete-inbox-notification":delete t.notificationsById[n.inboxNotificationId];break;case"delete-all-inbox-notifications":t.notificationsById={};break;case"update-notification-settings":{let e=t.settingsByRoomId[n.roomId];if(void 0===e)break;t.settingsByRoomId[n.roomId]={...e,...n.settings}}}let n=Object.values(t.threadsById).filter(e=>!e.deletedAt).filter(e=>e.comments.some(e=>void 0===e.deletedAt));return{notifications:Object.values(t.notificationsById).filter(e=>"thread"!==e.kind||t.threadsById[e.threadId]&&t.threadsById[e.threadId]?.deletedAt===void 0).sort((e,t)=>t.notifiedAt.getTime()-e.notifiedAt.getTime()),notificationsById:t.notificationsById,settingsByRoomId:t.settingsByRoomId,queries3:e.queries3,queries4:e.queries4,threads:n,threadsById:t.threadsById,versionsByRoomId:e.versionsByRoomId}}(e)),this._stateCached}batch(e){return this._store.batch(e)}getFullState(){return this.get()}getRoomThreadsAsync(e,t){let n=p(e,t),r=this._roomThreads.get(n);if(void 0===r)return b;let i=r.get();if(i.isLoading||i.error)return i;let s=y(this.getFullState(),{roomId:e,query:t,orderBy:"age"}),o=i.data;return{isLoading:!1,threads:s,hasFetchedAll:o.hasFetchedAll,isFetchingMore:o.isFetchingMore,fetchMoreError:o.fetchMoreError,fetchMore:o.fetchMore}}getUserThreadsAsync(e){let t=m(e),n=this._userThreads.get(t);if(void 0===n)return b;let r=n.get();if(r.isLoading||r.error)return r;let i=y(this.getFullState(),{roomId:null,query:e,orderBy:"last-update"}),s=r.data;return{isLoading:!1,threads:i,hasFetchedAll:s.hasFetchedAll,isFetchingMore:s.isFetchingMore,fetchMoreError:s.fetchMoreError,fetchMore:s.fetchMore}}getInboxNotificationsAsync(){let e=this._notifications.get();if(e.isLoading||e.error)return e;let t=e.data;return{isLoading:!1,inboxNotifications:this.getFullState().notifications,hasFetchedAll:t.hasFetchedAll,isFetchingMore:t.isFetchingMore,fetchMoreError:t.fetchMoreError,fetchMore:t.fetchMore}}getNotificationSettingsAsync(e){let t=this.get(),n=t.queries3[g(e)];return void 0===n||n.isLoading?b:void 0!==n.error?n:{isLoading:!1,settings:(0,i.nn)(t.settingsByRoomId[e])}}getVersionsAsync(e){let t=this.get(),n=t.queries4[v(e)];return void 0===n||n.isLoading?b:void 0!==n.error?n:{isLoading:!1,versions:(0,i.nn)(t.versionsByRoomId[e])}}_hasOptimisticUpdates(){return this._store.get().optimisticUpdates.length>0}subscribe(e){return this._store.subscribe(e)}_subscribeOptimisticUpdates(e){return this.subscribe(e)}subscribeThreads(e){return this.subscribe(e)}subscribeUserThreads(e){return this.subscribe(e)}subscribeThreadsOrInboxNotifications(e){return this.subscribe(e)}subscribeNotificationSettings(e){return this.subscribe(e)}subscribeVersions(e){return this.subscribe(e)}updateThreadsCache(e){this._store.set(t=>{let n=e(t.rawThreadsById);return n!==t.rawThreadsById?{...t,rawThreadsById:n}:t})}updateInboxNotificationsCache(e){this._store.set(t=>{let n=e(t.notificationsById);return n!==t.notificationsById?{...t,notificationsById:n}:t})}setNotificationSettings(e,t){this._store.set(n=>({...n,settingsByRoomId:{...n.settingsByRoomId,[e]:t}}))}setVersions(e,t){this._store.set(n=>({...n,versionsByRoomId:{...n.versionsByRoomId,[e]:t}}))}setQuery3State(e,t){this._store.set(n=>({...n,queries3:{...n.queries3,[e]:t}}))}setQuery4State(e,t){this._store.set(n=>({...n,queries4:{...n.queries4,[e]:t}}))}updateOptimisticUpdatesCache(e){this._store.set(t=>({...t,optimisticUpdates:e(t.optimisticUpdates)}))}force_set(e){return this._store.set(e)}updateInboxNotification(e,t,n){this._store.batch(()=>{this.removeOptimisticUpdate(t),this.updateInboxNotificationsCache(t=>{let r=t[e];return r?{...t,[e]:n(r)}:t})})}updateAllInboxNotifications(e,t){this._store.batch(()=>{this.removeOptimisticUpdate(e),this.updateInboxNotificationsCache(e=>(0,i.Q8)(e,t))})}deleteInboxNotification(e,t){this._store.batch(()=>{this.removeOptimisticUpdate(t),this.updateInboxNotificationsCache(t=>{let{[e]:n,...r}=t;return void 0===n?t:r})})}deleteAllInboxNotifications(e){this._store.batch(()=>{this.removeOptimisticUpdate(e),this.updateInboxNotificationsCache(()=>({}))})}createThread(e,t){this._store.batch(()=>{this.removeOptimisticUpdate(e),this.updateThreadsCache(e=>({...e,[t.id]:t}))})}updateThread(e,t,n,r){this._store.batch(()=>{null!==t&&this.removeOptimisticUpdate(t),this.updateThreadsCache(t=>{let i=t[e];return!i||void 0!==i.deletedAt||r&&i.updatedAt>r?t:{...t,[e]:n(i)}})})}patchThread(e,t,n,r){return this.updateThread(e,t,e=>({...e,...(0,i.yg)(n)}),r)}addReaction(e,t,n,r,i){this.updateThread(e,t,e=>k(e,n,r),i)}removeReaction(e,t,n,r,i,s){this.updateThread(e,t,e=>T(e,n,r,i,s),s)}deleteThread(e,t){return this.updateThread(e,t,e=>({...e,updatedAt:new Date,deletedAt:new Date}))}createComment(e,t){this._store.batch(()=>{this.removeOptimisticUpdate(t);let n=this._store.get().rawThreadsById[e.threadId];n&&(this.updateThreadsCache(t=>({...t,[e.threadId]:E(n,e)})),this.updateInboxNotificationsCache(t=>{let n=Object.values(t).find(t=>"thread"===t.kind&&t.threadId===e.threadId);return n?{...t,[n.id]:{...n,notifiedAt:e.createdAt,readAt:e.createdAt}}:t}))})}editComment(e,t,n){return this.updateThread(e,t,e=>E(e,n))}deleteComment(e,t,n,r){return this.updateThread(e,t,e=>x(e,n,r),r)}updateThreadAndNotification(e,t){this._store.batch(()=>{this.updateThreadsCache(t=>{let n=t[e.id];return void 0===n||0>d(e,n)?{...t,[e.id]:e}:t}),void 0!==t&&this.updateInboxNotificationsCache(e=>({...e,[t.id]:t}))})}updateThreadsAndNotifications(e,t,n=[],r=[]){this._store.batch(()=>{this.updateThreadsCache(t=>(function(e,t){let n={...e};return t.newThreads.forEach(e=>{let t=n[e.id];!(t&&0>d(t,e))&&(n[e.id]=e)}),t.deletedThreads.forEach(({id:e,deletedAt:t})=>{let r=n[e];void 0!==r&&(r.deletedAt=t,r.updatedAt=t,r.comments=[])}),n})(t,{newThreads:e,deletedThreads:n})),this.updateInboxNotificationsCache(e=>(function(e,t){let n={...e};return t.newInboxNotifications.forEach(e=>{let t=n[e.id];(!t||1!=(t.notifiedAt>e.notifiedAt?1:t.notifiedAt<e.notifiedAt?-1:t.readAt&&e.readAt?t.readAt>e.readAt?1:t.readAt<e.readAt?-1:0:t.readAt||e.readAt?t.readAt?1:-1:0))&&(n[e.id]=e)}),t.deletedNotifications.forEach(({id:e})=>delete n[e]),n})(e,{newInboxNotifications:t,deletedNotifications:r}))})}updateRoomInboxNotificationSettings2(e,t,n){this._store.batch(()=>{this.removeOptimisticUpdate(t),this.setNotificationSettings(e,n)})}updateRoomInboxNotificationSettings(e,t,n){this._store.batch(()=>{this.setQuery3OK(n),this.setNotificationSettings(e,t)})}updateRoomVersions(e,t,n){this._store.batch(()=>{this.setVersions(e,t),void 0!==n&&this.setQuery4OK(n)})}addOptimisticUpdate(e){let t=(0,i.x0)(),n={...e,id:t};return this.updateOptimisticUpdatesCache(e=>[...e,n]),t}removeOptimisticUpdate(e){this.updateOptimisticUpdatesCache(t=>t.filter(t=>t.id!==e))}setQuery3Loading(e){this.setQuery3State(e,b)}setQuery3OK(e){this.setQuery3State(e,f)}setQuery3Error(e,t){this.setQuery3State(e,{isLoading:!1,error:t})}setQuery4Loading(e){this.setQuery4State(e,b)}setQuery4OK(e){this.setQuery4State(e,f)}setQuery4Error(e,t){this.setQuery4State(e,{isLoading:!1,error:t})}async fetchNotificationsDeltaUpdate(){let e=this._notificationsLastRequestedAt;if(null===e)return;let t=(0,i.nn)(this._client,"Client is required in order to load notifications for the room"),n=await t.getInboxNotificationsSince(e);e<n.requestedAt&&(this._notificationsLastRequestedAt=n.requestedAt),this.updateThreadsAndNotifications(n.threads.updated,n.inboxNotifications.updated,n.threads.deleted,n.inboxNotifications.deleted)}waitUntilNotificationsLoaded(){return this._notifications.waitUntilLoaded()}waitUntilRoomThreadsLoaded(e,t){let n=async n=>{if(void 0===this._client)throw new i.MC("Client is required in order to load threads for the room");let r=this._client.getRoom(e);if(null===r)throw new i.MC(`Room with id ${e} is not available on client`);let s=await r.getThreads({cursor:n,query:t});this.updateThreadsAndNotifications(s.threads,s.inboxNotifications);let o=this._roomThreadsLastRequestedAtByRoom.get(e);return(void 0===o||o>s.requestedAt)&&this._roomThreadsLastRequestedAtByRoom.set(e,s.requestedAt),s.nextCursor},r=p(e,t),s=this._roomThreads.get(r);return void 0===s&&(s=new w(n)),s.observable.subscribe(()=>this._store.set(e=>({...e}))),this._roomThreads.set(r,s),s.waitUntilLoaded()}async fetchRoomThreadsDeltaUpdate(e){let t=this._roomThreadsLastRequestedAtByRoom.get(e);if(void 0===t)return;let n=(0,i.nn)(this._client,"Client is required in order to load notifications for the room"),r=(0,i.nn)(n.getRoom(e),`Room with id ${e} is not available on client`),s=await r.getThreadsSince({since:t});this.updateThreadsAndNotifications(s.threads.updated,s.inboxNotifications.updated,s.threads.deleted,s.inboxNotifications.deleted),t<s.requestedAt&&this._roomThreadsLastRequestedAtByRoom.set(e,s.requestedAt)}waitUntilUserThreadsLoaded(e){let t=m(e),n=async t=>{if(void 0===this._client)throw new i.MC("Client is required in order to load threads for the room");let n=await this._client[i.W_].getUserThreads_experimental({cursor:t,query:e});return this.updateThreadsAndNotifications(n.threads,n.inboxNotifications),null===this._userThreadsLastRequestedAt&&(this._userThreadsLastRequestedAt=n.requestedAt),n.nextCursor},r=this._userThreads.get(t);return void 0===r&&(r=new w(n)),r.observable.subscribe(()=>this._store.set(e=>({...e}))),this._userThreads.set(t,r),r.waitUntilLoaded()}async fetchUserThreadsDeltaUpdate(){let e=this._userThreadsLastRequestedAt;if(null===e)return;let t=(0,i.nn)(this._client,"Client is required in order to load threads for the user"),n=await t[i.W_].getUserThreadsSince_experimental({since:e});e<n.requestedAt&&(this._notificationsLastRequestedAt=n.requestedAt),this.updateThreadsAndNotifications(n.threads.updated,n.inboxNotifications.updated,n.threads.deleted,n.inboxNotifications.deleted)}};function E(e,t){if(void 0!==e.deletedAt)return e;if(t.threadId!==e.id)return i.iV.warn(`Comment ${t.id} does not belong to thread ${e.id}`),e;let n=e.comments.find(e=>e.id===t.id);if(void 0===n){let n=new Date(Math.max(e.updatedAt.getTime(),t.createdAt.getTime()));return{...e,updatedAt:n,comments:[...e.comments,t]}}if(void 0!==n.deletedAt)return e;if(void 0===n.editedAt||void 0===t.editedAt||n.editedAt<=t.editedAt){let n=e.comments.map(e=>e.id===t.id?t:e);return{...e,updatedAt:new Date(Math.max(e.updatedAt.getTime(),t.editedAt?.getTime()||t.createdAt.getTime())),comments:n}}return e}function x(e,t,n){if(void 0!==e.deletedAt)return e;let r=e.comments.find(e=>e.id===t);if(void 0===r||void 0!==r.deletedAt)return e;let i=e.comments.map(e=>e.id===t?{...e,deletedAt:n,body:void 0,attachments:[]}:e);return i.every(e=>void 0!==e.deletedAt)?{...e,deletedAt:n,updatedAt:n}:{...e,updatedAt:n,comments:i}}function k(e,t,n){if(void 0!==e.deletedAt)return e;let r=e.comments.find(e=>e.id===t);if(void 0===r||void 0!==r.deletedAt)return e;let i=e.comments.map(e=>e.id===t?{...e,reactions:function(e,t){let n=e.find(e=>e.emoji===t.emoji);return void 0===n?[...e,{emoji:t.emoji,createdAt:t.createdAt,users:[{id:t.userId}]}]:!1===n.users.some(e=>e.id===t.userId)?e.map(e=>e.emoji===t.emoji?{...e,users:[...e.users,{id:t.userId}]}:e):e}(e.reactions,n)}:e);return{...e,updatedAt:new Date(Math.max(n.createdAt.getTime(),e.updatedAt.getTime())),comments:i}}function T(e,t,n,r,i){if(void 0!==e.deletedAt)return e;let s=e.comments.find(e=>e.id===t);if(void 0===s||void 0!==s.deletedAt)return e;let o=e.comments.map(e=>e.id===t?{...e,reactions:e.reactions.map(e=>e.emoji===n?{...e,users:e.users.filter(e=>e.id!==r)}:e).filter(e=>e.users.length>0)}:e);return{...e,updatedAt:new Date(Math.max(i.getTime(),e.updatedAt.getTime())),comments:o}}function O(e,t){if(!(0,i.PO)(e)||!(0,i.PO)(t))return(0,i.Xd)(e,t);let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&(0,i.Xd)(e[n],t[n]))}function I(e){let t=(0,r.useRef)(e);return(0,r.useEffect)(()=>{t.current=e},[e]),t}var C=e=>e;function R(e){return(0,r.useReducer)(C,e)[0]}function A(e){let t=R(e);if("function"!=typeof t)return t;{let t=I(e);return(0,r.useCallback)((...e)=>t.current(...e),[t])}}var P=e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e},M=(0,r.createContext)(null);function L(e){return Error(`resolveUsers didn't return anything for user '${e}'`)}function N(e){return e}var D=new WeakMap,$=new WeakMap;function j(e){return e.inboxNotifications?{isLoading:!1,count:function(e){let t=0;for(let n of e)(null===n.readAt||n.readAt<n.notifiedAt)&&t++;return t}(e.inboxNotifications)}:e}function F(e){let t=D.get(e);return t||(t=new S(e),D.set(e,t)),t}function U(e){let t=$.get(e);return t||(t=function(e){let t=F(e);return{store:t,subscribeToNotificationsDeltaUpdates:function(e){let t=(0,i.x3)(async()=>{try{await e.waitUntilNotificationsLoaded(),await e.fetchNotificationsDeltaUpdate()}catch(e){console.warn(`Polling new inbox notifications failed: ${String(e)}`)}},6e4),n=0;return()=>(n++,t.enable(n>0),()=>{n--,t.enable(n>0)})}(t),subscribeToUserThreadsDeltaUpdates:function(e){let t=(0,i.x3)(async()=>{try{await e.fetchUserThreadsDeltaUpdate()}catch(e){console.warn(`Polling new user threads failed: ${String(e)}`)}},6e4),n=0;return()=>(n++,t.enable(n>0),()=>{n--,t.enable(n>0)})}(t)}}(e),$.set(e,t)),t}function q(e,t,n){let{store:i,subscribeToNotificationsDeltaUpdates:s}=U(e);return(0,r.useEffect)(()=>{i.waitUntilNotificationsLoaded().catch(()=>{})}),(0,r.useEffect)(s,[s]),(0,o.useSyncExternalStoreWithSelector)(i.subscribeThreadsOrInboxNotifications,i.getInboxNotificationsAsync,i.getInboxNotificationsAsync,t,n)}function B(){return(0,r.useContext)(M)}function H(){return B()??(0,i.OU)("LiveblocksProvider is missing from the React tree.")}function z(e){return function(e){let t=B();if(!e?.allowNesting&&null!==t)throw Error("You cannot nest multiple LiveblocksProvider instances in the same React tree.")}(e),r.createElement(M.Provider,{value:e.client},e.children)}function W(e){let{children:t,...n}=e,s={publicApiKey:R(n.publicApiKey),throttle:R(n.throttle),lostConnectionTimeout:R(n.lostConnectionTimeout),backgroundKeepAliveTimeout:R(n.backgroundKeepAliveTimeout),polyfills:R(n.polyfills),unstable_fallbackToHTTP:R(n.unstable_fallbackToHTTP),unstable_streamData:R(n.unstable_streamData),authEndpoint:A(n.authEndpoint),resolveMentionSuggestions:A(n.resolveMentionSuggestions),resolveUsers:A(n.resolveUsers),resolveRoomsInfo:A(n.resolveRoomsInfo),baseUrl:R(n.baseUrl),enableDebugLogging:R(n.enableDebugLogging)},o=(0,r.useMemo)(()=>(0,i.eI)(s),[]);return r.createElement(z,{client:o},t)}function V(){return function(e){P(U(e).store.waitUntilNotificationsLoaded());let t=q(e,N,i.Xd);return(0,i.hu)(!t.error,"Did not expect error"),(0,i.hu)(!t.isLoading,"Did not expect loading"),t}(H())}function G(){var e;return e=H(),(0,r.useCallback)(()=>{let{store:t}=U(e),n=new Date,r=t.addOptimisticUpdate({type:"mark-all-inbox-notifications-as-read",readAt:n});e.markAllInboxNotificationsAsRead().then(()=>{t.updateAllInboxNotifications(r,e=>({...e,readAt:n}))},()=>{t.removeOptimisticUpdate(r)})},[e])}function Q(){var e;return e=H(),(0,r.useCallback)(t=>{let{store:n}=U(e),r=new Date,i=n.addOptimisticUpdate({type:"mark-inbox-notification-as-read",inboxNotificationId:t,readAt:r});e.markInboxNotificationAsRead(t).then(()=>{n.updateInboxNotification(t,i,e=>({...e,readAt:r}))},()=>{n.removeOptimisticUpdate(i)})},[e])}function K(){var e;return e=H(),(0,r.useCallback)(t=>{let{store:n}=U(e),r=new Date,i=n.addOptimisticUpdate({type:"delete-inbox-notification",inboxNotificationId:t,deletedAt:r});e.deleteInboxNotification(t).then(()=>{n.deleteInboxNotification(t,i)},()=>{n.removeOptimisticUpdate(i)})},[e])}function J(){return function(e){P(U(e).store.waitUntilNotificationsLoaded());let t=q(e,j,i.Xd);return(0,i.hu)(!t.isLoading,"Did not expect loading"),(0,i.hu)(!t.error,"Did not expect error"),t}(H())}function X(e){return function(e,t){let n=e[i.W_].roomsInfoStore,s=(0,r.useCallback)(()=>n.getState(t),[n,t]),a=(0,r.useCallback)(e=>{var n,r;return n=e,r=t,void 0===n||n?.isLoading?n??{isLoading:!0}:n.error?n:n.data?{isLoading:!1,info:n.data}:{isLoading:!1,error:Error(`resolveRoomsInfo didn't return anything for room '${r}'`)}},[t]),l=(0,o.useSyncExternalStoreWithSelector)(n.subscribe,s,s,a,i.Xd);return(0,r.useEffect)(()=>{n.get(t)},[n,t,l]),l}(H(),e)}var Z=function(e){return function(e,t){let{store:n}=U(e),s=n.getFullState,a=(0,r.useCallback)(e=>{let n=e.notificationsById[t]??(0,i.OU)(`Inbox notification with ID "${t}" not found`);return"thread"!==n.kind&&(0,i.OU)(`Inbox notification with ID "${t}" is not of kind "thread"`),e.threadsById[n.threadId]??(0,i.OU)(`Thread with ID "${n.threadId}" not found, this inbox notification might not be of kind "thread"`)},[t]);return(0,o.useSyncExternalStoreWithSelector)(n.subscribeThreadsOrInboxNotifications,s,s,a)}(H(),e)},Y=function(e){return function(e,t){let n=e[i.W_].usersStore,s=(0,r.useCallback)(()=>n.getState(t),[n,t]),a=(0,r.useCallback)(e=>void 0===e||e?.isLoading?e??{isLoading:!0}:e.error?e:e.data?{isLoading:!1,user:e.data}:{isLoading:!1,error:L(t)},[t]),l=(0,o.useSyncExternalStoreWithSelector)(n.subscribe,s,s,a,i.Xd);return(0,r.useEffect)(()=>{n.get(t)},[n,t,l]),l}(H(),e)},ee=function(e){return function(e,t){let n=e[i.W_].usersStore,o=(0,r.useCallback)(()=>n.getState(t),[n,t]),a=o();if(!a||a.isLoading)throw n.get(t);if(a.error)throw a.error;if(!a.data)throw L(t);let l=(0,s.useSyncExternalStore)(n.subscribe,o,o);return(0,i.hu)(void 0!==l,"Unexpected missing state"),(0,i.hu)(!l.isLoading,"Unexpected loading state"),(0,i.hu)(!l.error,"Unexpected error state"),{isLoading:!1,user:l.data,error:void 0}}(H(),e)},et=class extends Error{constructor(e,t){super("Create thread failed."),this.cause=e,this.context=t,this.name="CreateThreadError"}},en=class extends Error{constructor(e,t){super("Mark thread as resolved failed."),this.cause=e,this.context=t,this.name="MarkThreadAsResolvedError"}},er=class extends Error{constructor(e,t){super("Mark thread as unresolved failed."),this.cause=e,this.context=t,this.name="MarkThreadAsUnresolvedError"}},ei=class extends Error{constructor(e,t){super("Create comment failed."),this.cause=e,this.context=t,this.name="CreateCommentError"}},es=class extends Error{constructor(e,t){super("Edit comment failed."),this.cause=e,this.context=t,this.name="EditCommentError"}},eo=class extends Error{constructor(e,t){super("Delete comment failed."),this.cause=e,this.context=t,this.name="DeleteCommentError"}},ea=class extends Error{constructor(e,t){super("Add reaction failed."),this.cause=e,this.context=t,this.name="AddReactionError"}},el=class extends Error{constructor(e,t){super("Remove reaction failed."),this.cause=e,this.context=t,this.name="RemoveReactionError"}},eu=class extends Error{constructor(e,t){super("Mark inbox notification as read failed."),this.cause=e,this.context=t,this.name="MarkInboxNotificationAsReadError"}};function ec(e,t){t>=5||setTimeout(()=>{e()},5e3*Math.pow(2,t))}var ed=e=>e,eh=Object.freeze([]);function ef(){return eh}function ep(){return null}function em(e){let t=e.getSelf();return null===t||void 0===t.id?"anonymous":t.id}function eg(e){let t=`Request failed with status ${e.status}: ${e.message}`;if(e.details?.error==="FORBIDDEN"){let n=[t,e.details.suggestion,e.details.docs].filter(Boolean).join("\n");i.iV.error(n)}return Error(t)}var ev=new WeakMap;function ey(e){let t=ev.get(e);return t||(t=function(e){let t=F(e),n=new Map;async function r(e,{retryCount:s}={retryCount:0}){let o=v(e.id),a=n.get(o);if(void 0!==a)return a;let l=e[i.W_].listTextVersions();n.set(o,l),t.setQuery4Loading(o);try{let r=await l,i=(await r.json()).versions.map(({createdAt:e,...t})=>({createdAt:new Date(e),...t}));t.updateRoomVersions(e.id,i,o),n.delete(o)}catch(i){n.delete(o),ec(()=>{r(e,{retryCount:s+1})},s),t.setQuery4Error(o,i)}}async function s(e,{retryCount:r}={retryCount:0}){let i=g(e.id),o=n.get(i);if(void 0!==o)return o;try{let r=e.getNotificationSettings();n.set(i,r),t.setQuery3Loading(i);let s=await r;t.updateRoomInboxNotificationSettings(e.id,s,i)}catch(o){n.delete(i),ec(()=>{s(e,{retryCount:r+1})},r),t.setQuery3Error(i,o)}}let o=(0,i.Zb)();return{store:t,subscribeToRoomThreadsDeltaUpdates:function(e){let t=F(e),n=(0,i.x3)(async()=>{let n=e[i.W_].getRoomIds();await Promise.allSettled(n.map(n=>{let r=e.getRoom(n);if(null!==r)return t.fetchRoomThreadsDeltaUpdate(r.id)}))},3e5),r=0;return()=>(r++,n.enable(r>0),()=>{r--,n.enable(r>0)})}(e),commentsErrorEventSource:o,getInboxNotificationSettings:s,getRoomVersions:r,onMutationFailure:function(e,n,r){if(t.removeOptimisticUpdate(n),e instanceof i.iz){let t=eg(e);o.notify(r(t));return}if(e instanceof i.VB){eg(e);return}throw e}}}(e),ev.set(e,t)),t}function e_(e){let t=H(),{id:n,stableEnterRoom:s}=e,o=R({initialPresence:e.initialPresence,initialStorage:e.initialStorage,unstable_batchedUpdates:e.unstable_batchedUpdates,autoConnect:e.autoConnect??"undefined"!=typeof window}),[{room:l},u]=r.useState(()=>s(n,{...o,autoConnect:!1}));return r.useEffect(()=>{let{store:e}=ey(t);async function n(t){if(t.type===i.yO.THREAD_DELETED){e.deleteThread(t.threadId,null);return}let n=await l.getThread(t.threadId);if(!n.thread){e.deleteThread(t.threadId,null);return}let{thread:r,inboxNotification:s}=n,o=e.getFullState().threadsById[t.threadId];switch(t.type){case i.yO.COMMENT_EDITED:case i.yO.THREAD_METADATA_UPDATED:case i.yO.THREAD_UPDATED:case i.yO.COMMENT_REACTION_ADDED:case i.yO.COMMENT_REACTION_REMOVED:case i.yO.COMMENT_DELETED:if(!o)break;e.updateThreadAndNotification(r,s);break;case i.yO.COMMENT_CREATED:e.updateThreadAndNotification(r,s)}}return l.events.comments.subscribe(e=>void n(e))},[t,l]),r.useEffect(()=>{ey(t).store.fetchRoomThreadsDeltaUpdate(l.id).catch(()=>{})},[t,l.id]),r.useEffect(()=>{function e(){ey(t).store.fetchRoomThreadsDeltaUpdate(l.id).catch(()=>{})}return window.addEventListener("online",e),()=>{window.removeEventListener("online",e)}},[t,l.id]),r.useEffect(()=>{let e=s(n,o);u(e);let{room:t,leave:r}=e;return o.autoConnect&&t.connect(),()=>{r()}},[n,o,s]),r.createElement(a.Provider,{value:l},e.children)}function eb(){let e=l();if(null===e)throw Error("RoomProvider is missing from the React tree.");return e}function ew(){let e=H(),t=eb();return r.useCallback(({threadId:n,body:r,attachments:s})=>{let o=(0,i.F0)(),a=new Date,l={id:o,threadId:n,roomId:t.id,type:"comment",createdAt:a,userId:em(t),body:r,reactions:[],attachments:s??[]},{store:u,onMutationFailure:c}=ey(e),d=u.addOptimisticUpdate({type:"create-comment",comment:l}),h=s?.map(e=>e.id);return t.createComment({threadId:n,commentId:o,body:r,attachmentIds:h}).then(e=>{u.createComment(e,d)},e=>c(e,d,e=>new ei(e,{roomId:t.id,threadId:n,commentId:o,body:r}))),l},[e,t])}function eS(){let e=H(),t=eb();return r.useCallback(({threadId:n,commentId:r,body:s,attachments:o})=>{let a=new Date,{store:l,onMutationFailure:u}=ey(e),c=l.getFullState().threadsById[n];if(void 0===c){i.iV.warn(`Internal unexpected behavior. Cannot edit comment in thread "${n}" because the thread does not exist in the cache.`);return}let d=c.comments.find(e=>e.id===r);if(void 0===d||void 0!==d.deletedAt){i.iV.warn(`Internal unexpected behavior. Cannot edit comment "${r}" in thread "${n}" because the comment does not exist in the cache.`);return}let h=l.addOptimisticUpdate({type:"edit-comment",comment:{...d,editedAt:a,body:s,attachments:o??[]}}),f=o?.map(e=>e.id);t.editComment({threadId:n,commentId:r,body:s,attachmentIds:f}).then(e=>{l.editComment(n,h,e)},e=>u(e,h,e=>new es(e,{roomId:t.id,threadId:n,commentId:r,body:s})))},[e,t])}function eE(){let e=H(),t=eb();return r.useCallback(({threadId:n,commentId:r})=>{let i=new Date,{store:s,onMutationFailure:o}=ey(e),a=s.addOptimisticUpdate({type:"delete-comment",threadId:n,commentId:r,deletedAt:i,roomId:t.id});t.deleteComment({threadId:n,commentId:r}).then(()=>{s.deleteComment(n,a,r,i)},e=>o(e,a,e=>new eo(e,{roomId:t.id,threadId:n,commentId:r})))},[e,t])}function ex(){let e=H(),t=eb();return r.useCallback(({threadId:n,commentId:r,emoji:i})=>{let s=em(t),o=new Date,{store:a,onMutationFailure:l}=ey(e),u=a.addOptimisticUpdate({type:"remove-reaction",threadId:n,commentId:r,emoji:i,userId:s,removedAt:o});t.removeReaction({threadId:n,commentId:r,emoji:i}).then(()=>{a.removeReaction(n,u,r,i,s,o)},e=>l(e,u,e=>new el(e,{roomId:t.id,threadId:n,commentId:r,emoji:i})))},[e,t])}function ek(){let e=H(),t=eb();return r.useCallback(n=>{let{store:r,onMutationFailure:i}=ey(e),s=Object.values(r.getFullState().notificationsById).find(e=>"thread"===e.kind&&e.threadId===n);if(!s)return;let o=new Date,a=r.addOptimisticUpdate({type:"mark-inbox-notification-as-read",inboxNotificationId:s.id,readAt:o});t.markInboxNotificationAsRead(s.id).then(()=>{r.updateInboxNotification(s.id,a,e=>({...e,readAt:o}))},e=>{i(e,a,e=>new eu(e,{inboxNotificationId:s.id}))})},[e,t])}function eT(){let e=H(),t=eb();return r.useCallback(n=>{let r=new Date,{store:i,onMutationFailure:s}=ey(e),o=i.addOptimisticUpdate({type:"mark-thread-as-resolved",threadId:n,updatedAt:r});t.markThreadAsResolved(n).then(()=>{i.patchThread(n,o,{resolved:!0},r)},e=>s(e,o,e=>new en(e,{roomId:t.id,threadId:n})))},[e,t])}function eO(){let e=H(),t=eb();return r.useCallback(n=>{let r=new Date,{store:i,onMutationFailure:s}=ey(e),o=i.addOptimisticUpdate({type:"mark-thread-as-unresolved",threadId:n,updatedAt:r});t.markThreadAsUnresolved(n).then(()=>{i.patchThread(n,o,{resolved:!1},r)},e=>s(e,o,e=>new er(e,{roomId:t.id,threadId:n})))},[e,t])}function eI(e){let{store:t}=ey(H()),n=r.useCallback(t=>{let n=t.notifications.find(t=>"thread"===t.kind&&t.threadId===e),r=t.threadsById[e];return void 0===n||void 0===r?{status:"not-subscribed"}:{status:"subscribed",unreadSince:n.readAt}},[e]);return(0,o.useSyncExternalStoreWithSelector)(t.subscribeThreads,t.getFullState,t.getFullState,n)}function eC(e){return void 0===e||e?.isLoading?e??{isLoading:!0}:e.error?e:((0,i.hu)(void 0!==e.data,"Unexpected missing attachment URL"),{isLoading:!1,url:e.data})}function eR(e){let{attachmentUrlsStore:t}=eb()[i.W_],n=r.useCallback(()=>t.getState(e),[t,e]);return r.useEffect(()=>{t.get(e)},[t,e]),(0,o.useSyncExternalStoreWithSelector)(t.subscribe,n,n,eC,i.Xd)}Symbol();var eA=function(e){let t=H(),[n]=r.useState(()=>new Map),i=r.useCallback((e,r)=>{let i=n.get(e);if(i)return i;let s=t.enterRoom(e,r),o=s.leave;return s.leave=()=>{o(),n.delete(e)},n.set(e,s),s},[t,n]);return r.createElement(e_,{...e,stableEnterRoom:i})},eP=eb,eM=function(){return null!==l()},eL=function(){let e=H(),t=eb();return r.useCallback(({threadId:n,commentId:r,emoji:i})=>{let s=new Date,o=em(t),{store:a,onMutationFailure:l}=ey(e),u=a.addOptimisticUpdate({type:"add-reaction",threadId:n,commentId:r,reaction:{emoji:i,userId:o,createdAt:s}});t.addReaction({threadId:n,commentId:r,emoji:i}).then(e=>{a.addReaction(n,u,r,e,s)},e=>l(e,u,e=>new ea(e,{roomId:t.id,threadId:n,commentId:r,emoji:i})))},[e,t])},eN=function(){let e=H(),t=eb();return r.useCallback(n=>{let r=n.body,s=n.metadata??{},o=n.attachments,a=(0,i.iK)(),l=(0,i.F0)(),u=new Date,c={id:l,threadId:a,roomId:t.id,createdAt:u,type:"comment",userId:em(t),body:r,reactions:[],attachments:o??[]},d={id:a,type:"thread",createdAt:u,updatedAt:u,roomId:t.id,metadata:s,comments:[c],resolved:!1},{store:h,onMutationFailure:f}=ey(e),p=h.addOptimisticUpdate({type:"create-thread",thread:d,roomId:t.id}),m=o?.map(e=>e.id);return t.createThread({threadId:a,commentId:l,body:r,metadata:s,attachmentIds:m}).then(e=>{h.createThread(p,e)},e=>f(e,p,e=>new et(e,{roomId:t.id,threadId:a,commentId:l,body:r,metadata:s}))),d},[e,t])},eD=function(e){let t=eb(),n=I(e);r.useEffect(()=>t.events.customEvent.subscribe(e=>{n.current(e)}),[t,n])},e$=function(e={query:{metadata:{}}}){let{scrollOnLoad:t=!0}=e,n=H(),i=eb(),{store:s,subscribeToRoomThreadsDeltaUpdates:a}=ey(n);r.useEffect(()=>{s.waitUntilRoomThreadsLoaded(i.id,e.query).catch(()=>{})}),r.useEffect(a,[a]);let l=r.useCallback(()=>s.getRoomThreadsAsync(i.id,e.query),[s,i.id,e.query]),u=(0,o.useSyncExternalStoreWithSelector)(s.subscribeThreads,l,l,ed,O);return r.useEffect(()=>{!function(e,t){if(!1===e||!t.threads||!("undefined"!=typeof window))return;let n=window.location.hash.slice(1);if(!n.startsWith("cm_"))return;let r=document.getElementById(n);null!==r&&t.threads.flatMap(e=>e.comments).some(e=>e.id===n)&&r.scrollIntoView()}(t,u)},[u.isLoading]),u};function ej(...e){return function(e,t){let n=eb(),r=n.events.others.subscribe,i=n.getOthers;return(0,o.useSyncExternalStoreWithSelector)(r,i,ef,e??ed,t)}(...e)}function eF(...e){return function(e,t){let n=eb(),i=n.events.self.subscribe,s=n.getSelf,a=e??ed,l=r.useCallback(e=>null!==e?a(e):null,[a]);return(0,o.useSyncExternalStoreWithSelector)(i,s,ep,l,t)}(...e)}},22888:function(e,t,n){"use strict";n.d(t,{P:function(){return g}});var r=n(52676),i=n(26414),s=n(75271),o=n(95105),a=n(305),l=n(80258),u=n(39367),c=n(6091),d=n(40727);let h=(0,s.forwardRef)(({size:e="var(--cb-icon-size, 70%)",style:t,...n},i)=>(0,r.jsx)("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:i,...n,children:(0,r.jsx)("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));h.displayName="@mantine/core/CloseIcon";var f={root:"m_86a44da5","root--subtle":"m_220c80f2"};let p={variant:"subtle"},m=(0,a.Z)((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":(0,o.ap)(t,"cb-size"),"--cb-radius":void 0===n?void 0:(0,o.H5)(n),"--cb-icon-size":(0,i.h)(r)}})),g=(0,c.b)((e,t)=>{let n=(0,l.w)("CloseButton",p,e),{iconSize:i,children:s,vars:o,radius:a,className:c,classNames:g,style:v,styles:y,unstyled:_,"data-disabled":b,disabled:w,variant:S,icon:E,mod:x,...k}=n,T=(0,u.y)({name:"CloseButton",props:n,className:c,style:v,classes:f,classNames:g,styles:y,unstyled:_,vars:o,varsResolver:m});return(0,r.jsxs)(d.k,{ref:t,...k,unstyled:_,variant:S,disabled:w,mod:[{disabled:w||b},x],...T("root",{variant:S,active:!w&&!b}),children:[E||(0,r.jsx)(h,{}),s]})});g.classes=f,g.displayName="@mantine/core/CloseButton"},32498:function(e,t,n){"use strict";n.d(t,{a:function(){return b}});var r=n(52676),i=n(75271),s=n(95105),o=n(305),a=n(67387),l=n(80258),u=n(39367),c=n(76140),d=n(1271),h=n(4814),f={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};let p=(0,i.forwardRef)(({className:e,...t},n)=>(0,r.jsxs)(c.x,{component:"span",className:(0,h.Z)(f.barsLoader,e),...t,ref:n,children:[(0,r.jsx)("span",{className:f.bar}),(0,r.jsx)("span",{className:f.bar}),(0,r.jsx)("span",{className:f.bar})]}));p.displayName="@mantine/core/Bars";let m=(0,i.forwardRef)(({className:e,...t},n)=>(0,r.jsxs)(c.x,{component:"span",className:(0,h.Z)(f.dotsLoader,e),...t,ref:n,children:[(0,r.jsx)("span",{className:f.dot}),(0,r.jsx)("span",{className:f.dot}),(0,r.jsx)("span",{className:f.dot})]}));m.displayName="@mantine/core/Dots";let g=(0,i.forwardRef)(({className:e,...t},n)=>(0,r.jsx)(c.x,{component:"span",className:(0,h.Z)(f.ovalLoader,e),...t,ref:n}));g.displayName="@mantine/core/Oval";let v={bars:p,oval:g,dots:m},y={loaders:v,type:"oval"},_=(0,o.Z)((e,{size:t,color:n})=>({root:{"--loader-size":(0,s.ap)(t,"loader-size"),"--loader-color":n?(0,a.p)(n,e):void 0}})),b=(0,d.d5)((e,t)=>{let n=(0,l.w)("Loader",y,e),{size:i,color:s,type:o,vars:a,className:d,style:h,classNames:p,styles:m,unstyled:g,loaders:v,variant:b,children:w,...S}=n,E=(0,u.y)({name:"Loader",props:n,classes:f,className:d,style:h,classNames:p,styles:m,unstyled:g,vars:a,varsResolver:_});return w?(0,r.jsx)(c.x,{...E("root"),ref:t,...S,children:w}):(0,r.jsx)(c.x,{...E("root"),ref:t,component:v[o],variant:b,size:i,...S})});b.defaultLoaders=v,b.classes=f,b.displayName="@mantine/core/Loader"},63418:function(e,t,n){"use strict";n.d(t,{q:function(){return d}});var r=n(52676),i=n(75271),s=n(30967),o=n(56994),a=n(89290),l=n(80258);let u={},c=(0,i.forwardRef)((e,t)=>{let{children:n,target:c,...d}=(0,l.w)("Portal",u,e),[h,f]=(0,i.useState)(!1),p=(0,i.useRef)(null);return((0,o.Y)(()=>(f(!0),p.current=c?"string"==typeof c?document.querySelector(c):c:function(e){let t=document.createElement("div");return t.setAttribute("data-portal","true"),"string"==typeof e.className&&t.classList.add(...e.className.split(" ").filter(Boolean)),"object"==typeof e.style&&Object.assign(t.style,e.style),"string"==typeof e.id&&t.setAttribute("id",e.id),t}(d),(0,a.kR)(t,p.current),!c&&p.current&&document.body.appendChild(p.current),()=>{!c&&p.current&&document.body.removeChild(p.current)}),[c]),h&&p.current)?(0,s.createPortal)((0,r.jsx)(r.Fragment,{children:n}),p.current):null});function d({withinPortal:e=!0,children:t,...n}){return e?(0,r.jsx)(c,{...n,children:t}):(0,r.jsx)(r.Fragment,{children:t})}c.displayName="@mantine/core/Portal",d.displayName="@mantine/core/OptionalPortal"},40727:function(e,t,n){"use strict";n.d(t,{k:function(){return c}});var r=n(52676);n(75271);var i=n(80258),s=n(39367),o=n(76140),a=n(6091),l={root:"m_87cf2631"};let u={__staticSelector:"UnstyledButton"},c=(0,a.b)((e,t)=>{let n=(0,i.w)("UnstyledButton",u,e),{className:a,component:c="button",__staticSelector:d,unstyled:h,classNames:f,styles:p,style:m,...g}=n,v=(0,s.y)({name:d,props:n,classes:l,className:a,style:m,classNames:f,styles:p,unstyled:h});return(0,r.jsx)(o.x,{...v("root",{focusable:!0}),component:c,ref:t,type:"button"===c?"button":void 0,...g})});c.classes=l,c.displayName="@mantine/core/UnstyledButton"},76140:function(e,t,n){"use strict";n.d(t,{x:function(){return v}});var r=n(52676),i=n(75271),s=n(4814),o=n(4080),a=n(53807),l=n(2882),u=n(54136);function c(e){return e.startsWith("data-")?e:`data-${e}`}function d(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...d(n,t)}),{}):"function"==typeof e?e(t):null==e?{}:e}var h=n(10351);let f={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};var p=n(33080),m=n(59003);let g=(0,i.forwardRef)(({component:e,style:t,__vars:n,className:i,variant:g,mod:v,size:y,hiddenFrom:_,visibleFrom:b,lightHidden:w,darkHidden:S,renderRoot:E,__size:x,...k},T)=>{let O=(0,u.rZ)(),{styleProps:I,rest:C}=(0,h.c)(k),R=(0,l.dv)(),A=R?.()?.(I.sx),P=(0,m.m)(),M=(0,p.n)({styleProps:I,theme:O,data:f}),L={ref:T,style:function({theme:e,style:t,vars:n,styleProps:r}){let i=d(t,e),s=d(n,e);return{...i,...s,...r}}({theme:O,style:t,vars:n,styleProps:M.inlineStyles}),className:(0,s.Z)(i,A,{[P]:M.hasResponsiveStyles,"mantine-light-hidden":w,"mantine-dark-hidden":S,[`mantine-hidden-from-${_}`]:_,[`mantine-visible-from-${b}`]:b}),"data-variant":g,"data-size":(0,a.s)(y)?void 0:y||void 0,size:x,...function e(t){return t?"string"==typeof t?{[c(t)]:!0}:Array.isArray(t)?[...t].reduce((t,n)=>({...t,...e(n)}),{}):Object.keys(t).reduce((e,n)=>{let r=t[n];return void 0===r||""===r||!1===r||null===r||(e[c(n)]=t[n]),e},{}):null}(v),...C};return(0,r.jsxs)(r.Fragment,{children:[M.hasResponsiveStyles&&(0,r.jsx)(o.f,{selector:`.${P}`,styles:M.styles,media:M.media}),"function"==typeof E?E(L):(0,r.jsx)(e||"div",{...L})]})});g.displayName="@mantine/core/Box";let v=g},10351:function(e,t,n){"use strict";n.d(t,{c:function(){return i}});var r=n(5701);function i(e){let{m:t,mx:n,my:i,mt:s,mb:o,ml:a,mr:l,me:u,ms:c,p:d,px:h,py:f,pt:p,pb:m,pl:g,pr:v,pe:y,ps:_,bd:b,bg:w,c:S,opacity:E,ff:x,fz:k,fw:T,lts:O,ta:I,lh:C,fs:R,tt:A,td:P,w:M,miw:L,maw:N,h:D,mih:$,mah:j,bgsz:F,bgp:U,bgr:q,bga:B,pos:H,top:z,left:W,bottom:V,right:G,inset:Q,display:K,flex:J,hiddenFrom:X,visibleFrom:Z,lightHidden:Y,darkHidden:ee,sx:et,...en}=e;return{styleProps:(0,r.L)({m:t,mx:n,my:i,mt:s,mb:o,ml:a,mr:l,me:u,ms:c,p:d,px:h,py:f,pt:p,pb:m,pl:g,pr:v,pe:y,ps:_,bd:b,bg:w,c:S,opacity:E,ff:x,fz:k,fw:T,lts:O,ta:I,lh:C,fs:R,tt:A,td:P,w:M,miw:L,maw:N,h:D,mih:$,mah:j,bgsz:F,bgp:U,bgr:q,bga:B,pos:H,top:z,left:W,bottom:V,right:G,inset:Q,display:K,flex:J,hiddenFrom:X,visibleFrom:Z,lightHidden:Y,darkHidden:ee,sx:et}),rest:en}}n(75271),n(52676)},33080:function(e,t,n){"use strict";n.d(t,{n:function(){return h}});var r=n(49654);n(75271),n(52676);var i=n(26414),s=n(2141);function o(e,t){let n=(0,s.E)({color:e,theme:t});return"dimmed"===n.color?"var(--mantine-color-dimmed)":"bright"===n.color?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}let a={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"},l=["h1","h2","h3","h4","h5","h6"],u=["h1","h2","h3","h4","h5","h6"],c={color:o,textColor:function(e,t){let n=(0,s.E)({color:e,theme:t});return n.isThemeColor&&void 0===n.shade?`var(--mantine-color-${n.color}-text)`:o(e,t)},fontSize:function(e,t){return"string"==typeof e&&e in t.fontSizes?`var(--mantine-font-size-${e})`:"string"==typeof e&&l.includes(e)?`var(--mantine-${e}-font-size)`:"number"==typeof e||"string"==typeof e?(0,i.h)(e):e},spacing:function(e,t){if("number"==typeof e)return(0,i.h)(e);if("string"==typeof e){let n=e.replace("-","");if(!(n in t.spacing))return(0,i.h)(e);let r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e},identity:function(e){return e},size:function(e){return"number"==typeof e?(0,i.h)(e):e},lineHeight:function(e,t){return"string"==typeof e&&e in t.lineHeights?`var(--mantine-line-height-${e})`:"string"==typeof e&&u.includes(e)?`var(--mantine-${e}-line-height)`:e},fontFamily:function(e){return"string"==typeof e&&e in a?a[e]:e},border:function(e,t){if("number"==typeof e)return(0,i.h)(e);if("string"==typeof e){let[n,r,...s]=e.split(" ").filter(e=>""!==e.trim()),a=`${(0,i.h)(n)}`;return r&&(a+=` ${r}`),s.length>0&&(a+=` ${o(s.join(" "),t)}`),a.trim()}return e}};function d(e){return e.replace("(min-width: ","").replace("em)","")}function h({styleProps:e,data:t,theme:n}){return function({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(d(e))-Number(d(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}((0,r.X)(e).reduce((i,s)=>{var o,a;if("hiddenFrom"===s||"visibleFrom"===s||"sx"===s)return i;let l=t[s],u=Array.isArray(l.property)?l.property:[l.property],d="object"==typeof(a=e[s])&&null!==a?"base"in a?a.base:void 0:a;if(!function(e){if("object"!=typeof e||null===e)return!1;let t=Object.keys(e);return 1!==t.length||"base"!==t[0]}(e[s]))return u.forEach(e=>{i.inlineStyles[e]=c[l.type](d,n)}),i;i.hasResponsiveStyles=!0;let h="object"==typeof(o=e[s])&&null!==o?(0,r.X)(o).filter(e=>"base"!==e):[];return u.forEach(t=>{d&&(i.styles[t]=c[l.type](d,n)),h.forEach(r=>{var o;let a=`(min-width: ${n.breakpoints[r]})`;i.media[a]={...i.media[a],[t]:c[l.type]("object"==typeof(o=e[s])&&null!==o&&r in o?o[r]:o,n)}})}),i},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}},59003:function(e,t,n){"use strict";n.d(t,{m:function(){return i}});var r=n(75271);function i(){let e=(0,r.useId)().replace(/:/g,"");return`__m__-${e}`}},4080:function(e,t,n){"use strict";n.d(t,{f:function(){return a}});var r=n(52676);n(75271);var i=n(2882),s=n(49654);function o(e){return(0,s.X)(e).reduce((t,n)=>void 0!==e[n]?`${t}${n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${e[n]};`:t,"").trim()}function a(e){let t=(0,i.R7)();return(0,r.jsx)("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:function({selector:e,styles:t,media:n,container:r}){let i=t?o(t):"",s=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${o(t.styles)}}}`):[],a=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${o(t.styles)}}}`):[];return`${i?`${e}{${i}}`:""}${s.join("")}${a.join("")}`.trim()}(e)}})}},2882:function(e,t,n){"use strict";n.d(t,{DE:function(){return c},Nu:function(){return u},R7:function(){return l},Sm:function(){return o},XD:function(){return i},dv:function(){return d},sZ:function(){return h},uK:function(){return a},wB:function(){return s}});var r=n(75271);let i=(0,r.createContext)(null);function s(){let e=(0,r.useContext)(i);if(!e)throw Error("[@mantine/core] MantineProvider was not found in tree");return e}function o(){return s().cssVariablesResolver}function a(){return s().classNamesPrefix}function l(){return s().getStyleNonce}function u(){return s().withStaticClasses}function c(){return s().headless}function d(){return s().stylesTransform?.sx}function h(){return s().stylesTransform?.styles}},17134:function(e,t,n){"use strict";n.d(t,{M:function(){return k}});var r=n(52676);function i(e){return"auto"===e||"dark"===e||"light"===e}var s=n(2882),o=n(49654),a=n(77516),l=n(26414),u=n(75271),c=n(54136);function d(){let e=(0,c.rZ)(),t=(0,s.R7)(),n=(0,o.X)(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes("px"),i=(0,a.px)(e.breakpoints[n]),s=r?`${i-.1}px`:(0,l.em)(i-.1),o=r?`${i}px`:(0,l.em)(i);return`${t}@media (max-width: ${s}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${o}) {.mantine-hidden-from-${n} {display: none !important;}}`},"");return(0,r.jsx)("style",{"data-mantine-styles":"classes",nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function h(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join("")}function f(e,t){return(Array.isArray(e)?e:[e]).reduce((e,t)=>`${t}{${e}}`,t)}var p=n(68803),m=n(23818),g=n(3972),v=n(63419);function y({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if("light"===n){let n=(0,m.j)(e,"light"),s={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${9===n?8:n+1})`,[`--mantine-color-${r}-light`]:(0,v.F)(e.colors[t][n],.1),[`--mantine-color-${r}-light-hover`]:(0,v.F)(e.colors[t][n],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:(0,v.F)(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...s}:s}let s=(0,m.j)(e,"dark"),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${s})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${9===s?8:s+1})`,[`--mantine-color-${r}-light`]:(0,v.F)(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:(0,v.F)(e.colors[t][Math.max(0,s-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(s-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:(0,v.F)(e.colors[t][Math.max(s-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}function _(e,t,n){(0,o.X)(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}let b=e=>{let t=(0,m.j)(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:(0,l.h)(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":(0,g.a)(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":(0,g.a)(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)"}};_(r.variables,e.breakpoints,"breakpoint"),_(r.variables,e.spacing,"spacing"),_(r.variables,e.fontSizes,"font-size"),_(r.variables,e.lineHeights,"line-height"),_(r.variables,e.shadows,"shadow"),_(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),(0,o.X)(e.colors).forEach(t=>{let n=e.colors[t];if(n&&"object"==typeof n&&"mantine-virtual-color"in n){Object.assign(r.light,y({theme:e,name:n.name,color:n.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,y({theme:e,name:n.name,color:n.dark,colorScheme:"dark",withColorValues:!0}));return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,y({theme:e,color:t,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,y({theme:e,color:t,colorScheme:"dark",withColorValues:!1}))});let i=e.headings.sizes;return(0,o.X)(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r},w=b(n(53411).t);function S({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=(0,c.rZ)(),i=(0,s.R7)(),a=function({theme:e,generator:t}){let n=b(e),r=t?.(e);return r?(0,p.R)(n,r):n}({theme:n,generator:(0,s.Sm)()}),l=":root"===e&&t,u=function(e,t){let n=h(e.variables),r=n?f(t,n):"",i=h(e.dark),s=h(e.light),o=i?":host"===t?f(`${t}([data-mantine-color-scheme="dark"])`,i):f(`${t}[data-mantine-color-scheme="dark"]`,i):"",a=s?":host"===t?f(`${t}([data-mantine-color-scheme="light"])`,s):f(`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${o}${a}`}(l?function(e){let t={variables:{},light:{},dark:{}};return(0,o.X)(e.variables).forEach(n=>{w.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),(0,o.X)(e.light).forEach(n=>{w.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),(0,o.X)(e.dark).forEach(n=>{w.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}(a):a,e);return u?(0,r.jsx)("style",{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${u}${l?"":`
  ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
  ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
`}`}}):null}S.displayName="@mantine/CssVariables";var E=n(56994);function x(e,t){let n="auto"!==e?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";t()?.setAttribute("data-mantine-color-scheme",n)}function k({theme:e,children:t,getStyleNonce:n,withStaticClasses:o=!0,withGlobalClasses:a=!0,deduplicateCssVariables:l=!0,withCssVariables:h=!0,cssVariablesSelector:f=":root",classNamesPrefix:p="mantine",colorSchemeManager:m=function({key:e="mantine-color-scheme-value"}={}){let t;return{get:t=>{if("undefined"==typeof window)return t;try{let n=window.localStorage.getItem(e);return i(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&i(t.newValue)&&n(t.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}(),defaultColorScheme:g="light",getRootElement:v=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:_,stylesTransform:b}){let{colorScheme:w,setColorScheme:k,clearColorScheme:T}=function({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,u.useRef)(),[s,o]=(0,u.useState)(()=>e.get(t)),a=r||s,l=(0,u.useCallback)(t=>{r||(x(t,n),o(t),e.set(t))},[e.set,a,r]),c=(0,u.useCallback)(()=>{o(t),x(t,n),e.clear()},[e.clear,t]);return(0,u.useEffect)(()=>(e.subscribe(l),e.unsubscribe),[e.subscribe,e.unsubscribe]),(0,E.Y)(()=>{x(e.get(t),n)},[]),(0,u.useEffect)(()=>{if(r)return x(r,n),()=>{};void 0===r&&x(s,n),i.current=window.matchMedia("(prefers-color-scheme: dark)");let e=e=>{"auto"===s&&x(e.matches?"dark":"light",n)};return i.current?.addEventListener("change",e),()=>i.current?.removeEventListener("change",e)},[s,r]),{colorScheme:a,setColorScheme:l,clearColorScheme:c}}({defaultColorScheme:g,forceColorScheme:_,manager:m,getRootElement:v});return function({respectReducedMotion:e,getRootElement:t}){(0,E.Y)(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:v}),(0,r.jsx)(s.XD.Provider,{value:{colorScheme:w,setColorScheme:k,clearColorScheme:T,getRootElement:v,classNamesPrefix:p,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:f,withStaticClasses:o,stylesTransform:b},children:(0,r.jsxs)(c.M2,{theme:e,children:[h&&(0,r.jsx)(S,{cssVariablesSelector:f,deduplicateCssVariables:l}),a&&(0,r.jsx)(d,{}),t]})})}(function(){let e=console.error;console.error=(...t)=>{t.length>1&&"string"==typeof t[0]&&t[0].toLowerCase().includes("extra attributes from the server")&&"string"==typeof t[1]&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}})(),k.displayName="@mantine/core/MantineProvider"},54136:function(e,t,n){"use strict";n.d(t,{M2:function(){return h},rZ:function(){return d}});var r=n(52676),i=n(75271),s=n(53411),o=n(68803);function a(e){return!(e<0)&&!(e>9)&&parseInt(e.toString(),10)===e}function l(e){if(!(e.primaryColor in e.colors))throw Error("[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");if("object"==typeof e.primaryShade&&(!a(e.primaryShade.dark)||!a(e.primaryShade.light))||"number"==typeof e.primaryShade&&!a(e.primaryShade))throw Error("[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }")}let u=(0,i.createContext)(null),c=()=>(0,i.useContext)(u)||s.t;function d(){let e=(0,i.useContext)(u);if(!e)throw Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function h({theme:e,children:t,inherit:n=!0}){let a=c(),d=(0,i.useMemo)(()=>(function(e,t){if(!t)return l(e),e;let n=(0,o.R)(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),l(n),n})(n?a:s.t,e),[e,a,n]);return(0,r.jsx)(u.Provider,{value:d,children:t})}h.displayName="@mantine/core/MantineThemeProvider"},3972:function(e,t,n){"use strict";n.d(t,{R:function(){return s},a:function(){return o}});var r=n(23818),i=n(2141);function s({color:e,theme:t,autoContrast:n}){return("boolean"==typeof n?n:t.autoContrast)&&(0,i.E)({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function o(e,t){return s({color:e.colors[e.primaryColor][(0,r.j)(e,t)],theme:e,autoContrast:null})}},64377:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(67387);function i(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg||t.defaultGradient.deg||0},i=(0,r.p)(n.from,t),s=(0,r.p)(n.to,t);return`linear-gradient(${n.deg}deg, ${i} 0%, ${s} 100%)`}},23818:function(e,t,n){"use strict";function r(e,t){return"number"==typeof e.primaryShade?e.primaryShade:"dark"===t?e.primaryShade.dark:e.primaryShade.light}n.d(t,{j:function(){return r}})},67387:function(e,t,n){"use strict";n.d(t,{p:function(){return i}});var r=n(2141);function i(e,t){let n=(0,r.E)({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}},2141:function(e,t,n){"use strict";n.d(t,{E:function(){return a}});var r=n(23818),i=n(28807);function s(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function o(e,t=.179){return!e.startsWith("var(")&&function(e){if(e.startsWith("oklch("))return(function(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}(e)||0)/100;let{r:t,g:n,b:r}=(0,i.c)(e);return .2126*s(t/255)+.7152*s(n/255)+.0722*s(r/255)}(e)>t}function a({color:e,theme:t,colorScheme:n}){if("string"!=typeof e)throw Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if("bright"===e)return{color:e,value:"dark"===n?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:o("dark"===n?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if("dimmed"===e)return{color:e,value:"dark"===n?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:o("dark"===n?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if("white"===e||"black"===e)return{color:e,value:"white"===e?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:o("white"===e?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};let[i,s]=e.split("."),a=s?Number(s):void 0,l=i in t.colors;if(l){let e=void 0!==a?t.colors[i][a]:t.colors[i][(0,r.j)(t,n||"light")];return{color:i,value:e,shade:a,isThemeColor:l,isLight:o(e,t.luminanceThreshold),variable:s?`--mantine-color-${i}-${a}`:`--mantine-color-${i}-filled`}}return{color:e,value:e,isThemeColor:l,isLight:o(e,t.luminanceThreshold),shade:a,variable:void 0}}},63419:function(e,t,n){"use strict";n.d(t,{F:function(){return s},m:function(){return i}});var r=n(28807);function i(e,t){if("string"!=typeof e||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var("))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);let{r:n,g:i,b:s}=(0,r.c)(e);return`rgba(${n}, ${i}, ${s}, ${t})`}let s=i},28807:function(e,t,n){"use strict";function r(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)?function(e){let t=e.replace("#","");if(3===t.length){let e=t.split("");t=[e[0],e[0],e[1],e[1],e[2],e[2]].join("")}if(8===t.length){let e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:255&n,a:1}}(e):e.startsWith("rgb")?function(e){let[t,n,r,i]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i||1}}(e):e.startsWith("hsl")?function(e){let t,n,r;let i=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!i)return{r:0,g:0,b:0,a:1};let s=parseInt(i[1],10),o=parseInt(i[2],10)/100,a=parseInt(i[3],10)/100,l=i[5]?parseFloat(i[5]):void 0,u=(1-Math.abs(2*a-1))*o,c=s/60,d=u*(1-Math.abs(c%2-1)),h=a-u/2;return c>=0&&c<1?(t=u,n=d,r=0):c>=1&&c<2?(t=d,n=u,r=0):c>=2&&c<3?(t=0,n=u,r=d):c>=3&&c<4?(t=0,n=d,r=u):c>=4&&c<5?(t=d,n=0,r=u):(t=u,n=0,r=d),{r:Math.round((t+h)*255),g:Math.round((n+h)*255),b:Math.round((r+h)*255),a:l||1}}(e):{r:0,g:0,b:0,a:1}}n.d(t,{c:function(){return r}})},53411:function(e,t,n){"use strict";n.d(t,{t:function(){return c}});var r=n(26414);n(75271),n(52676);var i=n(28807);function s(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${100*t}%)`;let{r:n,g:r,b:s,a:o}=(0,i.c)(e),a=1-t,l=e=>Math.round(e*a);return`rgba(${l(n)}, ${l(r)}, ${l(s)}, ${o})`}var o=n(64377),a=n(2141),l=n(63419);let u="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",c={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:{dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:({color:e,theme:t,variant:n,gradient:i,autoContrast:u})=>{let c=(0,a.E)({color:e,theme:t}),d="boolean"==typeof u?u:t.autoContrast;if("filled"===n){let t=d&&c.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return c.isThemeColor?void 0===c.shade?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:t,border:`${(0,r.h)(1)} solid transparent`}:{background:`var(--mantine-color-${c.color}-${c.shade})`,hover:`var(--mantine-color-${c.color}-${9===c.shade?8:c.shade+1})`,color:t,border:`${(0,r.h)(1)} solid transparent`}:{background:e,hover:s(e,.1),color:t,border:`${(0,r.h)(1)} solid transparent`}}if("light"===n){if(c.isThemeColor){if(void 0===c.shade)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${(0,r.h)(1)} solid transparent`};let n=t.colors[c.color][c.shade];return{background:(0,l.m)(n,.1),hover:(0,l.m)(n,.12),color:`var(--mantine-color-${c.color}-${Math.min(c.shade,6)})`,border:`${(0,r.h)(1)} solid transparent`}}return{background:(0,l.m)(e,.1),hover:(0,l.m)(e,.12),color:e,border:`${(0,r.h)(1)} solid transparent`}}if("outline"===n)return c.isThemeColor?void 0===c.shade?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${(0,r.h)(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:(0,l.m)(t.colors[c.color][c.shade],.05),color:`var(--mantine-color-${c.color}-${c.shade})`,border:`${(0,r.h)(1)} solid var(--mantine-color-${c.color}-${c.shade})`}:{background:"transparent",hover:(0,l.m)(e,.05),color:e,border:`${(0,r.h)(1)} solid ${e}`};if("subtle"===n){if(c.isThemeColor){if(void 0===c.shade)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${(0,r.h)(1)} solid transparent`};let n=t.colors[c.color][c.shade];return{background:"transparent",hover:(0,l.m)(n,.12),color:`var(--mantine-color-${c.color}-${Math.min(c.shade,6)})`,border:`${(0,r.h)(1)} solid transparent`}}return{background:"transparent",hover:(0,l.m)(e,.12),color:e,border:`${(0,r.h)(1)} solid transparent`}}return"transparent"===n?c.isThemeColor?void 0===c.shade?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${(0,r.h)(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${c.color}-${Math.min(c.shade,6)})`,border:`${(0,r.h)(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${(0,r.h)(1)} solid transparent`}:"white"===n?c.isThemeColor?void 0===c.shade?{background:"var(--mantine-color-white)",hover:s(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${(0,r.h)(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:s(t.white,.01),color:`var(--mantine-color-${c.color}-${c.shade})`,border:`${(0,r.h)(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:s(t.white,.01),color:e,border:`${(0,r.h)(1)} solid transparent`}:"gradient"===n?{background:(0,o.u)(i,t),hover:(0,o.u)(i,t),color:"var(--mantine-color-white)",border:"none"}:"default"===n?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${(0,r.h)(1)} solid var(--mantine-color-default-border)`}:{}},autoContrast:!1,luminanceThreshold:.3,fontFamily:u,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:u,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:(0,r.h)(34),lineHeight:"1.3"},h2:{fontSize:(0,r.h)(26),lineHeight:"1.35"},h3:{fontSize:(0,r.h)(22),lineHeight:"1.4"},h4:{fontSize:(0,r.h)(18),lineHeight:"1.45"},h5:{fontSize:(0,r.h)(16),lineHeight:"1.5"},h6:{fontSize:(0,r.h)(14),lineHeight:"1.5"}}},fontSizes:{xs:(0,r.h)(12),sm:(0,r.h)(14),md:(0,r.h)(16),lg:(0,r.h)(18),xl:(0,r.h)(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:(0,r.h)(2),sm:(0,r.h)(4),md:(0,r.h)(8),lg:(0,r.h)(16),xl:(0,r.h)(32)},spacing:{xs:(0,r.h)(10),sm:(0,r.h)(12),md:(0,r.h)(16),lg:(0,r.h)(20),xl:(0,r.h)(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${(0,r.h)(1)} ${(0,r.h)(3)} rgba(0, 0, 0, 0.05), 0 ${(0,r.h)(1)} ${(0,r.h)(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${(0,r.h)(1)} ${(0,r.h)(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${(0,r.h)(10)} ${(0,r.h)(15)} ${(0,r.h)(-5)}, rgba(0, 0, 0, 0.04) 0 ${(0,r.h)(7)} ${(0,r.h)(7)} ${(0,r.h)(-5)}`,md:`0 ${(0,r.h)(1)} ${(0,r.h)(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${(0,r.h)(20)} ${(0,r.h)(25)} ${(0,r.h)(-5)}, rgba(0, 0, 0, 0.04) 0 ${(0,r.h)(10)} ${(0,r.h)(10)} ${(0,r.h)(-5)}`,lg:`0 ${(0,r.h)(1)} ${(0,r.h)(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${(0,r.h)(28)} ${(0,r.h)(23)} ${(0,r.h)(-7)}, rgba(0, 0, 0, 0.04) 0 ${(0,r.h)(12)} ${(0,r.h)(12)} ${(0,r.h)(-7)}`,xl:`0 ${(0,r.h)(1)} ${(0,r.h)(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${(0,r.h)(36)} ${(0,r.h)(28)} ${(0,r.h)(-7)}, rgba(0, 0, 0, 0.04) 0 ${(0,r.h)(17)} ${(0,r.h)(17)} ${(0,r.h)(-7)}`},other:{},components:{}}},80258:function(e,t,n){"use strict";n.d(t,{w:function(){return s}});var r=n(5701);n(75271),n(52676);var i=n(54136);function s(e,t,n){let s=(0,i.rZ)(),o=s.components[e]?.defaultProps,a="function"==typeof o?o(s):o;return{...t,...a,...(0,r.L)(n)}}},1271:function(e,t,n){"use strict";n.d(t,{d5:function(){return a},ug:function(){return o},yR:function(){return s}});var r=n(52676),i=n(75271);function s(e){return e}function o(e){return t=>{let n=(0,i.forwardRef)((n,i)=>(0,r.jsx)(e,{...t,...n,ref:i}));return n.extend=e.extend,n.displayName=`WithProps(${e.displayName})`,n}}function a(e){let t=(0,i.forwardRef)(e);return t.extend=s,t.withProps=e=>{let n=(0,i.forwardRef)((n,i)=>(0,r.jsx)(t,{...e,...n,ref:i}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}},6091:function(e,t,n){"use strict";n.d(t,{b:function(){return o}});var r=n(52676),i=n(75271),s=n(1271);function o(e){let t=(0,i.forwardRef)(e);return t.withProps=e=>{let n=(0,i.forwardRef)((n,i)=>(0,r.jsx)(t,{...e,...n,ref:i}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=s.yR,t}},305:function(e,t,n){"use strict";function r(e){return e}n.d(t,{Z:function(){return r}})},69287:function(e,t,n){"use strict";n.d(t,{m:function(){return s}});var r=n(4814);let i={};function s({theme:e,classNames:t,props:n,stylesCtx:s}){return function(e){let t={};return e.forEach(e=>{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=(0,r.Z)(t[e],n):t[e]=n})}),t}((Array.isArray(t)?t:[t]).map(t=>"function"==typeof t?t(e,n,s):t||i))}},30539:function(e,t,n){"use strict";function r({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((t,i)=>"function"==typeof i?{...t,...i(e,n,r)}:{...t,...i},{})}n.d(t,{i:function(){return r}})},39367:function(e,t,n){"use strict";n.d(t,{y:function(){return h}}),n(75271),n(52676);var r=n(2882),i=n(54136),s=n(4814);let o={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};var a=n(69287);function l({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return(0,a.m)({theme:n,classNames:r,props:i,stylesCtx:t})[e]}var u=n(30539);function c({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...c({style:n,theme:t})}),{}):"function"==typeof e?e(t):null==e?{}:e}var d=n(5701);function h({name:e,classes:t,props:n,stylesCtx:h,className:f,style:p,rootSelector:m="root",unstyled:g,classNames:v,styles:y,vars:_,varsResolver:b}){let w=(0,i.rZ)(),S=(0,r.uK)(),E=(0,r.Nu)(),x=(0,r.DE)(),k=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:T,getTransformedStyles:O}=function({props:e,stylesCtx:t,themeName:n}){let s=(0,i.rZ)(),o=r.sZ()?.();return{getTransformedStyles:r=>o?[...r.map(n=>o(n,{props:e,theme:s,ctx:t})),...n.map(n=>o(s.components[n]?.styles,{props:e,theme:s,ctx:t}))].filter(Boolean):[],withStylesTransform:!!o}}({props:n,stylesCtx:h,themeName:k});return(e,r)=>({className:function({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:u,classes:c,unstyled:d,className:h,rootSelector:f,props:p,stylesCtx:m,withStaticClasses:g,headless:v,transformedStyles:y}){return(0,s.Z)(function({theme:e,options:t,unstyled:n}){return(0,s.Z)(t?.focusable&&!n&&(e.focusClassName||o[e.focusRing]),t?.active&&!n&&e.activeClassName)}({theme:e,options:t,unstyled:d||v}),function({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(e=>a.m({theme:t,classNames:t.components[e]?.classNames,props:r,stylesCtx:i})?.[n])}({theme:e,themeName:n,selector:r,props:p,stylesCtx:m}),function({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}({options:t,classes:c,selector:r,unstyled:d}),l({selector:r,stylesCtx:m,theme:e,classNames:u,props:p}),l({selector:r,stylesCtx:m,theme:e,classNames:y,props:p}),function({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return(0,a.m)({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}({selector:r,stylesCtx:m,options:t,props:p,theme:e}),function({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}({rootSelector:f,selector:r,className:h}),function({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}({selector:r,classes:c,unstyled:d||v}),g&&!v&&function({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return!1===r?[]:e.map(e=>`${t}-${e}-${n}`)}({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}({theme:w,options:r,themeName:k,selector:e,classNamesPrefix:S,classNames:v,classes:t,unstyled:g,className:f,rootSelector:m,props:n,stylesCtx:h,withStaticClasses:E,headless:x,transformedStyles:O([r?.styles,y])}),style:function({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:s,rootSelector:o,styles:a,style:l,vars:h,varsResolver:f,headless:p,withStylesTransform:m}){return{...!m&&function({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(t=>(0,u.i)({theme:e,styles:e.components[t]?.styles,props:n,stylesCtx:r})[i]).reduce((e,t)=>({...e,...t}),{})}({theme:e,themeName:t,props:i,stylesCtx:s,selector:n}),...!m&&(0,u.i)({theme:e,styles:a,props:i,stylesCtx:s})[n],...!m&&(0,u.i)({theme:e,styles:r?.styles,props:r?.props||i,stylesCtx:s})[n],...function({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:s,themeName:o,headless:a}){return[a?{}:t?.(n,r,i),...o.map(e=>n.components?.[e]?.vars?.(n,r,i)),e?.(n,r,i)].reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...(0,d.L)(t[n])}}),e),{})?.[s]}({theme:e,props:i,stylesCtx:s,vars:h,varsResolver:f,selector:n,themeName:t,headless:p}),...o===n?c({style:l,theme:e}):null,...c({style:r?.style,theme:e})}}({theme:w,themeName:k,selector:e,options:r,props:n,stylesCtx:h,rootSelector:m,styles:y,style:p,vars:_,varsResolver:b,headless:x,withStylesTransform:T})})}},68803:function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&!Array.isArray(e)}n.d(t,{R:function(){return function e(t,n){let i={...t};return r(t)&&r(n)&&Object.keys(n).forEach(s=>{r(n[s])&&s in t?i[s]=e(i[s],n[s]):i[s]=n[s]}),i}}})},5701:function(e,t,n){"use strict";function r(e){return Object.keys(e).reduce((t,n)=>(void 0!==e[n]&&(t[n]=e[n]),t),{})}n.d(t,{L:function(){return r}})},33059:function(e,t,n){"use strict";n.d(t,{w:function(){return i}});let r={app:100,modal:200,popover:300,overlay:400,max:9999};function i(e){return r[e]}},95105:function(e,t,n){"use strict";n.d(t,{Dp:function(){return u},H5:function(){return a},Xj:function(){return c},ap:function(){return s},bG:function(){return o},yv:function(){return l}});var r=n(53807),i=n(26414);function s(e,t="size",n=!0){if(void 0!==e)return(0,r.s)(e)?n?(0,i.h)(e):e:`var(--${t}-${e})`}function o(e){return s(e,"mantine-spacing")}function a(e){return void 0===e?"var(--mantine-radius-default)":s(e,"mantine-radius")}function l(e){return s(e,"mantine-font-size")}function u(e){return s(e,"mantine-line-height",!1)}function c(e){if(e)return s(e,"mantine-shadow",!1)}},53807:function(e,t,n){"use strict";function r(e){if("number"==typeof e)return!0;if("string"==typeof e){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&""!==e.trim())return!0;let t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(e=>t.test(e))}return!1}n.d(t,{s:function(){return r}})},49654:function(e,t,n){"use strict";function r(e){return Object.keys(e)}n.d(t,{X:function(){return r}})},77516:function(e,t,n){"use strict";function r(e){let t="string"==typeof e&&e.includes("var(--mantine-scale)")?e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim():e;return"number"==typeof t?t:"string"==typeof t?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?16*Number(t.replace("rem","")):t.includes("em")?16*Number(t.replace("em","")):Number(t):NaN}n.d(t,{px:function(){return r}})},26414:function(e,t,n){"use strict";function r(e){return"0rem"===e?"0rem":`calc(${e} * var(--mantine-scale))`}function i(e,{shouldScale:t=!1}={}){return function n(i){if(0===i||"0"===i)return`0${e}`;if("number"==typeof i){let n=`${i/16}${e}`;return t?r(n):n}if("string"==typeof i){if(""===i||i.startsWith("calc(")||i.startsWith("clamp(")||i.includes("rgba("))return i;if(i.includes(","))return i.split(",").map(e=>n(e)).join(",");if(i.includes(" "))return i.split(" ").map(e=>n(e)).join(" ");if(i.includes(e))return t?r(i):i;let s=i.replace("px","");if(!Number.isNaN(Number(s))){let n=`${Number(s)/16}${e}`;return t?r(n):n}}return i}}n.d(t,{em:function(){return o},h:function(){return s}});let s=i("rem",{shouldScale:!0}),o=i("em")},52635:function(e,t,n){"use strict";n.d(t,{l:function(){return i}});var r=n(75271);function i(e,t){let n=(0,r.useRef)(!1);(0,r.useEffect)(()=>()=>{n.current=!1},[]),(0,r.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}},56994:function(e,t,n){"use strict";n.d(t,{Y:function(){return i}});var r=n(75271);let i="undefined"!=typeof document?r.useLayoutEffect:r.useEffect},89290:function(e,t,n){"use strict";n.d(t,{Yx:function(){return o},kR:function(){return i},lq:function(){return s}});var r=n(75271);function i(e,t){"function"==typeof e?e(t):"object"==typeof e&&null!==e&&"current"in e&&(e.current=t)}function s(...e){return t=>{e.forEach(e=>i(e,t))}}function o(...e){return(0,r.useCallback)(s(...e),e)}},78399:function(e,t,n){"use strict";n.d(t,{J:function(){return i}});var r=n(75271);function i(e,t){return function(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[i,s]=(0,r.useState)(n?t:!!("undefined"!=typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches),o=(0,r.useRef)();return(0,r.useEffect)(()=>{if("matchMedia"in window)return o.current=window.matchMedia(e),s(o.current.matches),function(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch(n){return e.addListener(t),()=>e.removeListener(t)}}(o.current,e=>s(e.matches))},[e]),i}("(prefers-reduced-motion: reduce)",e,t)}},27894:function(e,t,n){"use strict";function r(){return`mantine-${Math.random().toString(36).slice(2,11)}`}n.d(t,{k:function(){return r}})},16023:function(e,t,n){"use strict";n.d(t,{yK:function(){return l},N9:function(){return u},Ps:function(){return s},zn:function(){return o}});var r=n(27894),i=n(75271);let s=function(e){let t=e,n=!1,r=new Set;return{getState:()=>t,updateState(e){t="function"==typeof e?e(t):e},setState(e){this.updateState(e),r.forEach(e=>e(t))},initialize(e){n||(t=e,n=!0)},subscribe:e=>(r.add(e),()=>r.delete(e))}}({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),o=(e=s)=>(0,i.useSyncExternalStore)(e.subscribe,()=>e.getState(),()=>e.getState());function a(e,t){let n=e.getState(),r=function(e,t,n){let r=[],i=[],s={};for(let o of e){let e=o.position||t;s[e]=s[e]||0,s[e]+=1,s[e]<=n?i.push(o):r.push(o)}return{notifications:i,queue:r}}(t([...n.notifications,...n.queue]),n.defaultPosition,n.limit);e.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function l(e,t=s){return a(t,t=>t.filter(t=>t.id!==e||(t.onClose?.(t),!1))),e}let u={show:function(e,t=s){let n=e.id||(0,r.k)();return a(t,t=>e.id&&t.some(t=>t.id===e.id)?t:[...t,{...e,id:n}]),n},hide:l,update:function(e,t=s){return a(t,t=>t.map(t=>t.id===e.id?{...t,...e}:t)),e.id},clean:function(e=s){a(e,()=>[])},cleanQueue:function(e=s){a(e,t=>t.slice(0,e.getState().limit))},updateState:a}},81198:function(e,t,n){"use strict";n.d(t,{G:function(){return h}});var r=n(71270),i=n(79836),s=n(86516),o=n(46330);class a{constructor(e,t){let n,r;n=e||new o.s,r=t||new o.s,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t;let n=this._pushScope();try{t=e(n)}catch(e){throw this._popScope(),e}return(0,i.J8)(t)?t.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),t)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function l(){let e=(0,r.c)(),t=(0,r.q)(e);return t.stack=t.stack||new a((0,s.Y)("defaultCurrentScope",()=>new o.s),(0,s.Y)("defaultIsolationScope",()=>new o.s))}function u(e){return l().withScope(e)}function c(e,t){let n=l();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function d(e){return l().withScope(()=>e(l().getIsolationScope()))}function h(e){let t=(0,r.q)(e);return t.acs?t.acs:{withIsolationScope:d,withScope:u,withSetScope:c,withSetIsolationScope:(e,t)=>d(t),getCurrentScope:()=>l().getScope(),getIsolationScope:()=>l().getIsolationScope()}}},66569:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(95153),i=n(2005),s=n(20618);function o(e,t){let n=(0,s.s3)(),o=(0,s.aF)();if(!n)return;let{beforeBreadcrumb:a=null,maxBreadcrumbs:l=100}=n.getOptions();if(l<=0)return;let u={timestamp:(0,r.yW)(),...e},c=a?(0,i.Cf)(()=>a(u,t)):u;null!==c&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),o.addBreadcrumb(c,l))}},71270:function(e,t,n){"use strict";n.d(t,{c:function(){return s},q:function(){return o}});var r=n(86516),i=n(14841);function s(){return o(r.GLOBAL_OBJ),r.GLOBAL_OBJ}function o(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||i.J,t[i.J]=t[i.J]||{}}},50814:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});let r="production"},20618:function(e,t,n){"use strict";n.d(t,{$e:function(){return c},aF:function(){return l},lW:function(){return u},nZ:function(){return a},s3:function(){return d}});var r=n(86516),i=n(81198),s=n(71270),o=n(46330);function a(){let e=(0,s.c)();return(0,i.G)(e).getCurrentScope()}function l(){let e=(0,s.c)();return(0,i.G)(e).getIsolationScope()}function u(){return(0,r.Y)("globalScope",()=>new o.s)}function c(...e){let t=(0,s.c)(),n=(0,i.G)(t);if(2===e.length){let[t,r]=e;return t?n.withSetScope(t,r):n.withScope(r)}return n.withScope(e[0])}function d(){return a().getClient()}},95050:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});let r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},60840:function(e,t,n){"use strict";n.d(t,{Qy:function(){return g},Tb:function(){return c},av:function(){return p},cg:function(){return b},eN:function(){return h},uT:function(){return d},v:function(){return f},yj:function(){return v},yl:function(){return m}});var r=n(2005),i=n(86516),s=n(50814),o=n(20618),a=n(95050),l=n(59892),u=n(74761);function c(e,t){return(0,o.nZ)().captureException(e,(0,u.U0)(t))}function d(e,t){let n="string"==typeof t?t:void 0,r="string"!=typeof t?{captureContext:t}:void 0;return(0,o.nZ)().captureMessage(e,n,r)}function h(e,t){return(0,o.nZ)().captureEvent(e,t)}function f(e,t){(0,o.aF)().setContext(e,t)}function p(e){(0,o.aF)().setUser(e)}async function m(e){let t=(0,o.s3)();return t?t.flush(e):(a.X&&r.kg.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}function g(e){(0,o.aF)().addEventProcessor(e)}function v(e){let t=(0,o.s3)(),n=(0,o.aF)(),r=(0,o.nZ)(),{release:a,environment:u=s.J}=t&&t.getOptions()||{},{userAgent:c}=i.GLOBAL_OBJ.navigator||{},d=(0,l.Hv)({release:a,environment:u,user:r.getUser()||n.getUser(),...c&&{userAgent:c},...e}),h=n.getSession();return h&&"ok"===h.status&&(0,l.CT)(h,{status:"exited"}),y(),n.setSession(d),r.setSession(d),d}function y(){let e=(0,o.aF)(),t=(0,o.nZ)(),n=t.getSession()||e.getSession();n&&(0,l.RJ)(n),_(),e.setSession(),t.setSession()}function _(){let e=(0,o.aF)(),t=(0,o.nZ)(),n=(0,o.s3)(),r=t.getSession()||e.getSession();r&&n&&n.captureSession(r)}function b(e=!1){if(e){y();return}_()}},37833:function(e,t,n){"use strict";n.d(t,{y:function(){return i}});var r=n(39388);function i(e){let t=e._sentryMetrics;if(!t)return;let n={};for(let[,[e,i]]of t)(n[e]||(n[e]=[])).push((0,r.Jr)(i));return n}},46330:function(e,t,n){"use strict";n.d(t,{s:function(){return d}});var r=n(48938),i=n(79836),s=n(95153),o=n(46410),a=n(2005),l=n(59892),u=n(35378);class c{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=(0,r.Q)()}clone(){let e=new c;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,(0,u.D)(e,(0,u.Y)(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&(0,l.CT)(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let t="function"==typeof e?e(this):e,[n,r]=t instanceof d?[t.getScopeData(),t.getRequestSession()]:(0,i.PO)(t)?[e,e.requestSession]:[],{tags:s,extra:o,user:a,contexts:l,level:u,fingerprint:c=[],propagationContext:h}=n||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...o},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),c.length&&(this._fingerprint=c),h&&(this._propagationContext=h),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,(0,u.D)(this,void 0),this._attachments=[],this._propagationContext=(0,r.Q)(),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n="number"==typeof t?t:100;if(n<=0)return this;let r={timestamp:(0,s.yW)(),...e},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:(0,u.Y)(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t&&t.event_id?t.event_id:(0,o.DM)();if(!this._client)return a.kg.warn("No client configured on scope - will not capture exception!"),n;let r=Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n&&n.event_id?n.event_id:(0,o.DM)();if(!this._client)return a.kg.warn("No client configured on scope - will not capture message!"),r;let i=Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=t&&t.event_id?t.event_id:(0,o.DM)();return this._client?this._client.captureEvent(e,{...t,event_id:n},this):a.kg.warn("No client configured on scope - will not capture event!"),n}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}let d=c},99173:function(e,t,n){"use strict";n.d(t,{$J:function(){return s},E1:function(){return l},JQ:function(){return d},S3:function(){return o},TE:function(){return i},Wb:function(){return u},Zj:function(){return r},ju:function(){return a},p6:function(){return c}});let r="sentry.source",i="sentry.sample_rate",s="sentry.op",o="sentry.origin",a="sentry.idle_span_finish_reason",l="sentry.measurement_unit",u="sentry.measurement_value",c="sentry.profile_id",d="sentry.exclusive_time"},59892:function(e,t,n){"use strict";n.d(t,{CT:function(){return a},Hv:function(){return o},RJ:function(){return l}});var r=n(95153),i=n(46410),s=n(39388);function o(e){let t=(0,r.ph)(),n={sid:(0,i.DM)(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>(0,s.Jr)({sid:`${n.sid}`,init:n.init,started:new Date(1e3*n.started).toISOString(),timestamp:new Date(1e3*n.timestamp).toISOString(),status:n.status,errors:n.errors,did:"number"==typeof n.did||"string"==typeof n.did?`${n.did}`:void 0,duration:n.duration,abnormal_mechanism:n.abnormal_mechanism,attrs:{release:n.release,environment:n.environment,ip_address:n.ipAddress,user_agent:n.userAgent}})};return e&&a(n,e),n}function a(e,t={}){if(!t.user||(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,r.ph)(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:(0,i.DM)()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function l(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),a(e,n)}},45049:function(e,t,n){"use strict";n.d(t,{Lh:function(){return d},_l:function(){return h},jC:function(){return f}});var r=n(39388),i=n(49110),s=n(50814),o=n(20618),a=n(99173),l=n(63119),u=n(90512);let c="_frozenDsc";function d(e,t){(0,r.xp)(e,c,t)}function h(e,t){let n=t.getOptions(),{publicKey:i}=t.getDsn()||{},o=(0,r.Jr)({environment:n.environment||s.J,release:n.release,public_key:i,trace_id:e});return t.emit("createDsc",o),o}function f(e){let t=(0,o.s3)();if(!t)return{};let n=h((0,u.XU)(e).trace_id||"",t),r=(0,u.Gx)(e),s=r[c];if(s)return s;let d=r.spanContext().traceState,f=d&&d.get("sentry.dsc"),p=f&&(0,i.EN)(f);if(p)return p;let m=(0,u.XU)(r),g=m.data||{},v=g[a.TE];null!=v&&(n.sample_rate=`${v}`);let y=g[a.Zj],_=m.description;return"url"!==y&&_&&(n.transaction=_),(0,l.z)()&&(n.sampled=String((0,u.Tt)(r))),t.emit("createDsc",n,r),n}},61572:function(e,t,n){"use strict";n.d(t,{OP:function(){return i},Q0:function(){return o},jt:function(){return s},pq:function(){return r}});let r=0,i=1,s=2;function o(e,t){e.setAttribute("http.response.status_code",t);let n=function(e){if(e<400&&e>=100)return{code:i};if(e>=400&&e<500)switch(e){case 401:return{code:s,message:"unauthenticated"};case 403:return{code:s,message:"permission_denied"};case 404:return{code:s,message:"not_found"};case 409:return{code:s,message:"already_exists"};case 413:return{code:s,message:"failed_precondition"};case 429:return{code:s,message:"resource_exhausted"};case 499:return{code:s,message:"cancelled"};default:return{code:s,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:s,message:"unimplemented"};case 503:return{code:s,message:"unavailable"};case 504:return{code:s,message:"deadline_exceeded"};default:return{code:s,message:"internal_error"}}return{code:s,message:"unknown_error"}}(t);"unknown_error"!==n.message&&e.setStatus(n)}},63119:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(20618);function i(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;let t=(0,r.s3)(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}},74761:function(e,t,n){"use strict";n.d(t,{U0:function(){return S},R:function(){return b}});var r=n(46410),i=n(95153),s=n(70077),o=n(86516),a=n(2341),l=n(50814),u=n(20618),c=n(26013),d=n(2005),h=n(79836),f=n(95050),p=n(46330),m=n(39388),g=n(45049),v=n(90512);function y(e,t){let{extra:n,tags:r,user:i,contexts:s,level:o,sdkProcessingMetadata:a,breadcrumbs:l,fingerprint:u,eventProcessors:c,attachments:d,propagationContext:h,transactionName:f,span:p}=t;_(e,"extra",n),_(e,"tags",r),_(e,"user",i),_(e,"contexts",s),_(e,"sdkProcessingMetadata",a),o&&(e.level=o),f&&(e.transactionName=f),p&&(e.span=p),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),c.length&&(e.eventProcessors=[...e.eventProcessors,...c]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...h}}function _(e,t,n){if(n&&Object.keys(n).length)for(let r in e[t]={...e[t]},n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}function b(e,t,n,_,b,S){let{normalizeDepth:E=3,normalizeMaxBreadth:x=1e3}=e,k={...t,event_id:t.event_id||n.event_id||(0,r.DM)(),timestamp:t.timestamp||(0,i.yW)()},T=n.integrations||e.integrations.map(e=>e.name);(function(e,t){let{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:l.J),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=(0,s.$G)(e.message,o));let a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=(0,s.$G)(a.value,o));let u=e.request;u&&u.url&&(u.url=(0,s.$G)(u.url,o))})(k,e),T.length>0&&(k.sdk=k.sdk||{},k.sdk.integrations=[...k.sdk.integrations||[],...T]),b&&b.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){let n;let r=o.GLOBAL_OBJ._sentryDebugIds;if(!r)return;let i=w.get(t);i?n=i:(n=new Map,w.set(t,n));let s=Object.entries(r).reduce((e,[r,i])=>{let s;let o=n.get(r);o?s=o:(s=t(r),n.set(r,s));for(let t=s.length-1;t>=0;t--){let n=s[t];if(n.filename){e[n.filename]=i;break}}return e},{});try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.filename&&(e.debug_id=s[e.filename])})})}catch(e){}}(k,e.stackParser);let O=function(e,t){if(!t)return e;let n=e?e.clone():new p.s;return n.update(t),n}(_,n.captureContext);n.mechanism&&(0,r.EG)(k,n.mechanism);let I=b?b.getEventProcessors():[],C=(0,u.lW)().getScopeData();S&&y(C,S.getScopeData()),O&&y(C,O.getScopeData());let R=[...n.attachments||[],...C.attachments];return R.length&&(n.attachments=R),function(e,t){let{fingerprint:n,span:i,breadcrumbs:s,sdkProcessingMetadata:o}=t;(function(e,t){let{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:a}=t,l=(0,m.Jr)(n);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});let u=(0,m.Jr)(r);u&&Object.keys(u).length&&(e.tags={...u,...e.tags});let c=(0,m.Jr)(i);c&&Object.keys(c).length&&(e.user={...c,...e.user});let d=(0,m.Jr)(s);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),o&&(e.level=o),a&&"transaction"!==e.type&&(e.transaction=a)})(e,t),i&&function(e,t){e.contexts={trace:(0,v.wy)(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:(0,g.jC)(t),...e.sdkProcessingMetadata};let n=(0,v.Gx)(t),r=(0,v.XU)(n).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}(e,i),e.fingerprint=e.fingerprint?(0,r.lE)(e.fingerprint):[],n&&(e.fingerprint=e.fingerprint.concat(n)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint,function(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,s),e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...o}}(k,C),(function e(t,n,r,i=0){return new c.cW((s,o)=>{let a=t[i];if(null===n||"function"!=typeof a)s(n);else{let l=a({...n},r);f.X&&a.id&&null===l&&d.kg.log(`Event processor "${a.id}" dropped event`),(0,h.J8)(l)?l.then(n=>e(t,n,r,i+1).then(s)).then(null,o):e(t,l,r,i+1).then(s).then(null,o)}})})([...I,...C.eventProcessors],k,n).then(e=>(e&&function(e){let t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch(e){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof E&&E>0)?function(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:(0,a.Fv)(e.data,t,n)}}))},...e.user&&{user:(0,a.Fv)(e.user,t,n)},...e.contexts&&{contexts:(0,a.Fv)(e.contexts,t,n)},...e.extra&&{extra:(0,a.Fv)(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=(0,a.Fv)(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:(0,a.Fv)(e.data,t,n)}}))),r}(e,E,x):e)}let w=new WeakMap;function S(e){return e?e instanceof p.s||"function"==typeof e||Object.keys(e).some(e=>E.includes(e))?{captureContext:e}:e:void 0}let E=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"]},35378:function(e,t,n){"use strict";n.d(t,{D:function(){return s},Y:function(){return o}});var r=n(39388);let i="_sentrySpan";function s(e,t){t?(0,r.xp)(e,i,t):delete e[i]}function o(e){return e[i]}},90512:function(e,t,n){"use strict";n.d(t,{$k:function(){return y},Dp:function(){return O},Gx:function(){return I},HN:function(){return C},HR:function(){return m},Hb:function(){return v},Tt:function(){return w},XU:function(){return b},_4:function(){return S},ed:function(){return T},i0:function(){return p},j5:function(){return k},ve:function(){return f},wy:function(){return g}});var r=n(39388),i=n(56792),s=n(95153),o=n(81198),a=n(71270),l=n(20618),u=n(37833),c=n(99173),d=n(61572),h=n(35378);let f=0,p=1;function m(e){let{spanId:t,traceId:n}=e.spanContext(),{data:i,op:s,parent_span_id:o,status:a,origin:l}=b(e);return(0,r.Jr)({parent_span_id:o,span_id:t,trace_id:n,data:i,op:s,status:a,origin:l})}function g(e){let{spanId:t,traceId:n}=e.spanContext(),{parent_span_id:i}=b(e);return(0,r.Jr)({parent_span_id:i,span_id:t,trace_id:n})}function v(e){let{traceId:t,spanId:n}=e.spanContext(),r=w(e);return(0,i.$p)(t,n,r)}function y(e){return"number"==typeof e?_(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?_(e.getTime()):(0,s.ph)()}function _(e){return e>9999999999?e/1e3:e}function b(e){if("function"==typeof e.getSpanJSON)return e.getSpanJSON();try{let{spanId:t,traceId:n}=e.spanContext();if(e.attributes&&e.startTime&&e.name&&e.endTime&&e.status){let{attributes:i,startTime:s,name:o,endTime:a,parentSpanId:l,status:d}=e;return(0,r.Jr)({span_id:t,trace_id:n,data:i,description:o,parent_span_id:l,start_timestamp:y(s),timestamp:y(a)||void 0,status:S(d),op:i[c.$J],origin:i[c.S3],_metrics_summary:(0,u.y)(e)})}return{span_id:t,trace_id:n}}catch(e){return{}}}function w(e){let{traceFlags:t}=e.spanContext();return t===p}function S(e){return e&&e.code!==d.pq?e.code===d.OP?"ok":e.message||"unknown_error":void 0}let E="_sentryChildSpans",x="_sentryRootSpan";function k(e,t){let n=e[x]||e;(0,r.xp)(t,x,n),e[E]?e[E].add(t):(0,r.xp)(e,E,new Set([t]))}function T(e,t){e[E]&&e[E].delete(t)}function O(e){let t=new Set;return function e(n){if(!t.has(n)&&w(n))for(let r of(t.add(n),n[E]?Array.from(n[E]):[]))e(r)}(e),Array.from(t)}function I(e){return e[x]||e}function C(){let e=(0,a.c)(),t=(0,o.G)(e);return t.getActiveSpan?t.getActiveSpan():(0,h.Y)((0,l.nZ)())}},50380:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});let r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},49110:function(e,t,n){"use strict";n.d(t,{EN:function(){return u},IQ:function(){return c},bU:function(){return o},lq:function(){return a}});var r=n(9259),i=n(79836),s=n(2005);let o="baggage",a="sentry-",l=/^sentry-/;function u(e){let t=e&&((0,i.HD)(e)||Array.isArray(e))?Array.isArray(e)?e.reduce((e,t)=>(Object.entries(d(t)).forEach(([t,n])=>{e[t]=n}),e),{}):d(e):void 0;if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>(t.match(l)&&(e[t.slice(a.length)]=n),e),{});return Object.keys(n).length>0?n:void 0}function c(e){if(e)return function(e){if(0!==Object.keys(e).length)return Object.entries(e).reduce((e,[t,n],i)=>{let o=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=0===i?o:`${e},${o}`;return a.length>8192?(r.X&&s.kg.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},"")}(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${a}${t}`]=n),e),{}))}function d(e){return e.split(",").map(e=>e.split("=").map(e=>decodeURIComponent(e.trim()))).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}},85026:function(e,t,n){"use strict";n.d(t,{Rt:function(){return s},iY:function(){return l},l4:function(){return o},qT:function(){return a}});var r=n(79836);let i=n(86516).GLOBAL_OBJ;function s(e,t={}){if(!e)return"<unknown>";try{let n,s=e,o=[],a=0,l=0,u=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||80;for(;s&&a++<5&&(n=function(e,t){let n=[];if(!e||!e.tagName)return"";if(i.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}n.push(e.tagName.toLowerCase());let s=t&&t.length?t.filter(t=>e.getAttribute(t)).map(t=>[t,e.getAttribute(t)]):null;if(s&&s.length)s.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{e.id&&n.push(`#${e.id}`);let t=e.className;if(t&&(0,r.HD)(t))for(let e of t.split(/\s+/))n.push(`.${e}`)}for(let t of["aria-label","type","name","title","alt"]){let r=e.getAttribute(t);r&&n.push(`[${t}="${r}"]`)}return n.join("")}(s,u),"html"!==n&&(!(a>1)||!(l+3*o.length+n.length>=c)));)o.push(n),l+=n.length,s=s.parentNode;return o.reverse().join(" > ")}catch(e){return"<unknown>"}}function o(){try{return i.document.location.href}catch(e){return""}}function a(e){return i.document&&i.document.querySelector?i.document.querySelector(e):null}function l(e){if(!i.HTMLElement)return null;let t=e;for(let e=0;e<5&&t;e++){if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}},9259:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});let r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},79836:function(e,t,n){"use strict";n.d(t,{Cy:function(){return v},HD:function(){return u},J8:function(){return g},Kj:function(){return m},Le:function(){return c},PO:function(){return h},TX:function(){return a},V9:function(){return y},VW:function(){return o},VZ:function(){return i},cO:function(){return f},fm:function(){return l},kK:function(){return p},pt:function(){return d},y1:function(){return _}});let r=Object.prototype.toString;function i(e){switch(r.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return y(e,Error)}}function s(e,t){return r.call(e)===`[object ${t}]`}function o(e){return s(e,"ErrorEvent")}function a(e){return s(e,"DOMError")}function l(e){return s(e,"DOMException")}function u(e){return s(e,"String")}function c(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function d(e){return null===e||c(e)||"object"!=typeof e&&"function"!=typeof e}function h(e){return s(e,"Object")}function f(e){return"undefined"!=typeof Event&&y(e,Event)}function p(e){return"undefined"!=typeof Element&&y(e,Element)}function m(e){return s(e,"RegExp")}function g(e){return!!(e&&e.then&&"function"==typeof e.then)}function v(e){return h(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function y(e,t){try{return e instanceof t}catch(e){return!1}}function _(e){return!!("object"==typeof e&&null!==e&&(e.__isVue||e._isVue))}},2005:function(e,t,n){"use strict";n.d(t,{Cf:function(){return a},LD:function(){return o},RU:function(){return s},kg:function(){return l}});var r=n(9259),i=n(86516);let s=["debug","info","warn","error","log","assert","trace"],o={};function a(e){if(!("console"in i.GLOBAL_OBJ))return e();let t=i.GLOBAL_OBJ.console,n={},r=Object.keys(o);r.forEach(e=>{let r=o[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}let l=(0,i.Y)("logger",function(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return r.X?s.forEach(n=>{t[n]=(...t)=>{e&&a(()=>{i.GLOBAL_OBJ.console[n](`Sentry Logger [${n}]:`,...t)})}}):s.forEach(e=>{t[e]=()=>void 0}),t})},46410:function(e,t,n){"use strict";n.d(t,{DM:function(){return s},Db:function(){return l},EG:function(){return u},YO:function(){return c},jH:function(){return a},lE:function(){return d}});var r=n(39388),i=n(86516);function s(){let e=i.GLOBAL_OBJ,t=e.crypto||e.msCrypto,n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{let e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(e){}return"10000000100040008000100000000000".replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function o(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function a(e){let{message:t,event_id:n}=e;if(t)return t;let r=o(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function l(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function u(e,t){let n=o(e);if(!n)return;let r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){let e={...r&&r.data,...t.data};n.mechanism.data=e}}function c(e){if(e&&e.__sentry_captured__)return!0;try{(0,r.xp)(e,"__sentry_captured__",!0)}catch(e){}return!1}function d(e){return Array.isArray(e)?e:[e]}},2341:function(e,t,n){"use strict";n.d(t,{Fv:function(){return o},Qy:function(){return function e(t,n=3,r=102400){let i=o(t,n);return~-encodeURI(JSON.stringify(i)).split(/%..|./).length>r?e(t,n-1,r):i}}});var r=n(79836),i=n(39388),s=n(22611);function o(e,t=100,n=Infinity){try{return function e(t,n,o=Infinity,a=Infinity,l=function(){let e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){let[u,c]=l;if(null==n||["boolean","string"].includes(typeof n)||"number"==typeof n&&Number.isFinite(n))return n;let d=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof global&&t===global)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if((0,r.y1)(t))return"[VueViewModel]";if((0,r.Cy)(t))return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${(0,s.$P)(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;let n=function(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);if(/^HTML(\w*)Element$/.test(n))return`[HTMLElement: ${n}]`;return`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}(t,n);if(!d.startsWith("[object "))return d;if(n.__sentry_skip_normalization__)return n;let h="number"==typeof n.__sentry_override_normalization_depth__?n.__sentry_override_normalization_depth__:o;if(0===h)return d.replace("object ","");if(u(n))return"[Circular ~]";if(n&&"function"==typeof n.toJSON)try{let t=n.toJSON();return e("",t,h-1,a,l)}catch(e){}let f=Array.isArray(n)?[]:{},p=0,m=(0,i.Sh)(n);for(let t in m){if(!Object.prototype.hasOwnProperty.call(m,t))continue;if(p>=a){f[t]="[MaxProperties ~]";break}let n=m[t];f[t]=e(t,n,h-1,a,l),p++}return c(n),f}("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}},39388:function(e,t,n){"use strict";n.d(t,{$Q:function(){return c},HK:function(){return d},Jr:function(){return v},Sh:function(){return f},_j:function(){return h},hl:function(){return l},xp:function(){return u},zf:function(){return g}});var r=n(85026),i=n(9259),s=n(79836),o=n(2005),a=n(70077);function l(e,t,n){if(!(t in e))return;let r=e[t],i=n(r);"function"==typeof i&&c(i,r),e[t]=i}function u(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(n){i.X&&o.kg.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function c(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,u(e,"__sentry_original__",t)}catch(e){}}function d(e){return e.__sentry_original__}function h(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function f(e){if((0,s.VZ)(e))return{message:e.message,name:e.name,stack:e.stack,...m(e)};if(!(0,s.cO)(e))return e;{let t={type:e.type,target:p(e.target),currentTarget:p(e.currentTarget),...m(e)};return"undefined"!=typeof CustomEvent&&(0,s.V9)(e,CustomEvent)&&(t.detail=e.detail),t}}function p(e){try{return(0,s.kK)(e)?(0,r.Rt)(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}}function m(e){if("object"!=typeof e||null===e)return{};{let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}}function g(e,t=40){let n=Object.keys(f(e));n.sort();let r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return(0,a.$G)(r,t);for(let e=n.length;e>0;e--){let r=n.slice(0,e).join(", ");if(!(r.length>t)){if(e===n.length)return r;return(0,a.$G)(r,t)}}return""}function v(e){return function e(t,n){if(function(e){if(!(0,s.PO)(e))return!1;try{let t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(e){return!0}}(t)){let r=n.get(t);if(void 0!==r)return r;let i={};for(let r of(n.set(t,i),Object.getOwnPropertyNames(t)))void 0!==t[r]&&(i[r]=e(t[r],n));return i}if(Array.isArray(t)){let r=n.get(t);if(void 0!==r)return r;let i=[];return n.set(t,i),t.forEach(t=>{i.push(e(t,n))}),i}return t}(e,new Map)}},48938:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(46410);function i(){return{traceId:(0,r.DM)(),spanId:(0,r.DM)().substring(16)}}},22611:function(e,t,n){"use strict";n.d(t,{$P:function(){return c},Fi:function(){return r},Fr:function(){return d},Sq:function(){return a},pE:function(){return o}});let r="?",i=/\(error: (.*)\)/,s=/captureMessage|captureException/;function o(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,o=0)=>{let a=[],u=e.split("\n");for(let e=n;e<u.length;e++){let n=u[e];if(n.length>1024)continue;let r=i.test(n)?n.replace(i,"$1"):n;if(!r.match(/\S*Error: /)){for(let e of t){let t=e(r);if(t){a.push(t);break}}if(a.length>=50+o)break}}return function(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(l(t).function||"")&&t.pop(),t.reverse(),s.test(l(t).function||"")&&(t.pop(),s.test(l(t).function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||l(t).filename,function:e.function||r}))}(a.slice(o))}}function a(e){return Array.isArray(e)?o(...e):e}function l(e){return e[e.length-1]||{}}let u="<anonymous>";function c(e){try{if(!e||"function"!=typeof e)return u;return e.name||u}catch(e){return u}}function d(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch(e){}}}},70077:function(e,t,n){"use strict";n.d(t,{$G:function(){return i},U0:function(){return o},nK:function(){return s}});var r=n(79836);function i(e,t=0){return"string"!=typeof e||0===t?e:e.length<=t?e:`${e.slice(0,t)}...`}function s(e,t){if(!Array.isArray(e))return"";let n=[];for(let t=0;t<e.length;t++){let i=e[t];try{(0,r.y1)(i)?n.push("[VueViewModel]"):n.push(String(i))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function o(e,t=[],n=!1){return t.some(t=>(function(e,t,n=!1){return!!(0,r.HD)(e)&&((0,r.Kj)(t)?t.test(e):!!(0,r.HD)(t)&&(n?e===t:e.includes(t)))})(e,t,n))}},26013:function(e,t,n){"use strict";n.d(t,{$2:function(){return a},WD:function(){return o},cW:function(){return l}});var r,i,s=n(79836);function o(e){return new l(t=>{t(e)})}function a(e){return new l((t,n)=>{n(e)})}(r=i||(i={}))[r.PENDING=0]="PENDING",r[r.RESOLVED=1]="RESOLVED",r[r.REJECTED=2]="REJECTED";class l{constructor(e){l.prototype.__init.call(this),l.prototype.__init2.call(this),l.prototype.__init3.call(this),l.prototype.__init4.call(this),this._state=i.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new l((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new l((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{if(i){n(r);return}t(r)})})}__init(){this._resolve=e=>{this._setResult(i.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(i.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===i.PENDING){if((0,s.J8)(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===i.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===i.RESOLVED&&e[1](this._value),this._state===i.REJECTED&&e[2](this._value),e[0]=!0)})}}}},95153:function(e,t,n){"use strict";n.d(t,{Z1:function(){return o},ph:function(){return s},yW:function(){return i}});var r=n(86516);function i(){return Date.now()/1e3}let s=function(){let{performance:e}=r.GLOBAL_OBJ;if(!e||!e.now)return i;let t=Date.now()-e.now(),n=void 0==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}(),o=(()=>{let{performance:e}=r.GLOBAL_OBJ;if(!e||!e.now)return;let t=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+t-n):36e5,s=e.timing&&e.timing.navigationStart,o="number"==typeof s?Math.abs(s+t-n):36e5;return i<36e5||o<36e5?i<=o?e.timeOrigin:s:n})()},56792:function(e,t,n){"use strict";n.d(t,{$p:function(){return a},pT:function(){return o}});var r=n(49110),i=n(46410);let s=RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function o(e,t){let n=function(e){let t;if(!e)return;let n=e.match(s);if(n)return"1"===n[3]?t=!0:"0"===n[3]&&(t=!1),{traceId:n[1],parentSampled:t,parentSpanId:n[2]}}(e),o=(0,r.EN)(t),{traceId:a,parentSpanId:l,parentSampled:u}=n||{};return n?{traceId:a||(0,i.DM)(),parentSpanId:l||(0,i.DM)().substring(16),spanId:(0,i.DM)().substring(16),sampled:u,dsc:o||{}}:{traceId:a||(0,i.DM)(),spanId:(0,i.DM)().substring(16)}}function a(e=(0,i.DM)(),t=(0,i.DM)().substring(16),n){let r="";return void 0!==n&&(r=n?"-1":"-0"),`${e}-${t}${r}`}},14841:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});let r="8.35.0"},86516:function(e,t,n){"use strict";n.d(t,{GLOBAL_OBJ:function(){return i},Y:function(){return s}});var r=n(14841);let i=globalThis;function s(e,t,n){let s=n||i,o=s.__SENTRY__=s.__SENTRY__||{},a=o[r.J]=o[r.J]||{};return a[e]||(a[e]=t())}},26566:function(e,t,n){"use strict";n.d(t,{j:function(){return s}});var r=n(33485),i=n(48842),s=new class extends r.l{#I;#C;#R;constructor(){super(),this.#R=e=>{if(!i.sk&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#C||this.setEventListener(this.#R)}onUnsubscribe(){this.hasListeners()||(this.#C?.(),this.#C=void 0)}setEventListener(e){this.#R=e,this.#C?.(),this.#C=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#I!==e&&(this.#I=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#I?this.#I:globalThis.document?.visibilityState!=="hidden"}}},88506:function(e,t,n){"use strict";n.d(t,{V:function(){return r}});var r=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=e=>setTimeout(e,0),s=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{--t||o()}return n},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}()},17343:function(e,t,n){"use strict";n.d(t,{N:function(){return s}});var r=n(33485),i=n(48842),s=new class extends r.l{#A=!0;#C;#R;constructor(){super(),this.#R=e=>{if(!i.sk&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#C||this.setEventListener(this.#R)}onUnsubscribe(){this.hasListeners()||(this.#C?.(),this.#C=void 0)}setEventListener(e){this.#R=e,this.#C?.(),this.#C=e(this.setOnline.bind(this))}setOnline(e){this.#A!==e&&(this.#A=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#A}}},43489:function(e,t,n){"use strict";n.d(t,{A:function(){return a},z:function(){return l}});var r=n(48842),i=n(88506),s=n(75865),o=n(19737),a=class extends o.F{#P;#M;#L;#n;#S;#N;constructor(e){super(),this.#N=!1,this.#S=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#L=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#P=function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#P,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#S,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#L.remove(this)}setData(e,t){let n=(0,r.oE)(this.state.data,e,this.options);return this.#r({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#r({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(r.ZT).catch(r.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#P)}isActive(){return this.observers.some(e=>!1!==(0,r.Nc)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===r.CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,r.Kp)(this.state.dataUpdatedAt,e)}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#L.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#N?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#L.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#N=!0,n.signal)})},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{let e=(0,r.cG)(this.options,t),n={queryKey:this.queryKey,meta:this.meta};return(i(n),this.#N=!1,this.options.persister)?this.options.persister(e,n,this):e(n)}};i(o),this.options.behavior?.onFetch(o,this),this.#M=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#r({type:"fetch",meta:o.fetchOptions?.meta});let a=e=>{(0,s.DV)(e)&&e.silent||this.#r({type:"error",error:e}),(0,s.DV)(e)||(this.#L.config.onError?.(e,this),this.#L.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#n=(0,s.Mz)({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(void 0===e){a(Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){a(e);return}this.#L.config.onSuccess?.(e,this),this.#L.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:a,onFail:(e,t)=>{this.#r({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#n.start()}#r(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...l(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let n=e.error;if((0,s.DV)(n)&&n.revert&&this.#M)return{...this.#M,fetchStatus:"idle"};return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),i.V.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#L.notify({query:this,type:"updated",action:e})})}};function l(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,s.Kw)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}},42611:function(e,t,n){"use strict";n.d(t,{z:function(){return u}});var r=n(26566),i=n(88506),s=n(43489),o=n(33485),a=n(40963),l=n(48842),u=class extends o.l{constructor(e,t){super(),this.options=t,this.#i=e,this.#D=null,this.#$=(0,a.O)(),this.options.experimental_prefetchInRender||this.#$.reject(Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#i;#j=void 0;#F=void 0;#s=void 0;#U;#q;#$;#D;#B;#H;#z;#W;#V;#G;#Q=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#j.addObserver(this),c(this.#j,this.options)?this.#K():this.updateResult(),this.#J())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#j,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#j,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#X(),this.#Z(),this.#j.removeObserver(this)}setOptions(e,t){let n=this.options,r=this.#j;if(this.options=this.#i.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,l.Nc)(this.options.enabled,this.#j))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#Y(),this.#j.setOptions(this.options),n._defaulted&&!(0,l.VS)(this.options,n)&&this.#i.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#j,observer:this});let i=this.hasListeners();i&&h(this.#j,r,this.options,n)&&this.#K(),this.updateResult(t),i&&(this.#j!==r||(0,l.Nc)(this.options.enabled,this.#j)!==(0,l.Nc)(n.enabled,this.#j)||(0,l.KC)(this.options.staleTime,this.#j)!==(0,l.KC)(n.staleTime,this.#j))&&this.#ee();let s=this.#et();i&&(this.#j!==r||(0,l.Nc)(this.options.enabled,this.#j)!==(0,l.Nc)(n.enabled,this.#j)||s!==this.#G)&&this.#en(s)}getOptimisticResult(e){let t=this.#i.getQueryCache().build(this.#i,e),n=this.createResult(t,e);return(0,l.VS)(this.getCurrentResult(),n)||(this.#s=n,this.#q=this.options,this.#U=this.#j.state),n}getCurrentResult(){return this.#s}trackResult(e,t){let n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#Q.add(e)}getCurrentQuery(){return this.#j}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#i.defaultQueryOptions(e),n=this.#i.getQueryCache().build(this.#i,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#K({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#K(e){this.#Y();let t=this.#j.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l.ZT)),t}#ee(){this.#X();let e=(0,l.KC)(this.options.staleTime,this.#j);if(l.sk||this.#s.isStale||!(0,l.PN)(e))return;let t=(0,l.Kp)(this.#s.dataUpdatedAt,e);this.#W=setTimeout(()=>{this.#s.isStale||this.updateResult()},t+1)}#et(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#j):this.options.refetchInterval)??!1}#en(e){this.#Z(),this.#G=e,!l.sk&&!1!==(0,l.Nc)(this.options.enabled,this.#j)&&(0,l.PN)(this.#G)&&0!==this.#G&&(this.#V=setInterval(()=>{(this.options.refetchIntervalInBackground||r.j.isFocused())&&this.#K()},this.#G))}#J(){this.#ee(),this.#en(this.#et())}#X(){this.#W&&(clearTimeout(this.#W),this.#W=void 0)}#Z(){this.#V&&(clearInterval(this.#V),this.#V=void 0)}createResult(e,t){let n;let r=this.#j,i=this.options,o=this.#s,u=this.#U,d=this.#q,p=e!==r?e.state:this.#F,{state:m}=e,g={...m},v=!1;if(t._optimisticResults){let n=this.hasListeners(),o=!n&&c(e,t),a=n&&h(e,r,t,i);(o||a)&&(g={...g,...(0,s.z)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(g.fetchStatus="idle")}let{error:y,errorUpdatedAt:_,status:b}=g;if(t.select&&void 0!==g.data){if(o&&g.data===u?.data&&t.select===this.#B)n=this.#H;else try{this.#B=t.select,n=t.select(g.data),n=(0,l.oE)(o?.data,n,t),this.#H=n,this.#D=null}catch(e){this.#D=e}}else n=g.data;if(void 0!==t.placeholderData&&void 0===n&&"pending"===b){let e;if(o?.isPlaceholderData&&t.placeholderData===d?.placeholderData)e=o.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(this.#z?.state.data,this.#z):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#D=null}catch(e){this.#D=e}void 0!==e&&(b="success",n=(0,l.oE)(o?.data,e,t),v=!0)}this.#D&&(y=this.#D,n=this.#H,_=Date.now(),b="error");let w="fetching"===g.fetchStatus,S="pending"===b,E="error"===b,x=S&&w,k=void 0!==n,T={status:b,fetchStatus:g.fetchStatus,isPending:S,isSuccess:"success"===b,isError:E,isInitialLoading:x,isLoading:x,data:n,dataUpdatedAt:g.dataUpdatedAt,error:y,errorUpdatedAt:_,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:E&&!k,isPaused:"paused"===g.fetchStatus,isPlaceholderData:v,isRefetchError:E&&k,isStale:f(e,t),refetch:this.refetch,promise:this.#$};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===T.status?e.reject(T.error):void 0!==T.data&&e.resolve(T.data)},n=()=>{t(this.#$=T.promise=(0,a.O)())},i=this.#$;switch(i.status){case"pending":e.queryHash===r.queryHash&&t(i);break;case"fulfilled":("error"===T.status||T.data!==i.value)&&n();break;case"rejected":("error"!==T.status||T.error!==i.reason)&&n()}}return T}updateResult(e){let t=this.#s,n=this.createResult(this.#j,this.options);if(this.#U=this.#j.state,this.#q=this.options,void 0!==this.#U.data&&(this.#z=this.#j),(0,l.VS)(n,t))return;this.#s=n;let r={};e?.listeners!==!1&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,n="function"==typeof e?e():e;if("all"===n||!n&&!this.#Q.size)return!0;let r=new Set(n??this.#Q);return this.options.throwOnError&&r.add("error"),Object.keys(this.#s).some(e=>this.#s[e]!==t[e]&&r.has(e))})()&&(r.listeners=!0),this.#u({...r,...e})}#Y(){let e=this.#i.getQueryCache().build(this.#i,this.options);if(e===this.#j)return;let t=this.#j;this.#j=e,this.#F=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#J()}#u(e){i.V.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#s)}),this.#i.getQueryCache().notify({query:this.#j,type:"observerResultsUpdated"})})}};function c(e,t){return!1!==(0,l.Nc)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)||void 0!==e.state.data&&d(e,t,t.refetchOnMount)}function d(e,t,n){if(!1!==(0,l.Nc)(t.enabled,e)){let r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&f(e,t)}return!1}function h(e,t,n,r){return(e!==t||!1===(0,l.Nc)(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&f(e,n)}function f(e,t){return!1!==(0,l.Nc)(t.enabled,e)&&e.isStaleByTime((0,l.KC)(t.staleTime,e))}},19737:function(e,t,n){"use strict";n.d(t,{F:function(){return i}});var r=n(48842),i=class{#er;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.PN)(this.gcTime)&&(this.#er=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r.sk?1/0:3e5))}clearGcTimeout(){this.#er&&(clearTimeout(this.#er),this.#er=void 0)}}},75865:function(e,t,n){"use strict";n.d(t,{DV:function(){return c},Kw:function(){return l},Mz:function(){return d}});var r=n(26566),i=n(17343),s=n(40963),o=n(48842);function a(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||i.N.isOnline()}var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){return e instanceof u}function d(e){let t,n=!1,c=0,d=!1,h=(0,s.O)(),f=()=>r.j.isFocused()&&("always"===e.networkMode||i.N.isOnline())&&e.canRun(),p=()=>l(e.networkMode)&&e.canRun(),m=n=>{d||(d=!0,e.onSuccess?.(n),t?.(),h.resolve(n))},g=n=>{d||(d=!0,e.onError?.(n),t?.(),h.reject(n))},v=()=>new Promise(n=>{t=e=>{(d||f())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,d||e.onContinue?.()}),y=()=>{let t;if(d)return;let r=0===c?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(m).catch(t=>{if(d)return;let r=e.retry??(o.sk?0:3),i=e.retryDelay??a,s="function"==typeof i?i(c,t):i,l=!0===r||"number"==typeof r&&c<r||"function"==typeof r&&r(c,t);if(n||!l){g(t);return}c++,e.onFail?.(c,t),(0,o._v)(s).then(()=>f()?void 0:v()).then(()=>{n?g(t):y()})})};return{promise:h,cancel:t=>{d||(g(new u(t)),e.abort?.())},continue:()=>(t?.(),h),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:p,start:()=>(p()?y():v().then(y),h)}}},33485:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},40963:function(e,t,n){"use strict";function r(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}n.d(t,{O:function(){return r}})},48842:function(e,t,n){"use strict";n.d(t,{CN:function(){return x},Ht:function(){return E},KC:function(){return l},Kp:function(){return a},Nc:function(){return u},PN:function(){return o},Q$:function(){return m},Rm:function(){return h},SE:function(){return s},VS:function(){return g},VX:function(){return S},X7:function(){return d},Ym:function(){return f},ZT:function(){return i},_v:function(){return b},_x:function(){return c},cG:function(){return k},oE:function(){return w},sk:function(){return r},to:function(){return p}});var r="undefined"==typeof window||"Deno"in globalThis;function i(){}function s(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function a(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){let{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==h(o,t.options))return!1}else if(!p(t.queryKey,o))return!1}if("all"!==n){let e=t.isActive();if("active"===n&&!e||"inactive"===n&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(!i||i===t.state.fetchStatus)&&(!s||!!s(t))}function d(e,t){let{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(f(t.options.mutationKey)!==f(s))return!1}else if(!p(t.options.mutationKey,s))return!1}return(!r||t.state.status===r)&&(!i||!!i(t))}function h(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>y(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function p(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(n=>!p(e[n],t[n]))}function m(e,t){if(e===t)return e;let n=v(e)&&v(t);if(n||y(e)&&y(t)){let r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{},l=0;for(let i=0;i<o;i++){let o=n?i:s[i];(!n&&r.includes(o)||n)&&void 0===e[o]&&void 0===t[o]?(a[o]=void 0,l++):(a[o]=m(e[o],t[o]),a[o]===e[o]&&void 0!==e[o]&&l++)}return i===o&&l===i?e:a}return t}function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function y(e){if(!_(e))return!1;let t=e.constructor;if(void 0===t)return!0;let n=t.prototype;return!!(_(n)&&n.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(e)===Object.prototype}function _(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return new Promise(t=>{setTimeout(t,e)})}function w(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?m(e,t):t}function S(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function E(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var x=Symbol();function k(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==x?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}},80707:function(e,t,n){"use strict";n.d(t,{NL:function(){return o},aH:function(){return a}});var r=n(75271),i=n(52676),s=r.createContext(void 0),o=e=>{let t=r.useContext(s);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},a=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(s.Provider,{value:e,children:t}))},1561:function(e,t,n){"use strict";let r;n.d(t,{_:function(){return o}});var i=n(75271);n(52676);var s=i.createContext((r=!1,{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r})),o=()=>i.useContext(s)},37968:function(e,t,n){"use strict";n.d(t,{JN:function(){return o},KJ:function(){return a},pf:function(){return s}});var r=n(75271),i=n(20942),s=(e,t)=>{(e.suspense||e.throwOnError)&&!t.isReset()&&(e.retryOnMount=!1)},o=e=>{r.useEffect(()=>{e.clearReset()},[e])},a=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(0,i.L)(n,[e.error,r])},11317:function(e,t,n){"use strict";n.d(t,{S:function(){return s}});var r=n(75271),i=r.createContext(!1),s=()=>r.useContext(i);i.Provider},37811:function(e,t,n){"use strict";n.d(t,{A8:function(){return i},Ct:function(){return r},SB:function(){return o},Z$:function(){return s},j8:function(){return a}});var r=(e,t)=>void 0===t.state.data,i=e=>{e.suspense&&(void 0===e.staleTime&&(e.staleTime=1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))},s=(e,t)=>e.isLoading&&e.isFetching&&!t,o=(e,t)=>e?.suspense&&t.isPending,a=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()})},26720:function(e,t,n){"use strict";n.d(t,{r:function(){return h}});var r=n(75271),i=n(88506),s=n(48842),o=n(80707),a=n(1561),l=n(37968),u=n(11317),c=n(37811),d=n(20942);function h(e,t,n){let h=(0,o.NL)(n),f=(0,u.S)(),p=(0,a._)(),m=h.defaultQueryOptions(e);h.getDefaultOptions().queries?._experimental_beforeQuery?.(m),m._optimisticResults=f?"isRestoring":"optimistic",(0,c.A8)(m),(0,l.pf)(m,p),(0,l.JN)(p);let g=!h.getQueryCache().get(m.queryHash),[v]=r.useState(()=>new t(h,m)),y=v.getOptimisticResult(m);if(r.useSyncExternalStore(r.useCallback(e=>{let t=f?()=>void 0:v.subscribe(i.V.batchCalls(e));return v.updateResult(),t},[v,f]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),r.useEffect(()=>{v.setOptions(m,{listeners:!1})},[m,v]),(0,c.SB)(m,y))throw(0,c.j8)(m,v,p);if((0,l.KJ)({result:y,errorResetBoundary:p,throwOnError:m.throwOnError,query:h.getQueryCache().get(m.queryHash)}))throw y.error;if(h.getDefaultOptions().queries?._experimental_afterQuery?.(m,y),m.experimental_prefetchInRender&&!s.sk&&(0,c.Z$)(y,f)){let e=g?(0,c.j8)(m,v,p):h.getQueryCache().get(m.queryHash)?.promise;e?.catch(d.Z).finally(()=>{v.hasListeners()||v.updateResult()})}return m.notifyOnChangeProps?y:v.trackResult(y)}},94973:function(e,t,n){"use strict";n.d(t,{a:function(){return s}});var r=n(42611),i=n(26720);function s(e,t){return(0,i.r)(e,r.z,t)}},20942:function(e,t,n){"use strict";function r(e,t){return"function"==typeof e?e(...t):!!e}function i(){}n.d(t,{L:function(){return r},Z:function(){return i}})},83760:function(e,t,n){"use strict";function r(e){let t={subscribe(t){let n=null,r=!1,i=!1,s=!1;function o(){if(null===n){s=!0;return}!i&&(i=!0,"function"==typeof n?n():n&&n.unsubscribe())}return n=e({next(e){r||t.next?.(e)},error(e){r||(r=!0,t.error?.(e),o())},complete(){r||(r=!0,t.complete?.(),o())}}),s&&o(),{unsubscribe:o}},pipe:(...e)=>e.reduce(i,t)};return t}function i(e,t){return t(e)}n.d(t,{ss:function(){return o},NT:function(){return a},Bm:function(){return d},fE:function(){return l},ny:function(){return h},ch:function(){return k}});var s=n(28913);class o extends Error{static from(e,t={}){return e instanceof o||e instanceof Error&&"TRPCClientError"===e.name?(t.meta&&(e.meta={...e.meta,...t.meta}),e):(0,s.Kn)(e)&&(0,s.Kn)(e.error)&&"number"==typeof e.error.code&&"string"==typeof e.error.message?new o(e.error.message,{...t,result:e}):new o("string"==typeof e?e:(0,s.Kn)(e)&&"string"==typeof e.message?e.message:"Unknown error",{...t,cause:e})}constructor(e,t){let n=t?.cause;super(e,{cause:n}),this.meta=t?.meta,this.cause=n,this.shape=t?.result?.error,this.data=t?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,o.prototype)}}class a{$request(e){var t;return(t={links:this.links,op:{...e,context:e.context??{},id:++this.requestId}},r(e=>(function e(n=0,r=t.op){let i=t.links[n];if(!i)throw Error("No more links to execute - did you forget to add an ending link?");return i({op:r,next:t=>e(n+1,t)})})().subscribe(e))).pipe(e=>{let t=0,n=null,i=[];return r(r=>(t++,i.push(r),n||(n=e.subscribe({next(e){for(let t of i)t.next?.(e)},error(e){for(let t of i)t.error?.(e)},complete(){for(let e of i)e.complete?.()}})),{unsubscribe(){t--,function(){if(0===t&&n){let e=n;n=null,e.unsubscribe()}}();let e=i.findIndex(e=>e===r);e>-1&&i.splice(e,1)}}))})}async requestAsPromise(e){try{let t=this.$request(e);return(await function(e){let t=new AbortController;return new Promise((n,r)=>{let i=!1;function s(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});let o=e.subscribe({next(e){i=!0,n(e),s()},error(e){r(e)},complete(){t.abort(),s()}})})}(t)).result.data}catch(e){throw o.from(e)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n?.context,signal:null}).subscribe({next(e){"started"===e.result.type?n.onStarted?.({context:e.context}):"stopped"===e.result.type?n.onStopped?.():n.onData?.(e.result.data)},error(e){n.onError?.(e)},complete(){n.onComplete?.()}})}constructor(e){this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}}function l(e){return new a(e)}let u={query:"query",mutate:"mutation",subscribe:"subscription"},c=e=>u[e];function d(e){let t=(0,s.IX)(({path:t,args:n})=>{let r=[...t],i=c(r.pop()),s=r.join(".");return e[i](s,...n)});return(0,s.yh)(n=>e.hasOwnProperty(n)?e[n]:"__untypedClient"===n?e:t[n])}function h(e){return e.__untypedClient}let f=e=>"function"==typeof e;var p=n(33015);let m={query:"GET",mutation:"POST",subscription:"PATCH"};function g(e){return"input"in e?e.transformer.input.serialize(e.input):function(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];t[n]=r}return t}(e.inputs.map(t=>e.transformer.input.serialize(t)))}let v=e=>{let t=e.url.split("?"),n=t[0].replace(/\/$/,"")+"/"+e.path,r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),"query"===e.type||"subscription"===e.type){let t=g(e);void 0!==t&&"POST"!==e.methodOverride&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+="?"+r.join("&")),n},y=e=>{if("query"===e.type&&"POST"!==e.methodOverride)return;let t=g(e);return void 0!==t?JSON.stringify(t):void 0},_=e=>E({...e,contentTypeHeader:"application/json",getUrl:v,getBody:y});class b extends Error{constructor(){let e="AbortError";super(e),this.name=e,this.message=e}}let w=e=>{if(e?.aborted){if(e.throwIfAborted?.(),"undefined"!=typeof DOMException)throw new DOMException("AbortError","AbortError");throw new b}};async function S(e){w(e.signal);let t=e.getUrl(e),n=e.getBody(e),{type:r}=e,i=await (async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),s={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...i};return(function(e){if(e)return e;if("undefined"!=typeof window&&f(window.fetch))return window.fetch;if("undefined"!=typeof globalThis&&f(globalThis.fetch))return globalThis.fetch;throw Error("No fetch implementation found")})(e.fetch)(t,{method:e.methodOverride??m[r],signal:e.signal,body:n,headers:s})}async function E(e){let t={},n=await S(e);t.response=n;let r=await n.json();return t.responseJSON=r,{json:r,meta:t}}let x=e=>{let t=g(e);if(t instanceof FormData){if("mutation"!==e.type&&"POST"!==e.methodOverride)throw Error("FormData is only supported for mutations");return E({...e,contentTypeHeader:void 0,getUrl:v,getBody:()=>t})}if(t instanceof Uint8Array||t instanceof Blob){if("mutation"!==e.type&&"POST"!==e.methodOverride)throw Error("Octet type input is only supported for mutations");return E({...e,contentTypeHeader:"application/octet-stream",getUrl:v,getBody:()=>t})}return _(e)};function k(e){let t={url:e.url.toString(),fetch:e.fetch,transformer:(0,p.S)(e.transformer),methodOverride:e.methodOverride};return()=>({op:n})=>r(r=>{let i;let{path:a,input:l,type:u}=n;if("subscription"===u)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");return x({...t,type:u,path:a,input:l,signal:n.signal,headers:()=>e.headers?"function"==typeof e.headers?e.headers({op:n}):e.headers:{}}).then(e=>{i=e.meta;let n=(0,s.F7)(e.json,t.transformer.output);if(!n.ok){r.error(o.from(n.error,{meta:i}));return}r.next({context:e.meta,result:n.result}),r.complete()}).catch(e=>{r.error(o.from(e,{meta:i}))}),()=>{}})}},33015:function(e,t,n){"use strict";function r(e){return e?"input"in e?e:{input:e,output:e}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}n.d(t,{S:function(){return r}})},28913:function(e,t,n){"use strict";var r,i;n.d(t,{yh:function(){return l},IX:function(){return a},D0:function(){return f},Kn:function(){return c},F7:function(){return _}});let s=()=>{},o=e=>{Object.freeze&&Object.freeze(e)},a=e=>(function e(t,n,a){let l=n.join(".");return(r=a)[i=l]??(r[i]=new Proxy(s,{get(r,i){if("string"==typeof i&&"then"!==i)return e(t,[...n,i],a)},apply(e,r,i){let s=n[n.length-1],a={args:i,path:n};return"call"===s?a={args:i.length>=2?[i[1]]:[],path:n.slice(0,-1)}:"apply"===s&&(a={args:i.length>=2?i[1]:[],path:n.slice(0,-1)}),o(a.args),o(a.path),t(a)}})),a[l]})(e,[],Object.create(null)),l=e=>new Proxy(s,{get(t,n){if("string"==typeof n&&"then"!==n)return e(n)}});function u(e,...t){let n=Object.assign(Object.create(null),e);for(let e of t)for(let t in e){if(t in n&&n[t]!==e[t])throw Error(`Duplicate key ${t}`);n[t]=e[t]}return n}function c(e){return!!e&&!Array.isArray(e)&&"object"==typeof e}function d(e){return Object.assign(Object.create(null),e)}Symbol("unsetMarker");let h="function"==typeof Symbol&&!!Symbol.asyncIterator;function f(e){return h&&c(e)&&Symbol.asyncIterator in e}class p extends Error{}function m(e){if(e instanceof g||e instanceof Error&&"TRPCError"===e.name)return e;let t=new g({code:"INTERNAL_SERVER_ERROR",cause:e});return e instanceof Error&&e.stack&&(t.stack=e.stack),t}class g extends Error{constructor(e){let t=function(e){if(e instanceof Error)return e;let t=typeof e;if("undefined"!==t&&"function"!==t&&null!==e){if("object"!==t)return Error(String(e));if(c(e)){let t=new p;for(let n in e)t[n]=e[n];return t}}}(e.cause);super(e.message??t?.message??e.code,{cause:t}),this.code=e.code,this.name="TRPCError",this.cause||(this.cause=t)}}Symbol("cancelledReadableStream"),Symbol("TrackedEnvelope");let v={input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}};class y extends Error{constructor(){super("Unable to transform response from server")}}function _(e,t){let n;try{n=function(e,t){if("error"in e){let n=t.deserialize(e.error);return{ok:!1,error:{...e,error:n}}}return{ok:!0,result:{...e.result,...(!e.result.type||"data"===e.result.type)&&{type:"data",data:t.deserialize(e.result.data)}}}}(e,t)}catch(e){throw new y}if(!n.ok&&(!c(n.error.error)||"number"!=typeof n.error.error.code)||n.ok&&!c(n.result))throw new y;return n}let b=({shape:e})=>e,w="middlewareMarker";function S(e){if("function"==typeof e&&"function"==typeof e.assert)return e.assert.bind(e);if("function"==typeof e)return e;if("function"==typeof e.parseAsync)return e.parseAsync.bind(e);if("function"==typeof e.parse)return e.parse.bind(e);if("function"==typeof e.validateSync)return e.validateSync.bind(e);if("function"==typeof e.create)return e.create.bind(e);if("function"==typeof e.assert)return t=>(e.assert(t),t);throw Error("Could not find a validator fn")}function E(e,t){let{middlewares:n=[],inputs:r,meta:i,...s}=t;return x({...u(e,s),inputs:[...e.inputs,...r??[]],middlewares:[...e.middlewares,...n],meta:e.meta&&i?{...e.meta,...i}:i??e.meta})}function x(e={}){let t={procedure:!0,inputs:[],middlewares:[],...e};return{_def:t,input(e){let n=S(e);return E(t,{inputs:[e],middlewares:[function(e){let t=async function(t){let n;let r=await t.getRawInput();try{n=await e(r)}catch(e){throw new g({code:"BAD_REQUEST",cause:e})}let i=c(t.input)&&c(n)?{...t.input,...n}:n;return t.next({input:i})};return t._type="input",t}(n)]})},output(e){let n=S(e);return E(t,{output:e,middlewares:[function(e){let t=async function({next:t}){let n=await t();if(!n.ok)return n;try{let t=await e(n.data);return{...n,data:t}}catch(e){throw new g({message:"Output validation failed",code:"INTERNAL_SERVER_ERROR",cause:e})}};return t._type="output",t}(n)]})},meta:e=>E(t,{meta:e}),use:e=>E(t,{middlewares:"_middlewares"in e?e._middlewares:[e]}),unstable_concat:e=>E(t,e._def),query:e=>k({...t,type:"query"},e),mutation:e=>k({...t,type:"mutation"},e),subscription:e=>k({...t,type:"subscription"},e),experimental_caller:e=>E(t,{caller:e})}}function k(e,t){let n=E(e,{resolver:t,middlewares:[async function(e){return{marker:w,ok:!0,data:await t(e),ctx:e.ctx}}]}),r={...n._def,type:e.type,experimental_caller:!!n._def.caller,meta:n._def.meta,$types:null},i=function(e){async function t(t){if(!t||!("getRawInput"in t))throw Error(T);let n=await O(0,e,t);if(!n)throw new g({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!n.ok)throw n.error;return n.data}return t._def=e,t}(n._def),s=n._def.caller;if(!s)return i;let o=async(...e)=>await s({args:e,invoke:i,_def:r});return o._def=r,o}let T=`
This is a client-only function.
If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls
`.trim();async function O(e,t,n){try{let r=t.middlewares[e];return await r({...n,meta:t.meta,input:n.input,next:r=>O(e+1,t,{...n,ctx:r?.ctx?{...n.ctx,...r.ctx}:n.ctx,input:r&&"input"in r?r.input:n.input,getRawInput:r?.getRawInput??n.getRawInput})})}catch(e){return{ok:!1,error:m(e),marker:w}}}let I="undefined"==typeof window||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID,C={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:b,transformer:v},R=["then","call","apply"];function A(e){return function(t){let n=new Set(Object.keys(t).filter(e=>R.includes(e)));if(n.size>0)throw Error("Reserved words used in `router({})` call: "+Array.from(n).join(", "));let r=d({}),i=function e(t,n=[]){let i=d({});for(let[s,o]of Object.entries(t??{})){if(o._def&&"router"in o._def){i[s]=e(o._def.record,[...n,s]);continue}if("function"!=typeof o){i[s]=e(o,[...n,s]);continue}let t=[...n,s].join(".");if(r[t])throw Error(`Duplicate key: ${t}`);r[t]=o,i[s]=o}return i}(t),s={_config:e,router:!0,procedures:r,...C,record:i};return{...i,_def:s,createCaller:P()({_def:s})}}}function P(){return function(e){let t=e._def;return function(e,n){return a(async({path:r,args:i})=>{let s;let o=r.join(".");if(1===r.length&&"_def"===r[0])return t;let a=t.procedures[o];try{return s="function"==typeof e?await Promise.resolve(e()):e,await a({path:o,getRawInput:async()=>i[0],ctx:s,type:a._def.type,signal:n?.signal})}catch(e){throw n?.onError?.({ctx:s,error:m(e),input:i[0],path:o,type:a._def.type}),e}})}}}function M(...e){let t=u({},...e.map(e=>e._def.record));return A({errorFormatter:e.reduce((e,t)=>{if(t._def._config.errorFormatter&&t._def._config.errorFormatter!==b){if(e!==b&&e!==t._def._config.errorFormatter)throw Error("You seem to have several error formatters");return t._def._config.errorFormatter}return e},b),transformer:e.reduce((e,t)=>{if(t._def._config.transformer&&t._def._config.transformer!==v){if(e!==v&&e!==t._def._config.transformer)throw Error("You seem to have several transformers");return t._def._config.transformer}return e},v),isDev:e.every(e=>e._def._config.isDev),allowOutsideOfServer:e.every(e=>e._def._config.allowOutsideOfServer),isServer:e.every(e=>e._def._config.isServer),$types:e[0]?._def._config.$types})(t)}class L{context(){return new L}meta(){return new L}create(e){var t;let n={transformer:"input"in(t=e?.transformer??v)?t:{input:t,output:t},isDev:e?.isDev??globalThis.process?.env.NODE_ENV!=="production",allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??b,isServer:e?.isServer??I,$types:null,experimental:e?.experimental??{}};if(!(e?.isServer??I)&&e?.allowOutsideOfServer!==!0)throw Error("You're trying to use @trpc/server in a non-server environment. This is not supported by default.");return{_config:n,procedure:x({meta:e?.defaultMeta}),middleware:function(e){return function e(t){return{_middlewares:t,unstable_pipe:n=>e([...t,..."_middlewares"in n?n._middlewares:[n]])}}([e])},router:A(n),mergeRouters:M,createCallerFactory:P()}}}new L,Symbol("TypeError")},4814:function(e,t,n){"use strict";t.Z=function(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=function e(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t)){var s=t.length;for(n=0;n<s;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=" "),i+=r)}else for(r in t)t[r]&&(i&&(i+=" "),i+=r)}return i}(e))&&(r&&(r+=" "),r+=t);return r}},89356:function(e){"use strict";e.exports={version:"1.5.1"}}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[9774,179],function(){return t(55134),t(96011),t(64046)}),_N_E=e.O()}]);