@mevdragon/vidfarm-devcli 0.2.14 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/SKILL.director.md +100 -0
- package/SKILL.platform.md +66 -6
- package/dist/src/cli.js +135 -1527
- package/package.json +5 -24
- package/.env.example +0 -60
- package/auto-create-hyperframe-templates/AUTO_CREATE_HYPERFRAME_TEMPLATES.md +0 -275
- package/auto-create-hyperframe-templates/extractor-system-prompt.md +0 -128
- package/auto-create-hyperframe-templates/input-manifest.schema.json +0 -56
- package/auto-create-hyperframe-templates/lambda-memory-estimator.md +0 -118
- package/auto-create-hyperframe-templates/production-graph.schema.json +0 -314
- package/auto-create-hyperframe-templates/runbook.md +0 -198
- package/auto-create-hyperframe-templates/scripts/create-hyperframe-template.mjs +0 -368
- package/auto-create-hyperframe-templates/template-plan.schema.json +0 -311
- package/auto-create-hyperframe-templates/template-planner-prompt.md +0 -144
- package/auto-create-templates/AUTO_CREATE_TEMPLATES.md +0 -599
- package/auto-create-templates/extractor-system-prompt.md +0 -119
- package/auto-create-templates/production-graph.schema.json +0 -276
- package/auto-create-templates/runbook.md +0 -140
- package/auto-create-templates/template-plan.schema.json +0 -301
- package/auto-create-templates/template-planner-prompt.md +0 -137
- package/dist/src/account-pages-legacy.js +0 -9338
- package/dist/src/account-pages-legacy.js.map +0 -1
- package/dist/src/account-pages.js +0 -52
- package/dist/src/account-pages.js.map +0 -1
- package/dist/src/app.js +0 -13711
- package/dist/src/app.js.map +0 -1
- package/dist/src/cli.js.map +0 -1
- package/dist/src/composition-runtime.js +0 -581
- package/dist/src/composition-runtime.js.map +0 -1
- package/dist/src/config.js +0 -140
- package/dist/src/config.js.map +0 -1
- package/dist/src/context.js +0 -492
- package/dist/src/context.js.map +0 -1
- package/dist/src/dev-app-legacy.js +0 -694
- package/dist/src/dev-app-legacy.js.map +0 -1
- package/dist/src/dev-app.js +0 -6
- package/dist/src/dev-app.js.map +0 -1
- package/dist/src/dev-serve.js.map +0 -1
- package/dist/src/domain.js +0 -2
- package/dist/src/domain.js.map +0 -1
- package/dist/src/editor-chat-history.js +0 -82
- package/dist/src/editor-chat-history.js.map +0 -1
- package/dist/src/editor-chat.js +0 -312
- package/dist/src/editor-chat.js.map +0 -1
- package/dist/src/editor-dark-theme.js +0 -1128
- package/dist/src/editor-dark-theme.js.map +0 -1
- package/dist/src/frontend/flockposter-cache-store.js +0 -124
- package/dist/src/frontend/flockposter-cache-store.js.map +0 -1
- package/dist/src/frontend/homepage-client.js +0 -117
- package/dist/src/frontend/homepage-client.js.map +0 -1
- package/dist/src/frontend/homepage-shared.js +0 -4
- package/dist/src/frontend/homepage-shared.js.map +0 -1
- package/dist/src/frontend/homepage-store.js +0 -28
- package/dist/src/frontend/homepage-store.js.map +0 -1
- package/dist/src/frontend/homepage-view.js +0 -260
- package/dist/src/frontend/homepage-view.js.map +0 -1
- package/dist/src/frontend/page-runtime-client.js +0 -124
- package/dist/src/frontend/page-runtime-client.js.map +0 -1
- package/dist/src/frontend/page-runtime-store.js +0 -9
- package/dist/src/frontend/page-runtime-store.js.map +0 -1
- package/dist/src/frontend/sentry.js +0 -42
- package/dist/src/frontend/sentry.js.map +0 -1
- package/dist/src/frontend/template-editor-chat.js +0 -3760
- package/dist/src/frontend/template-editor-chat.js.map +0 -1
- package/dist/src/help-page.js +0 -333
- package/dist/src/help-page.js.map +0 -1
- package/dist/src/homepage.js +0 -919
- package/dist/src/homepage.js.map +0 -1
- package/dist/src/hyperframes/composition.js +0 -180
- package/dist/src/hyperframes/composition.js.map +0 -1
- package/dist/src/index.js +0 -16
- package/dist/src/index.js.map +0 -1
- package/dist/src/instrument.js +0 -30
- package/dist/src/instrument.js.map +0 -1
- package/dist/src/lib/crypto.js +0 -45
- package/dist/src/lib/crypto.js.map +0 -1
- package/dist/src/lib/dev-log.js +0 -54
- package/dist/src/lib/dev-log.js.map +0 -1
- package/dist/src/lib/display-name.js +0 -11
- package/dist/src/lib/display-name.js.map +0 -1
- package/dist/src/lib/ids.js +0 -24
- package/dist/src/lib/ids.js.map +0 -1
- package/dist/src/lib/images.js +0 -19
- package/dist/src/lib/images.js.map +0 -1
- package/dist/src/lib/json.js +0 -15
- package/dist/src/lib/json.js.map +0 -1
- package/dist/src/lib/template-dna.js +0 -543
- package/dist/src/lib/template-dna.js.map +0 -1
- package/dist/src/lib/template-paths.js +0 -28
- package/dist/src/lib/template-paths.js.map +0 -1
- package/dist/src/lib/template-style-options.js +0 -203
- package/dist/src/lib/template-style-options.js.map +0 -1
- package/dist/src/lib/time.js +0 -7
- package/dist/src/lib/time.js.map +0 -1
- package/dist/src/lib/video-quality-harness.js +0 -60
- package/dist/src/lib/video-quality-harness.js.map +0 -1
- package/dist/src/page-runtime.js +0 -2
- package/dist/src/page-runtime.js.map +0 -1
- package/dist/src/page-shell.js +0 -1315
- package/dist/src/page-shell.js.map +0 -1
- package/dist/src/primitive-context.js +0 -299
- package/dist/src/primitive-context.js.map +0 -1
- package/dist/src/primitive-registry.js +0 -2181
- package/dist/src/primitive-registry.js.map +0 -1
- package/dist/src/primitive-sdk.js +0 -4
- package/dist/src/primitive-sdk.js.map +0 -1
- package/dist/src/primitives/remotion/html-image.js +0 -30
- package/dist/src/primitives/remotion/html-image.js.map +0 -1
- package/dist/src/primitives/remotion/media-slideshow.js +0 -60
- package/dist/src/primitives/remotion/media-slideshow.js.map +0 -1
- package/dist/src/react-page-shell.js +0 -35
- package/dist/src/react-page-shell.js.map +0 -1
- package/dist/src/ready-post-schedule-component.js +0 -1515
- package/dist/src/ready-post-schedule-component.js.map +0 -1
- package/dist/src/registry.js +0 -296
- package/dist/src/registry.js.map +0 -1
- package/dist/src/runtime.js +0 -31
- package/dist/src/runtime.js.map +0 -1
- package/dist/src/services/api-call-history.js +0 -249
- package/dist/src/services/api-call-history.js.map +0 -1
- package/dist/src/services/auth.js +0 -152
- package/dist/src/services/auth.js.map +0 -1
- package/dist/src/services/billing.js +0 -231
- package/dist/src/services/billing.js.map +0 -1
- package/dist/src/services/chat-threads.js +0 -92
- package/dist/src/services/chat-threads.js.map +0 -1
- package/dist/src/services/fork-access.js +0 -93
- package/dist/src/services/fork-access.js.map +0 -1
- package/dist/src/services/fork-manifest.js +0 -43
- package/dist/src/services/fork-manifest.js.map +0 -1
- package/dist/src/services/ghostcut.js +0 -132
- package/dist/src/services/ghostcut.js.map +0 -1
- package/dist/src/services/hyperframes.js +0 -1014
- package/dist/src/services/hyperframes.js.map +0 -1
- package/dist/src/services/job-capacity.js +0 -14
- package/dist/src/services/job-capacity.js.map +0 -1
- package/dist/src/services/job-logs.js +0 -197
- package/dist/src/services/job-logs.js.map +0 -1
- package/dist/src/services/jobs.js +0 -136
- package/dist/src/services/jobs.js.map +0 -1
- package/dist/src/services/media-processing.js +0 -743
- package/dist/src/services/media-processing.js.map +0 -1
- package/dist/src/services/primitive-media-lambda.js +0 -280
- package/dist/src/services/primitive-media-lambda.js.map +0 -1
- package/dist/src/services/providers.js +0 -2870
- package/dist/src/services/providers.js.map +0 -1
- package/dist/src/services/rate-limits.js +0 -237
- package/dist/src/services/rate-limits.js.map +0 -1
- package/dist/src/services/remotion.js +0 -688
- package/dist/src/services/remotion.js.map +0 -1
- package/dist/src/services/serverless-auth.js +0 -374
- package/dist/src/services/serverless-auth.js.map +0 -1
- package/dist/src/services/serverless-jobs.js +0 -1074
- package/dist/src/services/serverless-jobs.js.map +0 -1
- package/dist/src/services/serverless-provider-keys.js +0 -401
- package/dist/src/services/serverless-provider-keys.js.map +0 -1
- package/dist/src/services/serverless-records.js +0 -1088
- package/dist/src/services/serverless-records.js.map +0 -1
- package/dist/src/services/serverless-template-configs.js +0 -67
- package/dist/src/services/serverless-template-configs.js.map +0 -1
- package/dist/src/services/storage.js +0 -383
- package/dist/src/services/storage.js.map +0 -1
- package/dist/src/services/template-certification.js +0 -475
- package/dist/src/services/template-certification.js.map +0 -1
- package/dist/src/services/template-loader.js +0 -99
- package/dist/src/services/template-loader.js.map +0 -1
- package/dist/src/services/template-runtime-bundles.js +0 -217
- package/dist/src/services/template-runtime-bundles.js.map +0 -1
- package/dist/src/services/template-sources.js +0 -1017
- package/dist/src/services/template-sources.js.map +0 -1
- package/dist/src/services/video-normalization.js +0 -2
- package/dist/src/services/video-normalization.js.map +0 -1
- package/dist/src/services/webhooks.js +0 -62
- package/dist/src/services/webhooks.js.map +0 -1
- package/dist/src/template-editor-pages.js +0 -2491
- package/dist/src/template-editor-pages.js.map +0 -1
- package/dist/src/template-editor-shell.js +0 -2702
- package/dist/src/template-editor-shell.js.map +0 -1
- package/dist/src/template-sdk.js +0 -4
- package/dist/src/template-sdk.js.map +0 -1
- package/dist/src/worker.js +0 -17
- package/dist/src/worker.js.map +0 -1
- package/public/assets/homepage-app.js +0 -54
- package/public/assets/homepage-client-app.js +0 -80
- package/public/assets/page-runtime-client-app.js +0 -94
- package/readme.secret.md +0 -89
- package/templates/vidfarm_template_0000/README.md +0 -106
- package/templates/vidfarm_template_0000/SKILL.md +0 -266
- package/templates/vidfarm_template_0000/assets/Abel-Regular.ttf +0 -0
- package/templates/vidfarm_template_0000/assets/DMSerifDisplay-Regular.ttf +0 -0
- package/templates/vidfarm_template_0000/assets/Montserrat[wght].ttf +0 -0
- package/templates/vidfarm_template_0000/assets/SourceCodePro[wght].ttf +0 -0
- package/templates/vidfarm_template_0000/assets/TikTokSans-SemiBold.ttf +0 -0
- package/templates/vidfarm_template_0000/assets/Yesteryear-Regular.ttf +0 -0
- package/templates/vidfarm_template_0000/composition.json +0 -11
- package/templates/vidfarm_template_0000/src/lib/images.js +0 -221
- package/templates/vidfarm_template_0000/src/remotion/Root.js +0 -33
- package/templates/vidfarm_template_0000/src/remotion/index.js +0 -3
- package/templates/vidfarm_template_0000/src/sdk.js +0 -3
- package/templates/vidfarm_template_0000/src/style-options.js +0 -200
- package/templates/vidfarm_template_0000/src/template-dna.js +0 -9
- package/templates/vidfarm_template_0000/src/template.js +0 -1566
- package/templates/vidfarm_template_0000/template.config.json +0 -21
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
var eR=Object.create;var lS=Object.defineProperty;var tR=Object.getOwnPropertyDescriptor;var nR=Object.getOwnPropertyNames;var rR=Object.getPrototypeOf,oR=Object.prototype.hasOwnProperty;var Ar=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var iR=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of nR(t))!oR.call(e,o)&&o!==n&&lS(e,o,{get:()=>t[o],enumerable:!(r=tR(t,o))||r.enumerable});return e};var gn=(e,t,n)=>(n=e!=null?eR(rR(e)):{},iR(t||!e||!e.__esModule?lS(n,"default",{value:e,enumerable:!0}):n,e));var eI=Ar(me=>{"use strict";var yl=Symbol.for("react.element"),UO=Symbol.for("react.portal"),FO=Symbol.for("react.fragment"),BO=Symbol.for("react.strict_mode"),HO=Symbol.for("react.profiler"),$O=Symbol.for("react.provider"),zO=Symbol.for("react.context"),jO=Symbol.for("react.forward_ref"),WO=Symbol.for("react.suspense"),GO=Symbol.for("react.memo"),VO=Symbol.for("react.lazy"),jT=Symbol.iterator;function qO(e){return e===null||typeof e!="object"?null:(e=jT&&e[jT]||e["@@iterator"],typeof e=="function"?e:null)}var VT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qT=Object.assign,YT={};function Cs(e,t,n){this.props=e,this.context=t,this.refs=YT,this.updater=n||VT}Cs.prototype.isReactComponent={};Cs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Cs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function KT(){}KT.prototype=Cs.prototype;function Sh(e,t,n){this.props=e,this.context=t,this.refs=YT,this.updater=n||VT}var _h=Sh.prototype=new KT;_h.constructor=Sh;qT(_h,Cs.prototype);_h.isPureReactComponent=!0;var WT=Array.isArray,JT=Object.prototype.hasOwnProperty,vh={current:null},XT={key:!0,ref:!0,__self:!0,__source:!0};function QT(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)JT.call(t,r)&&!XT.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:yl,type:e,key:i,ref:s,props:o,_owner:vh.current}}function YO(e,t){return{$$typeof:yl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Eh(e){return typeof e=="object"&&e!==null&&e.$$typeof===yl}function KO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var GT=/\/+/g;function yh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?KO(""+e.key):t.toString(36)}function Qu(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case yl:case UO:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+yh(s,0):r,WT(o)?(n="",e!=null&&(n=e.replace(GT,"$&/")+"/"),Qu(o,t,n,"",function(c){return c})):o!=null&&(Eh(o)&&(o=YO(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(GT,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",WT(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+yh(i,a);s+=Qu(i,t,n,l,o)}else if(l=qO(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+yh(i,a++),s+=Qu(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Xu(e,t,n){if(e==null)return e;var r=[],o=0;return Qu(e,r,"","",function(i){return t.call(n,i,o++)}),r}function JO(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Jt={current:null},Zu={transition:null},XO={ReactCurrentDispatcher:Jt,ReactCurrentBatchConfig:Zu,ReactCurrentOwner:vh};function ZT(){throw Error("act(...) is not supported in production builds of React.")}me.Children={map:Xu,forEach:function(e,t,n){Xu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xu(e,function(){t++}),t},toArray:function(e){return Xu(e,function(t){return t})||[]},only:function(e){if(!Eh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};me.Component=Cs;me.Fragment=FO;me.Profiler=HO;me.PureComponent=Sh;me.StrictMode=BO;me.Suspense=WO;me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=XO;me.act=ZT;me.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=qT({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=vh.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)JT.call(t,l)&&!XT.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:yl,type:e.type,key:o,ref:i,props:r,_owner:s}};me.createContext=function(e){return e={$$typeof:zO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:$O,_context:e},e.Consumer=e};me.createElement=QT;me.createFactory=function(e){var t=QT.bind(null,e);return t.type=e,t};me.createRef=function(){return{current:null}};me.forwardRef=function(e){return{$$typeof:jO,render:e}};me.isValidElement=Eh;me.lazy=function(e){return{$$typeof:VO,_payload:{_status:-1,_result:e},_init:JO}};me.memo=function(e,t){return{$$typeof:GO,type:e,compare:t===void 0?null:t}};me.startTransition=function(e){var t=Zu.transition;Zu.transition={};try{e()}finally{Zu.transition=t}};me.unstable_act=ZT;me.useCallback=function(e,t){return Jt.current.useCallback(e,t)};me.useContext=function(e){return Jt.current.useContext(e)};me.useDebugValue=function(){};me.useDeferredValue=function(e){return Jt.current.useDeferredValue(e)};me.useEffect=function(e,t){return Jt.current.useEffect(e,t)};me.useId=function(){return Jt.current.useId()};me.useImperativeHandle=function(e,t,n){return Jt.current.useImperativeHandle(e,t,n)};me.useInsertionEffect=function(e,t){return Jt.current.useInsertionEffect(e,t)};me.useLayoutEffect=function(e,t){return Jt.current.useLayoutEffect(e,t)};me.useMemo=function(e,t){return Jt.current.useMemo(e,t)};me.useReducer=function(e,t,n){return Jt.current.useReducer(e,t,n)};me.useRef=function(e){return Jt.current.useRef(e)};me.useState=function(e){return Jt.current.useState(e)};me.useSyncExternalStore=function(e,t,n){return Jt.current.useSyncExternalStore(e,t,n)};me.useTransition=function(){return Jt.current.useTransition()};me.version="18.3.1"});var Vr=Ar((Gq,tI)=>{"use strict";tI.exports=eI()});var SI=Ar(Fe=>{"use strict";function Nh(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<ed(o,t))e[r]=t,e[n]=o,n=r;else break e}}function sr(e){return e.length===0?null:e[0]}function nd(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var s=2*(r+1)-1,a=e[s],l=s+1,c=e[l];if(0>ed(a,n))l<o&&0>ed(c,a)?(e[r]=c,e[l]=n,r=l):(e[r]=a,e[s]=n,r=s);else if(l<o&&0>ed(c,n))e[r]=c,e[l]=n,r=l;else break e}}return t}function ed(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(cI=performance,Fe.unstable_now=function(){return cI.now()}):(Ch=Date,uI=Ch.now(),Fe.unstable_now=function(){return Ch.now()-uI});var cI,Ch,uI,Ir=[],Io=[],tL=1,$n=null,Bt=3,rd=!1,yi=!1,_l=!1,pI=typeof setTimeout=="function"?setTimeout:null,mI=typeof clearTimeout=="function"?clearTimeout:null,dI=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function bh(e){for(var t=sr(Io);t!==null;){if(t.callback===null)nd(Io);else if(t.startTime<=e)nd(Io),t.sortIndex=t.expirationTime,Nh(Ir,t);else break;t=sr(Io)}}function kh(e){if(_l=!1,bh(e),!yi)if(sr(Ir)!==null)yi=!0,Mh(Ah);else{var t=sr(Io);t!==null&&Ph(kh,t.startTime-e)}}function Ah(e,t){yi=!1,_l&&(_l=!1,mI(vl),vl=-1),rd=!0;var n=Bt;try{for(bh(t),$n=sr(Ir);$n!==null&&(!($n.expirationTime>t)||e&&!yI());){var r=$n.callback;if(typeof r=="function"){$n.callback=null,Bt=$n.priorityLevel;var o=r($n.expirationTime<=t);t=Fe.unstable_now(),typeof o=="function"?$n.callback=o:$n===sr(Ir)&&nd(Ir),bh(t)}else nd(Ir);$n=sr(Ir)}if($n!==null)var i=!0;else{var s=sr(Io);s!==null&&Ph(kh,s.startTime-t),i=!1}return i}finally{$n=null,Bt=n,rd=!1}}var od=!1,td=null,vl=-1,hI=5,gI=-1;function yI(){return!(Fe.unstable_now()-gI<hI)}function xh(){if(td!==null){var e=Fe.unstable_now();gI=e;var t=!0;try{t=td(!0,e)}finally{t?Sl():(od=!1,td=null)}}else od=!1}var Sl;typeof dI=="function"?Sl=function(){dI(xh)}:typeof MessageChannel<"u"?(Rh=new MessageChannel,fI=Rh.port2,Rh.port1.onmessage=xh,Sl=function(){fI.postMessage(null)}):Sl=function(){pI(xh,0)};var Rh,fI;function Mh(e){td=e,od||(od=!0,Sl())}function Ph(e,t){vl=pI(function(){e(Fe.unstable_now())},t)}Fe.unstable_IdlePriority=5;Fe.unstable_ImmediatePriority=1;Fe.unstable_LowPriority=4;Fe.unstable_NormalPriority=3;Fe.unstable_Profiling=null;Fe.unstable_UserBlockingPriority=2;Fe.unstable_cancelCallback=function(e){e.callback=null};Fe.unstable_continueExecution=function(){yi||rd||(yi=!0,Mh(Ah))};Fe.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):hI=0<e?Math.floor(1e3/e):5};Fe.unstable_getCurrentPriorityLevel=function(){return Bt};Fe.unstable_getFirstCallbackNode=function(){return sr(Ir)};Fe.unstable_next=function(e){switch(Bt){case 1:case 2:case 3:var t=3;break;default:t=Bt}var n=Bt;Bt=t;try{return e()}finally{Bt=n}};Fe.unstable_pauseExecution=function(){};Fe.unstable_requestPaint=function(){};Fe.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Bt;Bt=e;try{return t()}finally{Bt=n}};Fe.unstable_scheduleCallback=function(e,t,n){var r=Fe.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:tL++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,Nh(Io,e),sr(Ir)===null&&e===sr(Io)&&(_l?(mI(vl),vl=-1):_l=!0,Ph(kh,n-r))):(e.sortIndex=o,Nh(Ir,e),yi||rd||(yi=!0,Mh(Ah))),e};Fe.unstable_shouldYield=yI;Fe.unstable_wrapCallback=function(e){var t=Bt;return function(){var n=Bt;Bt=t;try{return e.apply(this,arguments)}finally{Bt=n}}}});var vI=Ar((fY,_I)=>{"use strict";_I.exports=SI()});var wC=Ar(Rn=>{"use strict";var nL=Vr(),Cn=vI();function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Rw=new Set,zl={};function ki(e,t){qs(e,t),qs(e+"Capture",t)}function qs(e,t){for(zl[e]=t,e=0;e<t.length;e++)Rw.add(t[e])}var Zr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ng=Object.prototype.hasOwnProperty,rL=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,EI={},TI={};function oL(e){return ng.call(TI,e)?!0:ng.call(EI,e)?!1:rL.test(e)?TI[e]=!0:(EI[e]=!0,!1)}function iL(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function sL(e,t,n,r){if(t===null||typeof t>"u"||iL(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Zt(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Zt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Zt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Zt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Zt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){kt[e]=new Zt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Zt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Zt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Zt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Zt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yg=/[\-:]([a-z])/g;function Kg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Yg,Kg);kt[t]=new Zt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Yg,Kg);kt[t]=new Zt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Yg,Kg);kt[t]=new Zt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Zt(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Zt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Zt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jg(e,t,n,r){var o=kt.hasOwnProperty(t)?kt[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(sL(t,n,o,r)&&(n=null),r||o===null?oL(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ro=nL.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,id=Symbol.for("react.element"),bs=Symbol.for("react.portal"),ks=Symbol.for("react.fragment"),Xg=Symbol.for("react.strict_mode"),rg=Symbol.for("react.profiler"),Nw=Symbol.for("react.provider"),bw=Symbol.for("react.context"),Qg=Symbol.for("react.forward_ref"),og=Symbol.for("react.suspense"),ig=Symbol.for("react.suspense_list"),Zg=Symbol.for("react.memo"),Co=Symbol.for("react.lazy"),kw=Symbol.for("react.offscreen"),II=Symbol.iterator;function El(e){return e===null||typeof e!="object"?null:(e=II&&e[II]||e["@@iterator"],typeof e=="function"?e:null)}var Xe=Object.assign,Oh;function bl(e){if(Oh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Oh=t&&t[1]||""}return`
|
|
2
|
-
`+Oh+e}var Lh=!1;function Dh(e,t){if(!e||Lh)return"";Lh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
|
|
3
|
-
`),i=r.stack.split(`
|
|
4
|
-
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
|
|
5
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Lh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?bl(e):""}function aL(e){switch(e.tag){case 5:return bl(e.type);case 16:return bl("Lazy");case 13:return bl("Suspense");case 19:return bl("SuspenseList");case 0:case 2:case 15:return e=Dh(e.type,!1),e;case 11:return e=Dh(e.type.render,!1),e;case 1:return e=Dh(e.type,!0),e;default:return""}}function sg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ks:return"Fragment";case bs:return"Portal";case rg:return"Profiler";case Xg:return"StrictMode";case og:return"Suspense";case ig:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bw:return(e.displayName||"Context")+".Consumer";case Nw:return(e._context.displayName||"Context")+".Provider";case Qg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zg:return t=e.displayName||null,t!==null?t:sg(e.type)||"Memo";case Co:t=e._payload,e=e._init;try{return sg(e(t))}catch{}}return null}function lL(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sg(t);case 8:return t===Xg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Bo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Aw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cL(e){var t=Aw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sd(e){e._valueTracker||(e._valueTracker=cL(e))}function Mw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Aw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Od(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ag(e,t){var n=t.checked;return Xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function wI(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Bo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Pw(e,t){t=t.checked,t!=null&&Jg(e,"checked",t,!1)}function lg(e,t){Pw(e,t);var n=Bo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?cg(e,t.type,n):t.hasOwnProperty("defaultValue")&&cg(e,t.type,Bo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function CI(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function cg(e,t,n){(t!=="number"||Od(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kl=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Bo(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ug(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(O(91));return Xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function xI(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(O(92));if(kl(n)){if(1<n.length)throw Error(O(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Bo(n)}}function Ow(e,t){var n=Bo(t.value),r=Bo(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function RI(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Lw(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function dg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Lw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ad,Dw=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ad=ad||document.createElement("div"),ad.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ad.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},uL=["Webkit","ms","Moz","O"];Object.keys(Pl).forEach(function(e){uL.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pl[t]=Pl[e]})});function Uw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pl.hasOwnProperty(e)&&Pl[e]?(""+t).trim():t+"px"}function Fw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Uw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var dL=Xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fg(e,t){if(t){if(dL[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function pg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mg=null;function ey(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hg=null,zs=null,js=null;function NI(e){if(e=ac(e)){if(typeof hg!="function")throw Error(O(280));var t=e.stateNode;t&&(t=cf(t),hg(e.stateNode,e.type,t))}}function Bw(e){zs?js?js.push(e):js=[e]:zs=e}function Hw(){if(zs){var e=zs,t=js;if(js=zs=null,NI(e),t)for(e=0;e<t.length;e++)NI(t[e])}}function $w(e,t){return e(t)}function zw(){}var Uh=!1;function jw(e,t,n){if(Uh)return e(t,n);Uh=!0;try{return $w(e,t,n)}finally{Uh=!1,(zs!==null||js!==null)&&(zw(),Hw())}}function Wl(e,t){var n=e.stateNode;if(n===null)return null;var r=cf(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(O(231,t,typeof n));return n}var gg=!1;if(Zr)try{Rs={},Object.defineProperty(Rs,"passive",{get:function(){gg=!0}}),window.addEventListener("test",Rs,Rs),window.removeEventListener("test",Rs,Rs)}catch{gg=!1}var Rs;function fL(e,t,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Ol=!1,Ld=null,Dd=!1,yg=null,pL={onError:function(e){Ol=!0,Ld=e}};function mL(e,t,n,r,o,i,s,a,l){Ol=!1,Ld=null,fL.apply(pL,arguments)}function hL(e,t,n,r,o,i,s,a,l){if(mL.apply(this,arguments),Ol){if(Ol){var c=Ld;Ol=!1,Ld=null}else throw Error(O(198));Dd||(Dd=!0,yg=c)}}function Ai(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Ww(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function bI(e){if(Ai(e)!==e)throw Error(O(188))}function gL(e){var t=e.alternate;if(!t){if(t=Ai(e),t===null)throw Error(O(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return bI(o),e;if(i===r)return bI(o),t;i=i.sibling}throw Error(O(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(O(189))}}if(n.alternate!==r)throw Error(O(190))}if(n.tag!==3)throw Error(O(188));return n.stateNode.current===n?e:t}function Gw(e){return e=gL(e),e!==null?Vw(e):null}function Vw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Vw(e);if(t!==null)return t;e=e.sibling}return null}var qw=Cn.unstable_scheduleCallback,kI=Cn.unstable_cancelCallback,yL=Cn.unstable_shouldYield,SL=Cn.unstable_requestPaint,ot=Cn.unstable_now,_L=Cn.unstable_getCurrentPriorityLevel,ty=Cn.unstable_ImmediatePriority,Yw=Cn.unstable_UserBlockingPriority,Ud=Cn.unstable_NormalPriority,vL=Cn.unstable_LowPriority,Kw=Cn.unstable_IdlePriority,of=null,Rr=null;function EL(e){if(Rr&&typeof Rr.onCommitFiberRoot=="function")try{Rr.onCommitFiberRoot(of,e,void 0,(e.current.flags&128)===128)}catch{}}var dr=Math.clz32?Math.clz32:wL,TL=Math.log,IL=Math.LN2;function wL(e){return e>>>=0,e===0?32:31-(TL(e)/IL|0)|0}var ld=64,cd=4194304;function Al(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Al(a):(i&=s,i!==0&&(r=Al(i)))}else s=n&~o,s!==0?r=Al(s):i!==0&&(r=Al(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-dr(t),o=1<<n,r|=e[n],t&=~o;return r}function CL(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xL(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-dr(i),a=1<<s,l=o[s];l===-1?((a&n)===0||(a&r)!==0)&&(o[s]=CL(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Sg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Jw(){var e=ld;return ld<<=1,(ld&4194240)===0&&(ld=64),e}function Fh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ic(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dr(t),e[t]=n}function RL(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-dr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function ny(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-dr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ke=0;function Xw(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Qw,ry,Zw,e0,t0,_g=!1,ud=[],Ao=null,Mo=null,Po=null,Gl=new Map,Vl=new Map,Ro=[],NL="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function AI(e,t){switch(e){case"focusin":case"focusout":Ao=null;break;case"dragenter":case"dragleave":Mo=null;break;case"mouseover":case"mouseout":Po=null;break;case"pointerover":case"pointerout":Gl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vl.delete(t.pointerId)}}function Tl(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=ac(t),t!==null&&ry(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function bL(e,t,n,r,o){switch(t){case"focusin":return Ao=Tl(Ao,e,t,n,r,o),!0;case"dragenter":return Mo=Tl(Mo,e,t,n,r,o),!0;case"mouseover":return Po=Tl(Po,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Gl.set(i,Tl(Gl.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Vl.set(i,Tl(Vl.get(i)||null,e,t,n,r,o)),!0}return!1}function n0(e){var t=vi(e.target);if(t!==null){var n=Ai(t);if(n!==null){if(t=n.tag,t===13){if(t=Ww(n),t!==null){e.blockedOn=t,t0(e.priority,function(){Zw(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mg=r,n.target.dispatchEvent(r),mg=null}else return t=ac(n),t!==null&&ry(t),e.blockedOn=n,!1;t.shift()}return!0}function MI(e,t,n){wd(e)&&n.delete(t)}function kL(){_g=!1,Ao!==null&&wd(Ao)&&(Ao=null),Mo!==null&&wd(Mo)&&(Mo=null),Po!==null&&wd(Po)&&(Po=null),Gl.forEach(MI),Vl.forEach(MI)}function Il(e,t){e.blockedOn===t&&(e.blockedOn=null,_g||(_g=!0,Cn.unstable_scheduleCallback(Cn.unstable_NormalPriority,kL)))}function ql(e){function t(o){return Il(o,e)}if(0<ud.length){Il(ud[0],e);for(var n=1;n<ud.length;n++){var r=ud[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ao!==null&&Il(Ao,e),Mo!==null&&Il(Mo,e),Po!==null&&Il(Po,e),Gl.forEach(t),Vl.forEach(t),n=0;n<Ro.length;n++)r=Ro[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ro.length&&(n=Ro[0],n.blockedOn===null);)n0(n),n.blockedOn===null&&Ro.shift()}var Ws=ro.ReactCurrentBatchConfig,Bd=!0;function AL(e,t,n,r){var o=ke,i=Ws.transition;Ws.transition=null;try{ke=1,oy(e,t,n,r)}finally{ke=o,Ws.transition=i}}function ML(e,t,n,r){var o=ke,i=Ws.transition;Ws.transition=null;try{ke=4,oy(e,t,n,r)}finally{ke=o,Ws.transition=i}}function oy(e,t,n,r){if(Bd){var o=vg(e,t,n,r);if(o===null)Gh(e,t,r,Hd,n),AI(e,r);else if(bL(o,e,t,n,r))r.stopPropagation();else if(AI(e,r),t&4&&-1<NL.indexOf(e)){for(;o!==null;){var i=ac(o);if(i!==null&&Qw(i),i=vg(e,t,n,r),i===null&&Gh(e,t,r,Hd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Gh(e,t,r,null,n)}}var Hd=null;function vg(e,t,n,r){if(Hd=null,e=ey(r),e=vi(e),e!==null)if(t=Ai(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ww(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Hd=e,null}function r0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(_L()){case ty:return 1;case Yw:return 4;case Ud:case vL:return 16;case Kw:return 536870912;default:return 16}default:return 16}}var bo=null,iy=null,Cd=null;function o0(){if(Cd)return Cd;var e,t=iy,n=t.length,r,o="value"in bo?bo.value:bo.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Cd=o.slice(e,1<r?1-r:void 0)}function xd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function dd(){return!0}function PI(){return!1}function xn(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?dd:PI,this.isPropagationStopped=PI,this}return Xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=dd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=dd)},persist:function(){},isPersistent:dd}),t}var ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sy=xn(ea),sc=Xe({},ea,{view:0,detail:0}),PL=xn(sc),Bh,Hh,wl,sf=Xe({},sc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ay,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==wl&&(wl&&e.type==="mousemove"?(Bh=e.screenX-wl.screenX,Hh=e.screenY-wl.screenY):Hh=Bh=0,wl=e),Bh)},movementY:function(e){return"movementY"in e?e.movementY:Hh}}),OI=xn(sf),OL=Xe({},sf,{dataTransfer:0}),LL=xn(OL),DL=Xe({},sc,{relatedTarget:0}),$h=xn(DL),UL=Xe({},ea,{animationName:0,elapsedTime:0,pseudoElement:0}),FL=xn(UL),BL=Xe({},ea,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),HL=xn(BL),$L=Xe({},ea,{data:0}),LI=xn($L),zL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jL={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},WL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GL(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=WL[e])?!!t[e]:!1}function ay(){return GL}var VL=Xe({},sc,{key:function(e){if(e.key){var t=zL[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jL[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ay,charCode:function(e){return e.type==="keypress"?xd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qL=xn(VL),YL=Xe({},sf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),DI=xn(YL),KL=Xe({},sc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ay}),JL=xn(KL),XL=Xe({},ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),QL=xn(XL),ZL=Xe({},sf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),eD=xn(ZL),tD=[9,13,27,32],ly=Zr&&"CompositionEvent"in window,Ll=null;Zr&&"documentMode"in document&&(Ll=document.documentMode);var nD=Zr&&"TextEvent"in window&&!Ll,i0=Zr&&(!ly||Ll&&8<Ll&&11>=Ll),UI=" ",FI=!1;function s0(e,t){switch(e){case"keyup":return tD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function a0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var As=!1;function rD(e,t){switch(e){case"compositionend":return a0(t);case"keypress":return t.which!==32?null:(FI=!0,UI);case"textInput":return e=t.data,e===UI&&FI?null:e;default:return null}}function oD(e,t){if(As)return e==="compositionend"||!ly&&s0(e,t)?(e=o0(),Cd=iy=bo=null,As=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return i0&&t.locale!=="ko"?null:t.data;default:return null}}var iD={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function BI(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!iD[e.type]:t==="textarea"}function l0(e,t,n,r){Bw(r),t=$d(t,"onChange"),0<t.length&&(n=new sy("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Dl=null,Yl=null;function sD(e){_0(e,0)}function af(e){var t=Os(e);if(Mw(t))return e}function aD(e,t){if(e==="change")return t}var c0=!1;Zr&&(Zr?(pd="oninput"in document,pd||(zh=document.createElement("div"),zh.setAttribute("oninput","return;"),pd=typeof zh.oninput=="function"),fd=pd):fd=!1,c0=fd&&(!document.documentMode||9<document.documentMode));var fd,pd,zh;function HI(){Dl&&(Dl.detachEvent("onpropertychange",u0),Yl=Dl=null)}function u0(e){if(e.propertyName==="value"&&af(Yl)){var t=[];l0(t,Yl,e,ey(e)),jw(sD,t)}}function lD(e,t,n){e==="focusin"?(HI(),Dl=t,Yl=n,Dl.attachEvent("onpropertychange",u0)):e==="focusout"&&HI()}function cD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return af(Yl)}function uD(e,t){if(e==="click")return af(t)}function dD(e,t){if(e==="input"||e==="change")return af(t)}function fD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pr=typeof Object.is=="function"?Object.is:fD;function Kl(e,t){if(pr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!ng.call(t,o)||!pr(e[o],t[o]))return!1}return!0}function $I(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zI(e,t){var n=$I(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$I(n)}}function d0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?d0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function f0(){for(var e=window,t=Od();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Od(e.document)}return t}function cy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function pD(e){var t=f0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&d0(n.ownerDocument.documentElement,n)){if(r!==null&&cy(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=zI(n,i);var s=zI(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mD=Zr&&"documentMode"in document&&11>=document.documentMode,Ms=null,Eg=null,Ul=null,Tg=!1;function jI(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tg||Ms==null||Ms!==Od(r)||(r=Ms,"selectionStart"in r&&cy(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ul&&Kl(Ul,r)||(Ul=r,r=$d(Eg,"onSelect"),0<r.length&&(t=new sy("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ms)))}function md(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ps={animationend:md("Animation","AnimationEnd"),animationiteration:md("Animation","AnimationIteration"),animationstart:md("Animation","AnimationStart"),transitionend:md("Transition","TransitionEnd")},jh={},p0={};Zr&&(p0=document.createElement("div").style,"AnimationEvent"in window||(delete Ps.animationend.animation,delete Ps.animationiteration.animation,delete Ps.animationstart.animation),"TransitionEvent"in window||delete Ps.transitionend.transition);function lf(e){if(jh[e])return jh[e];if(!Ps[e])return e;var t=Ps[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in p0)return jh[e]=t[n];return e}var m0=lf("animationend"),h0=lf("animationiteration"),g0=lf("animationstart"),y0=lf("transitionend"),S0=new Map,WI="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function $o(e,t){S0.set(e,t),ki(t,[e])}for(hd=0;hd<WI.length;hd++)gd=WI[hd],GI=gd.toLowerCase(),VI=gd[0].toUpperCase()+gd.slice(1),$o(GI,"on"+VI);var gd,GI,VI,hd;$o(m0,"onAnimationEnd");$o(h0,"onAnimationIteration");$o(g0,"onAnimationStart");$o("dblclick","onDoubleClick");$o("focusin","onFocus");$o("focusout","onBlur");$o(y0,"onTransitionEnd");qs("onMouseEnter",["mouseout","mouseover"]);qs("onMouseLeave",["mouseout","mouseover"]);qs("onPointerEnter",["pointerout","pointerover"]);qs("onPointerLeave",["pointerout","pointerover"]);ki("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ki("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ki("onBeforeInput",["compositionend","keypress","textInput","paste"]);ki("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ki("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ki("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ml="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),hD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ml));function qI(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,hL(r,t,void 0,e),e.currentTarget=null}function _0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;qI(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;qI(o,a,c),i=l}}}if(Dd)throw e=yg,Dd=!1,yg=null,e}function je(e,t){var n=t[Rg];n===void 0&&(n=t[Rg]=new Set);var r=e+"__bubble";n.has(r)||(v0(t,e,2,!1),n.add(r))}function Wh(e,t,n){var r=0;t&&(r|=4),v0(n,e,r,t)}var yd="_reactListening"+Math.random().toString(36).slice(2);function Jl(e){if(!e[yd]){e[yd]=!0,Rw.forEach(function(n){n!=="selectionchange"&&(hD.has(n)||Wh(n,!1,e),Wh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[yd]||(t[yd]=!0,Wh("selectionchange",!1,t))}}function v0(e,t,n,r){switch(r0(t)){case 1:var o=AL;break;case 4:o=ML;break;default:o=oy}n=o.bind(null,t,n,e),o=void 0,!gg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Gh(e,t,n,r,o){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=vi(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}jw(function(){var c=i,u=ey(n),d=[];e:{var p=S0.get(e);if(p!==void 0){var h=sy,m=e;switch(e){case"keypress":if(xd(n)===0)break e;case"keydown":case"keyup":h=qL;break;case"focusin":m="focus",h=$h;break;case"focusout":m="blur",h=$h;break;case"beforeblur":case"afterblur":h=$h;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=OI;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=LL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=JL;break;case m0:case h0:case g0:h=FL;break;case y0:h=QL;break;case"scroll":h=PL;break;case"wheel":h=eD;break;case"copy":case"cut":case"paste":h=HL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=DI}var _=(t&4)!==0,T=!_&&e==="scroll",y=_?p!==null?p+"Capture":null:p;_=[];for(var S=c,v;S!==null;){v=S;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,y!==null&&(w=Wl(S,y),w!=null&&_.push(Xl(S,w,v)))),T)break;S=S.return}0<_.length&&(p=new h(p,m,null,n,u),d.push({event:p,listeners:_}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==mg&&(m=n.relatedTarget||n.fromElement)&&(vi(m)||m[eo]))break e;if((h||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=c,m=m?vi(m):null,m!==null&&(T=Ai(m),m!==T||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=c),h!==m)){if(_=OI,w="onMouseLeave",y="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(_=DI,w="onPointerLeave",y="onPointerEnter",S="pointer"),T=h==null?p:Os(h),v=m==null?p:Os(m),p=new _(w,S+"leave",h,n,u),p.target=T,p.relatedTarget=v,w=null,vi(u)===c&&(_=new _(y,S+"enter",m,n,u),_.target=v,_.relatedTarget=T,w=_),T=w,h&&m)t:{for(_=h,y=m,S=0,v=_;v;v=Ns(v))S++;for(v=0,w=y;w;w=Ns(w))v++;for(;0<S-v;)_=Ns(_),S--;for(;0<v-S;)y=Ns(y),v--;for(;S--;){if(_===y||y!==null&&_===y.alternate)break t;_=Ns(_),y=Ns(y)}_=null}else _=null;h!==null&&YI(d,p,h,_,!1),m!==null&&T!==null&&YI(d,T,m,_,!0)}}e:{if(p=c?Os(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var k=aD;else if(BI(p))if(c0)k=dD;else{k=cD;var A=lD}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(k=uD);if(k&&(k=k(e,c))){l0(d,k,n,u);break e}A&&A(e,p,c),e==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&cg(p,"number",p.value)}switch(A=c?Os(c):window,e){case"focusin":(BI(A)||A.contentEditable==="true")&&(Ms=A,Eg=c,Ul=null);break;case"focusout":Ul=Eg=Ms=null;break;case"mousedown":Tg=!0;break;case"contextmenu":case"mouseup":case"dragend":Tg=!1,jI(d,n,u);break;case"selectionchange":if(mD)break;case"keydown":case"keyup":jI(d,n,u)}var I;if(ly)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else As?s0(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(i0&&n.locale!=="ko"&&(As||N!=="onCompositionStart"?N==="onCompositionEnd"&&As&&(I=o0()):(bo=u,iy="value"in bo?bo.value:bo.textContent,As=!0)),A=$d(c,N),0<A.length&&(N=new LI(N,e,null,n,u),d.push({event:N,listeners:A}),I?N.data=I:(I=a0(n),I!==null&&(N.data=I)))),(I=nD?rD(e,n):oD(e,n))&&(c=$d(c,"onBeforeInput"),0<c.length&&(u=new LI("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=I))}_0(d,t)})}function Xl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $d(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Wl(e,n),i!=null&&r.unshift(Xl(e,i,o)),i=Wl(e,t),i!=null&&r.push(Xl(e,i,o))),e=e.return}return r}function Ns(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function YI(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=Wl(n,i),l!=null&&s.unshift(Xl(n,l,a))):o||(l=Wl(n,i),l!=null&&s.push(Xl(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var gD=/\r\n?/g,yD=/\u0000|\uFFFD/g;function KI(e){return(typeof e=="string"?e:""+e).replace(gD,`
|
|
6
|
-
`).replace(yD,"")}function Sd(e,t,n){if(t=KI(t),KI(e)!==t&&n)throw Error(O(425))}function zd(){}var Ig=null,wg=null;function Cg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xg=typeof setTimeout=="function"?setTimeout:void 0,SD=typeof clearTimeout=="function"?clearTimeout:void 0,JI=typeof Promise=="function"?Promise:void 0,_D=typeof queueMicrotask=="function"?queueMicrotask:typeof JI<"u"?function(e){return JI.resolve(null).then(e).catch(vD)}:xg;function vD(e){setTimeout(function(){throw e})}function Vh(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ql(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ql(t)}function Oo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function XI(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ta=Math.random().toString(36).slice(2),xr="__reactFiber$"+ta,Ql="__reactProps$"+ta,eo="__reactContainer$"+ta,Rg="__reactEvents$"+ta,ED="__reactListeners$"+ta,TD="__reactHandles$"+ta;function vi(e){var t=e[xr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eo]||n[xr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=XI(e);e!==null;){if(n=e[xr])return n;e=XI(e)}return t}e=n,n=e.parentNode}return null}function ac(e){return e=e[xr]||e[eo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Os(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(O(33))}function cf(e){return e[Ql]||null}var Ng=[],Ls=-1;function zo(e){return{current:e}}function We(e){0>Ls||(e.current=Ng[Ls],Ng[Ls]=null,Ls--)}function Be(e,t){Ls++,Ng[Ls]=e.current,e.current=t}var Ho={},jt=zo(Ho),fn=zo(!1),Ci=Ho;function Ys(e,t){var n=e.type.contextTypes;if(!n)return Ho;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function pn(e){return e=e.childContextTypes,e!=null}function jd(){We(fn),We(jt)}function QI(e,t,n){if(jt.current!==Ho)throw Error(O(168));Be(jt,t),Be(fn,n)}function E0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(O(108,lL(e)||"Unknown",o));return Xe({},n,r)}function Wd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ho,Ci=jt.current,Be(jt,e),Be(fn,fn.current),!0}function ZI(e,t,n){var r=e.stateNode;if(!r)throw Error(O(169));n?(e=E0(e,t,Ci),r.__reactInternalMemoizedMergedChildContext=e,We(fn),We(jt),Be(jt,e)):We(fn),Be(fn,n)}var Kr=null,uf=!1,qh=!1;function T0(e){Kr===null?Kr=[e]:Kr.push(e)}function ID(e){uf=!0,T0(e)}function jo(){if(!qh&&Kr!==null){qh=!0;var e=0,t=ke;try{var n=Kr;for(ke=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Kr=null,uf=!1}catch(o){throw Kr!==null&&(Kr=Kr.slice(e+1)),qw(ty,jo),o}finally{ke=t,qh=!1}}return null}var Ds=[],Us=0,Gd=null,Vd=0,zn=[],jn=0,xi=null,Jr=1,Xr="";function Si(e,t){Ds[Us++]=Vd,Ds[Us++]=Gd,Gd=e,Vd=t}function I0(e,t,n){zn[jn++]=Jr,zn[jn++]=Xr,zn[jn++]=xi,xi=e;var r=Jr;e=Xr;var o=32-dr(r)-1;r&=~(1<<o),n+=1;var i=32-dr(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Jr=1<<32-dr(t)+o|n<<o|r,Xr=i+e}else Jr=1<<i|n<<o|r,Xr=e}function uy(e){e.return!==null&&(Si(e,1),I0(e,1,0))}function dy(e){for(;e===Gd;)Gd=Ds[--Us],Ds[Us]=null,Vd=Ds[--Us],Ds[Us]=null;for(;e===xi;)xi=zn[--jn],zn[jn]=null,Xr=zn[--jn],zn[jn]=null,Jr=zn[--jn],zn[jn]=null}var wn=null,In=null,qe=!1,ur=null;function w0(e,t){var n=Wn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ew(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,wn=e,In=Oo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,wn=e,In=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=xi!==null?{id:Jr,overflow:Xr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Wn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,wn=e,In=null,!0):!1;default:return!1}}function bg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function kg(e){if(qe){var t=In;if(t){var n=t;if(!ew(e,t)){if(bg(e))throw Error(O(418));t=Oo(n.nextSibling);var r=wn;t&&ew(e,t)?w0(r,n):(e.flags=e.flags&-4097|2,qe=!1,wn=e)}}else{if(bg(e))throw Error(O(418));e.flags=e.flags&-4097|2,qe=!1,wn=e}}}function tw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;wn=e}function _d(e){if(e!==wn)return!1;if(!qe)return tw(e),qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Cg(e.type,e.memoizedProps)),t&&(t=In)){if(bg(e))throw C0(),Error(O(418));for(;t;)w0(e,t),t=Oo(t.nextSibling)}if(tw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){In=Oo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}In=null}}else In=wn?Oo(e.stateNode.nextSibling):null;return!0}function C0(){for(var e=In;e;)e=Oo(e.nextSibling)}function Ks(){In=wn=null,qe=!1}function fy(e){ur===null?ur=[e]:ur.push(e)}var wD=ro.ReactCurrentBatchConfig;function Cl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(O(309));var r=n.stateNode}if(!r)throw Error(O(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(O(284));if(!n._owner)throw Error(O(290,e))}return e}function vd(e,t){throw e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function nw(e){var t=e._init;return t(e._payload)}function x0(e){function t(y,S){if(e){var v=y.deletions;v===null?(y.deletions=[S],y.flags|=16):v.push(S)}}function n(y,S){if(!e)return null;for(;S!==null;)t(y,S),S=S.sibling;return null}function r(y,S){for(y=new Map;S!==null;)S.key!==null?y.set(S.key,S):y.set(S.index,S),S=S.sibling;return y}function o(y,S){return y=Fo(y,S),y.index=0,y.sibling=null,y}function i(y,S,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<S?(y.flags|=2,S):v):(y.flags|=2,S)):(y.flags|=1048576,S)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,S,v,w){return S===null||S.tag!==6?(S=eg(v,y.mode,w),S.return=y,S):(S=o(S,v),S.return=y,S)}function l(y,S,v,w){var k=v.type;return k===ks?u(y,S,v.props.children,w,v.key):S!==null&&(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Co&&nw(k)===S.type)?(w=o(S,v.props),w.ref=Cl(y,S,v),w.return=y,w):(w=Pd(v.type,v.key,v.props,null,y.mode,w),w.ref=Cl(y,S,v),w.return=y,w)}function c(y,S,v,w){return S===null||S.tag!==4||S.stateNode.containerInfo!==v.containerInfo||S.stateNode.implementation!==v.implementation?(S=tg(v,y.mode,w),S.return=y,S):(S=o(S,v.children||[]),S.return=y,S)}function u(y,S,v,w,k){return S===null||S.tag!==7?(S=wi(v,y.mode,w,k),S.return=y,S):(S=o(S,v),S.return=y,S)}function d(y,S,v){if(typeof S=="string"&&S!==""||typeof S=="number")return S=eg(""+S,y.mode,v),S.return=y,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case id:return v=Pd(S.type,S.key,S.props,null,y.mode,v),v.ref=Cl(y,null,S),v.return=y,v;case bs:return S=tg(S,y.mode,v),S.return=y,S;case Co:var w=S._init;return d(y,w(S._payload),v)}if(kl(S)||El(S))return S=wi(S,y.mode,v,null),S.return=y,S;vd(y,S)}return null}function p(y,S,v,w){var k=S!==null?S.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return k!==null?null:a(y,S,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case id:return v.key===k?l(y,S,v,w):null;case bs:return v.key===k?c(y,S,v,w):null;case Co:return k=v._init,p(y,S,k(v._payload),w)}if(kl(v)||El(v))return k!==null?null:u(y,S,v,w,null);vd(y,v)}return null}function h(y,S,v,w,k){if(typeof w=="string"&&w!==""||typeof w=="number")return y=y.get(v)||null,a(S,y,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case id:return y=y.get(w.key===null?v:w.key)||null,l(S,y,w,k);case bs:return y=y.get(w.key===null?v:w.key)||null,c(S,y,w,k);case Co:var A=w._init;return h(y,S,v,A(w._payload),k)}if(kl(w)||El(w))return y=y.get(v)||null,u(S,y,w,k,null);vd(S,w)}return null}function m(y,S,v,w){for(var k=null,A=null,I=S,N=S=0,F=null;I!==null&&N<v.length;N++){I.index>N?(F=I,I=null):F=I.sibling;var R=p(y,I,v[N],w);if(R===null){I===null&&(I=F);break}e&&I&&R.alternate===null&&t(y,I),S=i(R,S,N),A===null?k=R:A.sibling=R,A=R,I=F}if(N===v.length)return n(y,I),qe&&Si(y,N),k;if(I===null){for(;N<v.length;N++)I=d(y,v[N],w),I!==null&&(S=i(I,S,N),A===null?k=I:A.sibling=I,A=I);return qe&&Si(y,N),k}for(I=r(y,I);N<v.length;N++)F=h(I,y,N,v[N],w),F!==null&&(e&&F.alternate!==null&&I.delete(F.key===null?N:F.key),S=i(F,S,N),A===null?k=F:A.sibling=F,A=F);return e&&I.forEach(function(U){return t(y,U)}),qe&&Si(y,N),k}function _(y,S,v,w){var k=El(v);if(typeof k!="function")throw Error(O(150));if(v=k.call(v),v==null)throw Error(O(151));for(var A=k=null,I=S,N=S=0,F=null,R=v.next();I!==null&&!R.done;N++,R=v.next()){I.index>N?(F=I,I=null):F=I.sibling;var U=p(y,I,R.value,w);if(U===null){I===null&&(I=F);break}e&&I&&U.alternate===null&&t(y,I),S=i(U,S,N),A===null?k=U:A.sibling=U,A=U,I=F}if(R.done)return n(y,I),qe&&Si(y,N),k;if(I===null){for(;!R.done;N++,R=v.next())R=d(y,R.value,w),R!==null&&(S=i(R,S,N),A===null?k=R:A.sibling=R,A=R);return qe&&Si(y,N),k}for(I=r(y,I);!R.done;N++,R=v.next())R=h(I,y,N,R.value,w),R!==null&&(e&&R.alternate!==null&&I.delete(R.key===null?N:R.key),S=i(R,S,N),A===null?k=R:A.sibling=R,A=R);return e&&I.forEach(function(Q){return t(y,Q)}),qe&&Si(y,N),k}function T(y,S,v,w){if(typeof v=="object"&&v!==null&&v.type===ks&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case id:e:{for(var k=v.key,A=S;A!==null;){if(A.key===k){if(k=v.type,k===ks){if(A.tag===7){n(y,A.sibling),S=o(A,v.props.children),S.return=y,y=S;break e}}else if(A.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Co&&nw(k)===A.type){n(y,A.sibling),S=o(A,v.props),S.ref=Cl(y,A,v),S.return=y,y=S;break e}n(y,A);break}else t(y,A);A=A.sibling}v.type===ks?(S=wi(v.props.children,y.mode,w,v.key),S.return=y,y=S):(w=Pd(v.type,v.key,v.props,null,y.mode,w),w.ref=Cl(y,S,v),w.return=y,y=w)}return s(y);case bs:e:{for(A=v.key;S!==null;){if(S.key===A)if(S.tag===4&&S.stateNode.containerInfo===v.containerInfo&&S.stateNode.implementation===v.implementation){n(y,S.sibling),S=o(S,v.children||[]),S.return=y,y=S;break e}else{n(y,S);break}else t(y,S);S=S.sibling}S=tg(v,y.mode,w),S.return=y,y=S}return s(y);case Co:return A=v._init,T(y,S,A(v._payload),w)}if(kl(v))return m(y,S,v,w);if(El(v))return _(y,S,v,w);vd(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,S!==null&&S.tag===6?(n(y,S.sibling),S=o(S,v),S.return=y,y=S):(n(y,S),S=eg(v,y.mode,w),S.return=y,y=S),s(y)):n(y,S)}return T}var Js=x0(!0),R0=x0(!1),qd=zo(null),Yd=null,Fs=null,py=null;function my(){py=Fs=Yd=null}function hy(e){var t=qd.current;We(qd),e._currentValue=t}function Ag(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Gs(e,t){Yd=e,py=Fs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(dn=!0),e.firstContext=null)}function Vn(e){var t=e._currentValue;if(py!==e)if(e={context:e,memoizedValue:t,next:null},Fs===null){if(Yd===null)throw Error(O(308));Fs=e,Yd.dependencies={lanes:0,firstContext:e}}else Fs=Fs.next=e;return t}var Ei=null;function gy(e){Ei===null?Ei=[e]:Ei.push(e)}function N0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,gy(t)):(n.next=o.next,o.next=n),t.interleaved=n,to(e,r)}function to(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var xo=!1;function yy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function b0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Lo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ee&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,to(e,n)}return o=r.interleaved,o===null?(t.next=t,gy(r)):(t.next=o.next,o.next=t),r.interleaved=t,to(e,n)}function Rd(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ny(e,n)}}function rw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Kd(e,t,n,r){var o=e.updateQueue;xo=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,u=c=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,_=a;switch(p=t,h=n,_.tag){case 1:if(m=_.payload,typeof m=="function"){d=m.call(h,d,p);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=_.payload,p=typeof m=="function"?m.call(h,d,p):m,p==null)break e;d=Xe({},d,p);break e;case 2:xo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=d):u=u.next=h,s|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(u===null&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Ni|=s,e.lanes=s,e.memoizedState=d}}function ow(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(O(191,o));o.call(r)}}}var lc={},Nr=zo(lc),Zl=zo(lc),ec=zo(lc);function Ti(e){if(e===lc)throw Error(O(174));return e}function Sy(e,t){switch(Be(ec,t),Be(Zl,e),Be(Nr,lc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:dg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=dg(t,e)}We(Nr),Be(Nr,t)}function Xs(){We(Nr),We(Zl),We(ec)}function k0(e){Ti(ec.current);var t=Ti(Nr.current),n=dg(t,e.type);t!==n&&(Be(Zl,e),Be(Nr,n))}function _y(e){Zl.current===e&&(We(Nr),We(Zl))}var Ke=zo(0);function Jd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Yh=[];function vy(){for(var e=0;e<Yh.length;e++)Yh[e]._workInProgressVersionPrimary=null;Yh.length=0}var Nd=ro.ReactCurrentDispatcher,Kh=ro.ReactCurrentBatchConfig,Ri=0,Je=null,mt=null,vt=null,Xd=!1,Fl=!1,tc=0,CD=0;function Ht(){throw Error(O(321))}function Ey(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!pr(e[n],t[n]))return!1;return!0}function Ty(e,t,n,r,o,i){if(Ri=i,Je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Nd.current=e===null||e.memoizedState===null?bD:kD,e=n(r,o),Fl){i=0;do{if(Fl=!1,tc=0,25<=i)throw Error(O(301));i+=1,vt=mt=null,t.updateQueue=null,Nd.current=AD,e=n(r,o)}while(Fl)}if(Nd.current=Qd,t=mt!==null&&mt.next!==null,Ri=0,vt=mt=Je=null,Xd=!1,t)throw Error(O(300));return e}function Iy(){var e=tc!==0;return tc=0,e}function Cr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Je.memoizedState=vt=e:vt=vt.next=e,vt}function qn(){if(mt===null){var e=Je.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var t=vt===null?Je.memoizedState:vt.next;if(t!==null)vt=t,mt=e;else{if(e===null)throw Error(O(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},vt===null?Je.memoizedState=vt=e:vt=vt.next=e}return vt}function nc(e,t){return typeof t=="function"?t(e):t}function Jh(e){var t=qn(),n=t.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=e;var r=mt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,c=i;do{var u=c.lane;if((Ri&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,Je.lanes|=u,Ni|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,pr(r,t.memoizedState)||(dn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Je.lanes|=i,Ni|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Xh(e){var t=qn(),n=t.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);pr(i,t.memoizedState)||(dn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function A0(){}function M0(e,t){var n=Je,r=qn(),o=t(),i=!pr(r.memoizedState,o);if(i&&(r.memoizedState=o,dn=!0),r=r.queue,wy(L0.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||vt!==null&&vt.memoizedState.tag&1){if(n.flags|=2048,rc(9,O0.bind(null,n,r,o,t),void 0,null),Et===null)throw Error(O(349));(Ri&30)!==0||P0(n,t,o)}return o}function P0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Je.updateQueue,t===null?(t={lastEffect:null,stores:null},Je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function O0(e,t,n,r){t.value=n,t.getSnapshot=r,D0(t)&&U0(e)}function L0(e,t,n){return n(function(){D0(t)&&U0(e)})}function D0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pr(e,n)}catch{return!0}}function U0(e){var t=to(e,1);t!==null&&fr(t,e,1,-1)}function iw(e){var t=Cr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:nc,lastRenderedState:e},t.queue=e,e=e.dispatch=ND.bind(null,Je,e),[t.memoizedState,e]}function rc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Je.updateQueue,t===null?(t={lastEffect:null,stores:null},Je.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function F0(){return qn().memoizedState}function bd(e,t,n,r){var o=Cr();Je.flags|=e,o.memoizedState=rc(1|t,n,void 0,r===void 0?null:r)}function df(e,t,n,r){var o=qn();r=r===void 0?null:r;var i=void 0;if(mt!==null){var s=mt.memoizedState;if(i=s.destroy,r!==null&&Ey(r,s.deps)){o.memoizedState=rc(t,n,i,r);return}}Je.flags|=e,o.memoizedState=rc(1|t,n,i,r)}function sw(e,t){return bd(8390656,8,e,t)}function wy(e,t){return df(2048,8,e,t)}function B0(e,t){return df(4,2,e,t)}function H0(e,t){return df(4,4,e,t)}function $0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function z0(e,t,n){return n=n!=null?n.concat([e]):null,df(4,4,$0.bind(null,t,e),n)}function Cy(){}function j0(e,t){var n=qn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ey(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function W0(e,t){var n=qn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ey(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function G0(e,t,n){return(Ri&21)===0?(e.baseState&&(e.baseState=!1,dn=!0),e.memoizedState=n):(pr(n,t)||(n=Jw(),Je.lanes|=n,Ni|=n,e.baseState=!0),t)}function xD(e,t){var n=ke;ke=n!==0&&4>n?n:4,e(!0);var r=Kh.transition;Kh.transition={};try{e(!1),t()}finally{ke=n,Kh.transition=r}}function V0(){return qn().memoizedState}function RD(e,t,n){var r=Uo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},q0(e))Y0(t,n);else if(n=N0(e,t,n,r),n!==null){var o=Qt();fr(n,e,r,o),K0(n,t,r)}}function ND(e,t,n){var r=Uo(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(q0(e))Y0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,pr(a,s)){var l=t.interleaved;l===null?(o.next=o,gy(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}n=N0(e,t,o,r),n!==null&&(o=Qt(),fr(n,e,r,o),K0(n,t,r))}}function q0(e){var t=e.alternate;return e===Je||t!==null&&t===Je}function Y0(e,t){Fl=Xd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function K0(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ny(e,n)}}var Qd={readContext:Vn,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},bD={readContext:Vn,useCallback:function(e,t){return Cr().memoizedState=[e,t===void 0?null:t],e},useContext:Vn,useEffect:sw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bd(4194308,4,$0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bd(4194308,4,e,t)},useInsertionEffect:function(e,t){return bd(4,2,e,t)},useMemo:function(e,t){var n=Cr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=RD.bind(null,Je,e),[r.memoizedState,e]},useRef:function(e){var t=Cr();return e={current:e},t.memoizedState=e},useState:iw,useDebugValue:Cy,useDeferredValue:function(e){return Cr().memoizedState=e},useTransition:function(){var e=iw(!1),t=e[0];return e=xD.bind(null,e[1]),Cr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Je,o=Cr();if(qe){if(n===void 0)throw Error(O(407));n=n()}else{if(n=t(),Et===null)throw Error(O(349));(Ri&30)!==0||P0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,sw(L0.bind(null,r,i,e),[e]),r.flags|=2048,rc(9,O0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Cr(),t=Et.identifierPrefix;if(qe){var n=Xr,r=Jr;n=(r&~(1<<32-dr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=tc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=CD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},kD={readContext:Vn,useCallback:j0,useContext:Vn,useEffect:wy,useImperativeHandle:z0,useInsertionEffect:B0,useLayoutEffect:H0,useMemo:W0,useReducer:Jh,useRef:F0,useState:function(){return Jh(nc)},useDebugValue:Cy,useDeferredValue:function(e){var t=qn();return G0(t,mt.memoizedState,e)},useTransition:function(){var e=Jh(nc)[0],t=qn().memoizedState;return[e,t]},useMutableSource:A0,useSyncExternalStore:M0,useId:V0,unstable_isNewReconciler:!1},AD={readContext:Vn,useCallback:j0,useContext:Vn,useEffect:wy,useImperativeHandle:z0,useInsertionEffect:B0,useLayoutEffect:H0,useMemo:W0,useReducer:Xh,useRef:F0,useState:function(){return Xh(nc)},useDebugValue:Cy,useDeferredValue:function(e){var t=qn();return mt===null?t.memoizedState=e:G0(t,mt.memoizedState,e)},useTransition:function(){var e=Xh(nc)[0],t=qn().memoizedState;return[e,t]},useMutableSource:A0,useSyncExternalStore:M0,useId:V0,unstable_isNewReconciler:!1};function lr(e,t){if(e&&e.defaultProps){t=Xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Mg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ff={isMounted:function(e){return(e=e._reactInternals)?Ai(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qt(),o=Uo(e),i=Qr(r,o);i.payload=t,n!=null&&(i.callback=n),t=Lo(e,i,o),t!==null&&(fr(t,e,o,r),Rd(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qt(),o=Uo(e),i=Qr(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Lo(e,i,o),t!==null&&(fr(t,e,o,r),Rd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qt(),r=Uo(e),o=Qr(n,r);o.tag=2,t!=null&&(o.callback=t),t=Lo(e,o,r),t!==null&&(fr(t,e,r,n),Rd(t,e,r))}};function aw(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Kl(n,r)||!Kl(o,i):!0}function J0(e,t,n){var r=!1,o=Ho,i=t.contextType;return typeof i=="object"&&i!==null?i=Vn(i):(o=pn(t)?Ci:jt.current,r=t.contextTypes,i=(r=r!=null)?Ys(e,o):Ho),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ff,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function lw(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ff.enqueueReplaceState(t,t.state,null)}function Pg(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},yy(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Vn(i):(i=pn(t)?Ci:jt.current,o.context=Ys(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Mg(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&ff.enqueueReplaceState(o,o.state,null),Kd(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Qs(e,t){try{var n="",r=t;do n+=aL(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
7
|
-
Error generating stack: `+i.message+`
|
|
8
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Qh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Og(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var MD=typeof WeakMap=="function"?WeakMap:Map;function X0(e,t,n){n=Qr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ef||(ef=!0,Wg=r),Og(e,t)},n}function Q0(e,t,n){n=Qr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Og(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Og(e,t),typeof r!="function"&&(Do===null?Do=new Set([this]):Do.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function cw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new MD;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=VD.bind(null,e,t,n),t.then(e,e))}function uw(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function dw(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Qr(-1,1),t.tag=2,Lo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var PD=ro.ReactCurrentOwner,dn=!1;function Xt(e,t,n,r){t.child=e===null?R0(t,null,n,r):Js(t,e.child,n,r)}function fw(e,t,n,r,o){n=n.render;var i=t.ref;return Gs(t,o),r=Ty(e,t,n,r,i,o),n=Iy(),e!==null&&!dn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,no(e,t,o)):(qe&&n&&uy(t),t.flags|=1,Xt(e,t,r,o),t.child)}function pw(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Py(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Z0(e,t,i,r,o)):(e=Pd(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&o)===0){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Kl,n(s,r)&&e.ref===t.ref)return no(e,t,o)}return t.flags|=1,e=Fo(i,r),e.ref=t.ref,e.return=t,t.child=e}function Z0(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Kl(i,r)&&e.ref===t.ref)if(dn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(dn=!0);else return t.lanes=e.lanes,no(e,t,o)}return Lg(e,t,n,r,o)}function eC(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Be(Hs,Tn),Tn|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Be(Hs,Tn),Tn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Be(Hs,Tn),Tn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Be(Hs,Tn),Tn|=r;return Xt(e,t,o,n),t.child}function tC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Lg(e,t,n,r,o){var i=pn(n)?Ci:jt.current;return i=Ys(t,i),Gs(t,o),n=Ty(e,t,n,r,i,o),r=Iy(),e!==null&&!dn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,no(e,t,o)):(qe&&r&&uy(t),t.flags|=1,Xt(e,t,n,o),t.child)}function mw(e,t,n,r,o){if(pn(n)){var i=!0;Wd(t)}else i=!1;if(Gs(t,o),t.stateNode===null)kd(e,t),J0(t,n,r),Pg(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Vn(c):(c=pn(n)?Ci:jt.current,c=Ys(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&lw(t,s,r,c),xo=!1;var p=t.memoizedState;s.state=p,Kd(t,r,s,o),l=t.memoizedState,a!==r||p!==l||fn.current||xo?(typeof u=="function"&&(Mg(t,n,u,r),l=t.memoizedState),(a=xo||aw(t,n,a,r,p,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,b0(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:lr(t.type,a),s.props=c,d=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Vn(l):(l=pn(n)?Ci:jt.current,l=Ys(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||p!==l)&&lw(t,s,r,l),xo=!1,p=t.memoizedState,s.state=p,Kd(t,r,s,o);var m=t.memoizedState;a!==d||p!==m||fn.current||xo?(typeof h=="function"&&(Mg(t,n,h,r),m=t.memoizedState),(c=xo||aw(t,n,c,r,p,m,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Dg(e,t,n,r,i,o)}function Dg(e,t,n,r,o,i){tC(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&ZI(t,n,!1),no(e,t,i);r=t.stateNode,PD.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Js(t,e.child,null,i),t.child=Js(t,null,a,i)):Xt(e,t,a,i),t.memoizedState=r.state,o&&ZI(t,n,!0),t.child}function nC(e){var t=e.stateNode;t.pendingContext?QI(e,t.pendingContext,t.pendingContext!==t.context):t.context&&QI(e,t.context,!1),Sy(e,t.containerInfo)}function hw(e,t,n,r,o){return Ks(),fy(o),t.flags|=256,Xt(e,t,n,r),t.child}var Ug={dehydrated:null,treeContext:null,retryLane:0};function Fg(e){return{baseLanes:e,cachePool:null,transitions:null}}function rC(e,t,n){var r=t.pendingProps,o=Ke.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Be(Ke,o&1),e===null)return kg(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},(r&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=s):i=hf(s,r,0,null),e=wi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Fg(n),t.memoizedState=Ug,e):xy(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return OD(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Fo(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Fo(a,i):(i=wi(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Fg(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Ug,r}return i=e.child,e=i.sibling,r=Fo(i,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function xy(e,t){return t=hf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ed(e,t,n,r){return r!==null&&fy(r),Js(t,e.child,null,n),e=xy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function OD(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Qh(Error(O(422))),Ed(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=hf({mode:"visible",children:r.children},o,0,null),i=wi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&Js(t,e.child,null,s),t.child.memoizedState=Fg(s),t.memoizedState=Ug,i);if((t.mode&1)===0)return Ed(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(O(419)),r=Qh(i,r,void 0),Ed(e,t,s,r)}if(a=(s&e.childLanes)!==0,dn||a){if(r=Et,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,to(e,o),fr(r,e,o,-1))}return My(),r=Qh(Error(O(421))),Ed(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=qD.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,In=Oo(o.nextSibling),wn=t,qe=!0,ur=null,e!==null&&(zn[jn++]=Jr,zn[jn++]=Xr,zn[jn++]=xi,Jr=e.id,Xr=e.overflow,xi=t),t=xy(t,r.children),t.flags|=4096,t)}function gw(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ag(e.return,t,n)}function Zh(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function oC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Xt(e,t,r.children,n),r=Ke.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gw(e,n,t);else if(e.tag===19)gw(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Be(Ke,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Jd(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Zh(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Jd(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Zh(t,!0,n,null,i);break;case"together":Zh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function kd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function no(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ni|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,n=Fo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function LD(e,t,n){switch(t.tag){case 3:nC(t),Ks();break;case 5:k0(t);break;case 1:pn(t.type)&&Wd(t);break;case 4:Sy(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Be(qd,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Be(Ke,Ke.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?rC(e,t,n):(Be(Ke,Ke.current&1),e=no(e,t,n),e!==null?e.sibling:null);Be(Ke,Ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return oC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Be(Ke,Ke.current),r)break;return null;case 22:case 23:return t.lanes=0,eC(e,t,n)}return no(e,t,n)}var iC,Bg,sC,aC;iC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Bg=function(){};sC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ti(Nr.current);var i=null;switch(n){case"input":o=ag(e,o),r=ag(e,r),i=[];break;case"select":o=Xe({},o,{value:void 0}),r=Xe({},r,{value:void 0}),i=[];break;case"textarea":o=ug(e,o),r=ug(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=zd)}fg(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(zl.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o?.[c],r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(zl.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&je("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};aC=function(e,t,n,r){n!==r&&(t.flags|=4)};function xl(e,t){if(!qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $t(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function DD(e,t,n){var r=t.pendingProps;switch(dy(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $t(t),null;case 1:return pn(t.type)&&jd(),$t(t),null;case 3:return r=t.stateNode,Xs(),We(fn),We(jt),vy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(_d(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ur!==null&&(qg(ur),ur=null))),Bg(e,t),$t(t),null;case 5:_y(t);var o=Ti(ec.current);if(n=t.type,e!==null&&t.stateNode!=null)sC(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(O(166));return $t(t),null}if(e=Ti(Nr.current),_d(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[xr]=t,r[Ql]=i,e=(t.mode&1)!==0,n){case"dialog":je("cancel",r),je("close",r);break;case"iframe":case"object":case"embed":je("load",r);break;case"video":case"audio":for(o=0;o<Ml.length;o++)je(Ml[o],r);break;case"source":je("error",r);break;case"img":case"image":case"link":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"input":wI(r,i),je("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},je("invalid",r);break;case"textarea":xI(r,i),je("invalid",r)}fg(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Sd(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Sd(r.textContent,a,e),o=["children",""+a]):zl.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&je("scroll",r)}switch(n){case"input":sd(r),CI(r,i,!0);break;case"textarea":sd(r),RI(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=zd)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Lw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[xr]=t,e[Ql]=r,iC(e,t,!1,!1),t.stateNode=e;e:{switch(s=pg(n,r),n){case"dialog":je("cancel",e),je("close",e),o=r;break;case"iframe":case"object":case"embed":je("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ml.length;o++)je(Ml[o],e);o=r;break;case"source":je("error",e),o=r;break;case"img":case"image":case"link":je("error",e),je("load",e),o=r;break;case"details":je("toggle",e),o=r;break;case"input":wI(e,r),o=ag(e,r),je("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Xe({},r,{value:void 0}),je("invalid",e);break;case"textarea":xI(e,r),o=ug(e,r),je("invalid",e);break;default:o=r}fg(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Fw(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Dw(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&jl(e,l):typeof l=="number"&&jl(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(zl.hasOwnProperty(i)?l!=null&&i==="onScroll"&&je("scroll",e):l!=null&&Jg(e,i,l,s))}switch(n){case"input":sd(e),CI(e,r,!1);break;case"textarea":sd(e),RI(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Bo(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?$s(e,!!r.multiple,i,!1):r.defaultValue!=null&&$s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=zd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return $t(t),null;case 6:if(e&&t.stateNode!=null)aC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(O(166));if(n=Ti(ec.current),Ti(Nr.current),_d(t)){if(r=t.stateNode,n=t.memoizedProps,r[xr]=t,(i=r.nodeValue!==n)&&(e=wn,e!==null))switch(e.tag){case 3:Sd(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Sd(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[xr]=t,t.stateNode=r}return $t(t),null;case 13:if(We(Ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qe&&In!==null&&(t.mode&1)!==0&&(t.flags&128)===0)C0(),Ks(),t.flags|=98560,i=!1;else if(i=_d(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(O(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(O(317));i[xr]=t}else Ks(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$t(t),i=!1}else ur!==null&&(qg(ur),ur=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ke.current&1)!==0?ht===0&&(ht=3):My())),t.updateQueue!==null&&(t.flags|=4),$t(t),null);case 4:return Xs(),Bg(e,t),e===null&&Jl(t.stateNode.containerInfo),$t(t),null;case 10:return hy(t.type._context),$t(t),null;case 17:return pn(t.type)&&jd(),$t(t),null;case 19:if(We(Ke),i=t.memoizedState,i===null)return $t(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)xl(i,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Jd(e),s!==null){for(t.flags|=128,xl(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Be(Ke,Ke.current&1|2),t.child}e=e.sibling}i.tail!==null&&ot()>Zs&&(t.flags|=128,r=!0,xl(i,!1),t.lanes=4194304)}else{if(!r)if(e=Jd(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!qe)return $t(t),null}else 2*ot()-i.renderingStartTime>Zs&&n!==1073741824&&(t.flags|=128,r=!0,xl(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ot(),t.sibling=null,n=Ke.current,Be(Ke,r?n&1|2:n&1),t):($t(t),null);case 22:case 23:return Ay(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Tn&1073741824)!==0&&($t(t),t.subtreeFlags&6&&(t.flags|=8192)):$t(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function UD(e,t){switch(dy(t),t.tag){case 1:return pn(t.type)&&jd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xs(),We(fn),We(jt),vy(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return _y(t),null;case 13:if(We(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));Ks()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return We(Ke),null;case 4:return Xs(),null;case 10:return hy(t.type._context),null;case 22:case 23:return Ay(),null;case 24:return null;default:return null}}var Td=!1,zt=!1,FD=typeof WeakSet=="function"?WeakSet:Set,H=null;function Bs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nt(e,t,r)}else n.current=null}function Hg(e,t,n){try{n()}catch(r){nt(e,t,r)}}var yw=!1;function BD(e,t){if(Ig=Bd,e=f0(),cy(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,p=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++c===o&&(a=s),p===i&&++u===r&&(l=s),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(wg={focusedElem:e,selectionRange:n},Bd=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var m=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var _=m.memoizedProps,T=m.memoizedState,y=t.stateNode,S=y.getSnapshotBeforeUpdate(t.elementType===t.type?_:lr(t.type,_),T);y.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(w){nt(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return m=yw,yw=!1,m}function Bl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Hg(t,n,i)}o=o.next}while(o!==r)}}function pf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function $g(e){var t=e.ref;if(t!==null){var n=e.stateNode;e.tag,e=n,typeof t=="function"?t(e):t.current=e}}function lC(e){var t=e.alternate;t!==null&&(e.alternate=null,lC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xr],delete t[Ql],delete t[Rg],delete t[ED],delete t[TD])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function cC(e){return e.tag===5||e.tag===3||e.tag===4}function Sw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=zd));else if(r!==4&&(e=e.child,e!==null))for(zg(e,t,n),e=e.sibling;e!==null;)zg(e,t,n),e=e.sibling}function jg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(jg(e,t,n),e=e.sibling;e!==null;)jg(e,t,n),e=e.sibling}var Nt=null,cr=!1;function wo(e,t,n){for(n=n.child;n!==null;)uC(e,t,n),n=n.sibling}function uC(e,t,n){if(Rr&&typeof Rr.onCommitFiberUnmount=="function")try{Rr.onCommitFiberUnmount(of,n)}catch{}switch(n.tag){case 5:zt||Bs(n,t);case 6:var r=Nt,o=cr;Nt=null,wo(e,t,n),Nt=r,cr=o,Nt!==null&&(cr?(e=Nt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nt.removeChild(n.stateNode));break;case 18:Nt!==null&&(cr?(e=Nt,n=n.stateNode,e.nodeType===8?Vh(e.parentNode,n):e.nodeType===1&&Vh(e,n),ql(e)):Vh(Nt,n.stateNode));break;case 4:r=Nt,o=cr,Nt=n.stateNode.containerInfo,cr=!0,wo(e,t,n),Nt=r,cr=o;break;case 0:case 11:case 14:case 15:if(!zt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&((i&2)!==0||(i&4)!==0)&&Hg(n,t,s),o=o.next}while(o!==r)}wo(e,t,n);break;case 1:if(!zt&&(Bs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){nt(n,t,a)}wo(e,t,n);break;case 21:wo(e,t,n);break;case 22:n.mode&1?(zt=(r=zt)||n.memoizedState!==null,wo(e,t,n),zt=r):wo(e,t,n);break;default:wo(e,t,n)}}function _w(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new FD),t.forEach(function(r){var o=YD.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ar(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Nt=a.stateNode,cr=!1;break e;case 3:Nt=a.stateNode.containerInfo,cr=!0;break e;case 4:Nt=a.stateNode.containerInfo,cr=!0;break e}a=a.return}if(Nt===null)throw Error(O(160));uC(i,s,o),Nt=null,cr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){nt(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)dC(t,e),t=t.sibling}function dC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ar(t,e),wr(e),r&4){try{Bl(3,e,e.return),pf(3,e)}catch(_){nt(e,e.return,_)}try{Bl(5,e,e.return)}catch(_){nt(e,e.return,_)}}break;case 1:ar(t,e),wr(e),r&512&&n!==null&&Bs(n,n.return);break;case 5:if(ar(t,e),wr(e),r&512&&n!==null&&Bs(n,n.return),e.flags&32){var o=e.stateNode;try{jl(o,"")}catch(_){nt(e,e.return,_)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Pw(o,i),pg(a,s);var c=pg(a,i);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?Fw(o,d):u==="dangerouslySetInnerHTML"?Dw(o,d):u==="children"?jl(o,d):Jg(o,u,d,c)}switch(a){case"input":lg(o,i);break;case"textarea":Ow(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?$s(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?$s(o,!!i.multiple,i.defaultValue,!0):$s(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ql]=i}catch(_){nt(e,e.return,_)}}break;case 6:if(ar(t,e),wr(e),r&4){if(e.stateNode===null)throw Error(O(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(_){nt(e,e.return,_)}}break;case 3:if(ar(t,e),wr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ql(t.containerInfo)}catch(_){nt(e,e.return,_)}break;case 4:ar(t,e),wr(e);break;case 13:ar(t,e),wr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(by=ot())),r&4&&_w(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(zt=(c=zt)||u,ar(t,e),zt=c):ar(t,e),wr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&(e.mode&1)!==0)for(H=e,u=e.child;u!==null;){for(d=H=u;H!==null;){switch(p=H,h=p.child,p.tag){case 0:case 11:case 14:case 15:Bl(4,p,p.return);break;case 1:Bs(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(_){nt(r,n,_)}}break;case 5:Bs(p,p.return);break;case 22:if(p.memoizedState!==null){Ew(d);continue}}h!==null?(h.return=p,H=h):Ew(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{o=d.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Uw("display",s))}catch(_){nt(e,e.return,_)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(_){nt(e,e.return,_)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ar(t,e),wr(e),r&4&&_w(e);break;case 21:break;default:ar(t,e),wr(e)}}function wr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(cC(n)){var r=n;break e}n=n.return}throw Error(O(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(jl(o,""),r.flags&=-33);var i=Sw(e);jg(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=Sw(e);zg(e,a,s);break;default:throw Error(O(161))}}catch(l){nt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function HD(e,t,n){H=e,fC(e,t,n)}function fC(e,t,n){for(var r=(e.mode&1)!==0;H!==null;){var o=H,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Td;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||zt;a=Td;var c=zt;if(Td=s,(zt=l)&&!c)for(H=o;H!==null;)s=H,l=s.child,s.tag===22&&s.memoizedState!==null?Tw(o):l!==null?(l.return=s,H=l):Tw(o);for(;i!==null;)H=i,fC(i,t,n),i=i.sibling;H=o,Td=a,zt=c}vw(e,t,n)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,H=i):vw(e,t,n)}}function vw(e){for(;H!==null;){var t=H;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:zt||pf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!zt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:lr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&ow(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ow(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&ql(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(O(163))}zt||t.flags&512&&$g(t)}catch(p){nt(t,t.return,p)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function Ew(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function Tw(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pf(4,t)}catch(l){nt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){nt(t,o,l)}}var i=t.return;try{$g(t)}catch(l){nt(t,i,l)}break;case 5:var s=t.return;try{$g(t)}catch(l){nt(t,s,l)}}}catch(l){nt(t,t.return,l)}if(t===e){H=null;break}var a=t.sibling;if(a!==null){a.return=t.return,H=a;break}H=t.return}}var $D=Math.ceil,Zd=ro.ReactCurrentDispatcher,Ry=ro.ReactCurrentOwner,Gn=ro.ReactCurrentBatchConfig,Ee=0,Et=null,ut=null,bt=0,Tn=0,Hs=zo(0),ht=0,oc=null,Ni=0,mf=0,Ny=0,Hl=null,un=null,by=0,Zs=1/0,Yr=null,ef=!1,Wg=null,Do=null,Id=!1,ko=null,tf=0,$l=0,Gg=null,Ad=-1,Md=0;function Qt(){return(Ee&6)!==0?ot():Ad!==-1?Ad:Ad=ot()}function Uo(e){return(e.mode&1)===0?1:(Ee&2)!==0&&bt!==0?bt&-bt:wD.transition!==null?(Md===0&&(Md=Jw()),Md):(e=ke,e!==0||(e=window.event,e=e===void 0?16:r0(e.type)),e)}function fr(e,t,n,r){if(50<$l)throw $l=0,Gg=null,Error(O(185));ic(e,n,r),((Ee&2)===0||e!==Et)&&(e===Et&&((Ee&2)===0&&(mf|=n),ht===4&&No(e,bt)),mn(e,r),n===1&&Ee===0&&(t.mode&1)===0&&(Zs=ot()+500,uf&&jo()))}function mn(e,t){var n=e.callbackNode;xL(e,t);var r=Fd(e,e===Et?bt:0);if(r===0)n!==null&&kI(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&kI(n),t===1)e.tag===0?ID(Iw.bind(null,e)):T0(Iw.bind(null,e)),_D(function(){(Ee&6)===0&&jo()}),n=null;else{switch(Xw(r)){case 1:n=ty;break;case 4:n=Yw;break;case 16:n=Ud;break;case 536870912:n=Kw;break;default:n=Ud}n=vC(n,pC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function pC(e,t){if(Ad=-1,Md=0,(Ee&6)!==0)throw Error(O(327));var n=e.callbackNode;if(Vs()&&e.callbackNode!==n)return null;var r=Fd(e,e===Et?bt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=nf(e,r);else{t=r;var o=Ee;Ee|=2;var i=hC();(Et!==e||bt!==t)&&(Yr=null,Zs=ot()+500,Ii(e,t));do try{WD();break}catch(a){mC(e,a)}while(!0);my(),Zd.current=i,Ee=o,ut!==null?t=0:(Et=null,bt=0,t=ht)}if(t!==0){if(t===2&&(o=Sg(e),o!==0&&(r=o,t=Vg(e,o))),t===1)throw n=oc,Ii(e,0),No(e,r),mn(e,ot()),n;if(t===6)No(e,r);else{if(o=e.current.alternate,(r&30)===0&&!zD(o)&&(t=nf(e,r),t===2&&(i=Sg(e),i!==0&&(r=i,t=Vg(e,i))),t===1))throw n=oc,Ii(e,0),No(e,r),mn(e,ot()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(O(345));case 2:_i(e,un,Yr);break;case 3:if(No(e,r),(r&130023424)===r&&(t=by+500-ot(),10<t)){if(Fd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Qt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=xg(_i.bind(null,e,un,Yr),t);break}_i(e,un,Yr);break;case 4:if(No(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-dr(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=ot()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$D(r/1960))-r,10<r){e.timeoutHandle=xg(_i.bind(null,e,un,Yr),r);break}_i(e,un,Yr);break;case 5:_i(e,un,Yr);break;default:throw Error(O(329))}}}return mn(e,ot()),e.callbackNode===n?pC.bind(null,e):null}function Vg(e,t){var n=Hl;return e.current.memoizedState.isDehydrated&&(Ii(e,t).flags|=256),e=nf(e,t),e!==2&&(t=un,un=n,t!==null&&qg(t)),e}function qg(e){un===null?un=e:un.push.apply(un,e)}function zD(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!pr(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function No(e,t){for(t&=~Ny,t&=~mf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-dr(t),r=1<<n;e[n]=-1,t&=~r}}function Iw(e){if((Ee&6)!==0)throw Error(O(327));Vs();var t=Fd(e,0);if((t&1)===0)return mn(e,ot()),null;var n=nf(e,t);if(e.tag!==0&&n===2){var r=Sg(e);r!==0&&(t=r,n=Vg(e,r))}if(n===1)throw n=oc,Ii(e,0),No(e,t),mn(e,ot()),n;if(n===6)throw Error(O(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,_i(e,un,Yr),mn(e,ot()),null}function ky(e,t){var n=Ee;Ee|=1;try{return e(t)}finally{Ee=n,Ee===0&&(Zs=ot()+500,uf&&jo())}}function bi(e){ko!==null&&ko.tag===0&&(Ee&6)===0&&Vs();var t=Ee;Ee|=1;var n=Gn.transition,r=ke;try{if(Gn.transition=null,ke=1,e)return e()}finally{ke=r,Gn.transition=n,Ee=t,(Ee&6)===0&&jo()}}function Ay(){Tn=Hs.current,We(Hs)}function Ii(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,SD(n)),ut!==null)for(n=ut.return;n!==null;){var r=n;switch(dy(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&jd();break;case 3:Xs(),We(fn),We(jt),vy();break;case 5:_y(r);break;case 4:Xs();break;case 13:We(Ke);break;case 19:We(Ke);break;case 10:hy(r.type._context);break;case 22:case 23:Ay()}n=n.return}if(Et=e,ut=e=Fo(e.current,null),bt=Tn=t,ht=0,oc=null,Ny=mf=Ni=0,un=Hl=null,Ei!==null){for(t=0;t<Ei.length;t++)if(n=Ei[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Ei=null}return e}function mC(e,t){do{var n=ut;try{if(my(),Nd.current=Qd,Xd){for(var r=Je.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Xd=!1}if(Ri=0,vt=mt=Je=null,Fl=!1,tc=0,Ry.current=null,n===null||n.return===null){ht=1,oc=t,ut=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=bt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if((u.mode&1)===0&&(d===0||d===11||d===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=uw(s);if(h!==null){h.flags&=-257,dw(h,s,a,i,t),h.mode&1&&cw(i,c,t),t=h,l=c;var m=t.updateQueue;if(m===null){var _=new Set;_.add(l),t.updateQueue=_}else m.add(l);break e}else{if((t&1)===0){cw(i,c,t),My();break e}l=Error(O(426))}}else if(qe&&a.mode&1){var T=uw(s);if(T!==null){(T.flags&65536)===0&&(T.flags|=256),dw(T,s,a,i,t),fy(Qs(l,a));break e}}i=l=Qs(l,a),ht!==4&&(ht=2),Hl===null?Hl=[i]:Hl.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=X0(i,l,t);rw(i,y);break e;case 1:a=l;var S=i.type,v=i.stateNode;if((i.flags&128)===0&&(typeof S.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Do===null||!Do.has(v)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=Q0(i,a,t);rw(i,w);break e}}i=i.return}while(i!==null)}yC(n)}catch(k){t=k,ut===n&&n!==null&&(ut=n=n.return);continue}break}while(!0)}function hC(){var e=Zd.current;return Zd.current=Qd,e===null?Qd:e}function My(){(ht===0||ht===3||ht===2)&&(ht=4),Et===null||(Ni&268435455)===0&&(mf&268435455)===0||No(Et,bt)}function nf(e,t){var n=Ee;Ee|=2;var r=hC();(Et!==e||bt!==t)&&(Yr=null,Ii(e,t));do try{jD();break}catch(o){mC(e,o)}while(!0);if(my(),Ee=n,Zd.current=r,ut!==null)throw Error(O(261));return Et=null,bt=0,ht}function jD(){for(;ut!==null;)gC(ut)}function WD(){for(;ut!==null&&!yL();)gC(ut)}function gC(e){var t=_C(e.alternate,e,Tn);e.memoizedProps=e.pendingProps,t===null?yC(e):ut=t,Ry.current=null}function yC(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=DD(n,t,Tn),n!==null){ut=n;return}}else{if(n=UD(n,t),n!==null){n.flags&=32767,ut=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ht=6,ut=null;return}}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);ht===0&&(ht=5)}function _i(e,t,n){var r=ke,o=Gn.transition;try{Gn.transition=null,ke=1,GD(e,t,n,r)}finally{Gn.transition=o,ke=r}return null}function GD(e,t,n,r){do Vs();while(ko!==null);if((Ee&6)!==0)throw Error(O(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(O(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(RL(e,i),e===Et&&(ut=Et=null,bt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Id||(Id=!0,vC(Ud,function(){return Vs(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=Gn.transition,Gn.transition=null;var s=ke;ke=1;var a=Ee;Ee|=4,Ry.current=null,BD(e,n),dC(n,e),pD(wg),Bd=!!Ig,wg=Ig=null,e.current=n,HD(n,e,o),SL(),Ee=a,ke=s,Gn.transition=i}else e.current=n;if(Id&&(Id=!1,ko=e,tf=o),i=e.pendingLanes,i===0&&(Do=null),EL(n.stateNode,r),mn(e,ot()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ef)throw ef=!1,e=Wg,Wg=null,e;return(tf&1)!==0&&e.tag!==0&&Vs(),i=e.pendingLanes,(i&1)!==0?e===Gg?$l++:($l=0,Gg=e):$l=0,jo(),null}function Vs(){if(ko!==null){var e=Xw(tf),t=Gn.transition,n=ke;try{if(Gn.transition=null,ke=16>e?16:e,ko===null)var r=!1;else{if(e=ko,ko=null,tf=0,(Ee&6)!==0)throw Error(O(331));var o=Ee;for(Ee|=4,H=e.current;H!==null;){var i=H,s=i.child;if((H.flags&16)!==0){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(H=c;H!==null;){var u=H;switch(u.tag){case 0:case 11:case 15:Bl(8,u,i)}var d=u.child;if(d!==null)d.return=u,H=d;else for(;H!==null;){u=H;var p=u.sibling,h=u.return;if(lC(u),u===c){H=null;break}if(p!==null){p.return=h,H=p;break}H=h}}}var m=i.alternate;if(m!==null){var _=m.child;if(_!==null){m.child=null;do{var T=_.sibling;_.sibling=null,_=T}while(_!==null)}}H=i}}if((i.subtreeFlags&2064)!==0&&s!==null)s.return=i,H=s;else e:for(;H!==null;){if(i=H,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:Bl(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,H=y;break e}H=i.return}}var S=e.current;for(H=S;H!==null;){s=H;var v=s.child;if((s.subtreeFlags&2064)!==0&&v!==null)v.return=s,H=v;else e:for(s=S;H!==null;){if(a=H,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:pf(9,a)}}catch(k){nt(a,a.return,k)}if(a===s){H=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,H=w;break e}H=a.return}}if(Ee=o,jo(),Rr&&typeof Rr.onPostCommitFiberRoot=="function")try{Rr.onPostCommitFiberRoot(of,e)}catch{}r=!0}return r}finally{ke=n,Gn.transition=t}}return!1}function ww(e,t,n){t=Qs(n,t),t=X0(e,t,1),e=Lo(e,t,1),t=Qt(),e!==null&&(ic(e,1,t),mn(e,t))}function nt(e,t,n){if(e.tag===3)ww(e,e,n);else for(;t!==null;){if(t.tag===3){ww(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Do===null||!Do.has(r))){e=Qs(n,e),e=Q0(t,e,1),t=Lo(t,e,1),e=Qt(),t!==null&&(ic(t,1,e),mn(t,e));break}}t=t.return}}function VD(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qt(),e.pingedLanes|=e.suspendedLanes&n,Et===e&&(bt&n)===n&&(ht===4||ht===3&&(bt&130023424)===bt&&500>ot()-by?Ii(e,0):Ny|=n),mn(e,t)}function SC(e,t){t===0&&((e.mode&1)===0?t=1:(t=cd,cd<<=1,(cd&130023424)===0&&(cd=4194304)));var n=Qt();e=to(e,t),e!==null&&(ic(e,t,n),mn(e,n))}function qD(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),SC(e,n)}function YD(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(O(314))}r!==null&&r.delete(t),SC(e,n)}var _C;_C=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||fn.current)dn=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return dn=!1,LD(e,t,n);dn=(e.flags&131072)!==0}else dn=!1,qe&&(t.flags&1048576)!==0&&I0(t,Vd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;kd(e,t),e=t.pendingProps;var o=Ys(t,jt.current);Gs(t,n),o=Ty(null,t,r,e,o,n);var i=Iy();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pn(r)?(i=!0,Wd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,yy(t),o.updater=ff,t.stateNode=o,o._reactInternals=t,Pg(t,r,e,n),t=Dg(null,t,r,!0,i,n)):(t.tag=0,qe&&i&&uy(t),Xt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(kd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=JD(r),e=lr(r,e),o){case 0:t=Lg(null,t,r,e,n);break e;case 1:t=mw(null,t,r,e,n);break e;case 11:t=fw(null,t,r,e,n);break e;case 14:t=pw(null,t,r,lr(r.type,e),n);break e}throw Error(O(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),Lg(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),mw(e,t,r,o,n);case 3:e:{if(nC(t),e===null)throw Error(O(387));r=t.pendingProps,i=t.memoizedState,o=i.element,b0(e,t),Kd(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Qs(Error(O(423)),t),t=hw(e,t,r,n,o);break e}else if(r!==o){o=Qs(Error(O(424)),t),t=hw(e,t,r,n,o);break e}else for(In=Oo(t.stateNode.containerInfo.firstChild),wn=t,qe=!0,ur=null,n=R0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ks(),r===o){t=no(e,t,n);break e}Xt(e,t,r,n)}t=t.child}return t;case 5:return k0(t),e===null&&kg(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Cg(r,o)?s=null:i!==null&&Cg(r,i)&&(t.flags|=32),tC(e,t),Xt(e,t,s,n),t.child;case 6:return e===null&&kg(t),null;case 13:return rC(e,t,n);case 4:return Sy(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Js(t,null,r,n):Xt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),fw(e,t,r,o,n);case 7:return Xt(e,t,t.pendingProps,n),t.child;case 8:return Xt(e,t,t.pendingProps.children,n),t.child;case 12:return Xt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Be(qd,r._currentValue),r._currentValue=s,i!==null)if(pr(i.value,s)){if(i.children===o.children&&!fn.current){t=no(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Qr(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Ag(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(O(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ag(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Xt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Gs(t,n),o=Vn(o),r=r(o),t.flags|=1,Xt(e,t,r,n),t.child;case 14:return r=t.type,o=lr(r,t.pendingProps),o=lr(r.type,o),pw(e,t,r,o,n);case 15:return Z0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),kd(e,t),t.tag=1,pn(r)?(e=!0,Wd(t)):e=!1,Gs(t,n),J0(t,r,o),Pg(t,r,o,n),Dg(null,t,r,!0,e,n);case 19:return oC(e,t,n);case 22:return eC(e,t,n)}throw Error(O(156,t.tag))};function vC(e,t){return qw(e,t)}function KD(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wn(e,t,n,r){return new KD(e,t,n,r)}function Py(e){return e=e.prototype,!(!e||!e.isReactComponent)}function JD(e){if(typeof e=="function")return Py(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qg)return 11;if(e===Zg)return 14}return 2}function Fo(e,t){var n=e.alternate;return n===null?(n=Wn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pd(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Py(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ks:return wi(n.children,o,i,t);case Xg:s=8,o|=8;break;case rg:return e=Wn(12,n,t,o|2),e.elementType=rg,e.lanes=i,e;case og:return e=Wn(13,n,t,o),e.elementType=og,e.lanes=i,e;case ig:return e=Wn(19,n,t,o),e.elementType=ig,e.lanes=i,e;case kw:return hf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Nw:s=10;break e;case bw:s=9;break e;case Qg:s=11;break e;case Zg:s=14;break e;case Co:s=16,r=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=Wn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function wi(e,t,n,r){return e=Wn(7,e,r,t),e.lanes=n,e}function hf(e,t,n,r){return e=Wn(22,e,r,t),e.elementType=kw,e.lanes=n,e.stateNode={isHidden:!1},e}function eg(e,t,n){return e=Wn(6,e,null,t),e.lanes=n,e}function tg(e,t,n){return t=Wn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function XD(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fh(0),this.expirationTimes=Fh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Oy(e,t,n,r,o,i,s,a,l){return e=new XD(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Wn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yy(i),e}function QD(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:bs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function EC(e){if(!e)return Ho;e=e._reactInternals;e:{if(Ai(e)!==e||e.tag!==1)throw Error(O(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(O(171))}if(e.tag===1){var n=e.type;if(pn(n))return E0(e,n,t)}return t}function TC(e,t,n,r,o,i,s,a,l){return e=Oy(n,r,!0,e,o,i,s,a,l),e.context=EC(null),n=e.current,r=Qt(),o=Uo(n),i=Qr(r,o),i.callback=t??null,Lo(n,i,o),e.current.lanes=o,ic(e,o,r),mn(e,r),e}function gf(e,t,n,r){var o=t.current,i=Qt(),s=Uo(o);return n=EC(n),t.context===null?t.context=n:t.pendingContext=n,t=Qr(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Lo(o,t,s),e!==null&&(fr(e,o,s,i),Rd(e,o,s)),s}function rf(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Cw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ly(e,t){Cw(e,t),(e=e.alternate)&&Cw(e,t)}function ZD(){return null}var IC=typeof reportError=="function"?reportError:function(e){console.error(e)};function Dy(e){this._internalRoot=e}yf.prototype.render=Dy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));gf(e,t,null,null)};yf.prototype.unmount=Dy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bi(function(){gf(null,e,null,null)}),t[eo]=null}};function yf(e){this._internalRoot=e}yf.prototype.unstable_scheduleHydration=function(e){if(e){var t=e0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ro.length&&t!==0&&t<Ro[n].priority;n++);Ro.splice(n,0,e),n===0&&n0(e)}};function Uy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Sf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function xw(){}function eU(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=rf(s);i.call(c)}}var s=TC(t,r,e,0,null,!1,!1,"",xw);return e._reactRootContainer=s,e[eo]=s.current,Jl(e.nodeType===8?e.parentNode:e),bi(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=rf(l);a.call(c)}}var l=Oy(e,0,!1,null,null,!1,!1,"",xw);return e._reactRootContainer=l,e[eo]=l.current,Jl(e.nodeType===8?e.parentNode:e),bi(function(){gf(t,l,n,r)}),l}function _f(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=rf(s);a.call(l)}}gf(t,s,e,o)}else s=eU(n,t,e,o,r);return rf(s)}Qw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Al(t.pendingLanes);n!==0&&(ny(t,n|1),mn(t,ot()),(Ee&6)===0&&(Zs=ot()+500,jo()))}break;case 13:bi(function(){var r=to(e,1);if(r!==null){var o=Qt();fr(r,e,1,o)}}),Ly(e,1)}};ry=function(e){if(e.tag===13){var t=to(e,134217728);if(t!==null){var n=Qt();fr(t,e,134217728,n)}Ly(e,134217728)}};Zw=function(e){if(e.tag===13){var t=Uo(e),n=to(e,t);if(n!==null){var r=Qt();fr(n,e,t,r)}Ly(e,t)}};e0=function(){return ke};t0=function(e,t){var n=ke;try{return ke=e,t()}finally{ke=n}};hg=function(e,t,n){switch(t){case"input":if(lg(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=cf(r);if(!o)throw Error(O(90));Mw(r),lg(r,o)}}}break;case"textarea":Ow(e,n);break;case"select":t=n.value,t!=null&&$s(e,!!n.multiple,t,!1)}};$w=ky;zw=bi;var tU={usingClientEntryPoint:!1,Events:[ac,Os,cf,Bw,Hw,ky]},Rl={findFiberByHostInstance:vi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nU={bundleType:Rl.bundleType,version:Rl.version,rendererPackageName:Rl.rendererPackageName,rendererConfig:Rl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ro.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Gw(e),e===null?null:e.stateNode},findFiberByHostInstance:Rl.findFiberByHostInstance||ZD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Nl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Nl.isDisabled&&Nl.supportsFiber))try{of=Nl.inject(nU),Rr=Nl}catch{}var Nl;Rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tU;Rn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uy(t))throw Error(O(200));return QD(e,t,null,n)};Rn.createRoot=function(e,t){if(!Uy(e))throw Error(O(299));var n=!1,r="",o=IC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Oy(e,1,!1,null,null,n,!1,r,o),e[eo]=t.current,Jl(e.nodeType===8?e.parentNode:e),new Dy(t)};Rn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=Gw(t),e=e===null?null:e.stateNode,e};Rn.flushSync=function(e){return bi(e)};Rn.hydrate=function(e,t,n){if(!Sf(t))throw Error(O(200));return _f(null,e,t,!0,n)};Rn.hydrateRoot=function(e,t,n){if(!Uy(e))throw Error(O(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=IC;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=TC(t,null,e,1,n??null,o,!1,i,s),e[eo]=t.current,Jl(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new yf(t)};Rn.render=function(e,t,n){if(!Sf(t))throw Error(O(200));return _f(null,e,t,!1,n)};Rn.unmountComponentAtNode=function(e){if(!Sf(e))throw Error(O(40));return e._reactRootContainer?(bi(function(){_f(null,null,e,!1,function(){e._reactRootContainer=null,e[eo]=null})}),!0):!1};Rn.unstable_batchedUpdates=ky;Rn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Sf(n))throw Error(O(200));if(e==null||e._reactInternals===void 0)throw Error(O(38));return _f(e,t,n,!1,r)};Rn.version="18.3.1-next-f1338f8080-20240426"});var vf=Ar((mY,xC)=>{"use strict";function CC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(CC)}catch(e){console.error(e)}}CC(),xC.exports=wC()});var NC=Ar(Fy=>{"use strict";var RC=vf();Fy.createRoot=RC.createRoot,Fy.hydrateRoot=RC.hydrateRoot;var hY});var UC=Ar(If=>{"use strict";var uU=Vr(),dU=Symbol.for("react.element"),fU=Symbol.for("react.fragment"),pU=Object.prototype.hasOwnProperty,mU=uU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,hU={key:!0,ref:!0,__self:!0,__source:!0};function DC(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)pU.call(t,r)&&!hU.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:dU,type:e,key:i,ref:s,props:o,_owner:mU.current}}If.Fragment=fU;If.jsx=DC;If.jsxs=DC});var uc=Ar((wY,FC)=>{"use strict";FC.exports=UC()});var L=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var j=globalThis;var hr="10.56.0";function yn(){return Go(j),j}function Go(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||hr,t[hr]=t[hr]||{}}function Jn(e,t,n=j){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[hr]=r[hr]||{};return o[e]||(o[e]=t())}var hc=["debug","info","warn","error","log","assert","trace"],sR="Sentry Logger ",Vo={};function wt(e){if(!("console"in j))return e();let t=j.console,n={},r=Object.keys(Vo);r.forEach(o=>{let i=Vo[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function aR(){Gf().enabled=!0}function lR(){Gf().enabled=!1}function cS(){return Gf().enabled}function cR(...e){Wf("log",...e)}function uR(...e){Wf("warn",...e)}function dR(...e){Wf("error",...e)}function Wf(e,...t){L&&cS()&&wt(()=>{j.console[e](`${sR}[${e}]:`,...t)})}function Gf(){return L?Jn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var x={enable:aR,disable:lR,isEnabled:cS,log:cR,warn:uR,error:dR};var uS=/\(error: (.*)\)/,dS=/captureMessage|captureException/;function sa(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let i=[],s=n.split(`
|
|
9
|
-
`);for(let a=r;a<s.length;a++){let l=s[a];l.length>1024&&(l=l.slice(0,1024));let c=uS.test(l)?l.replace(uS,"$1"):l;if(!c.includes("Error: ")){for(let u of t){let d=u(c);if(d){i.push(d);break}}if(i.length>=50+o)break}}return qf(i.slice(o))}}function yc(e){return Array.isArray(e)?sa(...e):e}function qf(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(gc(t).function||"")&&t.pop(),t.reverse(),dS.test(gc(t).function||"")&&(t.pop(),dS.test(gc(t).function||"")&&t.pop()),t.slice(0,50).map(n=>({...n,filename:n.filename||gc(t).filename,function:n.function||"?"}))}function gc(e){return e[e.length-1]||{}}var Vf="<anonymous>";function Wt(e){try{return!e||typeof e!="function"?Vf:e.name||Vf}catch{return Vf}}function aa(e){let t=e.exception;if(t){let n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}var la={},fS={};function Mt(e,t){return la[e]=la[e]||[],la[e].push(t),()=>{let n=la[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function Pt(e,t){if(!fS[e]){fS[e]=!0;try{t()}catch(n){L&&x.error(`Error while instrumenting ${e}`,n)}}}function at(e,t){let n=e&&la[e];if(n)for(let r of n)try{r(t)}catch(o){L&&x.error(`Error while triggering instrumentation handler.
|
|
10
|
-
Type: ${e}
|
|
11
|
-
Name: ${Wt(r)}
|
|
12
|
-
Error:`,o)}}var Yf=null;function ca(e){let t="error";Mt(t,e),Pt(t,fR)}function fR(){Yf=j.onerror,j.onerror=function(e,t,n,r,o){return at("error",{column:r,error:o,line:n,msg:e,url:t}),Yf?Yf.apply(this,arguments):!1},j.onerror.__SENTRY_INSTRUMENTED__=!0}var Kf=null;function ua(e){let t="unhandledrejection";Mt(t,e),Pt(t,pR)}function pR(){Kf=j.onunhandledrejection,j.onunhandledrejection=function(e){return at("unhandledrejection",e),Kf?Kf.apply(this,arguments):!0},j.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var pS=Object.prototype.toString;function kn(e){switch(pS.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qn(e,Error)}}function Hi(e,t){return pS.call(e)===`[object ${t}]`}function $i(e){return Hi(e,"ErrorEvent")}function da(e){return Hi(e,"DOMError")}function Sc(e){return Hi(e,"DOMException")}function Ot(e){return Hi(e,"String")}function ao(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function nn(e){return e===null||ao(e)||typeof e!="object"&&typeof e!="function"}function An(e){return Hi(e,"Object")}function lo(e){return typeof Event<"u"&&Qn(e,Event)}function _c(e){return Hi(e,"RegExp")}function Xn(e){return!!(e?.then&&typeof e.then=="function")}function Qn(e,t){try{return e instanceof t}catch{return!1}}function fa(e){return typeof Request<"u"&&Qn(e,Request)}function Ze(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&pa(o,r);try{e[t]=o}catch{L&&x.log(`Failed to replace method "${t}" in object`,e)}}function $e(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{L&&x.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function pa(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,$e(e,"__sentry_original__",t)}catch{}}function co(e){return e.__sentry_original__}function ma(e){if(kn(e))return{message:e.message,name:e.name,stack:e.stack,...mS(e)};if(lo(e)){let{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...mS(e)}}return e}function mS(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function vc(e){let t=Object.keys(ma(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var zi;function qo(e){if(zi!==void 0)return zi?zi(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=j;return t in n&&typeof n[t]=="function"?(zi=n[t],zi(e)):(zi=null,e())}function Mn(){return qo(()=>Math.random())}function Yo(){return qo(()=>Date.now())}var mR=Symbol.for("sentry.skipNormalization"),hR=Symbol.for("sentry.overrideNormalizationDepth");function hS(e){return!!e[mR]}function gS(e){let t=e[hR];return typeof t=="number"?t:void 0}var Jf;function ji(e){Jf=e}function Lt(e,t=100,n=1/0){try{return Xf("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ha(e,t=3,n=100*1024){let r=Lt(e,t);return SR(r)>n?ha(e,t-1,n):r}function Xf(e,t,n=1/0,r=1/0,o=_R()){let[i,s]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=Qf(e,t);if(!a.startsWith("[object "))return a;if(hS(t))return t;let l=gS(t),c=l!==void 0?l:n;if(c===0)return a.replace("object ","");if(i(t))return"[Circular ~]";let u=t;if(u&&typeof u.toJSON=="function")try{let m=u.toJSON();return Xf("",m,c-1,r,o)}catch{}let d=Array.isArray(t)?[]:{},p=0,h=ma(t);for(let m in h){if(!Object.prototype.hasOwnProperty.call(h,m))continue;if(p>=r){d[m]="[MaxProperties ~]";break}let _=h[m];d[m]=Xf(m,_,c-1,r,o),p++}return s(t),d}function Qf(e,t){try{if(Jf){let r=Jf(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Wt(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${gR(t)}]`}catch(n){return`**non-serializable** (${n})`}}function gR(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function yR(e){return~-encodeURI(e).split(/%..|./).length}function SR(e){return yR(JSON.stringify(e))}function _R(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function Ko(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function ga(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];nn(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(Qf(void 0,o))}return n.join(t)}function uo(e,t,n=!1){return Ot(e)?_c(t)?t.test(e):Ot(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Ct(e,t=[],n=!1){for(let r of t)if(uo(e,r,n))return!0;return!1}function vR(){let e=j;return e.crypto||e.msCrypto}var Zf;function ER(){return Mn()*16}function et(e=vR()){try{if(e?.randomUUID)return qo(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Zf||(Zf="10000000100040008000"+1e11),Zf.replace(/[018]/g,t=>(t^(ER()&15)>>t/4).toString(16))}function yS(e){return e.exception?.values?.[0]}function Zn(e){let{message:t,event_id:n}=e;if(t)return t;let r=yS(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Jo(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function Pn(e,t){let n=yS(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){let i={...o?.data,...t.data};n.mechanism.data=i}}function ya(e){if(ep(e))return!0;try{$e(e,"__sentry_captured__",!0)}catch{}return!1}function ep(e){try{return e.__sentry_captured__}catch{}}var _S=1e3;function rn(){return Yo()/_S}function TR(){let{performance:e}=j;if(!e?.now||!e.timeOrigin)return rn;let t=e.timeOrigin;return()=>(t+qo(()=>e.now()))/_S}var SS;function Ce(){return(SS??(SS=TR()))()}var tp=null;function IR(){let{performance:e}=j;if(!e?.now)return;let t=3e5,n=qo(()=>e.now()),r=Yo(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;let i=e.timing?.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<t?i:r-n}function Oe(){return tp===null&&(tp=IR()),tp}function vS(e){let t=Ce(),n={sid:et(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>wR(n)};return e&&Mr(n,e),n}function Mr(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||Ce(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:et()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n: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),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function ES(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),Mr(e,n)}function wR(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function fo(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=fo(r[o],t[o],n-1));return r}function Gt(){return et()}function Dt(){return et().substring(16)}function Ec(e){try{let t=j.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Tc(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var np="_sentrySpan";function po(e,t){t?$e(e,np,Ec(t)):delete e[np]}function Xo(e){return Tc(e[np])}var CR=100,on=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Gt(),sampleRand:Mn()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,po(t,Xo(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Mr(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():An(n)?t:void 0,{tags:o,attributes:i,extra:s,user:a,contexts:l,level:c,fingerprint:u=[],propagationContext:d,conversationId:p}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...i},this._extra={...this._extra,...s},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),p&&(this._conversationId=p),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,po(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Gt(),sampleRand:Mn()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:CR;if(r<=0)return this;let o={timestamp:rn(),...t,message:t.message?Ko(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,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:Xo(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=fo(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||et();if(!this._client)return L&&x.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){let o=r?.event_id||et();if(!this._client)return L&&x.warn("No client configured on scope - will not capture message!"),o;let i=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:o},this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||et();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(L&&x.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function TS(){return Jn("defaultCurrentScope",()=>new on)}function IS(){return Jn("defaultIsolationScope",()=>new on)}var wS=e=>e instanceof Promise&&!e[CS],CS=Symbol("chained PromiseLike"),xS=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return wS(r)&&wS(e)?r:xR(e,r)},xR=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...i)=>o.apply(e,i),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[CS]:!0}),t};var rp=class{constructor(t,n){let r;t?r=t:r=new on;let o;n?o=n:o=new on,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return Xn(r)?xS(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Wi(){let e=yn(),t=Go(e);return t.stack=t.stack||new rp(TS(),IS())}function RR(e){return Wi().withScope(e)}function NR(e,t){let n=Wi();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function RS(e){return Wi().withScope(()=>e(Wi().getIsolationScope()))}function NS(){return{withIsolationScope:RS,withScope:RR,withSetScope:NR,withSetIsolationScope:(e,t)=>RS(t),getCurrentScope:()=>Wi().getScope(),getIsolationScope:()=>Wi().getIsolationScope()}}function gr(e){let t=Go(e);return t.acs?t.acs:NS()}function bR(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function kR(e,t){let{value:n,unit:r}=bR(e)?e:{value:e,unit:void 0},o=AR(n),i=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...i};if(!t||t==="skip-undefined"&&n===void 0)return;let s="";try{s=JSON.stringify(n)??""}catch{}return{value:s,type:"string",...i}}function op(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let i=kR(o,t);i&&(n[r]=i)}return n}function AR(e){if(Array.isArray(e))return{value:e,type:"array"};let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}var bS;function ip(){return bS?.()}function Ic(){return bS!==void 0}function K(){let e=yn();return gr(e).getCurrentScope()}function Ve(){let e=yn();return gr(e).getIsolationScope()}function Sa(){return Jn("globalScope",()=>new on)}function On(...e){let t=yn(),n=gr(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function $(){return K().getClient()}function wc(e){let t=ip();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:i}=n,s={trace_id:r,span_id:i||Dt()};return o&&(s.parent_span_id=o),s}var ft="sentry.source",Pr="sentry.sample_rate",Gi="sentry.previous_trace_sample_rate",ze="sentry.op",Se="sentry.origin",Or="sentry.idle_span_finish_reason",er="sentry.measurement_unit",tr="sentry.measurement_value";var Vi="sentry.custom_span_name",Qo="sentry.profile_id",Ut="sentry.exclusive_time";var Cc="sentry.link.type",xc="gen_ai.conversation.id";function sp(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}function qi(e,t){e.setAttribute("http.response.status_code",t);let n=sp(t);n.message!=="unknown_error"&&e.setStatus(n)}var kS="_sentryScope",AS="_sentryIsolationScope";function MS(e,t,n){e&&($e(e,AS,Ec(n)),$e(e,kS,t))}function Zo(e){let t=e;return{scope:t[kS],isolationScope:Tc(t[AS])}}var _a="sentry-";var MR=8192;function Rc(e){let t=PR(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,i])=>{if(o.startsWith(_a)){let s=o.slice(_a.length);r[s]=i}return r},{});if(Object.keys(n).length>0)return n}function ap(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${_a}${r}`]=o),n),{});return OR(t)}function PR(e){if(!(!e||!Ot(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=PS(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):PS(e)}function PS(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function OR(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,s=o===0?i:`${t},${i}`;return s.length>MR?(L&&x.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var LR=/^o(\d+)\./,DR=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function UR(e){return e==="http"||e==="https"}function Sn(e,t=!1){let{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${s}`}function FR(e){let t=DR.exec(e);if(!t){wt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",i="",s="",a=""]=t.slice(1),l="",c=a,u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){let d=c.match(/^\d+/);d&&(c=d[0])}return OS({host:i,pass:o,path:l,projectId:c,port:s,protocol:n,publicKey:r})}function OS(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function BR(e){if(!L)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(x.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?UR(r)?t&&isNaN(parseInt(t,10))?(x.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(x.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(x.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function HR(e){return e.match(LR)?.[1]}function LS(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=HR(n)),r}function Nc(e){let t=typeof e=="string"?FR(e):OS(e);if(!(!t||!BR(t)))return t}function _n(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var bc=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function DS(e){if(!e)return;let t=e.match(bc);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function lp(e,t){let n=DS(e),r=Rc(t);if(!n?.traceId)return{traceId:Gt(),sampleRand:Mn()};let o=$R(n,r);r&&(r.sample_rand=o.toString());let{traceId:i,parentSpanId:s,parentSampled:a}=n;return{traceId:i,parentSpanId:s,sampled:a,dsc:r||{},sampleRand:o}}function va(e=Gt(),t=Dt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Ea(e=Gt(),t=Dt(),n){return`00-${e}-${t}-${n?"01":"00"}`}function $R(e,t){let n=_n(t?.sample_rand);if(n!==void 0)return n;let r=_n(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?Mn()*r:r+Mn()*(1-r):Mn()}var kc=0,Ia=1,US=!1;function HS(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:a,links:l}=X(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:o,status:s,origin:a,links:l}}function Ac(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:X(e).parent_span_id,i=Zo(e).scope,s=r?i?.getPropagationContext().propagationSpanId||Dt():t;return{parent_span_id:o,span_id:s,trace_id:n}}function wa(e){let{traceId:t,spanId:n}=e.spanContext(),r=an(e);return va(t,n,r)}function $S(e){let{traceId:t,spanId:n}=e.spanContext(),r=an(e);return Ea(t,n,r)}function Ca(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:i})=>({span_id:t,trace_id:n,sampled:r===Ia,attributes:i,...o}))}function dp(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Ia,attributes:o}))}function sn(e){return typeof e=="number"?FS(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?FS(e.getTime()):Ce()}function FS(e){return e>9999999999?e/1e3:e}function X(e){if(GS(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(WS(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:l}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:zS(e),start_timestamp:sn(o),timestamp:sn(s)||void 0,status:Ra(a),op:r[ze],origin:r[Se],links:Ca(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function xa(e){if(GS(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(WS(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:l}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:zS(e),start_timestamp:sn(o),end_timestamp:sn(s),is_segment:e===Ta(e),status:fp(a),attributes:r,links:dp(l)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Ta(e)}}function zS(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function jS(e){return{...e,attributes:op(e.attributes),links:e.links?.map(t=>({...t,attributes:op(t.attributes)}))}}function WS(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function GS(e){return typeof e.getSpanJSON=="function"}function an(e){let{traceFlags:t}=e.spanContext();return t===Ia}function Ra(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function fp(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var ei="_sentryChildSpans",cp="_sentryRootSpan";function Na(e,t){let n=e[cp]||e;$e(t,cp,n),e[ei]?e[ei].add(t):$e(e,ei,new Set([t]))}function VS(e,t){e[ei]&&e[ei].delete(t)}function Lr(e){let t=new Set;function n(r){if(!t.has(r)&&an(r)){t.add(r);let o=r[ei]?Array.from(r[ei]):[];for(let i of o)n(i)}}return n(e),Array.from(t)}var Ie=Ta;function Ta(e){return e[cp]||e}function Ne(){let e=yn(),t=gr(e);return t.getActiveSpan?t.getActiveSpan():Xo(K())}function ba(){US||(wt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),US=!0)}var qS=!1;function Mc(){if(qS)return;function e(){let t=Ne(),n=t&&Ie(t);if(n){let r="internal_error";L&&x.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}qS=!0,ca(e),ua(e)}function pt(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||$()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function YS(e){x.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Dr(e,t){if(!t?.length)return!1;for(let n of t){if(jR(n)){if(e.description&&uo(e.description,n))return L&&YS(e),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?e.description&&uo(e.description,n.name):!0,i=n.op?e.op&&uo(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,l])=>zR(e.attributes?.[a],l)):!0;if(o&&i&&s)return L&&YS(e),!0}return!1}function zR(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?uo(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function KS(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function jR(e){return typeof e=="string"||e instanceof RegExp}var Yi="production";var JS="_frozenDsc";function Ki(e,t){$e(e,JS,t)}function Pc(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Yi,release:n.release,public_key:r,trace_id:e,org_id:LS(t)};return t.emit("createDsc",o),o}function Ji(e,t){let n=t.getPropagationContext();return n.dsc||Pc(n.traceId,e)}function lt(e){let t=$();if(!t)return{};let n=Ie(e),r=X(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[Pr]??o[Gi];function a(m){return(typeof s=="number"||typeof s=="string")&&(m.sample_rate=`${s}`),m}let l=n[JS];if(l)return a(l);let c=i?.get("sentry.dsc"),u=c&&Rc(c);if(u)return a(u);let d=Pc(e.spanContext().traceId,t),p=o[ft]??o["sentry.span.source"],h=r.description;return p!=="url"&&h&&(d.transaction=h),pt()&&(d.sampled=String(an(n)),d.sample_rand=i?.get("sentry.sample_rand")??Zo(n).scope?.getPropagationContext().sampleRand.toString()),a(d),t.emit("createDsc",d,n),d}var xt=class{constructor(t={}){this._traceId=t.traceId||Gt(),this._spanId=t.spanId||Dt(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:kc}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}};function Oc(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function Vt(e,t=[]){return[e,t]}function Lc(e,t){let[n,r]=e;return[n,[...r,t]]}function ka(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function mp(e,t){return ka(e,(n,r)=>t.includes(r))}function pp(e){let t=Go(j);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function hp(e){let[t,n]=e,r=JSON.stringify(t);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[pp(r),i]:r.push(typeof i=="string"?pp(i):i)}for(let i of n){let[s,a]=i;if(o(`
|
|
13
|
-
${JSON.stringify(s)}
|
|
14
|
-
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(Lt(a))}o(l)}}return typeof r=="string"?r:WR(r)}function WR(e){let t=e.reduce((o,i)=>o+i.length,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function gp(e){return[{type:"span"},e]}function yp(e){let t=typeof e.data=="string"?pp(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var XS={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function GR(e){return e in XS}function Dc(e){return GR(e)?XS[e]:e}function Xi(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Aa(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Sn(r)},...o&&{trace:o}}}function VR(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function QS(e,t,n,r){let o=Xi(n),i={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Sn(t)}},s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Vt(i,[s])}function ZS(e,t,n,r){let o=Xi(n),i=e.type&&e.type!=="replay_event"?e.type:"event";VR(e,n?.sdk);let s=Aa(e,o,r,t);return delete e.sdkProcessingMetadata,Vt(s,[[{type:i},e]])}function e_(e,t){function n(h){return!!h.trace_id&&!!h.public_key}let r=lt(e[0]),o=t?.getDsn(),i=t?.getOptions().tunnel,s={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&o&&{dsn:Sn(o)}},{beforeSendSpan:a,ignoreSpans:l}=t?.getOptions()||{},c=l?.length?e.filter(h=>{let m=X(h);return!Dr({description:m.description,op:m.op,attributes:m.data},l)}):e,u=e.length-c.length;u&&t?.recordDroppedEvent("before_send","span",u);let d=a?h=>{let m=X(h),_=Oc(a)?m:a(m);return _||(ba(),m)}:X,p=[];for(let h of c){let m=d(h);m&&p.push(gp(m))}return Vt(s,p)}function t_(e){if(!L)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=X(e),{spanId:o}=e.spanContext(),i=an(e),s=Ie(e),a=s===e,l=`[Tracing] Starting ${i?"sampled":"unsampled"} ${a?"root ":""}span`,c=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&c.push(`parent ID: ${r}`),!a){let{op:u,description:d}=X(s);c.push(`root ID: ${s.spanContext().spanId}`),u&&c.push(`root op: ${u}`),d&&c.push(`root description: ${d}`)}x.log(`${l}
|
|
15
|
-
${c.join(`
|
|
16
|
-
`)}`)}function n_(e){if(!L)return;let{description:t="< unknown name >",op:n="< unknown op >"}=X(e),{spanId:r}=e.spanContext(),i=Ie(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;x.log(s)}function Uc(e,t,n,r=Ne()){let o=r&&Ie(r);o&&(L&&x.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[tr]:t,[er]:n}))}function Fc(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},o=r[er],i=r[tr];typeof o=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:o})}),t}function Rt(e){return e.getOptions().traceLifecycle==="stream"}var r_=1e3,mo=class{constructor(t={}){this._traceId=t.traceId||Gt(),this._spanId=t.spanId||Dt(),this._startTime=t.startTimestamp||Ce(),this._links=t.links,this._attributes={},this.setAttributes({[Se]:"manual",[ze]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){let{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?Ia:kc}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=sn(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(ft,"custom"),this}end(t){this._endTime||(this._endTime=sn(t),n_(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ze],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Ra(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Se],profile_id:this._attributes[Qo],exclusive_time:this._attributes[Ut],measurements:Fc(this._events),is_segment:this._isStandaloneSpan&&Ie(this)===this||void 0,segment_id:this._isStandaloneSpan?Ie(this).spanContext().spanId:void 0,links:Ca(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===Ie(this),status:fp(this._status),attributes:this._attributes,links:dp(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){L&&x.log("[Tracing] Adding an event to span:",t);let o=o_(n)?n:r||Ce(),i=o_(n)?{}:n||{},s={name:t,time:sn(o),attributes:i};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let t=$();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Ie(this)))return;if(this._isStandaloneSpan){this._sampled?YR(e_([this],t)):(L&&x.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Rt(t)){t.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(Zo(this).scope||K()).captureEvent(r)}_convertSpanToTransaction(){if(!i_(X(this)))return;this._name||(L&&x.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:t,isolationScope:n}=Zo(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=Lr(this).filter(d=>d!==this&&!qR(d)).map(d=>X(d)).filter(i_),s=this._attributes[ft];delete this._attributes[Vi];let a=!1;i.forEach(d=>{delete d.data[Vi],d.op?.startsWith("gen_ai.")&&(a=!0)});let l={contexts:{trace:HS(this)},spans:i.length>r_?i.sort((d,p)=>d.start_timestamp-p.start_timestamp).slice(0,r_):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:lt(this),hasGenAiSpans:a},request:r,...s&&{transaction_info:{source:s}}},c=Fc(this._events);return c&&Object.keys(c).length&&(L&&x.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),l.measurements=c),l}};function o_(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function i_(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function qR(e){return e instanceof mo&&e.isStandaloneSpan()}function YR(e){let t=$();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function s_(e,t,n){if(!pt(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);let i=_n(o);if(i===void 0)return L&&x.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!i)return L&&x.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];let s=n<i;return s||L&&x.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[s,i,r]}var Sp="__SENTRY_SUPPRESS_TRACING__";function St(e){let t=l_();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=JR(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?s=>On(e.scope,s):o!==void 0?s=>Qi(o,s):s=>s())(()=>{let s=K(),a=QR(s,o),l=$();return e.onlyIfParent&&!a?(l?.recordDroppedEvent("no_parent_span","span"),new xt):KR({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}function Qi(e,t){let n=l_();return n.withActiveSpan?n.withActiveSpan(e,t):On(r=>(po(r,e||void 0),t(r)))}function KR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!pt()){let a=new xt;if(n||!e){let l={sampled:"false",sample_rate:"0",transaction:t.name,...lt(a)};Ki(a,l)}return a}let o=$();if(ZR(o,t))return _p(r)||o?.recordDroppedEvent("ignored","span"),new xt({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let i=Ve(),s;if(e&&!n)s=XR(e,r,t),Na(e,s);else if(e){let a=lt(e),{traceId:l,spanId:c}=e.spanContext(),u=an(e);s=a_({traceId:l,parentSpanId:c,...t},r,u),Ki(s,a)}else{let{traceId:a,dsc:l,parentSpanId:c,sampled:u}={...i.getPropagationContext(),...r.getPropagationContext()};s=a_({traceId:a,parentSpanId:c,...t},r,u),l&&Ki(s,l)}return t_(s),MS(s,r,i),s}function JR(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...n};return r.startTimestamp=sn(e.startTime),delete r.startTime,r}return n}function l_(){let e=yn();return gr(e)}function a_(e,t,n){let r=$(),o=r?.getOptions()||{},{name:i=""}=e,s={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r?.emit("beforeSampling",s,{decision:!1});let a=s.parentSampled??n,l=s.spanAttributes,c=t.getPropagationContext(),u=_p(t),[d,p,h]=u?[!1]:s_(o,{name:i,parentSampled:a,attributes:l,parentSampleRate:_n(c.dsc?.sample_rate)},c.sampleRand),m=new mo({...e,attributes:{[ft]:"custom",[Pr]:p!==void 0&&h?p:void 0,...l},sampled:d});return!d&&r&&!u&&(L&&x.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Rt(r)?"span":"transaction")),r&&r.emit("spanStart",m),m}function XR(e,t,n){let{spanId:r,traceId:o}=e.spanContext(),i=_p(t),s=i?!1:an(e),a=s?new mo({...n,parentSpanId:r,traceId:o,sampled:s}):new xt({traceId:o});Na(e,a);let l=$();return l&&(Rt(l)&&a instanceof xt&&(e instanceof xt&&e.dropReason?(a.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,"span")):i||(a.dropReason="sample_rate",l.recordDroppedEvent("sample_rate","span"))),l.emit("spanStart",a),n.endTimestamp&&(l.emit("spanEnd",a),l.emit("afterSpanEnd",a))),a}function QR(e,t){if(t)return t;if(t===null)return;let n=Xo(e);if(!n)return;let r=$();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Ie(n):n}function ZR(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Rt(e)||!n?.length?!1:Dr({description:t.name||"",op:t.attributes?.[ze]||t.op,attributes:t.attributes},n)}function _p(e){return e.getScopeData().sdkProcessingMetadata[Sp]===!0}var Zi={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},eN="heartbeatFailed",tN="idleTimeout",nN="finalTimeout",rN="externalFinish";function Bc(e,t={}){let n=new Map,r=!1,o,i=rN,s=!t.disableAutoFinish,a=[],{idleTimeout:l=Zi.idleTimeout,finalTimeout:c=Zi.finalTimeout,childSpanTimeout:u=Zi.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:p=!0}=t,h=$();if(!h||!pt()){let I=new xt,N={sample_rate:"0",sampled:"false",...lt(I)};return Ki(I,N),I}let m=K(),_=Ne(),T=oN(e);T.end=new Proxy(T.end,{apply(I,N,F){if(d&&d(T),N instanceof xt)return;let[R,...U]=F,Q=R||Ce(),de=sn(Q),V=Lr(T).filter(q=>q!==T),we=X(T);if(!V.length||!p)return A(de),Reflect.apply(I,N,[de,...U]);let ie=h.getOptions().ignoreSpans,xe=V?.reduce((q,oe)=>{let ce=X(oe);return!ce.timestamp||ie&&Dr({description:ce.description,op:ce.op,attributes:ce.data},ie)?q:q?Math.max(q,ce.timestamp):ce.timestamp},void 0),D=we.start_timestamp,le=Math.min(D?D+c/1e3:1/0,Math.max(D||-1/0,Math.min(de,xe||1/0)));return A(le),Reflect.apply(I,N,[le,...U])}});function y(){o&&(clearTimeout(o),o=void 0)}function S(I){y(),o=setTimeout(()=>{!r&&n.size===0&&s&&(i=tN,T.end(I))},l)}function v(I){o=setTimeout(()=>{!r&&s&&(i=eN,T.end(I))},u)}function w(I){y(),n.set(I,!0);let N=Ce();v(N+u/1e3)}function k(I){if(n.has(I)&&n.delete(I),n.size===0){let N=Ce();S(N+l/1e3)}}function A(I){r=!0,n.clear(),a.forEach(V=>V()),po(m,_);let N=X(T),{start_timestamp:F}=N;if(!F)return;N.data[Or]||T.setAttribute(Or,i);let U=N.status;(!U||U==="unknown")&&T.setStatus({code:1}),x.log(`[Tracing] Idle span "${N.op}" finished`);let Q=Lr(T).filter(V=>V!==T),de=0;Q.forEach(V=>{V.isRecording()&&(V.setStatus({code:2,message:"cancelled"}),V.end(I),L&&x.log("[Tracing] Cancelling span since span ended early",JSON.stringify(V,void 0,2)));let we=X(V),{timestamp:ie=0,start_timestamp:xe=0}=we,D=xe<=I,le=(c+l)/1e3,q=ie-xe<=le;if(L){let oe=JSON.stringify(V,void 0,2);D?q||x.log("[Tracing] Discarding span since it finished after idle span final timeout",oe):x.log("[Tracing] Discarding span since it happened after idle span was finished",oe)}(!q||!D)&&(VS(T,V),de++)}),de>0&&T.setAttribute("sentry.idle_span_discarded_spans",de)}return a.push(h.on("spanStart",I=>{if(r||I===T||X(I).timestamp||I instanceof mo&&I.isStandaloneSpan())return;Lr(T).includes(I)&&w(I.spanContext().spanId)})),a.push(h.on("spanEnd",I=>{r||k(I.spanContext().spanId)})),a.push(h.on("idleSpanEnableAutoFinish",I=>{I===T&&(s=!0,S(),n.size&&v())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(T.setStatus({code:2,message:"deadline_exceeded"}),i=nN,T.end())},c),T}function oN(e){let t=St(e);return po(K(),t),L&&x.log("[Tracing] Started span is an idle span"),t}function u_(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;iN(e,t),r&&lN(e,r),cN(e,n),sN(e,o),aN(e,i)}function c_(e,t){let{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:p,propagationContext:h,transactionName:m,span:_}=t;Ma(e,"extra",n),Ma(e,"tags",r),Ma(e,"attributes",o),Ma(e,"user",i),Ma(e,"contexts",s),e.sdkProcessingMetadata=fo(e.sdkProcessingMetadata,l,2),a&&(e.level=a),m&&(e.transactionName=m),_&&(e.span=_),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function Ma(e,t,n){e[t]=fo(e[t],n,1)}function Hc(e,t){let n=Sa().getScopeData();return e&&c_(n,e.getScopeData()),t&&c_(n,t.getScopeData()),n}function iN(e,t){let{extra:n,tags:r,user:o,contexts:i,level:s,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),s&&(e.level=s),a&&e.type!=="transaction"&&(e.transaction=a)}function sN(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function aN(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function lN(e,t){e.contexts={trace:Ac(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:lt(t),...e.sdkProcessingMetadata};let n=Ie(t),r=X(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function cN(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}var uN="thismessage:/";function ni(e){return"isRelative"in e}function yr(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?uN:void 0);try{if("canParse"in URL&&!URL.canParse(e,r))return;let o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function es(e){if(ni(e))return e.pathname;let t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Ln(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}}function $c(e){return e.split(/[?#]/,1)[0]}function Ft(e,t=!0){if(e.startsWith("data:")){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),i=e.indexOf(","),s="";if(t&&i!==-1){let a=e.slice(i+1);s=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${s?`,${s}`:""}`}return e}function ho(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}var vp=0,d_=1,f_=2;function Sr(e){return new Pa(t=>{t(e)})}function ri(e){return new Pa((t,n)=>{n(e)})}var Pa=class e{constructor(t){this._state=vp,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(s){o(s)}},i=>{if(!n)o(i);else try{r(n(i))}catch(s){o(s)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,i;return this.then(s=>{i=!1,o=s,t&&t()},s=>{i=!0,o=s,t&&t()}).then(()=>{if(i){r(o);return}n(o)})})}_executeHandlers(){if(this._state===vp)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===d_&&n[1](this._value),this._state===f_&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===vp){if(Xn(s)){s.then(r,o);return}this._state=i,this._value=s,this._executeHandlers()}},r=i=>{n(d_,i)},o=i=>{n(f_,i)};try{t(r,o)}catch(i){o(i)}}};function p_(e,t,n,r=0){try{let o=Ep(t,n,e,r);return Xn(o)?o:Sr(o)}catch(o){return ri(o)}}function Ep(e,t,n,r){let o=n[r];if(!e||!o)return e;let i=o({...e},t);return L&&i===null&&x.log(`Event processor "${o.id||"?"}" dropped event`),Xn(i)?i.then(s=>Ep(s,t,n,r+1)):Ep(i,t,n,r+1)}var oi,m_,h_,go;function g_(e){let t=j._sentryDebugIds,n=j._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(go&&r.length===m_&&o.length===h_)return go;m_=r.length,h_=o.length,go={},oi||(oi={});let i=(s,a)=>{for(let l of s){let c=a[l],u=oi?.[l];if(u&&go&&c)go[u[0]]=c,oi&&(oi[l]=[u[0],c]);else if(c){let d=e(l);for(let p=d.length-1;p>=0;p--){let m=d[p]?.filename;if(m&&go&&oi){go[m]=c,oi[l]=[m,c];break}}}}};return t&&i(r,t),n&&i(o,n),go}function Oa(e,t,n,r,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||et(),timestamp:t.timestamp||rn()},c=n.integrations||e.integrations.map(y=>y.name);dN(l,e),mN(l,c),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&fN(l,e.stackParser);let u=gN(r,n.captureContext);n.mechanism&&Pn(l,n.mechanism);let d=o?o.getEventProcessors():[],p=Hc(i,u),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),u_(l,p);let m=[...d,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?Sr(l):p_(m,l,n)).then(y=>(y&&pN(y),typeof s=="number"&&s>0?hN(y,s,a):y))}function dN(e,t){let{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||Yi,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let s=e.request;s?.url&&i&&(s.url=Ko(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=Ko(a.value,i))})}function fN(e,t){let n=g_(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function pN(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)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(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function mN(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function hN(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Lt(o.data,t,n)}}))},...e.user&&{user:Lt(e.user,t,n)},...e.contexts&&{contexts:Lt(e.contexts,t,n)},...e.extra&&{extra:Lt(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Lt(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Lt(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Lt(e.contexts.flags,3,n)),r}function gN(e,t){if(!t)return e;let n=e?e.clone():new on;return n.update(t),n}function y_(e){if(e)return yN(e)?{captureContext:e}:_N(e)?{captureContext:e}:e}function yN(e){return e instanceof on||typeof e=="function"}var SN=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function _N(e){return Object.keys(e).some(t=>SN.includes(t))}function Ur(e,t){return K().captureException(e,y_(t))}function ts(e,t){return K().captureEvent(e,t)}function ii(e,t){Ve().setContext(e,t)}function La(){return Ve().lastEventId()}function Da(){let e=$();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Ua(e){Ve().addEventProcessor(e)}function ns(e){let t=Ve(),{user:n}=Hc(t,K()),{userAgent:r}=j.navigator||{},o=vS({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return i?.status==="ok"&&Mr(i,{status:"exited"}),Fa(),t.setSession(o),o}function Fa(){let e=Ve(),n=K().getSession()||e.getSession();n&&ES(n),S_(),e.setSession()}function S_(){let e=Ve(),t=$(),n=e.getSession();n&&t&&t.captureSession(n)}function si(e=!1){if(e){Fa();return}S_()}var __="7";function v_(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function vN(e){return`${v_(e)}${e.projectId}/envelope/`}function EN(e,t){let n={sentry_version:__};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Ip(e,t,n){return t||`${vN(e)}?${EN(e,n)}`}function wp(e,t){let n=Nc(e);if(!n)return"";let r=`${v_(n)}embed/error-page/`,o=`dsn=${Sn(n)}`;for(let i in t)if(i!=="dsn"&&i!=="onClose")if(i==="user"){let s=t.user;if(!s)continue;s.name&&(o+=`&name=${encodeURIComponent(s.name)}`),s.email&&(o+=`&email=${encodeURIComponent(s.email)}`)}else o+=`&${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`;return`${r}?${o}`}var Cp=[];function TN(e){let t={};return e.forEach(n=>{let{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function xp(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){let o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return TN(r)}function E_(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Np(e,r,n)}),n}function Rp(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Np(e,t,n){if(n[t.name]){L&&x.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Cp.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Cp.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,i)=>r(o,i,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((i,s)=>r(i,s,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=t[r];typeof o=="function"&&e.on(r,i=>o.call(t,i,e))}),L&&x.log(`Integration installed: ${t.name}`)}function bp(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function kp(){return"npm"}function T_(){return!bp()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Dn(){return typeof window<"u"&&(!T_()||IN())}function IN(){return j.process?.type==="renderer"}function wN(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...Dn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function I_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Sn(r)),Vt(i,[wN(e,o)])}function rs(e,t){let n=t??CN(e)??[];if(n.length===0)return;let r=e.getOptions(),o=I_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);w_().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function CN(e){return w_().get(e)}function w_(){return Jn("clientToLogBufferMap",()=>new WeakMap)}function xN(e,t){let n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...Dn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function C_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Sn(r)),Vt(i,[xN(e,o)])}function Ba(e,t){let n=t??RN(e)??[];if(n.length===0)return;let r=e.getOptions(),o=C_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);x_().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function RN(e){return x_().get(e)}function x_(){return Jn("clientToMetricBufferMap",()=>new WeakMap)}function R_(e){let t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status==="ok"||e.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...e.data},links:e.links};return jS(t)}function N_(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||Rt(t))return;let n=[],r=[];for(let i of e.spans)i.op?.startsWith("gen_ai.")?n.push(R_(i)):r.push(i);if(n.length===0)return;e.spans=r;let o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Dn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}function zc(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var os=Symbol.for("SentryBufferFullError");function ai(e=100){let t=new Set;function n(){return t.size<e}function r(s){t.delete(s)}function o(s){if(!n())return ri(os);let a=s();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function i(s){if(!t.size)return Sr(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let l=[a,new Promise(c=>zc(setTimeout(()=>c(!1),s)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:i}}var b_=60*1e3;function k_(e,t=Yo()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?b_:r-t}function A_(e,t){return e[t]||e.all||0}function Ha(e,t,n=Yo()){return A_(e,t)>n}function $a(e,{statusCode:t,headers:n},r=Yo()){let o={...e},i=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(i)for(let a of i.trim().split(",")){let[l,c,,,u]=a.split(":",5),d=parseInt(l,10),p=(isNaN(d)?60:d)*1e3;if(!c)o.all=r+p;else for(let h of c.split(";"))h==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(o[h]=r+p):o[h]=r+p}else s?o.all=r+k_(s,r):t===429&&(o.all=r+60*1e3);return o}var Ap=64;function jc(e,t,n=ai(e.bufferSize||Ap)){let r={},o=s=>n.drain(s);function i(s){let a=[];if(ka(s,(d,p)=>{let h=Dc(p);Ha(r,h)?e.recordDroppedEvent("ratelimit_backoff",h):a.push(d)}),a.length===0)return Promise.resolve({});let l=Vt(s[0],a),c=d=>{if(mp(l,["client_report"])){L&&x.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}ka(l,(p,h)=>{e.recordDroppedEvent(d,Dc(h))})},u=()=>t({body:hp(l)}).then(d=>d.statusCode===413?(L&&x.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),d):(L&&d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&x.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=$a(r,d),d),d=>{throw c("network_error"),L&&x.error("Encountered error running transport request:",d),d});return n.add(u).then(d=>d,d=>{if(d===os)return L&&x.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw d})}return{send:i,flush:o}}function M_(e,t,n){let r=[{type:"client_report"},{timestamp:n||rn(),discarded_events:e}];return Vt(t?{dsn:t}:{},[r])}function Wc(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function P_(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:i,data:s,op:a}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:s?.[Qo],exclusive_time:s?.[Ut],measurements:e.measurements,is_segment:!0}}function O_(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[Qo]:e.profile_id},...e.exclusive_time&&{[Ut]:e.exclusive_time}}}},measurements:e.measurements}}var za=["forwarded","-ip","remote-","via","-user"];function L_(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5}:{userInfo:!1,cookies:{deny:za},httpHeaders:{request:{deny:za},response:{deny:za}},httpBodies:[],queryParams:{deny:za},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:5}}var NN={userInfo:!1,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function D_(e){let t=e.dataCollection!=null?NN:L_(e.sendDefaultPii),n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,queryParams:n.queryParams??t.queryParams,genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var U_="Not capturing exception because it's already been captured.",F_="Discarded session because of missing or non-string release",W_=Symbol.for("SentryInternalError"),G_=Symbol.for("SentryDoNotSendEventError"),bN=5e3;function Gc(e){return{message:e,[W_]:!0}}function Mp(e){return{message:e,[G_]:!0}}function B_(e){return!!e&&typeof e=="object"&&W_ in e}function H_(e){return!!e&&typeof e=="object"&&G_ in e}function $_(e,t,n,r,o){let i=0,s,a=!1;e.on(n,()=>{i=0,clearTimeout(s),a=!1}),e.on(t,l=>{if(i+=r(l),i>=8e5)o(e);else if(!a){let c=e.getOptions()._flushInterval??bN;c>0&&(a=!0,s=zc(setTimeout(()=>{o(e)},c)))}}),e.on("flush",()=>{o(e)})}var ja=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ai(t.transportOptions?.bufferSize??Ap),this._dataCollection=D_(t),t.dsn?this._dsn=Nc(t.dsn):L&&x.warn("No DSN provided, client will not send events."),this._dsn){let r=Ip(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&$_(this,"afterCaptureLog","flushLogs",PN,rs),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&$_(this,"afterCaptureMetric","flushMetrics",MN,Ba)}captureException(t,n,r){let o=et();if(ya(t))return L&&x.log(U_),o;let i={event_id:o,...n};return this._process(()=>this.eventFromException(t,i).then(s=>this._captureEvent(s,i,r)).then(s=>s),"error"),i.event_id}captureMessage(t,n,r,o){let i={event_id:et(),...r},s=ao(t)?t:String(t),a=nn(t),l=a?this.eventFromMessage(s,n,i):this.eventFromException(t,i);return this._process(()=>l.then(c=>this._captureEvent(c,i,o)),a?"unknown":"error"),i.event_id}captureEvent(t,n,r){let o=et();if(n?.originalException&&ya(n.originalException))return L&&x.log(U_),o;let i={event_id:o,...n},s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,l=s.capturedSpanIsolationScope,c=z_(t.type);return this._process(()=>this._captureEvent(t,i,a||r,l),c),i.event_id}captureSession(t){this.sendSession(t),Mr(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(this.emit("flush"),!n)return!0;let r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){rs(this);let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Np(this,t,this._integrations),n||Rp(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=N_(t,this),o=ZS(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=Lc(o,yp(i));r&&(o=Lc(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){let{release:n,environment:r=Yi}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){L&&x.warn(F_);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){L&&x.warn(F_);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=QS(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;L&&x.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,o=(...i)=>n(...i);return r.add(o),()=>{r.delete(o)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return L&&x.error("Error while sending envelope:",n),{}}return L&&x.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=E_(this,t),Rp(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,i=n.exception?.values;if(i){o=!0,r=!1;for(let l of i)if(l.mechanism?.handled===!1){r=!0;break}}let s=t.status==="ok";(s&&t.errors===0||s&&r)&&(Mr(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){let i=this.getOptions(),s=this.getIntegrationNames();return!n.integrations&&s.length&&(n.integrations=s),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Oa(i,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...wc(r)},...a.contexts};let l=Ji(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=K(),o=Ve()){return L&&Pp(t)&&x.log(`Captured error event \`${Wc(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(i=>i.event_id,i=>{L&&(H_(i)?x.log(i.message):B_(i)?x.warn(i.message):x.warn(i))})}_processEvent(t,n,r,o){let i=this.getOptions(),{sampleRate:s}=i,a=V_(t),l=Pp(t),u=`before send for type \`${t.type||"error"}\``,d=typeof s>"u"?void 0:_n(s);if(l&&typeof d=="number"&&Mn()>d)return this.recordDroppedEvent("sample_rate","error"),ri(Mp(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let p=z_(t.type);return this._prepareEvent(t,n,r,o).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",p),Mp("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return h;let _=AN(this,i,h,n);return kN(_,u)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",p),a){let y=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw Mp(`${u} returned \`null\`, will not send event.`)}let m=r.getSession()||o.getSession();if(l&&m&&this._updateSessionFromEvent(m,h),a){let T=h.sdkProcessingMetadata?.spanCountBeforeProcessing||0,y=h.spans?h.spans.length:0,S=T-y;S>0&&this.recordDroppedEvent("before_send","span",S)}let _=h.transaction_info;if(a&&_&&h.transaction!==t.transaction){let T="custom";h.transaction_info={..._,source:T}}return this.sendEvent(h,n),h}).then(null,h=>{throw H_(h)||B_(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),Gc(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
17
|
-
Reason: ${h}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===os&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{let[o,i]=n.split(":");return{reason:o,category:i,quantity:r}})}_flushOutcomes(){L&&x.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){L&&x.log("No outcomes to send");return}if(!this._dsn){L&&x.log("No dsn provided, will not send outcomes");return}L&&x.log("Sending outcomes:",t);let n=M_(t,this._options.tunnel&&Sn(this._dsn));this.sendEnvelope(n)}};function z_(e){return e==="replay_event"?"replay":e||"error"}function kN(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Xn(e))return e.then(r=>{if(!An(r)&&r!==null)throw Gc(n);return r},r=>{throw Gc(`${t} rejected with ${r}`)});if(!An(e)&&e!==null)throw Gc(n);return e}function AN(e,t,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=!Oc(t.beforeSendSpan)&&t.beforeSendSpan,l=n;if(Pp(l)&&o)return o(l,r);if(V_(l)){if(a||s){let c=P_(l);if(s?.length&&Dr({description:c.description,op:c.op,attributes:c.data},s))return null;if(a){let u=a(c);u?l=fo(n,O_(u)):ba()}if(l.spans){let u=[],d=l.spans;for(let h of d){if(s?.length&&Dr({description:h.description,op:h.op,attributes:h.data},s)){KS(d,h);continue}if(a){let m=a(h);m?u.push(m):(ba(),u.push(h))}else u.push(h)}let p=l.spans.length-u.length;p&&e.recordDroppedEvent("before_send","span",p),l.spans=u}}if(i){if(l.spans){let c=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return i(l,r)}}return l}function Pp(e){return e.type===void 0}function V_(e){return e.type==="transaction"}function MN(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+q_(e.attributes)}function PN(e){let t=0;return e.message&&(t+=e.message.length*2),t+q_(e.attributes)}function q_(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*j_(n[0]):nn(n)?t+=j_(n):t+=100}),t}function j_(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Op(e,t){t.debug===!0&&(L?x.enable():wt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),K().update(t.initialScope);let r=new e(t);return Lp(r),r.init(),r}function Lp(e){K().setClient(e)}function Dp(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return LN(e,n)||ON(e,r)}function ON(e,t){return t?Y_(e)===Y_(t):!1}function LN(e,t){let n=yr(e);return!n||ni(n)||!t?!1:DN(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function DN(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function Y_(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Up(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Wa(e,t,n=[t],r="npm"){let o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:hr})),o.version=hr)}function is(e={}){let t=e.client||$();if(!Da()||!t)return{};let n=yn(),r=gr(n);if(r.getTraceData)return r.getTraceData(e);let o=e.scope||K(),i=e.span||Ne();if(!i&&Ic())return{};let s=i?wa(i):UN(o),a=i?lt(i):Ji(t,o),l=ap(a);if(!bc.test(s))return x.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let u={"sentry-trace":s,baggage:l};return e.propagateTraceparent&&(u.traceparent=i?$S(i):FN(o)),u}function UN(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return va(t,r,n)}function FN(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ea(t,r,n)}function Fp(e,t,n){let r,o,i,s=n?.maxWait?Math.max(n.maxWait,t):0,a=n?.setTimeoutImpl||setTimeout;function l(){return c(),r=e(),r}function c(){o!==void 0&&clearTimeout(o),i!==void 0&&clearTimeout(i),o=i=void 0}function u(){return o!==void 0||i!==void 0?l():r}function d(){return o&&clearTimeout(o),o=a(l,t),s&&i===void 0&&(i=a(l,s)),r}return d.cancel=c,d.flush=u,d}var BN=100;function vn(e,t){let n=$(),r=Ve();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=BN}=n.getOptions();if(i<=0)return;let a={timestamp:rn(),...e},l=o?wt(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,i))}var K_,HN="FunctionToString",J_=new WeakMap,$N=(()=>({name:HN,setupOnce(){K_=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=co(this),n=J_.has($())&&t!==void 0?t:this;return K_.apply(n,e)}}catch{}},setup(e){J_.set(e,!0)}})),Vc=$N;var zN=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],jN="EventFilters",Bp=(e={})=>{let t;return{name:jN,setup(n){let r=n.getOptions();t=X_(e,r)},processEvent(n,r,o){if(!t){let i=o.getOptions();t=X_(e,i)}return WN(n,t)?null:n}}},Yc=((e={})=>({...Bp(e),name:"InboundFilters"}));function X_(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:zN],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function WN(e,t){if(e.type){if(e.type==="transaction"&&VN(e,t.ignoreTransactions))return L&&x.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
18
|
-
Event: ${Zn(e)}`),!0}else{if(GN(e,t.ignoreErrors))return L&&x.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
19
|
-
Event: ${Zn(e)}`),!0;if(JN(e))return L&&x.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
20
|
-
Event: ${Zn(e)}`),!0;if(qN(e,t.denyUrls))return L&&x.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
21
|
-
Event: ${Zn(e)}.
|
|
22
|
-
Url: ${qc(e)}`),!0;if(!YN(e,t.allowUrls))return L&&x.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
23
|
-
Event: ${Zn(e)}.
|
|
24
|
-
Url: ${qc(e)}`),!0}return!1}function GN(e,t){return t?.length?Wc(e).some(n=>Ct(n,t)):!1}function VN(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Ct(n,t):!1}function qN(e,t){if(!t?.length)return!1;let n=qc(e);return n?Ct(n,t):!1}function YN(e,t){if(!t?.length)return!0;let n=qc(e);return n?Ct(n,t):!0}function KN(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function qc(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?KN(n):null}catch{return L&&x.error(`Cannot extract url for event ${Zn(e)}`),null}}function JN(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function $p(e,t,n,r,o,i){if(!o.exception?.values||!i||!Qn(i.originalException,Error))return;let s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=Hp(e,t,r,i.originalException,n,o.exception.values,s,0))}function Hp(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let l=[...i];if(Qn(r[o],Error)){Q_(s,a,r);let c=e(t,r[o]),u=l.length;Z_(c,o,u,a),l=Hp(e,t,n,r[o],o,[c,...l],c,u)}return ev(r)&&r.errors.forEach((c,u)=>{if(Qn(c,Error)){Q_(s,a,r);let d=e(t,c),p=l.length;Z_(d,`errors[${u}]`,p,a),l=Hp(e,t,n,c,o,[d,...l],d,p)}}),l}function ev(e){return Array.isArray(e.errors)}function Q_(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...ev(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Z_(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function XN(e){return kn(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Kc(e){return XN(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var tv=new Set([]);function zp(e){let t="console",n=Mt(t,e);return Pt(t,QN),n}function QN(){"console"in j&&hc.forEach(function(e){e in j.console&&Ze(j.console,e,function(t){return Vo[e]=t,function(...n){let r=n[0],o=Vo[e],i=tv.size&&typeof r=="string"&&Ct(r,tv);i||at("console",{args:n,level:e}),(!i||L&&x.isEnabled())&&o?.apply(j.console,n)}})})}function ss(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var ZN="Dedupe",eb=(()=>{let e;return{name:ZN,processEvent(t){if(t.type)return t;try{if(tb(t,e))return L&&x.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),Jc=eb;function tb(e,t){return t?!!(nb(e,t)||rb(e,t)):!1}function nb(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!ov(e,t)||!rv(e,t))}function rb(e,t){let n=nv(t),r=nv(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!ov(e,t)||!rv(e,t))}function rv(e,t){let n=aa(e),r=aa(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){let i=r[o],s=n[o];if(i.filename!==s.filename||i.lineno!==s.lineno||i.colno!==s.colno||i.function!==s.function)return!1}return!0}function ov(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function nv(e){return e.exception?.values?.[0]}var ob="ConversationId",ib=(()=>({name:ob,setup(e){e.on("spanStart",t=>{let n=K().getScopeData(),r=Ve().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:s,description:a}=X(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(xc,o)}})}})),jp=ib;function Wp(e,t,n,r,o){if(!e.fetchData)return;let{method:i,url:s}=e.fetchData,a=pt()&&t(s);if(e.endTimestamp){let m=e.fetchData.__span;if(!m)return;let _=r[m];_&&(a&&(ab(_,e),sb(_,e,o)),delete r[m]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},u=$(),p=!!Ne()||!!u&&Rt(u),h=a&&p?St(ub(s,i,l)):new xt;if(a&&!p&&u?.recordDroppedEvent("no_parent_span","span"),e.fetchData.__span=h.spanContext().spanId,r[h.spanContext().spanId]=h,n(e.fetchData.url)){let m=e.args[0],_={...e.args[1]||{}},T=sv(m,_,pt()&&p?h:void 0,c);T&&(e.args[1]=_,_.headers=T)}if(u){let m={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit("beforeOutgoingRequestSpan",h,m)}return h}function sb(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function sv(e,t,n,r){let o=is({span:n,propagateTraceparent:r}),i=o["sentry-trace"],s=o.baggage,a=o.traceparent;if(!i)return;let l=t.headers||(fa(e)?e.headers:void 0);if(l)if(lb(l)){let c=new Headers(l);if(c.get("sentry-trace")||c.set("sentry-trace",i),r&&a&&!c.get("traceparent")&&c.set("traceparent",a),s){let u=c.get("baggage");u?Xc(u)||c.set("baggage",`${u},${s}`):c.set("baggage",s)}return c}else if(cb(l)){let c=[...l];c.find(d=>d[0]==="sentry-trace")||c.push(["sentry-trace",i]),r&&a&&!c.find(d=>d[0]==="traceparent")&&c.push(["traceparent",a]);let u=l.find(d=>d[0]==="baggage"&&typeof d[1]=="string"&&Xc(d[1]));return s&&!u&&c.push(["baggage",s]),c}else{let c="sentry-trace"in l?l["sentry-trace"]:void 0,u="traceparent"in l?l.traceparent:void 0,d="baggage"in l?l.baggage:void 0,p=d?Array.isArray(d)?[...d]:[d]:[],h=d&&(Array.isArray(d)?d.find(_=>Xc(_)):Xc(d));s&&!h&&p.push(s);let m=Object.assign({},l,{"sentry-trace":c??i,baggage:p.length>0?p.join(","):void 0});return r&&a&&!u&&(m.traceparent=a),m}else return{...o}}function ab(e,t){if(t.response){qi(e,t.response.status);let n=t.response?.headers?.get("content-length");if(n){let r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:2,message:"internal_error"});e.end()}function Xc(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(_a))}function lb(e){return typeof Headers<"u"&&Qn(e,Headers)}function cb(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function ub(e,t,n){if(e.startsWith("data:")){let i=Ft(e);return{name:`${t} ${i}`,attributes:iv(e,void 0,t,n)}}let r=yr(e),o=r?es(r):e;return{name:`${t} ${o}`,attributes:iv(e,r,t,n)}}function iv(e,t,n,r){let o={url:Ft(e),type:"fetch","http.method":n,[Se]:r,[ze]:"http.client"};return t&&(ni(t)||(o["http.url"]=Ft(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function Qc(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var Ga=j;function Gp(){return"history"in Ga&&!!Ga.history}function db(){if(!("fetch"in Ga))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Va(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Vp(){if(typeof EdgeRuntime=="string")return!0;if(!db())return!1;if(Va(Ga.fetch))return!0;let e=!1,t=Ga.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Va(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){L&&x.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function yo(e,t){let n="fetch",r=Mt(n,e);return Pt(n,()=>lv(void 0,t)),r}function eu(e){let t="fetch-body-resolved",n=Mt(t,e);return Pt(t,()=>lv(pb)),n}function lv(e,t=!1){t&&!Vp()||Ze(j,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:s}=mb(r),a={args:r,fetchData:{method:i,url:s},startTimestamp:Ce()*1e3,virtualError:o,headers:hb(r)};return e||at("fetch",{...a}),n.apply(j,r).then(async l=>(e?e(l):at("fetch",{...a,endTimestamp:Ce()*1e3,response:l}),l),l=>{at("fetch",{...a,endTimestamp:Ce()*1e3,error:l}),kn(l)&&l.stack===void 0&&(l.stack=o.stack,$e(l,"framesToPop",1));let u=$()?.getOptions().enhanceFetchErrorMessages??"always";if(u!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{let h=new URL(a.fetchData.url).host;u==="always"?l.message=`${l.message} (${h})`:$e(l,"__sentry_fetch_url_host__",h)}catch{}throw l})}})}async function fb(e,t){if(e?.body){let n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),i=!0;for(;i;){let s;try{s=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:a}=await r.read();clearTimeout(s),a&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(s)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function pb(e){let t;try{t=e.clone()}catch{return}fb(t,()=>{at("fetch-body-resolved",{endTimestamp:Ce()*1e3,response:e})})}function Zc(e,t){return!!e&&typeof e=="object"&&!!e[t]}function av(e){return typeof e=="string"?e:e?Zc(e,"url")?e.url:e.toString?e.toString():"":""}function mb(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:av(n),method:Zc(r,"method")?String(r.method).toUpperCase():fa(n)&&Zc(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:av(t),method:Zc(t,"method")?String(t.method).toUpperCase():"GET"}}function hb(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(fa(t))return new Headers(t.headers)}catch{}}var cv=j;function ln(){try{return cv.document.location.href}catch{return""}}function as(e,t=5){if(!cv.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}var G=j,qp=0;function Yp(){return qp>0}function Kb(){qp++,setTimeout(()=>{qp--})}function li(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{let o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(co(e))return e}catch{return e}let r=function(...o){j._sentryWrappedDepth=(j._sentryWrappedDepth||0)+1;try{let i=o.map(s=>li(s,t));return e.apply(this,i)}catch(i){throw Kb(),On(s=>{s.addEventProcessor(a=>(t.mechanism&&(Jo(a,void 0,void 0),Pn(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),Ur(i)}),i}finally{j._sentryWrappedDepth=(j._sentryWrappedDepth||0)-1}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}pa(r,e),$e(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function ls(){let e=ln(),{referrer:t}=G.document||{},{userAgent:n}=G.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function tu(e,t){let n=nu(e,t),r={type:ek(t),value:tk(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Jb(e,t,n,r){let i=$()?.getOptions().normalizeDepth,s=ok(t),a={__serialized__:ha(t,i)};if(s)return{exception:{values:[tu(e,s)]},extra:a};let l={exception:{values:[{type:lo(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:nk(t,{isUnhandledRejection:r})}]},extra:a};if(n){let c=nu(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function Kp(e,t){return{exception:{values:[tu(e,t)]}}}function nu(e,t){let n=t.stacktrace||t.stack||"",r=Qb(t),o=Zb(t);try{return e(n,r,o)}catch{}return[]}var Xb=/Minified React error #\d+;/i;function Qb(e){return e&&Xb.test(e.message)?1:0}function Zb(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Rv(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function ek(e){let t=e?.name;return!t&&Rv(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function tk(e){let t=e?.message;return Rv(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Kc(t.error):Kc(e):"No error message"}function Nv(e,t,n,r){let o=n?.syntheticException||void 0,i=ru(e,t,o,r);return Pn(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),Sr(i)}function bv(e,t,n="info",r,o){let i=r?.syntheticException||void 0,s=Jp(e,t,i,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),Sr(s)}function ru(e,t,n,r,o){let i;if($i(t)&&t.error)return Kp(e,t.error);if(da(t)||Sc(t)){let s=t;if("stack"in t){i=Kp(e,t);let a=i.exception?.values?.[0];if(r&&n&&a&&!a.stacktrace){let l=nu(e,n);l.length&&(a.stacktrace={frames:l},Pn(i,{synthetic:!0}))}}else{let a=s.name||(da(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;i=Jp(e,l,n,r),Jo(i,l)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return kn(t)?Kp(e,t):An(t)||lo(t)?(i=Jb(e,t,n,o),Pn(i,{synthetic:!0}),i):(i=Jp(e,t,n,r),Jo(i,`${t}`,void 0),Pn(i,{synthetic:!0}),i)}function Jp(e,t,n,r){let o={};if(r&&n){let i=nu(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),Pn(o,{synthetic:!0})}if(ao(t)){let{__sentry_template_string__:i,__sentry_template_values__:s}=t;return o.logentry={message:i,params:s},o}return o.message=t,o}function nk(e,{isUnhandledRejection:t}){let n=vc(e),r=t?"promise rejection":"exception";return $i(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:lo(e)?`Event \`${rk(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function rk(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function ok(e){return Object.values(e).find(t=>t instanceof Error)}var ou=class extends ja{constructor(t){let n=ik(t),r=G.SENTRY_SDK_SOURCE||kp();Wa(n,"browser",["browser"],r),super(n);let{userInfo:o}=this.getDataCollectionOptions();n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:o?"auto":"never",...n._metadata.sdk.settings});let{sendClientReports:i,enableLogs:s,_experiments:a,enableMetrics:l}=this._options,c=l??a?.enableMetrics??!0;G.document&&(i||s||c)&&G.document.addEventListener("visibilitychange",()=>{G.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&rs(this),c&&Ba(this))}),o&&this.on("beforeSendSession",Up)}eventFromException(t,n){return Nv(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return bv(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}};function ik(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:G.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var _t=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var W=j;var sk=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",_r=(e,t,n,r)=>{let o,i;return s=>{t.value>=0&&(s||r)&&(i=t.value-(o??0),(i||o===void 0)&&(o=t.value,t.delta=i,t.rating=sk(t.value,n),e(t)))}};var Br=(e=!0)=>{let t=W.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t};var Un=()=>Br()?.activationStart??0;function Fn(e,t,n){W.document&&W.addEventListener(e,t,n)}function ci(e,t,n){W.document&&W.removeEventListener(e,t,n)}var cs=-1,kv=new Set,ak=()=>W.document?.visibilityState==="hidden"&&!W.document?.prerendering?0:1/0,iu=e=>{if(lk(e)&&cs>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(let t of kv)t();isFinite(cs)||(cs=e.type==="visibilitychange"?e.timeStamp:0,ci("prerenderingchange",iu,!0))}},vr=()=>{if(W.document&&cs<0){let e=Un();cs=(W.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??ak(),Fn("visibilitychange",iu,!0),Fn("pagehide",iu,!0),Fn("prerenderingchange",iu,!0)}return{get firstHiddenTime(){return cs},onHidden(e){kv.add(e)}}};function lk(e){return e.type==="pagehide"||W.document?.visibilityState==="hidden"}var Av=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var Er=(e,t=-1)=>{let n=Br(),r="navigate";return n&&(W.document?.prerendering||Un()>0?r="prerender":W.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:Av(),navigationType:r}};var Xp=new WeakMap;function us(e,t){try{return Xp.get(e)||Xp.set(e,new t),Xp.get(e)}catch{return new t}}var su=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;let n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}};var Bn=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}};var ds=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var _o=e=>{W.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};var ck=[1800,3e3],Mv=(e,t={})=>{_o(()=>{let n=vr(),r=Er("FCP"),o,s=Bn("paint",a=>{for(let l of a)l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Un(),0),r.entries.push(l),o(!0)))});s&&(o=_r(e,r,ck,t.reportAllChanges))})};var uk=[.1,.25],Pv=(e,t={})=>{Mv(ds(()=>{let n=Er("CLS",0),r,o=vr(),i=us(t,su),s=l=>{for(let c of l)i._processEntry(c);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},a=Bn("layout-shift",s);a&&(r=_r(e,n,uk,t.reportAllChanges),o.onHidden(()=>{s(a.takeRecords()),r(!0)}),W?.setTimeout?.(r))}))};var Ov=0,Qp=1/0,au=0,dk=e=>{e.forEach(t=>{t.interactionId&&(Qp=Math.min(Qp,t.interactionId),au=Math.max(au,t.interactionId),Ov=au?(au-Qp)/7+1:0)})},Zp,em=()=>Zp?Ov:performance.interactionCount||0,Lv=()=>{"interactionCount"in performance||Zp||(Zp=Bn("event",dk,{type:"event",buffered:!0,durationThreshold:0}))};var tm=10,Dv=0,fk=()=>em()-Dv,lu=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){Dv=em(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let t=Math.min(this._longestInteractionList.length-1,Math.floor(fk()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;let n=this._longestInteractionList.at(-1),r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<tm||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,i)=>i._latency-o._latency),this._longestInteractionList.length>tm){let o=this._longestInteractionList.splice(tm);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var cu=e=>{let t=W.requestIdleCallback||W.setTimeout;W.document?.visibilityState==="hidden"?e():(e=ds(e),Fn("visibilitychange",e,{once:!0,capture:!0}),Fn("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),ci("visibilitychange",e,{capture:!0}),ci("pagehide",e,{capture:!0})}))};var pk=[200,500],mk=40,Uv=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=vr();_o(()=>{Lv();let r=Er("INP"),o,i=us(t,lu),s=l=>{cu(()=>{for(let u of l)i._processEntry(u);let c=i._estimateP98LongestInteraction();c&&c._latency!==r.value&&(r.value=c._latency,r.entries=c.entries,o())})},a=Bn("event",s,{durationThreshold:t.durationThreshold??mk});o=_r(e,r,pk,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),o(!0)}))})};var uu=class{_processEntry(t){this._onBeforeProcessingEntry?.(t)}};var hk=[2500,4e3],Fv=(e,t={})=>{_o(()=>{let n=vr(),r=Er("LCP"),o,i=us(t,uu),s=l=>{t.reportAllChanges||(l=l.slice(-1));for(let c of l)i._processEntry(c),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-Un(),0),r.entries=[c],o())},a=Bn("largest-contentful-paint",s);if(a){o=_r(e,r,hk,t.reportAllChanges);let l=ds(()=>{s(a.takeRecords()),a.disconnect(),o(!0)}),c=u=>{u.isTrusted&&(cu(l),ci(u.type,c,{capture:!0}))};for(let u of["keydown","click","visibilitychange"])Fn(u,c,{capture:!0})}})};var gk=[800,1800],nm=e=>{W.document?.prerendering?_o(()=>nm(e)):W.document?.readyState!=="complete"?addEventListener("load",()=>nm(e),!0):setTimeout(e)},Bv=(e,t={})=>{let n=Er("TTFB"),r=_r(e,n,gk,t.reportAllChanges);nm(()=>{let o=Br();o&&(n.value=Math.max(o.responseStart-Un(),0),n.entries=[o],r(!0))})};var qa={},du={},Hv,$v,zv,jv;function Hr(e,t=!1){return fu("cls",e,yk,Hv,t)}function $r(e,t=!1){return fu("lcp",e,Sk,$v,t)}function rm(e){return fu("ttfb",e,_k,zv)}function ui(e){return fu("inp",e,vk,jv)}function nr(e,t){return Wv(e,t),du[e]||(Ek(e),du[e]=!0),Gv(e,t)}function Ya(e,t){let n=qa[e];if(n?.length)for(let r of n)try{r(t)}catch(o){_t&&x.error(`Error while triggering instrumentation handler.
|
|
25
|
-
Type: ${e}
|
|
26
|
-
Name: ${Wt(r)}
|
|
27
|
-
Error:`,o)}}function yk(){return Pv(e=>{Ya("cls",{metric:e}),Hv=e},{reportAllChanges:!0})}function Sk(){return Fv(e=>{Ya("lcp",{metric:e}),$v=e},{reportAllChanges:!0})}function _k(){return Bv(e=>{Ya("ttfb",{metric:e}),zv=e})}function vk(){return Uv(e=>{Ya("inp",{metric:e}),jv=e})}function fu(e,t,n,r,o=!1){Wv(e,t);let i;return du[e]||(i=n(),du[e]=!0),r&&t({metric:r}),Gv(e,t,o?i:void 0)}function Ek(e){let t={};e==="event"&&(t.durationThreshold=0),Bn(e,n=>{Ya(e,{entries:n})},t)}function Wv(e,t){qa[e]=qa[e]||[],qa[e].push(t)}function Gv(e,t,n){return()=>{n&&n();let r=qa[e];if(!r)return;let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function Vv(e){return"duration"in e}var Tk=80;function Ae(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],i=0,s=0,a=" > ",l=a.length,c,u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||Tk;for(;n&&i++<r&&(c=Ik(n,u),!(c==="html"||i>1&&s+o.length*l+c.length>=d));)o.push(c),s+=c.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function Ik(e,t){let n=e,r=[];if(!n?.tagName)return"";if(typeof HTMLElement<"u"&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=t?.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(o?.length)o.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let i=n.className;if(i&&Ot(i)){let s=i.split(/\s+/);for(let a of s)r.push(`.${a}`)}}for(let i of["aria-label","type","name","title","alt"]){let s=n.getAttribute(i);s&&r.push(`[${i}="${s}"]`)}return r.join("")}var qv=e=>{let t=n=>{(n.type==="pagehide"||W.document?.visibilityState==="hidden")&&e(n)};Fn("visibilitychange",t,{capture:!0,once:!0}),Fn("pagehide",t,{capture:!0,once:!0})};function pu(e){return typeof e=="number"&&isFinite(e)}function zr(e,t,n,{...r}){let o=X(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Qi(e,()=>{let i=St({startTime:t,...r});return i&&i.end(n),i})}function fs(e){let t=$();if(!t)return;let{name:n,transaction:r,attributes:o,startTime:i}=e,{release:s,environment:a}=t.getOptions(),{userInfo:l}=t.getDataCollectionOptions(),u=t.getIntegrationByName("Replay")?.getReplayId(),d=K(),p=d.getUser(),h=p!==void 0?p.email||p.id||p.ip_address:void 0,m;try{m=d.getScopeData().contexts.profile.profile_id}catch{}let _={release:s,environment:a,user:h||void 0,profile_id:m||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":W.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return St({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function jr(){return W.addEventListener&&W.performance}function be(e){return e/1e3}function Yv(e){let t="unknown",n="unknown",r="";for(let o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function di(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function fi(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}qv(()=>{o("pagehide")});let i=e.on("beforeStartNavigationSpan",(a,l)=>{l?.isRedirect||(o("navigation"),i(),s())}),s=e.on("afterStartPageLoadSpan",a=>{n=a,s()})}function Kv(e){let t=0,n;if(!di("layout-shift"))return;let r=Hr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);fi(e,(o,i)=>{wk(t,n,i,o),r()})}function wk(e,t,n,r){_t&&x.log(`Sending CLS span (${e})`);let o=t?be((Oe()||0)+t.startTime):Ce(),i=K().getScopeData().transactionName,s=t?Ae(t.sources[0]?.node):"Layout shift",a={[Se]:"auto.http.browser.cls",[ze]:"ui.webvital.cls",[Ut]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((c,u)=>{a[`cls.source.${u+1}`]=Ae(c.node)});let l=fs({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("cls",{[er]:"",[tr]:e}),l.end(o))}var Ck=6e4;function pi(e){return e!=null&&e>0&&e<=Ck}function Jv(e){let t=0,n;if(!di("largest-contentful-paint"))return;let r=$r(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!pi(o.value)||(t=o.value,n=i)},!0);fi(e,(o,i)=>{xk(t,n,i,o),r()})}function xk(e,t,n,r){if(!pi(e))return;_t&&x.log(`Sending LCP span (${e})`);let o=be((Oe()||0)+(t?.startTime||0)),i=K().getScopeData().transactionName,s=t?Ae(t.element):"Largest contentful paint",a={[Se]:"auto.http.browser.lcp",[ze]:"ui.webvital.lcp",[Ut]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Ae(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));let l=fs({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[er]:"millisecond",[tr]:e}),l.end(o))}function Hn(e){return e&&((Oe()||performance.timeOrigin)+e)/1e3}function Ka(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=Yv(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return Oe()||jr()?.timeOrigin?Rk({...t,"http.request.redirect_start":Hn(e.redirectStart),"http.request.redirect_end":Hn(e.redirectEnd),"http.request.worker_start":Hn(e.workerStart),"http.request.fetch_start":Hn(e.fetchStart),"http.request.domain_lookup_start":Hn(e.domainLookupStart),"http.request.domain_lookup_end":Hn(e.domainLookupEnd),"http.request.connect_start":Hn(e.connectStart),"http.request.secure_connection_start":Hn(e.secureConnectionStart),"http.request.connection_end":Hn(e.connectEnd),"http.request.request_start":Hn(e.requestStart),"http.request.response_start":Hn(e.responseStart),"http.request.response_end":Hn(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Rk(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var Nk=2147483647,Xv=0,qt={},cn,hu;function om({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=jr();if(r&&Oe()){r.mark&&W.performance.mark("sentry-tracing-init");let o=t?Jv(n):t===!1?kk():void 0,i=e?Kv(n):e===!1?bk():void 0,s=Ak();return()=>{s(),o?.(),i?.()}}return()=>{}}function im(){nr("longtask",({entries:e})=>{let t=Ne();if(!t)return;let{op:n,start_timestamp:r}=X(t);for(let o of e){let i=be(Oe()+o.startTime),s=be(o.duration);n==="navigation"&&r&&i<r||zr(t,i,i+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Se]:"auto.ui.browser.metrics"}})}})}function sm(){new PerformanceObserver(t=>{let n=Ne();if(n)for(let r of t.getEntries()){if(!r.scripts[0])continue;let o=be(Oe()+r.startTime),{start_timestamp:i,op:s}=X(n);if(s==="navigation"&&i&&o<i)continue;let a=be(r.duration),l={[Se]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:u,invokerType:d,sourceURL:p,sourceFunctionName:h,sourceCharPosition:m}=c;l["browser.script.invoker"]=u,l["browser.script.invoker_type"]=d,p&&(l["code.filepath"]=p),h&&(l["code.function"]=h),m!==-1&&(l["browser.script.source_char_position"]=m),zr(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function am(){nr("event",({entries:e})=>{let t=Ne();if(t){for(let n of e)if(n.name==="click"){let r=be(Oe()+n.startTime),o=be(n.duration),i={name:Ae(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Se]:"auto.ui.browser.metrics"}},s=as(n.target);s&&(i.attributes["ui.component_name"]=s),zr(t,r,r+o,i)}}})}function bk(){return Hr(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(qt.cls={value:e.value,unit:""},hu=t)},!0)}function kk(){return $r(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!pi(e.value)||(qt.lcp={value:e.value,unit:"millisecond"},cn=t)},!0)}function Ak(){return rm(({metric:e})=>{e.entries[e.entries.length-1]&&(qt.ttfb={value:e.value,unit:"millisecond"})})}function lm(e,t){let n=jr(),r=Oe();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:s,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:l}=t,c=be(r),u=n.getEntries(),{op:d,start_timestamp:p}=X(e);if(u.slice(Xv).forEach(h=>{let m=be(h.startTime),_=be(Math.max(0,h.duration));if(!(d==="navigation"&&p&&c+m<p))switch(h.entryType){case"navigation":{Lk(e,h,c);break}case"mark":case"paint":case"measure":{Pk(e,h,m,_,c,i);let T=vr(),y=h.startTime<T.firstHiddenTime;h.name==="first-paint"&&y&&(qt.fp={value:h.startTime,unit:"millisecond"}),h.name==="first-contentful-paint"&&y&&(qt.fcp={value:h.startTime,unit:"millisecond"});break}case"resource":{Fk(e,h,h.name,m,_,c,s);break}}}),Xv=Math.max(u.length-1,0),Bk(e,o),d==="pageload"){if(zk(qt),o){let h=(m,_,T)=>{let y=T??`browser.web_vital.${m}.value`;e.setAttribute(y,_),_t&&x.log("Setting web vital attribute",{[y]:_},"on pageload span")};["ttfb","fp","fcp"].forEach(m=>{qt[m]&&h(m,qt[m].value)}),qt["ttfb.requestTime"]&&h("ttfb.requestTime",qt["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete qt.cls,l||delete qt.lcp,Object.entries(qt).forEach(([h,m])=>{Uc(h,m.value,m.unit)}),Hk(e,t);e.setAttribute(o?"browser.performance.time_origin":"performance.timeOrigin",c),e.setAttribute(o?"browser.performance.navigation.activation_start":"performance.activationStart",Un())}cn=void 0,hu=void 0,qt={}}function Mk(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components \u269B"}catch{return}}function Pk(e,t,n,r,o,i){if(Mk(t)||["mark","measure"].includes(t.entryType)&&Ct(t.name,i))return;let s=Br(!1),a=be(s?s.requestStart:0),l=o+Math.max(n,a),c=o+n,u=c+r,d={[Se]:"auto.resource.browser.metrics"};l!==c&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=l),Ok(d,t),l<=u&&zr(e,l,u,{name:t.name,op:t.entryType,attributes:d})}function Ok(e,t){try{let n=t.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&nn(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(nn(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Lk(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{mu(e,t,r,n)}),mu(e,t,"secureConnection",n,"TLS/SSL"),mu(e,t,"fetch",n,"cache"),mu(e,t,"domainLookup",n,"DNS"),Uk(e,t,n)}function mu(e,t,n,r,o=n){let i=Dk(n),s=t[i],a=t[`${n}Start`];!a||!s||zr(e,r+be(a),r+be(s),{op:`browser.${o}`,name:t.name,attributes:{[Se]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Dk(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Uk(e,t,n){let r=n+be(t.requestStart),o=n+be(t.responseEnd),i=n+be(t.responseStart);t.responseEnd&&(zr(e,r,o,{op:"browser.request",name:t.name,attributes:{[Se]:"auto.ui.browser.metrics"}}),zr(e,i,o,{op:"browser.response",name:t.name,attributes:{[Se]:"auto.ui.browser.metrics"}}))}function Fk(e,t,n,r,o,i,s){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(s?.includes(a))return;let l={[Se]:"auto.resource.browser.metrics"},c=Ln(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(W.location.origin),$k(t,l,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);let u={...l,...Ka(t)},d=i+r,p=d+o;zr(e,d,p,{name:n.replace(W.location.origin,""),op:a,attributes:u})}function Bk(e,t){let n=W.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),pu(r.rtt)&&(qt["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),pu(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),pu(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function Hk(e,t){cn&&t.recordLcpOnPageloadSpan&&(cn.element&&e.setAttribute("lcp.element",Ae(cn.element)),cn.id&&e.setAttribute("lcp.id",cn.id),cn.url&&e.setAttribute("lcp.url",cn.url.trim().slice(0,200)),cn.loadTime!=null&&e.setAttribute("lcp.loadTime",cn.loadTime),cn.renderTime!=null&&e.setAttribute("lcp.renderTime",cn.renderTime),e.setAttribute("lcp.size",cn.size)),hu?.sources&&t.recordClsOnPageloadSpan&&hu.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ae(n.node)))}function $k(e,t,n){n.forEach(([r,o])=>{let i=e[r];i!=null&&(typeof i=="number"&&i<Nk||typeof i=="string")&&(t[o]=i)})}function zk(e){let t=Br(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var cm=[],Ja=new Map,ps=new Map,um=60;function dm(){if(jr()&&Oe()){let t=jk();return()=>{t()}}return()=>{}}var ms={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"};function jk(){return ui(Wk)}var Wk=({metric:e})=>{if(e.value==null)return;let t=be(e.value);if(t>um)return;let n=e.entries.find(m=>m.duration===e.value&&ms[m.name]);if(!n)return;let{interactionId:r}=n,o=ms[n.name],i=be(Oe()+n.startTime),s=Ne(),a=s?Ie(s):void 0,l=r!=null?Ja.get(r):void 0,c=l?.span||a,u=c?X(c).description:K().getScopeData().transactionName,d=l?.elementName||Ae(n.target),p={[Se]:"auto.http.browser.inp",[ze]:`ui.interaction.${o}`,[Ut]:n.duration},h=fs({name:d,transaction:u,attributes:p,startTime:i});h&&(h.addEvent("inp",{[er]:"millisecond",[tr]:e.value}),h.end(i+t))};function Qv(e){return e!=null?Ja.get(e):void 0}function fm(){let e=Object.keys(ms);Dn()&&e.forEach(o=>{W.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){let i=o.target;if(!i)return;let s=Ae(i),a=Math.round(o.timeStamp);if(ps.set(a,s),ps.size>50){let l=ps.keys().next().value;l!==void 0&&ps.delete(l)}}function n(o){let i=Math.round(o.startTime),s=ps.get(i);if(!s)for(let a=-5;a<=5;a++){let l=ps.get(i+a);if(l){s=l;break}}return s||"<unknown>"}let r=({entries:o})=>{let i=Ne(),s=i&&Ie(i);o.forEach(a=>{if(!Vv(a))return;let l=a.interactionId;if(l==null||Ja.has(l))return;let c=a.target?Ae(a.target):n(a);if(cm.length>10){let u=cm.shift();Ja.delete(u)}cm.push(l),Ja.set(l,{span:s,elementName:c})})};nr("event",r),nr("first-input",r)}function pm(e){let{name:t,op:n,origin:r,metricName:o,value:i,attributes:s,parentSpan:a,reportEvent:l,startTime:c,endTime:u}=e,d=K().getScopeData().transactionName,p={[Se]:r,[ze]:n,[Ut]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":d,"user_agent.original":W.navigator?.userAgent,...s};a&&xa(a).attributes?.[ze]==="pageload"&&(p["sentry.pageload.span_id"]=a.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let h=St({name:t,attributes:p,startTime:c,parentSpan:a});h&&h.end(u??c)}function mm(e){let t=0,n;if(!di("largest-contentful-paint"))return;let r=$r(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!pi(o.value)||(t=o.value,n=i)},!0);fi(e,(o,i,s)=>{Gk(t,n,s,o),r()})}function Gk(e,t,n,r){if(!pi(e))return;_t&&x.log(`Sending LCP span (${e})`);let o=Oe()||0,i=be(o),s=be(o+(t?.startTime||0)),a=t?Ae(t.element):"Largest contentful paint",l={};t?.element&&(l["browser.web_vital.lcp.element"]=Ae(t.element)),t?.id&&(l["browser.web_vital.lcp.id"]=t.id),t?.url&&(l["browser.web_vital.lcp.url"]=t.url),t?.loadTime!=null&&(l["browser.web_vital.lcp.load_time"]=t.loadTime),t?.renderTime!=null&&(l["browser.web_vital.lcp.render_time"]=t.renderTime),t?.size!=null&&(l["browser.web_vital.lcp.size"]=t.size),pm({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:l,parentSpan:n,reportEvent:r,startTime:i,endTime:s})}function hm(e){let t=0,n;if(!di("layout-shift"))return;let r=Hr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);fi(e,(o,i,s)=>{Vk(t,n,s,o),r()})}function Vk(e,t,n,r){_t&&x.log(`Sending CLS span (${e})`);let o=t?be((Oe()||0)+t.startTime):Ce(),i=t?Ae(t.sources[0]?.node):"Layout shift",s={};t?.sources&&t.sources.forEach((a,l)=>{s[`browser.web_vital.cls.source.${l+1}`]=Ae(a.node)}),pm({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:s,parentSpan:n,reportEvent:r,startTime:o})}function gm(){if(!jr()||!Oe())return;ui(({metric:n})=>{if(n.value==null||be(n.value)>um)return;let o=n.entries.find(i=>i.duration===n.value&&ms[i.name]);o&&qk(n.value,o)})}function qk(e,t){_t&&x.log(`Sending INP span (${e})`);let n=be(Oe()+t.startTime),r=be(e),o=ms[t.name],i=Qv(t.interactionId),s=Ne(),a=s?Ie(s):void 0,l=i?.span||a,c=l?xa(l).name:K().getScopeData().transactionName,u=i?.elementName||Ae(t.target);pm({name:u,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[Ut]:t.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var Yk=1e3,Zv,ym,Sm;function Xa(e){Mt("dom",e),Pt("dom",Kk)}function Kk(){if(!W.document)return;let e=at.bind(null,"dom"),t=eE(e,!0);W.document.addEventListener("click",t,!1),W.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=W[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(Ze(o,"addEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let c=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},u=c[s]=c[s]||{refCount:0};if(!u.handler){let d=eE(e);u.handler=d,i.call(this,s,d,l)}u.refCount++}catch{}return i.call(this,s,a,l)}}),Ze(o,"removeEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let c=this.__sentry_instrumentation_handlers__||{},u=c[s];u&&(u.refCount--,u.refCount<=0&&(i.call(this,s,u.handler,l),u.handler=void 0,delete c[s]),Object.keys(c).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,l)}}))})}function Jk(e){if(e.type!==ym)return!1;try{if(!e.target||e.target._sentryId!==Sm)return!1}catch{}return!0}function Xk(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function eE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=Qk(n);if(Xk(n.type,r))return;$e(n,"_sentryCaptured",!0),r&&!r._sentryId&&$e(r,"_sentryId",et());let o=n.type==="keypress"?"input":n.type;Jk(n)||(e({event:n,name:o,global:t}),ym=n.type,Sm=r?r._sentryId:void 0),clearTimeout(Zv),Zv=W.setTimeout(()=>{Sm=void 0,ym=void 0},Yk)}}function Qk(e){try{return e.target}catch{return null}}var gu;function Wr(e){let t="history";Mt(t,e),Pt(t,Zk)}function Zk(){if(W.addEventListener("popstate",()=>{let t=W.location.href,n=gu;if(gu=t,n===t)return;at("history",{from:n,to:t})}),!Gp())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=gu,i=eA(String(r));if(gu=i,o===i)return t.apply(this,n);at("history",{from:o,to:i})}return t.apply(this,n)}}Ze(W.history,"pushState",e),Ze(W.history,"replaceState",e)}function eA(e){try{return new URL(e,W.location.origin).toString()}catch{return e}}var yu={};function Su(e){let t=yu[e];if(t)return t;let n=W[e];if(Va(n))return yu[e]=n.bind(W);let r=W.document;if(r&&typeof r.createElement=="function")try{let o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);let i=o.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(o)}catch(o){_t&&x.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(yu[e]=n.bind(W))}function _m(e){yu[e]=void 0}function mi(...e){return Su("setTimeout")(...e)}var rr="__sentry_xhr_v3__";function Qa(e){Mt("xhr",e),Pt("xhr",tA)}function tA(){if(!W.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,i=Ce()*1e3,s=Ot(r[0])?r[0].toUpperCase():void 0,a=nA(r[1]);if(!s||!a)return t.apply(n,r);n[rr]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let l=()=>{let c=n[rr];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}let u={endTimestamp:Ce()*1e3,startTimestamp:i,xhr:n,virtualError:o};at("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,d){return l(),c.apply(u,d)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,d){let[p,h]=d,m=u[rr];return m&&Ot(p)&&Ot(h)&&(m.request_headers[p.toLowerCase()]=h),c.apply(u,d)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){let o=n[rr];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:Ce()*1e3,xhr:n};return at("xhr",i),t.apply(n,r)}})}function nA(e){if(Ot(e))return e;try{return e.toString()}catch{}}var rA=Symbol.for("sentry__originalRequestBody");function _u(e){return new URLSearchParams(e).toString()}function vu(e,t=x){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[_u(e)];if(!e)return[void 0]}catch(n){return _t&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return _t&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Eu(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){let n=e[0][rA];return n!==void 0?n:void 0}}function Za(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return _t&&x.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
28
|
-
`).reduce((n,r)=>{let[o,i]=r.split(": ");return i&&(n[o.toLowerCase()]=i),n},{}):{}}function vm(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var oA=40;function tE(e,t=Su("fetch")){let n=0,r=0;async function o(i){let s=i.body.length;n+=s,r++;let a={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let l=await t(e.url,a);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw _m("fetch"),l}finally{n-=s,r--}}return jc(e,o,ai(e.bufferSize||oA))}var Ye=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var iA=30;var sA=50;function Em(e,t,n,r){let o={filename:e,function:t==="<anonymous>"?"?":t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}var aA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,lA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,cA=/\((\S*)(?::(\d+))(?::(\d+))\)/,uA=/at (.+?) ?\(data:(.+?),/,dA=e=>{let t=e.match(uA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=aA.exec(e);if(n){let[,o,i,s]=n;return Em(o,"?",+i,+s)}let r=lA.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=cA.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[i,s]=rE(r[1]||"?",r[2]);return Em(s,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},fA=[iA,dA],pA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,mA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,hA=e=>{let t=pA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=mA.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],o=t[1]||"?";return[o,r]=rE(o,r),Em(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},gA=[sA,hA];var yA=[fA,gA],nE=sa(...yA),rE=(e,t)=>{let n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};var Tu=1024,SA="Breadcrumbs",_A=((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:SA,setup(n){t.console&&zp(TA(n)),t.dom&&Xa(EA(n,t.dom)),t.xhr&&Qa(IA(n)),t.fetch&&yo(wA(n)),t.history&&Wr(CA(n)),t.sentry&&n.on("beforeSendEvent",vA(n))}}}),oE=_A;function vA(e){return function(n){$()===e&&vn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Zn(n)},{event:n})}}function EA(e,t){return function(r){if($()!==e)return;let o,i,s=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Tu&&(Ye&&x.warn(`\`dom.maxStringLength\` cannot exceed ${Tu}, but a value of ${a} was configured. Sentry will use ${Tu} instead.`),a=Tu),typeof s=="string"&&(s=[s]);try{let c=r.event,u=xA(c)?c.target:c;o=Ae(u,{keyAttrs:s,maxStringLength:a}),i=as(u)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${r.name}`,message:o};i&&(l.data={"ui.component_name":i}),vn(l,{event:r.event,name:r.name,global:r.global})}}function TA(e){return function(n){if($()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:ss(n.level),message:ga(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${ga(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;vn(r,{input:n.args,level:n.level})}}function IA(e){return function(n){if($()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[rr];if(!r||!o||!i)return;let{method:s,url:a,status_code:l,body:c}=i,u={method:s,url:a,status_code:l},d={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},p={category:"xhr",data:u,type:"http",level:Qc(l)};e.emit("beforeOutgoingRequestBreadcrumb",p,d),vn(p,d)}}function wA(e){return function(n){if($()!==e)return;let{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){let i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},s={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",s,i),vn(s,i)}else{let i=n.response,s={...n.fetchData,status_code:i?.status},a={input:n.args,response:i,startTimestamp:r,endTimestamp:o},l={category:"fetch",data:s,type:"http",level:Qc(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),vn(l,a)}}}function CA(e){return function(n){if($()!==e)return;let r=n.from,o=n.to,i=Ln(G.location.href),s=r?Ln(r):void 0,a=Ln(o);s?.path||(s=i),i.protocol===a.protocol&&i.host===a.host&&(o=a.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),vn({category:"navigation",data:{from:r,to:o}})}}function xA(e){return!!e&&!!e.target}var RA="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".split(","),NA="BrowserApiErrors",bA=((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:NA,setupOnce(){t.setTimeout&&Ze(G,"setTimeout",iE),t.setInterval&&Ze(G,"setInterval",iE),t.requestAnimationFrame&&Ze(G,"requestAnimationFrame",kA),t.XMLHttpRequest&&"XMLHttpRequest"in G&&Ze(XMLHttpRequest.prototype,"send",AA);let n=t.eventTarget;n&&(Array.isArray(n)?n:RA).forEach(o=>MA(o,t))}}}),sE=bA;function iE(e){return function(...t){let n=t[0];return t[0]=li(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Wt(e)}`}}),e.apply(this,t)}}function kA(e){return function(t){return e.apply(this,[li(t,{mechanism:{data:{handler:Wt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function AA(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&Ze(n,o,function(i){let s={mechanism:{data:{handler:Wt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=co(i);return a&&(s.mechanism.data.handler=Wt(a)),li(i,s)})}),e.apply(this,t)}}function MA(e,t){let r=G[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ze(r,"addEventListener",function(o){return function(i,s,a){try{PA(s)&&(s.handleEvent=li(s.handleEvent,{mechanism:{data:{handler:Wt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&OA(this,i,s),o.apply(this,[i,li(s,{mechanism:{data:{handler:Wt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),Ze(r,"removeEventListener",function(o){return function(i,s,a){try{let l=s.__sentry_wrapped__;l&&o.call(this,i,l,a)}catch{}return o.call(this,i,s,a)}}))}function PA(e){return typeof e.handleEvent=="function"}function OA(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var aE=(e={})=>{let t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof G.document>"u"){Ye&&x.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}ns({ignoreDuration:!0}),si();let n=Ve(),r=n.getUser();n.addScopeListener(o=>{let i=o.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(si(),r=i)}),t==="route"&&Wr(({from:o,to:i})=>{o!==i&&(ns({ignoreDuration:!0}),si())})}}};var LA="CultureContext",DA=(()=>({name:LA,preprocessEvent(e){let t=lE();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=lE();t&&ho(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),cE=DA;function lE(){try{let e=G.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var UA="GlobalHandlers",FA=((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:UA,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(BA(n),uE("onerror")),t.onunhandledrejection&&(HA(n),uE("onunhandledrejection"))}}}),dE=FA;function BA(e){ca(t=>{let{stackParser:n,attachStacktrace:r}=fE();if($()!==e||Yp())return;let{msg:o,url:i,line:s,column:a,error:l}=t,c=jA(ru(n,l||o,void 0,r,!1),i,s,a);c.level="error",ts(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function HA(e){ua(t=>{let{stackParser:n,attachStacktrace:r}=fE();if($()!==e||Yp())return;let o=$A(t),i=nn(o)?zA(o):ru(n,o,void 0,r,!0);i.level="error",ts(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function $A(e){if(nn(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function zA(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function jA(e,t,n,r){let o=e.exception=e.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[];return l.length===0&&l.push({colno:r,lineno:n,filename:WA(t)??ln(),function:"?",in_app:!0}),e}function uE(e){Ye&&x.log(`Global Handler attached: ${e}`)}function fE(){return $()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function WA(e){if(!(!Ot(e)||e.length===0))return e.startsWith("data:")?`<${Ft(e,!1)}>`:e}var pE=()=>({name:"HttpContext",preprocessEvent(e){if(!G.navigator&&!G.location&&!G.document)return;let t=ls(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!G.navigator&&!G.location&&!G.document)return;let t=ls();ho(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}});var GA="cause",VA=5,qA="LinkedErrors",YA=((e={})=>{let t=e.limit||VA,n=e.key||GA;return{name:qA,preprocessEvent(r,o,i){let s=i.getOptions();$p(tu,s.stackParser,n,t,r,o)}}}),mE=YA;var KA=/^HTML(\w*)Element$/;function el(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(vm(e)){let t=JA(e);if(KA.test(t))return`[HTMLElement: ${Ae(e)}]`}}function JA(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function hE(){return XA()?(Ye&&wt(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function XA(){if(typeof G.window>"u")return!1;let e=G;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let n=ln();return!(G===G.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function gE(e){return[Yc(),Vc(),jp(),sE(),oE(),dE(),mE(),Jc(),pE(),cE(),aE()]}function Tm(e={}){let t=!e.skipBrowserExtensionCheck&&hE(),n=e.defaultIntegrations==null?gE():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:yc(e.stackParser||nE),integrations:xp({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||tE};return ji(el),Op(ou,r)}function Iu(e={}){let t=G.document,n=t?.head||t?.body;if(!n){Ye&&x.error("[showReportDialog] Global document not defined");return}let r=K(),i=$()?.getDsn();if(!i){Ye&&x.error("[showReportDialog] DSN not configured");return}let s={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||La()},a=G.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=wp(i,s);let{onLoad:l,onClose:c}=s;if(l&&(a.onload=l),c){let u=d=>{if(d.data==="__sentry_reportdialog_closed__")try{c()}finally{G.removeEventListener("message",u)}};G.addEventListener("message",u)}n.appendChild(a)}var Ue=j,Qm="sentryReplaySession",QA="replay_event",Zm="Unable to send Replay",ZA=3e5,e1=9e5,t1=5e3,n1=5500,r1=6e4,o1=5e3,i1=3,yE=15e4,wu=5e3,s1=3e3,a1=300,eh=2e7,l1=4999,c1=5e4,SE=36e5,u1=Object.defineProperty,d1=(e,t,n)=>t in e?u1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_E=(e,t,n)=>d1(e,typeof t!="symbol"?t+"":t,n),ct=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ct||{});function f1(e){return e.nodeType===e.ELEMENT_NODE}function rl(e){return e?.host?.shadowRoot===e}function ol(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function p1(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function m1(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(" ")+";"}function bu(e){try{let t=e.rules||e.cssRules;return t?p1(Array.from(t,jE).join("")):null}catch{return null}}function h1(e){let t="";for(let n=0;n<e.style.length;n++){let r=e.style,o=r[n],i=r.getPropertyPriority(o);t+=`${o}:${r.getPropertyValue(o)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function jE(e){let t;if(y1(e))try{t=bu(e.styleSheet)||m1(e)}catch{}else if(S1(e)){let n=e.cssText,r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=h1(e)),r&&(n=g1(n)),r||o)return n}return t||e.cssText}function g1(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function y1(e){return"styleSheet"in e}function S1(e){return"selectorText"in e}var ku=class{constructor(){_E(this,"idNodeMap",new Map),_E(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function _1(){return new ku}function Wu({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function sl({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function Ts(e){return e.toLowerCase()}function Nm(e){return e.toUpperCase()}var vE="__rrweb_original__";function v1(e){let t=e.getContext("2d");if(!t)return!0;let n=50;for(let r=0;r<e.width;r+=n)for(let o=0;o<e.height;o+=n){let i=t.getImageData,s=vE in i?i[vE]:i;if(new Uint32Array(s.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function th(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ts(t):null}function Au(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function WE(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}var EE={};function GE(e){let t=EE[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return EE[e]=r.bind(window)}function bm(...e){return GE("setTimeout")(...e)}function VE(...e){return GE("clearTimeout")(...e)}function qE(e){try{return e.contentDocument}catch{}}function E1(e){try{return e.contentWindow}catch{}}var T1=1,I1=new RegExp("[^a-z0-9-_:]"),al=-2;function nh(){return T1++}function w1(e){if(e instanceof HTMLFormElement)return"form";let t=Ts(e.tagName);return I1.test(t)?"div":t}function C1(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var hs,TE,x1=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,R1=/^(?:[a-z+]+:)?\/\//i,N1=/^www\..*/i,b1=/^(data:)([^,]*),(.*)/i;function k1(e,t){if(!e||t.size===0)return e;try{let n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;let i=o.indexOf(":");if(i===-1){r.push(o);continue}let s=o.slice(0,i).trim();t.has(s)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function Mu(e,t){return(e||"").replace(x1,(n,r,o,i,s,a)=>{let l=o||s||a,c=r||i||"";if(!l)return n;if(R1.test(l)||N1.test(l))return`url(${c}${l}${c})`;if(b1.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${C1(t)+l}${c})`;let u=t.split("/"),d=l.split("/");u.pop();for(let p of d)p!=="."&&(p===".."?u.pop():u.push(p));return`url(${c}${u.join("/")}${c})`})}var A1=/^[^ \t\n\r\u000c]+/,M1=/^[, \t\n\r\u000c]+/;function P1(e,t){if(t.trim()==="")return t;let n=0;function r(i){let s,a=i.exec(t.substring(n));return a?(s=a[0],n+=s.length,s):""}let o=[];for(;r(M1),!(n>=t.length);){let i=r(A1);if(i.slice(-1)===",")i=Ss(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=Ss(e,i);let a=!1;for(;;){let l=t.charAt(n);if(l===""){o.push((i+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){n+=1,o.push((i+s).trim());break}else l==="("&&(a=!0);s+=l,n+=1}}}return o.join(", ")}var IE=new WeakMap;function Ss(e,t){return!t||t.trim()===""?t:Gu(e,t)}function O1(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Gu(e,t){let n=IE.get(e);if(n||(n=e.createElement("a"),IE.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function YE(e,t,n,r,o,i,s){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Ss(e,r);if(n==="xlink:href"&&r[0]!=="#")return Ss(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Ss(e,r);if(n==="srcset")return P1(e,r);if(n==="style"){let a=Mu(r,Gu(e));return s&&s.size>0&&(a=k1(a,s)),a}else if(t==="object"&&n==="data")return Ss(e,r);return typeof i=="function"?i(n,r,o):r}function KE(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function L1(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function D1(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function hi(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:hi(e.parentNode,t,n,r+1)}function _s(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(D1(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Is(e,t,n,r,o,i){try{let s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(s===null)return!1;if(s.tagName==="INPUT"){let c=s.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let a=-1,l=-1;if(i){if(l=hi(s,_s(r,o)),l<0)return!0;a=hi(s,_s(t,n),l>=0?l:1/0)}else{if(a=hi(s,_s(t,n)),a<0)return!1;l=hi(s,_s(r,o),a>=0?a:1/0)}return a>=0?l>=0?a<=l:!0:l>=0?!1:!!i}catch{}return!!i}function U1(e,t,n){let r=E1(e);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let a=bm(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{VE(a),o=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return bm(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function F1(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let i=bm(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{VE(i),r=!0,t()})}function B1(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:m={},maskTextFn:_,maskInputFn:T,dataURLOptions:y={},inlineImages:S,recordCanvas:v,keepIframeSrcFn:w,newlyAddedElement:k=!1,ignoreCSSAttributes:A}=t,I=H1(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ct.Document,childNodes:[],compatMode:e.compatMode}:{type:ct.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ct.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return z1(e,{doc:n,blockClass:o,blockSelector:i,unblockSelector:s,inlineStylesheet:h,maskAttributeFn:l,maskInputOptions:m,maskInputFn:T,dataURLOptions:y,inlineImages:S,recordCanvas:v,keepIframeSrcFn:w,newlyAddedElement:k,rootId:I,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,ignoreCSSAttributes:A});case e.TEXT_NODE:return $1(e,{doc:n,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,maskTextFn:_,maskInputOptions:m,maskInputFn:T,rootId:I});case e.CDATA_SECTION_NODE:return{type:ct.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:ct.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function H1(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function $1(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:s,maskTextFn:a,maskInputOptions:l,maskInputFn:c,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName,p=e.textContent,h=d==="STYLE"?!0:void 0,m=d==="SCRIPT"?!0:void 0,_=d==="TEXTAREA"?!0:void 0;if(h&&p){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(p=bu(e.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,e)}p=Mu(p,Gu(t.doc))}m&&(p="SCRIPT_PLACEHOLDER");let T=Is(e,r,i,o,s,n);if(!h&&!m&&!_&&p&&T&&(p=a?a(p,e.parentElement):p.replace(/[\S]/g,"*")),_&&p&&(l.textarea||T)&&(p=c?c(p,e.parentNode):p.replace(/[\S]/g,"*")),d==="OPTION"&&p){let y=Wu({type:null,tagName:d,maskInputOptions:l});p=sl({isMasked:Is(e,r,i,o,s,y),element:e,value:p,maskInputFn:c})}return{type:ct.Text,textContent:p||"",isStyle:h,rootId:u}}function z1(e,t){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:s,maskInputOptions:a={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:u={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:m=!1,rootId:_,maskTextClass:T,unmaskTextClass:y,maskTextSelector:S,unmaskTextSelector:v,ignoreCSSAttributes:w}=t,k=L1(e,r,o,i),A=w1(e),I={},N=e.attributes.length;for(let R=0;R<N;R++){let U=e.attributes[R];U.name&&!KE(A,U.name,U.value)&&(I[U.name]=YE(n,A,Ts(U.name),U.value,e,l,w))}if(A==="link"&&s){let R=Array.from(n.styleSheets).find(Q=>Q.href===e.href),U=null;R&&(U=bu(R)),U&&(I.rel=null,I.href=null,I.crossorigin=null,I._cssText=Mu(U,R.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let R=bu(e.sheet);R&&(I._cssText=Mu(R,Gu(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){let R=e,U=th(R),Q=Au(R,Nm(A),U),de=R.checked;if(U!=="submit"&&U!=="button"&&Q){let V=Is(R,T,S,y,v,Wu({type:U,tagName:Nm(A),maskInputOptions:a}));I.value=sl({isMasked:V,element:R,value:Q,maskInputFn:c})}de&&(I.checked=de)}if(A==="option"&&(e.selected&&!a.select?I.selected=!0:delete I.selected),A==="canvas"&&p){if(e.__context==="2d")v1(e)||(I.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){let R=e.toDataURL(u.type,u.quality),U=n.createElement("canvas");U.width=e.width,U.height=e.height;let Q=U.toDataURL(u.type,u.quality);R!==Q&&(I.rr_dataURL=R)}}if(A==="img"&&d){hs||(hs=n.createElement("canvas"),TE=hs.getContext("2d"));let R=e,U=R.currentSrc||R.getAttribute("src")||"<unknown-src>",Q=R.crossOrigin,de=()=>{R.removeEventListener("load",de);try{hs.width=R.naturalWidth,hs.height=R.naturalHeight,TE.drawImage(R,0,0),I.rr_dataURL=hs.toDataURL(u.type,u.quality)}catch(V){if(R.crossOrigin!=="anonymous"){R.crossOrigin="anonymous",R.complete&&R.naturalWidth!==0?de():R.addEventListener("load",de);return}else console.warn(`Cannot inline img src=${U}! Error: ${V}`)}R.crossOrigin==="anonymous"&&(Q?I.crossOrigin=Q:R.removeAttribute("crossorigin"))};R.complete&&R.naturalWidth!==0?de():R.addEventListener("load",de)}if((A==="audio"||A==="video")&&(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop)),k){let{width:R,height:U}=e.getBoundingClientRect();I={class:I.class,rr_width:`${R}px`,rr_height:`${U}px`}}A==="iframe"&&!h(I.src)&&(!k&&!qE(e)&&(I.rr_src=I.src),delete I.src);let F;try{customElements.get(A)&&(F=!0)}catch{}return{type:ct.Element,tagName:A,attributes:I,childNodes:[],isSVG:O1(e)||void 0,needBlock:k,rootId:_,isCustom:F}}function De(e){return e==null?"":e.toLowerCase()}function j1(e,t){if(t.comment&&e.type===ct.Comment)return!0;if(e.type===ct.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&WE(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(De(e.attributes.name).match(/^msapplication-tile(image|color)$/)||De(e.attributes.name)==="application-name"||De(e.attributes.rel)==="icon"||De(e.attributes.rel)==="apple-touch-icon"||De(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&De(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(De(e.attributes.property).match(/^(og|twitter|fb):/)||De(e.attributes.name).match(/^(og|twitter):/)||De(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(De(e.attributes.name)==="robots"||De(e.attributes.name)==="googlebot"||De(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(De(e.attributes.name)==="author"||De(e.attributes.name)==="generator"||De(e.attributes.name)==="framework"||De(e.attributes.name)==="publisher"||De(e.attributes.name)==="progid"||De(e.attributes.property).match(/^article:/)||De(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(De(e.attributes.name)==="google-site-verification"||De(e.attributes.name)==="yandex-verification"||De(e.attributes.name)==="csrf-token"||De(e.attributes.name)==="p:domain_verify"||De(e.attributes.name)==="verify-v1"||De(e.attributes.name)==="verification"||De(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function vs(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:m={},maskAttributeFn:_,maskTextFn:T,maskInputFn:y,slimDOMOptions:S,dataURLOptions:v={},inlineImages:w=!1,recordCanvas:k=!1,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N=5e3,onBlockedImageLoad:F,onStylesheetLoad:R,stylesheetLoadTimeout:U=5e3,keepIframeSrcFn:Q=()=>!1,newlyAddedElement:de=!1,ignoreCSSAttributes:V}=t,{preserveWhiteSpace:we=!0}=t,ie=B1(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:_,maskTextFn:T,maskInputFn:y,dataURLOptions:v,inlineImages:w,recordCanvas:k,keepIframeSrcFn:Q,newlyAddedElement:de,ignoreCSSAttributes:V});if(!ie)return console.warn(e,"not serialized"),null;let xe;r.hasNode(e)?xe=r.getId(e):j1(ie,S)||!we&&ie.type===ct.Text&&!ie.isStyle&&!ie.textContent.trim().length?xe=al:xe=nh();let D=Object.assign(ie,{id:xe});if(r.add(e,D),xe===al)return null;A&&A(e);let le=!p;if(D.type===ct.Element){le=le&&!D.needBlock;let q=e.shadowRoot;q&&ol(q)&&(D.isShadowHost=!0)}if((D.type===ct.Document||D.type===ct.Element)&&le){S.headWhitespace&&D.type===ct.Element&&D.tagName==="head"&&(we=!1);let q={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:p,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:_,maskTextFn:T,maskInputFn:y,slimDOMOptions:S,dataURLOptions:v,inlineImages:w,recordCanvas:k,preserveWhiteSpace:we,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onBlockedImageLoad:F,onStylesheetLoad:R,stylesheetLoadTimeout:U,keepIframeSrcFn:Q,ignoreCSSAttributes:V},oe=e.childNodes?Array.from(e.childNodes):[];for(let ce of oe){let ge=vs(ce,q);ge&&D.childNodes.push(ge)}if(f1(e)&&e.shadowRoot)for(let ce of Array.from(e.shadowRoot.childNodes)){let ge=vs(ce,q);ge&&(ol(e.shadowRoot)&&(ge.isShadow=!0),D.childNodes.push(ge))}}if(e.parentNode&&rl(e.parentNode)&&ol(e.parentNode)&&(D.isShadow=!0),D.type===ct.Element&&D.tagName==="iframe"&&!D.needBlock&&U1(e,()=>{let q=qE(e);if(q&&I){let oe=vs(q,{doc:q,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:_,maskTextFn:T,maskInputFn:y,slimDOMOptions:S,dataURLOptions:v,inlineImages:w,recordCanvas:k,preserveWhiteSpace:we,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:R,stylesheetLoadTimeout:U,keepIframeSrcFn:Q,ignoreCSSAttributes:V});oe&&I(e,oe)}},N),D.type===ct.Element&&D.tagName==="img"&&!e.complete&&D.needBlock){let q=e,oe=()=>{if(q.isConnected&&!q.complete&&F)try{let ce=q.getBoundingClientRect();ce.width>0&&ce.height>0&&F(q,D,ce)}catch{}q.removeEventListener("load",oe)};q.isConnected&&q.addEventListener("load",oe)}return D.type===ct.Element&&D.tagName==="link"&&typeof D.attributes.rel=="string"&&(D.attributes.rel==="stylesheet"||D.attributes.rel==="preload"&&typeof D.attributes.href=="string"&&WE(D.attributes.href)==="css")&&F1(e,()=>{if(R){let q=vs(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:m,maskAttributeFn:_,maskTextFn:T,maskInputFn:y,slimDOMOptions:S,dataURLOptions:v,inlineImages:w,recordCanvas:k,preserveWhiteSpace:we,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:R,stylesheetLoadTimeout:U,keepIframeSrcFn:Q,ignoreCSSAttributes:V});q&&R(e,q)}},U),D.type===ct.Element&&delete D.needBlock,D}function W1(e,t){let{mirror:n=new ku,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:i=null,maskAllText:s=!1,maskTextClass:a="rr-mask",unmaskTextClass:l=null,maskTextSelector:c=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:p=!1,recordCanvas:h=!1,maskAllInputs:m=!1,maskAttributeFn:_,maskTextFn:T,maskInputFn:y,slimDOM:S=!1,dataURLOptions:v,preserveWhiteSpace:w,onSerialize:k,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:F,stylesheetLoadTimeout:R,keepIframeSrcFn:U=()=>!1,ignoreCSSAttributes:Q=new Set([])}=t||{};return vs(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:s,maskTextClass:a,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:m===!0?{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}:m===!1?{}:m,maskAttributeFn:_,maskTextFn:T,maskInputFn:y,slimDOMOptions:S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:v,inlineImages:p,recordCanvas:h,preserveWhiteSpace:w,onSerialize:k,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:F,stylesheetLoadTimeout:R,keepIframeSrcFn:U,newlyAddedElement:!1,ignoreCSSAttributes:Q})}function Kt(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var gs=`Please stop import mirror directly. Instead of that,\r
|
|
29
|
-
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
30
|
-
or you can use record.mirror to access the mirror instance during recording.`,wE={map:{},getId(){return console.error(gs),-1},getNode(){return console.error(gs),null},removeNodeFromMap(){console.error(gs)},has(){return console.error(gs),!1},reset(){console.error(gs)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(wE=new Proxy(wE,{get(e,t,n){return t==="map"&&console.error(gs),Reflect.get(e,t,n)}}));function ll(e,t,n={}){let r=null,o=0;return function(...i){let s=Date.now();!o&&n.leading===!1&&(o=s);let a=t-(s-o),l=this;a<=0||a>t?(r&&(J1(r),r=null),o=s,e.apply(l,i)):!r&&n.trailing!==!1&&(r=Vu(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(l,i)},a))}}function JE(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){Vu(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>JE(e,t,i||{},!0)}function rh(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}var Pu=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Pu=()=>new Date().getTime());function XE(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function QE(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ZE(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function eT(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function En(e,t,n,r,o){if(!e)return!1;let i=eT(e);if(!i)return!1;let s=_s(t,n);if(!o){let c=r&&i.matches(r);return s(i)&&!c}let a=hi(i,s),l=-1;return a<0?!1:(r&&(l=hi(i,_s(null,r))),a>-1&&l<0?!0:a<l)}function G1(e,t){return t.getId(e)!==-1}function Im(e,t){return t.getId(e)===al}function tT(e,t){if(rl(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?tT(e.parentNode,t):!0:!0}function km(e){return!!e.changedTouches}function V1(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=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function nT(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function rT(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Am(e){return!!e?.shadowRoot}var Mm=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function oT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function q1(e){let t=e,n;for(;n=oT(t);)t=n;return t}function Y1(e){let t=e.ownerDocument;if(!t)return!1;let n=q1(e);return t.contains(n)}function iT(e){let t=e.ownerDocument;return t?t.contains(e)||Y1(e):!1}var CE={};function oh(e){let t=CE[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return CE[e]=r.bind(window)}function K1(...e){return oh("requestAnimationFrame")(...e)}function Vu(...e){return oh("setTimeout")(...e)}function J1(...e){return oh("clearTimeout")(...e)}var ae=(e=>(e[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))(ae||{}),ne=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(ne||{}),Yt=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Yt||{}),Gr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Gr||{}),ys=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ys||{}),il;function X1(e){il=e}function Q1(){il=void 0}var _e=e=>il?((...n)=>{try{return e(...n)}catch(r){if(il&&il(r)===!0)return()=>{};throw r}}):e,xE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Z1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(tl=0;tl<xE.length;tl++)Z1[xE.charCodeAt(tl)]=tl;var tl,Ou=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function ih(e){try{return e.contentDocument}catch{}}function cl(e){try{return e.contentWindow}catch{}}var Pm=class{constructor(t){this.doc=t,this.unattachedDoc=null}parse(t){return this.parseWithConstructableStylesheet(t)||this.parseWithDetachedElement(t)}parseWithConstructableStylesheet(t){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{let n=new CSSStyleSheet;n.replaceSync(`x { ${t} }`);let r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch{return null}}parseWithDetachedElement(t){let n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",t),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function RE(e){return"__ln"in e}var Om=class{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&RE(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&RE(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},NE=(e,t)=>`${e}@${t}`,Lm=class{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=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new Om,o=l=>{let c=l,u=al;for(;u===al;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},i=l=>{if(!l.parentNode||!iT(l))return;let c=rl(l.parentNode)?this.mirror.getId(oT(l)):this.mirror.getId(l.parentNode),u=o(l);if(c===-1||u===-1)return r.addNode(l);let d=vs(l,{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:p=>{nT(p,this.mirror)&&!En(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),rT(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Am(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,h)=>{if(En(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,h);let m=cl(p);m&&this.canvasManager.addWindow(m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,h)=>{this.stylesheetManager.attachLinkElement(p,h)},onBlockedImageLoad:(p,h,{width:m,height:_})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:h.id,attributes:{style:{width:`${m}px`,height:`${_}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});d&&(t.push({parentId:c,nextId:u,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)bE(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(let l of this.addedSet)!kE(this.droppedSet,l)&&!bE(this.removes,l,this.mirror)||kE(this.movedSet,l)?i(l):this.droppedSet.add(l);let s=null;for(;r.length;){let l=null;if(s){let c=this.mirror.getId(s.value.parentNode),u=o(s.value);c!==-1&&u!==-1&&(l=s)}if(!l){let c=r.tail;for(;c;){let u=c;if(c=c.previous,u){let d=this.mirror.getId(u.value.parentNode);if(o(u.value)===-1)continue;if(d!==-1){l=u;break}else{let h=u.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=h.parentNode.host;if(this.mirror.getId(m)!==-1){l=u;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}s=l.previous,r.removeNode(l.value),i(l.value)}let a={texts:this.texts.map(l=>({id:this.mirror.getId(l.node),value:l.value})).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:c}=l;if(typeof c.style=="string"){let u=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+d).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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(a))},this.processMutation=t=>{if(!Im(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!En(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Is(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,eT(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){let s=th(n),a=n.tagName;o=Au(n,a,s);let l=Wu({maskInputOptions:this.maskInputOptions,tagName:a,type:s}),c=Is(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=sl({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(En(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!ih(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!KE(n.tagName,r)&&(i.attributes[r]=YE(this.doc,Ts(n.tagName),Ts(r),o,n,this.maskAttributeFn),r==="style")){let s=t.oldValue?this.styleDeclarationParser.parse(t.oldValue):null;for(let a of Array.from(n.style)){let l=n.style.getPropertyValue(a),c=n.style.getPropertyPriority(a);l!==(s?.getPropertyValue(a)||"")||c!==(s?.getPropertyPriority(a)||"")?c===""?i.styleDiff[a]=l:i.styleDiff[a]=[l,c]:i._unchangedStyles[a]=[l,c]}if(s)for(let a of Array.from(s))n.style.getPropertyValue(a)===""&&(i.styleDiff[a]=!1)}break}case"childList":{if(En(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=rl(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);En(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Im(n,this.mirror)||!G1(n,this.mirror)||(this.addedSet.has(n)?(Dm(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||tT(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[NE(r,o)]?Dm(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:rl(t.target)&&ol(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Im(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[NE(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);En(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Am(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["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","ignoreCSSAttributes"].forEach(n=>{this[n]=t[n]}),this.styleDeclarationParser=new Pm(this.doc)}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 Dm(e,t){e.delete(t),t.childNodes?.forEach(n=>Dm(e,n))}function bE(e,t,n){return e.length===0?!1:eM(e,t,n)}function eM(e,t,n){let r=t.parentNode;for(;r;){let o=n.getId(r);if(e.some(i=>i.id===o))return!0;r=r.parentNode}return!1}function kE(e,t){return e.size===0?!1:sT(e,t)}function sT(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:sT(e,n):!1}var Es=[];function ml(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{}return e&&e.target}function aT(e,t){let n=new Lm;Es.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);let i=new r(_e(s=>{e.onMutation&&e.onMutation(s)===!1||n.processMutations.bind(n)(s)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function tM({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=ll(_e(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),i),c=_e(ll(_e(d=>{let p=ml(d),{clientX:h,clientY:m}=km(d)?d.changedTouches[0]:d;a||(a=Pu()),s.push({x:h,y:m,id:r.getId(p),timeOffset:Pu()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?ne.Drag:d instanceof MouseEvent?ne.MouseMove:ne.TouchMove)}),o,{trailing:!1})),u=[Kt("mousemove",c,n),Kt("touchmove",c,n),Kt("drag",c,n)];return _e(()=>{u.forEach(d=>d())})}function nM({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){if(s.mouseInteraction===!1)return()=>{};let a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,l=[],c=null,u=d=>p=>{let h=ml(p);if(En(h,r,o,i,!0))return;let m=null,_=d;if("pointerType"in p){switch(p.pointerType){case"mouse":m=Gr.Mouse;break;case"touch":m=Gr.Touch;break;case"pen":m=Gr.Pen;break}m===Gr.Touch?Yt[d]===Yt.MouseDown?_="TouchStart":Yt[d]===Yt.MouseUp&&(_="TouchEnd"):Gr.Pen}else km(p)&&(m=Gr.Touch);m!==null?(c=m,(_.startsWith("Touch")&&m===Gr.Touch||_.startsWith("Mouse")&&m===Gr.Mouse)&&(m=null)):Yt[d]===Yt.Click&&(m=c,c=null);let T=km(p)?p.changedTouches[0]:p;if(!T)return;let y=n.getId(h),{clientX:S,clientY:v}=T;_e(e)({type:Yt[_],id:y,x:S,y:v,...m!==null&&{pointerType:m}})};return Object.keys(Yt).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&a[d]!==!1).forEach(d=>{let p=Ts(d),h=u(d);if(window.PointerEvent)switch(Yt[d]){case Yt.MouseDown:case Yt.MouseUp:p=p.replace("mouse","pointer");break;case Yt.TouchStart:case Yt.TouchEnd:return}l.push(Kt(p,h,t))}),_e(()=>{l.forEach(d=>d())})}function lT({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){let a=_e(ll(_e(l=>{let c=ml(l);if(!c||En(c,r,o,i,!0))return;let u=n.getId(c);if(c===t&&t.defaultView){let d=XE(t.defaultView);e({id:u,x:d.left,y:d.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}),s.scroll||100));return Kt("scroll",a,t)}function rM({viewportResizeCb:e},{win:t}){let n=-1,r=-1,o=_e(ll(_e(()=>{let i=QE(),s=ZE();(n!==i||r!==s)&&(e({width:Number(s),height:Number(i)}),n=i,r=s)}),200));return Kt("resize",o,t)}var oM=["INPUT","TEXTAREA","SELECT"],AE=new WeakMap;function iM({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d,maskTextClass:p,unmaskTextClass:h,maskTextSelector:m,unmaskTextSelector:_}){function T(I){let N=ml(I),F=I.isTrusted,R=N&&Nm(N.tagName);if(R==="OPTION"&&(N=N.parentElement),!N||!R||oM.indexOf(R)<0||En(N,r,o,i,!0))return;let U=N;if(U.classList.contains(s)||a&&U.matches(a))return;let Q=th(N),de=Au(U,R,Q),V=!1,we=Wu({maskInputOptions:l,tagName:R,type:Q}),ie=Is(N,p,m,h,_,we);(Q==="radio"||Q==="checkbox")&&(V=N.checked),de=sl({isMasked:ie,element:N,value:de,maskInputFn:c}),y(N,d?{text:de,isChecked:V,userTriggered:F}:{text:de,isChecked:V});let xe=N.name;Q==="radio"&&xe&&V&&t.querySelectorAll(`input[type="radio"][name="${xe}"]`).forEach(D=>{if(D!==N){let le=sl({isMasked:ie,element:D,value:Au(D,R,Q),maskInputFn:c});y(D,d?{text:le,isChecked:!V,userTriggered:!1}:{text:le,isChecked:!V})}})}function y(I,N){let F=AE.get(I);if(!F||F.text!==N.text||F.isChecked!==N.isChecked){AE.set(I,N);let R=n.getId(I);_e(e)({...N,id:R})}}let v=(u.input==="last"?["change"]:["input","change"]).map(I=>Kt(I,_e(T),t)),w=t.defaultView;if(!w)return()=>{v.forEach(I=>I())};let k=w.Object.getOwnPropertyDescriptor(w.HTMLInputElement.prototype,"value"),A=[[w.HTMLInputElement.prototype,"value"],[w.HTMLInputElement.prototype,"checked"],[w.HTMLSelectElement.prototype,"value"],[w.HTMLTextAreaElement.prototype,"value"],[w.HTMLSelectElement.prototype,"selectedIndex"],[w.HTMLOptionElement.prototype,"selected"]];return k&&k.set&&v.push(...A.map(I=>JE(I[0],I[1],{set(){_e(T)({target:this,isTrusted:!1})}},!1,w))),_e(()=>{v.forEach(I=>I())})}function Lu(e){let t=[];function n(r,o){if(Cu("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Cu("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Cu("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Cu("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function vo(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function sM({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:_e((u,d,p)=>{let[h,m]=p,{id:_,styleId:T}=vo(d,t,n.styleMirror);return(_&&_!==-1||T&&T!==-1)&&e({id:_,styleId:T,adds:[{rule:h,index:m}]}),u.apply(d,p)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:_e((u,d,p)=>{let[h]=p,{id:m,styleId:_}=vo(d,t,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&e({id:m,styleId:_,removes:[{index:h}]}),u.apply(d,p)})});let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:_e((u,d,p)=>{let[h]=p,{id:m,styleId:_}=vo(d,t,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&e({id:m,styleId:_,replace:h}),u.apply(d,p)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:_e((u,d,p)=>{let[h]=p,{id:m,styleId:_}=vo(d,t,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&e({id:m,styleId:_,replaceSync:h}),u.apply(d,p)})}));let l={};xu("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(xu("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),xu("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),xu("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,d])=>{c[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(c[u].insertRule,{apply:_e((p,h,m)=>{let[_,T]=m,{id:y,styleId:S}=vo(h.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,adds:[{rule:_,index:[...Lu(h),T||0]}]}),p.apply(h,m)})}),d.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:_e((p,h,m)=>{let[_]=m,{id:T,styleId:y}=vo(h.parentStyleSheet,t,n.styleMirror);return(T&&T!==-1||y&&y!==-1)&&e({id:T,styleId:y,removes:[{index:[...Lu(h),_]}]}),p.apply(h,m)})})}),_e(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,d])=>{d.prototype.insertRule=c[u].insertRule,d.prototype.deleteRule=c[u].deleteRule})})}function cT({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);let o=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(s){let a=i.set?.call(this,s);if(r!==null&&r!==-1)try{t.adoptStyleSheets(s,r)}catch{}return a}}),_e(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function aM({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:_e((a,l,c)=>{let[u,d,p]=c;if(n.has(u))return i.apply(l,[u,d,p]);let{id:h,styleId:m}=vo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,set:{property:u,value:d,priority:p},index:Lu(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:_e((a,l,c)=>{let[u]=c;if(n.has(u))return s.apply(l,[u]);let{id:d,styleId:p}=vo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||p&&p!==-1)&&e({id:d,styleId:p,remove:{property:u},index:Lu(l.parentRule)}),a.apply(l,c)})}),_e(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function lM({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:s}){let a=_e(c=>ll(_e(u=>{let d=ml(u);if(!d||En(d,t,n,r,!0))return;let{currentTime:p,volume:h,muted:m,playbackRate:_}=d;e({type:c,id:o.getId(d),currentTime:p,volume:h,muted:m,playbackRate:_})}),i.media||500)),l=[Kt("play",a(ys.Play),s),Kt("pause",a(ys.Pause),s),Kt("seeked",a(ys.Seeked),s),Kt("volumechange",a(ys.VolumeChange),s),Kt("ratechange",a(ys.RateChange),s)];return _e(()=>{l.forEach(c=>c())})}function cM({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,u){let d=new i(l,c,u);return o.set(d,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};let s=rh(t.fonts,"add",function(a){return function(l){return Vu(_e(()=>{let c=o.get(l);c&&(e(c),o.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{n.FontFace=i}),r.push(s),_e(()=>{r.forEach(a=>a())})}function uM(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:s}=e,a=!0,l=_e(()=>{let c=t.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;let u=[],d=c.rangeCount||0;for(let p=0;p<d;p++){let h=c.getRangeAt(p),{startContainer:m,startOffset:_,endContainer:T,endOffset:y}=h;En(m,r,o,i,!0)||En(T,r,o,i,!0)||u.push({start:n.getId(m),startOffset:_,end:n.getId(T),endOffset:y})}s({ranges:u})});return l(),Kt("selectionchange",l)}function dM({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:rh(n.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{}return o.apply(this,[i,s,a])}})}function fM(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=aT(e,e.doc));let o=tM(e),i=nM(e),s=lT(e),a=rM(e,{win:n}),l=iM(e),c=lM(e),u=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(u=sM(e,{win:n}),d=cT(e,e.doc),p=aM(e,{win:n}),e.collectFonts&&(h=cM(e)));let m=uM(e),_=dM(e),T=[];for(let y of e.plugins)T.push(y.observer(y.callback,n,y.options));return _e(()=>{Es.forEach(y=>y.reset()),r?.disconnect(),o(),i(),s(),a(),l(),c(),u(),d(),p(),h(),m(),_(),T.forEach(y=>y())})}function Cu(e){return typeof window[e]<"u"}function xu(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ul=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){let i=r||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),a=i.get(n);return a||(a=this.generateIdFn(),i.set(n,a),s.set(a,n)),a}getIds(t,n){let r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,o))}getRemoteId(t,n,r){let o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}},Um=class{constructor(){this.crossOriginIframeMirror=new ul(nh),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Fm=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ul(nh),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ul(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0);let n=cl(t);n&&this.crossOriginIframeMap.set(n,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&cl(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);let r=ih(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){let n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;let o=this.crossOriginIframeMap.get(t.source);if(!o)return;let i=this.transformCrossOriginEvent(o,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case ae.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);let r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:ae.IncrementalSnapshot,data:{source:ne.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ae.Meta:case ae.Load:case ae.DomContentLoaded:return!1;case ae.Plugin:return n;case ae.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case ae.IncrementalSnapshot:switch(n.data.source){case ne.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case ne.Drag:case ne.TouchMove:case ne.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case ne.ViewportResize:return!1;case ne.MediaInteraction:case ne.MouseInteraction:case ne.Scroll:case ne.CanvasMutation:case ne.Input:return this.replaceIds(n.data,t,["id"]),n;case ne.StyleSheetRule:case ne.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case ne.Font:return n;case ne.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case ne.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==ct.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},Bm=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},Hm=class{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!ol(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);let r=aT({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(lT({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),Vu(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(cT({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){let n=ih(t),r=cl(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(rh(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i);return this.shadowRoot&&iT(this)&&r.addShadowRoot(this.shadowRoot,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},$m=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Mm,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,l)=>({rule:jE(a),index:l}))})),r.styleIds.push(s)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},zm=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){let r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,K1(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},tt,Du;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var or=_1();function ir(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,unblockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskAllText:c=!1,maskTextClass:u="rr-mask",unmaskTextClass:d=null,maskTextSelector:p=null,unmaskTextSelector:h=null,inlineStylesheet:m=!0,maskAllInputs:_,maskInputOptions:T,slimDOMOptions:y,maskAttributeFn:S,maskInputFn:v,maskTextFn:w,maxCanvasSize:k=null,packFn:A,sampling:I={},dataURLOptions:N={},mousemoveWait:F,recordDOM:R=!0,recordCanvas:U=!1,recordCrossOriginIframes:Q=!1,recordAfter:de=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:V=!1,collectFonts:we=!1,inlineImages:ie=!1,plugins:xe,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:le=new Set([]),errorHandler:q,onMutation:oe,getCanvasManager:ce}=e;X1(q);let ge=Q?window.parent===window:!0,yt=!1;if(!ge)try{window.parent.document&&(yt=!1)}catch{yt=!0}if(ge&&!t)throw new Error("emit function is required");if(!ge&&!yt)return()=>{};F!==void 0&&I.mousemove===void 0&&(I.mousemove=F),or.reset();let Tt=_===!0?{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}:T!==void 0?T:{},Re=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};V1();let It,en=0,Nn=Y=>{for(let Le of xe||[])Le.eventProcessor&&(Y=Le.eventProcessor(Y));return A&&!yt&&(Y=A(Y)),Y};tt=(Y,Le)=>{let ue=Y;if(ue.timestamp=Pu(),Es[0]?.isFrozen()&&ue.type!==ae.FullSnapshot&&!(ue.type===ae.IncrementalSnapshot&&ue.data.source===ne.Mutation)&&Es.forEach(Me=>Me.unfreeze()),ge)t?.(Nn(ue),Le);else if(yt){let Me={type:"rrweb",event:Nn(ue),origin:window.location.origin,isCheckout:Le};window.parent.postMessage(Me,"*")}if(ue.type===ae.FullSnapshot)It=ue,en=0;else if(ue.type===ae.IncrementalSnapshot){if(ue.data.source===ne.Mutation&&ue.data.isAttachIframe)return;en++;let Me=r&&en>=r,pe=n&&It&&ue.timestamp-It.timestamp>n;(Me||pe)&&Qe(!0)}};let He=Y=>{tt({type:ae.IncrementalSnapshot,data:{source:ne.Mutation,...Y}})},bn=Y=>tt({type:ae.IncrementalSnapshot,data:{source:ne.Scroll,...Y}}),Wo=Y=>tt({type:ae.IncrementalSnapshot,data:{source:ne.CanvasMutation,...Y}}),io=Y=>tt({type:ae.IncrementalSnapshot,data:{source:ne.AdoptedStyleSheet,...Y}}),P=new $m({mutationCb:He,adoptedStyleSheetCb:io}),z=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Um:new Fm({mirror:or,mutationCb:He,stylesheetManager:P,recordCrossOriginIframes:Q,wrappedEmit:tt});for(let Y of xe||[])Y.getMirror&&Y.getMirror({nodeMirror:or,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});let te=new zm,re=mM(ce,{mirror:or,win:window,mutationCb:Y=>tt({type:ae.IncrementalSnapshot,data:{source:ne.CanvasMutation,...Y}}),recordCanvas:U,blockClass:o,blockSelector:i,unblockSelector:s,maxCanvasSize:k,sampling:I.canvas,dataURLOptions:N,errorHandler:q}),Te=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Bm:new Hm({mutationCb:He,scrollCb:bn,bypassOptions:{onMutation:oe,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:m,maskInputOptions:Tt,dataURLOptions:N,maskAttributeFn:S,maskTextFn:w,maskInputFn:v,recordCanvas:U,inlineImages:ie,sampling:I,slimDOMOptions:Re,iframeManager:z,stylesheetManager:P,canvasManager:re,keepIframeSrcFn:D,processedNodeManager:te,ignoreCSSAttributes:le},mirror:or}),Qe=(Y=!1)=>{if(!R)return;tt({type:ae.Meta,data:{href:window.location.href,width:ZE(),height:QE()}},Y),P.reset(),Te.init(),Es.forEach(ue=>ue.lock());let Le=W1(document,{mirror:or,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:m,maskAllInputs:Tt,maskAttributeFn:S,maskInputFn:v,maskTextFn:w,slimDOM:Re,dataURLOptions:N,recordCanvas:U,inlineImages:ie,onSerialize:ue=>{nT(ue,or)&&z.addIframe(ue),rT(ue,or)&&P.trackLinkElement(ue),Am(ue)&&Te.addShadowRoot(ue.shadowRoot,document)},onIframeLoad:(ue,Me)=>{z.attachIframe(ue,Me);let pe=cl(ue);pe&&re.addWindow(pe),Te.observeAttachShadow(ue)},onStylesheetLoad:(ue,Me)=>{P.attachLinkElement(ue,Me)},onBlockedImageLoad:(ue,Me,{width:pe,height:so})=>{He({adds:[],removes:[],texts:[],attributes:[{id:Me.id,attributes:{style:{width:`${pe}px`,height:`${so}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:le});if(!Le)return console.warn("Failed to snapshot the document");tt({type:ae.FullSnapshot,data:{node:Le,initialOffset:XE(window)}}),Es.forEach(ue=>ue.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,or.getId(document))};Du=Qe;try{let Y=[],Le=Me=>_e(fM)({onMutation:oe,mutationCb:He,mousemoveCb:(pe,so)=>tt({type:ae.IncrementalSnapshot,data:{source:so,positions:pe}}),mouseInteractionCb:pe=>tt({type:ae.IncrementalSnapshot,data:{source:ne.MouseInteraction,...pe}}),scrollCb:bn,viewportResizeCb:pe=>tt({type:ae.IncrementalSnapshot,data:{source:ne.ViewportResize,...pe}}),inputCb:pe=>tt({type:ae.IncrementalSnapshot,data:{source:ne.Input,...pe}}),mediaInteractionCb:pe=>tt({type:ae.IncrementalSnapshot,data:{source:ne.MediaInteraction,...pe}}),styleSheetRuleCb:pe=>tt({type:ae.IncrementalSnapshot,data:{source:ne.StyleSheetRule,...pe}}),styleDeclarationCb:pe=>tt({type:ae.IncrementalSnapshot,data:{source:ne.StyleDeclaration,...pe}}),canvasMutationCb:Wo,fontCb:pe=>tt({type:ae.IncrementalSnapshot,data:{source:ne.Font,...pe}}),selectionCb:pe=>{tt({type:ae.IncrementalSnapshot,data:{source:ne.Selection,...pe}})},customElementCb:pe=>{tt({type:ae.IncrementalSnapshot,data:{source:ne.CustomElement,...pe}})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,maskInputOptions:Tt,inlineStylesheet:m,sampling:I,recordDOM:R,recordCanvas:U,inlineImages:ie,userTriggeredOnInput:V,collectFonts:we,doc:Me,maskAttributeFn:S,maskInputFn:v,maskTextFn:w,keepIframeSrcFn:D,blockSelector:i,unblockSelector:s,slimDOMOptions:Re,dataURLOptions:N,mirror:or,iframeManager:z,stylesheetManager:P,shadowDomManager:Te,processedNodeManager:te,canvasManager:re,ignoreCSSAttributes:le,plugins:xe?.filter(pe=>pe.observer)?.map(pe=>({observer:pe.observer,options:pe.options,callback:so=>tt({type:ae.Plugin,data:{plugin:pe.name,payload:so}})}))||[]},{});z.addLoadListener(Me=>{try{Y.push(Le(Me.contentDocument))}catch(pe){console.warn(pe)}});let ue=()=>{Qe(),Y.push(Le(document))};return document.readyState==="interactive"||document.readyState==="complete"?ue():(Y.push(Kt("DOMContentLoaded",()=>{tt({type:ae.DomContentLoaded,data:{}}),de==="DOMContentLoaded"&&ue()})),Y.push(Kt("load",()=>{tt({type:ae.Load,data:{}}),de==="load"&&ue()},window))),()=>{Y.forEach(Me=>Me()),te.destroy(),Du=void 0,Q1()}}catch(Y){console.warn(Y)}}function pM(e){if(!Du)throw new Error("please take full snapshot after start recording");Du(e)}ir.mirror=or;ir.takeFullSnapshot=pM;function mM(e,t){try{return e?e(t):new Ou}catch{return console.warn("Unable to initialize CanvasManager"),new Ou}}var ME;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ME||(ME={}));var hM=3,gM=5;function sh(e){return e>9999999999?e:e*1e3}function wm(e){return e>9999999999?e/1e3:e}function hl(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:ae.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Lt(t,10,1e3)}}),t.category==="console")))}var yM="button,a";function uT(e){return e.closest(yM)||e}function dT(e){let t=fT(e);return!t||!(t instanceof Element)?t:uT(t)}function fT(e){return SM(e)?e.target:e}function SM(e){return typeof e=="object"&&!!e&&"target"in e}var Eo;function _M(e){return Eo||(Eo=[],vM()),Eo.push(e),()=>{let t=Eo?Eo.indexOf(e):-1;t>-1&&Eo.splice(t,1)}}function vM(){Ze(Ue,"open",function(e){return function(...t){if(Eo)try{Eo.forEach(n=>n())}catch{}return e.apply(Ue,t)}})}var EM=new Set([ne.Mutation,ne.StyleSheetRule,ne.StyleDeclaration,ne.AdoptedStyleSheet,ne.CanvasMutation,ne.Selection,ne.MediaInteraction]);function TM(e,t,n){e.handleClick(t,n)}var jm=class{constructor(t,n,r=hl){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){let t=_M(()=>{this._lastMutation=PE()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(wM(n,this._ignoreSelector)||!CM(t))return;let r={timestamp:wm(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(o=>o.node===r.node&&Math.abs(o.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=wm(t)}registerScroll(t=Date.now()){this._lastScroll=wm(t)}registerClick(t){let n=uT(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){let t=[],n=PE();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(let r of t){let o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){let n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,o=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!o,{clickCount:s,clickBreadcrumb:a}=t;if(i){let l=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,c=l<this._timeout*1e3?"mutation":"timeout",u={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:Ue.location.href,route:n.getCurrentRoute(),timeAfterClickMs:l,endReason:c,clickCount:s||1}};this._addBreadcrumbEvent(n,u);return}if(s>1){let l={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:Ue.location.href,route:n.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=mi(()=>this._checkClicks(),1e3)}},IM=["A","BUTTON","INPUT"];function wM(e,t){return!!(!IM.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function CM(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function PE(){return Date.now()/1e3}function xM(e,t){try{if(!RM(t))return;let{source:n}=t.data;if(EM.has(n)&&e.registerMutation(t.timestamp),n===ne.Scroll&&e.registerScroll(t.timestamp),NM(t)){let{type:r,id:o}=t.data,i=ir.mirror.getNode(o);i instanceof HTMLElement&&r===Yt.Click&&e.registerClick(i)}}catch{}}function RM(e){return e.type===hM}function NM(e){return e.data.source===ne.MouseInteraction}function Tr(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var qu=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(qu||{}),bM=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function kM(e){let t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(let n in e)if(bM.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}var AM=e=>t=>{if(!e.isEnabled())return;let n=MM(t);if(!n)return;let r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&TM(e.clickDetector,n,dT(t.event)),hl(e,n)};function pT(e,t){let n=ir.mirror.getId(e),r=n&&ir.mirror.getNode(n),o=r&&ir.mirror.getMeta(r),i=o&&OM(o)?o:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(s=>s.type===qu.Text&&s.textContent).filter(Boolean).map(s=>s.trim()).join(""),attributes:kM(i.attributes)}}:{}}}function MM(e){let{target:t,message:n}=PM(e);return Tr({category:`ui.${e.name}`,...pT(t,n)})}function PM(e){let t=e.name==="click",n,r=null;try{r=t?dT(e.event):fT(e.event),n=Ae(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function OM(e){return e.type===qu.Element}function LM(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=DM(t);n&&hl(e,n)}function DM(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:s}=e;if(!s||UM(s)||!i)return null;let a=t||r||o,l=i.length===1;if(!a&&l)return null;let c=Ae(s,{maxStringLength:200})||"<unknown>",u=pT(s,c);return Tr({category:"ui.keyDown",message:c,data:{...u.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function UM(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var FM={resource:jM,paint:$M,navigation:zM};function Cm(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function BM(e){return e.map(HM).filter(Boolean)}function HM(e){let t=FM[e.entryType];return t?t(e):null}function ws(e){return((Oe()||Ue.performance.timeOrigin)+e)/1e3}function $M(e){let{duration:t,entryType:n,name:r,startTime:o}=e,i=ws(o);return{type:n,name:r,start:i,end:i+t,data:void 0}}function zM(e){let{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:u,loadEventEnd:d,redirectCount:p,startTime:h,transferSize:m,type:_}=e;return o===0?null:{type:`${t}.${_}`,start:ws(h),end:ws(i),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:s,duration:o,domInteractive:c,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,loadEventStart:u,loadEventEnd:d,domComplete:i,redirectCount:p}}}function jM(e){let{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:i,decodedBodySize:s,encodedBodySize:a,responseStatus:l,transferSize:c}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:ws(i),end:ws(o),name:r,data:{size:c,statusCode:l,decodedBodySize:s,encodedBodySize:a}}}function WM(e){let t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return ah(e,"largest-contentful-paint",n)}function GM(e){return e.sources!==void 0}function VM(e){let t=[],n=[];for(let r of e.entries)if(GM(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let s=ir.mirror.getId(i.node);s&&o.push(s)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return ah(e,"cumulative-layout-shift",n,t)}function qM(e){let t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return ah(e,"interaction-to-next-paint",n)}function ah(e,t,n,r){let o=e.value,i=e.rating,s=ws(o);return{type:"web-vital",name:t,start:s,end:s,data:{value:o,size:o,rating:i,nodeIds:n?n.map(a=>ir.mirror.getId(a)):void 0,attributions:r}}}function YM(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}let r=[];return["navigation","paint","resource"].forEach(o=>{r.push(nr(o,n))}),r.push($r(Cm(WM,e)),Hr(Cm(VM,e)),ui(Cm(qM,e))),()=>{r.forEach(o=>o())}}var Z=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,KM='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]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(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,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(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},_=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},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=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:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(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,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}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 s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),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=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+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(U,C,0),R=U;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[s[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=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(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;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=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,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];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}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[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=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),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(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[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-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=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(L(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 s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),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(s),32768),this.s.z=n.length-s+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.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=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}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return 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&&O(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)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(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=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=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 B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[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});';function JM(){let e=new Blob([KM]);return URL.createObjectURL(e)}var OE=["log","warn","error"],Nu="[Replay] ";function xm(e,t="info"){vn({category:"console",data:{logger:"replay"},level:t,message:`${Nu}${e}`},{level:t})}function XM(){let e=!1,t=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return Z?(OE.forEach(r=>{n[r]=(...o)=>{x[r](Nu,...o),t&&xm(o.join(""),ss(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),x.error(Nu,r),e?Ur(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&xm(r,"error")},n.infoTick=(...r)=>{x.log(Nu,...r),t&&setTimeout(()=>xm(r[0]),0)}):OE.forEach(r=>{n[r]=()=>{}}),n}var ee=XM(),dl=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${eh}.`)}},Uu=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){let n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>eh)throw new dl;this.events.push(t)}finish(){return new Promise(t=>{let n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(let{timestamp:n}of this.events)(t===null||n<t)&&(t=n);return t===null?t:sh(t)}},Wm=class{constructor(t){this._onMessage=({data:n})=>{let r=n;if(typeof r.id!="number")return;let o=this._pending.get(r.id);if(!(!o||o.method!==r.method)){if(this._pending.delete(r.id),!r.success){Z&&ee.error("Error in compression worker: ",r.response),o.reject(new Error("Error in compression worker"));return}o.resolve(r.response)}},this._worker=t,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():(Z&&ee.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{Z&&ee.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){Z&&ee.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(t=>t.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(t,n){let r=this._getAndIncrementId();return new Promise((o,i)=>{this._pending.set(r,{method:t,resolve:o,reject:i});try{this._worker.postMessage({id:r,method:t,arg:n})}catch(s){this._pending.delete(r),i(s)}})}_getAndIncrementId(){return this._id++}},Gm=class{constructor(t){this._worker=new Wm(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){let n=sh(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>eh?Promise.reject(new dl):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{Z&&ee.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){let t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}},Vm=class{constructor(t){this._fallback=new Uu,this._compression=new Gm(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){Z&&ee.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(let i of t)o.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(i){Z&&ee.exception(i,"Failed to add events when switching buffers.")}}};function QM({useCompression:e,workerUrl:t}){if(e&&window.Worker){let n=ZM(t);if(n)return n}return Z&&ee.log("Using simple buffer"),new Uu}function ZM(e){try{let t=e||eP();if(!t)return;Z&&ee.log(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new Vm(n)}catch(t){Z&&ee.exception(t,"Failed to create compression worker")}}function eP(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?JM():""}function lh(){try{return"sessionStorage"in Ue&&!!Ue.sessionStorage}catch{return!1}}function tP(e){nP(),e.session=void 0}function nP(){if(lh())try{Ue.sessionStorage.removeItem(Qm)}catch{}}function mT(e){return e===void 0?!1:Math.random()<e}function Yu(e){if(lh())try{Ue.sessionStorage.setItem(Qm,JSON.stringify(e))}catch{}}function hT(e){let t=Date.now(),n=e.id||et(),r=e.started||t,o=e.lastActivity||t,i=e.segmentId||0,s=e.sampled,a=e.previousSessionId,l=e.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:i,sampled:s,previousSessionId:a,dirty:l}}function rP(e,t){return mT(e)?"session":t?"buffer":!1}function LE({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let o=rP(e,t),i=hT({sampled:o,previousSessionId:r});return n&&Yu(i),i}function oP(){if(!lh())return null;try{let e=Ue.sessionStorage.getItem(Qm);if(!e)return null;let t=JSON.parse(e);return Z&&ee.infoTick("Loading existing session"),hT(t)}catch{return null}}function qm(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function iP(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return qm(e.started,t,r)||qm(e.lastActivity,n,r)}function Fu(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!iP(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Rm({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let o=r.stickySession&&oP();return o?Fu(o,{sessionIdleExpire:e,maxReplayDuration:t})?(Z&&ee.infoTick("Session in sessionStorage is expired, creating new one..."),LE(r,{previousSessionId:o.id})):o:(Z&&ee.infoTick("Creating new session"),LE(r,{previousSessionId:n}))}function sP(e){return e.type===ae.Custom}function ch(e,t,n){return yT(e,t)?(gT(e,t,n),!0):!1}function aP(e,t,n){return yT(e,t)?gT(e,t,n):Promise.resolve(null)}async function gT(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let o=e.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let i=e.getOptions(),s=lP(t,i.beforeAddRecordingEvent);return s?await r.addEvent(s):void 0}catch(i){let s=i&&i instanceof dl,a=s?"eventBufferOverflow":"eventBufferError",l=$();if(l){let c=s?"buffer_overflow":"internal_sdk_error";l.recordDroppedEvent(c,"replay")}if(s&&o)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:a})}}function yT(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=sh(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Z&&ee.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function lP(e,t){try{if(typeof t=="function"&&sP(e))return t(e)}catch(n){return Z&&ee.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function uh(e){return!e.type}function Ym(e){return e.type==="transaction"}function cP(e){return e.type==="replay_event"}function DE(e){return e.type==="feedback"}function uP(e){return(t,n)=>{if(!e.isEnabled()||!uh(t)&&!Ym(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(Ym(t)){dP(e,t);return}fP(e,t)}}}function dP(e,t){let n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function fP(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||mi(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function pP(e){return t=>{!e.isEnabled()||!uh(t)||mP(e,t)}}function mP(e,t){let n=t.exception?.values?.[0]?.value;if(typeof n=="string"&&(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))){let r=Tr({category:"replay.hydrate-error",data:{url:ln()}});hl(e,r)}}function hP(e){let t=$();t&&t.on("beforeAddBreadcrumb",n=>gP(e,n))}function gP(e,t){if(!e.isEnabled()||!ST(t))return;let n=yP(t);n&&hl(e,n)}function yP(e){return!ST(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?SP(e):Tr(e)}function SP(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return Tr(e);let n=!1,r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>wu?(n=!0,`${o.slice(0,wu)}\u2026`):o;if(typeof o=="object")try{let i=Lt(o,7);return JSON.stringify(i).length>wu?(n=!0,`${JSON.stringify(i,null,2).slice(0,wu)}\u2026`):i}catch{}return o});return Tr({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function ST(e){return!!e.category}function _P(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Bu(){let e=K().getPropagationContext().dsc;e&&delete e.replay_id;let t=Ne();if(t){let n=lt(t);delete n.replay_id}}function UE(e){let t=K().getPropagationContext().dsc;t&&(t.replay_id=e);let n=Ne();if(n){let r=lt(n);r.replay_id=e}}function vP(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:ae.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function EP(e,t){return e.recordingMode!=="buffer"||t.message===Zm||!t.exception||t.type?!1:mT(e.getOptions().errorSampleRate)}function TP(e){return Object.assign((t,n)=>{if(e.session&&Fu(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Bu(),!e.isEnabled()||e.isPaused())return t;if(cP(t))return delete t.breadcrumbs,t;if(!uh(t)&&!Ym(t)&&!DE(t))return t;if(!e.checkAndHandleExpiredSession())return Bu(),t;if(DE(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),vP(e,t),t;if(_P(t,n)&&!e.getOptions()._experiments.captureExceptions)return Z&&ee.log("Ignoring error from rrweb internals",t),null;let o=EP(e,t);if((o||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),o&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){let s=e.session;s.dirty=!0,e.getOptions().stickySession&&Yu(s)}return t},{id:"Replay"})}function Ku(e,t){return t.map(({type:n,start:r,end:o,name:i,data:s})=>{let a=e.throttledAddEvent({type:ae.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:o,data:s}}});return typeof a=="string"?Promise.resolve(null):a})}function IP(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function wP(e){return t=>{if(!e.isEnabled())return;let n=IP(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Ku(e,[n]),!1)))}}function CP(e,t){return Z&&e.getOptions()._experiments.traceInternals?!1:Dp(t,$())}function _T(e,t){e.isEnabled()&&t!==null&&(CP(e,t.name)||e.addUpdate(()=>(Ku(e,[t]),!0)))}function Ju(e){if(!e)return;let t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=_u(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function vT(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Hu(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 ET(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:o,method:i,statusCode:s,request:a,response:l}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:i,statusCode:s,request:a,response:l}}}function fl(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function To(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:o,warnings:i}=xP(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function Km(e,t){return Object.entries(e).reduce((n,[r,o])=>{let i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=o),n},{})}function xP(e){if(!e||typeof e!="string")return{body:e};let t=e.length>yE,n=RP(e);if(t){let r=e.slice(0,yE);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function RP(e){let t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function $u(e,t){let n=NP(e);return Ct(n,t)}function NP(e,t=Ue.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Ue.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}async function bP(e,t,n){try{let r=await AP(e,t,n),o=ET("resource.fetch",r);_T(n.replay,o)}catch(r){Z&&ee.exception(r,"Failed to capture fetch breadcrumb")}}function kP(e,t){let{input:n,response:r}=t,o=n?Eu(n):void 0,i=Ju(o),s=r?vT(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),s!==void 0&&(e.data.response_body_size=s)}async function AP(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r}=t,{url:s,method:a,status_code:l=0,request_body_size:c,response_body_size:u}=e.data,d=$u(s,n.networkDetailAllowUrls)&&!$u(s,n.networkDetailDenyUrls),p=d?MP(n,t.input,c):fl(c),h=await PP(d,n,t.response,u);return{startTimestamp:o,endTimestamp:i,url:s,method:a,statusCode:l,request:p,response:h}}function MP({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let o=n?DP(n,t):{};if(!e)return To(o,r,void 0);let i=Eu(n),[s,a]=vu(i,ee),l=To(o,r,s);return a?Hu(l,a):l}async function PP(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return fl(o);let i=r?TT(r.headers,n):{};if(!r||!t&&o!==void 0)return To(i,o,void 0);let[s,a]=await LP(r),l=OP(s,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:i});return a?Hu(l,a):l}function OP(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{let i=e?.length&&n===void 0?Ju(e):n;return r?t?To(o,i,e):To(o,i,void 0):fl(i)}catch(i){return Z&&ee.exception(i,"Failed to serialize response body"),To(o,n,void 0)}}async function LP(e){let t=UP(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await FP(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(Z&&ee.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(Z&&ee.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function TT(e,t){let n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function DP(e,t){return e.length===1&&typeof e[0]!="string"?FE(e[0],t):e.length===2?FE(e[1],t):{}}function FE(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?TT(n,t):Array.isArray(n)?{}:Km(n,t):{}}function UP(e){try{return e.clone()}catch(t){Z&&ee.exception(t,"Failed to clone response body")}}function FP(e){return new Promise((t,n)=>{let r=mi(()=>n(new Error("Timeout while trying to read response body")),500);BP(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function BP(e){return await e.text()}async function HP(e,t,n){try{let r=zP(e,t,n),o=ET("resource.xhr",r);_T(n.replay,o)}catch(r){Z&&ee.exception(r,"Failed to capture xhr breadcrumb")}}function $P(e,t){let{xhr:n,input:r}=t;if(!n)return;let o=Ju(r),i=n.getResponseHeader("content-length")?vT(n.getResponseHeader("content-length")):GP(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}function zP(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r,input:s,xhr:a}=t,{url:l,method:c,status_code:u=0,request_body_size:d,response_body_size:p}=e.data;if(!l)return null;if(!a||!$u(l,n.networkDetailAllowUrls)||$u(l,n.networkDetailDenyUrls)){let A=fl(d),I=fl(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:A,response:I}}let h=a[rr],m=h?Km(h.request_headers,n.networkRequestHeaders):{},_=Km(Za(a),n.networkResponseHeaders),[T,y]=n.networkCaptureBodies?vu(s,ee):[void 0],[S,v]=n.networkCaptureBodies?jP(a):[void 0],w=To(m,d,T),k=To(_,p,S);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:y?Hu(w,y):w,response:v?Hu(k,v):k}}function jP(e){let t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return WP(e.response,e.responseType)}catch(n){t.push(n)}return Z&&ee.warn("Failed to get xhr response body",...t),[void 0]}function WP(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return Z&&ee.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Z&&ee.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function GP(e,t){try{let n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return Ju(n)}catch{return}}function VP(e){let t=$();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s};t&&t.on("beforeAddBreadcrumb",(l,c)=>qP(a,l,c))}catch{}}function qP(e,t,n){if(t.data)try{YP(t)&&JP(n)&&($P(t,n),HP(t,n,e)),KP(t)&&XP(n)&&(kP(t,n),bP(t,n,e))}catch(r){Z&&ee.exception(r,"Error when enriching network breadcrumb")}}function YP(e){return e.category==="xhr"}function KP(e){return e.category==="fetch"}function JP(e){return e?.xhr}function XP(e){return e?.input!==void 0}function QP(e){let t=$();Xa(AM(e)),Wr(wP(e)),hP(e),VP(e);let n=TP(e);Ua(n),t&&(t.on("beforeSendEvent",pP(e)),t.on("afterSendEvent",uP(e)),t.on("createDsc",r=>{let o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,o)=>{let i=e.getSessionId();o?.includeReplay&&e.isEnabled()&&i&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function ZP(e){try{return Promise.all(Ku(e,[eO(Ue.performance.memory)]))}catch{return[]}}function eO(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function tO(e,t,n){return Fp(e,t,{...n,setTimeoutImpl:mi})}var Ru=j.navigator;function nO(){return/iPhone|iPad|iPod/i.test(Ru?.userAgent??"")||/Macintosh/i.test(Ru?.userAgent??"")&&Ru?.maxTouchPoints&&Ru?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function rO(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){Z&&ee.warn("Received replay event after session expired.");return}let o=r||!t;t=!0,oO(n),e.clickDetector&&xM(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!ch(e,n,o))return!0;if(!o)return!1;let i=e.session;if(sO(e,o),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){let s=e.eventBuffer.getEarliestTimestamp();s&&(Z&&ee.log(`Updating session start time to earliest event in buffer to ${new Date(s)}`),i.started=s,e.getOptions().stickySession&&Yu(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function oO(e){let t=e.data;if(!(e.type!==ae.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==ne.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(let n of t.attributes){let r=ir.mirror.getNode(n.id),o=r&&ir.mirror.getMeta(r);if(o?.type===qu.Element)for(let[i,s]of Object.entries(n.attributes))s===null?delete o.attributes[i]:o.attributes[i]=s}}function iO(e){let t=e.getOptions();return{type:ae.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?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function sO(e,t){!t||e.session?.segmentId!==0||ch(e,iO(e),!1)}function aO(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function lO(e,t,n,r){return Vt(Aa(e,Xi(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function cO({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
|
|
31
|
-
`;if(typeof e=="string")n=`${r}${e}`;else{let i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function uO({client:e,scope:t,replayId:n,event:r}){let o=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:o};e.emit("preprocessEvent",r,i);let s=await Oa(e.getOptions(),r,i,t,e,Ve());if(!s)return null;e.emit("postprocessEvent",s,i),s.platform=s.platform||"javascript";let a=e.getSdkMetadata(),{name:l,version:c,settings:u}=a?.sdk||{};return s.sdk={...s.sdk,name:l||"sentry.javascript.unknown",version:c||"0.0.0",settings:u},s}async function dO({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:i}){let s=cO({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:l,traceIds:c,initialTimestamp:u}=r,d=$(),p=K(),h=d?.getTransport(),m=d?.getDsn();if(!d||!h||!m||!i.sampled)return Promise.resolve({});let _={type:QA,replay_start_timestamp:u/1e3,timestamp:o/1e3,error_ids:l,trace_ids:c,urls:a,replay_id:t,segment_id:n,replay_type:i.sampled},T=await uO({scope:p,client:d,replayId:t,event:_});if(!T)return d.recordDroppedEvent("event_processor","replay"),Z&&ee.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete T.sdkProcessingMetadata;let y=lO(T,s,m,d.getOptions().tunnel),S;try{S=await h.send(y)}catch(w){let k=new Error(Zm);try{k.cause=w}catch{}throw k}let v=$a({},S);if(Ha(v,"replay"))throw new pl(v);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new zu(S.statusCode);return S}var zu=class extends Error{constructor(t){super(`Transport returned status code ${t}`)}},pl=class extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}},ju=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function IT(e,t={count:0,interval:o1}){let{recordingData:n,onError:r}=e;if(n.length)try{return await dO(e),!0}catch(o){if(o instanceof zu||o instanceof pl)throw o;if(ii("Replays",{_retryCount:t.count}),r&&r(o),t.count>=i1){let i=new Error(`${Zm} - max retries exceeded`);try{i.cause=o}catch{}throw i}return t.interval*=++t.count,new Promise((i,s)=>{mi(async()=>{try{await IT(e,t),i(!0)}catch(a){s(a)}},t.interval)})}}var wT="__THROTTLED",fO="__SKIPPED";function pO(e,t,n){let r=new Map,o=a=>{let l=a-n;r.forEach((c,u)=>{u<l&&r.delete(u)})},i=()=>[...r.values()].reduce((a,l)=>a+l,0),s=!1;return(...a)=>{let l=Math.floor(Date.now()/1e3);if(o(l),i()>=t){let u=s;return s=!0,u?fO:wT}s=!1;let c=r.get(l)||0;return r.set(l,c+1),e(...a)}}var Jm=class{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:ZA,sessionIdleExpire:e1},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=n,this._options=t,this._debouncedFlush=tO(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=pO((s,a)=>aP(this,s,a),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(s1,r),timeout:r,scrollTimeout:a1,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new jm(this,i)),Z){let s=t._experiments;ee.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{Ue.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let s=Tr({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{let s=Tr({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{LM(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){Z&&ee.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){let{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(t),!this.session){Z&&ee.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",Z&&ee.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){Z&&ee.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){Z&&ee.log("Buffering is in progress, call `flush()` to save the replay");return}Z&&ee.infoTick("Starting replay in session mode"),this._updateUserActivity();let t=Rm({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){Z&&ee.log("Buffering is in progress, call `flush()` to save the replay");return}Z&&ee.infoTick("Starting replay in buffer mode");let t=Rm({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{let t=this._canvas;this._stopRecording=ir({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:r1}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:rO(this),...nO(),onMutation:this._onMutationHandler.bind(this),...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";let r=n??"manual";$()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{Z&&ee.log(`Stopping Replay triggered by ${r}`),Bu(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,tP(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Z&&ee.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Z&&ee.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();Z&&ee.log("Converting buffer to session"),await this.flushImmediate();let r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),UE(this.session.id)),this.startRecording())}addUpdate(t){let n=t();this.recordingMode==="buffer"||!this._isEnabled||n!==!0&&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 this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(t){if(!(t&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&qm(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let t=`${Ue.location.pathname}${Ue.location.hash}${Ue.location.search}`,n=`${Ue.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){let r=this._throttledAddEvent(t,n);if(r===wT){let o=Tr({category:"replay.throttled"});this.addUpdate(()=>!ch(this,{type:gM,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let t=this.lastActiveSpan||Ne(),n=t&&Ie(t),o=(n&&X(n).data||{})[ft];if(!(!n||!o||!["route","custom"].includes(o)))return X(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=QM({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&$()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&UE(this.session.id)}_initializeSessionForSampling(t){let n=this._options.errorSampleRate>0,r=Rm({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;let t=this.session;return Fu(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(t.id))}_addListeners(){try{Ue.document.addEventListener("visibilitychange",this._handleVisibilityChange),Ue.addEventListener("blur",this._handleWindowBlur),Ue.addEventListener("focus",this._handleWindowFocus),Ue.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(QP(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=YM(this)}_removeListeners(){try{Ue.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Ue.removeEventListener("blur",this._handleWindowBlur),Ue.removeEventListener("focus",this._handleWindowFocus),Ue.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;if(Fu(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Bu();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){Z&&ee.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:ae.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=BM(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(Ku(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;let r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){let t={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(),t}async _runFlush(){let t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){Z&&ee.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await ZP(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new ju;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await IT({replayId:t,recordingData:i,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:s=>this.handleException(s)})}catch(n){this.handleException(n),this.stop({reason:"sendError"});let r=$();if(r){let o;n instanceof pl?o="ratelimit_backoff":n instanceof ju?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){Z&&ee.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;let n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();let i=o<this._options.minReplayDuration,s=o>this._options.maxReplayDuration+5e3;if(i||s){Z&&ee.log(`Session duration (${Math.floor(o/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&Z&&ee.log("Flushing initial segment without checkout.");let l=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(c){this.handleException(c)}finally{this._flushLock=void 0,l&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Yu(this.session)}_onMutationHandler(t){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{let l=aO(a.target),c=n.join(",");return l?.matches(c)}))return!1;let r=t.length,o=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=o&&r>o;if(r>i||s){let a=Tr({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function nl(e,t){return[...e,...t].join(",")}function mO({mask:e,unmask:t,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],s=nl(e,[".sentry-mask","[data-sentry-mask]"]),a=nl(t,[]);return{maskTextSelector:s,unmaskTextSelector:a,blockSelector:nl(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:nl(r,[]),ignoreSelector:nl(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function hO({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:i}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return i;let s=n.includes(t),a=r&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return s||a?i.replace(/[\S]/g,"*"):i}var BE='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',gO=["content-length","content-type","accept"],yO=Symbol.for("sentry__originalRequestBody"),HE=!1,$E=!1;function SO(){if(typeof Request>"u"||$E)return;let e=Request;try{let t=function(n,r){let o=new e(n,r);return r?.body!=null&&(o[yO]=r.body),o};t.prototype=e.prototype,j.Request=t,$E=!0}catch{}}var dh=(e=>new Xm(e)),Xm=class{constructor({flushMinDelay:t=t1,flushMaxDelay:n=n1,minReplayDuration:r=l1,maxReplayDuration:o=SE,stickySession:i=!0,useCompression:s=!0,workerUrl:a,_experiments:l={},maskAllText:c=!0,maskAllInputs:u=!0,blockAllMedia:d=!0,mutationBreadcrumbLimit:p=750,mutationLimit:h=1e4,slowClickTimeout:m=7e3,slowClickIgnoreSelectors:_=[],networkDetailAllowUrls:T=[],networkDetailDenyUrls:y=[],networkCaptureBodies:S=!0,networkRequestHeaders:v=[],networkResponseHeaders:w=[],mask:k=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:I=[],block:N=[],unblock:F=[],ignore:R=[],maskFn:U,beforeAddRecordingEvent:Q,beforeErrorSampling:de,onError:V,attachRawBodyFromRequest:we=!1}={}){this.name="Replay";let ie=mO({mask:k,unmask:I,block:N,unblock:F,ignore:R});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:U,maskInputFn:U,maskAttributeFn:(xe,D,le)=>hO({maskAttributes:A,maskAllText:c,privacyOptions:ie,key:xe,value:D,el:le}),...ie,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:xe=>{try{xe.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!l.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,c1),maxReplayDuration:Math.min(o,SE),stickySession:i,useCompression:s,workerUrl:a,blockAllMedia:d,maskAllInputs:u,maskAllText:c,mutationBreadcrumbLimit:p,mutationLimit:h,slowClickTimeout:m,slowClickIgnoreSelectors:_,networkDetailAllowUrls:T,networkDetailDenyUrls:y,networkCaptureBodies:S,networkRequestHeaders:zE(v),networkResponseHeaders:zE(w),beforeAddRecordingEvent:Q,beforeErrorSampling:de,onError:V,attachRawBodyFromRequest:we,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${BE}`:BE,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Dn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return HE}set _isInitialized(t){HE=t}afterAllSetup(t){!Dn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&SO(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(t){let n=this.getReplayId(!0);n&&ho(t,{"sentry.replay_id":n})}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){let n=_O(this._initialOptions,t);this._replay=new Jm({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{let n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function _O(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=_n(n.replaysSessionSampleRate),i=_n(n.replaysOnErrorSampleRate);return o==null&&i==null&&wt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function zE(e){return[...gO,...e.map(t=>t.toLowerCase())]}function CT(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function fh(e){try{return new URL(e,G.location.origin).href}catch{return}}function xT(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function ph(e){try{return new Headers(e)}catch{return}}var mh={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function NT(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:s,onRequestSpanStart:a,onRequestSpanEnd:l}={...mh,...t},c=typeof o=="function"?o:h=>!0,u=h=>EO(h,s),d={},p=e.getOptions().propagateTraceparent;n&&yo(h=>{let m=Wp(h,c,u,d,{propagateTraceparent:p,onRequestSpanEnd:l});if(m){let _=fh(h.fetchData.url),T=_?Ln(_).host:void 0;m.setAttributes({"http.url":_?Ft(_):void 0,"server.address":T}),i&&RT(m,e),a?.(m,{headers:h.headers})}}),r&&Qa(h=>{let m=TO(h,c,u,d,p,l);m&&(i&&RT(m,e),a?.(m,{headers:ph(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}var vO=300;function RT(e,t){let{url:n}=X(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(Rt(t)){let i=e.end.bind(e);e.end=s=>{let a=s??Ce(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(a),clearTimeout(u))};r=c;let u=setTimeout(c,vO)}}let o=nr("resource",({entries:i})=>{i.forEach(s=>{xT(s)&&s.name.endsWith(n)&&(e.setAttributes(Ka(s)),r())})})}function EO(e,t){let n=ln();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}let i=r.origin===o;return t?Ct(r.toString(),t)||i&&Ct(r.pathname,t):i}else{let r=!!e.match(/^\/(?!\/)/);return t?Ct(e,t):r}}function TO(e,t,n,r,o,i){let s=e.xhr,a=s?.[rr];if(!s||s.__sentry_own_request__||!a)return;let{url:l,method:c}=a,u=pt()&&t(l);if(e.endTimestamp){let S=s.__sentry_xhr_span_id__;if(!S)return;let v=r[S];v&&(u&&a.status_code!==void 0&&(qi(v,a.status_code),v.end(),i?.(v,{headers:ph(Za(s)),error:e.error})),delete r[S]);return}let d=fh(l),p=d?Ln(d):Ln(l),h=Ft($c(l)),m=$(),T=!!Ne()||!!m&&Rt(m),y=u&&T?St({name:`${c} ${h}`,attributes:{url:Ft(l),type:"xhr","http.method":c,"http.url":d?Ft(d):void 0,"server.address":p?.host,[Se]:"auto.http.browser",[ze]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new xt;return u&&!T&&m?.recordDroppedEvent("no_parent_span","span"),s.__sentry_xhr_span_id__=y.spanContext().spanId,r[s.__sentry_xhr_span_id__]=y,n(l)&&IO(s,pt()&&T?y:void 0,o),m&&m.emit("beforeOutgoingRequestSpan",y,e),y}function IO(e,t,n){let{"sentry-trace":r,baggage:o,traceparent:i}=is({span:t,propagateTraceparent:n});r&&wO(e,r,o,i)}function wO(e,t,n,r){let o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!o?.traceparent&&e.setRequestHeader("traceparent",r),n){let i=o?.baggage;(!i||!CT(i))&&e.setRequestHeader("baggage",n)}}catch{}}var bT=new WeakMap,kT=new WeakMap,CO=9e4,xO=["text/event-stream","application/x-ndjson","application/stream+json"],AT=()=>({name:"FetchStreamPerformance",setup(){eu(e=>{if(e.response){let t=bT.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=kT.get(e.response);n&&clearTimeout(n)}}}),yo(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!xO.some(l=>t.startsWith(l)))return;let n=e.fetchData?.url||"",r=e.fetchData?.method||"GET",o=yr(n),i=n.startsWith("data:")?Ft(n):o?es(o):n,s=St({name:`${r} ${i}`,startTime:e.endTimestamp,attributes:{url:Ft(n),"http.method":r,type:"fetch",[ze]:"http.client.stream",[Se]:"auto.http.browser.stream"}});bT.set(e.response,s);let a=setTimeout(()=>{s.isRecording()&&s.end()},CO);kT.set(e.response,a)}})}});function MT(){G.document?G.document.addEventListener("visibilitychange",()=>{let e=Ne();if(!e)return;let t=Ie(e);if(G.document.hidden&&t){let n="cancelled",{op:r,status:o}=X(t);Ye&&x.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:2,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Ye&&x.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var RO=3600,PT="sentry_previous_trace",NO="sentry.previous_trace";function OT(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t==="session-storage",o=r?AO():void 0;e.on("spanStart",s=>{if(Ie(s)!==s)return;let a=K().getPropagationContext();o=bO(o,s,a),r&&kO(o)});let i=!0;n&&e.on("beforeSampling",s=>{if(!o)return;let a=K(),l=a.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(hh(o.spanContext))},sampleRand:o.sampleRand}),s.parentSampled=hh(o.spanContext),s.parentSampleRate=o.sampleRate,s.spanAttributes={...s.spanAttributes,[Gi]:o.sampleRate}})}function bO(e,t,n){let r=X(t);function o(){try{let a=Number(r.data?.[Pr]??n.dsc?.sample_rate);return Number.isNaN(a)?0:a}catch{return 0}}let i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return i;let s=e.spanContext;return s.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=RO&&(Ye&&x.log(`Adding previous_trace \`${JSON.stringify(s)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:s,attributes:{[Cc]:"previous_trace"}}),t.setAttribute(NO,`${s.traceId}-${s.spanId}-${hh(s)?1:0}`)),i)}function kO(e){try{G.sessionStorage.setItem(PT,JSON.stringify(e))}catch(t){Ye&&x.warn("Could not store previous trace in sessionStorage",t)}}function AO(){try{let e=G.sessionStorage?.getItem(PT);return JSON.parse(e)}catch{return}}function hh(e){return e.traceFlags===1}var MO="BrowserTracing",PO=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function BT(){let e=G.navigator;return e?.userAgent?PO.test(e.userAgent):!1}var OO={...Zi,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...mh},gh=((e={})=>{"enableElementTiming"in e&&wt(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=G.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:s,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:u,finalTimeout:d,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:m,traceXHR:_,trackFetchStreamPerformance:T,shouldCreateSpanForRequest:y,enableHTTPTimings:S,ignoreResourceSpans:v,ignorePerformanceApiSpans:w,instrumentPageLoad:k,instrumentNavigation:A,detectRedirects:I,linkPreviousTrace:N,consistentTraceSampling:F,enableReportPageLoaded:R,onRequestSpanStart:U,onRequestSpanEnd:Q}={...OO,...e},de=BT(),V,we,ie;function xe(D,le,q=!0){let oe=le.op==="pageload",ce=le.name,ge=c?c(le):le,yt=ge.attributes||{};if(ce!==ge.name&&(yt[ft]="custom",ge.attributes=yt),!q){let It=rn();St({...ge,startTime:It}).end(It);return}t.name=ge.name,t.source=yt[ft];let Tt=Bc(ge,{idleTimeout:u,finalTimeout:d,childSpanTimeout:p,disableAutoFinish:oe,beforeSpanEnd:It=>{V?.();let en=Rt(D);lm(It,{recordClsOnPageloadSpan:!en&&!a,recordLcpOnPageloadSpan:!en&&!l,ignoreResourceSpans:v,ignorePerformanceApiSpans:w,spanStreamingEnabled:en}),UT(D,void 0);let Nn=K(),He=Nn.getPropagationContext();Nn.setPropagationContext({...He,traceId:Tt.spanContext().traceId,sampled:an(Tt),dsc:lt(It)}),oe&&(ie=void 0)},trimIdleSpanEndTimestamp:!R});oe&&R&&(ie=Tt),UT(D,Tt);function Re(){n&&["interactive","complete"].includes(n.readyState)&&D.emit("idleSpanEnableAutoFinish",Tt)}oe&&!R&&n&&(n.addEventListener("readystatechange",()=>{Re()}),Re())}return{name:MO,setup(D){if(de){Ye&&x.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}Mc();let le=Rt(D);if(V=om({recordClsStandaloneSpans:le?void 0:a||!1,recordLcpStandaloneSpans:le?void 0:l||!1,client:D}),le?(mm(D),hm(D),r&&gm()):r&&dm(),i&&j.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?sm():o&&im(),s&&am(),I&&n){let oe=()=>{we=Ce()};addEventListener("click",oe,{capture:!0}),addEventListener("keydown",oe,{capture:!0,passive:!0})}function q(){let oe=gl(D);oe&&!X(oe).timestamp&&(Ye&&x.log(`[Tracing] Finishing current active span with op: ${X(oe).op}`),oe.setAttribute(Or,"cancelled"),oe.end())}D.on("startNavigationSpan",(oe,ce)=>{if($()!==D)return;if(ce?.isRedirect){Ye&&x.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),xe(D,{op:"navigation.redirect",...oe},!1);return}we=void 0,q(),Ve().setPropagationContext({traceId:Gt(),sampleRand:Math.random(),propagationSpanId:pt()?void 0:Dt()});let ge=K();ge.setPropagationContext({traceId:Gt(),sampleRand:Math.random(),propagationSpanId:pt()?void 0:Dt()}),ge.setSDKProcessingMetadata({normalizedRequest:void 0}),xe(D,{op:"navigation",...oe,parentSpan:null,forceTransaction:!0})}),D.on("startPageLoadSpan",(oe,ce={})=>{if($()!==D)return;q();let ge=ce.sentryTrace||LT("sentry-trace")||DT("sentry-trace"),yt=ce.baggage||LT("baggage")||DT("baggage"),Tt=lp(ge,yt),Re=K();Re.setPropagationContext(Tt),pt()||(Re.getPropagationContext().propagationSpanId=Dt()),Re.setSDKProcessingMetadata({normalizedRequest:ls()}),xe(D,{op:"pageload",...oe})}),D.on("endPageloadSpan",()=>{R&&ie&&(ie.setAttribute(Or,"reportPageLoaded"),ie.end())})},afterAllSetup(D){if(de)return;let le=ln();if(N!=="off"&&OT(D,{linkPreviousTrace:N,consistentTraceSampling:F}),G.location){if(k){let q=Oe();HT(D,{name:G.location.pathname,startTime:q?q/1e3:void 0,attributes:{[ft]:"url",[Se]:"auto.pageload.browser"}})}A&&Wr(({to:q,from:oe})=>{if(oe===void 0&&le?.indexOf(q)!==-1){le=void 0;return}le=void 0;let ce=yr(q),ge=gl(D),yt=ge&&I&&DO(ge,we);$T(D,{name:ce?.pathname||G.location.pathname,attributes:{[ft]:"url",[Se]:"auto.navigation.browser"}},{url:q,isRedirect:yt})})}h&&MT(),s&&LO(D,u,d,p,t),r&&fm(),NT(D,{traceFetch:m,traceXHR:_,tracePropagationTargets:D.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:y,enableHTTPTimings:S,onRequestSpanStart:U,onRequestSpanEnd:Q}),T&&D.addIntegration(AT())}}});function HT(e,t,n){e.emit("startPageLoadSpan",t,n),K().setTransactionName(t.name);let r=gl(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function $T(e,t,n){let{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});let i=K();return i.setTransactionName(t.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...ls(),url:r}}),gl(e)}function LT(e){return G.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function DT(e){return G.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function LO(e,t,n,r,o){let i=G.document,s,a=()=>{let l="ui.action.click",c=gl(e);if(c){let u=X(c).op;if(["navigation","pageload"].includes(u)){Ye&&x.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(Or,"interactionInterrupted"),s.end(),s=void 0),!o.name){Ye&&x.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}s=Bc({name:o.name,op:l,attributes:{[ft]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}var zT="_sentry_idleSpan";function gl(e){return e[zT]}function UT(e,t){$e(e,zT,t)}var FT=1.5;function DO(e,t){let n=X(e),r=rn(),o=n.start_timestamp;return!(r-o>FT||t&&r-t<=FT)}var rI=gn(Vr(),1);function nI(e){return An(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Th(e){let t={...e};Wa(t,"react"),ii("react",{version:rI.version});let n=Tm(t);return ji(QO),n}function QO(e){return nI(e)?"[SyntheticEvent]":el(e)}var oI=gn(Vr(),1);function ZO(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function eL(e,t){let n=new WeakSet;function r(o,i){if(!n.has(o)){if(o.cause)return n.add(o),r(o.cause,i);o.cause=i}}r(e,t)}function iI(e,{componentStack:t},n){if(ZO(oI.version)&&kn(e)&&t){let r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,eL(e,r)}return On(r=>(r.setContext("react",{componentStack:t}),Ur(e,n)))}var gi=gn(Vr(),1);var sI=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Ih={componentStack:null,error:null,eventId:null},xs=class extends gi.Component{constructor(t){super(t),this.state=Ih,this._openFallbackReportDialog=!0;let n=$();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Iu({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:s,dialogOptions:a}=this.props;On(l=>{o&&o(l,t,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,u=iI(t,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(t,r,u),s&&(this._lastEventId=u,this._openFallbackReportDialog&&Iu({...a,eventId:u})),this.setState({error:t,componentStack:r,eventId:u})})}componentDidMount(){let{onMount:t}=this.props;t&&t()}componentWillUnmount(){let{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===Ih?o(null,null,null):o(t,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){let{onReset:t}=this.props,{error:n,componentStack:r,eventId:o}=this.state;t&&t(n,r,o),this.setState(Ih)}render(){let{fallback:t,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;let o=typeof t=="function"?gi.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return gi.isValidElement(o)?o:(t&&sI&&x.warn("fallback did not produce a valid ReactElement"),null)}};function wh(e,t){if(e==null||e==="")return t;let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)&&n>=0&&n<=1?n:t}var qr=window.__vidfarmSentry,lI=qr?.dsn?.trim()||"";if(lI){let e=qr?.environment?.trim()||"development",t=e==="production"?.1:1,n=e==="production"?.1:1,r=["localhost",window.location.origin,`${window.location.origin}/api`],o=Array.from(new Set([...r,...qr?.tracePropagationTargets??[]].filter(Boolean)));Th({dsn:lI,environment:e,release:qr?.release?.trim()||void 0,integrations:[gh(),dh({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:wh(qr?.tracesSampleRate,t),tracePropagationTargets:o,replaysSessionSampleRate:wh(qr?.replaysSessionSampleRate,n),replaysOnErrorSampleRate:wh(qr?.replaysOnErrorSampleRate,1),enableLogs:qr?.enableLogs??!0,sendDefaultPii:qr?.sendDefaultPii??!0})}var Di=gn(Vr(),1),Cx=gn(vf(),1),xx=gn(NC(),1);var bC=e=>{let t,n=new Set,r=(c,u)=>{let d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){let p=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,o,a);return a},Ef=(e=>e?bC(e):bC);var cc=gn(Vr(),1);var rU=e=>e;function kC(e,t=rU){let n=cc.default.useSyncExternalStore(e.subscribe,cc.default.useCallback(()=>t(e.getState()),[e,t]),cc.default.useCallback(()=>t(e.getInitialState()),[e,t]));return cc.default.useDebugValue(n),n}var oU="vidfarm:flockposter-cache:v1",iU="public",Tf={channels:[],posts:[],channelsUpdatedAt:null,calendarUpdatedAt:null,calendarRangeStart:null,calendarRangeEnd:null};function PC(e){return`${oU}_${e?.trim()||iU}`}function Hy(e){if(typeof window>"u")return Tf;try{let t=window.localStorage.getItem(PC(e));if(!t)return Tf;let n=JSON.parse(t);return!n||typeof n!="object"?Tf:{channels:Array.isArray(n.channels)?n.channels:[],posts:Array.isArray(n.posts)?n.posts:[],channelsUpdatedAt:typeof n.channelsUpdatedAt=="string"?n.channelsUpdatedAt:null,calendarUpdatedAt:typeof n.calendarUpdatedAt=="string"?n.calendarUpdatedAt:null,calendarRangeStart:typeof n.calendarRangeStart=="string"?n.calendarRangeStart:null,calendarRangeEnd:typeof n.calendarRangeEnd=="string"?n.calendarRangeEnd:null}}catch{return Tf}}function AC(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(PC(t),JSON.stringify(e))}catch{}}function OC(e){let t=Hy(e);return Ef((n,r)=>({...t,setChannelsData:o=>{let i=r(),s={...i,channels:[...i.channels.filter(MC),...o.filter(a=>!MC(a))],channelsUpdatedAt:new Date().toISOString()};AC(s,e),n(s)},setCalendarData:o=>{let i=r(),s=sU([...i.channels,...o.channels]),a=o.replaceRange?aU(i.posts,o.posts,o.rangeStart,o.rangeEnd):By([...i.posts,...o.posts]),l={...i,channels:s,posts:a,channelsUpdatedAt:new Date().toISOString(),calendarUpdatedAt:new Date().toISOString(),calendarRangeStart:lU(i.calendarRangeStart,o.rangeStart),calendarRangeEnd:cU(i.calendarRangeEnd,o.rangeEnd)};AC(l,e),n(l)}}))}function sU(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function MC(e){return e.id.startsWith("email:")||e.platform?.toLowerCase()==="email"}function By(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function aU(e,t,n,r){let o=Date.parse(n),i=Date.parse(r);return Number.isNaN(o)||Number.isNaN(i)?By([...e,...t]):By([...e.filter(s=>{let a=Date.parse(s.scheduledAt);return Number.isNaN(a)||a<o||a>i}),...t])}function lU(e,t){return e?Date.parse(t)<Date.parse(e)?t:e:t}function cU(e,t){return e?Date.parse(t)>Date.parse(e)?t:e:t}function LC(e){return Ef(t=>({boot:e,hydratedAt:null,setHydratedAt:n=>t({hydratedAt:n})}))}var M=gn(Vr(),1),Li=gn(vf(),1),f=gn(uc(),1),Lf=1024*1024,ax=50*Lf,gU=2*Lf,yU=3*Lf,SU=Math.floor(3.5*Lf),_U=2048,lx="chat";function ra(e){let t=e.id||e.attachment_id||e.file_id||"",n=e.fileName||e.file_name,r=e.contentType||e.content_type,o=e.viewUrl||e.view_url||"";return!t||!n||!r||!o?null:{id:t,fileName:n,contentType:r,viewUrl:o,sizeBytes:typeof e.sizeBytes=="number"?e.sizeBytes:e.size_bytes,folderPath:e.folderPath??e.folder_path??""}}function Mf(e){return e.contentType.startsWith("image/")}function Yy(e){return e.contentType.startsWith("video/")}var vU=new Set(["apng","avif","gif","jpeg","jpg","png","svg","webp"]),EU=new Set(["m4v","mov","mp4","mpeg","mpg","ogv","webm"]),BC=1200,$y=24,zy=80,TU=/^data:([^;,]+)[^,]*,/i,HC=/authorization|api[-_]?key|secret|token|vidfarm-api-key/i,IU=48e3,jy=14,wU=12e3,CU=1200,xU=30;function Nf(e){if(e==null||e==="")return"";if(typeof e=="string")try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}return JSON.stringify(e,null,2)}function bf(e){let t=TU.exec(e);return t?`[${t[1]} data URL omitted, ${e.length.toLocaleString()} chars]`:e.length>BC?`${e.slice(0,BC)}\u2026 [truncated ${e.length.toLocaleString()} chars]`:e}function Oi(e,t=0){if(e==null)return e;if(typeof e=="string")return bf(e);if(typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(!(typeof e=="function"||typeof e=="symbol")){if(t>=8)return"[nested payload omitted]";if(Array.isArray(e)){let n=e.slice(0,$y).map(r=>Oi(r,t+1));return e.length>$y&&n.push(`[${e.length-$y} more items omitted]`),n}if(typeof e=="object"){let n={},r=Object.entries(e);for(let[o,i]of r.slice(0,zy)){let s=Oi(i,t+1);s!==void 0&&(n[o]=s)}return r.length>zy&&(n.__omitted_keys=r.length-zy),n}return String(e)}}function cx(e){return Oi(e)}function fc(e){return{...e,request:{...e.request,headers:Object.fromEntries(Object.entries(e.request.headers).map(([t,n])=>[t,HC.test(t)?"[redacted]":bf(n)])),body:Oi(e.request.body)},result:{...e.result,headers:Object.fromEntries(Object.entries(e.result.headers).map(([t,n])=>[t,HC.test(t)?"[redacted]":bf(n)])),body:Oi(e.result.body),error:e.result.error?bf(e.result.error):e.result.error}}}function RU(){let e=new Date,t=null,n=null;try{t=new Intl.DateTimeFormat(void 0,{dateStyle:"full",timeStyle:"long"}).format(e)}catch{t=e.toString()}try{n=Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{n=null}return{currentDateTime:e.toISOString(),localDateTime:t,timeZone:n}}function ux(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Wy(e){let t=ux(e);return t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),t=t.replace(/(^|[^\*])\*([^*]+)\*(?!\*)/g,"$1<em>$2</em>"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),t=t.replace(/(^|[\s(])(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/g,'$1<a href="$2" target="_blank" rel="noopener noreferrer">$2</a>'),t}function dx(e){let t=e.replace(/\r\n/g,`
|
|
32
|
-
`).trim();return t?t.split(/\n{2,}/).map(r=>{let o=r.trim();if(!o)return"";if(o.startsWith("```")&&o.endsWith("```")){let l=o.replace(/^```[^\n]*\n?/,"").replace(/\n?```$/,"");return`<pre><code>${ux(l)}</code></pre>`}let i=o.split(`
|
|
33
|
-
`);return i.every(l=>/^[-*]\s+/.test(l.trim()))?`<ul>${i.map(c=>c.trim().replace(/^[-*]\s+/,"")).map(c=>`<li>${Wy(c)}</li>`).join("")}</ul>`:i.every(l=>/^\d+\.\s+/.test(l.trim()))?`<ol>${i.map(c=>c.trim().replace(/^\d+\.\s+/,"")).map(c=>`<li>${Wy(c)}</li>`).join("")}</ol>`:`<p>${i.map(l=>Wy(l.trim())).join("<br />")}</p>`}).filter(Boolean).join(""):""}function NU(e){return e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function bU(e){return/^item \d+$/i.test(e.trim())||/^output$/i.test(e.trim())}function kU(e){try{let n=new URL(e).searchParams.get("key");return n?.trim()?n.trim().replace(/^\/+/,""):null}catch{return null}}function Pf(e){try{return decodeURIComponent(e)}catch{return e}}function Qy(e){let t=kU(e);if(t){let n=Pf(t.split("/").filter(Boolean).pop()||"");if(n)return n}try{let n=new URL(e).pathname;return Pf(n.split("/").filter(Boolean).pop()||"")}catch{return""}}function fx(e){return Qy(e)||"Output"}function px(e,t){let n=Qy(e);return n||t.trim().replace(/[\\/:*?"<>|]+/g,"-")||"download"}function AU(e){let n=Qy(e).split(".").pop()?.trim().toLowerCase()||"";return vU.has(n)?"image":EU.has(n)?"video":null}function MU(e){let t=new Set,n=/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,r=/(^|[\s(])(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/gm,o=null;for(;(o=n.exec(e))!==null;)t.add(o[2]);for(;(o=r.exec(e))!==null;)t.add(o[2]);return[...t]}function PU(e,t=[]){let n=new Set(t),r=new Set,o=[];for(let i of MU(e)){if(n.has(i)||r.has(i))continue;let s=AU(i);s&&(r.add(i),o.push({kind:s,url:i,label:fx(i)}))}return o}function Ky(e,t,n=new Set,r=[]){if(!(t.length>=12||e==null)){if(typeof e=="string"){let o=e.trim();if(/^https?:\/\//i.test(o)&&!n.has(o)){n.add(o);let i=r.length?r[r.length-1]||"Output":"",s=NU(i),a=fx(o);t.push({label:a!=="Output"?a:s&&!bU(i)?s:a,url:o})}return}if(Array.isArray(e)){for(let[o,i]of e.entries())if(Ky(i,t,n,[...r,`item ${o+1}`]),t.length>=12)return;return}if(typeof e=="object"){for(let[o,i]of Object.entries(e))if(Ky(i,t,n,[...r,o]),t.length>=12)return}}}function $C(e){return[`Started render \`${e.job_id}\`${e.tracer?` with tracer \`${e.tracer}\``:""}.`,"If it takes a while, ask for an update later and I can check it for you."].join(`
|
|
34
|
-
|
|
35
|
-
`)}function Zy(e){return typeof e=="string"&&e.startsWith("primitive:brainstorm_")}function eS(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!n||typeof n!="object")continue;let r=n,o={artifact_id:typeof r.artifact_id=="string"?r.artifact_id:void 0,kind:typeof r.kind=="string"?r.kind:void 0,storage_key:typeof r.storage_key=="string"?r.storage_key:void 0,public_url:typeof r.public_url=="string"?r.public_url:void 0,metadata:r.metadata&&typeof r.metadata=="object"?r.metadata:null,created_at:typeof r.created_at=="string"?r.created_at:void 0};(o.public_url||o.storage_key)&&t.push(o)}return t}function mx(e){return e?Pf(e.split("/").filter(Boolean).pop()||"result.json"):"JSON result"}function OU(e){return Pf(e?.split("/").filter(Boolean).pop()||"")}function LU(e){switch(e){case"primitive:brainstorm_hooks":return"Hooks JSON";case"primitive:brainstorm_angles":return"Angles JSON";case"primitive:brainstorm_awareness_stages":return"Awareness JSON";case"primitive:brainstorm_coldstart":return"Coldstart JSON";default:return"Brainstorm JSON"}}function hx(e){if(e.status!=="succeeded"||!Zy(e.primitive_id))return[];let t=[];for(let[n,r]of eS(e.artifacts).entries()){let o=r.public_url?.trim(),i=r.storage_key?.trim();if(!(r.kind==="json"||!!(o&&/\.json(?:[?#]|$)/i.test(o))||!!(i&&/\.json$/i.test(i)))||!o)continue;let a=mx(r.storage_key),l=LU(e.primitive_id);t.push({key:r.artifact_id||`${e.job_id}:${o}:${n}`,url:o,label:a==="result.json"?l:`${l} \u2022 ${a}`,primitiveId:e.primitive_id,primitiveType:e.primitive_type,jobId:e.job_id})}return t}function DU(e){return e==="primitive:brainstorm_awareness_stages"?"Awareness response":"Brainstorm response"}function gx(e){if(e.status!=="succeeded"||!Zy(e.primitive_id))return[];let t=[];for(let[n,r]of eS(e.artifacts).entries()){let o=r.public_url?.trim(),i=r.storage_key?.trim(),s=OU(i),a=/^prompt\./i.test(s),l=r.kind==="text"?!!(o&&/\.md(?:[?#]|$)/i.test(o)||i&&/\.md$/i.test(i)):!!(o&&/\.md(?:[?#]|$)/i.test(o)||i&&/\.md$/i.test(i)),c=!!(o&&/\.txt(?:[?#]|$)/i.test(o)||i&&/\.txt$/i.test(i));if(!o||a||!l&&!c)continue;let u=DU(e.primitive_id);t.push({key:r.artifact_id||`${e.job_id}:${o}:${n}`,url:o,label:s==="response.md"||s==="response.txt"?u:mx(i),jobId:e.job_id,format:l?"markdown":"text"})}return t}function wf(e){if(e.status==="succeeded"){let t=[];Ky(e.result,t);let n=[`Render \`${e.job_id}\` succeeded.`];return Zy(e.primitive_id)&&(hx(e).length||gx(e).length)&&(n.push(""),n.push("Open the result below. It contains the brainstorm output you can review, copy, and reuse.")),t.length&&(n.push(""),n.push("Outputs:"),n.push(...t.map(({url:r,label:o})=>`- [${o}](${r})`))),n.join(`
|
|
36
|
-
`)}return e.status==="failed"?`Render \`${e.job_id}\` failed.${e.error?.message?` ${e.error.message}`:""}`:e.status==="cancelled"?`Render \`${e.job_id}\` was cancelled.`:`Render \`${e.job_id}\` is ${e.status}.`}function Cf(e,t){let n=e.trim(),r=t.trim();return!r||n.includes(r)?e:n?`${n}
|
|
37
|
-
|
|
38
|
-
${r}`:r}var UU=48;function FU(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=UU}function BU(e,t){let n=[...e??[]],r=n.findIndex(o=>o.pollMode==="automatic"&&o.pollJobId===t.pollJobId);return r===-1?(n.push(t),n):(n[r]=t,n)}var zC=3e4,HU=18e4,jC=4,WC=40,$U=1500,GC=250;function Mi(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.job_id!="string"||typeof t.status!="string"?null:{job_id:t.job_id,tracer:typeof t.tracer=="string"?t.tracer:void 0,status:t.status,primitive_id:typeof t.primitive_id=="string"?t.primitive_id:void 0,primitive_type:typeof t.primitive_type=="string"?t.primitive_type:void 0,operation_name:typeof t.operation_name=="string"?t.operation_name:void 0,progress:typeof t.progress=="number"?t.progress:null,result:t.result,artifacts:eS(t.artifacts),error:t.error&&typeof t.error=="object"?{message:typeof t.error.message=="string"?t.error.message:void 0,type:typeof t.error.type=="string"?t.error.type:void 0}:null}}function zU(e){if(!e)return!1;try{let t=typeof window<"u"?window.location.origin:"http://localhost";return new URL(e,t).pathname.startsWith("/api/v1/primitives")}catch{return!1}}function na(e){return e==="succeeded"||e==="failed"||e==="cancelled"}function VC(e,t,n){return`${e}::${t}::${n}`}function gt(e,t){let n=new Headers;return e&&n.set("vidfarm-api-key",e),t&&n.set("content-type",t),n}async function Pi(e){return await e.json()}async function Gy(e){return await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{if(typeof r.result=="string"){t(r.result);return}n(new Error("Unable to read attachment contents."))},r.onerror=()=>n(r.error??new Error("Unable to read attachment contents.")),r.readAsDataURL(e)})}async function qC(e){return await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{if(typeof r.result=="string"){t(r.result);return}n(new Error("Unable to read compressed attachment contents."))},r.onerror=()=>n(r.error??new Error("Unable to read compressed attachment contents.")),r.readAsDataURL(e)})}function jU(e){if(!e)return 0;let t=";base64,",n=e.indexOf(t);if(n<0)return e.length;let r=e.slice(n+t.length).replace(/\s/g,""),o=r.endsWith("==")?2:r.endsWith("=")?1:0;return Math.max(0,Math.floor(r.length*3/4)-o)}function yx(e){return e.reduce((t,n)=>t+jU(n.transportData),0)}async function WU(e,t,n){return await new Promise(r=>{e.toBlob(o=>r(o),t,n)})}async function GU(e){if(typeof createImageBitmap=="function")try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,close:()=>t.close()}}catch{}return await new Promise(t=>{let n=new Image,r=URL.createObjectURL(e);n.onload=()=>{URL.revokeObjectURL(r),t({source:n,width:n.naturalWidth||n.width,height:n.naturalHeight||n.height})},n.onerror=()=>{URL.revokeObjectURL(r),t(null)},n.src=r})}async function VU(e,t){if(!e.type.startsWith("image/")||t<=0)return;let n=Math.min(yU,t),r=Math.min(gU,n);if(e.size<=r)return Gy(e);let o=await GU(e);if(!o||o.width<=0||o.height<=0)return e.size<=n?Gy(e):void 0;try{let i=null,s=[_U,1600,1280,1024],a=[.86,.78,.7,.62,.54];for(let l of s){let c=Math.min(1,l/Math.max(o.width,o.height)),u=Math.max(1,Math.round(o.width*c)),d=Math.max(1,Math.round(o.height*c)),p=document.createElement("canvas");p.width=u,p.height=d;let h=p.getContext("2d");if(h){h.fillStyle="#fff",h.fillRect(0,0,u,d),h.drawImage(o.source,0,0,u,d);for(let m of a){let _=await WU(p,"image/jpeg",m);if(_&&(_.size<=n&&(!i||_.size<i.size)&&(i=_),_.size<=r))return qC(_)}}}return i&&(e.size>n||i.size<e.size)?qC(i):e.size<=n?Gy(e):void 0}finally{o.close?.()}}async function Sx(e){let t=SU-e.currentInlineBytes,n=await VU(e.file,t).catch(()=>{});return n?{...e.attachment,transportData:n}:e.attachment}async function qU(e){let t=e.maxBytes??ax,n=e.limitLabel??"50 MB";if(e.file.size>t)throw new Error(`File uploads can be at most ${n}.`);let r=new FormData;r.append("file",e.file),r.append("folder_path",e.folderPath||"");let o=await fetch("/api/v1/user/me/attachments/upload",{method:"POST",headers:gt(e.apiKey),body:r}),i=await Pi(o);if(!o.ok||!i.attachment)throw new Error(i.error||"Unable to upload attachment.");return ra(i.attachment)??(()=>{throw new Error("Attachment response was incomplete.")})()}async function YU(e){let t=await fetch("/api/v1/user/me/attachments",{headers:gt(e)}),n=await Pi(t);if(!t.ok)throw new Error(n.error||"Unable to load My Files.");let r=[];for(let o of n.attachments??[]){let i=ra(o);i&&r.push({...i,createdAt:o.createdAt??o.created_at})}return{attachments:r,folders:n.folders??[]}}async function _x(e){if(e.file.size>100*1024*1024)throw new Error("Temporary files can be at most 100 MB.");let t=await fetch("/api/v1/user/me/temporary-files/presign",{method:"POST",headers:gt(e.apiKey,"application/json"),body:JSON.stringify({file_name:e.file.name,content_type:e.file.type||void 0,size_bytes:e.file.size,folder_path:e.folderPath||void 0})}),n=await Pi(t);if(!t.ok||!("transport"in n))throw new Error("error"in n&&n.error||"Unable to prepare temporary upload.");if(n.transport==="server"){let a=new FormData;a.append(n.upload.form_field||"file",e.file),a.append("folder_path",e.folderPath||"");let l=await fetch(n.upload.url,{method:n.upload.method||"POST",headers:gt(e.apiKey),body:a}),c=await Pi(l);if(!l.ok||!c.file)throw new Error(c.error||"Unable to upload temporary file.");let u=ra(c.file);if(!u)throw new Error("Temporary file response was incomplete.");return{...u,createdAt:c.file.createdAt??c.file.created_at,expiresAt:c.file.expiresAt??c.file.expires_at,s3Url:c.file.s3Url??c.file.s3_url}}let r=await fetch(n.upload.url,{method:n.upload.method,headers:n.upload.headers,body:e.file});if(!r.ok)throw new Error(`Upload failed with status ${r.status}.`);let o=await fetch("/api/v1/user/me/temporary-files",{method:"POST",headers:gt(e.apiKey,"application/json"),body:JSON.stringify({file_id:n.file_id,file_name:n.file_name,content_type:n.content_type,size_bytes:e.file.size,storage_key:n.storage_key,folder_path:n.folder_path||e.folderPath||""})}),i=await Pi(o);if(!o.ok||!i.file)throw new Error(i.error||"Unable to save temporary file.");let s=ra(i.file);if(!s)throw new Error("Temporary file response was incomplete.");return{...s,createdAt:i.file.createdAt??i.file.created_at,expiresAt:i.file.expiresAt??i.file.expires_at,s3Url:i.file.s3Url??i.file.s3_url}}async function KU(e){let t=await fetch("/api/v1/user/me/temporary-files",{headers:gt(e)}),n=await Pi(t);if(!t.ok)throw new Error(n.error||"Unable to load temporary files.");let r=[];for(let o of n.files??[]){let i=ra(o);i&&r.push({...i,createdAt:o.createdAt??o.created_at,expiresAt:o.expiresAt??o.expires_at,s3Url:o.s3Url??o.s3_url})}return{files:r,folders:n.folders??[]}}async function YC(e,t){let n=new URL("/api/v1/user/me/generated-media",window.location.origin);n.searchParams.set("limit","24"),t&&n.searchParams.set("cursor",t);let r=await fetch(`${n.pathname}${n.search}`,{headers:gt(e)}),o=await Pi(r);if(!r.ok)throw new Error(o.error||"Unable to load recent media.");let i=[];for(let s of o.media??[]){let a=ra(s);a&&i.push({...a,createdAt:s.createdAt??s.created_at,jobId:typeof s.job_id=="string"?s.job_id:void 0,tracer:typeof s.tracer=="string"?s.tracer:void 0,templateId:typeof s.template_id=="string"?s.template_id:void 0})}return{media:i,nextCursor:o.next_cursor??null}}function JU(e){return e.reduce((t,n)=>{let r=n.attachments.reduce((o,i)=>o+i.fileName.length+i.contentType.length+32,0);return t+n.text.length+r},0)}function XU(e,t){let n=e.trim().replace(/\s+/g," ");return n.length<=t?n:`${n.slice(0,Math.max(0,t-32)).trimEnd()}\u2026 [truncated]`}function QU(e){if(e.length<=jy||JU(e)<=IU)return e;let t=e.slice(-jy),n=e.slice(0,-jy),r=[],o=0;for(let i of n){let s=i.attachments.length?` Attachments: ${i.attachments.map(l=>`${l.fileName} (${l.contentType})`).join(", ")}.`:"",a=`[${i.role}]: ${XU(`${i.text}${s}`,CU)}`;if(o+a.length>wU){r.push(`[${n.length-r.length} earlier messages omitted]`);break}r.push(a),o+=a.length}return[{id:kf("assistant"),role:"assistant",text:["[Earlier in this conversation - compacted summary]","Older turns were summarized before sending this request so the chat can continue efficiently.","",r.join(`
|
|
39
|
-
|
|
40
|
-
`)].join(`
|
|
41
|
-
`),attachments:[]},...t]}function ZU(e){return e.length?["Attached file URLs for REST payloads:",...e.map(n=>`- ${n.fileName} (${n.contentType}): ${n.viewUrl}`),"Use these exact URLs as prompt_attachments for primitive image generation, source_image_url for primitive image edits, media_url for primitive video slides, or reference attachment URLs when calling template routes."].join(`
|
|
42
|
-
`):null}function eF(e){let t=e.length-1;return e.map((n,r)=>{let o=ZU(n.attachments);return{role:n.role,content:[...n.text?[{type:"text",text:n.text}]:[],...o?[{type:"text",text:o}]:[],...n.attachments.map(i=>({type:"file",data:r===t&&i.transportData||i.viewUrl,mediaType:i.contentType}))]}})}function tF(){let t=window.__vidfarmFlockPosterCache?.readSnapshot?.();if(!t)return{};let n=Array.isArray(t?.channels)?t.channels.map(r=>r&&typeof r=="object"?r:null).filter(r=>typeof r?.id=="string"&&!!r.id.trim()).map(r=>({id:String(r?.id||""),name:typeof r?.name=="string"?r.name:null,title:typeof r?.title=="string"?r.title:null,handle:typeof r?.handle=="string"?r.handle:null,platform:typeof r?.platform=="string"?r.platform:null,status:typeof r?.status=="string"?r.status:null})):[];return n.length||t?.channelsUpdatedAt?{scheduleChannels:n,scheduleChannelsUpdatedAt:t?.channelsUpdatedAt??null}:{}}function nF(){let e=window.__vidfarmLibrarySelection?.readSelectedPosts?.();return{selectedPosts:Array.isArray(e?.posts)?e.posts.map(n=>n&&typeof n=="object"?n:null).filter(n=>typeof n?.post_id=="string"&&!!n.post_id.trim()).map(n=>({post_id:String(n?.post_id||""),title:typeof n?.title=="string"?n.title:null,caption:typeof n?.caption=="string"?n.caption:null,tracer:typeof n?.tracer=="string"?n.tracer:null,status:typeof n?.status=="string"?n.status:null,share_url:typeof n?.share_url=="string"?n.share_url:null,media:Array.isArray(n?.media)?n.media.slice(0,8).map(r=>r&&typeof r=="object"?r:null).filter(Boolean).map(r=>({url:typeof r?.url=="string"?r.url:null,kind:typeof r?.kind=="string"?r.kind:null,role:typeof r?.role=="string"?r.role:null,content_type:typeof r?.content_type=="string"?r.content_type:null})):[]})):[],selectedPostsUpdatedAt:e?.updatedAt??null}}async function rF(e,t){if(!e.body)throw new Error("Chat response did not include a body.");let n=e.body.getReader(),r=new TextDecoder,o="";for(;;){let{done:i,value:s}=await n.read();if(i)break;o+=r.decode(s,{stream:!0});let a=o.split(`
|
|
43
|
-
|
|
44
|
-
`);o=a.pop()??"";for(let l of a){let c=l.split(`
|
|
45
|
-
`).map(h=>h.trim()).find(h=>h.startsWith("data:"));if(!c)continue;let u=c.slice(5).trim();if(u==="[DONE]")continue;let d;try{d=JSON.parse(u)}catch{continue}if(!d||typeof d!="object")continue;let p=d;if(p.type==="text-delta"&&typeof p.delta=="string")t.onDelta(p.delta);else if(p.type==="status"){let h=typeof p.status=="string"?p.status:typeof p.message=="string"?p.message:null;h&&t.onStatus&&t.onStatus(h)}else p.type==="tool-call"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string"&&t.onToolCall?t.onToolCall({toolCallId:p.toolCallId,toolName:p.toolName,args:p.args&&typeof p.args=="object"?p.args:void 0}):p.type==="tool-result"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string"&&t.onToolResult?t.onToolResult({toolCallId:p.toolCallId,toolName:p.toolName,result:p.result}):p.type==="error"&&t.onError&&t.onError?.(typeof p.errorText=="string"?p.errorText:typeof p.error?.message=="string"?p.error.message:"Unable to read assistant response.")}}}function oF(e){return{threads:`vidfarm-editor-chat-threads:${e}`,activeThread:`vidfarm-editor-chat-active-thread:${e}`}}function iF(){if(typeof window>"u")return null;try{return window.sessionStorage}catch{try{return window.localStorage}catch{return null}}}function KC(){return`thread-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function kf(e){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`${e}-${crypto.randomUUID()}`:`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Yn(e){let t=new Set,n=[];for(let r of e){let o=r.trim();!o||t.has(o)||(t.add(o),n.push(o))}return n}function Vy(...e){return Yn(e.flat())}function sF(e){let t=e.trim();return!t||t.startsWith("archived_")?t:`archived_${t}`}function Jy(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,"").slice(-8):Math.random().toString(16).slice(2,10).padEnd(8,"0").slice(0,8)}function aF(e){return(e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tracer").slice(0,28)}function lF(e,t){let n=aF(e),r="";do r=`${n}-${Jy()}`;while(t.includes(r));return r}function cF(e,t){let n=e.trim();if(!n)return"";if(/-[a-z0-9]{8}$/i.test(n))return n;let r=`${n}-${Jy()}`;for(;t.includes(r);)r=`${n}-${Jy()}`;return r}function Af(){let e=new URLSearchParams(window.location.search),t=[...e.getAll("tracers"),...e.getAll("tracer")],n=[];for(let r of t){let o=r.trim();if(!o)continue;let i=o.startsWith("[")&&o.endsWith("]")?o.slice(1,-1):o;n.push(...i.split(",").map(s=>s.trim().replace(/^["']|["']$/g,"")))}return Yn(n)}function JC(){let e=new URLSearchParams(window.location.search);return(e.get("thread_id")||e.get("threadId")||e.get("chat_id")||e.get("chatId")||"").trim()}function xf(e){let t=e.trim().replace(/\s+/g," ");return t?t.length>42?`${t.slice(0,42).trimEnd()}\u2026`:t:"New chat"}function uF(e,t){return e.map(n=>({id:n.id,templateId:n.templateId,title:n.title,createdAt:n.createdAt,updatedAt:n.updatedAt,lastMessageAt:n.lastMessageAt??null,messageCount:Math.max(n.messageCount??0,n.messages.length),tracers:n.tracers,hiddenFromView:n.hiddenFromView,messages:(n.id===t?n.messages.slice(-xU):[]).map(r=>({id:r.id,role:r.role,text:r.text,attachments:r.attachments.map(o=>({id:o.id,fileName:o.fileName,contentType:o.contentType,viewUrl:o.viewUrl})),toolExchanges:r.toolExchanges?.map(o=>({...o,args:Oi(o.args),result:cx(o.result)})),httpExchanges:r.httpExchanges?.map(fc)}))}))}function dF(e,t){if(!e)return[];try{let n=JSON.parse(e);return Array.isArray(n)?n.filter(r=>r&&typeof r.id=="string").map(r=>({id:r.id,templateId:typeof r.templateId=="string"&&r.templateId.trim()?r.templateId:t,title:typeof r.title=="string"&&r.title.trim()?r.title:"New chat",createdAt:typeof r.createdAt=="string"?r.createdAt:new Date().toISOString(),updatedAt:typeof r.updatedAt=="string"?r.updatedAt:new Date().toISOString(),lastMessageAt:typeof r.lastMessageAt=="string"?r.lastMessageAt:null,messageCount:Math.max(typeof r.messageCount=="number"?r.messageCount:0,Array.isArray(r.messages)?r.messages.length:0),tracers:Yn(Array.isArray(r.tracers)?r.tracers.filter(o=>typeof o=="string"):[]),hiddenFromView:r.hiddenFromView===!0,messages:Array.isArray(r.messages)?r.messages.map(o=>({id:o.id,role:o.role,text:o.text,attachments:Array.isArray(o.attachments)?o.attachments:[],toolExchanges:Array.isArray(o.toolExchanges)?o.toolExchanges:[],httpExchanges:Array.isArray(o.httpExchanges)?o.httpExchanges:[]})):[]})):[]}catch{return[]}}function XC(e,t){return!e||typeof e.id!="string"?null:{id:e.id,templateId:typeof e.templateId=="string"&&e.templateId.trim()?e.templateId:t,title:typeof e.title=="string"&&e.title.trim()?e.title:"New chat",createdAt:typeof e.createdAt=="string"?e.createdAt:new Date().toISOString(),updatedAt:typeof e.updatedAt=="string"?e.updatedAt:new Date().toISOString(),lastMessageAt:typeof e.lastMessageAt=="string"?e.lastMessageAt:null,messageCount:Math.max(typeof e.messageCount=="number"?e.messageCount:0,Array.isArray(e.messages)?e.messages.length:0),tracers:Yn(Array.isArray(e.tracers)?e.tracers.filter(n=>typeof n=="string"):[]),hiddenFromView:e.hiddenFromView===!0,messages:Array.isArray(e.messages)?e.messages.map(n=>({id:n.id,role:n.role,text:n.text,attachments:Array.isArray(n.attachments)?n.attachments:[],toolExchanges:Array.isArray(n.toolExchanges)?n.toolExchanges:[],httpExchanges:Array.isArray(n.httpExchanges)?n.httpExchanges:[]})):[]}}function QC(e,t){let n=new Map;for(let r of t){let o=e.find(i=>i.id===r.id);n.set(r.id,{...r,lastMessageAt:r.lastMessageAt??o?.lastMessageAt??null,messageCount:Math.max(r.messageCount??0,o?.messageCount??0,r.messages.length,o?.messages.length??0),messages:r.messages.length?r.messages:o?.messages??[]})}for(let r of e)n.has(r.id)||n.set(r.id,r);return[...n.values()].sort((r,o)=>Date.parse(o.updatedAt)-Date.parse(r.updatedAt))}function fF(e){return[...e].sort((t,n)=>Date.parse(n.updatedAt)-Date.parse(t.updatedAt))}function dc(e,t){return t.length?e.tracers.some(n=>t.some(r=>pF(n,r))):!0}function pF(e,t){let n=e.trim(),r=t.trim();return!n||!r?!1:n===r?!0:n.startsWith(`${r}-`)&&/-[a-z0-9]{8}$/i.test(n)}function mF(e){return(0,f.jsxs)("div",{className:"vf-editor-chat-attachment",children:[(0,f.jsx)("span",{className:"vf-editor-chat-attachment-name",children:e.attachment.fileName}),e.onRemove?(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-attachment-remove","aria-label":"Remove attachment",onClick:e.onRemove,children:"\xD7"}):null]})}function tS(){return(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M10 3v9"}),(0,f.jsx)("path",{d:"m6.5 8.5 3.5 3.5 3.5-3.5"}),(0,f.jsx)("path",{d:"M4 16h12"})]})}function hF(){return(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M4.2 15.8c1.6.5 3.1-.1 3.7-1.7.6-1.4 1.8-2.1 3.5-2.1"}),(0,f.jsx)("path",{d:"m10.7 11.6 5.2-5.2a1.9 1.9 0 0 0-2.7-2.7L8 8.9"}),(0,f.jsx)("path",{d:"m7.9 9 3.1 3.1"}),(0,f.jsx)("path",{d:"M3.5 16.5c1.4.5 3.6.5 4.9-.8"})]})}function nS(){return(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M8.4 11.6a3.2 3.2 0 0 0 4.5 0l2.2-2.2a3.2 3.2 0 0 0-4.5-4.5L9.4 6.1"}),(0,f.jsx)("path",{d:"M11.6 8.4a3.2 3.2 0 0 0-4.5 0L4.9 10.6a3.2 3.2 0 0 0 4.5 4.5l1.2-1.2"})]})}function rS(){return(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("rect",{x:"7",y:"7",width:"9",height:"9",rx:"2"}),(0,f.jsx)("path",{d:"M5 12H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1"})]})}function Rf(e){return(0,f.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transform:e.open?"rotate(90deg)":"rotate(0deg)"},children:(0,f.jsx)("path",{d:"m7 4 6 6-6 6"})})}function vx(e){let t=e.label.trim().replace(/[\\/:*?"<>|]+/g,"-");if(t)return t;try{return new URL(e.url,window.location.href).pathname.split("/").filter(Boolean).pop()||"media"}catch{return"media"}}function ZC(e,t=!1){if(typeof window>"u"||e.kind!=="image"||!e.url)return"";let n=new URL("/inpaint",window.location.origin),r=window.__vidfarmEditorTracers,i=(r?.get()??Af())[0]||(t?r?.add()??"":"");return i&&n.searchParams.set("tracer",i),n.searchParams.set("source_image_url",e.url),n.searchParams.set("source_image_name",e.label||vx(e)),n.toString()}function gF(e){let[t,n]=(0,M.useState)(!1),[r,o]=(0,M.useState)(""),{onClose:i}=e,s=e.gallery?.length?e.gallery:[e.preview],a=Math.max(0,s.findIndex(T=>T.url===e.preview.url)),[l,c]=(0,M.useState)(a),u=s[l]||e.preview,d=s.length>1,p=u.kind==="image",h=p&&ZC(u,!1)||"/inpaint";(0,M.useEffect)(()=>{n(!0)},[]),(0,M.useEffect)(()=>{o("")},[u.url]);let m=async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(u.url);else{let T=document.createElement("textarea");T.value=u.url,T.style.position="fixed",T.style.opacity="0",document.body.appendChild(T),T.focus(),T.select(),document.execCommand("copy"),document.body.removeChild(T)}o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)},_=T=>{let y=ZC(u,!0);if(!y){T.preventDefault();return}T.preventDefault(),window.open(y,"_blank","noopener,noreferrer")};return(0,M.useEffect)(()=>{let T=y=>{if(y.key==="Escape"){i();return}d&&(y.key==="ArrowLeft"?(y.preventDefault(),c(S=>(S-1+s.length)%s.length)):y.key==="ArrowRight"&&(y.preventDefault(),c(S=>(S+1)%s.length)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[d,s.length,i]),t?(0,Li.createPortal)((0,f.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal",onClick:T=>T.stopPropagation(),children:[(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:u.url,target:"_blank",rel:"noopener noreferrer",children:d?`${u.label} (${l+1} of ${s.length})`:u.label}),(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[d?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:()=>c(T=>(T-1+s.length)%s.length),"aria-label":"Previous image",title:"Previous image",children:"\u2039"}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:()=>c(T=>(T+1)%s.length),"aria-label":"Next image",title:"Next image",children:"\u203A"})]}):null,p?(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:h,target:"_blank",rel:"noopener noreferrer",onClick:_,"aria-label":"Open image editor",title:"Image edit",children:(0,f.jsx)(hF,{})}):null,(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:u.url,download:vx(u),"aria-label":"Download media",title:"Download",children:(0,f.jsx)(tS,{})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{m()},"aria-label":r==="done"?"Media URL copied":r==="error"?"Unable to copy media URL":"Copy media URL",title:r==="done"?"Copied":r==="error"?"Copy failed":"Copy link",children:(0,f.jsx)(nS,{})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close media preview",title:"Close",children:"\xD7"})]})]}),(0,f.jsx)("div",{className:"vf-editor-chat-media-modal-body",children:u.kind==="image"?(0,f.jsx)("img",{src:u.url,alt:u.label,className:"vf-editor-chat-media-modal-image"}):(0,f.jsx)("video",{src:u.url,className:"vf-editor-chat-media-modal-video",controls:!0,autoPlay:!0,playsInline:!0})})]})}),document.body):null}function yF(e){let[t,n]=(0,M.useState)(!1);return(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-message-thumb-button is-image",onClick:()=>e.onOpenModal(e.preview,e.previews),"aria-label":`Preview ${e.preview.label}`,title:e.preview.label,"data-error":t?"true":"false",children:t?(0,f.jsx)("span",{className:"vf-editor-chat-message-thumb-fallback",children:"Preview unavailable"}):(0,f.jsx)("img",{src:e.preview.url,alt:e.preview.label,className:"vf-editor-chat-message-attachment-thumb",loading:"lazy",onError:()=>n(!0)})})}function ex(e){return(0,f.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,f.jsxs)("button",{type:"button",className:"vf-editor-chat-message-thumb-button",onClick:()=>e.onOpenModal(e.preview),"aria-label":`Preview ${e.preview.label}`,children:[(0,f.jsx)("video",{src:e.preview.url,className:"vf-editor-chat-message-attachment-thumb vf-editor-chat-message-video-thumb",preload:"metadata",muted:!0,playsInline:!0}),(0,f.jsx)("span",{className:"vf-editor-chat-message-video-play","aria-hidden":"true"})]})})}function tx(e){return e.previews.length?(0,f.jsx)("div",{className:"vf-editor-chat-message-image-rail","aria-label":"Image previews",children:e.previews.map(t=>(0,f.jsx)(yF,{preview:t,previews:e.previews,onOpenModal:e.onOpenModal},t.url))}):null}function SF(e){return(0,f.jsxs)("div",{className:"vf-editor-chat-composer-attachment-item",children:[Mf(e.attachment)?(0,f.jsx)("img",{src:e.attachment.viewUrl,alt:e.attachment.fileName,className:"vf-editor-chat-composer-attachment-thumb"}):(0,f.jsx)("div",{className:"vf-editor-chat-composer-attachment-file","aria-hidden":"true",children:e.attachment.fileName.slice(0,1).toUpperCase()}),(0,f.jsx)("div",{className:"vf-editor-chat-composer-attachment-meta",children:(0,f.jsx)("span",{className:"vf-editor-chat-composer-attachment-name",children:e.attachment.fileName})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-composer-attachment-remove","aria-label":`Remove ${e.attachment.fileName}`,onClick:e.onRemove,children:"\xD7"})]})}function _F(e){let[t,n]=(0,M.useState)(!1),[r,o]=(0,M.useState)(!1),i=Nf(e.exchange.request.body),s=Nf(e.exchange.result.body),a=e.exchange.request.url,l=a.length>52?`${a.slice(0,52).trimEnd()}...`:a,c=e.exchange.result.status>=400||!!e.exchange.result.error,u=e.exchange.result.status>=200&&e.exchange.result.status<300;return(0,M.useEffect)(()=>{o(!0)},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-card",children:(0,f.jsxs)("button",{type:"button",className:"vf-editor-chat-http-card-header",onClick:()=>n(!0),"aria-label":`Open HTTP details for ${e.exchange.request.method} ${a}`,children:[(0,f.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,f.jsx)("span",{className:"vf-editor-chat-http-url",title:a,children:l}),(0,f.jsxs)("span",{className:"vf-editor-chat-http-status","data-error":c?"true":"false","data-success":u?"true":"false",children:[e.exchange.result.status,e.exchange.result.statusText?` ${e.exchange.result.statusText}`:""]}),(0,f.jsx)("span",{className:"vf-editor-chat-http-expand","aria-hidden":"true",children:"+"})]})}),r&&t?(0,Li.createPortal)((0,f.jsx)("div",{className:"vf-editor-chat-http-modal-backdrop",onClick:()=>n(!1),children:(0,f.jsxs)("div",{className:"vf-editor-chat-http-modal",onClick:d=>d.stopPropagation(),children:[(0,f.jsxs)("div",{className:"vf-editor-chat-http-modal-header",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-http-modal-header-main",children:[(0,f.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,f.jsx)("span",{className:"vf-editor-chat-http-modal-url",children:a}),(0,f.jsxs)("span",{className:"vf-editor-chat-http-status","data-error":c?"true":"false","data-success":u?"true":"false",children:[e.exchange.result.status,e.exchange.result.statusText?` ${e.exchange.result.statusText}`:""]})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-http-modal-close",onClick:()=>n(!1),"aria-label":"Close HTTP details",children:"\xD7"})]}),(0,f.jsxs)("div",{className:"vf-editor-chat-http-card-body is-modal",children:[e.exchange.explanation?(0,f.jsx)("div",{className:"vf-editor-chat-http-note",children:e.exchange.explanation}):null,(0,f.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-label",children:"URL"}),(0,f.jsx)("pre",{className:"vf-editor-chat-http-pre",children:a})]}),i?(0,f.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-label",children:"Request"}),(0,f.jsx)("pre",{className:"vf-editor-chat-http-pre",children:i})]}):null,(0,f.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-label",children:"Response"}),(0,f.jsx)("pre",{className:"vf-editor-chat-http-pre",children:e.exchange.result.error||s||"(empty)"})]}),Object.keys(e.exchange.result.headers).length?(0,f.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-label",children:"Headers"}),(0,f.jsx)("pre",{className:"vf-editor-chat-http-pre",children:Nf(e.exchange.result.headers)})]}):null]})]})}),document.body):null]})}function nx(e){return typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"?String(e):e===null?"null":JSON.stringify(e)}function oS(e){if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(e);let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t),Promise.resolve()}function br(e){return(0,f.jsxs)("div",{className:"vf-editor-chat-json-line",style:{paddingLeft:`${e.depth*18+12}px`},children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-copy","aria-label":"Copy line",title:"Copy line",onClick:()=>e.onCopy(e.text),children:(0,f.jsx)(rS,{})}),(0,f.jsx)("span",{className:"vf-editor-chat-json-line-text",children:e.text})]})}function Xy(e){let t=e.value,n=e.isLast?"":",";if(Array.isArray(t)){let r=e.path,o=e.collapsedPaths.has(r),i=`${e.linePrefix??""}[`;return t.length?o?(0,f.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Expand JSON block",children:(0,f.jsx)(Rf,{open:!1})}),(0,f.jsx)(br,{text:`${e.linePrefix??""}[ \u2026 ]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Collapse JSON block",children:(0,f.jsx)(Rf,{open:!0})}),(0,f.jsx)(br,{text:i,depth:e.depth,onCopy:e.onCopy})]}),t.map((s,a)=>(0,f.jsx)(Xy,{value:s,depth:e.depth+1,path:`${r}.${a}`,isLast:a===t.length-1,collapsedPaths:e.collapsedPaths,togglePath:e.togglePath,onCopy:e.onCopy},`${r}:${a}`)),(0,f.jsx)(br,{text:`]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsx)(br,{text:`${e.linePrefix??""}[]${n}`,depth:e.depth,onCopy:e.onCopy})}if(t&&typeof t=="object"){let r=Object.entries(t),o=e.path,i=e.collapsedPaths.has(o),s=`${e.linePrefix??""}{`;return r.length?i?(0,f.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Expand JSON block",children:(0,f.jsx)(Rf,{open:!1})}),(0,f.jsx)(br,{text:`${e.linePrefix??""}{ \u2026 }${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Collapse JSON block",children:(0,f.jsx)(Rf,{open:!0})}),(0,f.jsx)(br,{text:s,depth:e.depth,onCopy:e.onCopy})]}),r.map(([a,l],c)=>{let u=`${JSON.stringify(a)}: `;return l&&typeof l=="object"?(0,f.jsx)(Xy,{value:l,depth:e.depth+1,linePrefix:u,path:`${o}.${a}`,isLast:c===r.length-1,collapsedPaths:e.collapsedPaths,togglePath:e.togglePath,onCopy:e.onCopy},`${o}:${a}`):(0,f.jsx)(br,{text:`${u}${nx(l)}${c===r.length-1?"":","}`,depth:e.depth+1,onCopy:e.onCopy},`${o}:${a}`)}),(0,f.jsx)(br,{text:`}${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsx)(br,{text:`${e.linePrefix??""}{}${n}`,depth:e.depth,onCopy:e.onCopy})}return(0,f.jsx)(br,{text:`${e.linePrefix??""}${nx(t)}${n}`,depth:e.depth,onCopy:e.onCopy})}function Ex(e){let[t,n]=(0,M.useState)(new Set),[r,o]=(0,M.useState)(""),i=a=>{n(l=>{let c=new Set(l);return c.has(a)?c.delete(a):c.add(a),c})},s=async a=>{try{await oS(a),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1400)};return(0,f.jsxs)("div",{className:"vf-editor-chat-json-viewer",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-toolbar",children:[(0,f.jsx)("span",{className:"vf-editor-chat-json-file",children:e.storageKey}),(0,f.jsx)("span",{className:"vf-editor-chat-json-copy-state","data-state":r,children:r==="done"?"Copied line":r==="error"?"Copy failed":"Hover a line to copy"})]}),(0,f.jsx)("div",{className:"vf-editor-chat-json-scroll",children:(0,f.jsx)(Xy,{value:e.value,depth:0,path:"root",collapsedPaths:t,togglePath:i,onCopy:s})})]})}function vF(e){let[t,n]=(0,M.useState)(!1),[r,o]=(0,M.useState)(""),i=px(e.artifact.url,`${e.artifact.label}.json`),s=Nf(e.data);(0,M.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await oS(s),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,M.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Li.createPortal)((0,f.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,f.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{a()},title:r==="done"?"Copied":r==="error"?"Copy failed":"Copy JSON","aria-label":r==="done"?"JSON copied":r==="error"?"Unable to copy JSON":"Copy JSON",children:(0,f.jsx)(rS,{})}),(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,download:i,title:"Download JSON","aria-label":"Download JSON",children:(0,f.jsx)(tS,{})}),(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",title:"Open raw JSON","aria-label":"Open raw JSON",children:(0,f.jsx)(nS,{})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close JSON preview",title:"Close",children:"\xD7"})]})]}),(0,f.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,f.jsx)(Ex,{value:e.data,storageKey:e.artifact.label})})]})}),document.body):null}function EF(e){let[t,n]=(0,M.useState)(!1),[r,o]=(0,M.useState)(!1),[i,s]=(0,M.useState)(null),[a,l]=(0,M.useState)(null),[c,u]=(0,M.useState)(!1),d=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).json();s(_)}catch(m){l(m instanceof Error?m.message:"Unable to load JSON artifact.")}finally{u(!1)}}},p=()=>{let m=!t;n(m),m&&d()},h=()=>{d(),o(!0)};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:"JSON result"}),(0,f.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,f.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview JSON"}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,f.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,f.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading JSON\u2026"}):a?(0,f.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,f.jsx)(Ex,{value:i,storageKey:e.artifact.label}):null}):null]}),r&&i!==null?(0,f.jsx)(vF,{artifact:e.artifact,data:i,onClose:()=>o(!1)}):null]})}function Tx(e){return e.format==="markdown"?(0,f.jsx)("div",{className:"vf-editor-chat-doc-markdown",dangerouslySetInnerHTML:{__html:dx(e.text)}}):(0,f.jsx)("pre",{className:"vf-editor-chat-doc-pre",children:e.text})}function TF(e){let[t,n]=(0,M.useState)(!1),[r,o]=(0,M.useState)(""),i=e.artifact.format==="markdown"?".md":".txt",s=px(e.artifact.url,`${e.artifact.label}${i}`);(0,M.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await oS(e.text),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,M.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Li.createPortal)((0,f.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,f.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{a()},title:r==="done"?"Copied":r==="error"?"Copy failed":e.artifact.format==="markdown"?"Copy markdown":"Copy text","aria-label":r==="done"?"Document copied":r==="error"?"Unable to copy document":e.artifact.format==="markdown"?"Copy markdown":"Copy text",children:(0,f.jsx)(rS,{})}),(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,download:s,title:e.artifact.format==="markdown"?"Download markdown":"Download text","aria-label":e.artifact.format==="markdown"?"Download markdown":"Download text",children:(0,f.jsx)(tS,{})}),(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",title:"Open raw file","aria-label":"Open raw file",children:(0,f.jsx)(nS,{})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close document preview",title:"Close",children:"\xD7"})]})]}),(0,f.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,f.jsx)("div",{className:"vf-editor-chat-doc-viewer",children:(0,f.jsx)(Tx,{text:e.text,format:e.artifact.format})})})]})}),document.body):null}function IF(e){let[t,n]=(0,M.useState)(!1),[r,o]=(0,M.useState)(!1),[i,s]=(0,M.useState)(null),[a,l]=(0,M.useState)(null),[c,u]=(0,M.useState)(!1),d=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).text();s(_)}catch(m){l(m instanceof Error?m.message:"Unable to load document artifact.")}finally{u(!1)}}},p=()=>{let m=!t;n(m),m&&d()},h=()=>{d(),o(!0)};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:e.artifact.format==="markdown"?"Markdown result":"Text result"}),(0,f.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,f.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview"}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,f.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,f.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading document\u2026"}):a?(0,f.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,f.jsx)("div",{className:"vf-editor-chat-doc-viewer is-inline",children:(0,f.jsx)(Tx,{text:i,format:e.artifact.format})}):null}):null]}),r&&i!==null?(0,f.jsx)(TF,{artifact:e.artifact,text:i,onClose:()=>o(!1)}):null]})}function wF(e){let t=e.message.role==="assistant",n=e.message.text.trim().length>0,r=n?dx(e.message.text):"",[o,i]=(0,M.useState)(null),s=e.message.attachments.filter(Mf),a=e.message.attachments.filter(Yy),l=e.message.attachments.filter(m=>!Mf(m)&&!Yy(m)),c=n?PU(e.message.text,e.message.attachments.map(m=>m.viewUrl)):[],u=c.filter(m=>m.kind==="image"),d=c.filter(m=>m.kind==="video"),p=(e.message.httpExchanges??[]).flatMap(m=>{let _=Mi(m.result.body);return _?hx(_):[]}).filter((m,_,T)=>T.findIndex(y=>y.url===m.url)===_),h=(e.message.httpExchanges??[]).flatMap(m=>{let _=Mi(m.result.body);return _?gx(_):[]}).filter((m,_,T)=>T.findIndex(y=>y.url===m.url)===_);return(0,f.jsxs)("div",{className:`vf-editor-chat-message ${t?"is-assistant":"is-user"}`,children:[(0,f.jsx)("div",{className:"vf-editor-chat-message-meta",children:t?"Copilot":"You"}),(0,f.jsxs)("div",{className:"vf-editor-chat-bubble","data-pending":e.message.isPending?"true":"false",children:[e.message.attachments.length?(0,f.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[l.map(m=>(0,f.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,f.jsx)("a",{className:"vf-editor-chat-message-preview-link",href:m.viewUrl,target:"_blank",rel:"noopener noreferrer",children:(0,f.jsx)(mF,{attachment:m})})},m.id)),(0,f.jsx)(tx,{previews:s.map(m=>({kind:"image",url:m.viewUrl,label:m.fileName})),onOpenModal:(m,_)=>i({preview:m,gallery:_})}),a.map(m=>(0,f.jsx)(ex,{preview:{kind:"video",url:m.viewUrl,label:m.fileName},onOpenModal:_=>i({preview:_,gallery:[_]})},m.id))]}):null,e.message.statusText?(0,f.jsxs)("div",{className:"vf-editor-chat-message-status","aria-live":"polite",children:[(0,f.jsx)("span",{className:"vf-editor-chat-status-dot"}),e.message.statusText]}):null,e.message.httpExchanges?.length?(0,f.jsx)("div",{className:"vf-editor-chat-http-list",children:e.message.httpExchanges.map((m,_)=>(0,f.jsx)(_F,{exchange:m},`${m.request.method}:${m.request.url}:${_}`))}):null,n?(0,f.jsx)("div",{className:"vf-editor-chat-message-body",dangerouslySetInnerHTML:{__html:r}}):e.message.isPending?(0,f.jsxs)("div",{className:"vf-editor-chat-message-loading","aria-hidden":"true",children:[(0,f.jsx)("span",{}),(0,f.jsx)("span",{}),(0,f.jsx)("span",{})]}):null,c.length?(0,f.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[(0,f.jsx)(tx,{previews:u,onOpenModal:(m,_)=>i({preview:m,gallery:_})}),d.map(m=>(0,f.jsx)(ex,{preview:m,onOpenModal:_=>i({preview:_,gallery:[_]})},m.url))]}):null,p.length?(0,f.jsx)("div",{className:"vf-editor-chat-json-list",children:p.map(m=>(0,f.jsx)(EF,{artifact:m},m.key))}):null,h.length?(0,f.jsx)("div",{className:"vf-editor-chat-json-list",children:h.map(m=>(0,f.jsx)(IF,{artifact:m},m.key))}):null]}),o?(0,f.jsx)(gF,{preview:o.preview,gallery:o.gallery,onClose:()=>i(null)}):null]})}function rx(e){if(!e||e<=0)return"Unknown size";let t=["B","KB","MB","GB"],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function ox(e){return Mf(e.file)?(0,f.jsx)("img",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,alt:e.file.fileName}):Yy(e.file)?(0,f.jsx)("video",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,muted:!0,playsInline:!0}):(0,f.jsx)("div",{className:"vf-editor-upload-file-icon","aria-hidden":"true",children:e.file.fileName.slice(0,1).toUpperCase()})}function oo(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Of(e,t){return oo([e,t].filter(Boolean).join("/"))}function ix(e){let t=oo(e).split("/").filter(Boolean);return t.pop(),t.join("/")}function sx(e){return oo(e).split("/").filter(Boolean).at(-1)||"All files"}function CF(e){let t=oo(e.currentFolder),n=t?`${t}/`:"",r=new Map;for(let o of e.folders){let i=oo(o);if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Of(t,a))}for(let o of e.files){let i=oo(o.folderPath??"");if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Of(t,a))}return Array.from(r.entries()).map(([o,i])=>({name:o,path:i})).sort((o,i)=>o.name.localeCompare(i.name))}function qy(e){return e.name==="share"?(0,f.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M14 4h6v6"}),(0,f.jsx)("path",{d:"M10 14 20 4"}),(0,f.jsx)("path",{d:"M20 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4"})]}):e.name==="link"?(0,f.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M10 13a5 5 0 0 0 7.07 0l2.12-2.12a5 5 0 0 0-7.07-7.07L11 4.93"}),(0,f.jsx)("path",{d:"M14 11a5 5 0 0 0-7.07 0L4.81 13.12a5 5 0 0 0 7.07 7.07L13 19.07"})]}):(0,f.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M3 6h18"}),(0,f.jsx)("path",{d:"M8 6V4h8v2"}),(0,f.jsx)("path",{d:"M19 6 18 20H6L5 6"}),(0,f.jsx)("path",{d:"M10 11v5"}),(0,f.jsx)("path",{d:"M14 11v5"})]})}function xF(e){let[t,n]=(0,M.useState)("my-files"),[r,o]=(0,M.useState)([]),[i,s]=(0,M.useState)([]),[a,l]=(0,M.useState)([]),[c,u]=(0,M.useState)(()=>new Set),[d,p]=(0,M.useState)([]),[h,m]=(0,M.useState)([]),[_,T]=(0,M.useState)(()=>new Set),[y,S]=(0,M.useState)(null),[v,w]=(0,M.useState)(!1),[k,A]=(0,M.useState)(""),[I,N]=(0,M.useState)(null),[F,R]=(0,M.useState)(null),[U,Q]=(0,M.useState)(null),[de,V]=(0,M.useState)(null),[we,ie]=(0,M.useState)(null),xe=(0,M.useRef)(null),D=(0,M.useRef)(null),le=(0,M.useMemo)(()=>{let P=d.map(te=>({...te,recentSource:"generated"}));return[...h.map(te=>({...te,recentSource:"temporary"})),...P].sort((te,re)=>{let Te=te.createdAt?Date.parse(te.createdAt):0;return(re.createdAt?Date.parse(re.createdAt):0)-Te})},[d,h]),q=t==="upload"?r:t==="my-files"?i.filter(P=>c.has(P.id)):t==="recents"?le.filter(P=>_.has(P.id)):[];async function oe(){let P=await YU(e.apiKey);s(P.attachments),l(P.folders)}async function ce(P){w(!0);try{let[z,te]=P?[await YC(e.apiKey,P),null]:await Promise.all([YC(e.apiKey),KU(e.apiKey)]);p(re=>P?[...re,...z.media]:z.media),te&&m(te.files),S(z.nextCursor),P||T(new Set)}finally{w(!1)}}(0,M.useEffect)(()=>{e.open&&(V(null),Q(null),oe().catch(P=>V(P instanceof Error?P.message:"Unable to load My Files.")),ce().catch(P=>V(P instanceof Error?P.message:"Unable to load recent media.")))},[e.open]);function ge(){o([]),u(new Set),T(new Set),Q(null),V(null),N(null),R(null),e.onClose()}async function yt(P){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(P);else{let z=document.createElement("textarea");z.value=P,z.style.position="fixed",z.style.opacity="0",document.body.appendChild(z),z.focus(),z.select(),document.execCommand("copy"),document.body.removeChild(z)}Q("File URL copied.")}catch{V("Unable to copy file URL.")}}async function Tt(P,z){if(!P.length)return;V(null);let te=[];for(let re of P)try{if(Q(`Uploading ${re.name}...`),z==="upload"){let Qe=await _x({apiKey:e.apiKey,file:re,folderPath:lx}),Y=await Sx({attachment:Qe,file:re,currentInlineBytes:yx([...r,...te])});te.push(Y);continue}let Te=await qU({apiKey:e.apiKey,file:re,folderPath:k,maxBytes:ax,limitLabel:"50 MB"});te.push(Te)}catch(Te){V(Te instanceof Error?Te.message:"Upload failed.")}z==="upload"?(o(re=>[...re,...te]),await ce().catch(re=>V(re instanceof Error?re.message:"Unable to refresh recent files."))):z==="my-files"&&(await oe(),u(re=>new Set([...re,...te.map(Te=>Te.id)]))),te.length&&Q(`${te.length} file${te.length===1?"":"s"} uploaded.`)}async function Re(P,z){let te=z==="my-files"?`/api/v1/user/me/attachments/${encodeURIComponent(P.id)}`:`/api/v1/user/me/temporary-files/${encodeURIComponent(P.id)}`,re=await fetch(te,{method:"DELETE",headers:gt(e.apiKey,"application/json")}),Te=await re.json().catch(()=>({}));if(!re.ok)throw new Error(Te.error||"Unable to delete file.");z==="my-files"&&(s(Qe=>Qe.filter(Y=>Y.id!==P.id)),u(Qe=>{let Y=new Set(Qe);return Y.delete(P.id),Y})),ie(null),Q("File deleted.")}async function It(P){if(P!=="my-files"||!F||F.mode!=="create")return;let z=Of(F.baseFolder,F.value);if(!z){V("Choose a folder name.");return}let te=await fetch("/api/v1/user/me/attachments/folders",{method:"POST",headers:gt(e.apiKey,"application/json"),body:JSON.stringify({folder_path:z})}),re=await te.json().catch(()=>({}));if(!te.ok){V(re.error||"Unable to create folder.");return}l(Te=>Array.from(new Set([...Te,z])).sort()),R(null),Q("Folder created.")}async function en(P,z){if(P!=="my-files"||!F||F.mode!=="rename")return;let te=F.value.trim(),re=Of(ix(z),te);if(!re||re===z)return;let Te=await fetch("/api/v1/user/me/attachments/folders",{method:"PATCH",headers:gt(e.apiKey,"application/json"),body:JSON.stringify({from_folder_path:z,to_folder_path:re})}),Qe=await Te.json().catch(()=>({}));if(!Te.ok){V(Qe.error||"Unable to rename folder.");return}A(Y=>Y===z||Y.startsWith(`${z}/`)?`${re}${Y.slice(z.length)}`:Y),await oe(),N(null),R(null),Q("Folder renamed.")}async function Nn(P,z){if(P!=="my-files")return;let te=await fetch("/api/v1/user/me/attachments/folders",{method:"DELETE",headers:gt(e.apiKey,"application/json"),body:JSON.stringify({folder_path:z})}),re=await te.json().catch(()=>({}));if(!te.ok){V(re.error||"Unable to delete folder.");return}A(Te=>Te===z||Te.startsWith(`${z}/`)?ix(z):Te),await oe(),N(null),R(null),Q("Folder deleted.")}function He(P){let z=a,te=i,re=k,Te=A,Qe=CF({folders:z,files:te,currentFolder:re}),Y=oo(re).split("/").filter(Boolean);return(0,f.jsxs)("div",{className:"vf-editor-upload-browser",children:[(0,f.jsxs)("div",{className:"vf-editor-upload-browser-toolbar",children:[(0,f.jsxs)("div",{className:"vf-editor-upload-breadcrumb","aria-label":"Current folder",children:[(0,f.jsx)("button",{type:"button","data-current":!re,onClick:()=>Te(""),children:"files"}),Y.map((Le,ue)=>{let Me=Y.slice(0,ue+1).join("/");return(0,f.jsxs)("span",{className:"vf-editor-upload-breadcrumb-segment",children:[(0,f.jsx)("span",{"aria-hidden":"true",children:"/"}),(0,f.jsx)("button",{type:"button","data-current":Me===re,onClick:()=>Te(Me),children:Le})]},Me)})]}),(0,f.jsx)("button",{type:"button",onClick:()=>R({mode:"create",scope:"my-files",baseFolder:re,value:""}),children:"New folder"})]}),Qe.length?(0,f.jsx)("div",{className:"vf-editor-upload-folder-grid",children:Qe.map(Le=>(0,f.jsxs)("article",{className:"vf-editor-upload-folder-row",children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-folder-open",onClick:()=>Te(Le.path),children:[(0,f.jsx)("span",{className:"vf-editor-upload-folder-icon","aria-hidden":"true"}),(0,f.jsx)("span",{children:Le.name})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-folder-menu-button","aria-label":`Folder actions for ${Le.name}`,onClick:()=>N(I===Le.path?null:Le.path),children:"..."}),I===Le.path?(0,f.jsxs)("div",{className:"vf-editor-upload-folder-menu",children:[(0,f.jsx)("button",{type:"button",onClick:()=>R({mode:"rename",scope:"my-files",folderPath:Le.path,value:sx(Le.path)}),children:"Rename"}),(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>R({mode:"delete",scope:"my-files",folderPath:Le.path,value:""}),children:"Delete"})]}):null]},Le.path))}):null]})}function bn(P,z){let te=z==="my-files"?c.has(P.id):z==="recents"?_.has(P.id):!1,re="s3Url"in P&&P.s3Url?P.s3Url:P.viewUrl;return(0,f.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":te?"true":"false",children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-file-select",onClick:()=>{if(z==="temporary"){yt(re);return}(z==="recents"?T:u)(Qe=>{let Y=new Set(Qe);return Y.has(P.id)?Y.delete(P.id):Y.add(P.id),Y})},children:[(0,f.jsx)(ox,{file:P}),(0,f.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,f.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,f.jsxs)("span",{className:"vf-editor-upload-file-meta",children:[rx(P.sizeBytes),P.folderPath?` \xB7 ${P.folderPath}`:""]})]})]}),(0,f.jsxs)("div",{className:"vf-editor-upload-file-actions",children:[z==="my-files"||z==="recents"?(0,f.jsx)("span",{className:"vf-editor-upload-selection-indicator","data-selected":te?"true":"false","aria-hidden":"true",children:te?"\u2713":""}):null,(0,f.jsx)("a",{href:P.viewUrl,target:"_blank",rel:"noreferrer","aria-label":`View ${P.fileName}`,children:(0,f.jsx)(qy,{name:"share"})}),(0,f.jsx)("button",{type:"button","aria-label":`Copy URL for ${P.fileName}`,onClick:()=>{yt(re)},children:(0,f.jsx)(qy,{name:"link"})}),z==="recents"?null:(0,f.jsx)("button",{type:"button","aria-label":`Delete ${P.fileName}`,onClick:()=>ie(we===P.id?null:P.id),children:(0,f.jsx)(qy,{name:"trash"})})]}),z!=="recents"&&we===P.id?(0,f.jsxs)("div",{className:"vf-editor-upload-popconfirm",children:[(0,f.jsx)("span",{children:"Delete this file?"}),(0,f.jsx)("button",{type:"button",onClick:()=>ie(null),children:"Cancel"}),(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{Re(P,z)},children:"Delete"})]}):null]},P.id)}function Wo(){if(!F)return null;let P=F.mode==="create"?"New folder":F.mode==="rename"?"Rename folder":"Delete folder",z=F.mode==="delete"?F.folderPath:"";return(0,f.jsxs)("div",{className:"vf-editor-upload-folder-dialog",role:"dialog","aria-label":P,children:[(0,f.jsx)("div",{className:"vf-editor-upload-folder-dialog-title",children:P}),F.mode==="delete"?(0,f.jsxs)("div",{className:"vf-editor-upload-folder-dialog-copy",children:["Delete ",(0,f.jsx)("strong",{children:z})," and all files inside it?"]}):(0,f.jsx)("input",{value:F.value,autoFocus:!0,placeholder:"folder-name",onChange:te=>R({...F,value:te.target.value}),onKeyDown:te=>{te.key==="Enter"&&(te.preventDefault(),F.mode==="create"?It(F.scope):en(F.scope,F.folderPath))}}),(0,f.jsxs)("div",{className:"vf-editor-upload-folder-dialog-actions",children:[(0,f.jsx)("button",{type:"button",onClick:()=>R(null),children:"Cancel"}),F.mode==="create"?(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{It(F.scope)},children:"Create"}):F.mode==="rename"?(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{en(F.scope,F.folderPath)},children:"Rename"}):(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{Nn(F.scope,F.folderPath)},children:"Delete"})]})]})}if(!e.open)return null;let io=i.filter(P=>oo(P.folderPath??"")===oo(k));return(0,Li.createPortal)((0,f.jsx)("div",{className:"vf-editor-upload-drawer-backdrop",children:(0,f.jsxs)("aside",{className:"vf-editor-upload-drawer","aria-label":"Upload drawer",children:[(0,f.jsxs)("div",{className:"vf-editor-upload-header",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"vf-editor-upload-title",children:"Upload"}),(0,f.jsx)("div",{className:"vf-editor-upload-subtitle",children:"Upload, attach, and copy file URLs."})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-close","aria-label":"Close upload drawer",onClick:ge,children:"\xD7"})]}),(0,f.jsxs)("div",{className:"vf-editor-upload-tabs",role:"tablist",children:[(0,f.jsx)("button",{type:"button","data-active":t==="upload",onClick:()=>n("upload"),children:"Upload file"}),(0,f.jsx)("button",{type:"button","data-active":t==="my-files",onClick:()=>n("my-files"),children:"My Files"}),(0,f.jsx)("button",{type:"button","data-active":t==="recents",onClick:()=>n("recents"),children:"Recents"})]}),(0,f.jsxs)("div",{className:"vf-editor-upload-body",children:[de?(0,f.jsx)("div",{className:"vf-editor-upload-status","data-tone":"error",children:de}):null,U?(0,f.jsx)("div",{className:"vf-editor-upload-status",children:U}):null,Wo(),t==="upload"?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>xe.current?.click(),children:["Upload files to chat",(0,f.jsx)("span",{children:"Stored in Recents and attached after Confirm. Images get compressed inline previews when possible; other files attach by URL. Max 100 MB each."})]}),(0,f.jsx)("input",{ref:xe,type:"file",multiple:!0,hidden:!0,onChange:P=>{Tt(Array.from(P.target.files??[]),"upload"),P.target.value=""}}),(0,f.jsx)("div",{className:"vf-editor-upload-list",children:r.map(P=>(0,f.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":"true",children:[(0,f.jsx)(ox,{file:P}),(0,f.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,f.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,f.jsx)("span",{className:"vf-editor-upload-file-meta",children:rx(P.sizeBytes)})]}),(0,f.jsx)("button",{type:"button",onClick:()=>o(z=>z.filter(te=>te.id!==P.id)),children:"\xD7"})]},P.id))})]}):t==="my-files"?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>D.current?.click(),children:["Add to My Files",(0,f.jsxs)("span",{children:["Uploads into ",sx(k)," and auto-selects. Max 50 MB each."]})]}),(0,f.jsx)("input",{ref:D,type:"file",multiple:!0,hidden:!0,onChange:P=>{Tt(Array.from(P.target.files??[]),"my-files"),P.target.value=""}}),He("my-files"),(0,f.jsx)("div",{className:"vf-editor-upload-list",children:io.length?io.map(P=>bn(P,"my-files")):(0,f.jsx)("div",{className:"vf-editor-upload-empty",children:"No files in this folder."})})]}):t==="recents"?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"vf-editor-upload-list",children:le.length?le.map(P=>bn(P,"recents")):(0,f.jsx)("div",{className:"vf-editor-upload-empty",children:v?"Loading recent files...":"No recent files yet."})}),y?(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-more",disabled:v,onClick:()=>{ce(y).catch(P=>V(P instanceof Error?P.message:"Unable to load more recent media."))},children:v?"Loading...":"Load more generated media"}):null]}):null]}),(0,f.jsxs)("div",{className:"vf-editor-upload-footer",children:[(0,f.jsx)("button",{type:"button",onClick:ge,children:"Cancel"}),(0,f.jsxs)("div",{className:"vf-editor-upload-footer-confirm",children:[(0,f.jsxs)("span",{children:[q.length," file",q.length===1?"":"s"," selected"]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",disabled:!q.length,onClick:()=>{e.onConfirm(q),ge()},children:"Confirm"})]})]})]})}),document.body)}function Ix({boot:e}){let t=e.template.templateId==="chat-brainstorm",n=(0,M.useMemo)(()=>oF(e.template.templateId),[e.template.templateId]),r=(0,M.useMemo)(()=>iF(),[]),o=(0,M.useRef)(null),i=(0,M.useRef)(null),s=(0,M.useRef)(!0),a=(0,M.useRef)(!1),l=(0,M.useRef)(null),c=(0,M.useRef)(null),u=(0,M.useRef)(new Map),d=(0,M.useRef)({nextAvailableAt:0}),p=(0,M.useRef)([]),h=(0,M.useRef)(new Set),[m,_]=(0,M.useState)([]),[T,y]=(0,M.useState)(null),[S,v]=(0,M.useState)(null),[w,k]=(0,M.useState)(null),[A,I]=(0,M.useState)(""),[N,F]=(0,M.useState)([]),[R,U]=(0,M.useState)(null),[Q,de]=(0,M.useState)(null),[V,we]=(0,M.useState)(null),[ie,xe]=(0,M.useState)(!1),[D,le]=(0,M.useState)(!1),[q,oe]=(0,M.useState)(!1),[ce,ge]=(0,M.useState)(!1),[yt,Tt]=(0,M.useState)(!1),[Re,It]=(0,M.useState)(()=>{let g=typeof window<"u"?window.__vidfarmEditorTracers:null;if(g)return g.get();if(typeof window<"u"){let E=Af();if(E.length)return E}return Yn(e.template.tracers||[])}),en=(0,M.useMemo)(()=>{if(!e.threadsUrl)return null;let g=new URL(e.threadsUrl,window.location.origin);return t||g.searchParams.set("template_id",e.template.templateId),g.searchParams.set("include_messages","false"),g.searchParams.set("limit",t?"200":"50"),g.toString()},[e.template.templateId,e.threadsUrl,t]),Nn=g=>e.threadsUrl?new URL(`${e.threadsUrl.replace(/\/$/,"")}/${encodeURIComponent(g)}`,window.location.origin).toString():null;(0,M.useEffect)(()=>{let g=dF(r?.getItem(n.threads)??null,e.template.templateId),E=r?.getItem(n.activeThread)??null,C=JC(),b=window.__vidfarmEditorTracers?.get()??Af(),B=C&&!g.some(fe=>fe.id===C)?[{id:C,templateId:e.template.templateId,title:"Loading chat",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),lastMessageAt:null,messageCount:0,tracers:b,hiddenFromView:!1,messages:[]},...g]:g,J=B.filter(fe=>!fe.hiddenFromView),st=J.find(fe=>dc(fe,b));p.current=B,_(B),C&&J.some(fe=>fe.id===C)?y(C):E&&J.some(fe=>fe.id===E)&&(!b.length||J.some(fe=>fe.id===E&&dc(fe,b)))?y(E):y(st?.id??J[0]?.id??null),xe(!0)},[e.template.templateId,r,n]),(0,M.useEffect)(()=>{if(!e.vidfarmApiKey||!en)return;let g=new AbortController;return(async()=>{try{let E=[],C=null,b=new Set;do{let B=new URL(en);C&&B.searchParams.set("cursor",C);let J=await fetch(B.toString(),{method:"GET",headers:gt(e.vidfarmApiKey),signal:g.signal});if(!J.ok)return;let st=await J.json().catch(()=>null);Array.isArray(st?.threads)&&E.push(...st.threads.map(ye=>XC(ye,e.template.templateId)).filter(ye=>!!ye));let fe=typeof st?.next_cursor=="string"&&st.next_cursor?st.next_cursor:null;!fe||b.has(fe)?C=null:(b.add(fe),C=fe)}while(C&&!g.signal.aborted);if(!E.length)return;_(B=>{let J=QC(B,E);return p.current=J,J}),y(B=>B&&E.some(J=>J.id===B)?B:E[0]?.id??B)}catch(E){if(E instanceof DOMException&&E.name==="AbortError")return}})(),()=>{g.abort()}},[e.template.templateId,e.vidfarmApiKey,en]),(0,M.useEffect)(()=>{p.current=m},[m]),(0,M.useEffect)(()=>{let g=window.__vidfarmEditorTracers;if(g)return It(g.get()),g.subscribe(C=>It(C));let E=()=>{let C=Af();It(C.length?C:Yn(e.template.tracers||[]))};return E(),window.addEventListener("popstate",E),()=>{window.removeEventListener("popstate",E)}},[e.template.tracers]),(0,M.useEffect)(()=>{if(ie)try{r?.setItem(n.threads,JSON.stringify(uF(m,T)))}catch(g){console.warn("Unable to persist editor chat threads.",g)}},[T,r,ie,n,m]),(0,M.useEffect)(()=>{if(ie)try{T?r?.setItem(n.activeThread,T):r?.removeItem(n.activeThread)}catch(g){console.warn("Unable to persist active editor chat thread.",g)}},[T,r,ie,n]);let He=(0,M.useMemo)(()=>m.find(g=>g.id===T)??null,[T,m]),bn=(0,M.useMemo)(()=>m.find(g=>g.id===w?.threadId)??null,[w?.threadId,m]);(0,M.useEffect)(()=>{if(!ie||!e.vidfarmApiKey||!T)return;let g=p.current.find(J=>J.id===T);if(h.current.has(T))return;let E=JC();if(g&&T!==E&&(g.messageCount??0)===0){h.current.add(T);return}let C=Nn(T);if(!C)return;let b=new AbortController;return!g?.messages.length&&v(T),(async()=>{try{let J=await fetch(C,{method:"GET",headers:gt(e.vidfarmApiKey),signal:b.signal});if(!J.ok){let ye=!!(g&&T!==E);J.status===404&&!ye&&U(`Chat ID ${T} was not found for this account.`),h.current.add(T);return}let st=await J.json().catch(()=>null),fe=st?.thread?XC(st.thread,e.template.templateId):null;if(!fe)return;h.current.add(fe.id),U(null),_(ye=>{let ve=QC(ye,[fe]);return p.current=ve,ve})}catch(J){if(J instanceof DOMException&&J.name==="AbortError")return}finally{b.signal.aborted||v(J=>J===T?null:J)}})(),()=>{b.abort(),v(J=>J===T?null:J)}},[T,e.vidfarmApiKey,e.threadsUrl,ie]),(0,M.useEffect)(()=>{if(!ie||He&&!He.hiddenFromView)return;let g=m.find(E=>!E.hiddenFromView&&dc(E,Re));y(g?.id??m.find(E=>!E.hiddenFromView)?.id??null)},[He,ie,m,Re]);let Wo=(0,M.useMemo)(()=>He?.tracers.length?He.tracers:Re,[He?.tracers,Re]),io=(0,M.useMemo)(()=>m.filter(g=>!g.hiddenFromView).sort((g,E)=>{let C=dc(g,Re),b=dc(E,Re);return C!==b?C?-1:1:Date.parse(E.updatedAt)-Date.parse(g.updatedAt)}),[m,Re]),P=Wo[0]??null,z=He?.messages??[],te=Q!==null,re=!!(T&&Q===T),Te=(0,M.useMemo)(()=>(A.trim()||N.length)&&!te,[A,N.length,te]);(0,M.useEffect)(()=>{!ie||!e.vidfarmApiKey||!He||!He.messages.length||Wx(He)},[He,e.vidfarmApiKey,ie]);async function Qe(g,E){if(!e.vidfarmApiKey||!e.threadsUrl||!g.messages.length)return;let C=Nn(g.id);C&&await fetch(C,{method:"PATCH",headers:gt(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:e.template.templateId,title:E?.title??g.title,tracers:E?.tracers??g.tracers,hidden_from_view:E?.hiddenFromView??g.hiddenFromView===!0,archived:E?.archived})}).catch(()=>{})}async function Y(g){if(!e.vidfarmApiKey||!e.threadsUrl||!g.messages.length)return;let E=Nn(g.threadId);E&&await fetch(`${E}/exchanges`,{method:"POST",headers:gt(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:g.templateId??e.template.templateId,title:g.title||"New chat",tracers:g.tracers,messages:g.messages.map(C=>({id:C.id,role:C.role,text:C.text,attachments:C.attachments.map(b=>({id:b.id,fileName:b.fileName,contentType:b.contentType,viewUrl:b.viewUrl})),toolExchanges:C.toolExchanges,httpExchanges:C.httpExchanges?.map(fc)}))})}).catch(()=>{})}async function Le(g){if(!e.vidfarmApiKey||!e.threadsUrl)return;let E=Nn(g);E&&await fetch(E,{method:"DELETE",headers:gt(e.vidfarmApiKey)}).catch(()=>{})}function ue(g){let E=new URL(window.location.href);g.length?E.searchParams.set("tracers",g.join(",")):E.searchParams.delete("tracers"),window.history.replaceState({},"",E.toString()),window.dispatchEvent(new CustomEvent("vidfarm:editor-tracers-changed",{detail:{tracers:g}}))}function Me(g){let E=Yn(g),C=window.__vidfarmEditorTracers;if(C){C.set(E);return}It(E),ue(E)}function pe(){let g=window.__vidfarmEditorTracers;if(g)return g.add();let E=lF(e.template.templateSlug,Re);return Me([E,...Re]),E}function so(g){let E=window.__vidfarmEditorTracers?.get()??Re,C=g?cF(g,E):null,b=window.__vidfarmEditorTracers;return b?b.add(C??void 0):C?(Me([C,...E.filter(B=>B!==C)]),C):pe()}function Nx(g){let E=g.trim();if(!E)return;let C=window.__vidfarmEditorTracers;C?C.add(E):Re.includes(E)||Me([E,...Re]),He&&it(He.id,b=>({...b,tracers:[E,...b.tracers.filter(B=>B!==E)],updatedAt:new Date().toISOString()}))}function bx(g){let E=window.__vidfarmEditorTracers;if(E){E.remove(g);return}let C=Re.filter(b=>b!==g);Me(C)}(0,M.useEffect)(()=>{ue(Re)},[]),(0,M.useEffect)(()=>{let g=i.current;if(!g)return;let E=()=>{s.current=FU(g),s.current||(a.current=!1)};return E(),g.addEventListener("scroll",E,{passive:!0}),()=>{g.removeEventListener("scroll",E)}},[]),(0,M.useLayoutEffect)(()=>{let g=i.current;if(!g)return;let E=l.current!==T;l.current=T,(E||a.current||s.current)&&(g.scrollTo({top:g.scrollHeight,behavior:"auto"}),s.current=!0,a.current=!1)},[z,T]),(0,M.useEffect)(()=>()=>{c.current?.abortController.abort(),c.current=null;for(let g of u.current.values())g.timeoutId!==null&&window.clearTimeout(g.timeoutId),g.abortController?.abort();u.current.clear()},[]),(0,M.useEffect)(()=>{if(!w)return;let g=()=>k(null);return document.addEventListener("click",g),window.addEventListener("resize",g),window.addEventListener("scroll",g,!0),()=>{document.removeEventListener("click",g),window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0)}},[w]),(0,M.useEffect)(()=>{let g=()=>{if(document.visibilityState!=="visible"||!navigator.onLine)return;let E=Date.now();for(let C of u.current.values())C.inFlight||C.nextPollAt!==null&&C.nextPollAt<=E&&C.runPoll&&Bf(C,C.runPoll,C.nextPollAt-E)};return window.addEventListener("online",g),document.addEventListener("visibilitychange",g),()=>{window.removeEventListener("online",g),document.removeEventListener("visibilitychange",g)}},[]);function kx(g){if(He)return He.id;let E=new Date().toISOString(),C=KC(),b={id:C,templateId:e.template.templateId,title:xf(g||""),createdAt:E,updatedAt:E,lastMessageAt:null,messageCount:0,tracers:Yn(Re),messages:[]};return p.current=[b,...p.current],_(B=>[b,...B]),y(C),C}function Ff(g){let E=new Date().toISOString(),C=Yn(g?.tracers??Re),b=KC(),B={id:b,templateId:e.template.templateId,title:g?.title||"New chat",createdAt:E,updatedAt:E,lastMessageAt:null,messageCount:0,tracers:C,messages:[]};return p.current=[B,...p.current],_(J=>[B,...J]),g?.activate!==!1&&(y(b),I(""),F([]),U(null)),k(null),b}function Ax(){Ff(),ge(!1)}function Mx(g){let E=m.find(b=>b.id===g);if(!E||!window.confirm(`Delete conversation "${E.title}"?`))return;let C=m.filter(b=>b.id!==g);p.current=p.current.filter(b=>b.id!==g);for(let[b,B]of u.current.entries())B.threadId===g&&oa(b);_(C),T===g&&y(C[0]?.id??null),U(null),k(null),Le(g)}function it(g,E){let C=fF(p.current.map(b=>b.id===g?E(b):b));p.current=C,_(C)}function Px(g,E){let C=Yn(E);it(g,B=>({...B,tracers:Vy(B.tracers,C),updatedAt:new Date().toISOString()}));let b=p.current.find(B=>B.id===g);b&&Qe({...b,tracers:Vy(b.tracers,C),updatedAt:new Date().toISOString()},{tracers:Vy(b.tracers,C)})}function sS(g,E){let C=g.trim();return C?p.current.find(b=>!b.hiddenFromView&&b.id!==E&&b.tracers.includes(C))?.id??null:null}function Ox(g,E){let C=sS(g);return C||Ff({tracers:[g],title:E?.title||`Tracer ${g}`,activate:E?.activate??!1})}function Lx(g){let E=g.toLowerCase();return/(?:own|separate|different|new)\s+(?:tracer\s+and\s+)?chat\s+threads?/.test(E)||/chat\s+threads?.{0,80}(?:own|separate|different|new)\s+tracers?/.test(E)||/each.{0,80}(?:own|separate|different|new).{0,80}chat\s+threads?/.test(E)||/(?:own|separate|different|new)\s+tracers?/.test(E)||/(?:each|every|per|one\s+per).{0,80}(?:own|separate|different|new).{0,80}tracers?/.test(E)||/(?:own|separate|different|new)\s+tracers?.{0,80}(?:each|every|per|outputs?|pieces?|posts?|jobs?|generations?)/.test(E)||/(?:outputs?|pieces?|posts?|jobs?|generations?).{0,80}(?:own|separate|different|new)\s+tracers?/.test(E)}function Dx(g){let E=sS(g.tracer,g.sourceThreadId);if(!E&&!g.shouldCreateThread)return null;let C=E??Ox(g.tracer,{title:`Tracer ${g.tracer}`,activate:!1});if(!C||C===g.sourceThreadId)return null;let b=kf("assistant"),B=new Date().toISOString(),J=g.job.status==="succeeded"||g.job.status==="failed"||g.job.status==="cancelled"?wf(g.job):$C(g.job),st=g.job.status==="succeeded"||g.job.status==="failed"||g.job.status==="cancelled"?null:`Job ${g.job.job_id} is being tracked. ${Hf()}`,fe={id:b,role:"assistant",text:J,attachments:[],httpExchanges:g.httpExchange?[g.httpExchange]:[],statusText:st,isPending:!1};it(C,ve=>({...ve,updatedAt:B,messages:[...ve.messages,fe]}));let ye=p.current.find(ve=>ve.id===C);return ye&&Y({threadId:C,templateId:ye.templateId,title:ye.title,tracers:ye.tracers,messages:[fe]}),{threadId:C,messageId:b}}function Ux(g){let E=m.find(B=>B.id===g);if(!E)return;let C=window.prompt("Thread tracers, comma separated",E.tracers.join(", "));if(C===null)return;let b=Yn(C.split(","));it(g,B=>({...B,tracers:b,updatedAt:new Date().toISOString()})),Qe(E,{tracers:b}),k(null)}function Fx(g){let E=m.find(B=>B.id===g);if(!E||!window.confirm(`Archive conversation "${E.title}"? Its tracer links will be prefixed with archived_.`))return;let b=Yn(E.tracers.map(sF));it(g,B=>({...B,tracers:b,updatedAt:new Date().toISOString()})),Qe(E,{tracers:b,archived:!0}),k(null)}function Bx(g){let E=m.find(b=>b.id===g);if(!(!E||!window.confirm(`Remove conversation "${E.title}" from this frontend view? The thread and tracer links stay available; Delete removes the thread completely.`))){for(let[b,B]of u.current.entries())B.threadId===g&&oa(b);if(it(g,b=>({...b,hiddenFromView:!0,updatedAt:new Date().toISOString()})),T===g){let b=io.find(B=>B.id!==g);y(b?.id??null)}k(null),U(null),Qe(E,{hiddenFromView:!0})}}async function Hx(g){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(g);else{let E=document.createElement("textarea");E.value=g,E.setAttribute("readonly",""),E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)}U(null)}catch{U("Unable to copy chat ID.")}finally{k(null)}}function $x(g,E){if(w?.threadId===g){k(null);return}let C=E.getBoundingClientRect(),b=148;k({threadId:g,top:C.bottom+6,left:Math.max(8,Math.min(window.innerWidth-b-8,C.right-b))})}function oa(g){let E=u.current.get(g);E&&(E.timeoutId!==null&&window.clearTimeout(E.timeoutId),E.abortController?.abort(),u.current.delete(g))}function ia(g,E,C){let b=u.current.get(g);b&&Bf(b,E,C)}function Bf(g,E,C){g.timeoutId!==null&&window.clearTimeout(g.timeoutId);let b=Math.max(GC,C);g.nextPollAt=Date.now()+b,g.timeoutId=window.setTimeout(()=>{g.timeoutId=null,E()},b)}function Ui(){return u.current.size>=jC?HU:zC}function Fi(g=Ui()){if(g>=6e4){let E=Math.round(g/6e4);return`${E} min${E===1?"":"s"}`}return`${Math.round(g/1e3)}s`}function Hf(g=Ui()){return u.current.size>=jC?`Many renders are active, so the next check is in ${Fi(g)}.`:`Checking again gently every ${Fi(g)}.`}function zx(){let g=Ui();if(g===zC)return;let E=Date.now();for(let C of u.current.values()){if(C.inFlight||!C.runPoll)continue;(C.nextPollAt===null?0:C.nextPollAt-E)<g&&Bf(C,C.runPoll,g)}}function jx(g){let E=Math.max(g,d.current.nextAvailableAt);return d.current.nextAvailableAt=E+$U,E-g}function $f(g){let E=VC(g.threadId,g.assistantMessageId,g.jobId);if(u.current.has(E))return;u.current.set(E,{timeoutId:null,abortController:null,runPoll:null,inFlight:!1,nextPollAt:null,lastPollAt:null,attempts:0,threadId:g.threadId});let C=async()=>{let J=u.current.get(E);if(!J||J.inFlight)return;let st=Date.now(),fe=Ui();if(J.lastPollAt!==null&&st-J.lastPollAt<fe){ia(E,C,fe-(st-J.lastPollAt));return}if(J.attempts>=WC){it(g.threadId,ve=>({...ve,updatedAt:new Date().toISOString(),messages:ve.messages.map(Pe=>Pe.id===g.assistantMessageId?{...Pe,statusText:"Background polling stopped after multiple checks. Open the job route when you want to refresh again."}:Pe)})),oa(E);return}if(document.visibilityState!=="visible"||!navigator.onLine){ia(E,C,fe);return}let ye=jx(Date.now());if(ye>0){ia(E,C,ye);return}J.inFlight=!0,J.lastPollAt=st,J.nextPollAt=null,J.attempts+=1,J.abortController=new AbortController;try{it(g.threadId,Ge=>({...Ge,updatedAt:new Date().toISOString(),messages:Ge.messages.map(dt=>dt.id===g.assistantMessageId?{...dt,statusText:`Job ${g.jobId} is being tracked. ${Hf(fe)}`}:dt)}));let ve=g.primitiveId||zU(g.sourceRequestUrl)?`/api/v1/primitives/jobs/${encodeURIComponent(g.jobId)}`:`/api/v1/templates/${encodeURIComponent(e.template.templateId)}/jobs/${encodeURIComponent(g.jobId)}`,Pe=await fetch(ve,{method:"GET",headers:gt(e.vidfarmApiKey),signal:J.abortController.signal}),kr=await Pe.json().catch(()=>null),he=Object.fromEntries(Pe.headers.entries()),se=Mi(kr);if(it(g.threadId,Ge=>({...Ge,updatedAt:new Date().toISOString(),messages:Ge.messages.map(dt=>{if(dt.id!==g.assistantMessageId)return dt;let Kn=BU(dt.httpExchanges,fc({explanation:`Automatic ${Fi(fe)} job status check for ${g.jobId}`,pollJobId:g.jobId,pollMode:"automatic",request:{method:"GET",url:ve,headers:Object.fromEntries(gt(e.vidfarmApiKey).entries())},result:{status:Pe.status,statusText:Pe.statusText,headers:he,body:kr}})),jf=se?se.status==="succeeded"?`Render ${se.job_id} succeeded.`:se.status==="failed"||se.status==="cancelled"?`Render ${se.job_id} ${se.status}.${se.error?.message?` ${se.error.message}`:""}`:`Render ${se.job_id} is ${se.status}. Next check in ${Fi(fe)}.`:`Render ${g.jobId} checked. Next check in ${Fi(fe)}.`;return{...dt,httpExchanges:Kn,statusText:jf,text:se&&(se.status==="succeeded"||se.status==="failed"||se.status==="cancelled")?Cf(dt.text,wf(se)):dt.text}})})),se&&(se.status==="succeeded"||se.status==="failed"||se.status==="cancelled")){oa(E);return}}catch(ve){if(ve instanceof DOMException&&ve.name==="AbortError")return;it(g.threadId,Pe=>({...Pe,updatedAt:new Date().toISOString(),messages:Pe.messages.map(kr=>kr.id===g.assistantMessageId?{...kr,statusText:`Automatic polling paused after an error. It will retry in ${Fi()}.`}:kr)}))}finally{let ve=u.current.get(E);if(!ve)return;ve.inFlight=!1,ve.abortController=null,ve.attempts<WC&&ve.timeoutId===null&&u.current.has(E)&&ia(E,C,Ui())}},b=u.current.get(E);b&&(b.runPoll=C),u.current.get(E)&&(ia(E,C,g.initialDelayMs??Ui()),zx())}function Wx(g){for(let E of g.messages)if(!(E.role!=="assistant"||!E.httpExchanges?.length))for(let C of E.httpExchanges){if(C.request.method!=="POST")continue;let b=Mi(C.result.body),B=VC(g.id,E.id,b?.job_id??"");!b||na(b.status)||u.current.has(B)||E.httpExchanges.some(st=>{let fe=Mi(st.result.body);return fe?.job_id===b.job_id&&na(fe.status)})||$f({threadId:g.id,assistantMessageId:E.id,jobId:b.job_id,tracer:b.tracer,initialStatus:b.status,primitiveId:b.primitive_id,sourceRequestUrl:C.request.url,initialDelayMs:GC})}}async function zf(g){if(!g.length)return;U(null);let E=[],C=null;for(let b of g)try{let B=await _x({apiKey:e.vidfarmApiKey,file:b,folderPath:lx}),J=await Sx({attachment:B,file:b,currentInlineBytes:yx([...N,...E])});E.push(J)}catch(B){C=B instanceof Error?B.message:"Unable to upload attachment."}C&&E.length===0&&U(C),E.length&&(F(b=>[...b,...E]),C&&U(C))}async function Gx(g){let E=Array.from(g.target.files??[]);await zf(E),g.target.value=""}async function Vx(g){let E=Array.from(g.clipboardData.files??[]).filter(C=>C.size>0);E.length&&(g.preventDefault(),await zf(E))}async function qx(g){g.preventDefault(),le(!1);let E=Array.from(g.dataTransfer.files??[]).filter(C=>C.size>0);E.length&&await zf(E)}async function aS(){if(!Te)return;a.current=!0;let g=kx(A),E=new Date().toISOString(),C=p.current.find(ye=>ye.id===g),b={id:kf("user"),role:"user",text:A.trim(),attachments:N},B={id:kf("assistant"),role:"assistant",text:"",attachments:[],statusText:"Waiting for AI response\u2026",isPending:!0},J=C?.messages??[],st=QU([...J,b]);it(g,ye=>({...ye,title:ye.messages.length===0?xf(b.text):ye.title,updatedAt:E,messages:[...ye.messages,b,B]})),I(""),F([]),U(null),de(g),we("Waiting for AI response\u2026");let fe=new AbortController;c.current={abortController:fe,threadId:g,assistantMessageId:B.id};try{let ye=JSON.stringify({messages:eF(st),thread_id:g,thread_template_id:C?.templateId??e.template.templateId,thread_title:J.length===0?xf(b.text):C?.title??xf(b.text),thread_tracers:Wo,client_context:RU(),user_message:{id:b.id,role:b.role,text:b.text,attachments:b.attachments.map(he=>({id:he.id,fileName:he.fileName,contentType:he.contentType,viewUrl:he.viewUrl}))},assistant_message:{id:B.id},template:{...e.template,tracers:Wo,defaultRequestTracer:P,activeTracer:P},cached_context:{...e.cachedContext,...tF(),...nF()}}),ve=await fetch(e.apiUrl||"/api/v1/editor-chat",{method:"POST",headers:gt(e.vidfarmApiKey,"application/json"),signal:fe.signal,body:ye});if(!ve.ok){let he=await ve.json().catch(()=>({}));throw new Error(typeof he?.error=="string"?he.error:`Chat failed with status ${ve.status}.`)}let Pe=new Map,kr=Lx(b.text);await rF(ve,{onDelta:he=>{we("AI is responding\u2026"),it(g,se=>({...se,updatedAt:new Date().toISOString(),messages:se.messages.map(Ge=>Ge.id===B.id?{...Ge,text:`${Ge.text}${he}`,statusText:"AI is responding\u2026",isPending:!1}:Ge)}))},onStatus:he=>{we(he),it(g,se=>({...se,messages:se.messages.map(Ge=>Ge.id===B.id?{...Ge,statusText:he,isPending:!Ge.text}:Ge)}))},onToolCall:he=>{Pe.set(he.toolCallId,{toolName:he.toolName,args:he.args}),it(g,se=>({...se,updatedAt:new Date().toISOString(),messages:se.messages.map(Ge=>Ge.id===B.id?{...Ge,toolExchanges:[...Ge.toolExchanges??[],{toolCallId:he.toolCallId,toolName:he.toolName,args:Oi(he.args),status:"pending"}]}:Ge)}))},onToolResult:he=>{let se=cx(he.result),Ge=Pe.get(he.toolCallId);if(he.toolName==="frontend_action"){let tn=he.result;if(tn?.action==="add_tracer")so(tn.tracer??void 0);else if(tn?.action==="remove_tracer"&&tn.tracer)bx(tn.tracer);else if(tn?.action==="activate_tracer"&&tn.tracer)Nx(tn.tracer);else if(tn?.action==="create_thread"){let At=tn.tracer?so(tn.tracer):pe();Ff({tracers:At?[At]:[],title:At?`Tracer ${At}`:"New chat",activate:!1})}}let dt=he.result,Kn=Mi(dt?.response?.body),jf=dt?.request&&dt?.response?fc({explanation:dt.explanation??null,request:dt.request,result:dt.response}):void 0,mc=dt?.request?.method==="POST"&&Kn?.tracer?Dx({sourceThreadId:g,tracer:Kn.tracer,job:Kn,httpExchange:jf,shouldCreateThread:kr}):null;mc&&Kn&&!na(Kn.status)&&$f({threadId:mc.threadId,assistantMessageId:mc.messageId,jobId:Kn.job_id,tracer:Kn.tracer,initialStatus:Kn.status,primitiveId:Kn.primitive_id,sourceRequestUrl:dt?.request?.url}),it(g,tn=>({...tn,updatedAt:new Date().toISOString(),messages:tn.messages.map(At=>{if(At.id!==B.id)return At;let Xx=(At.toolExchanges??[]).map(Bi=>Bi.toolCallId===he.toolCallId?{...Bi,result:se,status:typeof he.result?.error=="string"?"error":"complete"}:Bi),mr=he.result,rt=Mi(mr?.response?.body),Qx=mr?.request&&mr?.response?[...At.httpExchanges??[],fc({explanation:mr.explanation??null,request:mr.request,result:mr.response})]:At.httpExchanges;if(Ge&&Pe.delete(he.toolCallId),mr?.request?.method==="POST"&&rt?.tracer){let Bi=window.__vidfarmEditorTracers;Bi?Bi.add(rt.tracer):Me([rt.tracer,...Re.filter(Zx=>Zx!==rt.tracer)]),Px(g,[rt.tracer])}return rt&&!mc&&!na(rt.status)&&$f({threadId:g,assistantMessageId:B.id,jobId:rt.job_id,tracer:rt.tracer,initialStatus:rt.status,primitiveId:rt.primitive_id,sourceRequestUrl:mr?.request?.url}),{...At,toolExchanges:Xx,httpExchanges:Qx,statusText:rt&&!na(rt.status)?`Job ${rt.job_id} is being tracked. ${Hf()}`:At.statusText,isPending:!1,text:rt&&mr?.request?.method==="POST"&&mr?.response?.status===202?Cf(At.text,$C(rt)):rt&&na(rt.status)||rt?Cf(At.text,wf(rt)):At.text}})}))},onError:he=>{U(he),we(null),it(g,se=>({...se,messages:se.messages.filter(Ge=>Ge.id!==B.id)}))}}),it(g,he=>({...he,updatedAt:new Date().toISOString(),messages:he.messages.map(se=>se.id===B.id?{...se,statusText:se.statusText?.includes("being tracked")?se.statusText:null,isPending:!1}:se)}))}catch(ye){if(ye instanceof DOMException&&ye.name==="AbortError"){U(null),we(null),it(g,ve=>({...ve,updatedAt:new Date().toISOString(),messages:ve.messages.map(Pe=>Pe.id!==B.id?Pe:!!(Pe.text.trim()||Pe.toolExchanges?.length||Pe.httpExchanges?.length)?{...Pe,statusText:"Stopped.",isPending:!1}:{...Pe,text:"Stopped.",statusText:null,isPending:!1})}));return}U(ye instanceof Error?ye.message:"Unable to send chat message."),we(null),it(g,ve=>({...ve,messages:ve.messages.map(Pe=>Pe.id===B.id?{...Pe,text:ye instanceof Error?`Error: ${ye.message}`:"Error: Unable to send chat message.",statusText:null,isPending:!1}:Pe)}))}finally{c.current?.assistantMessageId===B.id&&(c.current=null),de(ye=>ye===g?null:ye),we(null)}}function Yx(){we("Stopping\u2026");let g=c.current;g&&it(g.threadId,E=>({...E,updatedAt:new Date().toISOString(),messages:E.messages.map(C=>C.id===g.assistantMessageId?{...C,statusText:"Stopping\u2026"}:C)})),c.current?.abortController.abort()}(0,M.useEffect)(()=>()=>{c.current?.abortController.abort();for(let g of u.current.keys())oa(g)},[]);function Kx(g){g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),aS())}let Jx=(0,f.jsx)("div",{className:`vf-editor-chat-thread-list${t?" vf-editor-chat-thread-list-sidebar":""}`,role:"tablist","aria-label":"Conversation threads",children:io.length?io.map(g=>(0,f.jsxs)("div",{role:"tab","aria-selected":g.id===T,className:"vf-editor-chat-thread-chip","data-active":g.id===T?"true":"false",children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-chat-thread-chip-main",onClick:()=>{y(g.id),U(null),k(null),ge(!1),t&&oe(!1)},children:[(0,f.jsx)("span",{className:"vf-editor-chat-thread-chip-title",children:g.title}),g.tracers.length?(0,f.jsxs)("span",{className:"vf-editor-chat-thread-chip-tracers",children:[g.tracers.slice(0,2).join(", "),g.tracers.length>2?` +${g.tracers.length-2}`:""]}):null]}),(0,f.jsx)("div",{className:"vf-editor-chat-thread-menu-wrap",children:(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-thread-chip-menu","aria-label":`Actions for ${g.title}`,onClick:E=>{E.stopPropagation(),$x(g.id,E.currentTarget)},children:"..."})})]},g.id)):(0,f.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Start a chat to create your first conversation thread."})});return(0,f.jsxs)("div",{className:"vf-editor-chat-shell","data-mobile-open":q?"true":"false","data-layout":t?"brainstorm":"default",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-mobile-fab","aria-label":"Open chat","aria-expanded":q,onClick:()=>oe(!0),children:(0,f.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(0,f.jsx)("path",{d:"M20 11.5a7.5 7.5 0 0 1-9.8 7.1L4 20l1.5-5.3A7.5 7.5 0 1 1 20 11.5Z"})})}),R?(0,f.jsx)("div",{className:"vf-editor-chat-error",role:"status",children:R}):null,(0,f.jsx)("div",{className:t?"vf-editor-chat-body vf-editor-chat-brainstorm-layout":"vf-editor-chat-body","data-history-open":ce?"true":"false",children:(0,f.jsxs)("div",{className:"vf-editor-chat-thread",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-header",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-header-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-history-icon","aria-label":ce?"Back to chat":"Open chat history","aria-pressed":ce,onClick:()=>ge(g=>!g),children:ce?(0,f.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,f.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,f.jsx)("circle",{cx:"10",cy:"10",r:"7.2"}),(0,f.jsx)("path",{d:"M10 6v4l2.6 1.6"})]})}),(0,f.jsxs)("div",{className:"vf-editor-chat-header-titles",children:[(0,f.jsx)("div",{className:"vf-editor-chat-header-title",children:"Vidfarm"}),(0,f.jsx)("div",{className:"vf-editor-chat-header-subtitle",children:ce?"Chat history":e.template.templateTitle})]}),ce?(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread",onClick:Ax,children:"New chat"}):null]}),w&&bn?(0,Li.createPortal)((0,f.jsxs)("div",{className:"vf-editor-chat-thread-menu",role:"menu",style:{top:w.top,left:w.left},onClick:g=>g.stopPropagation(),children:[(0,f.jsx)("button",{type:"button",onClick:()=>Hx(bn.id),children:"Copy Chat ID"}),(0,f.jsx)("button",{type:"button",onClick:()=>Ux(bn.id),children:"Edit tracers"}),(0,f.jsx)("button",{type:"button",onClick:()=>Bx(bn.id),children:"Remove from view"}),(0,f.jsx)("button",{type:"button",onClick:()=>Fx(bn.id),children:"Archive thread"}),(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>Mx(bn.id),children:"Delete"})]}),document.body):null]}),(0,f.jsx)("div",{className:"vf-editor-chat-viewport",ref:i,children:ce?(0,f.jsx)("div",{className:"vf-editor-chat-history-panel",children:Jx}):z.length?z.map(g=>(0,f.jsx)(wF,{message:g},g.id)):T&&S===T?(0,f.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,f.jsx)("div",{className:"vf-editor-chat-kicker",children:"Loading chat"}),(0,f.jsxs)("h2",{children:["Opening ",T]})]}):(0,f.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,f.jsx)("div",{className:"vf-editor-chat-kicker",children:"AI Copilot"}),(0,f.jsx)("h2",{children:t?"Start a new chat.":"Build a timeline."}),(0,f.jsx)("p",{children:t?"Use the brainstorm tools to go from zero context to angles, hooks, and a strategy you can actually test.":"Use the Copilot here to reason about layers, draft overlays, prepare assets, and run timeline render jobs. You can also connect from your own AI coding agent, including Claude Code or OpenAI Codex, and ask it to work against this composition."}),(0,f.jsx)("div",{className:"vf-editor-chat-empty-prompts","aria-label":"Example prompts",children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{children:"I don't know where to start"}),(0,f.jsx)("div",{children:"Help me think of persuasive angles"}),(0,f.jsx)("div",{children:"Help me think of viral hooks"})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{children:"teach me how this composition works"}),(0,f.jsx)("div",{children:"where should the overlay layers go?"}),(0,f.jsx)("div",{children:"create a timeline render using my video..."})]})})]})}),(0,f.jsx)("div",{className:"vf-editor-chat-footer",hidden:ce,children:(0,f.jsxs)("div",{className:"vf-editor-chat-composer","data-drop-target":D?"true":"false",onDragEnter:g=>{g.preventDefault(),le(!0)},onDragOver:g=>{g.preventDefault(),D||le(!0)},onDragLeave:g=>{g.preventDefault();let E=g.relatedTarget;E instanceof Node&&g.currentTarget.contains(E)||le(!1)},onDrop:g=>{qx(g)},children:[D?(0,f.jsx)("div",{className:"vf-editor-chat-dropzone-hint",children:"Drop files to attach"}):null,N.length?(0,f.jsx)("div",{className:"vf-editor-chat-composer-attachments-strip",children:N.map(g=>(0,f.jsx)(SF,{attachment:g,onRemove:()=>F(E=>E.filter(C=>C.id!==g.id))},g.id))}):null,(0,f.jsxs)("div",{className:"vf-editor-chat-composer-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-attach-button","aria-label":"Open upload drawer",onClick:()=>Tt(!0),children:"\u{1F4CE}"}),(0,f.jsx)("textarea",{rows:1,placeholder:t?"Describe the offer, audience, or strategy problem you want help with...":"Ask it to call a route, inspect jobs, save config, or continue this thread...",className:"vf-editor-chat-input",value:A,onChange:g=>I(g.target.value),onKeyDown:Kx,onPaste:g=>{Vx(g)}}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-send-button",onClick:()=>{if(re){Yx();return}aS()},disabled:re?!1:!Te,children:re?"Stop":"Send"})]}),(0,f.jsx)("input",{ref:o,type:"file",accept:"image/*,video/*,audio/*,application/pdf,text/plain,text/markdown",multiple:!0,hidden:!0,onChange:g=>{Gx(g)}})]})})]})}),(0,f.jsx)(xF,{apiKey:e.vidfarmApiKey,open:yt,onClose:()=>Tt(!1),onConfirm:g=>F(E=>[...E,...g])})]})}var hn=gn(uc(),1);function RF(){let e=document.getElementById("page-runtime-boot");return e?.textContent?JSON.parse(e.textContent):null}function Df(e){let t=new Date;return t.setDate(t.getDate()+e),t.toISOString()}async function NF(e){if(!e.userId)return;let t=e.store.getState();if(!e.force&&t.channels.length&&t.channelsUpdatedAt)return;let n=new URLSearchParams({start_date:Df(-7),end_date:Df(30)}),r=await fetch(`/u/${encodeURIComponent(e.userId)}/calendar/feed?${n.toString()}`,{headers:{accept:"application/json"}}),o=await r.json().catch(()=>null);!r.ok||!o||(e.store.getState().setCalendarData({channels:Array.isArray(o.channels)?o.channels:[],posts:Array.isArray(o.posts)?o.posts:[],rangeStart:o.startDate||Df(-7),rangeEnd:o.endDate||Df(30),replaceRange:!0}),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated")))}function bF({boot:e}){let t=(0,Di.useMemo)(()=>LC(e),[e]),n=kC(t,i=>i.boot.title),[r,o]=(0,Di.useState)(null);return(0,Di.useEffect)(()=>{t.getState().setHydratedAt(new Date().toISOString()),document.documentElement.dataset.reactRuntime="true",document.documentElement.dataset.reactRuntimePage=e.pageKind,document.title=n},[e.pageKind,t,n]),(0,Di.useEffect)(()=>{if(!e.editorChat)return;let i=document.querySelector("[data-template-editor-chat-root]");o(i instanceof HTMLElement?i:null)},[e.editorChat]),e.editorChat&&r?(0,Cx.createPortal)((0,hn.jsx)(xs,{fallback:(0,hn.jsx)(kF,{}),children:(0,hn.jsx)(Ix,{boot:e.editorChat})}),r):null}function kF(){return(0,hn.jsxs)("div",{style:{display:"grid",placeItems:"center",height:"100%",padding:"24px",textAlign:"center",gap:"12px",color:"#5c6a82"},children:[(0,hn.jsx)("div",{style:{fontSize:"0.72rem",fontWeight:800,letterSpacing:"0.14em",textTransform:"uppercase"},children:"Chat error"}),(0,hn.jsx)("div",{style:{fontSize:"0.92rem"},children:"Something went wrong loading the chat. Reload the page to try again."}),(0,hn.jsx)("button",{type:"button",onClick:()=>window.location.reload(),style:{marginTop:"4px",minHeight:"34px",padding:"0 16px",border:"1px solid rgba(191, 164, 109, 0.34)",borderRadius:"999px",background:"rgba(255, 255, 255, 0.92)",color:"#243041",fontWeight:700,cursor:"pointer"},children:"Reload"})]})}var pc=RF(),wx=document.getElementById("page-runtime-root"),iS=OC(pc?.userId??null),Uf=null;function Rx(e={}){return!e.force&&Uf||(Uf=NF({userId:pc?.userId??null,store:iS,force:e.force}).catch(()=>{})),Uf}window.__vidfarmFlockPosterCache={readSnapshot:()=>Hy(pc?.userId??null),ensureHydrated:Rx,setChannelsData:e=>{iS.getState().setChannelsData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))},setCalendarData:e=>{iS.getState().setCalendarData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))}};Rx();pc&&wx&&(0,xx.createRoot)(wx).render((0,hn.jsx)(xs,{fallback:(0,hn.jsx)(hn.Fragment,{}),children:(0,hn.jsx)(bF,{boot:pc})}));
|
|
46
|
-
/*! Bundled license information:
|
|
47
|
-
|
|
48
|
-
react/cjs/react.production.min.js:
|
|
49
|
-
(**
|
|
50
|
-
* @license React
|
|
51
|
-
* react.production.min.js
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE file in the root directory of this source tree.
|
|
57
|
-
*)
|
|
58
|
-
|
|
59
|
-
scheduler/cjs/scheduler.production.min.js:
|
|
60
|
-
(**
|
|
61
|
-
* @license React
|
|
62
|
-
* scheduler.production.min.js
|
|
63
|
-
*
|
|
64
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
65
|
-
*
|
|
66
|
-
* This source code is licensed under the MIT license found in the
|
|
67
|
-
* LICENSE file in the root directory of this source tree.
|
|
68
|
-
*)
|
|
69
|
-
|
|
70
|
-
react-dom/cjs/react-dom.production.min.js:
|
|
71
|
-
(**
|
|
72
|
-
* @license React
|
|
73
|
-
* react-dom.production.min.js
|
|
74
|
-
*
|
|
75
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the MIT license found in the
|
|
78
|
-
* LICENSE file in the root directory of this source tree.
|
|
79
|
-
*)
|
|
80
|
-
|
|
81
|
-
react/cjs/react-jsx-runtime.production.min.js:
|
|
82
|
-
(**
|
|
83
|
-
* @license React
|
|
84
|
-
* react-jsx-runtime.production.min.js
|
|
85
|
-
*
|
|
86
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the MIT license found in the
|
|
89
|
-
* LICENSE file in the root directory of this source tree.
|
|
90
|
-
*)
|
|
91
|
-
|
|
92
|
-
@sentry/core/build/esm/utils/env.js:
|
|
93
|
-
(*! __SENTRY_SDK_SOURCE__ *)
|
|
94
|
-
*/
|