@mevdragon/vidfarm-devcli 0.18.0 → 0.19.0

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.
Files changed (68) hide show
  1. package/.agents/skills/editor-capabilities/SKILL.md +166 -0
  2. package/.agents/skills/editor-capabilities/references/re-theme-walkthrough.md +58 -0
  3. package/.agents/skills/vidfarm-media/SKILL.md +43 -4
  4. package/SKILL.director.md +190 -18
  5. package/SKILL.platform.md +8 -4
  6. package/demo/dist/app.css +1 -1
  7. package/demo/dist/app.js +77 -75
  8. package/demo/dist/favicon.ico +0 -0
  9. package/dist/src/app.js +3031 -300
  10. package/dist/src/cli.js +1549 -69
  11. package/dist/src/config.js +7 -0
  12. package/dist/src/devcli/clip-store.js +29 -2
  13. package/dist/src/devcli/clips.js +55 -9
  14. package/dist/src/devcli/composition-edit.js +658 -8
  15. package/dist/src/devcli/local-backend.js +123 -0
  16. package/dist/src/devcli/migrate-local.js +140 -0
  17. package/dist/src/devcli/sync.js +311 -0
  18. package/dist/src/devcli/timeline-edit.js +490 -0
  19. package/dist/src/editor-chat.js +56 -17
  20. package/dist/src/frontend/discover-client.js +130 -0
  21. package/dist/src/frontend/discover-store.js +23 -0
  22. package/dist/src/frontend/file-directory.js +995 -0
  23. package/dist/src/frontend/homepage-view.js +3 -3
  24. package/dist/src/frontend/template-editor-chat.js +28 -22
  25. package/dist/src/landing-page.js +24 -7
  26. package/dist/src/page-shell.js +26 -2
  27. package/dist/src/primitive-registry.js +409 -4
  28. package/dist/src/reskin/agency-page.js +1 -1
  29. package/dist/src/reskin/calendar-page.js +2 -1
  30. package/dist/src/reskin/chat-page.js +420 -85
  31. package/dist/src/reskin/discover-page.js +731 -39
  32. package/dist/src/reskin/document.js +1311 -387
  33. package/dist/src/reskin/help-page.js +1 -0
  34. package/dist/src/reskin/inpaint-clipper-page.js +649 -0
  35. package/dist/src/reskin/inpaint-page.js +2459 -446
  36. package/dist/src/reskin/inpaint-video-page.js +1339 -0
  37. package/dist/src/reskin/library-page.js +1168 -228
  38. package/dist/src/reskin/login-page.js +6 -6
  39. package/dist/src/reskin/pricing-page.js +2 -0
  40. package/dist/src/reskin/settings-page.js +55 -10
  41. package/dist/src/reskin/theme.js +365 -20
  42. package/dist/src/services/billing.js +4 -0
  43. package/dist/src/services/clip-curation/gemini.js +5 -0
  44. package/dist/src/services/clip-curation/hunt.js +81 -1
  45. package/dist/src/services/clip-curation/index.js +2 -1
  46. package/dist/src/services/clip-curation/local-agent.js +4 -3
  47. package/dist/src/services/clip-curation/media-select.js +85 -0
  48. package/dist/src/services/clip-curation/query.js +5 -1
  49. package/dist/src/services/clip-curation/refine.js +50 -20
  50. package/dist/src/services/clip-curation/scan.js +10 -3
  51. package/dist/src/services/clip-curation/taxonomy.js +3 -1
  52. package/dist/src/services/clip-curation/taxonomy.v1.json +13 -1
  53. package/dist/src/services/clip-records.js +42 -1
  54. package/dist/src/services/clip-search.js +43 -13
  55. package/dist/src/services/file-directory.js +117 -0
  56. package/dist/src/services/hyperframes.js +283 -3
  57. package/dist/src/services/serverless-records.js +43 -0
  58. package/dist/src/services/storage.js +47 -2
  59. package/dist/src/services/upstream.js +5 -5
  60. package/dist/src/template-editor-shell.js +16 -2
  61. package/package.json +1 -1
  62. package/public/assets/discover-client-app.js +1 -0
  63. package/public/assets/file-directory-app.js +2 -0
  64. package/public/assets/homepage-client-app.js +12 -12
  65. package/public/assets/page-runtime-client-app.js +24 -24
  66. package/public/assets/placeholders/scene-placeholder.png +0 -0
  67. package/src/assets/favicon.ico +0 -0
  68. package/src/assets/logo-vidfarm.png +0 -0
@@ -1,48 +1,48 @@
1
- var Rx=Object.create;var PS=Object.defineProperty;var xx=Object.getOwnPropertyDescriptor;var bx=Object.getOwnPropertyNames;var kx=Object.getPrototypeOf,Nx=Object.prototype.hasOwnProperty;var Br=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Ax=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of bx(t))!Nx.call(e,o)&&o!==n&&PS(e,o,{get:()=>t[o],enumerable:!(r=xx(t,o))||r.enumerable});return e};var Cn=(e,t,n)=>(n=e!=null?Rx(kx(e)):{},Ax(t||!e||!e.__esModule?PS(n,"default",{value:e,enumerable:!0}):n,e));var CI=Br(_e=>{"use strict";var kl=Symbol.for("react.element"),cO=Symbol.for("react.portal"),uO=Symbol.for("react.fragment"),dO=Symbol.for("react.strict_mode"),fO=Symbol.for("react.profiler"),pO=Symbol.for("react.provider"),mO=Symbol.for("react.context"),hO=Symbol.for("react.forward_ref"),gO=Symbol.for("react.suspense"),yO=Symbol.for("react.memo"),SO=Symbol.for("react.lazy"),mI=Symbol.iterator;function _O(e){return e===null||typeof e!="object"?null:(e=mI&&e[mI]||e["@@iterator"],typeof e=="function"?e:null)}var yI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},SI=Object.assign,_I={};function Os(e,t,n){this.props=e,this.context=t,this.refs=_I,this.updater=n||yI}Os.prototype.isReactComponent={};Os.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")};Os.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vI(){}vI.prototype=Os.prototype;function Ph(e,t,n){this.props=e,this.context=t,this.refs=_I,this.updater=n||yI}var Lh=Ph.prototype=new vI;Lh.constructor=Ph;SI(Lh,Os.prototype);Lh.isPureReactComponent=!0;var hI=Array.isArray,EI=Object.prototype.hasOwnProperty,Oh={current:null},TI={key:!0,ref:!0,__self:!0,__source:!0};function II(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)EI.call(t,r)&&!TI.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:kl,type:e,key:i,ref:s,props:o,_owner:Oh.current}}function vO(e,t){return{$$typeof:kl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Dh(e){return typeof e=="object"&&e!==null&&e.$$typeof===kl}function EO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var gI=/\/+/g;function Mh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?EO(""+e.key):t.toString(36)}function ud(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 kl:case cO:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Mh(s,0):r,hI(o)?(n="",e!=null&&(n=e.replace(gI,"$&/")+"/"),ud(o,t,n,"",function(c){return c})):o!=null&&(Dh(o)&&(o=vO(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(gI,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",hI(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Mh(i,a);s+=ud(i,t,n,l,o)}else if(l=_O(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Mh(i,a++),s+=ud(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 cd(e,t,n){if(e==null)return e;var r=[],o=0;return ud(e,r,"","",function(i){return t.call(n,i,o++)}),r}function TO(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 on={current:null},dd={transition:null},IO={ReactCurrentDispatcher:on,ReactCurrentBatchConfig:dd,ReactCurrentOwner:Oh};function wI(){throw Error("act(...) is not supported in production builds of React.")}_e.Children={map:cd,forEach:function(e,t,n){cd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return cd(e,function(){t++}),t},toArray:function(e){return cd(e,function(t){return t})||[]},only:function(e){if(!Dh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};_e.Component=Os;_e.Fragment=uO;_e.Profiler=fO;_e.PureComponent=Ph;_e.StrictMode=dO;_e.Suspense=gO;_e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=IO;_e.act=wI;_e.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=SI({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Oh.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)EI.call(t,l)&&!TI.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:kl,type:e.type,key:o,ref:i,props:r,_owner:s}};_e.createContext=function(e){return e={$$typeof:mO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:pO,_context:e},e.Consumer=e};_e.createElement=II;_e.createFactory=function(e){var t=II.bind(null,e);return t.type=e,t};_e.createRef=function(){return{current:null}};_e.forwardRef=function(e){return{$$typeof:hO,render:e}};_e.isValidElement=Dh;_e.lazy=function(e){return{$$typeof:SO,_payload:{_status:-1,_result:e},_init:TO}};_e.memo=function(e,t){return{$$typeof:yO,type:e,compare:t===void 0?null:t}};_e.startTransition=function(e){var t=dd.transition;dd.transition={};try{e()}finally{dd.transition=t}};_e.unstable_act=wI;_e.useCallback=function(e,t){return on.current.useCallback(e,t)};_e.useContext=function(e){return on.current.useContext(e)};_e.useDebugValue=function(){};_e.useDeferredValue=function(e){return on.current.useDeferredValue(e)};_e.useEffect=function(e,t){return on.current.useEffect(e,t)};_e.useId=function(){return on.current.useId()};_e.useImperativeHandle=function(e,t,n){return on.current.useImperativeHandle(e,t,n)};_e.useInsertionEffect=function(e,t){return on.current.useInsertionEffect(e,t)};_e.useLayoutEffect=function(e,t){return on.current.useLayoutEffect(e,t)};_e.useMemo=function(e,t){return on.current.useMemo(e,t)};_e.useReducer=function(e,t,n){return on.current.useReducer(e,t,n)};_e.useRef=function(e){return on.current.useRef(e)};_e.useState=function(e){return on.current.useState(e)};_e.useSyncExternalStore=function(e,t,n){return on.current.useSyncExternalStore(e,t,n)};_e.useTransition=function(){return on.current.useTransition()};_e.version="18.3.1"});var eo=Br((SY,RI)=>{"use strict";RI.exports=CI()});var jI=Br(We=>{"use strict";function jh(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<fd(o,t))e[r]=t,e[n]=o,n=r;else break e}}function pr(e){return e.length===0?null:e[0]}function md(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>fd(a,n))l<o&&0>fd(c,a)?(e[r]=c,e[l]=n,r=l):(e[r]=a,e[s]=n,r=s);else if(l<o&&0>fd(c,n))e[r]=c,e[l]=n,r=l;else break e}}return t}function fd(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(LI=performance,We.unstable_now=function(){return LI.now()}):(Hh=Date,OI=Hh.now(),We.unstable_now=function(){return Hh.now()-OI});var LI,Hh,OI,kr=[],Ao=[],xO=1,Yn=null,Gt=3,hd=!1,Ri=!1,Al=!1,FI=typeof setTimeout=="function"?setTimeout:null,BI=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 Wh(e){for(var t=pr(Ao);t!==null;){if(t.callback===null)md(Ao);else if(t.startTime<=e)md(Ao),t.sortIndex=t.expirationTime,jh(kr,t);else break;t=pr(Ao)}}function Gh(e){if(Al=!1,Wh(e),!Ri)if(pr(kr)!==null)Ri=!0,qh(Vh);else{var t=pr(Ao);t!==null&&Yh(Gh,t.startTime-e)}}function Vh(e,t){Ri=!1,Al&&(Al=!1,BI(Ml),Ml=-1),hd=!0;var n=Gt;try{for(Wh(t),Yn=pr(kr);Yn!==null&&(!(Yn.expirationTime>t)||e&&!zI());){var r=Yn.callback;if(typeof r=="function"){Yn.callback=null,Gt=Yn.priorityLevel;var o=r(Yn.expirationTime<=t);t=We.unstable_now(),typeof o=="function"?Yn.callback=o:Yn===pr(kr)&&md(kr),Wh(t)}else md(kr);Yn=pr(kr)}if(Yn!==null)var i=!0;else{var s=pr(Ao);s!==null&&Yh(Gh,s.startTime-t),i=!1}return i}finally{Yn=null,Gt=n,hd=!1}}var gd=!1,pd=null,Ml=-1,HI=5,$I=-1;function zI(){return!(We.unstable_now()-$I<HI)}function $h(){if(pd!==null){var e=We.unstable_now();$I=e;var t=!0;try{t=pd(!0,e)}finally{t?Nl():(gd=!1,pd=null)}}else gd=!1}var Nl;typeof DI=="function"?Nl=function(){DI($h)}:typeof MessageChannel<"u"?(zh=new MessageChannel,UI=zh.port2,zh.port1.onmessage=$h,Nl=function(){UI.postMessage(null)}):Nl=function(){FI($h,0)};var zh,UI;function qh(e){pd=e,gd||(gd=!0,Nl())}function Yh(e,t){Ml=FI(function(){e(We.unstable_now())},t)}We.unstable_IdlePriority=5;We.unstable_ImmediatePriority=1;We.unstable_LowPriority=4;We.unstable_NormalPriority=3;We.unstable_Profiling=null;We.unstable_UserBlockingPriority=2;We.unstable_cancelCallback=function(e){e.callback=null};We.unstable_continueExecution=function(){Ri||hd||(Ri=!0,qh(Vh))};We.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};We.unstable_getCurrentPriorityLevel=function(){return Gt};We.unstable_getFirstCallbackNode=function(){return pr(kr)};We.unstable_next=function(e){switch(Gt){case 1:case 2:case 3:var t=3;break;default:t=Gt}var n=Gt;Gt=t;try{return e()}finally{Gt=n}};We.unstable_pauseExecution=function(){};We.unstable_requestPaint=function(){};We.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Gt;Gt=e;try{return t()}finally{Gt=n}};We.unstable_scheduleCallback=function(e,t,n){var r=We.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:xO++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,jh(Ao,e),pr(kr)===null&&e===pr(Ao)&&(Al?(BI(Ml),Ml=-1):Al=!0,Yh(Gh,n-r))):(e.sortIndex=o,jh(kr,e),Ri||hd||(Ri=!0,qh(Vh))),e};We.unstable_shouldYield=zI;We.unstable_wrapCallback=function(e){var t=Gt;return function(){var n=Gt;Gt=t;try{return e.apply(this,arguments)}finally{Gt=n}}}});var GI=Br((BY,WI)=>{"use strict";WI.exports=jI()});var KC=Br(Dn=>{"use strict";var bO=eo(),Ln=GI();function L(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 Qw=new Set,ec={};function Bi(e,t){ra(e,t),ra(e+"Capture",t)}function ra(e,t){for(ec[e]=t,e=0;e<t.length;e++)Qw.add(t[e])}var ao=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yg=Object.prototype.hasOwnProperty,kO=/^[: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]*$/,VI={},qI={};function NO(e){return yg.call(qI,e)?!0:yg.call(VI,e)?!1:kO.test(e)?qI[e]=!0:(VI[e]=!0,!1)}function AO(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 MO(e,t,n,r){if(t===null||typeof t>"u"||AO(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 ln(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 Ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ot[e]=new ln(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ot[t]=new ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ot[e]=new ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ot[e]=new ln(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){Ot[e]=new ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ot[e]=new ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ot[e]=new ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ot[e]=new ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ot[e]=new ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var cy=/[\-:]([a-z])/g;function uy(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(cy,uy);Ot[t]=new ln(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(cy,uy);Ot[t]=new ln(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(cy,uy);Ot[t]=new ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ot[e]=new ln(e,1,!1,e.toLowerCase(),null,!1,!1)});Ot.xlinkHref=new ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ot[e]=new ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function dy(e,t,n,r){var o=Ot.hasOwnProperty(t)?Ot[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(MO(t,n,o,r)&&(n=null),r||o===null?NO(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 fo=bO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yd=Symbol.for("react.element"),Bs=Symbol.for("react.portal"),Hs=Symbol.for("react.fragment"),fy=Symbol.for("react.strict_mode"),Sg=Symbol.for("react.profiler"),Zw=Symbol.for("react.provider"),e0=Symbol.for("react.context"),py=Symbol.for("react.forward_ref"),_g=Symbol.for("react.suspense"),vg=Symbol.for("react.suspense_list"),my=Symbol.for("react.memo"),Po=Symbol.for("react.lazy"),t0=Symbol.for("react.offscreen"),YI=Symbol.iterator;function Pl(e){return e===null||typeof e!="object"?null:(e=YI&&e[YI]||e["@@iterator"],typeof e=="function"?e:null)}var rt=Object.assign,Kh;function $l(e){if(Kh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kh=t&&t[1]||""}return`
1
+ var xx=Object.create;var PS=Object.defineProperty;var bx=Object.getOwnPropertyDescriptor;var kx=Object.getOwnPropertyNames;var Nx=Object.getPrototypeOf,Ax=Object.prototype.hasOwnProperty;var Br=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Mx=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of kx(t))!Ax.call(e,o)&&o!==n&&PS(e,o,{get:()=>t[o],enumerable:!(r=bx(t,o))||r.enumerable});return e};var Cn=(e,t,n)=>(n=e!=null?xx(Nx(e)):{},Mx(t||!e||!e.__esModule?PS(n,"default",{value:e,enumerable:!0}):n,e));var CI=Br(_e=>{"use strict";var kl=Symbol.for("react.element"),uO=Symbol.for("react.portal"),dO=Symbol.for("react.fragment"),fO=Symbol.for("react.strict_mode"),pO=Symbol.for("react.profiler"),mO=Symbol.for("react.provider"),hO=Symbol.for("react.context"),gO=Symbol.for("react.forward_ref"),yO=Symbol.for("react.suspense"),SO=Symbol.for("react.memo"),_O=Symbol.for("react.lazy"),mI=Symbol.iterator;function vO(e){return e===null||typeof e!="object"?null:(e=mI&&e[mI]||e["@@iterator"],typeof e=="function"?e:null)}var yI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},SI=Object.assign,_I={};function Os(e,t,n){this.props=e,this.context=t,this.refs=_I,this.updater=n||yI}Os.prototype.isReactComponent={};Os.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")};Os.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vI(){}vI.prototype=Os.prototype;function Ph(e,t,n){this.props=e,this.context=t,this.refs=_I,this.updater=n||yI}var Lh=Ph.prototype=new vI;Lh.constructor=Ph;SI(Lh,Os.prototype);Lh.isPureReactComponent=!0;var hI=Array.isArray,EI=Object.prototype.hasOwnProperty,Oh={current:null},TI={key:!0,ref:!0,__self:!0,__source:!0};function II(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)EI.call(t,r)&&!TI.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:kl,type:e,key:i,ref:s,props:o,_owner:Oh.current}}function EO(e,t){return{$$typeof:kl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Dh(e){return typeof e=="object"&&e!==null&&e.$$typeof===kl}function TO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var gI=/\/+/g;function Mh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?TO(""+e.key):t.toString(36)}function ud(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 kl:case uO:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Mh(s,0):r,hI(o)?(n="",e!=null&&(n=e.replace(gI,"$&/")+"/"),ud(o,t,n,"",function(c){return c})):o!=null&&(Dh(o)&&(o=EO(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(gI,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",hI(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Mh(i,a);s+=ud(i,t,n,l,o)}else if(l=vO(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Mh(i,a++),s+=ud(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 cd(e,t,n){if(e==null)return e;var r=[],o=0;return ud(e,r,"","",function(i){return t.call(n,i,o++)}),r}function IO(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 on={current:null},dd={transition:null},wO={ReactCurrentDispatcher:on,ReactCurrentBatchConfig:dd,ReactCurrentOwner:Oh};function wI(){throw Error("act(...) is not supported in production builds of React.")}_e.Children={map:cd,forEach:function(e,t,n){cd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return cd(e,function(){t++}),t},toArray:function(e){return cd(e,function(t){return t})||[]},only:function(e){if(!Dh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};_e.Component=Os;_e.Fragment=dO;_e.Profiler=pO;_e.PureComponent=Ph;_e.StrictMode=fO;_e.Suspense=yO;_e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wO;_e.act=wI;_e.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=SI({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Oh.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)EI.call(t,l)&&!TI.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:kl,type:e.type,key:o,ref:i,props:r,_owner:s}};_e.createContext=function(e){return e={$$typeof:hO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:mO,_context:e},e.Consumer=e};_e.createElement=II;_e.createFactory=function(e){var t=II.bind(null,e);return t.type=e,t};_e.createRef=function(){return{current:null}};_e.forwardRef=function(e){return{$$typeof:gO,render:e}};_e.isValidElement=Dh;_e.lazy=function(e){return{$$typeof:_O,_payload:{_status:-1,_result:e},_init:IO}};_e.memo=function(e,t){return{$$typeof:SO,type:e,compare:t===void 0?null:t}};_e.startTransition=function(e){var t=dd.transition;dd.transition={};try{e()}finally{dd.transition=t}};_e.unstable_act=wI;_e.useCallback=function(e,t){return on.current.useCallback(e,t)};_e.useContext=function(e){return on.current.useContext(e)};_e.useDebugValue=function(){};_e.useDeferredValue=function(e){return on.current.useDeferredValue(e)};_e.useEffect=function(e,t){return on.current.useEffect(e,t)};_e.useId=function(){return on.current.useId()};_e.useImperativeHandle=function(e,t,n){return on.current.useImperativeHandle(e,t,n)};_e.useInsertionEffect=function(e,t){return on.current.useInsertionEffect(e,t)};_e.useLayoutEffect=function(e,t){return on.current.useLayoutEffect(e,t)};_e.useMemo=function(e,t){return on.current.useMemo(e,t)};_e.useReducer=function(e,t,n){return on.current.useReducer(e,t,n)};_e.useRef=function(e){return on.current.useRef(e)};_e.useState=function(e){return on.current.useState(e)};_e.useSyncExternalStore=function(e,t,n){return on.current.useSyncExternalStore(e,t,n)};_e.useTransition=function(){return on.current.useTransition()};_e.version="18.3.1"});var eo=Br((_Y,RI)=>{"use strict";RI.exports=CI()});var jI=Br(We=>{"use strict";function jh(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<fd(o,t))e[r]=t,e[n]=o,n=r;else break e}}function pr(e){return e.length===0?null:e[0]}function md(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>fd(a,n))l<o&&0>fd(c,a)?(e[r]=c,e[l]=n,r=l):(e[r]=a,e[s]=n,r=s);else if(l<o&&0>fd(c,n))e[r]=c,e[l]=n,r=l;else break e}}return t}function fd(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(LI=performance,We.unstable_now=function(){return LI.now()}):(Hh=Date,OI=Hh.now(),We.unstable_now=function(){return Hh.now()-OI});var LI,Hh,OI,kr=[],Ao=[],bO=1,Yn=null,Gt=3,hd=!1,Ri=!1,Al=!1,FI=typeof setTimeout=="function"?setTimeout:null,BI=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 Wh(e){for(var t=pr(Ao);t!==null;){if(t.callback===null)md(Ao);else if(t.startTime<=e)md(Ao),t.sortIndex=t.expirationTime,jh(kr,t);else break;t=pr(Ao)}}function Gh(e){if(Al=!1,Wh(e),!Ri)if(pr(kr)!==null)Ri=!0,qh(Vh);else{var t=pr(Ao);t!==null&&Yh(Gh,t.startTime-e)}}function Vh(e,t){Ri=!1,Al&&(Al=!1,BI(Ml),Ml=-1),hd=!0;var n=Gt;try{for(Wh(t),Yn=pr(kr);Yn!==null&&(!(Yn.expirationTime>t)||e&&!zI());){var r=Yn.callback;if(typeof r=="function"){Yn.callback=null,Gt=Yn.priorityLevel;var o=r(Yn.expirationTime<=t);t=We.unstable_now(),typeof o=="function"?Yn.callback=o:Yn===pr(kr)&&md(kr),Wh(t)}else md(kr);Yn=pr(kr)}if(Yn!==null)var i=!0;else{var s=pr(Ao);s!==null&&Yh(Gh,s.startTime-t),i=!1}return i}finally{Yn=null,Gt=n,hd=!1}}var gd=!1,pd=null,Ml=-1,HI=5,$I=-1;function zI(){return!(We.unstable_now()-$I<HI)}function $h(){if(pd!==null){var e=We.unstable_now();$I=e;var t=!0;try{t=pd(!0,e)}finally{t?Nl():(gd=!1,pd=null)}}else gd=!1}var Nl;typeof DI=="function"?Nl=function(){DI($h)}:typeof MessageChannel<"u"?(zh=new MessageChannel,UI=zh.port2,zh.port1.onmessage=$h,Nl=function(){UI.postMessage(null)}):Nl=function(){FI($h,0)};var zh,UI;function qh(e){pd=e,gd||(gd=!0,Nl())}function Yh(e,t){Ml=FI(function(){e(We.unstable_now())},t)}We.unstable_IdlePriority=5;We.unstable_ImmediatePriority=1;We.unstable_LowPriority=4;We.unstable_NormalPriority=3;We.unstable_Profiling=null;We.unstable_UserBlockingPriority=2;We.unstable_cancelCallback=function(e){e.callback=null};We.unstable_continueExecution=function(){Ri||hd||(Ri=!0,qh(Vh))};We.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};We.unstable_getCurrentPriorityLevel=function(){return Gt};We.unstable_getFirstCallbackNode=function(){return pr(kr)};We.unstable_next=function(e){switch(Gt){case 1:case 2:case 3:var t=3;break;default:t=Gt}var n=Gt;Gt=t;try{return e()}finally{Gt=n}};We.unstable_pauseExecution=function(){};We.unstable_requestPaint=function(){};We.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Gt;Gt=e;try{return t()}finally{Gt=n}};We.unstable_scheduleCallback=function(e,t,n){var r=We.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:bO++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,jh(Ao,e),pr(kr)===null&&e===pr(Ao)&&(Al?(BI(Ml),Ml=-1):Al=!0,Yh(Gh,n-r))):(e.sortIndex=o,jh(kr,e),Ri||hd||(Ri=!0,qh(Vh))),e};We.unstable_shouldYield=zI;We.unstable_wrapCallback=function(e){var t=Gt;return function(){var n=Gt;Gt=t;try{return e.apply(this,arguments)}finally{Gt=n}}}});var GI=Br((HY,WI)=>{"use strict";WI.exports=jI()});var KC=Br(Dn=>{"use strict";var kO=eo(),Ln=GI();function L(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 Qw=new Set,ec={};function Bi(e,t){ra(e,t),ra(e+"Capture",t)}function ra(e,t){for(ec[e]=t,e=0;e<t.length;e++)Qw.add(t[e])}var ao=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yg=Object.prototype.hasOwnProperty,NO=/^[: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]*$/,VI={},qI={};function AO(e){return yg.call(qI,e)?!0:yg.call(VI,e)?!1:NO.test(e)?qI[e]=!0:(VI[e]=!0,!1)}function MO(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 PO(e,t,n,r){if(t===null||typeof t>"u"||MO(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 ln(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 Ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ot[e]=new ln(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ot[t]=new ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ot[e]=new ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ot[e]=new ln(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){Ot[e]=new ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ot[e]=new ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ot[e]=new ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ot[e]=new ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ot[e]=new ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var cy=/[\-:]([a-z])/g;function uy(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(cy,uy);Ot[t]=new ln(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(cy,uy);Ot[t]=new ln(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(cy,uy);Ot[t]=new ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ot[e]=new ln(e,1,!1,e.toLowerCase(),null,!1,!1)});Ot.xlinkHref=new ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ot[e]=new ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function dy(e,t,n,r){var o=Ot.hasOwnProperty(t)?Ot[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(PO(t,n,o,r)&&(n=null),r||o===null?AO(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 fo=kO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yd=Symbol.for("react.element"),Bs=Symbol.for("react.portal"),Hs=Symbol.for("react.fragment"),fy=Symbol.for("react.strict_mode"),Sg=Symbol.for("react.profiler"),Zw=Symbol.for("react.provider"),e0=Symbol.for("react.context"),py=Symbol.for("react.forward_ref"),_g=Symbol.for("react.suspense"),vg=Symbol.for("react.suspense_list"),my=Symbol.for("react.memo"),Po=Symbol.for("react.lazy"),t0=Symbol.for("react.offscreen"),YI=Symbol.iterator;function Pl(e){return e===null||typeof e!="object"?null:(e=YI&&e[YI]||e["@@iterator"],typeof e=="function"?e:null)}var rt=Object.assign,Kh;function $l(e){if(Kh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kh=t&&t[1]||""}return`
2
2
  `+Kh+e}var Jh=!1;function Xh(e,t){if(!e||Jh)return"";Jh=!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
3
  `),i=r.stack.split(`
4
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{Jh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$l(e):""}function PO(e){switch(e.tag){case 5:return $l(e.type);case 16:return $l("Lazy");case 13:return $l("Suspense");case 19:return $l("SuspenseList");case 0:case 2:case 15:return e=Xh(e.type,!1),e;case 11:return e=Xh(e.type.render,!1),e;case 1:return e=Xh(e.type,!0),e;default:return""}}function Eg(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 Hs:return"Fragment";case Bs:return"Portal";case Sg:return"Profiler";case fy:return"StrictMode";case _g:return"Suspense";case vg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case e0:return(e.displayName||"Context")+".Consumer";case Zw:return(e._context.displayName||"Context")+".Provider";case py:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case my:return t=e.displayName||null,t!==null?t:Eg(e.type)||"Memo";case Po:t=e._payload,e=e._init;try{return Eg(e(t))}catch{}}return null}function LO(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 Eg(t);case 8:return t===fy?"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 qo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function n0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OO(e){var t=n0(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=OO(e))}function r0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=n0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vd(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 Tg(e,t){var n=t.checked;return rt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function KI(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qo(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 o0(e,t){t=t.checked,t!=null&&dy(e,"checked",t,!1)}function Ig(e,t){o0(e,t);var n=qo(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")?wg(e,t.type,n):t.hasOwnProperty("defaultValue")&&wg(e,t.type,qo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function JI(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 wg(e,t,n){(t!=="number"||Vd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zl=Array.isArray;function Xs(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=""+qo(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 Cg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(L(91));return rt({},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(L(92));if(zl(n)){if(1<n.length)throw Error(L(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:qo(n)}}function i0(e,t){var n=qo(t.value),r=qo(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 QI(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function s0(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 Rg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?s0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var _d,a0=(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(_d=_d||document.createElement("div"),_d.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=_d.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function tc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gl={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},DO=["Webkit","ms","Moz","O"];Object.keys(Gl).forEach(function(e){DO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gl[t]=Gl[e]})});function l0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gl.hasOwnProperty(e)&&Gl[e]?(""+t).trim():t+"px"}function c0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=l0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var UO=rt({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 xg(e,t){if(t){if(UO[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function bg(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 kg=null;function hy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ng=null,Qs=null,Zs=null;function ZI(e){if(e=_c(e)){if(typeof Ng!="function")throw Error(L(280));var t=e.stateNode;t&&(t=Ef(t),Ng(e.stateNode,e.type,t))}}function u0(e){Qs?Zs?Zs.push(e):Zs=[e]:Qs=e}function d0(){if(Qs){var e=Qs,t=Zs;if(Zs=Qs=null,ZI(e),t)for(e=0;e<t.length;e++)ZI(t[e])}}function f0(e,t){return e(t)}function p0(){}var Qh=!1;function m0(e,t,n){if(Qh)return e(t,n);Qh=!0;try{return f0(e,t,n)}finally{Qh=!1,(Qs!==null||Zs!==null)&&(p0(),d0())}}function nc(e,t){var n=e.stateNode;if(n===null)return null;var r=Ef(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(L(231,t,typeof n));return n}var Ag=!1;if(ao)try{Us={},Object.defineProperty(Us,"passive",{get:function(){Ag=!0}}),window.addEventListener("test",Us,Us),window.removeEventListener("test",Us,Us)}catch{Ag=!1}var Us;function FO(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 Vl=!1,qd=null,Yd=!1,Mg=null,BO={onError:function(e){Vl=!0,qd=e}};function HO(e,t,n,r,o,i,s,a,l){Vl=!1,qd=null,FO.apply(BO,arguments)}function $O(e,t,n,r,o,i,s,a,l){if(HO.apply(this,arguments),Vl){if(Vl){var c=qd;Vl=!1,qd=null}else throw Error(L(198));Yd||(Yd=!0,Mg=c)}}function Hi(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 h0(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 ew(e){if(Hi(e)!==e)throw Error(L(188))}function zO(e){var t=e.alternate;if(!t){if(t=Hi(e),t===null)throw Error(L(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 ew(o),e;if(i===r)return ew(o),t;i=i.sibling}throw Error(L(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(L(189))}}if(n.alternate!==r)throw Error(L(190))}if(n.tag!==3)throw Error(L(188));return n.stateNode.current===n?e:t}function g0(e){return e=zO(e),e!==null?y0(e):null}function y0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=y0(e);if(t!==null)return t;e=e.sibling}return null}var S0=Ln.unstable_scheduleCallback,tw=Ln.unstable_cancelCallback,jO=Ln.unstable_shouldYield,WO=Ln.unstable_requestPaint,pt=Ln.unstable_now,GO=Ln.unstable_getCurrentPriorityLevel,gy=Ln.unstable_ImmediatePriority,_0=Ln.unstable_UserBlockingPriority,Kd=Ln.unstable_NormalPriority,VO=Ln.unstable_LowPriority,v0=Ln.unstable_IdlePriority,yf=null,Pr=null;function qO(e){if(Pr&&typeof Pr.onCommitFiberRoot=="function")try{Pr.onCommitFiberRoot(yf,e,void 0,(e.current.flags&128)===128)}catch{}}var Sr=Math.clz32?Math.clz32:JO,YO=Math.log,KO=Math.LN2;function JO(e){return e>>>=0,e===0?32:31-(YO(e)/KO|0)|0}var vd=64,Ed=4194304;function jl(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 Jd(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=jl(a):(i&=s,i!==0&&(r=jl(i)))}else s=n&~o,s!==0?r=jl(s):i!==0&&(r=jl(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-Sr(t),o=1<<n,r|=e[n],t&=~o;return r}function XO(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 QO(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Sr(i),a=1<<s,l=o[s];l===-1?((a&n)===0||(a&r)!==0)&&(o[s]=XO(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Pg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function E0(){var e=vd;return vd<<=1,(vd&4194240)===0&&(vd=64),e}function Zh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sr(t),e[t]=n}function ZO(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-Sr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function yy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Sr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var De=0;function T0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var I0,Sy,w0,C0,R0,Lg=!1,Td=[],Bo=null,Ho=null,$o=null,rc=new Map,oc=new Map,Oo=[],eD="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 nw(e,t){switch(e){case"focusin":case"focusout":Bo=null;break;case"dragenter":case"dragleave":Ho=null;break;case"mouseover":case"mouseout":$o=null;break;case"pointerover":case"pointerout":rc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oc.delete(t.pointerId)}}function Ll(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=_c(t),t!==null&&Sy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function tD(e,t,n,r,o){switch(t){case"focusin":return Bo=Ll(Bo,e,t,n,r,o),!0;case"dragenter":return Ho=Ll(Ho,e,t,n,r,o),!0;case"mouseover":return $o=Ll($o,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return rc.set(i,Ll(rc.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,oc.set(i,Ll(oc.get(i)||null,e,t,n,r,o)),!0}return!1}function x0(e){var t=ki(e.target);if(t!==null){var n=Hi(t);if(n!==null){if(t=n.tag,t===13){if(t=h0(n),t!==null){e.blockedOn=t,R0(e.priority,function(){w0(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 Dd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Og(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);kg=r,n.target.dispatchEvent(r),kg=null}else return t=_c(n),t!==null&&Sy(t),e.blockedOn=n,!1;t.shift()}return!0}function rw(e,t,n){Dd(e)&&n.delete(t)}function nD(){Lg=!1,Bo!==null&&Dd(Bo)&&(Bo=null),Ho!==null&&Dd(Ho)&&(Ho=null),$o!==null&&Dd($o)&&($o=null),rc.forEach(rw),oc.forEach(rw)}function Ol(e,t){e.blockedOn===t&&(e.blockedOn=null,Lg||(Lg=!0,Ln.unstable_scheduleCallback(Ln.unstable_NormalPriority,nD)))}function ic(e){function t(o){return Ol(o,e)}if(0<Td.length){Ol(Td[0],e);for(var n=1;n<Td.length;n++){var r=Td[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Bo!==null&&Ol(Bo,e),Ho!==null&&Ol(Ho,e),$o!==null&&Ol($o,e),rc.forEach(t),oc.forEach(t),n=0;n<Oo.length;n++)r=Oo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Oo.length&&(n=Oo[0],n.blockedOn===null);)x0(n),n.blockedOn===null&&Oo.shift()}var ea=fo.ReactCurrentBatchConfig,Xd=!0;function rD(e,t,n,r){var o=De,i=ea.transition;ea.transition=null;try{De=1,_y(e,t,n,r)}finally{De=o,ea.transition=i}}function oD(e,t,n,r){var o=De,i=ea.transition;ea.transition=null;try{De=4,_y(e,t,n,r)}finally{De=o,ea.transition=i}}function _y(e,t,n,r){if(Xd){var o=Og(e,t,n,r);if(o===null)sg(e,t,r,Qd,n),nw(e,r);else if(tD(o,e,t,n,r))r.stopPropagation();else if(nw(e,r),t&4&&-1<eD.indexOf(e)){for(;o!==null;){var i=_c(o);if(i!==null&&I0(i),i=Og(e,t,n,r),i===null&&sg(e,t,r,Qd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else sg(e,t,r,null,n)}}var Qd=null;function Og(e,t,n,r){if(Qd=null,e=hy(r),e=ki(e),e!==null)if(t=Hi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=h0(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 Qd=e,null}function b0(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(GO()){case gy:return 1;case _0:return 4;case Kd:case VO:return 16;case v0:return 536870912;default:return 16}default:return 16}}var Uo=null,vy=null,Ud=null;function k0(){if(Ud)return Ud;var e,t=vy,n=t.length,r,o="value"in Uo?Uo.value:Uo.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 Ud=o.slice(e,1<r?1-r:void 0)}function Fd(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 Id(){return!0}function ow(){return!1}function On(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)?Id:ow,this.isPropagationStopped=ow,this}return rt(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=Id)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Id)},persist:function(){},isPersistent:Id}),t}var ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ey=On(ua),Sc=rt({},ua,{view:0,detail:0}),iD=On(Sc),eg,tg,Dl,Sf=rt({},Sc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ty,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!==Dl&&(Dl&&e.type==="mousemove"?(eg=e.screenX-Dl.screenX,tg=e.screenY-Dl.screenY):tg=eg=0,Dl=e),eg)},movementY:function(e){return"movementY"in e?e.movementY:tg}}),iw=On(Sf),sD=rt({},Sf,{dataTransfer:0}),aD=On(sD),lD=rt({},Sc,{relatedTarget:0}),ng=On(lD),cD=rt({},ua,{animationName:0,elapsedTime:0,pseudoElement:0}),uD=On(cD),dD=rt({},ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fD=On(dD),pD=rt({},ua,{data:0}),sw=On(pD),mD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hD={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"},gD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gD[e])?!!t[e]:!1}function Ty(){return yD}var SD=rt({},Sc,{key:function(e){if(e.key){var t=mD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ty,charCode:function(e){return e.type==="keypress"?Fd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_D=On(SD),vD=rt({},Sf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aw=On(vD),ED=rt({},Sc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ty}),TD=On(ED),ID=rt({},ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),wD=On(ID),CD=rt({},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}),RD=On(CD),xD=[9,13,27,32],Iy=ao&&"CompositionEvent"in window,ql=null;ao&&"documentMode"in document&&(ql=document.documentMode);var bD=ao&&"TextEvent"in window&&!ql,N0=ao&&(!Iy||ql&&8<ql&&11>=ql),lw=" ",cw=!1;function A0(e,t){switch(e){case"keyup":return xD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $s=!1;function kD(e,t){switch(e){case"compositionend":return M0(t);case"keypress":return t.which!==32?null:(cw=!0,lw);case"textInput":return e=t.data,e===lw&&cw?null:e;default:return null}}function ND(e,t){if($s)return e==="compositionend"||!Iy&&A0(e,t)?(e=k0(),Ud=vy=Uo=null,$s=!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 N0&&t.locale!=="ko"?null:t.data;default:return null}}var AD={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 uw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!AD[e.type]:t==="textarea"}function P0(e,t,n,r){u0(r),t=Zd(t,"onChange"),0<t.length&&(n=new Ey("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yl=null,sc=null;function MD(e){W0(e,0)}function _f(e){var t=Ws(e);if(r0(t))return e}function PD(e,t){if(e==="change")return t}var L0=!1;ao&&(ao?(Cd="oninput"in document,Cd||(rg=document.createElement("div"),rg.setAttribute("oninput","return;"),Cd=typeof rg.oninput=="function"),wd=Cd):wd=!1,L0=wd&&(!document.documentMode||9<document.documentMode));var wd,Cd,rg;function dw(){Yl&&(Yl.detachEvent("onpropertychange",O0),sc=Yl=null)}function O0(e){if(e.propertyName==="value"&&_f(sc)){var t=[];P0(t,sc,e,hy(e)),m0(MD,t)}}function LD(e,t,n){e==="focusin"?(dw(),Yl=t,sc=n,Yl.attachEvent("onpropertychange",O0)):e==="focusout"&&dw()}function OD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _f(sc)}function DD(e,t){if(e==="click")return _f(t)}function UD(e,t){if(e==="input"||e==="change")return _f(t)}function FD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vr=typeof Object.is=="function"?Object.is:FD;function ac(e,t){if(vr(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(!yg.call(t,o)||!vr(e[o],t[o]))return!1}return!0}function fw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pw(e,t){var n=fw(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=fw(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 U0(){for(var e=window,t=Vd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vd(e.document)}return t}function wy(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 BD(e){var t=U0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&D0(n.ownerDocument.documentElement,n)){if(r!==null&&wy(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=pw(n,i);var s=pw(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 HD=ao&&"documentMode"in document&&11>=document.documentMode,zs=null,Dg=null,Kl=null,Ug=!1;function mw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ug||zs==null||zs!==Vd(r)||(r=zs,"selectionStart"in r&&wy(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}),Kl&&ac(Kl,r)||(Kl=r,r=Zd(Dg,"onSelect"),0<r.length&&(t=new Ey("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=zs)))}function Rd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var js={animationend:Rd("Animation","AnimationEnd"),animationiteration:Rd("Animation","AnimationIteration"),animationstart:Rd("Animation","AnimationStart"),transitionend:Rd("Transition","TransitionEnd")},og={},F0={};ao&&(F0=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function vf(e){if(og[e])return og[e];if(!js[e])return e;var t=js[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in F0)return og[e]=t[n];return e}var B0=vf("animationend"),H0=vf("animationiteration"),$0=vf("animationstart"),z0=vf("transitionend"),j0=new Map,hw="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 Ko(e,t){j0.set(e,t),Bi(t,[e])}for(xd=0;xd<hw.length;xd++)bd=hw[xd],gw=bd.toLowerCase(),yw=bd[0].toUpperCase()+bd.slice(1),Ko(gw,"on"+yw);var bd,gw,yw,xd;Ko(B0,"onAnimationEnd");Ko(H0,"onAnimationIteration");Ko($0,"onAnimationStart");Ko("dblclick","onDoubleClick");Ko("focusin","onFocus");Ko("focusout","onBlur");Ko(z0,"onTransitionEnd");ra("onMouseEnter",["mouseout","mouseover"]);ra("onMouseLeave",["mouseout","mouseover"]);ra("onPointerEnter",["pointerout","pointerover"]);ra("onPointerLeave",["pointerout","pointerover"]);Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="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(" "),$D=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wl));function Sw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,$O(r,t,void 0,e),e.currentTarget=null}function W0(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;Sw(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;Sw(o,a,c),i=l}}}if(Yd)throw e=Mg,Yd=!1,Mg=null,e}function Ye(e,t){var n=t[zg];n===void 0&&(n=t[zg]=new Set);var r=e+"__bubble";n.has(r)||(G0(t,e,2,!1),n.add(r))}function ig(e,t,n){var r=0;t&&(r|=4),G0(n,e,r,t)}var kd="_reactListening"+Math.random().toString(36).slice(2);function lc(e){if(!e[kd]){e[kd]=!0,Qw.forEach(function(n){n!=="selectionchange"&&($D.has(n)||ig(n,!1,e),ig(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[kd]||(t[kd]=!0,ig("selectionchange",!1,t))}}function G0(e,t,n,r){switch(b0(t)){case 1:var o=rD;break;case 4:o=oD;break;default:o=_y}n=o.bind(null,t,n,e),o=void 0,!Ag||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 sg(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=ki(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}m0(function(){var c=i,u=hy(n),f=[];e:{var p=j0.get(e);if(p!==void 0){var h=Ey,y=e;switch(e){case"keypress":if(Fd(n)===0)break e;case"keydown":case"keyup":h=_D;break;case"focusin":y="focus",h=ng;break;case"focusout":y="blur",h=ng;break;case"beforeblur":case"afterblur":h=ng;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=iw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=aD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=TD;break;case B0:case H0:case $0:h=uD;break;case z0:h=wD;break;case"scroll":h=iD;break;case"wheel":h=RD;break;case"copy":case"cut":case"paste":h=fD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=aw}var _=(t&4)!==0,T=!_&&e==="scroll",g=_?p!==null?p+"Capture":null:p;_=[];for(var S=c,E;S!==null;){E=S;var R=E.stateNode;if(E.tag===5&&R!==null&&(E=R,g!==null&&(R=nc(S,g),R!=null&&_.push(cc(S,R,E)))),T)break;S=S.return}0<_.length&&(p=new h(p,y,null,n,u),f.push({event:p,listeners:_}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==kg&&(y=n.relatedTarget||n.fromElement)&&(ki(y)||y[lo]))break e;if((h||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=c,y=y?ki(y):null,y!==null&&(T=Hi(y),y!==T||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=c),h!==y)){if(_=iw,R="onMouseLeave",g="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(_=aw,R="onPointerLeave",g="onPointerEnter",S="pointer"),T=h==null?p:Ws(h),E=y==null?p:Ws(y),p=new _(R,S+"leave",h,n,u),p.target=T,p.relatedTarget=E,R=null,ki(u)===c&&(_=new _(g,S+"enter",y,n,u),_.target=E,_.relatedTarget=T,R=_),T=R,h&&y)t:{for(_=h,g=y,S=0,E=_;E;E=Fs(E))S++;for(E=0,R=g;R;R=Fs(R))E++;for(;0<S-E;)_=Fs(_),S--;for(;0<E-S;)g=Fs(g),E--;for(;S--;){if(_===g||g!==null&&_===g.alternate)break t;_=Fs(_),g=Fs(g)}_=null}else _=null;h!==null&&_w(f,p,h,_,!1),y!==null&&T!==null&&_w(f,T,y,_,!0)}}e:{if(p=c?Ws(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var M=PD;else if(uw(p))if(L0)M=UD;else{M=OD;var A=LD}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(M=DD);if(M&&(M=M(e,c))){P0(f,M,n,u);break e}A&&A(e,p,c),e==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&wg(p,"number",p.value)}switch(A=c?Ws(c):window,e){case"focusin":(uw(A)||A.contentEditable==="true")&&(zs=A,Dg=c,Kl=null);break;case"focusout":Kl=Dg=zs=null;break;case"mousedown":Ug=!0;break;case"contextmenu":case"mouseup":case"dragend":Ug=!1,mw(f,n,u);break;case"selectionchange":if(HD)break;case"keydown":case"keyup":mw(f,n,u)}var I;if(Iy)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 $s?A0(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(N0&&n.locale!=="ko"&&($s||N!=="onCompositionStart"?N==="onCompositionEnd"&&$s&&(I=k0()):(Uo=u,vy="value"in Uo?Uo.value:Uo.textContent,$s=!0)),A=Zd(c,N),0<A.length&&(N=new sw(N,e,null,n,u),f.push({event:N,listeners:A}),I?N.data=I:(I=M0(n),I!==null&&(N.data=I)))),(I=bD?kD(e,n):ND(e,n))&&(c=Zd(c,"onBeforeInput"),0<c.length&&(u=new sw("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=I))}W0(f,t)})}function cc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=nc(e,n),i!=null&&r.unshift(cc(e,i,o)),i=nc(e,t),i!=null&&r.push(cc(e,i,o))),e=e.return}return r}function Fs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _w(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=nc(n,i),l!=null&&s.unshift(cc(n,l,a))):o||(l=nc(n,i),l!=null&&s.push(cc(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var zD=/\r\n?/g,jD=/\u0000|\uFFFD/g;function vw(e){return(typeof e=="string"?e:""+e).replace(zD,`
6
- `).replace(jD,"")}function Nd(e,t,n){if(t=vw(t),vw(e)!==t&&n)throw Error(L(425))}function ef(){}var Fg=null,Bg=null;function Hg(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 $g=typeof setTimeout=="function"?setTimeout:void 0,WD=typeof clearTimeout=="function"?clearTimeout:void 0,Ew=typeof Promise=="function"?Promise:void 0,GD=typeof queueMicrotask=="function"?queueMicrotask:typeof Ew<"u"?function(e){return Ew.resolve(null).then(e).catch(VD)}:$g;function VD(e){setTimeout(function(){throw e})}function ag(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),ic(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ic(t)}function zo(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 Tw(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 da=Math.random().toString(36).slice(2),Mr="__reactFiber$"+da,uc="__reactProps$"+da,lo="__reactContainer$"+da,zg="__reactEvents$"+da,qD="__reactListeners$"+da,YD="__reactHandles$"+da;function ki(e){var t=e[Mr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lo]||n[Mr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tw(e);e!==null;){if(n=e[Mr])return n;e=Tw(e)}return t}e=n,n=e.parentNode}return null}function _c(e){return e=e[Mr]||e[lo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ws(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(L(33))}function Ef(e){return e[uc]||null}var jg=[],Gs=-1;function Jo(e){return{current:e}}function Ke(e){0>Gs||(e.current=jg[Gs],jg[Gs]=null,Gs--)}function Ge(e,t){Gs++,jg[Gs]=e.current,e.current=t}var Yo={},Kt=Jo(Yo),_n=Jo(!1),Li=Yo;function oa(e,t){var n=e.type.contextTypes;if(!n)return Yo;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 vn(e){return e=e.childContextTypes,e!=null}function tf(){Ke(_n),Ke(Kt)}function Iw(e,t,n){if(Kt.current!==Yo)throw Error(L(168));Ge(Kt,t),Ge(_n,n)}function V0(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(L(108,LO(e)||"Unknown",o));return rt({},n,r)}function nf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yo,Li=Kt.current,Ge(Kt,e),Ge(_n,_n.current),!0}function ww(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=V0(e,t,Li),r.__reactInternalMemoizedMergedChildContext=e,Ke(_n),Ke(Kt),Ge(Kt,e)):Ke(_n),Ge(_n,n)}var ro=null,Tf=!1,lg=!1;function q0(e){ro===null?ro=[e]:ro.push(e)}function KD(e){Tf=!0,q0(e)}function Xo(){if(!lg&&ro!==null){lg=!0;var e=0,t=De;try{var n=ro;for(De=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ro=null,Tf=!1}catch(o){throw ro!==null&&(ro=ro.slice(e+1)),S0(gy,Xo),o}finally{De=t,lg=!1}}return null}var Vs=[],qs=0,rf=null,of=0,Kn=[],Jn=0,Oi=null,oo=1,io="";function xi(e,t){Vs[qs++]=of,Vs[qs++]=rf,rf=e,of=t}function Y0(e,t,n){Kn[Jn++]=oo,Kn[Jn++]=io,Kn[Jn++]=Oi,Oi=e;var r=oo;e=io;var o=32-Sr(r)-1;r&=~(1<<o),n+=1;var i=32-Sr(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,oo=1<<32-Sr(t)+o|n<<o|r,io=i+e}else oo=1<<i|n<<o|r,io=e}function Cy(e){e.return!==null&&(xi(e,1),Y0(e,1,0))}function Ry(e){for(;e===rf;)rf=Vs[--qs],Vs[qs]=null,of=Vs[--qs],Vs[qs]=null;for(;e===Oi;)Oi=Kn[--Jn],Kn[Jn]=null,io=Kn[--Jn],Kn[Jn]=null,oo=Kn[--Jn],Kn[Jn]=null}var Pn=null,Mn=null,Qe=!1,yr=null;function K0(e,t){var n=Xn(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 Cw(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,Pn=e,Mn=zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pn=e,Mn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Oi!==null?{id:oo,overflow:io}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Pn=e,Mn=null,!0):!1;default:return!1}}function Wg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gg(e){if(Qe){var t=Mn;if(t){var n=t;if(!Cw(e,t)){if(Wg(e))throw Error(L(418));t=zo(n.nextSibling);var r=Pn;t&&Cw(e,t)?K0(r,n):(e.flags=e.flags&-4097|2,Qe=!1,Pn=e)}}else{if(Wg(e))throw Error(L(418));e.flags=e.flags&-4097|2,Qe=!1,Pn=e}}}function Rw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pn=e}function Ad(e){if(e!==Pn)return!1;if(!Qe)return Rw(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Hg(e.type,e.memoizedProps)),t&&(t=Mn)){if(Wg(e))throw J0(),Error(L(418));for(;t;)K0(e,t),t=zo(t.nextSibling)}if(Rw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Mn=zo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mn=null}}else Mn=Pn?zo(e.stateNode.nextSibling):null;return!0}function J0(){for(var e=Mn;e;)e=zo(e.nextSibling)}function ia(){Mn=Pn=null,Qe=!1}function xy(e){yr===null?yr=[e]:yr.push(e)}var JD=fo.ReactCurrentBatchConfig;function Ul(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(L(309));var r=n.stateNode}if(!r)throw Error(L(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(L(284));if(!n._owner)throw Error(L(290,e))}return e}function Md(e,t){throw e=Object.prototype.toString.call(t),Error(L(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xw(e){var t=e._init;return t(e._payload)}function X0(e){function t(g,S){if(e){var E=g.deletions;E===null?(g.deletions=[S],g.flags|=16):E.push(S)}}function n(g,S){if(!e)return null;for(;S!==null;)t(g,S),S=S.sibling;return null}function r(g,S){for(g=new Map;S!==null;)S.key!==null?g.set(S.key,S):g.set(S.index,S),S=S.sibling;return g}function o(g,S){return g=Vo(g,S),g.index=0,g.sibling=null,g}function i(g,S,E){return g.index=E,e?(E=g.alternate,E!==null?(E=E.index,E<S?(g.flags|=2,S):E):(g.flags|=2,S)):(g.flags|=1048576,S)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,S,E,R){return S===null||S.tag!==6?(S=hg(E,g.mode,R),S.return=g,S):(S=o(S,E),S.return=g,S)}function l(g,S,E,R){var M=E.type;return M===Hs?u(g,S,E.props.children,R,E.key):S!==null&&(S.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Po&&xw(M)===S.type)?(R=o(S,E.props),R.ref=Ul(g,S,E),R.return=g,R):(R=Gd(E.type,E.key,E.props,null,g.mode,R),R.ref=Ul(g,S,E),R.return=g,R)}function c(g,S,E,R){return S===null||S.tag!==4||S.stateNode.containerInfo!==E.containerInfo||S.stateNode.implementation!==E.implementation?(S=gg(E,g.mode,R),S.return=g,S):(S=o(S,E.children||[]),S.return=g,S)}function u(g,S,E,R,M){return S===null||S.tag!==7?(S=Pi(E,g.mode,R,M),S.return=g,S):(S=o(S,E),S.return=g,S)}function f(g,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return S=hg(""+S,g.mode,E),S.return=g,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case yd:return E=Gd(S.type,S.key,S.props,null,g.mode,E),E.ref=Ul(g,null,S),E.return=g,E;case Bs:return S=gg(S,g.mode,E),S.return=g,S;case Po:var R=S._init;return f(g,R(S._payload),E)}if(zl(S)||Pl(S))return S=Pi(S,g.mode,E,null),S.return=g,S;Md(g,S)}return null}function p(g,S,E,R){var M=S!==null?S.key:null;if(typeof E=="string"&&E!==""||typeof E=="number")return M!==null?null:a(g,S,""+E,R);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case yd:return E.key===M?l(g,S,E,R):null;case Bs:return E.key===M?c(g,S,E,R):null;case Po:return M=E._init,p(g,S,M(E._payload),R)}if(zl(E)||Pl(E))return M!==null?null:u(g,S,E,R,null);Md(g,E)}return null}function h(g,S,E,R,M){if(typeof R=="string"&&R!==""||typeof R=="number")return g=g.get(E)||null,a(S,g,""+R,M);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case yd:return g=g.get(R.key===null?E:R.key)||null,l(S,g,R,M);case Bs:return g=g.get(R.key===null?E:R.key)||null,c(S,g,R,M);case Po:var A=R._init;return h(g,S,E,A(R._payload),M)}if(zl(R)||Pl(R))return g=g.get(E)||null,u(S,g,R,M,null);Md(S,R)}return null}function y(g,S,E,R){for(var M=null,A=null,I=S,N=S=0,U=null;I!==null&&N<E.length;N++){I.index>N?(U=I,I=null):U=I.sibling;var x=p(g,I,E[N],R);if(x===null){I===null&&(I=U);break}e&&I&&x.alternate===null&&t(g,I),S=i(x,S,N),A===null?M=x:A.sibling=x,A=x,I=U}if(N===E.length)return n(g,I),Qe&&xi(g,N),M;if(I===null){for(;N<E.length;N++)I=f(g,E[N],R),I!==null&&(S=i(I,S,N),A===null?M=I:A.sibling=I,A=I);return Qe&&xi(g,N),M}for(I=r(g,I);N<E.length;N++)U=h(I,g,N,E[N],R),U!==null&&(e&&U.alternate!==null&&I.delete(U.key===null?N:U.key),S=i(U,S,N),A===null?M=U:A.sibling=U,A=U);return e&&I.forEach(function(H){return t(g,H)}),Qe&&xi(g,N),M}function _(g,S,E,R){var M=Pl(E);if(typeof M!="function")throw Error(L(150));if(E=M.call(E),E==null)throw Error(L(151));for(var A=M=null,I=S,N=S=0,U=null,x=E.next();I!==null&&!x.done;N++,x=E.next()){I.index>N?(U=I,I=null):U=I.sibling;var H=p(g,I,x.value,R);if(H===null){I===null&&(I=U);break}e&&I&&H.alternate===null&&t(g,I),S=i(H,S,N),A===null?M=H:A.sibling=H,A=H,I=U}if(x.done)return n(g,I),Qe&&xi(g,N),M;if(I===null){for(;!x.done;N++,x=E.next())x=f(g,x.value,R),x!==null&&(S=i(x,S,N),A===null?M=x:A.sibling=x,A=x);return Qe&&xi(g,N),M}for(I=r(g,I);!x.done;N++,x=E.next())x=h(I,g,N,x.value,R),x!==null&&(e&&x.alternate!==null&&I.delete(x.key===null?N:x.key),S=i(x,S,N),A===null?M=x:A.sibling=x,A=x);return e&&I.forEach(function(j){return t(g,j)}),Qe&&xi(g,N),M}function T(g,S,E,R){if(typeof E=="object"&&E!==null&&E.type===Hs&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case yd:e:{for(var M=E.key,A=S;A!==null;){if(A.key===M){if(M=E.type,M===Hs){if(A.tag===7){n(g,A.sibling),S=o(A,E.props.children),S.return=g,g=S;break e}}else if(A.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Po&&xw(M)===A.type){n(g,A.sibling),S=o(A,E.props),S.ref=Ul(g,A,E),S.return=g,g=S;break e}n(g,A);break}else t(g,A);A=A.sibling}E.type===Hs?(S=Pi(E.props.children,g.mode,R,E.key),S.return=g,g=S):(R=Gd(E.type,E.key,E.props,null,g.mode,R),R.ref=Ul(g,S,E),R.return=g,g=R)}return s(g);case Bs:e:{for(A=E.key;S!==null;){if(S.key===A)if(S.tag===4&&S.stateNode.containerInfo===E.containerInfo&&S.stateNode.implementation===E.implementation){n(g,S.sibling),S=o(S,E.children||[]),S.return=g,g=S;break e}else{n(g,S);break}else t(g,S);S=S.sibling}S=gg(E,g.mode,R),S.return=g,g=S}return s(g);case Po:return A=E._init,T(g,S,A(E._payload),R)}if(zl(E))return y(g,S,E,R);if(Pl(E))return _(g,S,E,R);Md(g,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,S!==null&&S.tag===6?(n(g,S.sibling),S=o(S,E),S.return=g,g=S):(n(g,S),S=hg(E,g.mode,R),S.return=g,g=S),s(g)):n(g,S)}return T}var sa=X0(!0),Q0=X0(!1),sf=Jo(null),af=null,Ys=null,by=null;function ky(){by=Ys=af=null}function Ny(e){var t=sf.current;Ke(sf),e._currentValue=t}function Vg(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 ta(e,t){af=e,by=Ys=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Sn=!0),e.firstContext=null)}function Zn(e){var t=e._currentValue;if(by!==e)if(e={context:e,memoizedValue:t,next:null},Ys===null){if(af===null)throw Error(L(308));Ys=e,af.dependencies={lanes:0,firstContext:e}}else Ys=Ys.next=e;return t}var Ni=null;function Ay(e){Ni===null?Ni=[e]:Ni.push(e)}function Z0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ay(t)):(n.next=o.next,o.next=n),t.interleaved=n,co(e,r)}function co(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 Lo=!1;function My(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function eC(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 so(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(xe&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,co(e,n)}return o=r.interleaved,o===null?(t.next=t,Ay(r)):(t.next=o.next,o.next=t),r.interleaved=t,co(e,n)}function Bd(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,yy(e,n)}}function bw(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 lf(e,t,n,r){var o=e.updateQueue;Lo=!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 f=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 y=e,_=a;switch(p=t,h=n,_.tag){case 1:if(y=_.payload,typeof y=="function"){f=y.call(h,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=_.payload,p=typeof y=="function"?y.call(h,f,p):y,p==null)break e;f=rt({},f,p);break e;case 2:Lo=!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=f):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=f),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);Ui|=s,e.lanes=s,e.memoizedState=f}}function kw(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(L(191,o));o.call(r)}}}var vc={},Lr=Jo(vc),dc=Jo(vc),fc=Jo(vc);function Ai(e){if(e===vc)throw Error(L(174));return e}function Py(e,t){switch(Ge(fc,t),Ge(dc,e),Ge(Lr,vc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rg(t,e)}Ke(Lr),Ge(Lr,t)}function aa(){Ke(Lr),Ke(dc),Ke(fc)}function tC(e){Ai(fc.current);var t=Ai(Lr.current),n=Rg(t,e.type);t!==n&&(Ge(dc,e),Ge(Lr,n))}function Ly(e){dc.current===e&&(Ke(Lr),Ke(dc))}var tt=Jo(0);function cf(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 cg=[];function Oy(){for(var e=0;e<cg.length;e++)cg[e]._workInProgressVersionPrimary=null;cg.length=0}var Hd=fo.ReactCurrentDispatcher,ug=fo.ReactCurrentBatchConfig,Di=0,nt=null,Tt=null,Rt=null,uf=!1,Jl=!1,pc=0,XD=0;function Vt(){throw Error(L(321))}function Dy(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function Uy(e,t,n,r,o,i){if(Di=i,nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Hd.current=e===null||e.memoizedState===null?tU:nU,e=n(r,o),Jl){i=0;do{if(Jl=!1,pc=0,25<=i)throw Error(L(301));i+=1,Rt=Tt=null,t.updateQueue=null,Hd.current=rU,e=n(r,o)}while(Jl)}if(Hd.current=df,t=Tt!==null&&Tt.next!==null,Di=0,Rt=Tt=nt=null,uf=!1,t)throw Error(L(300));return e}function Fy(){var e=pc!==0;return pc=0,e}function Ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?nt.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function er(){if(Tt===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=Rt===null?nt.memoizedState:Rt.next;if(t!==null)Rt=t,Tt=e;else{if(e===null)throw Error(L(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Rt===null?nt.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function mc(e,t){return typeof t=="function"?t(e):t}function dg(e){var t=er(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=Tt,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((Di&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 f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,nt.lanes|=u,Ui|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,vr(r,t.memoizedState)||(Sn=!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,nt.lanes|=i,Ui|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function fg(e){var t=er(),n=t.queue;if(n===null)throw Error(L(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);vr(i,t.memoizedState)||(Sn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function nC(){}function rC(e,t){var n=nt,r=er(),o=t(),i=!vr(r.memoizedState,o);if(i&&(r.memoizedState=o,Sn=!0),r=r.queue,By(sC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Rt!==null&&Rt.memoizedState.tag&1){if(n.flags|=2048,hc(9,iC.bind(null,n,r,o,t),void 0,null),xt===null)throw Error(L(349));(Di&30)!==0||oC(n,t,o)}return o}function oC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function iC(e,t,n,r){t.value=n,t.getSnapshot=r,aC(t)&&lC(e)}function sC(e,t,n){return n(function(){aC(t)&&lC(e)})}function aC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function lC(e){var t=co(e,1);t!==null&&_r(t,e,1,-1)}function Nw(e){var t=Ar();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mc,lastRenderedState:e},t.queue=e,e=e.dispatch=eU.bind(null,nt,e),[t.memoizedState,e]}function hc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.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 cC(){return er().memoizedState}function $d(e,t,n,r){var o=Ar();nt.flags|=e,o.memoizedState=hc(1|t,n,void 0,r===void 0?null:r)}function If(e,t,n,r){var o=er();r=r===void 0?null:r;var i=void 0;if(Tt!==null){var s=Tt.memoizedState;if(i=s.destroy,r!==null&&Dy(r,s.deps)){o.memoizedState=hc(t,n,i,r);return}}nt.flags|=e,o.memoizedState=hc(1|t,n,i,r)}function Aw(e,t){return $d(8390656,8,e,t)}function By(e,t){return If(2048,8,e,t)}function uC(e,t){return If(4,2,e,t)}function dC(e,t){return If(4,4,e,t)}function fC(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 pC(e,t,n){return n=n!=null?n.concat([e]):null,If(4,4,fC.bind(null,t,e),n)}function Hy(){}function mC(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Dy(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hC(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Dy(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function gC(e,t,n){return(Di&21)===0?(e.baseState&&(e.baseState=!1,Sn=!0),e.memoizedState=n):(vr(n,t)||(n=E0(),nt.lanes|=n,Ui|=n,e.baseState=!0),t)}function QD(e,t){var n=De;De=n!==0&&4>n?n:4,e(!0);var r=ug.transition;ug.transition={};try{e(!1),t()}finally{De=n,ug.transition=r}}function yC(){return er().memoizedState}function ZD(e,t,n){var r=Go(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},SC(e))_C(t,n);else if(n=Z0(e,t,n,r),n!==null){var o=an();_r(n,e,r,o),vC(n,t,r)}}function eU(e,t,n){var r=Go(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(SC(e))_C(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,vr(a,s)){var l=t.interleaved;l===null?(o.next=o,Ay(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}n=Z0(e,t,o,r),n!==null&&(o=an(),_r(n,e,r,o),vC(n,t,r))}}function SC(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function _C(e,t){Jl=uf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vC(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yy(e,n)}}var df={readContext:Zn,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},tU={readContext:Zn,useCallback:function(e,t){return Ar().memoizedState=[e,t===void 0?null:t],e},useContext:Zn,useEffect:Aw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$d(4194308,4,fC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $d(4194308,4,e,t)},useInsertionEffect:function(e,t){return $d(4,2,e,t)},useMemo:function(e,t){var n=Ar();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ar();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=ZD.bind(null,nt,e),[r.memoizedState,e]},useRef:function(e){var t=Ar();return e={current:e},t.memoizedState=e},useState:Nw,useDebugValue:Hy,useDeferredValue:function(e){return Ar().memoizedState=e},useTransition:function(){var e=Nw(!1),t=e[0];return e=QD.bind(null,e[1]),Ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=nt,o=Ar();if(Qe){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),xt===null)throw Error(L(349));(Di&30)!==0||oC(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Aw(sC.bind(null,r,i,e),[e]),r.flags|=2048,hc(9,iC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ar(),t=xt.identifierPrefix;if(Qe){var n=io,r=oo;n=(r&~(1<<32-Sr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=XD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},nU={readContext:Zn,useCallback:mC,useContext:Zn,useEffect:By,useImperativeHandle:pC,useInsertionEffect:uC,useLayoutEffect:dC,useMemo:hC,useReducer:dg,useRef:cC,useState:function(){return dg(mc)},useDebugValue:Hy,useDeferredValue:function(e){var t=er();return gC(t,Tt.memoizedState,e)},useTransition:function(){var e=dg(mc)[0],t=er().memoizedState;return[e,t]},useMutableSource:nC,useSyncExternalStore:rC,useId:yC,unstable_isNewReconciler:!1},rU={readContext:Zn,useCallback:mC,useContext:Zn,useEffect:By,useImperativeHandle:pC,useInsertionEffect:uC,useLayoutEffect:dC,useMemo:hC,useReducer:fg,useRef:cC,useState:function(){return fg(mc)},useDebugValue:Hy,useDeferredValue:function(e){var t=er();return Tt===null?t.memoizedState=e:gC(t,Tt.memoizedState,e)},useTransition:function(){var e=fg(mc)[0],t=er().memoizedState;return[e,t]},useMutableSource:nC,useSyncExternalStore:rC,useId:yC,unstable_isNewReconciler:!1};function hr(e,t){if(e&&e.defaultProps){t=rt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:rt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wf={isMounted:function(e){return(e=e._reactInternals)?Hi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=an(),o=Go(e),i=so(r,o);i.payload=t,n!=null&&(i.callback=n),t=jo(e,i,o),t!==null&&(_r(t,e,o,r),Bd(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=an(),o=Go(e),i=so(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=jo(e,i,o),t!==null&&(_r(t,e,o,r),Bd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=an(),r=Go(e),o=so(n,r);o.tag=2,t!=null&&(o.callback=t),t=jo(e,o,r),t!==null&&(_r(t,e,r,n),Bd(t,e,r))}};function Mw(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?!ac(n,r)||!ac(o,i):!0}function EC(e,t,n){var r=!1,o=Yo,i=t.contextType;return typeof i=="object"&&i!==null?i=Zn(i):(o=vn(t)?Li:Kt.current,r=t.contextTypes,i=(r=r!=null)?oa(e,o):Yo),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=wf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Pw(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&&wf.enqueueReplaceState(t,t.state,null)}function Yg(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},My(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Zn(i):(i=vn(t)?Li:Kt.current,o.context=oa(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(qg(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&&wf.enqueueReplaceState(o,o.state,null),lf(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function la(e,t){try{var n="",r=t;do n+=PO(r),r=r.return;while(r);var o=n}catch(i){o=`
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{Jh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$l(e):""}function LO(e){switch(e.tag){case 5:return $l(e.type);case 16:return $l("Lazy");case 13:return $l("Suspense");case 19:return $l("SuspenseList");case 0:case 2:case 15:return e=Xh(e.type,!1),e;case 11:return e=Xh(e.type.render,!1),e;case 1:return e=Xh(e.type,!0),e;default:return""}}function Eg(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 Hs:return"Fragment";case Bs:return"Portal";case Sg:return"Profiler";case fy:return"StrictMode";case _g:return"Suspense";case vg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case e0:return(e.displayName||"Context")+".Consumer";case Zw:return(e._context.displayName||"Context")+".Provider";case py:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case my:return t=e.displayName||null,t!==null?t:Eg(e.type)||"Memo";case Po:t=e._payload,e=e._init;try{return Eg(e(t))}catch{}}return null}function OO(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 Eg(t);case 8:return t===fy?"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 qo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function n0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function DO(e){var t=n0(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=DO(e))}function r0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=n0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vd(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 Tg(e,t){var n=t.checked;return rt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function KI(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qo(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 o0(e,t){t=t.checked,t!=null&&dy(e,"checked",t,!1)}function Ig(e,t){o0(e,t);var n=qo(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")?wg(e,t.type,n):t.hasOwnProperty("defaultValue")&&wg(e,t.type,qo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function JI(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 wg(e,t,n){(t!=="number"||Vd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zl=Array.isArray;function Xs(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=""+qo(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 Cg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(L(91));return rt({},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(L(92));if(zl(n)){if(1<n.length)throw Error(L(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:qo(n)}}function i0(e,t){var n=qo(t.value),r=qo(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 QI(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function s0(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 Rg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?s0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var _d,a0=(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(_d=_d||document.createElement("div"),_d.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=_d.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function tc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gl={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},UO=["Webkit","ms","Moz","O"];Object.keys(Gl).forEach(function(e){UO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gl[t]=Gl[e]})});function l0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gl.hasOwnProperty(e)&&Gl[e]?(""+t).trim():t+"px"}function c0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=l0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var FO=rt({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 xg(e,t){if(t){if(FO[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function bg(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 kg=null;function hy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ng=null,Qs=null,Zs=null;function ZI(e){if(e=_c(e)){if(typeof Ng!="function")throw Error(L(280));var t=e.stateNode;t&&(t=Ef(t),Ng(e.stateNode,e.type,t))}}function u0(e){Qs?Zs?Zs.push(e):Zs=[e]:Qs=e}function d0(){if(Qs){var e=Qs,t=Zs;if(Zs=Qs=null,ZI(e),t)for(e=0;e<t.length;e++)ZI(t[e])}}function f0(e,t){return e(t)}function p0(){}var Qh=!1;function m0(e,t,n){if(Qh)return e(t,n);Qh=!0;try{return f0(e,t,n)}finally{Qh=!1,(Qs!==null||Zs!==null)&&(p0(),d0())}}function nc(e,t){var n=e.stateNode;if(n===null)return null;var r=Ef(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(L(231,t,typeof n));return n}var Ag=!1;if(ao)try{Us={},Object.defineProperty(Us,"passive",{get:function(){Ag=!0}}),window.addEventListener("test",Us,Us),window.removeEventListener("test",Us,Us)}catch{Ag=!1}var Us;function BO(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 Vl=!1,qd=null,Yd=!1,Mg=null,HO={onError:function(e){Vl=!0,qd=e}};function $O(e,t,n,r,o,i,s,a,l){Vl=!1,qd=null,BO.apply(HO,arguments)}function zO(e,t,n,r,o,i,s,a,l){if($O.apply(this,arguments),Vl){if(Vl){var c=qd;Vl=!1,qd=null}else throw Error(L(198));Yd||(Yd=!0,Mg=c)}}function Hi(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 h0(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 ew(e){if(Hi(e)!==e)throw Error(L(188))}function jO(e){var t=e.alternate;if(!t){if(t=Hi(e),t===null)throw Error(L(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 ew(o),e;if(i===r)return ew(o),t;i=i.sibling}throw Error(L(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(L(189))}}if(n.alternate!==r)throw Error(L(190))}if(n.tag!==3)throw Error(L(188));return n.stateNode.current===n?e:t}function g0(e){return e=jO(e),e!==null?y0(e):null}function y0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=y0(e);if(t!==null)return t;e=e.sibling}return null}var S0=Ln.unstable_scheduleCallback,tw=Ln.unstable_cancelCallback,WO=Ln.unstable_shouldYield,GO=Ln.unstable_requestPaint,pt=Ln.unstable_now,VO=Ln.unstable_getCurrentPriorityLevel,gy=Ln.unstable_ImmediatePriority,_0=Ln.unstable_UserBlockingPriority,Kd=Ln.unstable_NormalPriority,qO=Ln.unstable_LowPriority,v0=Ln.unstable_IdlePriority,yf=null,Pr=null;function YO(e){if(Pr&&typeof Pr.onCommitFiberRoot=="function")try{Pr.onCommitFiberRoot(yf,e,void 0,(e.current.flags&128)===128)}catch{}}var Sr=Math.clz32?Math.clz32:XO,KO=Math.log,JO=Math.LN2;function XO(e){return e>>>=0,e===0?32:31-(KO(e)/JO|0)|0}var vd=64,Ed=4194304;function jl(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 Jd(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=jl(a):(i&=s,i!==0&&(r=jl(i)))}else s=n&~o,s!==0?r=jl(s):i!==0&&(r=jl(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-Sr(t),o=1<<n,r|=e[n],t&=~o;return r}function QO(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 ZO(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Sr(i),a=1<<s,l=o[s];l===-1?((a&n)===0||(a&r)!==0)&&(o[s]=QO(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Pg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function E0(){var e=vd;return vd<<=1,(vd&4194240)===0&&(vd=64),e}function Zh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sr(t),e[t]=n}function eD(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-Sr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function yy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Sr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var De=0;function T0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var I0,Sy,w0,C0,R0,Lg=!1,Td=[],Bo=null,Ho=null,$o=null,rc=new Map,oc=new Map,Oo=[],tD="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 nw(e,t){switch(e){case"focusin":case"focusout":Bo=null;break;case"dragenter":case"dragleave":Ho=null;break;case"mouseover":case"mouseout":$o=null;break;case"pointerover":case"pointerout":rc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oc.delete(t.pointerId)}}function Ll(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=_c(t),t!==null&&Sy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function nD(e,t,n,r,o){switch(t){case"focusin":return Bo=Ll(Bo,e,t,n,r,o),!0;case"dragenter":return Ho=Ll(Ho,e,t,n,r,o),!0;case"mouseover":return $o=Ll($o,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return rc.set(i,Ll(rc.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,oc.set(i,Ll(oc.get(i)||null,e,t,n,r,o)),!0}return!1}function x0(e){var t=ki(e.target);if(t!==null){var n=Hi(t);if(n!==null){if(t=n.tag,t===13){if(t=h0(n),t!==null){e.blockedOn=t,R0(e.priority,function(){w0(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 Dd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Og(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);kg=r,n.target.dispatchEvent(r),kg=null}else return t=_c(n),t!==null&&Sy(t),e.blockedOn=n,!1;t.shift()}return!0}function rw(e,t,n){Dd(e)&&n.delete(t)}function rD(){Lg=!1,Bo!==null&&Dd(Bo)&&(Bo=null),Ho!==null&&Dd(Ho)&&(Ho=null),$o!==null&&Dd($o)&&($o=null),rc.forEach(rw),oc.forEach(rw)}function Ol(e,t){e.blockedOn===t&&(e.blockedOn=null,Lg||(Lg=!0,Ln.unstable_scheduleCallback(Ln.unstable_NormalPriority,rD)))}function ic(e){function t(o){return Ol(o,e)}if(0<Td.length){Ol(Td[0],e);for(var n=1;n<Td.length;n++){var r=Td[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Bo!==null&&Ol(Bo,e),Ho!==null&&Ol(Ho,e),$o!==null&&Ol($o,e),rc.forEach(t),oc.forEach(t),n=0;n<Oo.length;n++)r=Oo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Oo.length&&(n=Oo[0],n.blockedOn===null);)x0(n),n.blockedOn===null&&Oo.shift()}var ea=fo.ReactCurrentBatchConfig,Xd=!0;function oD(e,t,n,r){var o=De,i=ea.transition;ea.transition=null;try{De=1,_y(e,t,n,r)}finally{De=o,ea.transition=i}}function iD(e,t,n,r){var o=De,i=ea.transition;ea.transition=null;try{De=4,_y(e,t,n,r)}finally{De=o,ea.transition=i}}function _y(e,t,n,r){if(Xd){var o=Og(e,t,n,r);if(o===null)sg(e,t,r,Qd,n),nw(e,r);else if(nD(o,e,t,n,r))r.stopPropagation();else if(nw(e,r),t&4&&-1<tD.indexOf(e)){for(;o!==null;){var i=_c(o);if(i!==null&&I0(i),i=Og(e,t,n,r),i===null&&sg(e,t,r,Qd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else sg(e,t,r,null,n)}}var Qd=null;function Og(e,t,n,r){if(Qd=null,e=hy(r),e=ki(e),e!==null)if(t=Hi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=h0(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 Qd=e,null}function b0(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(VO()){case gy:return 1;case _0:return 4;case Kd:case qO:return 16;case v0:return 536870912;default:return 16}default:return 16}}var Uo=null,vy=null,Ud=null;function k0(){if(Ud)return Ud;var e,t=vy,n=t.length,r,o="value"in Uo?Uo.value:Uo.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 Ud=o.slice(e,1<r?1-r:void 0)}function Fd(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 Id(){return!0}function ow(){return!1}function On(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)?Id:ow,this.isPropagationStopped=ow,this}return rt(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=Id)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Id)},persist:function(){},isPersistent:Id}),t}var ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ey=On(ua),Sc=rt({},ua,{view:0,detail:0}),sD=On(Sc),eg,tg,Dl,Sf=rt({},Sc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ty,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!==Dl&&(Dl&&e.type==="mousemove"?(eg=e.screenX-Dl.screenX,tg=e.screenY-Dl.screenY):tg=eg=0,Dl=e),eg)},movementY:function(e){return"movementY"in e?e.movementY:tg}}),iw=On(Sf),aD=rt({},Sf,{dataTransfer:0}),lD=On(aD),cD=rt({},Sc,{relatedTarget:0}),ng=On(cD),uD=rt({},ua,{animationName:0,elapsedTime:0,pseudoElement:0}),dD=On(uD),fD=rt({},ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pD=On(fD),mD=rt({},ua,{data:0}),sw=On(mD),hD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gD={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"},yD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yD[e])?!!t[e]:!1}function Ty(){return SD}var _D=rt({},Sc,{key:function(e){if(e.key){var t=hD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ty,charCode:function(e){return e.type==="keypress"?Fd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vD=On(_D),ED=rt({},Sf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aw=On(ED),TD=rt({},Sc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ty}),ID=On(TD),wD=rt({},ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),CD=On(wD),RD=rt({},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}),xD=On(RD),bD=[9,13,27,32],Iy=ao&&"CompositionEvent"in window,ql=null;ao&&"documentMode"in document&&(ql=document.documentMode);var kD=ao&&"TextEvent"in window&&!ql,N0=ao&&(!Iy||ql&&8<ql&&11>=ql),lw=" ",cw=!1;function A0(e,t){switch(e){case"keyup":return bD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $s=!1;function ND(e,t){switch(e){case"compositionend":return M0(t);case"keypress":return t.which!==32?null:(cw=!0,lw);case"textInput":return e=t.data,e===lw&&cw?null:e;default:return null}}function AD(e,t){if($s)return e==="compositionend"||!Iy&&A0(e,t)?(e=k0(),Ud=vy=Uo=null,$s=!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 N0&&t.locale!=="ko"?null:t.data;default:return null}}var MD={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 uw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!MD[e.type]:t==="textarea"}function P0(e,t,n,r){u0(r),t=Zd(t,"onChange"),0<t.length&&(n=new Ey("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yl=null,sc=null;function PD(e){W0(e,0)}function _f(e){var t=Ws(e);if(r0(t))return e}function LD(e,t){if(e==="change")return t}var L0=!1;ao&&(ao?(Cd="oninput"in document,Cd||(rg=document.createElement("div"),rg.setAttribute("oninput","return;"),Cd=typeof rg.oninput=="function"),wd=Cd):wd=!1,L0=wd&&(!document.documentMode||9<document.documentMode));var wd,Cd,rg;function dw(){Yl&&(Yl.detachEvent("onpropertychange",O0),sc=Yl=null)}function O0(e){if(e.propertyName==="value"&&_f(sc)){var t=[];P0(t,sc,e,hy(e)),m0(PD,t)}}function OD(e,t,n){e==="focusin"?(dw(),Yl=t,sc=n,Yl.attachEvent("onpropertychange",O0)):e==="focusout"&&dw()}function DD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _f(sc)}function UD(e,t){if(e==="click")return _f(t)}function FD(e,t){if(e==="input"||e==="change")return _f(t)}function BD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vr=typeof Object.is=="function"?Object.is:BD;function ac(e,t){if(vr(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(!yg.call(t,o)||!vr(e[o],t[o]))return!1}return!0}function fw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pw(e,t){var n=fw(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=fw(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 U0(){for(var e=window,t=Vd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vd(e.document)}return t}function wy(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 HD(e){var t=U0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&D0(n.ownerDocument.documentElement,n)){if(r!==null&&wy(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=pw(n,i);var s=pw(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 $D=ao&&"documentMode"in document&&11>=document.documentMode,zs=null,Dg=null,Kl=null,Ug=!1;function mw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ug||zs==null||zs!==Vd(r)||(r=zs,"selectionStart"in r&&wy(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}),Kl&&ac(Kl,r)||(Kl=r,r=Zd(Dg,"onSelect"),0<r.length&&(t=new Ey("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=zs)))}function Rd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var js={animationend:Rd("Animation","AnimationEnd"),animationiteration:Rd("Animation","AnimationIteration"),animationstart:Rd("Animation","AnimationStart"),transitionend:Rd("Transition","TransitionEnd")},og={},F0={};ao&&(F0=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function vf(e){if(og[e])return og[e];if(!js[e])return e;var t=js[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in F0)return og[e]=t[n];return e}var B0=vf("animationend"),H0=vf("animationiteration"),$0=vf("animationstart"),z0=vf("transitionend"),j0=new Map,hw="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 Ko(e,t){j0.set(e,t),Bi(t,[e])}for(xd=0;xd<hw.length;xd++)bd=hw[xd],gw=bd.toLowerCase(),yw=bd[0].toUpperCase()+bd.slice(1),Ko(gw,"on"+yw);var bd,gw,yw,xd;Ko(B0,"onAnimationEnd");Ko(H0,"onAnimationIteration");Ko($0,"onAnimationStart");Ko("dblclick","onDoubleClick");Ko("focusin","onFocus");Ko("focusout","onBlur");Ko(z0,"onTransitionEnd");ra("onMouseEnter",["mouseout","mouseover"]);ra("onMouseLeave",["mouseout","mouseover"]);ra("onPointerEnter",["pointerout","pointerover"]);ra("onPointerLeave",["pointerout","pointerover"]);Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="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(" "),zD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wl));function Sw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,zO(r,t,void 0,e),e.currentTarget=null}function W0(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;Sw(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;Sw(o,a,c),i=l}}}if(Yd)throw e=Mg,Yd=!1,Mg=null,e}function Ye(e,t){var n=t[zg];n===void 0&&(n=t[zg]=new Set);var r=e+"__bubble";n.has(r)||(G0(t,e,2,!1),n.add(r))}function ig(e,t,n){var r=0;t&&(r|=4),G0(n,e,r,t)}var kd="_reactListening"+Math.random().toString(36).slice(2);function lc(e){if(!e[kd]){e[kd]=!0,Qw.forEach(function(n){n!=="selectionchange"&&(zD.has(n)||ig(n,!1,e),ig(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[kd]||(t[kd]=!0,ig("selectionchange",!1,t))}}function G0(e,t,n,r){switch(b0(t)){case 1:var o=oD;break;case 4:o=iD;break;default:o=_y}n=o.bind(null,t,n,e),o=void 0,!Ag||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 sg(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=ki(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}m0(function(){var c=i,u=hy(n),f=[];e:{var p=j0.get(e);if(p!==void 0){var h=Ey,y=e;switch(e){case"keypress":if(Fd(n)===0)break e;case"keydown":case"keyup":h=vD;break;case"focusin":y="focus",h=ng;break;case"focusout":y="blur",h=ng;break;case"beforeblur":case"afterblur":h=ng;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=iw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=lD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=ID;break;case B0:case H0:case $0:h=dD;break;case z0:h=CD;break;case"scroll":h=sD;break;case"wheel":h=xD;break;case"copy":case"cut":case"paste":h=pD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=aw}var _=(t&4)!==0,T=!_&&e==="scroll",g=_?p!==null?p+"Capture":null:p;_=[];for(var S=c,E;S!==null;){E=S;var R=E.stateNode;if(E.tag===5&&R!==null&&(E=R,g!==null&&(R=nc(S,g),R!=null&&_.push(cc(S,R,E)))),T)break;S=S.return}0<_.length&&(p=new h(p,y,null,n,u),f.push({event:p,listeners:_}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==kg&&(y=n.relatedTarget||n.fromElement)&&(ki(y)||y[lo]))break e;if((h||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=c,y=y?ki(y):null,y!==null&&(T=Hi(y),y!==T||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=c),h!==y)){if(_=iw,R="onMouseLeave",g="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(_=aw,R="onPointerLeave",g="onPointerEnter",S="pointer"),T=h==null?p:Ws(h),E=y==null?p:Ws(y),p=new _(R,S+"leave",h,n,u),p.target=T,p.relatedTarget=E,R=null,ki(u)===c&&(_=new _(g,S+"enter",y,n,u),_.target=E,_.relatedTarget=T,R=_),T=R,h&&y)t:{for(_=h,g=y,S=0,E=_;E;E=Fs(E))S++;for(E=0,R=g;R;R=Fs(R))E++;for(;0<S-E;)_=Fs(_),S--;for(;0<E-S;)g=Fs(g),E--;for(;S--;){if(_===g||g!==null&&_===g.alternate)break t;_=Fs(_),g=Fs(g)}_=null}else _=null;h!==null&&_w(f,p,h,_,!1),y!==null&&T!==null&&_w(f,T,y,_,!0)}}e:{if(p=c?Ws(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var M=LD;else if(uw(p))if(L0)M=FD;else{M=DD;var A=OD}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(M=UD);if(M&&(M=M(e,c))){P0(f,M,n,u);break e}A&&A(e,p,c),e==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&wg(p,"number",p.value)}switch(A=c?Ws(c):window,e){case"focusin":(uw(A)||A.contentEditable==="true")&&(zs=A,Dg=c,Kl=null);break;case"focusout":Kl=Dg=zs=null;break;case"mousedown":Ug=!0;break;case"contextmenu":case"mouseup":case"dragend":Ug=!1,mw(f,n,u);break;case"selectionchange":if($D)break;case"keydown":case"keyup":mw(f,n,u)}var I;if(Iy)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 $s?A0(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(N0&&n.locale!=="ko"&&($s||N!=="onCompositionStart"?N==="onCompositionEnd"&&$s&&(I=k0()):(Uo=u,vy="value"in Uo?Uo.value:Uo.textContent,$s=!0)),A=Zd(c,N),0<A.length&&(N=new sw(N,e,null,n,u),f.push({event:N,listeners:A}),I?N.data=I:(I=M0(n),I!==null&&(N.data=I)))),(I=kD?ND(e,n):AD(e,n))&&(c=Zd(c,"onBeforeInput"),0<c.length&&(u=new sw("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=I))}W0(f,t)})}function cc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=nc(e,n),i!=null&&r.unshift(cc(e,i,o)),i=nc(e,t),i!=null&&r.push(cc(e,i,o))),e=e.return}return r}function Fs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _w(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=nc(n,i),l!=null&&s.unshift(cc(n,l,a))):o||(l=nc(n,i),l!=null&&s.push(cc(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var jD=/\r\n?/g,WD=/\u0000|\uFFFD/g;function vw(e){return(typeof e=="string"?e:""+e).replace(jD,`
6
+ `).replace(WD,"")}function Nd(e,t,n){if(t=vw(t),vw(e)!==t&&n)throw Error(L(425))}function ef(){}var Fg=null,Bg=null;function Hg(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 $g=typeof setTimeout=="function"?setTimeout:void 0,GD=typeof clearTimeout=="function"?clearTimeout:void 0,Ew=typeof Promise=="function"?Promise:void 0,VD=typeof queueMicrotask=="function"?queueMicrotask:typeof Ew<"u"?function(e){return Ew.resolve(null).then(e).catch(qD)}:$g;function qD(e){setTimeout(function(){throw e})}function ag(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),ic(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ic(t)}function zo(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 Tw(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 da=Math.random().toString(36).slice(2),Mr="__reactFiber$"+da,uc="__reactProps$"+da,lo="__reactContainer$"+da,zg="__reactEvents$"+da,YD="__reactListeners$"+da,KD="__reactHandles$"+da;function ki(e){var t=e[Mr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lo]||n[Mr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tw(e);e!==null;){if(n=e[Mr])return n;e=Tw(e)}return t}e=n,n=e.parentNode}return null}function _c(e){return e=e[Mr]||e[lo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ws(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(L(33))}function Ef(e){return e[uc]||null}var jg=[],Gs=-1;function Jo(e){return{current:e}}function Ke(e){0>Gs||(e.current=jg[Gs],jg[Gs]=null,Gs--)}function Ge(e,t){Gs++,jg[Gs]=e.current,e.current=t}var Yo={},Kt=Jo(Yo),_n=Jo(!1),Li=Yo;function oa(e,t){var n=e.type.contextTypes;if(!n)return Yo;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 vn(e){return e=e.childContextTypes,e!=null}function tf(){Ke(_n),Ke(Kt)}function Iw(e,t,n){if(Kt.current!==Yo)throw Error(L(168));Ge(Kt,t),Ge(_n,n)}function V0(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(L(108,OO(e)||"Unknown",o));return rt({},n,r)}function nf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yo,Li=Kt.current,Ge(Kt,e),Ge(_n,_n.current),!0}function ww(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=V0(e,t,Li),r.__reactInternalMemoizedMergedChildContext=e,Ke(_n),Ke(Kt),Ge(Kt,e)):Ke(_n),Ge(_n,n)}var ro=null,Tf=!1,lg=!1;function q0(e){ro===null?ro=[e]:ro.push(e)}function JD(e){Tf=!0,q0(e)}function Xo(){if(!lg&&ro!==null){lg=!0;var e=0,t=De;try{var n=ro;for(De=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ro=null,Tf=!1}catch(o){throw ro!==null&&(ro=ro.slice(e+1)),S0(gy,Xo),o}finally{De=t,lg=!1}}return null}var Vs=[],qs=0,rf=null,of=0,Kn=[],Jn=0,Oi=null,oo=1,io="";function xi(e,t){Vs[qs++]=of,Vs[qs++]=rf,rf=e,of=t}function Y0(e,t,n){Kn[Jn++]=oo,Kn[Jn++]=io,Kn[Jn++]=Oi,Oi=e;var r=oo;e=io;var o=32-Sr(r)-1;r&=~(1<<o),n+=1;var i=32-Sr(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,oo=1<<32-Sr(t)+o|n<<o|r,io=i+e}else oo=1<<i|n<<o|r,io=e}function Cy(e){e.return!==null&&(xi(e,1),Y0(e,1,0))}function Ry(e){for(;e===rf;)rf=Vs[--qs],Vs[qs]=null,of=Vs[--qs],Vs[qs]=null;for(;e===Oi;)Oi=Kn[--Jn],Kn[Jn]=null,io=Kn[--Jn],Kn[Jn]=null,oo=Kn[--Jn],Kn[Jn]=null}var Pn=null,Mn=null,Qe=!1,yr=null;function K0(e,t){var n=Xn(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 Cw(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,Pn=e,Mn=zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pn=e,Mn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Oi!==null?{id:oo,overflow:io}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Pn=e,Mn=null,!0):!1;default:return!1}}function Wg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gg(e){if(Qe){var t=Mn;if(t){var n=t;if(!Cw(e,t)){if(Wg(e))throw Error(L(418));t=zo(n.nextSibling);var r=Pn;t&&Cw(e,t)?K0(r,n):(e.flags=e.flags&-4097|2,Qe=!1,Pn=e)}}else{if(Wg(e))throw Error(L(418));e.flags=e.flags&-4097|2,Qe=!1,Pn=e}}}function Rw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pn=e}function Ad(e){if(e!==Pn)return!1;if(!Qe)return Rw(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Hg(e.type,e.memoizedProps)),t&&(t=Mn)){if(Wg(e))throw J0(),Error(L(418));for(;t;)K0(e,t),t=zo(t.nextSibling)}if(Rw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Mn=zo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mn=null}}else Mn=Pn?zo(e.stateNode.nextSibling):null;return!0}function J0(){for(var e=Mn;e;)e=zo(e.nextSibling)}function ia(){Mn=Pn=null,Qe=!1}function xy(e){yr===null?yr=[e]:yr.push(e)}var XD=fo.ReactCurrentBatchConfig;function Ul(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(L(309));var r=n.stateNode}if(!r)throw Error(L(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(L(284));if(!n._owner)throw Error(L(290,e))}return e}function Md(e,t){throw e=Object.prototype.toString.call(t),Error(L(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xw(e){var t=e._init;return t(e._payload)}function X0(e){function t(g,S){if(e){var E=g.deletions;E===null?(g.deletions=[S],g.flags|=16):E.push(S)}}function n(g,S){if(!e)return null;for(;S!==null;)t(g,S),S=S.sibling;return null}function r(g,S){for(g=new Map;S!==null;)S.key!==null?g.set(S.key,S):g.set(S.index,S),S=S.sibling;return g}function o(g,S){return g=Vo(g,S),g.index=0,g.sibling=null,g}function i(g,S,E){return g.index=E,e?(E=g.alternate,E!==null?(E=E.index,E<S?(g.flags|=2,S):E):(g.flags|=2,S)):(g.flags|=1048576,S)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,S,E,R){return S===null||S.tag!==6?(S=hg(E,g.mode,R),S.return=g,S):(S=o(S,E),S.return=g,S)}function l(g,S,E,R){var M=E.type;return M===Hs?u(g,S,E.props.children,R,E.key):S!==null&&(S.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Po&&xw(M)===S.type)?(R=o(S,E.props),R.ref=Ul(g,S,E),R.return=g,R):(R=Gd(E.type,E.key,E.props,null,g.mode,R),R.ref=Ul(g,S,E),R.return=g,R)}function c(g,S,E,R){return S===null||S.tag!==4||S.stateNode.containerInfo!==E.containerInfo||S.stateNode.implementation!==E.implementation?(S=gg(E,g.mode,R),S.return=g,S):(S=o(S,E.children||[]),S.return=g,S)}function u(g,S,E,R,M){return S===null||S.tag!==7?(S=Pi(E,g.mode,R,M),S.return=g,S):(S=o(S,E),S.return=g,S)}function f(g,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return S=hg(""+S,g.mode,E),S.return=g,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case yd:return E=Gd(S.type,S.key,S.props,null,g.mode,E),E.ref=Ul(g,null,S),E.return=g,E;case Bs:return S=gg(S,g.mode,E),S.return=g,S;case Po:var R=S._init;return f(g,R(S._payload),E)}if(zl(S)||Pl(S))return S=Pi(S,g.mode,E,null),S.return=g,S;Md(g,S)}return null}function p(g,S,E,R){var M=S!==null?S.key:null;if(typeof E=="string"&&E!==""||typeof E=="number")return M!==null?null:a(g,S,""+E,R);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case yd:return E.key===M?l(g,S,E,R):null;case Bs:return E.key===M?c(g,S,E,R):null;case Po:return M=E._init,p(g,S,M(E._payload),R)}if(zl(E)||Pl(E))return M!==null?null:u(g,S,E,R,null);Md(g,E)}return null}function h(g,S,E,R,M){if(typeof R=="string"&&R!==""||typeof R=="number")return g=g.get(E)||null,a(S,g,""+R,M);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case yd:return g=g.get(R.key===null?E:R.key)||null,l(S,g,R,M);case Bs:return g=g.get(R.key===null?E:R.key)||null,c(S,g,R,M);case Po:var A=R._init;return h(g,S,E,A(R._payload),M)}if(zl(R)||Pl(R))return g=g.get(E)||null,u(S,g,R,M,null);Md(S,R)}return null}function y(g,S,E,R){for(var M=null,A=null,I=S,N=S=0,U=null;I!==null&&N<E.length;N++){I.index>N?(U=I,I=null):U=I.sibling;var x=p(g,I,E[N],R);if(x===null){I===null&&(I=U);break}e&&I&&x.alternate===null&&t(g,I),S=i(x,S,N),A===null?M=x:A.sibling=x,A=x,I=U}if(N===E.length)return n(g,I),Qe&&xi(g,N),M;if(I===null){for(;N<E.length;N++)I=f(g,E[N],R),I!==null&&(S=i(I,S,N),A===null?M=I:A.sibling=I,A=I);return Qe&&xi(g,N),M}for(I=r(g,I);N<E.length;N++)U=h(I,g,N,E[N],R),U!==null&&(e&&U.alternate!==null&&I.delete(U.key===null?N:U.key),S=i(U,S,N),A===null?M=U:A.sibling=U,A=U);return e&&I.forEach(function(H){return t(g,H)}),Qe&&xi(g,N),M}function _(g,S,E,R){var M=Pl(E);if(typeof M!="function")throw Error(L(150));if(E=M.call(E),E==null)throw Error(L(151));for(var A=M=null,I=S,N=S=0,U=null,x=E.next();I!==null&&!x.done;N++,x=E.next()){I.index>N?(U=I,I=null):U=I.sibling;var H=p(g,I,x.value,R);if(H===null){I===null&&(I=U);break}e&&I&&H.alternate===null&&t(g,I),S=i(H,S,N),A===null?M=H:A.sibling=H,A=H,I=U}if(x.done)return n(g,I),Qe&&xi(g,N),M;if(I===null){for(;!x.done;N++,x=E.next())x=f(g,x.value,R),x!==null&&(S=i(x,S,N),A===null?M=x:A.sibling=x,A=x);return Qe&&xi(g,N),M}for(I=r(g,I);!x.done;N++,x=E.next())x=h(I,g,N,x.value,R),x!==null&&(e&&x.alternate!==null&&I.delete(x.key===null?N:x.key),S=i(x,S,N),A===null?M=x:A.sibling=x,A=x);return e&&I.forEach(function(j){return t(g,j)}),Qe&&xi(g,N),M}function T(g,S,E,R){if(typeof E=="object"&&E!==null&&E.type===Hs&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case yd:e:{for(var M=E.key,A=S;A!==null;){if(A.key===M){if(M=E.type,M===Hs){if(A.tag===7){n(g,A.sibling),S=o(A,E.props.children),S.return=g,g=S;break e}}else if(A.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Po&&xw(M)===A.type){n(g,A.sibling),S=o(A,E.props),S.ref=Ul(g,A,E),S.return=g,g=S;break e}n(g,A);break}else t(g,A);A=A.sibling}E.type===Hs?(S=Pi(E.props.children,g.mode,R,E.key),S.return=g,g=S):(R=Gd(E.type,E.key,E.props,null,g.mode,R),R.ref=Ul(g,S,E),R.return=g,g=R)}return s(g);case Bs:e:{for(A=E.key;S!==null;){if(S.key===A)if(S.tag===4&&S.stateNode.containerInfo===E.containerInfo&&S.stateNode.implementation===E.implementation){n(g,S.sibling),S=o(S,E.children||[]),S.return=g,g=S;break e}else{n(g,S);break}else t(g,S);S=S.sibling}S=gg(E,g.mode,R),S.return=g,g=S}return s(g);case Po:return A=E._init,T(g,S,A(E._payload),R)}if(zl(E))return y(g,S,E,R);if(Pl(E))return _(g,S,E,R);Md(g,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,S!==null&&S.tag===6?(n(g,S.sibling),S=o(S,E),S.return=g,g=S):(n(g,S),S=hg(E,g.mode,R),S.return=g,g=S),s(g)):n(g,S)}return T}var sa=X0(!0),Q0=X0(!1),sf=Jo(null),af=null,Ys=null,by=null;function ky(){by=Ys=af=null}function Ny(e){var t=sf.current;Ke(sf),e._currentValue=t}function Vg(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 ta(e,t){af=e,by=Ys=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Sn=!0),e.firstContext=null)}function Zn(e){var t=e._currentValue;if(by!==e)if(e={context:e,memoizedValue:t,next:null},Ys===null){if(af===null)throw Error(L(308));Ys=e,af.dependencies={lanes:0,firstContext:e}}else Ys=Ys.next=e;return t}var Ni=null;function Ay(e){Ni===null?Ni=[e]:Ni.push(e)}function Z0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ay(t)):(n.next=o.next,o.next=n),t.interleaved=n,co(e,r)}function co(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 Lo=!1;function My(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function eC(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 so(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(xe&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,co(e,n)}return o=r.interleaved,o===null?(t.next=t,Ay(r)):(t.next=o.next,o.next=t),r.interleaved=t,co(e,n)}function Bd(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,yy(e,n)}}function bw(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 lf(e,t,n,r){var o=e.updateQueue;Lo=!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 f=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 y=e,_=a;switch(p=t,h=n,_.tag){case 1:if(y=_.payload,typeof y=="function"){f=y.call(h,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=_.payload,p=typeof y=="function"?y.call(h,f,p):y,p==null)break e;f=rt({},f,p);break e;case 2:Lo=!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=f):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=f),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);Ui|=s,e.lanes=s,e.memoizedState=f}}function kw(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(L(191,o));o.call(r)}}}var vc={},Lr=Jo(vc),dc=Jo(vc),fc=Jo(vc);function Ai(e){if(e===vc)throw Error(L(174));return e}function Py(e,t){switch(Ge(fc,t),Ge(dc,e),Ge(Lr,vc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rg(t,e)}Ke(Lr),Ge(Lr,t)}function aa(){Ke(Lr),Ke(dc),Ke(fc)}function tC(e){Ai(fc.current);var t=Ai(Lr.current),n=Rg(t,e.type);t!==n&&(Ge(dc,e),Ge(Lr,n))}function Ly(e){dc.current===e&&(Ke(Lr),Ke(dc))}var tt=Jo(0);function cf(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 cg=[];function Oy(){for(var e=0;e<cg.length;e++)cg[e]._workInProgressVersionPrimary=null;cg.length=0}var Hd=fo.ReactCurrentDispatcher,ug=fo.ReactCurrentBatchConfig,Di=0,nt=null,Tt=null,Rt=null,uf=!1,Jl=!1,pc=0,QD=0;function Vt(){throw Error(L(321))}function Dy(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function Uy(e,t,n,r,o,i){if(Di=i,nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Hd.current=e===null||e.memoizedState===null?nU:rU,e=n(r,o),Jl){i=0;do{if(Jl=!1,pc=0,25<=i)throw Error(L(301));i+=1,Rt=Tt=null,t.updateQueue=null,Hd.current=oU,e=n(r,o)}while(Jl)}if(Hd.current=df,t=Tt!==null&&Tt.next!==null,Di=0,Rt=Tt=nt=null,uf=!1,t)throw Error(L(300));return e}function Fy(){var e=pc!==0;return pc=0,e}function Ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?nt.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function er(){if(Tt===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=Rt===null?nt.memoizedState:Rt.next;if(t!==null)Rt=t,Tt=e;else{if(e===null)throw Error(L(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Rt===null?nt.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function mc(e,t){return typeof t=="function"?t(e):t}function dg(e){var t=er(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=Tt,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((Di&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 f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,nt.lanes|=u,Ui|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,vr(r,t.memoizedState)||(Sn=!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,nt.lanes|=i,Ui|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function fg(e){var t=er(),n=t.queue;if(n===null)throw Error(L(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);vr(i,t.memoizedState)||(Sn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function nC(){}function rC(e,t){var n=nt,r=er(),o=t(),i=!vr(r.memoizedState,o);if(i&&(r.memoizedState=o,Sn=!0),r=r.queue,By(sC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Rt!==null&&Rt.memoizedState.tag&1){if(n.flags|=2048,hc(9,iC.bind(null,n,r,o,t),void 0,null),xt===null)throw Error(L(349));(Di&30)!==0||oC(n,t,o)}return o}function oC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function iC(e,t,n,r){t.value=n,t.getSnapshot=r,aC(t)&&lC(e)}function sC(e,t,n){return n(function(){aC(t)&&lC(e)})}function aC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function lC(e){var t=co(e,1);t!==null&&_r(t,e,1,-1)}function Nw(e){var t=Ar();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mc,lastRenderedState:e},t.queue=e,e=e.dispatch=tU.bind(null,nt,e),[t.memoizedState,e]}function hc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.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 cC(){return er().memoizedState}function $d(e,t,n,r){var o=Ar();nt.flags|=e,o.memoizedState=hc(1|t,n,void 0,r===void 0?null:r)}function If(e,t,n,r){var o=er();r=r===void 0?null:r;var i=void 0;if(Tt!==null){var s=Tt.memoizedState;if(i=s.destroy,r!==null&&Dy(r,s.deps)){o.memoizedState=hc(t,n,i,r);return}}nt.flags|=e,o.memoizedState=hc(1|t,n,i,r)}function Aw(e,t){return $d(8390656,8,e,t)}function By(e,t){return If(2048,8,e,t)}function uC(e,t){return If(4,2,e,t)}function dC(e,t){return If(4,4,e,t)}function fC(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 pC(e,t,n){return n=n!=null?n.concat([e]):null,If(4,4,fC.bind(null,t,e),n)}function Hy(){}function mC(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Dy(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hC(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Dy(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function gC(e,t,n){return(Di&21)===0?(e.baseState&&(e.baseState=!1,Sn=!0),e.memoizedState=n):(vr(n,t)||(n=E0(),nt.lanes|=n,Ui|=n,e.baseState=!0),t)}function ZD(e,t){var n=De;De=n!==0&&4>n?n:4,e(!0);var r=ug.transition;ug.transition={};try{e(!1),t()}finally{De=n,ug.transition=r}}function yC(){return er().memoizedState}function eU(e,t,n){var r=Go(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},SC(e))_C(t,n);else if(n=Z0(e,t,n,r),n!==null){var o=an();_r(n,e,r,o),vC(n,t,r)}}function tU(e,t,n){var r=Go(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(SC(e))_C(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,vr(a,s)){var l=t.interleaved;l===null?(o.next=o,Ay(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}n=Z0(e,t,o,r),n!==null&&(o=an(),_r(n,e,r,o),vC(n,t,r))}}function SC(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function _C(e,t){Jl=uf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vC(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yy(e,n)}}var df={readContext:Zn,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},nU={readContext:Zn,useCallback:function(e,t){return Ar().memoizedState=[e,t===void 0?null:t],e},useContext:Zn,useEffect:Aw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$d(4194308,4,fC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $d(4194308,4,e,t)},useInsertionEffect:function(e,t){return $d(4,2,e,t)},useMemo:function(e,t){var n=Ar();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ar();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=eU.bind(null,nt,e),[r.memoizedState,e]},useRef:function(e){var t=Ar();return e={current:e},t.memoizedState=e},useState:Nw,useDebugValue:Hy,useDeferredValue:function(e){return Ar().memoizedState=e},useTransition:function(){var e=Nw(!1),t=e[0];return e=ZD.bind(null,e[1]),Ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=nt,o=Ar();if(Qe){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),xt===null)throw Error(L(349));(Di&30)!==0||oC(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Aw(sC.bind(null,r,i,e),[e]),r.flags|=2048,hc(9,iC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ar(),t=xt.identifierPrefix;if(Qe){var n=io,r=oo;n=(r&~(1<<32-Sr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=QD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rU={readContext:Zn,useCallback:mC,useContext:Zn,useEffect:By,useImperativeHandle:pC,useInsertionEffect:uC,useLayoutEffect:dC,useMemo:hC,useReducer:dg,useRef:cC,useState:function(){return dg(mc)},useDebugValue:Hy,useDeferredValue:function(e){var t=er();return gC(t,Tt.memoizedState,e)},useTransition:function(){var e=dg(mc)[0],t=er().memoizedState;return[e,t]},useMutableSource:nC,useSyncExternalStore:rC,useId:yC,unstable_isNewReconciler:!1},oU={readContext:Zn,useCallback:mC,useContext:Zn,useEffect:By,useImperativeHandle:pC,useInsertionEffect:uC,useLayoutEffect:dC,useMemo:hC,useReducer:fg,useRef:cC,useState:function(){return fg(mc)},useDebugValue:Hy,useDeferredValue:function(e){var t=er();return Tt===null?t.memoizedState=e:gC(t,Tt.memoizedState,e)},useTransition:function(){var e=fg(mc)[0],t=er().memoizedState;return[e,t]},useMutableSource:nC,useSyncExternalStore:rC,useId:yC,unstable_isNewReconciler:!1};function hr(e,t){if(e&&e.defaultProps){t=rt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:rt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wf={isMounted:function(e){return(e=e._reactInternals)?Hi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=an(),o=Go(e),i=so(r,o);i.payload=t,n!=null&&(i.callback=n),t=jo(e,i,o),t!==null&&(_r(t,e,o,r),Bd(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=an(),o=Go(e),i=so(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=jo(e,i,o),t!==null&&(_r(t,e,o,r),Bd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=an(),r=Go(e),o=so(n,r);o.tag=2,t!=null&&(o.callback=t),t=jo(e,o,r),t!==null&&(_r(t,e,r,n),Bd(t,e,r))}};function Mw(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?!ac(n,r)||!ac(o,i):!0}function EC(e,t,n){var r=!1,o=Yo,i=t.contextType;return typeof i=="object"&&i!==null?i=Zn(i):(o=vn(t)?Li:Kt.current,r=t.contextTypes,i=(r=r!=null)?oa(e,o):Yo),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=wf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Pw(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&&wf.enqueueReplaceState(t,t.state,null)}function Yg(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},My(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Zn(i):(i=vn(t)?Li:Kt.current,o.context=oa(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(qg(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&&wf.enqueueReplaceState(o,o.state,null),lf(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function la(e,t){try{var n="",r=t;do n+=LO(r),r=r.return;while(r);var o=n}catch(i){o=`
7
7
  Error generating stack: `+i.message+`
8
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function pg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Kg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var oU=typeof WeakMap=="function"?WeakMap:Map;function TC(e,t,n){n=so(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pf||(pf=!0,iy=r),Kg(e,t)},n}function IC(e,t,n){n=so(-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(){Kg(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Kg(e,t),typeof r!="function"&&(Wo===null?Wo=new Set([this]):Wo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Lw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new oU;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=SU.bind(null,e,t,n),t.then(e,e))}function Ow(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=so(-1,1),t.tag=2,jo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var iU=fo.ReactCurrentOwner,Sn=!1;function sn(e,t,n,r){t.child=e===null?Q0(t,null,n,r):sa(t,e.child,n,r)}function Uw(e,t,n,r,o){n=n.render;var i=t.ref;return ta(t,o),r=Uy(e,t,n,r,i,o),n=Fy(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uo(e,t,o)):(Qe&&n&&Cy(t),t.flags|=1,sn(e,t,r,o),t.child)}function Fw(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Yy(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,wC(e,t,i,r,o)):(e=Gd(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:ac,n(s,r)&&e.ref===t.ref)return uo(e,t,o)}return t.flags|=1,e=Vo(i,r),e.ref=t.ref,e.return=t,t.child=e}function wC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ac(i,r)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Sn=!0);else return t.lanes=e.lanes,uo(e,t,o)}return Jg(e,t,n,r,o)}function CC(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},Ge(Js,An),An|=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,Ge(Js,An),An|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ge(Js,An),An|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ge(Js,An),An|=r;return sn(e,t,o,n),t.child}function RC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jg(e,t,n,r,o){var i=vn(n)?Li:Kt.current;return i=oa(t,i),ta(t,o),n=Uy(e,t,n,r,i,o),r=Fy(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uo(e,t,o)):(Qe&&r&&Cy(t),t.flags|=1,sn(e,t,n,o),t.child)}function Bw(e,t,n,r,o){if(vn(n)){var i=!0;nf(t)}else i=!1;if(ta(t,o),t.stateNode===null)zd(e,t),EC(t,n,r),Yg(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=Zn(c):(c=vn(n)?Li:Kt.current,c=oa(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Pw(t,s,r,c),Lo=!1;var p=t.memoizedState;s.state=p,lf(t,r,s,o),l=t.memoizedState,a!==r||p!==l||_n.current||Lo?(typeof u=="function"&&(qg(t,n,u,r),l=t.memoizedState),(a=Lo||Mw(t,n,a,r,p,l,c))?(f||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,eC(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:hr(t.type,a),s.props=c,f=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zn(l):(l=vn(n)?Li:Kt.current,l=oa(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||p!==l)&&Pw(t,s,r,l),Lo=!1,p=t.memoizedState,s.state=p,lf(t,r,s,o);var y=t.memoizedState;a!==f||p!==y||_n.current||Lo?(typeof h=="function"&&(qg(t,n,h,r),y=t.memoizedState),(c=Lo||Mw(t,n,c,r,p,y,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,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=y),s.props=r,s.state=y,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 Xg(e,t,n,r,i,o)}function Xg(e,t,n,r,o,i){RC(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&ww(t,n,!1),uo(e,t,i);r=t.stateNode,iU.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=sa(t,e.child,null,i),t.child=sa(t,null,a,i)):sn(e,t,a,i),t.memoizedState=r.state,o&&ww(t,n,!0),t.child}function xC(e){var t=e.stateNode;t.pendingContext?Iw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Iw(e,t.context,!1),Py(e,t.containerInfo)}function Hw(e,t,n,r,o){return ia(),xy(o),t.flags|=256,sn(e,t,n,r),t.child}var Qg={dehydrated:null,treeContext:null,retryLane:0};function Zg(e){return{baseLanes:e,cachePool:null,transitions:null}}function bC(e,t,n){var r=t.pendingProps,o=tt.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),Ge(tt,o&1),e===null)return Gg(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=xf(s,r,0,null),e=Pi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Zg(n),t.memoizedState=Qg,e):$y(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return sU(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=Vo(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Vo(a,i):(i=Pi(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?Zg(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Qg,r}return i=e.child,e=i.sibling,r=Vo(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 $y(e,t){return t=xf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Pd(e,t,n,r){return r!==null&&xy(r),sa(t,e.child,null,n),e=$y(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sU(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=pg(Error(L(422))),Pd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=xf({mode:"visible",children:r.children},o,0,null),i=Pi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&sa(t,e.child,null,s),t.child.memoizedState=Zg(s),t.memoizedState=Qg,i);if((t.mode&1)===0)return Pd(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(L(419)),r=pg(i,r,void 0),Pd(e,t,s,r)}if(a=(s&e.childLanes)!==0,Sn||a){if(r=xt,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,co(e,o),_r(r,e,o,-1))}return qy(),r=pg(Error(L(421))),Pd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=_U.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Mn=zo(o.nextSibling),Pn=t,Qe=!0,yr=null,e!==null&&(Kn[Jn++]=oo,Kn[Jn++]=io,Kn[Jn++]=Oi,oo=e.id,io=e.overflow,Oi=t),t=$y(t,r.children),t.flags|=4096,t)}function $w(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Vg(e.return,t,n)}function mg(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 kC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(sn(e,t,r.children,n),r=tt.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&&$w(e,n,t);else if(e.tag===19)$w(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(Ge(tt,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&&cf(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),mg(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&&cf(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}mg(t,!0,n,null,i);break;case"together":mg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function uo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ui|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(L(153));if(t.child!==null){for(e=t.child,n=Vo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Vo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function aU(e,t,n){switch(t.tag){case 3:xC(t),ia();break;case 5:tC(t);break;case 1:vn(t.type)&&nf(t);break;case 4:Py(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ge(sf,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ge(tt,tt.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?bC(e,t,n):(Ge(tt,tt.current&1),e=uo(e,t,n),e!==null?e.sibling:null);Ge(tt,tt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return kC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ge(tt,tt.current),r)break;return null;case 22:case 23:return t.lanes=0,CC(e,t,n)}return uo(e,t,n)}var NC,ey,AC,MC;NC=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}};ey=function(){};AC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ai(Lr.current);var i=null;switch(n){case"input":o=Tg(e,o),r=Tg(e,r),i=[];break;case"select":o=rt({},o,{value:void 0}),r=rt({},r,{value:void 0}),i=[];break;case"textarea":o=Cg(e,o),r=Cg(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ef)}xg(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"&&(ec.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"&&(ec.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ye("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)}};MC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fl(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 qt(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 lU(e,t,n){var r=t.pendingProps;switch(Ry(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(t),null;case 1:return vn(t.type)&&tf(),qt(t),null;case 3:return r=t.stateNode,aa(),Ke(_n),Ke(Kt),Oy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ad(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yr!==null&&(ly(yr),yr=null))),ey(e,t),qt(t),null;case 5:Ly(t);var o=Ai(fc.current);if(n=t.type,e!==null&&t.stateNode!=null)AC(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(L(166));return qt(t),null}if(e=Ai(Lr.current),Ad(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Mr]=t,r[uc]=i,e=(t.mode&1)!==0,n){case"dialog":Ye("cancel",r),Ye("close",r);break;case"iframe":case"object":case"embed":Ye("load",r);break;case"video":case"audio":for(o=0;o<Wl.length;o++)Ye(Wl[o],r);break;case"source":Ye("error",r);break;case"img":case"image":case"link":Ye("error",r),Ye("load",r);break;case"details":Ye("toggle",r);break;case"input":KI(r,i),Ye("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ye("invalid",r);break;case"textarea":XI(r,i),Ye("invalid",r)}xg(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&&Nd(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Nd(r.textContent,a,e),o=["children",""+a]):ec.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Ye("scroll",r)}switch(n){case"input":Sd(r),JI(r,i,!0);break;case"textarea":Sd(r),QI(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ef)}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=s0(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[Mr]=t,e[uc]=r,NC(e,t,!1,!1),t.stateNode=e;e:{switch(s=bg(n,r),n){case"dialog":Ye("cancel",e),Ye("close",e),o=r;break;case"iframe":case"object":case"embed":Ye("load",e),o=r;break;case"video":case"audio":for(o=0;o<Wl.length;o++)Ye(Wl[o],e);o=r;break;case"source":Ye("error",e),o=r;break;case"img":case"image":case"link":Ye("error",e),Ye("load",e),o=r;break;case"details":Ye("toggle",e),o=r;break;case"input":KI(e,r),o=Tg(e,r),Ye("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=rt({},r,{value:void 0}),Ye("invalid",e);break;case"textarea":XI(e,r),o=Cg(e,r),Ye("invalid",e);break;default:o=r}xg(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?c0(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&a0(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&tc(e,l):typeof l=="number"&&tc(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ec.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ye("scroll",e):l!=null&&dy(e,i,l,s))}switch(n){case"input":Sd(e),JI(e,r,!1);break;case"textarea":Sd(e),QI(e);break;case"option":r.value!=null&&e.setAttribute("value",""+qo(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Xs(e,!!r.multiple,i,!1):r.defaultValue!=null&&Xs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ef)}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 qt(t),null;case 6:if(e&&t.stateNode!=null)MC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(L(166));if(n=Ai(fc.current),Ai(Lr.current),Ad(t)){if(r=t.stateNode,n=t.memoizedProps,r[Mr]=t,(i=r.nodeValue!==n)&&(e=Pn,e!==null))switch(e.tag){case 3:Nd(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nd(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Mr]=t,t.stateNode=r}return qt(t),null;case 13:if(Ke(tt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&Mn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)J0(),ia(),t.flags|=98560,i=!1;else if(i=Ad(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(L(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(L(317));i[Mr]=t}else ia(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qt(t),i=!1}else yr!==null&&(ly(yr),yr=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||(tt.current&1)!==0?It===0&&(It=3):qy())),t.updateQueue!==null&&(t.flags|=4),qt(t),null);case 4:return aa(),ey(e,t),e===null&&lc(t.stateNode.containerInfo),qt(t),null;case 10:return Ny(t.type._context),qt(t),null;case 17:return vn(t.type)&&tf(),qt(t),null;case 19:if(Ke(tt),i=t.memoizedState,i===null)return qt(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Fl(i,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=cf(e),s!==null){for(t.flags|=128,Fl(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 Ge(tt,tt.current&1|2),t.child}e=e.sibling}i.tail!==null&&pt()>ca&&(t.flags|=128,r=!0,Fl(i,!1),t.lanes=4194304)}else{if(!r)if(e=cf(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Qe)return qt(t),null}else 2*pt()-i.renderingStartTime>ca&&n!==1073741824&&(t.flags|=128,r=!0,Fl(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=pt(),t.sibling=null,n=tt.current,Ge(tt,r?n&1|2:n&1),t):(qt(t),null);case 22:case 23:return Vy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(An&1073741824)!==0&&(qt(t),t.subtreeFlags&6&&(t.flags|=8192)):qt(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function cU(e,t){switch(Ry(t),t.tag){case 1:return vn(t.type)&&tf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(),Ke(_n),Ke(Kt),Oy(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ly(t),null;case 13:if(Ke(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ke(tt),null;case 4:return aa(),null;case 10:return Ny(t.type._context),null;case 22:case 23:return Vy(),null;case 24:return null;default:return null}}var Ld=!1,Yt=!1,uU=typeof WeakSet=="function"?WeakSet:Set,B=null;function Ks(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ct(e,t,r)}else n.current=null}function ty(e,t,n){try{n()}catch(r){ct(e,t,r)}}var zw=!1;function dU(e,t){if(Fg=Xd,e=U0(),wy(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,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(a=s+o),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===o&&(a=s),p===i&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bg={focusedElem:e,selectionRange:n},Xd=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var y=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var _=y.memoizedProps,T=y.memoizedState,g=t.stateNode,S=g.getSnapshotBeforeUpdate(t.elementType===t.type?_:hr(t.type,_),T);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(R){ct(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return y=zw,zw=!1,y}function Xl(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&&ty(t,n,i)}o=o.next}while(o!==r)}}function Cf(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 ny(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 PC(e){var t=e.alternate;t!==null&&(e.alternate=null,PC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mr],delete t[uc],delete t[zg],delete t[qD],delete t[YD])),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 LC(e){return e.tag===5||e.tag===3||e.tag===4}function jw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||LC(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 ry(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=ef));else if(r!==4&&(e=e.child,e!==null))for(ry(e,t,n),e=e.sibling;e!==null;)ry(e,t,n),e=e.sibling}function oy(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(oy(e,t,n),e=e.sibling;e!==null;)oy(e,t,n),e=e.sibling}var Pt=null,gr=!1;function Mo(e,t,n){for(n=n.child;n!==null;)OC(e,t,n),n=n.sibling}function OC(e,t,n){if(Pr&&typeof Pr.onCommitFiberUnmount=="function")try{Pr.onCommitFiberUnmount(yf,n)}catch{}switch(n.tag){case 5:Yt||Ks(n,t);case 6:var r=Pt,o=gr;Pt=null,Mo(e,t,n),Pt=r,gr=o,Pt!==null&&(gr?(e=Pt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pt.removeChild(n.stateNode));break;case 18:Pt!==null&&(gr?(e=Pt,n=n.stateNode,e.nodeType===8?ag(e.parentNode,n):e.nodeType===1&&ag(e,n),ic(e)):ag(Pt,n.stateNode));break;case 4:r=Pt,o=gr,Pt=n.stateNode.containerInfo,gr=!0,Mo(e,t,n),Pt=r,gr=o;break;case 0:case 11:case 14:case 15:if(!Yt&&(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)&&ty(n,t,s),o=o.next}while(o!==r)}Mo(e,t,n);break;case 1:if(!Yt&&(Ks(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ct(n,t,a)}Mo(e,t,n);break;case 21:Mo(e,t,n);break;case 22:n.mode&1?(Yt=(r=Yt)||n.memoizedState!==null,Mo(e,t,n),Yt=r):Mo(e,t,n);break;default:Mo(e,t,n)}}function Ww(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new uU),t.forEach(function(r){var o=vU.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function mr(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:Pt=a.stateNode,gr=!1;break e;case 3:Pt=a.stateNode.containerInfo,gr=!0;break e;case 4:Pt=a.stateNode.containerInfo,gr=!0;break e}a=a.return}if(Pt===null)throw Error(L(160));OC(i,s,o),Pt=null,gr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){ct(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(mr(t,e),Nr(e),r&4){try{Xl(3,e,e.return),Cf(3,e)}catch(_){ct(e,e.return,_)}try{Xl(5,e,e.return)}catch(_){ct(e,e.return,_)}}break;case 1:mr(t,e),Nr(e),r&512&&n!==null&&Ks(n,n.return);break;case 5:if(mr(t,e),Nr(e),r&512&&n!==null&&Ks(n,n.return),e.flags&32){var o=e.stateNode;try{tc(o,"")}catch(_){ct(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&&o0(o,i),bg(a,s);var c=bg(a,i);for(s=0;s<l.length;s+=2){var u=l[s],f=l[s+1];u==="style"?c0(o,f):u==="dangerouslySetInnerHTML"?a0(o,f):u==="children"?tc(o,f):dy(o,u,f,c)}switch(a){case"input":Ig(o,i);break;case"textarea":i0(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Xs(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Xs(o,!!i.multiple,i.defaultValue,!0):Xs(o,!!i.multiple,i.multiple?[]:"",!1))}o[uc]=i}catch(_){ct(e,e.return,_)}}break;case 6:if(mr(t,e),Nr(e),r&4){if(e.stateNode===null)throw Error(L(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(_){ct(e,e.return,_)}}break;case 3:if(mr(t,e),Nr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ic(t.containerInfo)}catch(_){ct(e,e.return,_)}break;case 4:mr(t,e),Nr(e);break;case 13:mr(t,e),Nr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Wy=pt())),r&4&&Ww(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Yt=(c=Yt)||u,mr(t,e),Yt=c):mr(t,e),Nr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&(e.mode&1)!==0)for(B=e,u=e.child;u!==null;){for(f=B=u;B!==null;){switch(p=B,h=p.child,p.tag){case 0:case 11:case 14:case 15:Xl(4,p,p.return);break;case 1:Ks(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(_){ct(r,n,_)}}break;case 5:Ks(p,p.return);break;case 22:if(p.memoizedState!==null){Vw(f);continue}}h!==null?(h.return=p,B=h):Vw(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{o=f.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=l0("display",s))}catch(_){ct(e,e.return,_)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(_){ct(e,e.return,_)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:mr(t,e),Nr(e),r&4&&Ww(e);break;case 21:break;default:mr(t,e),Nr(e)}}function Nr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(LC(n)){var r=n;break e}n=n.return}throw Error(L(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(tc(o,""),r.flags&=-33);var i=jw(e);oy(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=jw(e);ry(e,a,s);break;default:throw Error(L(161))}}catch(l){ct(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fU(e,t,n){B=e,UC(e,t,n)}function UC(e,t,n){for(var r=(e.mode&1)!==0;B!==null;){var o=B,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Ld;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Yt;a=Ld;var c=Yt;if(Ld=s,(Yt=l)&&!c)for(B=o;B!==null;)s=B,l=s.child,s.tag===22&&s.memoizedState!==null?qw(o):l!==null?(l.return=s,B=l):qw(o);for(;i!==null;)B=i,UC(i,t,n),i=i.sibling;B=o,Ld=a,Yt=c}Gw(e,t,n)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,B=i):Gw(e,t,n)}}function Gw(e){for(;B!==null;){var t=B;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Yt||Cf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Yt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:hr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&kw(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}kw(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 f=u.dehydrated;f!==null&&ic(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(L(163))}Yt||t.flags&512&&ny(t)}catch(p){ct(t,t.return,p)}}if(t===e){B=null;break}if(n=t.sibling,n!==null){n.return=t.return,B=n;break}B=t.return}}function Vw(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var n=t.sibling;if(n!==null){n.return=t.return,B=n;break}B=t.return}}function qw(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Cf(4,t)}catch(l){ct(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){ct(t,o,l)}}var i=t.return;try{ny(t)}catch(l){ct(t,i,l)}break;case 5:var s=t.return;try{ny(t)}catch(l){ct(t,s,l)}}}catch(l){ct(t,t.return,l)}if(t===e){B=null;break}var a=t.sibling;if(a!==null){a.return=t.return,B=a;break}B=t.return}}var pU=Math.ceil,ff=fo.ReactCurrentDispatcher,zy=fo.ReactCurrentOwner,Qn=fo.ReactCurrentBatchConfig,xe=0,xt=null,yt=null,Lt=0,An=0,Js=Jo(0),It=0,gc=null,Ui=0,Rf=0,jy=0,Ql=null,yn=null,Wy=0,ca=1/0,no=null,pf=!1,iy=null,Wo=null,Od=!1,Fo=null,mf=0,Zl=0,sy=null,jd=-1,Wd=0;function an(){return(xe&6)!==0?pt():jd!==-1?jd:jd=pt()}function Go(e){return(e.mode&1)===0?1:(xe&2)!==0&&Lt!==0?Lt&-Lt:JD.transition!==null?(Wd===0&&(Wd=E0()),Wd):(e=De,e!==0||(e=window.event,e=e===void 0?16:b0(e.type)),e)}function _r(e,t,n,r){if(50<Zl)throw Zl=0,sy=null,Error(L(185));yc(e,n,r),((xe&2)===0||e!==xt)&&(e===xt&&((xe&2)===0&&(Rf|=n),It===4&&Do(e,Lt)),En(e,r),n===1&&xe===0&&(t.mode&1)===0&&(ca=pt()+500,Tf&&Xo()))}function En(e,t){var n=e.callbackNode;QO(e,t);var r=Jd(e,e===xt?Lt:0);if(r===0)n!==null&&tw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&tw(n),t===1)e.tag===0?KD(Yw.bind(null,e)):q0(Yw.bind(null,e)),GD(function(){(xe&6)===0&&Xo()}),n=null;else{switch(T0(r)){case 1:n=gy;break;case 4:n=_0;break;case 16:n=Kd;break;case 536870912:n=v0;break;default:n=Kd}n=GC(n,FC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function FC(e,t){if(jd=-1,Wd=0,(xe&6)!==0)throw Error(L(327));var n=e.callbackNode;if(na()&&e.callbackNode!==n)return null;var r=Jd(e,e===xt?Lt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=hf(e,r);else{t=r;var o=xe;xe|=2;var i=HC();(xt!==e||Lt!==t)&&(no=null,ca=pt()+500,Mi(e,t));do try{gU();break}catch(a){BC(e,a)}while(!0);ky(),ff.current=i,xe=o,yt!==null?t=0:(xt=null,Lt=0,t=It)}if(t!==0){if(t===2&&(o=Pg(e),o!==0&&(r=o,t=ay(e,o))),t===1)throw n=gc,Mi(e,0),Do(e,r),En(e,pt()),n;if(t===6)Do(e,r);else{if(o=e.current.alternate,(r&30)===0&&!mU(o)&&(t=hf(e,r),t===2&&(i=Pg(e),i!==0&&(r=i,t=ay(e,i))),t===1))throw n=gc,Mi(e,0),Do(e,r),En(e,pt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(L(345));case 2:bi(e,yn,no);break;case 3:if(Do(e,r),(r&130023424)===r&&(t=Wy+500-pt(),10<t)){if(Jd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){an(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=$g(bi.bind(null,e,yn,no),t);break}bi(e,yn,no);break;case 4:if(Do(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Sr(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=pt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*pU(r/1960))-r,10<r){e.timeoutHandle=$g(bi.bind(null,e,yn,no),r);break}bi(e,yn,no);break;case 5:bi(e,yn,no);break;default:throw Error(L(329))}}}return En(e,pt()),e.callbackNode===n?FC.bind(null,e):null}function ay(e,t){var n=Ql;return e.current.memoizedState.isDehydrated&&(Mi(e,t).flags|=256),e=hf(e,t),e!==2&&(t=yn,yn=n,t!==null&&ly(t)),e}function ly(e){yn===null?yn=e:yn.push.apply(yn,e)}function mU(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(!vr(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 Do(e,t){for(t&=~jy,t&=~Rf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Sr(t),r=1<<n;e[n]=-1,t&=~r}}function Yw(e){if((xe&6)!==0)throw Error(L(327));na();var t=Jd(e,0);if((t&1)===0)return En(e,pt()),null;var n=hf(e,t);if(e.tag!==0&&n===2){var r=Pg(e);r!==0&&(t=r,n=ay(e,r))}if(n===1)throw n=gc,Mi(e,0),Do(e,t),En(e,pt()),n;if(n===6)throw Error(L(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bi(e,yn,no),En(e,pt()),null}function Gy(e,t){var n=xe;xe|=1;try{return e(t)}finally{xe=n,xe===0&&(ca=pt()+500,Tf&&Xo())}}function Fi(e){Fo!==null&&Fo.tag===0&&(xe&6)===0&&na();var t=xe;xe|=1;var n=Qn.transition,r=De;try{if(Qn.transition=null,De=1,e)return e()}finally{De=r,Qn.transition=n,xe=t,(xe&6)===0&&Xo()}}function Vy(){An=Js.current,Ke(Js)}function Mi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,WD(n)),yt!==null)for(n=yt.return;n!==null;){var r=n;switch(Ry(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&tf();break;case 3:aa(),Ke(_n),Ke(Kt),Oy();break;case 5:Ly(r);break;case 4:aa();break;case 13:Ke(tt);break;case 19:Ke(tt);break;case 10:Ny(r.type._context);break;case 22:case 23:Vy()}n=n.return}if(xt=e,yt=e=Vo(e.current,null),Lt=An=t,It=0,gc=null,jy=Rf=Ui=0,yn=Ql=null,Ni!==null){for(t=0;t<Ni.length;t++)if(n=Ni[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}Ni=null}return e}function BC(e,t){do{var n=yt;try{if(ky(),Hd.current=df,uf){for(var r=nt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}uf=!1}if(Di=0,Rt=Tt=nt=null,Jl=!1,pc=0,zy.current=null,n===null||n.return===null){It=1,gc=t,yt=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Lt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if((u.mode&1)===0&&(f===0||f===11||f===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=Ow(s);if(h!==null){h.flags&=-257,Dw(h,s,a,i,t),h.mode&1&&Lw(i,c,t),t=h,l=c;var y=t.updateQueue;if(y===null){var _=new Set;_.add(l),t.updateQueue=_}else y.add(l);break e}else{if((t&1)===0){Lw(i,c,t),qy();break e}l=Error(L(426))}}else if(Qe&&a.mode&1){var T=Ow(s);if(T!==null){(T.flags&65536)===0&&(T.flags|=256),Dw(T,s,a,i,t),xy(la(l,a));break e}}i=l=la(l,a),It!==4&&(It=2),Ql===null?Ql=[i]:Ql.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=TC(i,l,t);bw(i,g);break e;case 1:a=l;var S=i.type,E=i.stateNode;if((i.flags&128)===0&&(typeof S.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Wo===null||!Wo.has(E)))){i.flags|=65536,t&=-t,i.lanes|=t;var R=IC(i,a,t);bw(i,R);break e}}i=i.return}while(i!==null)}zC(n)}catch(M){t=M,yt===n&&n!==null&&(yt=n=n.return);continue}break}while(!0)}function HC(){var e=ff.current;return ff.current=df,e===null?df:e}function qy(){(It===0||It===3||It===2)&&(It=4),xt===null||(Ui&268435455)===0&&(Rf&268435455)===0||Do(xt,Lt)}function hf(e,t){var n=xe;xe|=2;var r=HC();(xt!==e||Lt!==t)&&(no=null,Mi(e,t));do try{hU();break}catch(o){BC(e,o)}while(!0);if(ky(),xe=n,ff.current=r,yt!==null)throw Error(L(261));return xt=null,Lt=0,It}function hU(){for(;yt!==null;)$C(yt)}function gU(){for(;yt!==null&&!jO();)$C(yt)}function $C(e){var t=WC(e.alternate,e,An);e.memoizedProps=e.pendingProps,t===null?zC(e):yt=t,zy.current=null}function zC(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=lU(n,t,An),n!==null){yt=n;return}}else{if(n=cU(n,t),n!==null){n.flags&=32767,yt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{It=6,yt=null;return}}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);It===0&&(It=5)}function bi(e,t,n){var r=De,o=Qn.transition;try{Qn.transition=null,De=1,yU(e,t,n,r)}finally{Qn.transition=o,De=r}return null}function yU(e,t,n,r){do na();while(Fo!==null);if((xe&6)!==0)throw Error(L(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(L(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ZO(e,i),e===xt&&(yt=xt=null,Lt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Od||(Od=!0,GC(Kd,function(){return na(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=Qn.transition,Qn.transition=null;var s=De;De=1;var a=xe;xe|=4,zy.current=null,dU(e,n),DC(n,e),BD(Bg),Xd=!!Fg,Bg=Fg=null,e.current=n,fU(n,e,o),WO(),xe=a,De=s,Qn.transition=i}else e.current=n;if(Od&&(Od=!1,Fo=e,mf=o),i=e.pendingLanes,i===0&&(Wo=null),qO(n.stateNode,r),En(e,pt()),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(pf)throw pf=!1,e=iy,iy=null,e;return(mf&1)!==0&&e.tag!==0&&na(),i=e.pendingLanes,(i&1)!==0?e===sy?Zl++:(Zl=0,sy=e):Zl=0,Xo(),null}function na(){if(Fo!==null){var e=T0(mf),t=Qn.transition,n=De;try{if(Qn.transition=null,De=16>e?16:e,Fo===null)var r=!1;else{if(e=Fo,Fo=null,mf=0,(xe&6)!==0)throw Error(L(331));var o=xe;for(xe|=4,B=e.current;B!==null;){var i=B,s=i.child;if((B.flags&16)!==0){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(B=c;B!==null;){var u=B;switch(u.tag){case 0:case 11:case 15:Xl(8,u,i)}var f=u.child;if(f!==null)f.return=u,B=f;else for(;B!==null;){u=B;var p=u.sibling,h=u.return;if(PC(u),u===c){B=null;break}if(p!==null){p.return=h,B=p;break}B=h}}}var y=i.alternate;if(y!==null){var _=y.child;if(_!==null){y.child=null;do{var T=_.sibling;_.sibling=null,_=T}while(_!==null)}}B=i}}if((i.subtreeFlags&2064)!==0&&s!==null)s.return=i,B=s;else e:for(;B!==null;){if(i=B,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:Xl(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,B=g;break e}B=i.return}}var S=e.current;for(B=S;B!==null;){s=B;var E=s.child;if((s.subtreeFlags&2064)!==0&&E!==null)E.return=s,B=E;else e:for(s=S;B!==null;){if(a=B,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:Cf(9,a)}}catch(M){ct(a,a.return,M)}if(a===s){B=null;break e}var R=a.sibling;if(R!==null){R.return=a.return,B=R;break e}B=a.return}}if(xe=o,Xo(),Pr&&typeof Pr.onPostCommitFiberRoot=="function")try{Pr.onPostCommitFiberRoot(yf,e)}catch{}r=!0}return r}finally{De=n,Qn.transition=t}}return!1}function Kw(e,t,n){t=la(n,t),t=TC(e,t,1),e=jo(e,t,1),t=an(),e!==null&&(yc(e,1,t),En(e,t))}function ct(e,t,n){if(e.tag===3)Kw(e,e,n);else for(;t!==null;){if(t.tag===3){Kw(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wo===null||!Wo.has(r))){e=la(n,e),e=IC(t,e,1),t=jo(t,e,1),e=an(),t!==null&&(yc(t,1,e),En(t,e));break}}t=t.return}}function SU(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=an(),e.pingedLanes|=e.suspendedLanes&n,xt===e&&(Lt&n)===n&&(It===4||It===3&&(Lt&130023424)===Lt&&500>pt()-Wy?Mi(e,0):jy|=n),En(e,t)}function jC(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ed,Ed<<=1,(Ed&130023424)===0&&(Ed=4194304)));var n=an();e=co(e,t),e!==null&&(yc(e,t,n),En(e,n))}function _U(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jC(e,n)}function vU(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(L(314))}r!==null&&r.delete(t),jC(e,n)}var WC;WC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||_n.current)Sn=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Sn=!1,aU(e,t,n);Sn=(e.flags&131072)!==0}else Sn=!1,Qe&&(t.flags&1048576)!==0&&Y0(t,of,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zd(e,t),e=t.pendingProps;var o=oa(t,Kt.current);ta(t,n),o=Uy(null,t,r,e,o,n);var i=Fy();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,vn(r)?(i=!0,nf(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,My(t),o.updater=wf,t.stateNode=o,o._reactInternals=t,Yg(t,r,e,n),t=Xg(null,t,r,!0,i,n)):(t.tag=0,Qe&&i&&Cy(t),sn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=TU(r),e=hr(r,e),o){case 0:t=Jg(null,t,r,e,n);break e;case 1:t=Bw(null,t,r,e,n);break e;case 11:t=Uw(null,t,r,e,n);break e;case 14:t=Fw(null,t,r,hr(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),Jg(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),Bw(e,t,r,o,n);case 3:e:{if(xC(t),e===null)throw Error(L(387));r=t.pendingProps,i=t.memoizedState,o=i.element,eC(e,t),lf(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=la(Error(L(423)),t),t=Hw(e,t,r,n,o);break e}else if(r!==o){o=la(Error(L(424)),t),t=Hw(e,t,r,n,o);break e}else for(Mn=zo(t.stateNode.containerInfo.firstChild),Pn=t,Qe=!0,yr=null,n=Q0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ia(),r===o){t=uo(e,t,n);break e}sn(e,t,r,n)}t=t.child}return t;case 5:return tC(t),e===null&&Gg(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Hg(r,o)?s=null:i!==null&&Hg(r,i)&&(t.flags|=32),RC(e,t),sn(e,t,s,n),t.child;case 6:return e===null&&Gg(t),null;case 13:return bC(e,t,n);case 4:return Py(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=sa(t,null,r,n):sn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),Uw(e,t,r,o,n);case 7:return sn(e,t,t.pendingProps,n),t.child;case 8:return sn(e,t,t.pendingProps.children,n),t.child;case 12:return sn(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,Ge(sf,r._currentValue),r._currentValue=s,i!==null)if(vr(i.value,s)){if(i.children===o.children&&!_n.current){t=uo(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=so(-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),Vg(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(L(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Vg(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}sn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ta(t,n),o=Zn(o),r=r(o),t.flags|=1,sn(e,t,r,n),t.child;case 14:return r=t.type,o=hr(r,t.pendingProps),o=hr(r.type,o),Fw(e,t,r,o,n);case 15:return wC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),zd(e,t),t.tag=1,vn(r)?(e=!0,nf(t)):e=!1,ta(t,n),EC(t,r,o),Yg(t,r,o,n),Xg(null,t,r,!0,e,n);case 19:return kC(e,t,n);case 22:return CC(e,t,n)}throw Error(L(156,t.tag))};function GC(e,t){return S0(e,t)}function EU(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 Xn(e,t,n,r){return new EU(e,t,n,r)}function Yy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function TU(e){if(typeof e=="function")return Yy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===py)return 11;if(e===my)return 14}return 2}function Vo(e,t){var n=e.alternate;return n===null?(n=Xn(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 Gd(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Yy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Hs:return Pi(n.children,o,i,t);case fy:s=8,o|=8;break;case Sg:return e=Xn(12,n,t,o|2),e.elementType=Sg,e.lanes=i,e;case _g:return e=Xn(13,n,t,o),e.elementType=_g,e.lanes=i,e;case vg:return e=Xn(19,n,t,o),e.elementType=vg,e.lanes=i,e;case t0:return xf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zw:s=10;break e;case e0:s=9;break e;case py:s=11;break e;case my:s=14;break e;case Po:s=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=Xn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Pi(e,t,n,r){return e=Xn(7,e,r,t),e.lanes=n,e}function xf(e,t,n,r){return e=Xn(22,e,r,t),e.elementType=t0,e.lanes=n,e.stateNode={isHidden:!1},e}function hg(e,t,n){return e=Xn(6,e,null,t),e.lanes=n,e}function gg(e,t,n){return t=Xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function IU(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=Zh(0),this.expirationTimes=Zh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ky(e,t,n,r,o,i,s,a,l){return e=new IU(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Xn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},My(i),e}function wU(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 VC(e){if(!e)return Yo;e=e._reactInternals;e:{if(Hi(e)!==e||e.tag!==1)throw Error(L(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(L(171))}if(e.tag===1){var n=e.type;if(vn(n))return V0(e,n,t)}return t}function qC(e,t,n,r,o,i,s,a,l){return e=Ky(n,r,!0,e,o,i,s,a,l),e.context=VC(null),n=e.current,r=an(),o=Go(n),i=so(r,o),i.callback=t??null,jo(n,i,o),e.current.lanes=o,yc(e,o,r),En(e,r),e}function bf(e,t,n,r){var o=t.current,i=an(),s=Go(o);return n=VC(n),t.context===null?t.context=n:t.pendingContext=n,t=so(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=jo(o,t,s),e!==null&&(_r(e,o,s,i),Bd(e,o,s)),s}function gf(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Jw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jy(e,t){Jw(e,t),(e=e.alternate)&&Jw(e,t)}function CU(){return null}var YC=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xy(e){this._internalRoot=e}kf.prototype.render=Xy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(L(409));bf(e,t,null,null)};kf.prototype.unmount=Xy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fi(function(){bf(null,e,null,null)}),t[lo]=null}};function kf(e){this._internalRoot=e}kf.prototype.unstable_scheduleHydration=function(e){if(e){var t=C0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Oo.length&&t!==0&&t<Oo[n].priority;n++);Oo.splice(n,0,e),n===0&&x0(e)}};function Qy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Nf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xw(){}function RU(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=gf(s);i.call(c)}}var s=qC(t,r,e,0,null,!1,!1,"",Xw);return e._reactRootContainer=s,e[lo]=s.current,lc(e.nodeType===8?e.parentNode:e),Fi(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=gf(l);a.call(c)}}var l=Ky(e,0,!1,null,null,!1,!1,"",Xw);return e._reactRootContainer=l,e[lo]=l.current,lc(e.nodeType===8?e.parentNode:e),Fi(function(){bf(t,l,n,r)}),l}function Af(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=gf(s);a.call(l)}}bf(t,s,e,o)}else s=RU(n,t,e,o,r);return gf(s)}I0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jl(t.pendingLanes);n!==0&&(yy(t,n|1),En(t,pt()),(xe&6)===0&&(ca=pt()+500,Xo()))}break;case 13:Fi(function(){var r=co(e,1);if(r!==null){var o=an();_r(r,e,1,o)}}),Jy(e,1)}};Sy=function(e){if(e.tag===13){var t=co(e,134217728);if(t!==null){var n=an();_r(t,e,134217728,n)}Jy(e,134217728)}};w0=function(e){if(e.tag===13){var t=Go(e),n=co(e,t);if(n!==null){var r=an();_r(n,e,t,r)}Jy(e,t)}};C0=function(){return De};R0=function(e,t){var n=De;try{return De=e,t()}finally{De=n}};Ng=function(e,t,n){switch(t){case"input":if(Ig(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=Ef(r);if(!o)throw Error(L(90));r0(r),Ig(r,o)}}}break;case"textarea":i0(e,n);break;case"select":t=n.value,t!=null&&Xs(e,!!n.multiple,t,!1)}};f0=Gy;p0=Fi;var xU={usingClientEntryPoint:!1,Events:[_c,Ws,Ef,u0,d0,Gy]},Bl={findFiberByHostInstance:ki,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bU={bundleType:Bl.bundleType,version:Bl.version,rendererPackageName:Bl.rendererPackageName,rendererConfig:Bl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=g0(e),e===null?null:e.stateNode},findFiberByHostInstance:Bl.findFiberByHostInstance||CU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Hl.isDisabled&&Hl.supportsFiber))try{yf=Hl.inject(bU),Pr=Hl}catch{}var Hl;Dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xU;Dn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qy(t))throw Error(L(200));return wU(e,t,null,n)};Dn.createRoot=function(e,t){if(!Qy(e))throw Error(L(299));var n=!1,r="",o=YC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ky(e,1,!1,null,null,n,!1,r,o),e[lo]=t.current,lc(e.nodeType===8?e.parentNode:e),new Xy(t)};Dn.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(L(188)):(e=Object.keys(e).join(","),Error(L(268,e)));return e=g0(t),e=e===null?null:e.stateNode,e};Dn.flushSync=function(e){return Fi(e)};Dn.hydrate=function(e,t,n){if(!Nf(t))throw Error(L(200));return Af(null,e,t,!0,n)};Dn.hydrateRoot=function(e,t,n){if(!Qy(e))throw Error(L(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=YC;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=qC(t,null,e,1,n??null,o,!1,i,s),e[lo]=t.current,lc(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 kf(t)};Dn.render=function(e,t,n){if(!Nf(t))throw Error(L(200));return Af(null,e,t,!1,n)};Dn.unmountComponentAtNode=function(e){if(!Nf(e))throw Error(L(40));return e._reactRootContainer?(Fi(function(){Af(null,null,e,!1,function(){e._reactRootContainer=null,e[lo]=null})}),!0):!1};Dn.unstable_batchedUpdates=Gy;Dn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Nf(n))throw Error(L(200));if(e==null||e._reactInternals===void 0)throw Error(L(38));return Af(e,t,n,!1,r)};Dn.version="18.3.1-next-f1338f8080-20240426"});var Mf=Br(($Y,XC)=>{"use strict";function JC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(JC)}catch(e){console.error(e)}}JC(),XC.exports=KC()});var ZC=Br(Zy=>{"use strict";var QC=Mf();Zy.createRoot=QC.createRoot,Zy.hydrateRoot=QC.hydrateRoot;var zY});var uR=Br(Of=>{"use strict";var FU=eo(),BU=Symbol.for("react.element"),HU=Symbol.for("react.fragment"),$U=Object.prototype.hasOwnProperty,zU=FU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,jU={key:!0,ref:!0,__self:!0,__source:!0};function cR(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)$U.call(t,r)&&!jU.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:BU,type:e,key:i,ref:s,props:o,_owner:zU.current}}Of.Fragment=HU;Of.jsx=cR;Of.jsxs=cR});var Tc=Br((QY,dR)=>{"use strict";dR.exports=uR()});var O=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var G=globalThis;var Er="10.56.0";function Rn(){return ei(G),G}function ei(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Er,t[Er]=t[Er]||{}}function rr(e,t,n=G){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[Er]=r[Er]||{};return o[e]||(o[e]=t())}var xc=["debug","info","warn","error","log","assert","trace"],Mx="Sentry Logger ",ti={};function kt(e){if(!("console"in G))return e();let t=G.console,n={},r=Object.keys(ti);r.forEach(o=>{let i=ti[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function Px(){sp().enabled=!0}function Lx(){sp().enabled=!1}function LS(){return sp().enabled}function Ox(...e){ip("log",...e)}function Dx(...e){ip("warn",...e)}function Ux(...e){ip("error",...e)}function ip(e,...t){O&&LS()&&kt(()=>{G.console[e](`${Mx}[${e}]:`,...t)})}function sp(){return O?rr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var C={enable:Px,disable:Lx,isEnabled:LS,log:Ox,warn:Dx,error:Ux};var OS=/\(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(`
8
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function pg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Kg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var iU=typeof WeakMap=="function"?WeakMap:Map;function TC(e,t,n){n=so(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pf||(pf=!0,iy=r),Kg(e,t)},n}function IC(e,t,n){n=so(-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(){Kg(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Kg(e,t),typeof r!="function"&&(Wo===null?Wo=new Set([this]):Wo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Lw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new iU;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=_U.bind(null,e,t,n),t.then(e,e))}function Ow(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=so(-1,1),t.tag=2,jo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var sU=fo.ReactCurrentOwner,Sn=!1;function sn(e,t,n,r){t.child=e===null?Q0(t,null,n,r):sa(t,e.child,n,r)}function Uw(e,t,n,r,o){n=n.render;var i=t.ref;return ta(t,o),r=Uy(e,t,n,r,i,o),n=Fy(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uo(e,t,o)):(Qe&&n&&Cy(t),t.flags|=1,sn(e,t,r,o),t.child)}function Fw(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Yy(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,wC(e,t,i,r,o)):(e=Gd(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:ac,n(s,r)&&e.ref===t.ref)return uo(e,t,o)}return t.flags|=1,e=Vo(i,r),e.ref=t.ref,e.return=t,t.child=e}function wC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ac(i,r)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Sn=!0);else return t.lanes=e.lanes,uo(e,t,o)}return Jg(e,t,n,r,o)}function CC(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},Ge(Js,An),An|=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,Ge(Js,An),An|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ge(Js,An),An|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ge(Js,An),An|=r;return sn(e,t,o,n),t.child}function RC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jg(e,t,n,r,o){var i=vn(n)?Li:Kt.current;return i=oa(t,i),ta(t,o),n=Uy(e,t,n,r,i,o),r=Fy(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uo(e,t,o)):(Qe&&r&&Cy(t),t.flags|=1,sn(e,t,n,o),t.child)}function Bw(e,t,n,r,o){if(vn(n)){var i=!0;nf(t)}else i=!1;if(ta(t,o),t.stateNode===null)zd(e,t),EC(t,n,r),Yg(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=Zn(c):(c=vn(n)?Li:Kt.current,c=oa(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Pw(t,s,r,c),Lo=!1;var p=t.memoizedState;s.state=p,lf(t,r,s,o),l=t.memoizedState,a!==r||p!==l||_n.current||Lo?(typeof u=="function"&&(qg(t,n,u,r),l=t.memoizedState),(a=Lo||Mw(t,n,a,r,p,l,c))?(f||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,eC(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:hr(t.type,a),s.props=c,f=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zn(l):(l=vn(n)?Li:Kt.current,l=oa(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||p!==l)&&Pw(t,s,r,l),Lo=!1,p=t.memoizedState,s.state=p,lf(t,r,s,o);var y=t.memoizedState;a!==f||p!==y||_n.current||Lo?(typeof h=="function"&&(qg(t,n,h,r),y=t.memoizedState),(c=Lo||Mw(t,n,c,r,p,y,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,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=y),s.props=r,s.state=y,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 Xg(e,t,n,r,i,o)}function Xg(e,t,n,r,o,i){RC(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&ww(t,n,!1),uo(e,t,i);r=t.stateNode,sU.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=sa(t,e.child,null,i),t.child=sa(t,null,a,i)):sn(e,t,a,i),t.memoizedState=r.state,o&&ww(t,n,!0),t.child}function xC(e){var t=e.stateNode;t.pendingContext?Iw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Iw(e,t.context,!1),Py(e,t.containerInfo)}function Hw(e,t,n,r,o){return ia(),xy(o),t.flags|=256,sn(e,t,n,r),t.child}var Qg={dehydrated:null,treeContext:null,retryLane:0};function Zg(e){return{baseLanes:e,cachePool:null,transitions:null}}function bC(e,t,n){var r=t.pendingProps,o=tt.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),Ge(tt,o&1),e===null)return Gg(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=xf(s,r,0,null),e=Pi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Zg(n),t.memoizedState=Qg,e):$y(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return aU(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=Vo(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Vo(a,i):(i=Pi(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?Zg(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Qg,r}return i=e.child,e=i.sibling,r=Vo(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 $y(e,t){return t=xf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Pd(e,t,n,r){return r!==null&&xy(r),sa(t,e.child,null,n),e=$y(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function aU(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=pg(Error(L(422))),Pd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=xf({mode:"visible",children:r.children},o,0,null),i=Pi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&sa(t,e.child,null,s),t.child.memoizedState=Zg(s),t.memoizedState=Qg,i);if((t.mode&1)===0)return Pd(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(L(419)),r=pg(i,r,void 0),Pd(e,t,s,r)}if(a=(s&e.childLanes)!==0,Sn||a){if(r=xt,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,co(e,o),_r(r,e,o,-1))}return qy(),r=pg(Error(L(421))),Pd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=vU.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Mn=zo(o.nextSibling),Pn=t,Qe=!0,yr=null,e!==null&&(Kn[Jn++]=oo,Kn[Jn++]=io,Kn[Jn++]=Oi,oo=e.id,io=e.overflow,Oi=t),t=$y(t,r.children),t.flags|=4096,t)}function $w(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Vg(e.return,t,n)}function mg(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 kC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(sn(e,t,r.children,n),r=tt.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&&$w(e,n,t);else if(e.tag===19)$w(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(Ge(tt,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&&cf(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),mg(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&&cf(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}mg(t,!0,n,null,i);break;case"together":mg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function uo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ui|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(L(153));if(t.child!==null){for(e=t.child,n=Vo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Vo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lU(e,t,n){switch(t.tag){case 3:xC(t),ia();break;case 5:tC(t);break;case 1:vn(t.type)&&nf(t);break;case 4:Py(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ge(sf,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ge(tt,tt.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?bC(e,t,n):(Ge(tt,tt.current&1),e=uo(e,t,n),e!==null?e.sibling:null);Ge(tt,tt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return kC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ge(tt,tt.current),r)break;return null;case 22:case 23:return t.lanes=0,CC(e,t,n)}return uo(e,t,n)}var NC,ey,AC,MC;NC=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}};ey=function(){};AC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ai(Lr.current);var i=null;switch(n){case"input":o=Tg(e,o),r=Tg(e,r),i=[];break;case"select":o=rt({},o,{value:void 0}),r=rt({},r,{value:void 0}),i=[];break;case"textarea":o=Cg(e,o),r=Cg(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ef)}xg(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"&&(ec.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"&&(ec.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ye("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)}};MC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fl(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 qt(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 cU(e,t,n){var r=t.pendingProps;switch(Ry(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(t),null;case 1:return vn(t.type)&&tf(),qt(t),null;case 3:return r=t.stateNode,aa(),Ke(_n),Ke(Kt),Oy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ad(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yr!==null&&(ly(yr),yr=null))),ey(e,t),qt(t),null;case 5:Ly(t);var o=Ai(fc.current);if(n=t.type,e!==null&&t.stateNode!=null)AC(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(L(166));return qt(t),null}if(e=Ai(Lr.current),Ad(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Mr]=t,r[uc]=i,e=(t.mode&1)!==0,n){case"dialog":Ye("cancel",r),Ye("close",r);break;case"iframe":case"object":case"embed":Ye("load",r);break;case"video":case"audio":for(o=0;o<Wl.length;o++)Ye(Wl[o],r);break;case"source":Ye("error",r);break;case"img":case"image":case"link":Ye("error",r),Ye("load",r);break;case"details":Ye("toggle",r);break;case"input":KI(r,i),Ye("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ye("invalid",r);break;case"textarea":XI(r,i),Ye("invalid",r)}xg(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&&Nd(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Nd(r.textContent,a,e),o=["children",""+a]):ec.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Ye("scroll",r)}switch(n){case"input":Sd(r),JI(r,i,!0);break;case"textarea":Sd(r),QI(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ef)}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=s0(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[Mr]=t,e[uc]=r,NC(e,t,!1,!1),t.stateNode=e;e:{switch(s=bg(n,r),n){case"dialog":Ye("cancel",e),Ye("close",e),o=r;break;case"iframe":case"object":case"embed":Ye("load",e),o=r;break;case"video":case"audio":for(o=0;o<Wl.length;o++)Ye(Wl[o],e);o=r;break;case"source":Ye("error",e),o=r;break;case"img":case"image":case"link":Ye("error",e),Ye("load",e),o=r;break;case"details":Ye("toggle",e),o=r;break;case"input":KI(e,r),o=Tg(e,r),Ye("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=rt({},r,{value:void 0}),Ye("invalid",e);break;case"textarea":XI(e,r),o=Cg(e,r),Ye("invalid",e);break;default:o=r}xg(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?c0(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&a0(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&tc(e,l):typeof l=="number"&&tc(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ec.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ye("scroll",e):l!=null&&dy(e,i,l,s))}switch(n){case"input":Sd(e),JI(e,r,!1);break;case"textarea":Sd(e),QI(e);break;case"option":r.value!=null&&e.setAttribute("value",""+qo(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Xs(e,!!r.multiple,i,!1):r.defaultValue!=null&&Xs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ef)}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 qt(t),null;case 6:if(e&&t.stateNode!=null)MC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(L(166));if(n=Ai(fc.current),Ai(Lr.current),Ad(t)){if(r=t.stateNode,n=t.memoizedProps,r[Mr]=t,(i=r.nodeValue!==n)&&(e=Pn,e!==null))switch(e.tag){case 3:Nd(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nd(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Mr]=t,t.stateNode=r}return qt(t),null;case 13:if(Ke(tt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&Mn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)J0(),ia(),t.flags|=98560,i=!1;else if(i=Ad(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(L(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(L(317));i[Mr]=t}else ia(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qt(t),i=!1}else yr!==null&&(ly(yr),yr=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||(tt.current&1)!==0?It===0&&(It=3):qy())),t.updateQueue!==null&&(t.flags|=4),qt(t),null);case 4:return aa(),ey(e,t),e===null&&lc(t.stateNode.containerInfo),qt(t),null;case 10:return Ny(t.type._context),qt(t),null;case 17:return vn(t.type)&&tf(),qt(t),null;case 19:if(Ke(tt),i=t.memoizedState,i===null)return qt(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Fl(i,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=cf(e),s!==null){for(t.flags|=128,Fl(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 Ge(tt,tt.current&1|2),t.child}e=e.sibling}i.tail!==null&&pt()>ca&&(t.flags|=128,r=!0,Fl(i,!1),t.lanes=4194304)}else{if(!r)if(e=cf(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Qe)return qt(t),null}else 2*pt()-i.renderingStartTime>ca&&n!==1073741824&&(t.flags|=128,r=!0,Fl(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=pt(),t.sibling=null,n=tt.current,Ge(tt,r?n&1|2:n&1),t):(qt(t),null);case 22:case 23:return Vy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(An&1073741824)!==0&&(qt(t),t.subtreeFlags&6&&(t.flags|=8192)):qt(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function uU(e,t){switch(Ry(t),t.tag){case 1:return vn(t.type)&&tf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(),Ke(_n),Ke(Kt),Oy(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ly(t),null;case 13:if(Ke(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ke(tt),null;case 4:return aa(),null;case 10:return Ny(t.type._context),null;case 22:case 23:return Vy(),null;case 24:return null;default:return null}}var Ld=!1,Yt=!1,dU=typeof WeakSet=="function"?WeakSet:Set,B=null;function Ks(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ct(e,t,r)}else n.current=null}function ty(e,t,n){try{n()}catch(r){ct(e,t,r)}}var zw=!1;function fU(e,t){if(Fg=Xd,e=U0(),wy(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,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(a=s+o),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===o&&(a=s),p===i&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bg={focusedElem:e,selectionRange:n},Xd=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var y=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var _=y.memoizedProps,T=y.memoizedState,g=t.stateNode,S=g.getSnapshotBeforeUpdate(t.elementType===t.type?_:hr(t.type,_),T);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(R){ct(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return y=zw,zw=!1,y}function Xl(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&&ty(t,n,i)}o=o.next}while(o!==r)}}function Cf(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 ny(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 PC(e){var t=e.alternate;t!==null&&(e.alternate=null,PC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mr],delete t[uc],delete t[zg],delete t[YD],delete t[KD])),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 LC(e){return e.tag===5||e.tag===3||e.tag===4}function jw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||LC(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 ry(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=ef));else if(r!==4&&(e=e.child,e!==null))for(ry(e,t,n),e=e.sibling;e!==null;)ry(e,t,n),e=e.sibling}function oy(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(oy(e,t,n),e=e.sibling;e!==null;)oy(e,t,n),e=e.sibling}var Pt=null,gr=!1;function Mo(e,t,n){for(n=n.child;n!==null;)OC(e,t,n),n=n.sibling}function OC(e,t,n){if(Pr&&typeof Pr.onCommitFiberUnmount=="function")try{Pr.onCommitFiberUnmount(yf,n)}catch{}switch(n.tag){case 5:Yt||Ks(n,t);case 6:var r=Pt,o=gr;Pt=null,Mo(e,t,n),Pt=r,gr=o,Pt!==null&&(gr?(e=Pt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pt.removeChild(n.stateNode));break;case 18:Pt!==null&&(gr?(e=Pt,n=n.stateNode,e.nodeType===8?ag(e.parentNode,n):e.nodeType===1&&ag(e,n),ic(e)):ag(Pt,n.stateNode));break;case 4:r=Pt,o=gr,Pt=n.stateNode.containerInfo,gr=!0,Mo(e,t,n),Pt=r,gr=o;break;case 0:case 11:case 14:case 15:if(!Yt&&(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)&&ty(n,t,s),o=o.next}while(o!==r)}Mo(e,t,n);break;case 1:if(!Yt&&(Ks(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ct(n,t,a)}Mo(e,t,n);break;case 21:Mo(e,t,n);break;case 22:n.mode&1?(Yt=(r=Yt)||n.memoizedState!==null,Mo(e,t,n),Yt=r):Mo(e,t,n);break;default:Mo(e,t,n)}}function Ww(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dU),t.forEach(function(r){var o=EU.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function mr(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:Pt=a.stateNode,gr=!1;break e;case 3:Pt=a.stateNode.containerInfo,gr=!0;break e;case 4:Pt=a.stateNode.containerInfo,gr=!0;break e}a=a.return}if(Pt===null)throw Error(L(160));OC(i,s,o),Pt=null,gr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){ct(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(mr(t,e),Nr(e),r&4){try{Xl(3,e,e.return),Cf(3,e)}catch(_){ct(e,e.return,_)}try{Xl(5,e,e.return)}catch(_){ct(e,e.return,_)}}break;case 1:mr(t,e),Nr(e),r&512&&n!==null&&Ks(n,n.return);break;case 5:if(mr(t,e),Nr(e),r&512&&n!==null&&Ks(n,n.return),e.flags&32){var o=e.stateNode;try{tc(o,"")}catch(_){ct(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&&o0(o,i),bg(a,s);var c=bg(a,i);for(s=0;s<l.length;s+=2){var u=l[s],f=l[s+1];u==="style"?c0(o,f):u==="dangerouslySetInnerHTML"?a0(o,f):u==="children"?tc(o,f):dy(o,u,f,c)}switch(a){case"input":Ig(o,i);break;case"textarea":i0(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Xs(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Xs(o,!!i.multiple,i.defaultValue,!0):Xs(o,!!i.multiple,i.multiple?[]:"",!1))}o[uc]=i}catch(_){ct(e,e.return,_)}}break;case 6:if(mr(t,e),Nr(e),r&4){if(e.stateNode===null)throw Error(L(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(_){ct(e,e.return,_)}}break;case 3:if(mr(t,e),Nr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ic(t.containerInfo)}catch(_){ct(e,e.return,_)}break;case 4:mr(t,e),Nr(e);break;case 13:mr(t,e),Nr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Wy=pt())),r&4&&Ww(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Yt=(c=Yt)||u,mr(t,e),Yt=c):mr(t,e),Nr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&(e.mode&1)!==0)for(B=e,u=e.child;u!==null;){for(f=B=u;B!==null;){switch(p=B,h=p.child,p.tag){case 0:case 11:case 14:case 15:Xl(4,p,p.return);break;case 1:Ks(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(_){ct(r,n,_)}}break;case 5:Ks(p,p.return);break;case 22:if(p.memoizedState!==null){Vw(f);continue}}h!==null?(h.return=p,B=h):Vw(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{o=f.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=l0("display",s))}catch(_){ct(e,e.return,_)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(_){ct(e,e.return,_)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:mr(t,e),Nr(e),r&4&&Ww(e);break;case 21:break;default:mr(t,e),Nr(e)}}function Nr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(LC(n)){var r=n;break e}n=n.return}throw Error(L(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(tc(o,""),r.flags&=-33);var i=jw(e);oy(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=jw(e);ry(e,a,s);break;default:throw Error(L(161))}}catch(l){ct(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pU(e,t,n){B=e,UC(e,t,n)}function UC(e,t,n){for(var r=(e.mode&1)!==0;B!==null;){var o=B,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Ld;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Yt;a=Ld;var c=Yt;if(Ld=s,(Yt=l)&&!c)for(B=o;B!==null;)s=B,l=s.child,s.tag===22&&s.memoizedState!==null?qw(o):l!==null?(l.return=s,B=l):qw(o);for(;i!==null;)B=i,UC(i,t,n),i=i.sibling;B=o,Ld=a,Yt=c}Gw(e,t,n)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,B=i):Gw(e,t,n)}}function Gw(e){for(;B!==null;){var t=B;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Yt||Cf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Yt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:hr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&kw(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}kw(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 f=u.dehydrated;f!==null&&ic(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(L(163))}Yt||t.flags&512&&ny(t)}catch(p){ct(t,t.return,p)}}if(t===e){B=null;break}if(n=t.sibling,n!==null){n.return=t.return,B=n;break}B=t.return}}function Vw(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var n=t.sibling;if(n!==null){n.return=t.return,B=n;break}B=t.return}}function qw(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Cf(4,t)}catch(l){ct(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){ct(t,o,l)}}var i=t.return;try{ny(t)}catch(l){ct(t,i,l)}break;case 5:var s=t.return;try{ny(t)}catch(l){ct(t,s,l)}}}catch(l){ct(t,t.return,l)}if(t===e){B=null;break}var a=t.sibling;if(a!==null){a.return=t.return,B=a;break}B=t.return}}var mU=Math.ceil,ff=fo.ReactCurrentDispatcher,zy=fo.ReactCurrentOwner,Qn=fo.ReactCurrentBatchConfig,xe=0,xt=null,yt=null,Lt=0,An=0,Js=Jo(0),It=0,gc=null,Ui=0,Rf=0,jy=0,Ql=null,yn=null,Wy=0,ca=1/0,no=null,pf=!1,iy=null,Wo=null,Od=!1,Fo=null,mf=0,Zl=0,sy=null,jd=-1,Wd=0;function an(){return(xe&6)!==0?pt():jd!==-1?jd:jd=pt()}function Go(e){return(e.mode&1)===0?1:(xe&2)!==0&&Lt!==0?Lt&-Lt:XD.transition!==null?(Wd===0&&(Wd=E0()),Wd):(e=De,e!==0||(e=window.event,e=e===void 0?16:b0(e.type)),e)}function _r(e,t,n,r){if(50<Zl)throw Zl=0,sy=null,Error(L(185));yc(e,n,r),((xe&2)===0||e!==xt)&&(e===xt&&((xe&2)===0&&(Rf|=n),It===4&&Do(e,Lt)),En(e,r),n===1&&xe===0&&(t.mode&1)===0&&(ca=pt()+500,Tf&&Xo()))}function En(e,t){var n=e.callbackNode;ZO(e,t);var r=Jd(e,e===xt?Lt:0);if(r===0)n!==null&&tw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&tw(n),t===1)e.tag===0?JD(Yw.bind(null,e)):q0(Yw.bind(null,e)),VD(function(){(xe&6)===0&&Xo()}),n=null;else{switch(T0(r)){case 1:n=gy;break;case 4:n=_0;break;case 16:n=Kd;break;case 536870912:n=v0;break;default:n=Kd}n=GC(n,FC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function FC(e,t){if(jd=-1,Wd=0,(xe&6)!==0)throw Error(L(327));var n=e.callbackNode;if(na()&&e.callbackNode!==n)return null;var r=Jd(e,e===xt?Lt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=hf(e,r);else{t=r;var o=xe;xe|=2;var i=HC();(xt!==e||Lt!==t)&&(no=null,ca=pt()+500,Mi(e,t));do try{yU();break}catch(a){BC(e,a)}while(!0);ky(),ff.current=i,xe=o,yt!==null?t=0:(xt=null,Lt=0,t=It)}if(t!==0){if(t===2&&(o=Pg(e),o!==0&&(r=o,t=ay(e,o))),t===1)throw n=gc,Mi(e,0),Do(e,r),En(e,pt()),n;if(t===6)Do(e,r);else{if(o=e.current.alternate,(r&30)===0&&!hU(o)&&(t=hf(e,r),t===2&&(i=Pg(e),i!==0&&(r=i,t=ay(e,i))),t===1))throw n=gc,Mi(e,0),Do(e,r),En(e,pt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(L(345));case 2:bi(e,yn,no);break;case 3:if(Do(e,r),(r&130023424)===r&&(t=Wy+500-pt(),10<t)){if(Jd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){an(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=$g(bi.bind(null,e,yn,no),t);break}bi(e,yn,no);break;case 4:if(Do(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Sr(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=pt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*mU(r/1960))-r,10<r){e.timeoutHandle=$g(bi.bind(null,e,yn,no),r);break}bi(e,yn,no);break;case 5:bi(e,yn,no);break;default:throw Error(L(329))}}}return En(e,pt()),e.callbackNode===n?FC.bind(null,e):null}function ay(e,t){var n=Ql;return e.current.memoizedState.isDehydrated&&(Mi(e,t).flags|=256),e=hf(e,t),e!==2&&(t=yn,yn=n,t!==null&&ly(t)),e}function ly(e){yn===null?yn=e:yn.push.apply(yn,e)}function hU(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(!vr(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 Do(e,t){for(t&=~jy,t&=~Rf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Sr(t),r=1<<n;e[n]=-1,t&=~r}}function Yw(e){if((xe&6)!==0)throw Error(L(327));na();var t=Jd(e,0);if((t&1)===0)return En(e,pt()),null;var n=hf(e,t);if(e.tag!==0&&n===2){var r=Pg(e);r!==0&&(t=r,n=ay(e,r))}if(n===1)throw n=gc,Mi(e,0),Do(e,t),En(e,pt()),n;if(n===6)throw Error(L(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bi(e,yn,no),En(e,pt()),null}function Gy(e,t){var n=xe;xe|=1;try{return e(t)}finally{xe=n,xe===0&&(ca=pt()+500,Tf&&Xo())}}function Fi(e){Fo!==null&&Fo.tag===0&&(xe&6)===0&&na();var t=xe;xe|=1;var n=Qn.transition,r=De;try{if(Qn.transition=null,De=1,e)return e()}finally{De=r,Qn.transition=n,xe=t,(xe&6)===0&&Xo()}}function Vy(){An=Js.current,Ke(Js)}function Mi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,GD(n)),yt!==null)for(n=yt.return;n!==null;){var r=n;switch(Ry(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&tf();break;case 3:aa(),Ke(_n),Ke(Kt),Oy();break;case 5:Ly(r);break;case 4:aa();break;case 13:Ke(tt);break;case 19:Ke(tt);break;case 10:Ny(r.type._context);break;case 22:case 23:Vy()}n=n.return}if(xt=e,yt=e=Vo(e.current,null),Lt=An=t,It=0,gc=null,jy=Rf=Ui=0,yn=Ql=null,Ni!==null){for(t=0;t<Ni.length;t++)if(n=Ni[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}Ni=null}return e}function BC(e,t){do{var n=yt;try{if(ky(),Hd.current=df,uf){for(var r=nt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}uf=!1}if(Di=0,Rt=Tt=nt=null,Jl=!1,pc=0,zy.current=null,n===null||n.return===null){It=1,gc=t,yt=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Lt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if((u.mode&1)===0&&(f===0||f===11||f===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=Ow(s);if(h!==null){h.flags&=-257,Dw(h,s,a,i,t),h.mode&1&&Lw(i,c,t),t=h,l=c;var y=t.updateQueue;if(y===null){var _=new Set;_.add(l),t.updateQueue=_}else y.add(l);break e}else{if((t&1)===0){Lw(i,c,t),qy();break e}l=Error(L(426))}}else if(Qe&&a.mode&1){var T=Ow(s);if(T!==null){(T.flags&65536)===0&&(T.flags|=256),Dw(T,s,a,i,t),xy(la(l,a));break e}}i=l=la(l,a),It!==4&&(It=2),Ql===null?Ql=[i]:Ql.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=TC(i,l,t);bw(i,g);break e;case 1:a=l;var S=i.type,E=i.stateNode;if((i.flags&128)===0&&(typeof S.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Wo===null||!Wo.has(E)))){i.flags|=65536,t&=-t,i.lanes|=t;var R=IC(i,a,t);bw(i,R);break e}}i=i.return}while(i!==null)}zC(n)}catch(M){t=M,yt===n&&n!==null&&(yt=n=n.return);continue}break}while(!0)}function HC(){var e=ff.current;return ff.current=df,e===null?df:e}function qy(){(It===0||It===3||It===2)&&(It=4),xt===null||(Ui&268435455)===0&&(Rf&268435455)===0||Do(xt,Lt)}function hf(e,t){var n=xe;xe|=2;var r=HC();(xt!==e||Lt!==t)&&(no=null,Mi(e,t));do try{gU();break}catch(o){BC(e,o)}while(!0);if(ky(),xe=n,ff.current=r,yt!==null)throw Error(L(261));return xt=null,Lt=0,It}function gU(){for(;yt!==null;)$C(yt)}function yU(){for(;yt!==null&&!WO();)$C(yt)}function $C(e){var t=WC(e.alternate,e,An);e.memoizedProps=e.pendingProps,t===null?zC(e):yt=t,zy.current=null}function zC(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=cU(n,t,An),n!==null){yt=n;return}}else{if(n=uU(n,t),n!==null){n.flags&=32767,yt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{It=6,yt=null;return}}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);It===0&&(It=5)}function bi(e,t,n){var r=De,o=Qn.transition;try{Qn.transition=null,De=1,SU(e,t,n,r)}finally{Qn.transition=o,De=r}return null}function SU(e,t,n,r){do na();while(Fo!==null);if((xe&6)!==0)throw Error(L(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(L(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(eD(e,i),e===xt&&(yt=xt=null,Lt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Od||(Od=!0,GC(Kd,function(){return na(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=Qn.transition,Qn.transition=null;var s=De;De=1;var a=xe;xe|=4,zy.current=null,fU(e,n),DC(n,e),HD(Bg),Xd=!!Fg,Bg=Fg=null,e.current=n,pU(n,e,o),GO(),xe=a,De=s,Qn.transition=i}else e.current=n;if(Od&&(Od=!1,Fo=e,mf=o),i=e.pendingLanes,i===0&&(Wo=null),YO(n.stateNode,r),En(e,pt()),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(pf)throw pf=!1,e=iy,iy=null,e;return(mf&1)!==0&&e.tag!==0&&na(),i=e.pendingLanes,(i&1)!==0?e===sy?Zl++:(Zl=0,sy=e):Zl=0,Xo(),null}function na(){if(Fo!==null){var e=T0(mf),t=Qn.transition,n=De;try{if(Qn.transition=null,De=16>e?16:e,Fo===null)var r=!1;else{if(e=Fo,Fo=null,mf=0,(xe&6)!==0)throw Error(L(331));var o=xe;for(xe|=4,B=e.current;B!==null;){var i=B,s=i.child;if((B.flags&16)!==0){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(B=c;B!==null;){var u=B;switch(u.tag){case 0:case 11:case 15:Xl(8,u,i)}var f=u.child;if(f!==null)f.return=u,B=f;else for(;B!==null;){u=B;var p=u.sibling,h=u.return;if(PC(u),u===c){B=null;break}if(p!==null){p.return=h,B=p;break}B=h}}}var y=i.alternate;if(y!==null){var _=y.child;if(_!==null){y.child=null;do{var T=_.sibling;_.sibling=null,_=T}while(_!==null)}}B=i}}if((i.subtreeFlags&2064)!==0&&s!==null)s.return=i,B=s;else e:for(;B!==null;){if(i=B,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:Xl(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,B=g;break e}B=i.return}}var S=e.current;for(B=S;B!==null;){s=B;var E=s.child;if((s.subtreeFlags&2064)!==0&&E!==null)E.return=s,B=E;else e:for(s=S;B!==null;){if(a=B,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:Cf(9,a)}}catch(M){ct(a,a.return,M)}if(a===s){B=null;break e}var R=a.sibling;if(R!==null){R.return=a.return,B=R;break e}B=a.return}}if(xe=o,Xo(),Pr&&typeof Pr.onPostCommitFiberRoot=="function")try{Pr.onPostCommitFiberRoot(yf,e)}catch{}r=!0}return r}finally{De=n,Qn.transition=t}}return!1}function Kw(e,t,n){t=la(n,t),t=TC(e,t,1),e=jo(e,t,1),t=an(),e!==null&&(yc(e,1,t),En(e,t))}function ct(e,t,n){if(e.tag===3)Kw(e,e,n);else for(;t!==null;){if(t.tag===3){Kw(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wo===null||!Wo.has(r))){e=la(n,e),e=IC(t,e,1),t=jo(t,e,1),e=an(),t!==null&&(yc(t,1,e),En(t,e));break}}t=t.return}}function _U(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=an(),e.pingedLanes|=e.suspendedLanes&n,xt===e&&(Lt&n)===n&&(It===4||It===3&&(Lt&130023424)===Lt&&500>pt()-Wy?Mi(e,0):jy|=n),En(e,t)}function jC(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ed,Ed<<=1,(Ed&130023424)===0&&(Ed=4194304)));var n=an();e=co(e,t),e!==null&&(yc(e,t,n),En(e,n))}function vU(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jC(e,n)}function EU(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(L(314))}r!==null&&r.delete(t),jC(e,n)}var WC;WC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||_n.current)Sn=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Sn=!1,lU(e,t,n);Sn=(e.flags&131072)!==0}else Sn=!1,Qe&&(t.flags&1048576)!==0&&Y0(t,of,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zd(e,t),e=t.pendingProps;var o=oa(t,Kt.current);ta(t,n),o=Uy(null,t,r,e,o,n);var i=Fy();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,vn(r)?(i=!0,nf(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,My(t),o.updater=wf,t.stateNode=o,o._reactInternals=t,Yg(t,r,e,n),t=Xg(null,t,r,!0,i,n)):(t.tag=0,Qe&&i&&Cy(t),sn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=IU(r),e=hr(r,e),o){case 0:t=Jg(null,t,r,e,n);break e;case 1:t=Bw(null,t,r,e,n);break e;case 11:t=Uw(null,t,r,e,n);break e;case 14:t=Fw(null,t,r,hr(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),Jg(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),Bw(e,t,r,o,n);case 3:e:{if(xC(t),e===null)throw Error(L(387));r=t.pendingProps,i=t.memoizedState,o=i.element,eC(e,t),lf(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=la(Error(L(423)),t),t=Hw(e,t,r,n,o);break e}else if(r!==o){o=la(Error(L(424)),t),t=Hw(e,t,r,n,o);break e}else for(Mn=zo(t.stateNode.containerInfo.firstChild),Pn=t,Qe=!0,yr=null,n=Q0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ia(),r===o){t=uo(e,t,n);break e}sn(e,t,r,n)}t=t.child}return t;case 5:return tC(t),e===null&&Gg(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Hg(r,o)?s=null:i!==null&&Hg(r,i)&&(t.flags|=32),RC(e,t),sn(e,t,s,n),t.child;case 6:return e===null&&Gg(t),null;case 13:return bC(e,t,n);case 4:return Py(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=sa(t,null,r,n):sn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),Uw(e,t,r,o,n);case 7:return sn(e,t,t.pendingProps,n),t.child;case 8:return sn(e,t,t.pendingProps.children,n),t.child;case 12:return sn(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,Ge(sf,r._currentValue),r._currentValue=s,i!==null)if(vr(i.value,s)){if(i.children===o.children&&!_n.current){t=uo(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=so(-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),Vg(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(L(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Vg(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}sn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ta(t,n),o=Zn(o),r=r(o),t.flags|=1,sn(e,t,r,n),t.child;case 14:return r=t.type,o=hr(r,t.pendingProps),o=hr(r.type,o),Fw(e,t,r,o,n);case 15:return wC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),zd(e,t),t.tag=1,vn(r)?(e=!0,nf(t)):e=!1,ta(t,n),EC(t,r,o),Yg(t,r,o,n),Xg(null,t,r,!0,e,n);case 19:return kC(e,t,n);case 22:return CC(e,t,n)}throw Error(L(156,t.tag))};function GC(e,t){return S0(e,t)}function TU(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 Xn(e,t,n,r){return new TU(e,t,n,r)}function Yy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function IU(e){if(typeof e=="function")return Yy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===py)return 11;if(e===my)return 14}return 2}function Vo(e,t){var n=e.alternate;return n===null?(n=Xn(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 Gd(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Yy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Hs:return Pi(n.children,o,i,t);case fy:s=8,o|=8;break;case Sg:return e=Xn(12,n,t,o|2),e.elementType=Sg,e.lanes=i,e;case _g:return e=Xn(13,n,t,o),e.elementType=_g,e.lanes=i,e;case vg:return e=Xn(19,n,t,o),e.elementType=vg,e.lanes=i,e;case t0:return xf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zw:s=10;break e;case e0:s=9;break e;case py:s=11;break e;case my:s=14;break e;case Po:s=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=Xn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Pi(e,t,n,r){return e=Xn(7,e,r,t),e.lanes=n,e}function xf(e,t,n,r){return e=Xn(22,e,r,t),e.elementType=t0,e.lanes=n,e.stateNode={isHidden:!1},e}function hg(e,t,n){return e=Xn(6,e,null,t),e.lanes=n,e}function gg(e,t,n){return t=Xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function wU(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=Zh(0),this.expirationTimes=Zh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ky(e,t,n,r,o,i,s,a,l){return e=new wU(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Xn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},My(i),e}function CU(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 VC(e){if(!e)return Yo;e=e._reactInternals;e:{if(Hi(e)!==e||e.tag!==1)throw Error(L(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(L(171))}if(e.tag===1){var n=e.type;if(vn(n))return V0(e,n,t)}return t}function qC(e,t,n,r,o,i,s,a,l){return e=Ky(n,r,!0,e,o,i,s,a,l),e.context=VC(null),n=e.current,r=an(),o=Go(n),i=so(r,o),i.callback=t??null,jo(n,i,o),e.current.lanes=o,yc(e,o,r),En(e,r),e}function bf(e,t,n,r){var o=t.current,i=an(),s=Go(o);return n=VC(n),t.context===null?t.context=n:t.pendingContext=n,t=so(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=jo(o,t,s),e!==null&&(_r(e,o,s,i),Bd(e,o,s)),s}function gf(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Jw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jy(e,t){Jw(e,t),(e=e.alternate)&&Jw(e,t)}function RU(){return null}var YC=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xy(e){this._internalRoot=e}kf.prototype.render=Xy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(L(409));bf(e,t,null,null)};kf.prototype.unmount=Xy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fi(function(){bf(null,e,null,null)}),t[lo]=null}};function kf(e){this._internalRoot=e}kf.prototype.unstable_scheduleHydration=function(e){if(e){var t=C0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Oo.length&&t!==0&&t<Oo[n].priority;n++);Oo.splice(n,0,e),n===0&&x0(e)}};function Qy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Nf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xw(){}function xU(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=gf(s);i.call(c)}}var s=qC(t,r,e,0,null,!1,!1,"",Xw);return e._reactRootContainer=s,e[lo]=s.current,lc(e.nodeType===8?e.parentNode:e),Fi(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=gf(l);a.call(c)}}var l=Ky(e,0,!1,null,null,!1,!1,"",Xw);return e._reactRootContainer=l,e[lo]=l.current,lc(e.nodeType===8?e.parentNode:e),Fi(function(){bf(t,l,n,r)}),l}function Af(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=gf(s);a.call(l)}}bf(t,s,e,o)}else s=xU(n,t,e,o,r);return gf(s)}I0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jl(t.pendingLanes);n!==0&&(yy(t,n|1),En(t,pt()),(xe&6)===0&&(ca=pt()+500,Xo()))}break;case 13:Fi(function(){var r=co(e,1);if(r!==null){var o=an();_r(r,e,1,o)}}),Jy(e,1)}};Sy=function(e){if(e.tag===13){var t=co(e,134217728);if(t!==null){var n=an();_r(t,e,134217728,n)}Jy(e,134217728)}};w0=function(e){if(e.tag===13){var t=Go(e),n=co(e,t);if(n!==null){var r=an();_r(n,e,t,r)}Jy(e,t)}};C0=function(){return De};R0=function(e,t){var n=De;try{return De=e,t()}finally{De=n}};Ng=function(e,t,n){switch(t){case"input":if(Ig(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=Ef(r);if(!o)throw Error(L(90));r0(r),Ig(r,o)}}}break;case"textarea":i0(e,n);break;case"select":t=n.value,t!=null&&Xs(e,!!n.multiple,t,!1)}};f0=Gy;p0=Fi;var bU={usingClientEntryPoint:!1,Events:[_c,Ws,Ef,u0,d0,Gy]},Bl={findFiberByHostInstance:ki,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},kU={bundleType:Bl.bundleType,version:Bl.version,rendererPackageName:Bl.rendererPackageName,rendererConfig:Bl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=g0(e),e===null?null:e.stateNode},findFiberByHostInstance:Bl.findFiberByHostInstance||RU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Hl.isDisabled&&Hl.supportsFiber))try{yf=Hl.inject(kU),Pr=Hl}catch{}var Hl;Dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bU;Dn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qy(t))throw Error(L(200));return CU(e,t,null,n)};Dn.createRoot=function(e,t){if(!Qy(e))throw Error(L(299));var n=!1,r="",o=YC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ky(e,1,!1,null,null,n,!1,r,o),e[lo]=t.current,lc(e.nodeType===8?e.parentNode:e),new Xy(t)};Dn.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(L(188)):(e=Object.keys(e).join(","),Error(L(268,e)));return e=g0(t),e=e===null?null:e.stateNode,e};Dn.flushSync=function(e){return Fi(e)};Dn.hydrate=function(e,t,n){if(!Nf(t))throw Error(L(200));return Af(null,e,t,!0,n)};Dn.hydrateRoot=function(e,t,n){if(!Qy(e))throw Error(L(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=YC;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=qC(t,null,e,1,n??null,o,!1,i,s),e[lo]=t.current,lc(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 kf(t)};Dn.render=function(e,t,n){if(!Nf(t))throw Error(L(200));return Af(null,e,t,!1,n)};Dn.unmountComponentAtNode=function(e){if(!Nf(e))throw Error(L(40));return e._reactRootContainer?(Fi(function(){Af(null,null,e,!1,function(){e._reactRootContainer=null,e[lo]=null})}),!0):!1};Dn.unstable_batchedUpdates=Gy;Dn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Nf(n))throw Error(L(200));if(e==null||e._reactInternals===void 0)throw Error(L(38));return Af(e,t,n,!1,r)};Dn.version="18.3.1-next-f1338f8080-20240426"});var Mf=Br((zY,XC)=>{"use strict";function JC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(JC)}catch(e){console.error(e)}}JC(),XC.exports=KC()});var ZC=Br(Zy=>{"use strict";var QC=Mf();Zy.createRoot=QC.createRoot,Zy.hydrateRoot=QC.hydrateRoot;var jY});var uR=Br(Of=>{"use strict";var BU=eo(),HU=Symbol.for("react.element"),$U=Symbol.for("react.fragment"),zU=Object.prototype.hasOwnProperty,jU=BU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,WU={key:!0,ref:!0,__self:!0,__source:!0};function cR(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)zU.call(t,r)&&!WU.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:HU,type:e,key:i,ref:s,props:o,_owner:jU.current}}Of.Fragment=$U;Of.jsx=cR;Of.jsxs=cR});var Tc=Br((ZY,dR)=>{"use strict";dR.exports=uR()});var O=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var G=globalThis;var Er="10.56.0";function Rn(){return ei(G),G}function ei(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Er,t[Er]=t[Er]||{}}function rr(e,t,n=G){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[Er]=r[Er]||{};return o[e]||(o[e]=t())}var xc=["debug","info","warn","error","log","assert","trace"],Px="Sentry Logger ",ti={};function kt(e){if(!("console"in G))return e();let t=G.console,n={},r=Object.keys(ti);r.forEach(o=>{let i=ti[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function Lx(){sp().enabled=!0}function Ox(){sp().enabled=!1}function LS(){return sp().enabled}function Dx(...e){ip("log",...e)}function Ux(...e){ip("warn",...e)}function Fx(...e){ip("error",...e)}function ip(e,...t){O&&LS()&&kt(()=>{G.console[e](`${Px}[${e}]:`,...t)})}function sp(){return O?rr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var C={enable:Lx,disable:Ox,isEnabled:LS,log:Dx,warn:Ux,error:Fx};var OS=/\(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
9
  `);for(let a=r;a<s.length;a++){let l=s[a];l.length>1024&&(l=l.slice(0,1024));let c=OS.test(l)?l.replace(OS,"$1"):l;if(!c.includes("Error: ")){for(let u of t){let f=u(c);if(f){i.push(f);break}}if(i.length>=50+o)break}}return lp(i.slice(o))}}function kc(e){return Array.isArray(e)?Sa(...e):e}function lp(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(bc(t).function||"")&&t.pop(),t.reverse(),DS.test(bc(t).function||"")&&(t.pop(),DS.test(bc(t).function||"")&&t.pop()),t.slice(0,50).map(n=>({...n,filename:n.filename||bc(t).filename,function:n.function||"?"}))}function bc(e){return e[e.length-1]||{}}var ap="<anonymous>";function Qt(e){try{return!e||typeof e!="function"?ap:e.name||ap}catch{return ap}}function _a(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 va={},US={};function Ft(e,t){return va[e]=va[e]||[],va[e].push(t),()=>{let n=va[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function Bt(e,t){if(!US[e]){US[e]=!0;try{t()}catch(n){O&&C.error(`Error while instrumenting ${e}`,n)}}}function mt(e,t){let n=e&&va[e];if(n)for(let r of n)try{r(t)}catch(o){O&&C.error(`Error while triggering instrumentation handler.
10
10
  Type: ${e}
11
11
  Name: ${Qt(r)}
12
- Error:`,o)}}var cp=null;function Ea(e){let t="error";Ft(t,e),Bt(t,Fx)}function Fx(){cp=G.onerror,G.onerror=function(e,t,n,r,o){return mt("error",{column:r,error:o,line:n,msg:e,url:t}),cp?cp.apply(this,arguments):!1},G.onerror.__SENTRY_INSTRUMENTED__=!0}var up=null;function Ta(e){let t="unhandledrejection";Ft(t,e),Bt(t,Bx)}function Bx(){up=G.onunhandledrejection,G.onunhandledrejection=function(e){return mt("unhandledrejection",e),up?up.apply(this,arguments):!0},G.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var FS=Object.prototype.toString;function Un(e){switch(FS.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return ir(e,Error)}}function Ji(e,t){return FS.call(e)===`[object ${t}]`}function Xi(e){return Ji(e,"ErrorEvent")}function Ia(e){return Ji(e,"DOMError")}function Nc(e){return Ji(e,"DOMException")}function Ht(e){return Ji(e,"String")}function go(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function un(e){return e===null||go(e)||typeof e!="object"&&typeof e!="function"}function Fn(e){return Ji(e,"Object")}function yo(e){return typeof Event<"u"&&ir(e,Event)}function Ac(e){return Ji(e,"RegExp")}function or(e){return!!(e?.then&&typeof e.then=="function")}function ir(e,t){try{return e instanceof t}catch{return!1}}function wa(e){return typeof Request<"u"&&ir(e,Request)}function st(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Ca(o,r);try{e[t]=o}catch{O&&C.log(`Failed to replace method "${t}" in object`,e)}}function Ve(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{O&&C.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Ca(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,Ve(e,"__sentry_original__",t)}catch{}}function So(e){return e.__sentry_original__}function Ra(e){if(Un(e))return{message:e.message,name:e.name,stack:e.stack,...BS(e)};if(yo(e)){let{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...BS(e)}}return e}function BS(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function Mc(e){let t=Object.keys(Ra(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var Qi;function ni(e){if(Qi!==void 0)return Qi?Qi(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=G;return t in n&&typeof n[t]=="function"?(Qi=n[t],Qi(e)):(Qi=null,e())}function Bn(){return ni(()=>Math.random())}function ri(){return ni(()=>Date.now())}var Hx=Symbol.for("sentry.skipNormalization"),$x=Symbol.for("sentry.overrideNormalizationDepth");function HS(e){return!!e[Hx]}function $S(e){let t=e[$x];return typeof t=="number"?t:void 0}var dp;function Zi(e){dp=e}function $t(e,t=100,n=1/0){try{return fp("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function xa(e,t=3,n=100*1024){let r=$t(e,t);return Wx(r)>n?xa(e,t-1,n):r}function fp(e,t,n=1/0,r=1/0,o=Gx()){let[i,s]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=pp(e,t);if(!a.startsWith("[object "))return a;if(HS(t))return t;let l=$S(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 y=u.toJSON();return fp("",y,c-1,r,o)}catch{}let f=Array.isArray(t)?[]:{},p=0,h=Ra(t);for(let y in h){if(!Object.prototype.hasOwnProperty.call(h,y))continue;if(p>=r){f[y]="[MaxProperties ~]";break}let _=h[y];f[y]=fp(y,_,c-1,r,o),p++}return s(t),f}function pp(e,t){try{if(dp){let r=dp(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Qt(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${zx(t)}]`}catch(n){return`**non-serializable** (${n})`}}function zx(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function jx(e){return~-encodeURI(e).split(/%..|./).length}function Wx(e){return jx(JSON.stringify(e))}function Gx(){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 oi(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function ba(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];un(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(pp(void 0,o))}return n.join(t)}function _o(e,t,n=!1){return Ht(e)?Ac(t)?t.test(e):Ht(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Nt(e,t=[],n=!1){for(let r of t)if(_o(e,r,n))return!0;return!1}function Vx(){let e=G;return e.crypto||e.msCrypto}var mp;function qx(){return Bn()*16}function at(e=Vx()){try{if(e?.randomUUID)return ni(()=>e.randomUUID()).replace(/-/g,"")}catch{}return mp||(mp="10000000100040008000"+1e11),mp.replace(/[018]/g,t=>(t^(qx()&15)>>t/4).toString(16))}function zS(e){return e.exception?.values?.[0]}function sr(e){let{message:t,event_id:n}=e;if(t)return t;let r=zS(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ii(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 Hn(e,t){let n=zS(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 ka(e){if(hp(e))return!0;try{Ve(e,"__sentry_captured__",!0)}catch{}return!1}function hp(e){try{return e.__sentry_captured__}catch{}}var WS=1e3;function dn(){return ri()/WS}function Yx(){let{performance:e}=G;if(!e?.now||!e.timeOrigin)return dn;let t=e.timeOrigin;return()=>(t+ni(()=>e.now()))/WS}var jS;function Ae(){return(jS??(jS=Yx()))()}var gp=null;function Kx(){let{performance:e}=G;if(!e?.now)return;let t=3e5,n=ni(()=>e.now()),r=ri(),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 He(){return gp===null&&(gp=Kx()),gp}function GS(e){let t=Ae(),n={sid:at(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Jx(n)};return e&&Hr(n,e),n}function Hr(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||Ae(),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:at()),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 VS(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),Hr(e,n)}function Jx(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 vo(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]=vo(r[o],t[o],n-1));return r}function Zt(){return at()}function zt(){return at().substring(16)}function Pc(e){try{let t=G.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Lc(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var yp="_sentrySpan";function Eo(e,t){t?Ve(e,yp,Pc(t)):delete e[yp]}function si(e){return Lc(e[yp])}var Xx=100,fn=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:Zt(),sampleRand:Bn()}}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,Eo(t,si(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&&Hr(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():Fn(n)?t:void 0,{tags:o,attributes:i,extra:s,user:a,contexts:l,level:c,fingerprint:u=[],propagationContext:f,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),f&&(this._propagationContext=f),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,Eo(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Zt(),sampleRand:Bn()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:Xx;if(r<=0)return this;let o={timestamp:dn(),...t,message:t.message?oi(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:si(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=vo(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||at();if(!this._client)return O&&C.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||at();if(!this._client)return O&&C.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||at();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(O&&C.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 qS(){return rr("defaultCurrentScope",()=>new fn)}function YS(){return rr("defaultIsolationScope",()=>new fn)}var KS=e=>e instanceof Promise&&!e[JS],JS=Symbol("chained PromiseLike"),XS=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return KS(r)&&KS(e)?r:Qx(e,r)},Qx=(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,{[JS]:!0}),t};var Sp=class{constructor(t,n){let r;t?r=t:r=new fn;let o;n?o=n:o=new fn,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 or(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 es(){let e=Rn(),t=ei(e);return t.stack=t.stack||new Sp(qS(),YS())}function Zx(e){return es().withScope(e)}function eb(e,t){let n=es();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function QS(e){return es().withScope(()=>e(es().getIsolationScope()))}function ZS(){return{withIsolationScope:QS,withScope:Zx,withSetScope:eb,withSetIsolationScope:(e,t)=>QS(t),getCurrentScope:()=>es().getScope(),getIsolationScope:()=>es().getIsolationScope()}}function Tr(e){let t=ei(e);return t.acs?t.acs:ZS()}function tb(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function nb(e,t){let{value:n,unit:r}=tb(e)?e:{value:e,unit:void 0},o=rb(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 _p(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let i=nb(o,t);i&&(n[r]=i)}return n}function rb(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 e_;function vp(){return e_?.()}function Oc(){return e_!==void 0}function te(){let e=Rn();return Tr(e).getCurrentScope()}function Xe(){let e=Rn();return Tr(e).getIsolationScope()}function Na(){return rr("globalScope",()=>new fn)}function $n(...e){let t=Rn(),n=Tr(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 te().getClient()}function Dc(e){let t=vp();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||zt()};return o&&(s.parent_span_id=o),s}var vt="sentry.source",$r="sentry.sample_rate",ts="sentry.previous_trace_sample_rate",qe="sentry.op",we="sentry.origin",zr="sentry.idle_span_finish_reason",ar="sentry.measurement_unit",lr="sentry.measurement_value";var ns="sentry.custom_span_name",ai="sentry.profile_id",jt="sentry.exclusive_time";var Uc="sentry.link.type",Fc="gen_ai.conversation.id";function Ep(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 rs(e,t){e.setAttribute("http.response.status_code",t);let n=Ep(t);n.message!=="unknown_error"&&e.setStatus(n)}var t_="_sentryScope",n_="_sentryIsolationScope";function r_(e,t,n){e&&(Ve(e,n_,Pc(n)),Ve(e,t_,t))}function li(e){let t=e;return{scope:t[t_],isolationScope:Lc(t[n_])}}var Aa="sentry-";var ob=8192;function Bc(e){let t=ib(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,i])=>{if(o.startsWith(Aa)){let s=o.slice(Aa.length);r[s]=i}return r},{});if(Object.keys(n).length>0)return n}function Tp(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${Aa}${r}`]=o),n),{});return sb(t)}function ib(e){if(!(!e||!Ht(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=o_(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):o_(e)}function o_(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 sb(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>ob?(O&&C.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var ab=/^o(\d+)\./,lb=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function cb(e){return e==="http"||e==="https"}function xn(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 ub(e){let t=lb.exec(e);if(!t){kt(()=>{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 f=c.match(/^\d+/);f&&(c=f[0])}return i_({host:i,pass:o,path:l,projectId:c,port:s,protocol:n,publicKey:r})}function i_(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function db(e){if(!O)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(C.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?cb(r)?t&&isNaN(parseInt(t,10))?(C.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(C.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(C.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function fb(e){return e.match(ab)?.[1]}function s_(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=fb(n)),r}function Hc(e){let t=typeof e=="string"?ub(e):i_(e);if(!(!t||!db(t)))return t}function bn(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 $c=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function a_(e){if(!e)return;let t=e.match($c);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 Ip(e,t){let n=a_(e),r=Bc(t);if(!n?.traceId)return{traceId:Zt(),sampleRand:Bn()};let o=pb(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 Ma(e=Zt(),t=zt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Pa(e=Zt(),t=zt(),n){return`00-${e}-${t}-${n?"01":"00"}`}function pb(e,t){let n=bn(t?.sample_rand);if(n!==void 0)return n;let r=bn(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?Bn()*r:r+Bn()*(1-r):Bn()}var zc=0,Oa=1,l_=!1;function d_(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:a,links:l}=ne(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:o,status:s,origin:a,links:l}}function jc(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:ne(e).parent_span_id,i=li(e).scope,s=r?i?.getPropagationContext().propagationSpanId||zt():t;return{parent_span_id:o,span_id:s,trace_id:n}}function Da(e){let{traceId:t,spanId:n}=e.spanContext(),r=mn(e);return Ma(t,n,r)}function f_(e){let{traceId:t,spanId:n}=e.spanContext(),r=mn(e);return Pa(t,n,r)}function Ua(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===Oa,attributes:i,...o}))}function Rp(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Oa,attributes:o}))}function pn(e){return typeof e=="number"?c_(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?c_(e.getTime()):Ae()}function c_(e){return e>9999999999?e/1e3:e}function ne(e){if(g_(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(h_(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:p_(e),start_timestamp:pn(o),timestamp:pn(s)||void 0,status:Ba(a),op:r[qe],origin:r[we],links:Ua(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Fa(e){if(g_(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(h_(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:p_(e),start_timestamp:pn(o),end_timestamp:pn(s),is_segment:e===La(e),status:xp(a),attributes:r,links:Rp(l)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===La(e)}}function p_(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function m_(e){return{...e,attributes:_p(e.attributes),links:e.links?.map(t=>({...t,attributes:_p(t.attributes)}))}}function h_(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function g_(e){return typeof e.getSpanJSON=="function"}function mn(e){let{traceFlags:t}=e.spanContext();return t===Oa}function Ba(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function xp(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var ci="_sentryChildSpans",wp="_sentryRootSpan";function Ha(e,t){let n=e[wp]||e;Ve(t,wp,n),e[ci]?e[ci].add(t):Ve(e,ci,new Set([t]))}function y_(e,t){e[ci]&&e[ci].delete(t)}function jr(e){let t=new Set;function n(r){if(!t.has(r)&&mn(r)){t.add(r);let o=r[ci]?Array.from(r[ci]):[];for(let i of o)n(i)}}return n(e),Array.from(t)}var be=La;function La(e){return e[wp]||e}function Me(){let e=Rn(),t=Tr(e);return t.getActiveSpan?t.getActiveSpan():si(te())}function $a(){l_||(kt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),l_=!0)}var S_=!1;function Wc(){if(S_)return;function e(){let t=Me(),n=t&&be(t);if(n){let r="internal_error";O&&C.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}S_=!0,Ea(e),Ta(e)}function Et(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||$()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function __(e){C.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Wr(e,t){if(!t?.length)return!1;for(let n of t){if(hb(n)){if(e.description&&_o(e.description,n))return O&&__(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&&_o(e.description,n.name):!0,i=n.op?e.op&&_o(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,l])=>mb(e.attributes?.[a],l)):!0;if(o&&i&&s)return O&&__(e),!0}return!1}function mb(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?_o(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function v_(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 hb(e){return typeof e=="string"||e instanceof RegExp}var os="production";var E_="_frozenDsc";function is(e,t){Ve(e,E_,t)}function Gc(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||os,release:n.release,public_key:r,trace_id:e,org_id:s_(t)};return t.emit("createDsc",o),o}function ss(e,t){let n=t.getPropagationContext();return n.dsc||Gc(n.traceId,e)}function ht(e){let t=$();if(!t)return{};let n=be(e),r=ne(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[$r]??o[ts];function a(y){return(typeof s=="number"||typeof s=="string")&&(y.sample_rate=`${s}`),y}let l=n[E_];if(l)return a(l);let c=i?.get("sentry.dsc"),u=c&&Bc(c);if(u)return a(u);let f=Gc(e.spanContext().traceId,t),p=o[vt]??o["sentry.span.source"],h=r.description;return p!=="url"&&h&&(f.transaction=h),Et()&&(f.sampled=String(mn(n)),f.sample_rand=i?.get("sentry.sample_rand")??li(n).scope?.getPropagationContext().sampleRand.toString()),a(f),t.emit("createDsc",f,n),f}var At=class{constructor(t={}){this._traceId=t.traceId||Zt(),this._spanId=t.spanId||zt(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:zc}}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 Vc(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function en(e,t=[]){return[e,t]}function qc(e,t){let[n,r]=e;return[n,[...r,t]]}function za(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 kp(e,t){return za(e,(n,r)=>t.includes(r))}function bp(e){let t=ei(G);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Np(e){let[t,n]=e,r=JSON.stringify(t);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[bp(r),i]:r.push(typeof i=="string"?bp(i):i)}for(let i of n){let[s,a]=i;if(o(`
12
+ Error:`,o)}}var cp=null;function Ea(e){let t="error";Ft(t,e),Bt(t,Bx)}function Bx(){cp=G.onerror,G.onerror=function(e,t,n,r,o){return mt("error",{column:r,error:o,line:n,msg:e,url:t}),cp?cp.apply(this,arguments):!1},G.onerror.__SENTRY_INSTRUMENTED__=!0}var up=null;function Ta(e){let t="unhandledrejection";Ft(t,e),Bt(t,Hx)}function Hx(){up=G.onunhandledrejection,G.onunhandledrejection=function(e){return mt("unhandledrejection",e),up?up.apply(this,arguments):!0},G.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var FS=Object.prototype.toString;function Un(e){switch(FS.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return ir(e,Error)}}function Ji(e,t){return FS.call(e)===`[object ${t}]`}function Xi(e){return Ji(e,"ErrorEvent")}function Ia(e){return Ji(e,"DOMError")}function Nc(e){return Ji(e,"DOMException")}function Ht(e){return Ji(e,"String")}function go(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function un(e){return e===null||go(e)||typeof e!="object"&&typeof e!="function"}function Fn(e){return Ji(e,"Object")}function yo(e){return typeof Event<"u"&&ir(e,Event)}function Ac(e){return Ji(e,"RegExp")}function or(e){return!!(e?.then&&typeof e.then=="function")}function ir(e,t){try{return e instanceof t}catch{return!1}}function wa(e){return typeof Request<"u"&&ir(e,Request)}function st(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Ca(o,r);try{e[t]=o}catch{O&&C.log(`Failed to replace method "${t}" in object`,e)}}function Ve(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{O&&C.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Ca(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,Ve(e,"__sentry_original__",t)}catch{}}function So(e){return e.__sentry_original__}function Ra(e){if(Un(e))return{message:e.message,name:e.name,stack:e.stack,...BS(e)};if(yo(e)){let{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...BS(e)}}return e}function BS(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function Mc(e){let t=Object.keys(Ra(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var Qi;function ni(e){if(Qi!==void 0)return Qi?Qi(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=G;return t in n&&typeof n[t]=="function"?(Qi=n[t],Qi(e)):(Qi=null,e())}function Bn(){return ni(()=>Math.random())}function ri(){return ni(()=>Date.now())}var $x=Symbol.for("sentry.skipNormalization"),zx=Symbol.for("sentry.overrideNormalizationDepth");function HS(e){return!!e[$x]}function $S(e){let t=e[zx];return typeof t=="number"?t:void 0}var dp;function Zi(e){dp=e}function $t(e,t=100,n=1/0){try{return fp("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function xa(e,t=3,n=100*1024){let r=$t(e,t);return Gx(r)>n?xa(e,t-1,n):r}function fp(e,t,n=1/0,r=1/0,o=Vx()){let[i,s]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=pp(e,t);if(!a.startsWith("[object "))return a;if(HS(t))return t;let l=$S(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 y=u.toJSON();return fp("",y,c-1,r,o)}catch{}let f=Array.isArray(t)?[]:{},p=0,h=Ra(t);for(let y in h){if(!Object.prototype.hasOwnProperty.call(h,y))continue;if(p>=r){f[y]="[MaxProperties ~]";break}let _=h[y];f[y]=fp(y,_,c-1,r,o),p++}return s(t),f}function pp(e,t){try{if(dp){let r=dp(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Qt(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${jx(t)}]`}catch(n){return`**non-serializable** (${n})`}}function jx(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function Wx(e){return~-encodeURI(e).split(/%..|./).length}function Gx(e){return Wx(JSON.stringify(e))}function Vx(){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 oi(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function ba(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];un(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(pp(void 0,o))}return n.join(t)}function _o(e,t,n=!1){return Ht(e)?Ac(t)?t.test(e):Ht(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Nt(e,t=[],n=!1){for(let r of t)if(_o(e,r,n))return!0;return!1}function qx(){let e=G;return e.crypto||e.msCrypto}var mp;function Yx(){return Bn()*16}function at(e=qx()){try{if(e?.randomUUID)return ni(()=>e.randomUUID()).replace(/-/g,"")}catch{}return mp||(mp="10000000100040008000"+1e11),mp.replace(/[018]/g,t=>(t^(Yx()&15)>>t/4).toString(16))}function zS(e){return e.exception?.values?.[0]}function sr(e){let{message:t,event_id:n}=e;if(t)return t;let r=zS(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ii(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 Hn(e,t){let n=zS(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 ka(e){if(hp(e))return!0;try{Ve(e,"__sentry_captured__",!0)}catch{}return!1}function hp(e){try{return e.__sentry_captured__}catch{}}var WS=1e3;function dn(){return ri()/WS}function Kx(){let{performance:e}=G;if(!e?.now||!e.timeOrigin)return dn;let t=e.timeOrigin;return()=>(t+ni(()=>e.now()))/WS}var jS;function Ae(){return(jS??(jS=Kx()))()}var gp=null;function Jx(){let{performance:e}=G;if(!e?.now)return;let t=3e5,n=ni(()=>e.now()),r=ri(),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 He(){return gp===null&&(gp=Jx()),gp}function GS(e){let t=Ae(),n={sid:at(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Xx(n)};return e&&Hr(n,e),n}function Hr(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||Ae(),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:at()),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 VS(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),Hr(e,n)}function Xx(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 vo(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]=vo(r[o],t[o],n-1));return r}function Zt(){return at()}function zt(){return at().substring(16)}function Pc(e){try{let t=G.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Lc(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var yp="_sentrySpan";function Eo(e,t){t?Ve(e,yp,Pc(t)):delete e[yp]}function si(e){return Lc(e[yp])}var Qx=100,fn=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:Zt(),sampleRand:Bn()}}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,Eo(t,si(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&&Hr(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():Fn(n)?t:void 0,{tags:o,attributes:i,extra:s,user:a,contexts:l,level:c,fingerprint:u=[],propagationContext:f,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),f&&(this._propagationContext=f),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,Eo(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Zt(),sampleRand:Bn()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:Qx;if(r<=0)return this;let o={timestamp:dn(),...t,message:t.message?oi(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:si(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=vo(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||at();if(!this._client)return O&&C.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||at();if(!this._client)return O&&C.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||at();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(O&&C.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 qS(){return rr("defaultCurrentScope",()=>new fn)}function YS(){return rr("defaultIsolationScope",()=>new fn)}var KS=e=>e instanceof Promise&&!e[JS],JS=Symbol("chained PromiseLike"),XS=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return KS(r)&&KS(e)?r:Zx(e,r)},Zx=(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,{[JS]:!0}),t};var Sp=class{constructor(t,n){let r;t?r=t:r=new fn;let o;n?o=n:o=new fn,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 or(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 es(){let e=Rn(),t=ei(e);return t.stack=t.stack||new Sp(qS(),YS())}function eb(e){return es().withScope(e)}function tb(e,t){let n=es();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function QS(e){return es().withScope(()=>e(es().getIsolationScope()))}function ZS(){return{withIsolationScope:QS,withScope:eb,withSetScope:tb,withSetIsolationScope:(e,t)=>QS(t),getCurrentScope:()=>es().getScope(),getIsolationScope:()=>es().getIsolationScope()}}function Tr(e){let t=ei(e);return t.acs?t.acs:ZS()}function nb(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function rb(e,t){let{value:n,unit:r}=nb(e)?e:{value:e,unit:void 0},o=ob(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 _p(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let i=rb(o,t);i&&(n[r]=i)}return n}function ob(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 e_;function vp(){return e_?.()}function Oc(){return e_!==void 0}function te(){let e=Rn();return Tr(e).getCurrentScope()}function Xe(){let e=Rn();return Tr(e).getIsolationScope()}function Na(){return rr("globalScope",()=>new fn)}function $n(...e){let t=Rn(),n=Tr(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 te().getClient()}function Dc(e){let t=vp();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||zt()};return o&&(s.parent_span_id=o),s}var vt="sentry.source",$r="sentry.sample_rate",ts="sentry.previous_trace_sample_rate",qe="sentry.op",we="sentry.origin",zr="sentry.idle_span_finish_reason",ar="sentry.measurement_unit",lr="sentry.measurement_value";var ns="sentry.custom_span_name",ai="sentry.profile_id",jt="sentry.exclusive_time";var Uc="sentry.link.type",Fc="gen_ai.conversation.id";function Ep(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 rs(e,t){e.setAttribute("http.response.status_code",t);let n=Ep(t);n.message!=="unknown_error"&&e.setStatus(n)}var t_="_sentryScope",n_="_sentryIsolationScope";function r_(e,t,n){e&&(Ve(e,n_,Pc(n)),Ve(e,t_,t))}function li(e){let t=e;return{scope:t[t_],isolationScope:Lc(t[n_])}}var Aa="sentry-";var ib=8192;function Bc(e){let t=sb(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,i])=>{if(o.startsWith(Aa)){let s=o.slice(Aa.length);r[s]=i}return r},{});if(Object.keys(n).length>0)return n}function Tp(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${Aa}${r}`]=o),n),{});return ab(t)}function sb(e){if(!(!e||!Ht(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=o_(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):o_(e)}function o_(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 ab(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>ib?(O&&C.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var lb=/^o(\d+)\./,cb=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function ub(e){return e==="http"||e==="https"}function xn(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 db(e){let t=cb.exec(e);if(!t){kt(()=>{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 f=c.match(/^\d+/);f&&(c=f[0])}return i_({host:i,pass:o,path:l,projectId:c,port:s,protocol:n,publicKey:r})}function i_(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function fb(e){if(!O)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(C.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?ub(r)?t&&isNaN(parseInt(t,10))?(C.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(C.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(C.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function pb(e){return e.match(lb)?.[1]}function s_(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=pb(n)),r}function Hc(e){let t=typeof e=="string"?db(e):i_(e);if(!(!t||!fb(t)))return t}function bn(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 $c=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function a_(e){if(!e)return;let t=e.match($c);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 Ip(e,t){let n=a_(e),r=Bc(t);if(!n?.traceId)return{traceId:Zt(),sampleRand:Bn()};let o=mb(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 Ma(e=Zt(),t=zt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Pa(e=Zt(),t=zt(),n){return`00-${e}-${t}-${n?"01":"00"}`}function mb(e,t){let n=bn(t?.sample_rand);if(n!==void 0)return n;let r=bn(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?Bn()*r:r+Bn()*(1-r):Bn()}var zc=0,Oa=1,l_=!1;function d_(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:a,links:l}=ne(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:o,status:s,origin:a,links:l}}function jc(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:ne(e).parent_span_id,i=li(e).scope,s=r?i?.getPropagationContext().propagationSpanId||zt():t;return{parent_span_id:o,span_id:s,trace_id:n}}function Da(e){let{traceId:t,spanId:n}=e.spanContext(),r=mn(e);return Ma(t,n,r)}function f_(e){let{traceId:t,spanId:n}=e.spanContext(),r=mn(e);return Pa(t,n,r)}function Ua(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===Oa,attributes:i,...o}))}function Rp(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Oa,attributes:o}))}function pn(e){return typeof e=="number"?c_(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?c_(e.getTime()):Ae()}function c_(e){return e>9999999999?e/1e3:e}function ne(e){if(g_(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(h_(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:p_(e),start_timestamp:pn(o),timestamp:pn(s)||void 0,status:Ba(a),op:r[qe],origin:r[we],links:Ua(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Fa(e){if(g_(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(h_(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:p_(e),start_timestamp:pn(o),end_timestamp:pn(s),is_segment:e===La(e),status:xp(a),attributes:r,links:Rp(l)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===La(e)}}function p_(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function m_(e){return{...e,attributes:_p(e.attributes),links:e.links?.map(t=>({...t,attributes:_p(t.attributes)}))}}function h_(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function g_(e){return typeof e.getSpanJSON=="function"}function mn(e){let{traceFlags:t}=e.spanContext();return t===Oa}function Ba(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function xp(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var ci="_sentryChildSpans",wp="_sentryRootSpan";function Ha(e,t){let n=e[wp]||e;Ve(t,wp,n),e[ci]?e[ci].add(t):Ve(e,ci,new Set([t]))}function y_(e,t){e[ci]&&e[ci].delete(t)}function jr(e){let t=new Set;function n(r){if(!t.has(r)&&mn(r)){t.add(r);let o=r[ci]?Array.from(r[ci]):[];for(let i of o)n(i)}}return n(e),Array.from(t)}var be=La;function La(e){return e[wp]||e}function Me(){let e=Rn(),t=Tr(e);return t.getActiveSpan?t.getActiveSpan():si(te())}function $a(){l_||(kt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),l_=!0)}var S_=!1;function Wc(){if(S_)return;function e(){let t=Me(),n=t&&be(t);if(n){let r="internal_error";O&&C.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}S_=!0,Ea(e),Ta(e)}function Et(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||$()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function __(e){C.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Wr(e,t){if(!t?.length)return!1;for(let n of t){if(gb(n)){if(e.description&&_o(e.description,n))return O&&__(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&&_o(e.description,n.name):!0,i=n.op?e.op&&_o(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,l])=>hb(e.attributes?.[a],l)):!0;if(o&&i&&s)return O&&__(e),!0}return!1}function hb(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?_o(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function v_(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 gb(e){return typeof e=="string"||e instanceof RegExp}var os="production";var E_="_frozenDsc";function is(e,t){Ve(e,E_,t)}function Gc(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||os,release:n.release,public_key:r,trace_id:e,org_id:s_(t)};return t.emit("createDsc",o),o}function ss(e,t){let n=t.getPropagationContext();return n.dsc||Gc(n.traceId,e)}function ht(e){let t=$();if(!t)return{};let n=be(e),r=ne(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[$r]??o[ts];function a(y){return(typeof s=="number"||typeof s=="string")&&(y.sample_rate=`${s}`),y}let l=n[E_];if(l)return a(l);let c=i?.get("sentry.dsc"),u=c&&Bc(c);if(u)return a(u);let f=Gc(e.spanContext().traceId,t),p=o[vt]??o["sentry.span.source"],h=r.description;return p!=="url"&&h&&(f.transaction=h),Et()&&(f.sampled=String(mn(n)),f.sample_rand=i?.get("sentry.sample_rand")??li(n).scope?.getPropagationContext().sampleRand.toString()),a(f),t.emit("createDsc",f,n),f}var At=class{constructor(t={}){this._traceId=t.traceId||Zt(),this._spanId=t.spanId||zt(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:zc}}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 Vc(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function en(e,t=[]){return[e,t]}function qc(e,t){let[n,r]=e;return[n,[...r,t]]}function za(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 kp(e,t){return za(e,(n,r)=>t.includes(r))}function bp(e){let t=ei(G);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Np(e){let[t,n]=e,r=JSON.stringify(t);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[bp(r),i]:r.push(typeof i=="string"?bp(i):i)}for(let i of n){let[s,a]=i;if(o(`
13
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($t(a))}o(l)}}return typeof r=="string"?r:gb(r)}function gb(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 Ap(e){return[{type:"span"},e]}function Mp(e){let t=typeof e.data=="string"?bp(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var T_={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 yb(e){return e in T_}function Yc(e){return yb(e)?T_[e]:e}function as(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function ja(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:xn(r)},...o&&{trace:o}}}function Sb(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 I_(e,t,n,r){let o=as(n),i={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:xn(t)}},s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return en(i,[s])}function w_(e,t,n,r){let o=as(n),i=e.type&&e.type!=="replay_event"?e.type:"event";Sb(e,n?.sdk);let s=ja(e,o,r,t);return delete e.sdkProcessingMetadata,en(s,[[{type:i},e]])}function C_(e,t){function n(h){return!!h.trace_id&&!!h.public_key}let r=ht(e[0]),o=t?.getDsn(),i=t?.getOptions().tunnel,s={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&o&&{dsn:xn(o)}},{beforeSendSpan:a,ignoreSpans:l}=t?.getOptions()||{},c=l?.length?e.filter(h=>{let y=ne(h);return!Wr({description:y.description,op:y.op,attributes:y.data},l)}):e,u=e.length-c.length;u&&t?.recordDroppedEvent("before_send","span",u);let f=a?h=>{let y=ne(h),_=Vc(a)?y:a(y);return _||($a(),y)}:ne,p=[];for(let h of c){let y=f(h);y&&p.push(Ap(y))}return en(s,p)}function R_(e){if(!O)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=ne(e),{spanId:o}=e.spanContext(),i=mn(e),s=be(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:f}=ne(s);c.push(`root ID: ${s.spanContext().spanId}`),u&&c.push(`root op: ${u}`),f&&c.push(`root description: ${f}`)}C.log(`${l}
14
+ `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify($t(a))}o(l)}}return typeof r=="string"?r:yb(r)}function yb(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 Ap(e){return[{type:"span"},e]}function Mp(e){let t=typeof e.data=="string"?bp(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var T_={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 Sb(e){return e in T_}function Yc(e){return Sb(e)?T_[e]:e}function as(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function ja(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:xn(r)},...o&&{trace:o}}}function _b(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 I_(e,t,n,r){let o=as(n),i={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:xn(t)}},s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return en(i,[s])}function w_(e,t,n,r){let o=as(n),i=e.type&&e.type!=="replay_event"?e.type:"event";_b(e,n?.sdk);let s=ja(e,o,r,t);return delete e.sdkProcessingMetadata,en(s,[[{type:i},e]])}function C_(e,t){function n(h){return!!h.trace_id&&!!h.public_key}let r=ht(e[0]),o=t?.getDsn(),i=t?.getOptions().tunnel,s={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&o&&{dsn:xn(o)}},{beforeSendSpan:a,ignoreSpans:l}=t?.getOptions()||{},c=l?.length?e.filter(h=>{let y=ne(h);return!Wr({description:y.description,op:y.op,attributes:y.data},l)}):e,u=e.length-c.length;u&&t?.recordDroppedEvent("before_send","span",u);let f=a?h=>{let y=ne(h),_=Vc(a)?y:a(y);return _||($a(),y)}:ne,p=[];for(let h of c){let y=f(h);y&&p.push(Ap(y))}return en(s,p)}function R_(e){if(!O)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=ne(e),{spanId:o}=e.spanContext(),i=mn(e),s=be(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:f}=ne(s);c.push(`root ID: ${s.spanContext().spanId}`),u&&c.push(`root op: ${u}`),f&&c.push(`root description: ${f}`)}C.log(`${l}
15
15
  ${c.join(`
16
- `)}`)}function x_(e){if(!O)return;let{description:t="< unknown name >",op:n="< unknown op >"}=ne(e),{spanId:r}=e.spanContext(),i=be(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;C.log(s)}function Kc(e,t,n,r=Me()){let o=r&&be(r);o&&(O&&C.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[lr]:t,[ar]:n}))}function Jc(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},o=r[ar],i=r[lr];typeof o=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:o})}),t}function Mt(e){return e.getOptions().traceLifecycle==="stream"}var b_=1e3,To=class{constructor(t={}){this._traceId=t.traceId||Zt(),this._spanId=t.spanId||zt(),this._startTime=t.startTimestamp||Ae(),this._links=t.links,this._attributes={},this.setAttributes({[we]:"manual",[qe]: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?Oa:zc}}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=pn(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(vt,"custom"),this}end(t){this._endTime||(this._endTime=pn(t),x_(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[qe],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Ba(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[we],profile_id:this._attributes[ai],exclusive_time:this._attributes[jt],measurements:Jc(this._events),is_segment:this._isStandaloneSpan&&be(this)===this||void 0,segment_id:this._isStandaloneSpan?be(this).spanContext().spanId:void 0,links:Ua(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===be(this),status:xp(this._status),attributes:this._attributes,links:Rp(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){O&&C.log("[Tracing] Adding an event to span:",t);let o=k_(n)?n:r||Ae(),i=k_(n)?{}:n||{},s={name:t,time:pn(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===be(this)))return;if(this._isStandaloneSpan){this._sampled?vb(C_([this],t)):(O&&C.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Mt(t)){t.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(li(this).scope||te()).captureEvent(r)}_convertSpanToTransaction(){if(!N_(ne(this)))return;this._name||(O&&C.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:t,isolationScope:n}=li(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=jr(this).filter(f=>f!==this&&!_b(f)).map(f=>ne(f)).filter(N_),s=this._attributes[vt];delete this._attributes[ns];let a=!1;i.forEach(f=>{delete f.data[ns],f.op?.startsWith("gen_ai.")&&(a=!0)});let l={contexts:{trace:d_(this)},spans:i.length>b_?i.sort((f,p)=>f.start_timestamp-p.start_timestamp).slice(0,b_):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ht(this),hasGenAiSpans:a},request:r,...s&&{transaction_info:{source:s}}},c=Jc(this._events);return c&&Object.keys(c).length&&(O&&C.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),l.measurements=c),l}};function k_(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function N_(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function _b(e){return e instanceof To&&e.isStandaloneSpan()}function vb(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 A_(e,t,n){if(!Et(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=bn(o);if(i===void 0)return O&&C.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 O&&C.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||O&&C.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[s,i,r]}var Pp="__SENTRY_SUPPRESS_TRACING__";function wt(e){let t=P_();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=Tb(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?s=>$n(e.scope,s):o!==void 0?s=>ls(o,s):s=>s())(()=>{let s=te(),a=wb(s,o),l=$();return e.onlyIfParent&&!a?(l?.recordDroppedEvent("no_parent_span","span"),new At):Eb({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}function ls(e,t){let n=P_();return n.withActiveSpan?n.withActiveSpan(e,t):$n(r=>(Eo(r,e||void 0),t(r)))}function Eb({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Et()){let a=new At;if(n||!e){let l={sampled:"false",sample_rate:"0",transaction:t.name,...ht(a)};is(a,l)}return a}let o=$();if(Cb(o,t))return Lp(r)||o?.recordDroppedEvent("ignored","span"),new At({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let i=Xe(),s;if(e&&!n)s=Ib(e,r,t),Ha(e,s);else if(e){let a=ht(e),{traceId:l,spanId:c}=e.spanContext(),u=mn(e);s=M_({traceId:l,parentSpanId:c,...t},r,u),is(s,a)}else{let{traceId:a,dsc:l,parentSpanId:c,sampled:u}={...i.getPropagationContext(),...r.getPropagationContext()};s=M_({traceId:a,parentSpanId:c,...t},r,u),l&&is(s,l)}return R_(s),r_(s,r,i),s}function Tb(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...n};return r.startTimestamp=pn(e.startTime),delete r.startTime,r}return n}function P_(){let e=Rn();return Tr(e)}function M_(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=Lp(t),[f,p,h]=u?[!1]:A_(o,{name:i,parentSampled:a,attributes:l,parentSampleRate:bn(c.dsc?.sample_rate)},c.sampleRand),y=new To({...e,attributes:{[vt]:"custom",[$r]:p!==void 0&&h?p:void 0,...l},sampled:f});return!f&&r&&!u&&(O&&C.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Mt(r)?"span":"transaction")),r&&r.emit("spanStart",y),y}function Ib(e,t,n){let{spanId:r,traceId:o}=e.spanContext(),i=Lp(t),s=i?!1:mn(e),a=s?new To({...n,parentSpanId:r,traceId:o,sampled:s}):new At({traceId:o});Ha(e,a);let l=$();return l&&(Mt(l)&&a instanceof At&&(e instanceof At&&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 wb(e,t){if(t)return t;if(t===null)return;let n=si(e);if(!n)return;let r=$();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?be(n):n}function Cb(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Mt(e)||!n?.length?!1:Wr({description:t.name||"",op:t.attributes?.[qe]||t.op,attributes:t.attributes},n)}function Lp(e){return e.getScopeData().sdkProcessingMetadata[Pp]===!0}var cs={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Rb="heartbeatFailed",xb="idleTimeout",bb="finalTimeout",kb="externalFinish";function Xc(e,t={}){let n=new Map,r=!1,o,i=kb,s=!t.disableAutoFinish,a=[],{idleTimeout:l=cs.idleTimeout,finalTimeout:c=cs.finalTimeout,childSpanTimeout:u=cs.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:p=!0}=t,h=$();if(!h||!Et()){let I=new At,N={sample_rate:"0",sampled:"false",...ht(I)};return is(I,N),I}let y=te(),_=Me(),T=Nb(e);T.end=new Proxy(T.end,{apply(I,N,U){if(f&&f(T),N instanceof At)return;let[x,...H]=U,j=x||Ae(),ge=pn(j),X=jr(T).filter(Q=>Q!==T),Ze=ne(T);if(!X.length||!p)return A(ge),Reflect.apply(I,N,[ge,...H]);let fe=h.getOptions().ignoreSpans,de=X?.reduce((Q,ae)=>{let Re=ne(ae);return!Re.timestamp||fe&&Wr({description:Re.description,op:Re.op,attributes:Re.data},fe)?Q:Q?Math.max(Q,Re.timestamp):Re.timestamp},void 0),D=Ze.start_timestamp,ye=Math.min(D?D+c/1e3:1/0,Math.max(D||-1/0,Math.min(ge,de||1/0)));return A(ye),Reflect.apply(I,N,[ye,...H])}});function g(){o&&(clearTimeout(o),o=void 0)}function S(I){g(),o=setTimeout(()=>{!r&&n.size===0&&s&&(i=xb,T.end(I))},l)}function E(I){o=setTimeout(()=>{!r&&s&&(i=Rb,T.end(I))},u)}function R(I){g(),n.set(I,!0);let N=Ae();E(N+u/1e3)}function M(I){if(n.has(I)&&n.delete(I),n.size===0){let N=Ae();S(N+l/1e3)}}function A(I){r=!0,n.clear(),a.forEach(X=>X()),Eo(y,_);let N=ne(T),{start_timestamp:U}=N;if(!U)return;N.data[zr]||T.setAttribute(zr,i);let H=N.status;(!H||H==="unknown")&&T.setStatus({code:1}),C.log(`[Tracing] Idle span "${N.op}" finished`);let j=jr(T).filter(X=>X!==T),ge=0;j.forEach(X=>{X.isRecording()&&(X.setStatus({code:2,message:"cancelled"}),X.end(I),O&&C.log("[Tracing] Cancelling span since span ended early",JSON.stringify(X,void 0,2)));let Ze=ne(X),{timestamp:fe=0,start_timestamp:de=0}=Ze,D=de<=I,ye=(c+l)/1e3,Q=fe-de<=ye;if(O){let ae=JSON.stringify(X,void 0,2);D?Q||C.log("[Tracing] Discarding span since it finished after idle span final timeout",ae):C.log("[Tracing] Discarding span since it happened after idle span was finished",ae)}(!Q||!D)&&(y_(T,X),ge++)}),ge>0&&T.setAttribute("sentry.idle_span_discarded_spans",ge)}return a.push(h.on("spanStart",I=>{if(r||I===T||ne(I).timestamp||I instanceof To&&I.isStandaloneSpan())return;jr(T).includes(I)&&R(I.spanContext().spanId)})),a.push(h.on("spanEnd",I=>{r||M(I.spanContext().spanId)})),a.push(h.on("idleSpanEnableAutoFinish",I=>{I===T&&(s=!0,S(),n.size&&E())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(T.setStatus({code:2,message:"deadline_exceeded"}),i=bb,T.end())},c),T}function Nb(e){let t=wt(e);return Eo(te(),t),O&&C.log("[Tracing] Started span is an idle span"),t}function O_(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;Ab(e,t),r&&Lb(e,r),Ob(e,n),Mb(e,o),Pb(e,i)}function L_(e,t){let{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:f,attachments:p,propagationContext:h,transactionName:y,span:_}=t;Wa(e,"extra",n),Wa(e,"tags",r),Wa(e,"attributes",o),Wa(e,"user",i),Wa(e,"contexts",s),e.sdkProcessingMetadata=vo(e.sdkProcessingMetadata,l,2),a&&(e.level=a),y&&(e.transactionName=y),_&&(e.span=_),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function Wa(e,t,n){e[t]=vo(e[t],n,1)}function Qc(e,t){let n=Na().getScopeData();return e&&L_(n,e.getScopeData()),t&&L_(n,t.getScopeData()),n}function Ab(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 Mb(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Pb(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Lb(e,t){e.contexts={trace:jc(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ht(t),...e.sdkProcessingMetadata};let n=be(t),r=ne(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Ob(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 Db="thismessage:/";function di(e){return"isRelative"in e}function Ir(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?Db: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 us(e){if(di(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 zn(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 Zc(e){return e.split(/[?#]/,1)[0]}function Wt(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 Io(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}var Op=0,D_=1,U_=2;function wr(e){return new Ga(t=>{t(e)})}function fi(e){return new Ga((t,n)=>{n(e)})}var Ga=class e{constructor(t){this._state=Op,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===Op)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===D_&&n[1](this._value),this._state===U_&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===Op){if(or(s)){s.then(r,o);return}this._state=i,this._value=s,this._executeHandlers()}},r=i=>{n(D_,i)},o=i=>{n(U_,i)};try{t(r,o)}catch(i){o(i)}}};function F_(e,t,n,r=0){try{let o=Dp(t,n,e,r);return or(o)?o:wr(o)}catch(o){return fi(o)}}function Dp(e,t,n,r){let o=n[r];if(!e||!o)return e;let i=o({...e},t);return O&&i===null&&C.log(`Event processor "${o.id||"?"}" dropped event`),or(i)?i.then(s=>Dp(s,t,n,r+1)):Dp(i,t,n,r+1)}var pi,B_,H_,wo;function $_(e){let t=G._sentryDebugIds,n=G._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(wo&&r.length===B_&&o.length===H_)return wo;B_=r.length,H_=o.length,wo={},pi||(pi={});let i=(s,a)=>{for(let l of s){let c=a[l],u=pi?.[l];if(u&&wo&&c)wo[u[0]]=c,pi&&(pi[l]=[u[0],c]);else if(c){let f=e(l);for(let p=f.length-1;p>=0;p--){let y=f[p]?.filename;if(y&&wo&&pi){wo[y]=c,pi[l]=[y,c];break}}}}};return t&&i(r,t),n&&i(o,n),wo}function Va(e,t,n,r,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||at(),timestamp:t.timestamp||dn()},c=n.integrations||e.integrations.map(g=>g.name);Ub(l,e),Hb(l,c),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Fb(l,e.stackParser);let u=zb(r,n.captureContext);n.mechanism&&Hn(l,n.mechanism);let f=o?o.getEventProcessors():[],p=Qc(i,u),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),O_(l,p);let y=[...f,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?wr(l):F_(y,l,n)).then(g=>(g&&Bb(g),typeof s=="number"&&s>0?$b(g,s,a):g))}function Ub(e,t){let{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||os,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let s=e.request;s?.url&&i&&(s.url=oi(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=oi(a.value,i))})}function Fb(e,t){let n=$_(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Bb(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 Hb(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function $b(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:$t(o.data,t,n)}}))},...e.user&&{user:$t(e.user,t,n)},...e.contexts&&{contexts:$t(e.contexts,t,n)},...e.extra&&{extra:$t(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=$t(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:$t(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=$t(e.contexts.flags,3,n)),r}function zb(e,t){if(!t)return e;let n=e?e.clone():new fn;return n.update(t),n}function z_(e){if(e)return jb(e)?{captureContext:e}:Gb(e)?{captureContext:e}:e}function jb(e){return e instanceof fn||typeof e=="function"}var Wb=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Gb(e){return Object.keys(e).some(t=>Wb.includes(t))}function Gr(e,t){return te().captureException(e,z_(t))}function ds(e,t){return te().captureEvent(e,t)}function mi(e,t){Xe().setContext(e,t)}function qa(){return Xe().lastEventId()}function Ya(){let e=$();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Ka(e){Xe().addEventProcessor(e)}function fs(e){let t=Xe(),{user:n}=Qc(t,te()),{userAgent:r}=G.navigator||{},o=GS({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return i?.status==="ok"&&Hr(i,{status:"exited"}),Ja(),t.setSession(o),o}function Ja(){let e=Xe(),n=te().getSession()||e.getSession();n&&VS(n),j_(),e.setSession()}function j_(){let e=Xe(),t=$(),n=e.getSession();n&&t&&t.captureSession(n)}function hi(e=!1){if(e){Ja();return}j_()}var W_="7";function G_(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Vb(e){return`${G_(e)}${e.projectId}/envelope/`}function qb(e,t){let n={sentry_version:W_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Fp(e,t,n){return t||`${Vb(e)}?${qb(e,n)}`}function Bp(e,t){let n=Hc(e);if(!n)return"";let r=`${G_(n)}embed/error-page/`,o=`dsn=${xn(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 Hp=[];function Yb(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 $p(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 Yb(r)}function V_(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&jp(e,r,n)}),n}function zp(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function jp(e,t,n){if(n[t.name]){O&&C.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Hp.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Hp.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))}),O&&C.log(`Integration installed: ${t.name}`)}function Wp(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Gp(){return"npm"}function q_(){return!Wp()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function jn(){return typeof window<"u"&&(!q_()||Kb())}function Kb(){return G.process?.type==="renderer"}function Jb(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...jn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Y_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=xn(r)),en(i,[Jb(e,o)])}function ps(e,t){let n=t??Xb(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Y_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);K_().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Xb(e){return K_().get(e)}function K_(){return rr("clientToLogBufferMap",()=>new WeakMap)}function Qb(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,...jn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function J_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=xn(r)),en(i,[Qb(e,o)])}function Xa(e,t){let n=t??Zb(e)??[];if(n.length===0)return;let r=e.getOptions(),o=J_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);X_().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function Zb(e){return X_().get(e)}function X_(){return rr("clientToMetricBufferMap",()=>new WeakMap)}function Q_(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 m_(t)}function Z_(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||Mt(t))return;let n=[],r=[];for(let i of e.spans)i.op?.startsWith("gen_ai.")?n.push(Q_(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,...jn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}function eu(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var ms=Symbol.for("SentryBufferFullError");function gi(e=100){let t=new Set;function n(){return t.size<e}function r(s){t.delete(s)}function o(s){if(!n())return fi(ms);let a=s();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function i(s){if(!t.size)return wr(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let l=[a,new Promise(c=>eu(setTimeout(()=>c(!1),s)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:i}}var ev=60*1e3;function tv(e,t=ri()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?ev:r-t}function nv(e,t){return e[t]||e.all||0}function Qa(e,t,n=ri()){return nv(e,t)>n}function Za(e,{statusCode:t,headers:n},r=ri()){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),f=parseInt(l,10),p=(isNaN(f)?60:f)*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+tv(s,r):t===429&&(o.all=r+60*1e3);return o}var Vp=64;function tu(e,t,n=gi(e.bufferSize||Vp)){let r={},o=s=>n.drain(s);function i(s){let a=[];if(za(s,(f,p)=>{let h=Yc(p);Qa(r,h)?e.recordDroppedEvent("ratelimit_backoff",h):a.push(f)}),a.length===0)return Promise.resolve({});let l=en(s[0],a),c=f=>{if(kp(l,["client_report"])){O&&C.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}za(l,(p,h)=>{e.recordDroppedEvent(f,Yc(h))})},u=()=>t({body:Np(l)}).then(f=>f.statusCode===413?(O&&C.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),f):(O&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&C.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=Za(r,f),f),f=>{throw c("network_error"),O&&C.error("Encountered error running transport request:",f),f});return n.add(u).then(f=>f,f=>{if(f===ms)return O&&C.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw f})}return{send:i,flush:o}}function rv(e,t,n){let r=[{type:"client_report"},{timestamp:n||dn(),discarded_events:e}];return en(t?{dsn:t}:{},[r])}function nu(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 ov(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?.[ai],exclusive_time:s?.[jt],measurements:e.measurements,is_segment:!0}}function iv(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&&{[ai]:e.profile_id},...e.exclusive_time&&{[jt]:e.exclusive_time}}}},measurements:e.measurements}}var el=["forwarded","-ip","remote-","via","-user"];function sv(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:el},httpHeaders:{request:{deny:el},response:{deny:el}},httpBodies:[],queryParams:{deny:el},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:5}}var ek={userInfo:!1,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function av(e){let t=e.dataCollection!=null?ek:sv(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 lv="Not capturing exception because it's already been captured.",cv="Discarded session because of missing or non-string release",hv=Symbol.for("SentryInternalError"),gv=Symbol.for("SentryDoNotSendEventError"),tk=5e3;function ru(e){return{message:e,[hv]:!0}}function qp(e){return{message:e,[gv]:!0}}function uv(e){return!!e&&typeof e=="object"&&hv in e}function dv(e){return!!e&&typeof e=="object"&&gv in e}function fv(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??tk;c>0&&(a=!0,s=eu(setTimeout(()=>{o(e)},c)))}}),e.on("flush",()=>{o(e)})}var tl=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=gi(t.transportOptions?.bufferSize??Vp),this._dataCollection=av(t),t.dsn?this._dsn=Hc(t.dsn):O&&C.warn("No DSN provided, client will not send events."),this._dsn){let r=Fp(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&&fv(this,"afterCaptureLog","flushLogs",ik,ps),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&fv(this,"afterCaptureMetric","flushMetrics",ok,Xa)}captureException(t,n,r){let o=at();if(ka(t))return O&&C.log(lv),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:at(),...r},s=go(t)?t:String(t),a=un(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=at();if(n?.originalException&&ka(n.originalException))return O&&C.log(lv),o;let i={event_id:o,...n},s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,l=s.capturedSpanIsolationScope,c=pv(t.type);return this._process(()=>this._captureEvent(t,i,a||r,l),c),i.event_id}captureSession(t){this.sendSession(t),Hr(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){ps(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),jp(this,t,this._integrations),n||zp(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Z_(t,this),o=w_(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=qc(o,Mp(i));r&&(o=qc(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){let{release:n,environment:r=os}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){O&&C.warn(cv);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){O&&C.warn(cv);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=I_(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}`;O&&C.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 O&&C.error("Error while sending envelope:",n),{}}return O&&C.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=V_(this,t),zp(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)&&(Hr(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),Va(i,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Dc(r)},...a.contexts};let l=ss(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=te(),o=Xe()){return O&&Yp(t)&&C.log(`Captured error event \`${nu(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(i=>i.event_id,i=>{O&&(dv(i)?C.log(i.message):uv(i)?C.warn(i.message):C.warn(i))})}_processEvent(t,n,r,o){let i=this.getOptions(),{sampleRate:s}=i,a=yv(t),l=Yp(t),u=`before send for type \`${t.type||"error"}\``,f=typeof s>"u"?void 0:bn(s);if(l&&typeof f=="number"&&Bn()>f)return this.recordDroppedEvent("sample_rate","error"),fi(qp(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let p=pv(t.type);return this._prepareEvent(t,n,r,o).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",p),qp("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return h;let _=rk(this,i,h,n);return nk(_,u)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",p),a){let g=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",g)}throw qp(`${u} returned \`null\`, will not send event.`)}let y=r.getSession()||o.getSession();if(l&&y&&this._updateSessionFromEvent(y,h),a){let T=h.sdkProcessingMetadata?.spanCountBeforeProcessing||0,g=h.spans?h.spans.length:0,S=T-g;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 dv(h)||uv(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),ru(`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===ms&&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(){O&&C.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){O&&C.log("No outcomes to send");return}if(!this._dsn){O&&C.log("No dsn provided, will not send outcomes");return}O&&C.log("Sending outcomes:",t);let n=rv(t,this._options.tunnel&&xn(this._dsn));this.sendEnvelope(n)}};function pv(e){return e==="replay_event"?"replay":e||"error"}function nk(e,t){let n=`${t} must return \`null\` or a valid event.`;if(or(e))return e.then(r=>{if(!Fn(r)&&r!==null)throw ru(n);return r},r=>{throw ru(`${t} rejected with ${r}`)});if(!Fn(e)&&e!==null)throw ru(n);return e}function rk(e,t,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=!Vc(t.beforeSendSpan)&&t.beforeSendSpan,l=n;if(Yp(l)&&o)return o(l,r);if(yv(l)){if(a||s){let c=ov(l);if(s?.length&&Wr({description:c.description,op:c.op,attributes:c.data},s))return null;if(a){let u=a(c);u?l=vo(n,iv(u)):$a()}if(l.spans){let u=[],f=l.spans;for(let h of f){if(s?.length&&Wr({description:h.description,op:h.op,attributes:h.data},s)){v_(f,h);continue}if(a){let y=a(h);y?u.push(y):($a(),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 Yp(e){return e.type===void 0}function yv(e){return e.type==="transaction"}function ok(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Sv(e.attributes)}function ik(e){let t=0;return e.message&&(t+=e.message.length*2),t+Sv(e.attributes)}function Sv(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*mv(n[0]):un(n)?t+=mv(n):t+=100}),t}function mv(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Kp(e,t){t.debug===!0&&(O?C.enable():kt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),te().update(t.initialScope);let r=new e(t);return Jp(r),r.init(),r}function Jp(e){te().setClient(e)}function Xp(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return ak(e,n)||sk(e,r)}function sk(e,t){return t?_v(e)===_v(t):!1}function ak(e,t){let n=Ir(e);return!n||di(n)||!t?!1:lk(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function lk(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function _v(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Qp(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 nl(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:Er})),o.version=Er)}function hs(e={}){let t=e.client||$();if(!Ya()||!t)return{};let n=Rn(),r=Tr(n);if(r.getTraceData)return r.getTraceData(e);let o=e.scope||te(),i=e.span||Me();if(!i&&Oc())return{};let s=i?Da(i):ck(o),a=i?ht(i):ss(t,o),l=Tp(a);if(!$c.test(s))return C.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let u={"sentry-trace":s,baggage:l};return e.propagateTraceparent&&(u.traceparent=i?f_(i):uk(o)),u}function ck(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ma(t,r,n)}function uk(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Pa(t,r,n)}function Zp(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 f(){return o&&clearTimeout(o),o=a(l,t),s&&i===void 0&&(i=a(l,s)),r}return f.cancel=c,f.flush=u,f}var dk=100;function kn(e,t){let n=$(),r=Xe();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=dk}=n.getOptions();if(i<=0)return;let a={timestamp:dn(),...e},l=o?kt(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,i))}var vv,fk="FunctionToString",Ev=new WeakMap,pk=(()=>({name:fk,setupOnce(){vv=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=So(this),n=Ev.has($())&&t!==void 0?t:this;return vv.apply(n,e)}}catch{}},setup(e){Ev.set(e,!0)}})),ou=pk;var mk=[/^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$/],hk="EventFilters",em=(e={})=>{let t;return{name:hk,setup(n){let r=n.getOptions();t=Tv(e,r)},processEvent(n,r,o){if(!t){let i=o.getOptions();t=Tv(e,i)}return gk(n,t)?null:n}}},su=((e={})=>({...em(e),name:"InboundFilters"}));function Tv(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:mk],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function gk(e,t){if(e.type){if(e.type==="transaction"&&Sk(e,t.ignoreTransactions))return O&&C.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
18
- Event: ${sr(e)}`),!0}else{if(yk(e,t.ignoreErrors))return O&&C.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
19
- Event: ${sr(e)}`),!0;if(Tk(e))return O&&C.warn(`Event dropped due to not having an error message, error type or stacktrace.
20
- Event: ${sr(e)}`),!0;if(_k(e,t.denyUrls))return O&&C.warn(`Event dropped due to being matched by \`denyUrls\` option.
16
+ `)}`)}function x_(e){if(!O)return;let{description:t="< unknown name >",op:n="< unknown op >"}=ne(e),{spanId:r}=e.spanContext(),i=be(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;C.log(s)}function Kc(e,t,n,r=Me()){let o=r&&be(r);o&&(O&&C.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[lr]:t,[ar]:n}))}function Jc(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},o=r[ar],i=r[lr];typeof o=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:o})}),t}function Mt(e){return e.getOptions().traceLifecycle==="stream"}var b_=1e3,To=class{constructor(t={}){this._traceId=t.traceId||Zt(),this._spanId=t.spanId||zt(),this._startTime=t.startTimestamp||Ae(),this._links=t.links,this._attributes={},this.setAttributes({[we]:"manual",[qe]: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?Oa:zc}}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=pn(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(vt,"custom"),this}end(t){this._endTime||(this._endTime=pn(t),x_(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[qe],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Ba(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[we],profile_id:this._attributes[ai],exclusive_time:this._attributes[jt],measurements:Jc(this._events),is_segment:this._isStandaloneSpan&&be(this)===this||void 0,segment_id:this._isStandaloneSpan?be(this).spanContext().spanId:void 0,links:Ua(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===be(this),status:xp(this._status),attributes:this._attributes,links:Rp(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){O&&C.log("[Tracing] Adding an event to span:",t);let o=k_(n)?n:r||Ae(),i=k_(n)?{}:n||{},s={name:t,time:pn(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===be(this)))return;if(this._isStandaloneSpan){this._sampled?Eb(C_([this],t)):(O&&C.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Mt(t)){t.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(li(this).scope||te()).captureEvent(r)}_convertSpanToTransaction(){if(!N_(ne(this)))return;this._name||(O&&C.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:t,isolationScope:n}=li(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=jr(this).filter(f=>f!==this&&!vb(f)).map(f=>ne(f)).filter(N_),s=this._attributes[vt];delete this._attributes[ns];let a=!1;i.forEach(f=>{delete f.data[ns],f.op?.startsWith("gen_ai.")&&(a=!0)});let l={contexts:{trace:d_(this)},spans:i.length>b_?i.sort((f,p)=>f.start_timestamp-p.start_timestamp).slice(0,b_):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ht(this),hasGenAiSpans:a},request:r,...s&&{transaction_info:{source:s}}},c=Jc(this._events);return c&&Object.keys(c).length&&(O&&C.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),l.measurements=c),l}};function k_(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function N_(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function vb(e){return e instanceof To&&e.isStandaloneSpan()}function Eb(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 A_(e,t,n){if(!Et(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=bn(o);if(i===void 0)return O&&C.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 O&&C.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||O&&C.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[s,i,r]}var Pp="__SENTRY_SUPPRESS_TRACING__";function wt(e){let t=P_();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=Ib(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?s=>$n(e.scope,s):o!==void 0?s=>ls(o,s):s=>s())(()=>{let s=te(),a=Cb(s,o),l=$();return e.onlyIfParent&&!a?(l?.recordDroppedEvent("no_parent_span","span"),new At):Tb({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}function ls(e,t){let n=P_();return n.withActiveSpan?n.withActiveSpan(e,t):$n(r=>(Eo(r,e||void 0),t(r)))}function Tb({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Et()){let a=new At;if(n||!e){let l={sampled:"false",sample_rate:"0",transaction:t.name,...ht(a)};is(a,l)}return a}let o=$();if(Rb(o,t))return Lp(r)||o?.recordDroppedEvent("ignored","span"),new At({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let i=Xe(),s;if(e&&!n)s=wb(e,r,t),Ha(e,s);else if(e){let a=ht(e),{traceId:l,spanId:c}=e.spanContext(),u=mn(e);s=M_({traceId:l,parentSpanId:c,...t},r,u),is(s,a)}else{let{traceId:a,dsc:l,parentSpanId:c,sampled:u}={...i.getPropagationContext(),...r.getPropagationContext()};s=M_({traceId:a,parentSpanId:c,...t},r,u),l&&is(s,l)}return R_(s),r_(s,r,i),s}function Ib(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...n};return r.startTimestamp=pn(e.startTime),delete r.startTime,r}return n}function P_(){let e=Rn();return Tr(e)}function M_(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=Lp(t),[f,p,h]=u?[!1]:A_(o,{name:i,parentSampled:a,attributes:l,parentSampleRate:bn(c.dsc?.sample_rate)},c.sampleRand),y=new To({...e,attributes:{[vt]:"custom",[$r]:p!==void 0&&h?p:void 0,...l},sampled:f});return!f&&r&&!u&&(O&&C.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Mt(r)?"span":"transaction")),r&&r.emit("spanStart",y),y}function wb(e,t,n){let{spanId:r,traceId:o}=e.spanContext(),i=Lp(t),s=i?!1:mn(e),a=s?new To({...n,parentSpanId:r,traceId:o,sampled:s}):new At({traceId:o});Ha(e,a);let l=$();return l&&(Mt(l)&&a instanceof At&&(e instanceof At&&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 Cb(e,t){if(t)return t;if(t===null)return;let n=si(e);if(!n)return;let r=$();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?be(n):n}function Rb(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Mt(e)||!n?.length?!1:Wr({description:t.name||"",op:t.attributes?.[qe]||t.op,attributes:t.attributes},n)}function Lp(e){return e.getScopeData().sdkProcessingMetadata[Pp]===!0}var cs={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},xb="heartbeatFailed",bb="idleTimeout",kb="finalTimeout",Nb="externalFinish";function Xc(e,t={}){let n=new Map,r=!1,o,i=Nb,s=!t.disableAutoFinish,a=[],{idleTimeout:l=cs.idleTimeout,finalTimeout:c=cs.finalTimeout,childSpanTimeout:u=cs.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:p=!0}=t,h=$();if(!h||!Et()){let I=new At,N={sample_rate:"0",sampled:"false",...ht(I)};return is(I,N),I}let y=te(),_=Me(),T=Ab(e);T.end=new Proxy(T.end,{apply(I,N,U){if(f&&f(T),N instanceof At)return;let[x,...H]=U,j=x||Ae(),he=pn(j),X=jr(T).filter(Q=>Q!==T),Ze=ne(T);if(!X.length||!p)return A(he),Reflect.apply(I,N,[he,...H]);let fe=h.getOptions().ignoreSpans,de=X?.reduce((Q,ae)=>{let Re=ne(ae);return!Re.timestamp||fe&&Wr({description:Re.description,op:Re.op,attributes:Re.data},fe)?Q:Q?Math.max(Q,Re.timestamp):Re.timestamp},void 0),D=Ze.start_timestamp,ge=Math.min(D?D+c/1e3:1/0,Math.max(D||-1/0,Math.min(he,de||1/0)));return A(ge),Reflect.apply(I,N,[ge,...H])}});function g(){o&&(clearTimeout(o),o=void 0)}function S(I){g(),o=setTimeout(()=>{!r&&n.size===0&&s&&(i=bb,T.end(I))},l)}function E(I){o=setTimeout(()=>{!r&&s&&(i=xb,T.end(I))},u)}function R(I){g(),n.set(I,!0);let N=Ae();E(N+u/1e3)}function M(I){if(n.has(I)&&n.delete(I),n.size===0){let N=Ae();S(N+l/1e3)}}function A(I){r=!0,n.clear(),a.forEach(X=>X()),Eo(y,_);let N=ne(T),{start_timestamp:U}=N;if(!U)return;N.data[zr]||T.setAttribute(zr,i);let H=N.status;(!H||H==="unknown")&&T.setStatus({code:1}),C.log(`[Tracing] Idle span "${N.op}" finished`);let j=jr(T).filter(X=>X!==T),he=0;j.forEach(X=>{X.isRecording()&&(X.setStatus({code:2,message:"cancelled"}),X.end(I),O&&C.log("[Tracing] Cancelling span since span ended early",JSON.stringify(X,void 0,2)));let Ze=ne(X),{timestamp:fe=0,start_timestamp:de=0}=Ze,D=de<=I,ge=(c+l)/1e3,Q=fe-de<=ge;if(O){let ae=JSON.stringify(X,void 0,2);D?Q||C.log("[Tracing] Discarding span since it finished after idle span final timeout",ae):C.log("[Tracing] Discarding span since it happened after idle span was finished",ae)}(!Q||!D)&&(y_(T,X),he++)}),he>0&&T.setAttribute("sentry.idle_span_discarded_spans",he)}return a.push(h.on("spanStart",I=>{if(r||I===T||ne(I).timestamp||I instanceof To&&I.isStandaloneSpan())return;jr(T).includes(I)&&R(I.spanContext().spanId)})),a.push(h.on("spanEnd",I=>{r||M(I.spanContext().spanId)})),a.push(h.on("idleSpanEnableAutoFinish",I=>{I===T&&(s=!0,S(),n.size&&E())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(T.setStatus({code:2,message:"deadline_exceeded"}),i=kb,T.end())},c),T}function Ab(e){let t=wt(e);return Eo(te(),t),O&&C.log("[Tracing] Started span is an idle span"),t}function O_(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;Mb(e,t),r&&Ob(e,r),Db(e,n),Pb(e,o),Lb(e,i)}function L_(e,t){let{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:f,attachments:p,propagationContext:h,transactionName:y,span:_}=t;Wa(e,"extra",n),Wa(e,"tags",r),Wa(e,"attributes",o),Wa(e,"user",i),Wa(e,"contexts",s),e.sdkProcessingMetadata=vo(e.sdkProcessingMetadata,l,2),a&&(e.level=a),y&&(e.transactionName=y),_&&(e.span=_),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function Wa(e,t,n){e[t]=vo(e[t],n,1)}function Qc(e,t){let n=Na().getScopeData();return e&&L_(n,e.getScopeData()),t&&L_(n,t.getScopeData()),n}function Mb(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 Pb(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Lb(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Ob(e,t){e.contexts={trace:jc(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ht(t),...e.sdkProcessingMetadata};let n=be(t),r=ne(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Db(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 Ub="thismessage:/";function di(e){return"isRelative"in e}function Ir(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?Ub: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 us(e){if(di(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 zn(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 Zc(e){return e.split(/[?#]/,1)[0]}function Wt(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 Io(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}var Op=0,D_=1,U_=2;function wr(e){return new Ga(t=>{t(e)})}function fi(e){return new Ga((t,n)=>{n(e)})}var Ga=class e{constructor(t){this._state=Op,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===Op)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===D_&&n[1](this._value),this._state===U_&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===Op){if(or(s)){s.then(r,o);return}this._state=i,this._value=s,this._executeHandlers()}},r=i=>{n(D_,i)},o=i=>{n(U_,i)};try{t(r,o)}catch(i){o(i)}}};function F_(e,t,n,r=0){try{let o=Dp(t,n,e,r);return or(o)?o:wr(o)}catch(o){return fi(o)}}function Dp(e,t,n,r){let o=n[r];if(!e||!o)return e;let i=o({...e},t);return O&&i===null&&C.log(`Event processor "${o.id||"?"}" dropped event`),or(i)?i.then(s=>Dp(s,t,n,r+1)):Dp(i,t,n,r+1)}var pi,B_,H_,wo;function $_(e){let t=G._sentryDebugIds,n=G._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(wo&&r.length===B_&&o.length===H_)return wo;B_=r.length,H_=o.length,wo={},pi||(pi={});let i=(s,a)=>{for(let l of s){let c=a[l],u=pi?.[l];if(u&&wo&&c)wo[u[0]]=c,pi&&(pi[l]=[u[0],c]);else if(c){let f=e(l);for(let p=f.length-1;p>=0;p--){let y=f[p]?.filename;if(y&&wo&&pi){wo[y]=c,pi[l]=[y,c];break}}}}};return t&&i(r,t),n&&i(o,n),wo}function Va(e,t,n,r,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||at(),timestamp:t.timestamp||dn()},c=n.integrations||e.integrations.map(g=>g.name);Fb(l,e),$b(l,c),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Bb(l,e.stackParser);let u=jb(r,n.captureContext);n.mechanism&&Hn(l,n.mechanism);let f=o?o.getEventProcessors():[],p=Qc(i,u),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),O_(l,p);let y=[...f,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?wr(l):F_(y,l,n)).then(g=>(g&&Hb(g),typeof s=="number"&&s>0?zb(g,s,a):g))}function Fb(e,t){let{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||os,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let s=e.request;s?.url&&i&&(s.url=oi(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=oi(a.value,i))})}function Bb(e,t){let n=$_(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Hb(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 $b(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function zb(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:$t(o.data,t,n)}}))},...e.user&&{user:$t(e.user,t,n)},...e.contexts&&{contexts:$t(e.contexts,t,n)},...e.extra&&{extra:$t(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=$t(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:$t(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=$t(e.contexts.flags,3,n)),r}function jb(e,t){if(!t)return e;let n=e?e.clone():new fn;return n.update(t),n}function z_(e){if(e)return Wb(e)?{captureContext:e}:Vb(e)?{captureContext:e}:e}function Wb(e){return e instanceof fn||typeof e=="function"}var Gb=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Vb(e){return Object.keys(e).some(t=>Gb.includes(t))}function Gr(e,t){return te().captureException(e,z_(t))}function ds(e,t){return te().captureEvent(e,t)}function mi(e,t){Xe().setContext(e,t)}function qa(){return Xe().lastEventId()}function Ya(){let e=$();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Ka(e){Xe().addEventProcessor(e)}function fs(e){let t=Xe(),{user:n}=Qc(t,te()),{userAgent:r}=G.navigator||{},o=GS({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return i?.status==="ok"&&Hr(i,{status:"exited"}),Ja(),t.setSession(o),o}function Ja(){let e=Xe(),n=te().getSession()||e.getSession();n&&VS(n),j_(),e.setSession()}function j_(){let e=Xe(),t=$(),n=e.getSession();n&&t&&t.captureSession(n)}function hi(e=!1){if(e){Ja();return}j_()}var W_="7";function G_(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function qb(e){return`${G_(e)}${e.projectId}/envelope/`}function Yb(e,t){let n={sentry_version:W_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Fp(e,t,n){return t||`${qb(e)}?${Yb(e,n)}`}function Bp(e,t){let n=Hc(e);if(!n)return"";let r=`${G_(n)}embed/error-page/`,o=`dsn=${xn(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 Hp=[];function Kb(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 $p(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 Kb(r)}function V_(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&jp(e,r,n)}),n}function zp(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function jp(e,t,n){if(n[t.name]){O&&C.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Hp.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Hp.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))}),O&&C.log(`Integration installed: ${t.name}`)}function Wp(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Gp(){return"npm"}function q_(){return!Wp()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function jn(){return typeof window<"u"&&(!q_()||Jb())}function Jb(){return G.process?.type==="renderer"}function Xb(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...jn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Y_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=xn(r)),en(i,[Xb(e,o)])}function ps(e,t){let n=t??Qb(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Y_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);K_().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Qb(e){return K_().get(e)}function K_(){return rr("clientToLogBufferMap",()=>new WeakMap)}function Zb(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,...jn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function J_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=xn(r)),en(i,[Zb(e,o)])}function Xa(e,t){let n=t??ek(e)??[];if(n.length===0)return;let r=e.getOptions(),o=J_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);X_().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function ek(e){return X_().get(e)}function X_(){return rr("clientToMetricBufferMap",()=>new WeakMap)}function Q_(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 m_(t)}function Z_(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||Mt(t))return;let n=[],r=[];for(let i of e.spans)i.op?.startsWith("gen_ai.")?n.push(Q_(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,...jn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}function eu(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var ms=Symbol.for("SentryBufferFullError");function gi(e=100){let t=new Set;function n(){return t.size<e}function r(s){t.delete(s)}function o(s){if(!n())return fi(ms);let a=s();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function i(s){if(!t.size)return wr(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let l=[a,new Promise(c=>eu(setTimeout(()=>c(!1),s)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:i}}var ev=60*1e3;function tv(e,t=ri()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?ev:r-t}function nv(e,t){return e[t]||e.all||0}function Qa(e,t,n=ri()){return nv(e,t)>n}function Za(e,{statusCode:t,headers:n},r=ri()){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),f=parseInt(l,10),p=(isNaN(f)?60:f)*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+tv(s,r):t===429&&(o.all=r+60*1e3);return o}var Vp=64;function tu(e,t,n=gi(e.bufferSize||Vp)){let r={},o=s=>n.drain(s);function i(s){let a=[];if(za(s,(f,p)=>{let h=Yc(p);Qa(r,h)?e.recordDroppedEvent("ratelimit_backoff",h):a.push(f)}),a.length===0)return Promise.resolve({});let l=en(s[0],a),c=f=>{if(kp(l,["client_report"])){O&&C.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}za(l,(p,h)=>{e.recordDroppedEvent(f,Yc(h))})},u=()=>t({body:Np(l)}).then(f=>f.statusCode===413?(O&&C.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),f):(O&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&C.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=Za(r,f),f),f=>{throw c("network_error"),O&&C.error("Encountered error running transport request:",f),f});return n.add(u).then(f=>f,f=>{if(f===ms)return O&&C.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw f})}return{send:i,flush:o}}function rv(e,t,n){let r=[{type:"client_report"},{timestamp:n||dn(),discarded_events:e}];return en(t?{dsn:t}:{},[r])}function nu(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 ov(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?.[ai],exclusive_time:s?.[jt],measurements:e.measurements,is_segment:!0}}function iv(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&&{[ai]:e.profile_id},...e.exclusive_time&&{[jt]:e.exclusive_time}}}},measurements:e.measurements}}var el=["forwarded","-ip","remote-","via","-user"];function sv(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:el},httpHeaders:{request:{deny:el},response:{deny:el}},httpBodies:[],queryParams:{deny:el},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:5}}var tk={userInfo:!1,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function av(e){let t=e.dataCollection!=null?tk:sv(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 lv="Not capturing exception because it's already been captured.",cv="Discarded session because of missing or non-string release",hv=Symbol.for("SentryInternalError"),gv=Symbol.for("SentryDoNotSendEventError"),nk=5e3;function ru(e){return{message:e,[hv]:!0}}function qp(e){return{message:e,[gv]:!0}}function uv(e){return!!e&&typeof e=="object"&&hv in e}function dv(e){return!!e&&typeof e=="object"&&gv in e}function fv(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??nk;c>0&&(a=!0,s=eu(setTimeout(()=>{o(e)},c)))}}),e.on("flush",()=>{o(e)})}var tl=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=gi(t.transportOptions?.bufferSize??Vp),this._dataCollection=av(t),t.dsn?this._dsn=Hc(t.dsn):O&&C.warn("No DSN provided, client will not send events."),this._dsn){let r=Fp(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&&fv(this,"afterCaptureLog","flushLogs",sk,ps),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&fv(this,"afterCaptureMetric","flushMetrics",ik,Xa)}captureException(t,n,r){let o=at();if(ka(t))return O&&C.log(lv),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:at(),...r},s=go(t)?t:String(t),a=un(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=at();if(n?.originalException&&ka(n.originalException))return O&&C.log(lv),o;let i={event_id:o,...n},s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,l=s.capturedSpanIsolationScope,c=pv(t.type);return this._process(()=>this._captureEvent(t,i,a||r,l),c),i.event_id}captureSession(t){this.sendSession(t),Hr(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){ps(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),jp(this,t,this._integrations),n||zp(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Z_(t,this),o=w_(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=qc(o,Mp(i));r&&(o=qc(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){let{release:n,environment:r=os}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){O&&C.warn(cv);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){O&&C.warn(cv);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=I_(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}`;O&&C.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 O&&C.error("Error while sending envelope:",n),{}}return O&&C.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=V_(this,t),zp(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)&&(Hr(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),Va(i,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Dc(r)},...a.contexts};let l=ss(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=te(),o=Xe()){return O&&Yp(t)&&C.log(`Captured error event \`${nu(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(i=>i.event_id,i=>{O&&(dv(i)?C.log(i.message):uv(i)?C.warn(i.message):C.warn(i))})}_processEvent(t,n,r,o){let i=this.getOptions(),{sampleRate:s}=i,a=yv(t),l=Yp(t),u=`before send for type \`${t.type||"error"}\``,f=typeof s>"u"?void 0:bn(s);if(l&&typeof f=="number"&&Bn()>f)return this.recordDroppedEvent("sample_rate","error"),fi(qp(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let p=pv(t.type);return this._prepareEvent(t,n,r,o).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",p),qp("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return h;let _=ok(this,i,h,n);return rk(_,u)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",p),a){let g=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",g)}throw qp(`${u} returned \`null\`, will not send event.`)}let y=r.getSession()||o.getSession();if(l&&y&&this._updateSessionFromEvent(y,h),a){let T=h.sdkProcessingMetadata?.spanCountBeforeProcessing||0,g=h.spans?h.spans.length:0,S=T-g;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 dv(h)||uv(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),ru(`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===ms&&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(){O&&C.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){O&&C.log("No outcomes to send");return}if(!this._dsn){O&&C.log("No dsn provided, will not send outcomes");return}O&&C.log("Sending outcomes:",t);let n=rv(t,this._options.tunnel&&xn(this._dsn));this.sendEnvelope(n)}};function pv(e){return e==="replay_event"?"replay":e||"error"}function rk(e,t){let n=`${t} must return \`null\` or a valid event.`;if(or(e))return e.then(r=>{if(!Fn(r)&&r!==null)throw ru(n);return r},r=>{throw ru(`${t} rejected with ${r}`)});if(!Fn(e)&&e!==null)throw ru(n);return e}function ok(e,t,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=!Vc(t.beforeSendSpan)&&t.beforeSendSpan,l=n;if(Yp(l)&&o)return o(l,r);if(yv(l)){if(a||s){let c=ov(l);if(s?.length&&Wr({description:c.description,op:c.op,attributes:c.data},s))return null;if(a){let u=a(c);u?l=vo(n,iv(u)):$a()}if(l.spans){let u=[],f=l.spans;for(let h of f){if(s?.length&&Wr({description:h.description,op:h.op,attributes:h.data},s)){v_(f,h);continue}if(a){let y=a(h);y?u.push(y):($a(),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 Yp(e){return e.type===void 0}function yv(e){return e.type==="transaction"}function ik(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Sv(e.attributes)}function sk(e){let t=0;return e.message&&(t+=e.message.length*2),t+Sv(e.attributes)}function Sv(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*mv(n[0]):un(n)?t+=mv(n):t+=100}),t}function mv(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Kp(e,t){t.debug===!0&&(O?C.enable():kt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),te().update(t.initialScope);let r=new e(t);return Jp(r),r.init(),r}function Jp(e){te().setClient(e)}function Xp(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return lk(e,n)||ak(e,r)}function ak(e,t){return t?_v(e)===_v(t):!1}function lk(e,t){let n=Ir(e);return!n||di(n)||!t?!1:ck(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function ck(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function _v(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Qp(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 nl(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:Er})),o.version=Er)}function hs(e={}){let t=e.client||$();if(!Ya()||!t)return{};let n=Rn(),r=Tr(n);if(r.getTraceData)return r.getTraceData(e);let o=e.scope||te(),i=e.span||Me();if(!i&&Oc())return{};let s=i?Da(i):uk(o),a=i?ht(i):ss(t,o),l=Tp(a);if(!$c.test(s))return C.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let u={"sentry-trace":s,baggage:l};return e.propagateTraceparent&&(u.traceparent=i?f_(i):dk(o)),u}function uk(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ma(t,r,n)}function dk(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Pa(t,r,n)}function Zp(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 f(){return o&&clearTimeout(o),o=a(l,t),s&&i===void 0&&(i=a(l,s)),r}return f.cancel=c,f.flush=u,f}var fk=100;function kn(e,t){let n=$(),r=Xe();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=fk}=n.getOptions();if(i<=0)return;let a={timestamp:dn(),...e},l=o?kt(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,i))}var vv,pk="FunctionToString",Ev=new WeakMap,mk=(()=>({name:pk,setupOnce(){vv=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=So(this),n=Ev.has($())&&t!==void 0?t:this;return vv.apply(n,e)}}catch{}},setup(e){Ev.set(e,!0)}})),ou=mk;var hk=[/^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$/],gk="EventFilters",em=(e={})=>{let t;return{name:gk,setup(n){let r=n.getOptions();t=Tv(e,r)},processEvent(n,r,o){if(!t){let i=o.getOptions();t=Tv(e,i)}return yk(n,t)?null:n}}},su=((e={})=>({...em(e),name:"InboundFilters"}));function Tv(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:hk],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function yk(e,t){if(e.type){if(e.type==="transaction"&&_k(e,t.ignoreTransactions))return O&&C.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
18
+ Event: ${sr(e)}`),!0}else{if(Sk(e,t.ignoreErrors))return O&&C.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
19
+ Event: ${sr(e)}`),!0;if(Ik(e))return O&&C.warn(`Event dropped due to not having an error message, error type or stacktrace.
20
+ Event: ${sr(e)}`),!0;if(vk(e,t.denyUrls))return O&&C.warn(`Event dropped due to being matched by \`denyUrls\` option.
21
21
  Event: ${sr(e)}.
22
- Url: ${iu(e)}`),!0;if(!vk(e,t.allowUrls))return O&&C.warn(`Event dropped due to not being matched by \`allowUrls\` option.
22
+ Url: ${iu(e)}`),!0;if(!Ek(e,t.allowUrls))return O&&C.warn(`Event dropped due to not being matched by \`allowUrls\` option.
23
23
  Event: ${sr(e)}.
24
- Url: ${iu(e)}`),!0}return!1}function yk(e,t){return t?.length?nu(e).some(n=>Nt(n,t)):!1}function Sk(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Nt(n,t):!1}function _k(e,t){if(!t?.length)return!1;let n=iu(e);return n?Nt(n,t):!1}function vk(e,t){if(!t?.length)return!0;let n=iu(e);return n?Nt(n,t):!0}function Ek(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 iu(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Ek(n):null}catch{return O&&C.error(`Cannot extract url for event ${sr(e)}`),null}}function Tk(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function nm(e,t,n,r,o,i){if(!o.exception?.values||!i||!ir(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=tm(e,t,r,i.originalException,n,o.exception.values,s,0))}function tm(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let l=[...i];if(ir(r[o],Error)){Iv(s,a,r);let c=e(t,r[o]),u=l.length;wv(c,o,u,a),l=tm(e,t,n,r[o],o,[c,...l],c,u)}return Cv(r)&&r.errors.forEach((c,u)=>{if(ir(c,Error)){Iv(s,a,r);let f=e(t,c),p=l.length;wv(f,`errors[${u}]`,p,a),l=tm(e,t,n,c,o,[f,...l],f,p)}}),l}function Cv(e){return Array.isArray(e.errors)}function Iv(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Cv(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function wv(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Ik(e){return Un(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function au(e){return Ik(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var Rv=new Set([]);function rm(e){let t="console",n=Ft(t,e);return Bt(t,wk),n}function wk(){"console"in G&&xc.forEach(function(e){e in G.console&&st(G.console,e,function(t){return ti[e]=t,function(...n){let r=n[0],o=ti[e],i=Rv.size&&typeof r=="string"&&Nt(r,Rv);i||mt("console",{args:n,level:e}),(!i||O&&C.isEnabled())&&o?.apply(G.console,n)}})})}function gs(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var Ck="Dedupe",Rk=(()=>{let e;return{name:Ck,processEvent(t){if(t.type)return t;try{if(xk(t,e))return O&&C.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),lu=Rk;function xk(e,t){return t?!!(bk(e,t)||kk(e,t)):!1}function bk(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!kv(e,t)||!bv(e,t))}function kk(e,t){let n=xv(t),r=xv(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!kv(e,t)||!bv(e,t))}function bv(e,t){let n=_a(e),r=_a(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 kv(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 xv(e){return e.exception?.values?.[0]}var Nk="ConversationId",Ak=(()=>({name:Nk,setup(e){e.on("spanStart",t=>{let n=te().getScopeData(),r=Xe().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:s,description:a}=ne(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(Fc,o)}})}})),om=Ak;function im(e,t,n,r,o){if(!e.fetchData)return;let{method:i,url:s}=e.fetchData,a=Et()&&t(s);if(e.endTimestamp){let y=e.fetchData.__span;if(!y)return;let _=r[y];_&&(a&&(Pk(_,e),Mk(_,e,o)),delete r[y]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},u=$(),p=!!Me()||!!u&&Mt(u),h=a&&p?wt(Dk(s,i,l)):new At;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 y=e.args[0],_={...e.args[1]||{}},T=Av(y,_,Et()&&p?h:void 0,c);T&&(e.args[1]=_,_.headers=T)}if(u){let y={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit("beforeOutgoingRequestSpan",h,y)}return h}function Mk(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Av(e,t,n,r){let o=hs({span:n,propagateTraceparent:r}),i=o["sentry-trace"],s=o.baggage,a=o.traceparent;if(!i)return;let l=t.headers||(wa(e)?e.headers:void 0);if(l)if(Lk(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?cu(u)||c.set("baggage",`${u},${s}`):c.set("baggage",s)}return c}else if(Ok(l)){let c=[...l];c.find(f=>f[0]==="sentry-trace")||c.push(["sentry-trace",i]),r&&a&&!c.find(f=>f[0]==="traceparent")&&c.push(["traceparent",a]);let u=l.find(f=>f[0]==="baggage"&&typeof f[1]=="string"&&cu(f[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,f="baggage"in l?l.baggage:void 0,p=f?Array.isArray(f)?[...f]:[f]:[],h=f&&(Array.isArray(f)?f.find(_=>cu(_)):cu(f));s&&!h&&p.push(s);let y=Object.assign({},l,{"sentry-trace":c??i,baggage:p.length>0?p.join(","):void 0});return r&&a&&!u&&(y.traceparent=a),y}else return{...o}}function Pk(e,t){if(t.response){rs(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 cu(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(Aa))}function Lk(e){return typeof Headers<"u"&&ir(e,Headers)}function Ok(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function Dk(e,t,n){if(e.startsWith("data:")){let i=Wt(e);return{name:`${t} ${i}`,attributes:Nv(e,void 0,t,n)}}let r=Ir(e),o=r?us(r):e;return{name:`${t} ${o}`,attributes:Nv(e,r,t,n)}}function Nv(e,t,n,r){let o={url:Wt(e),type:"fetch","http.method":n,[we]:r,[qe]:"http.client"};return t&&(di(t)||(o["http.url"]=Wt(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function uu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var rl=G;function sm(){return"history"in rl&&!!rl.history}function Uk(){if(!("fetch"in rl))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ol(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function am(){if(typeof EdgeRuntime=="string")return!0;if(!Uk())return!1;if(ol(rl.fetch))return!0;let e=!1,t=rl.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ol(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){O&&C.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Co(e,t){let n="fetch",r=Ft(n,e);return Bt(n,()=>Pv(void 0,t)),r}function fu(e){let t="fetch-body-resolved",n=Ft(t,e);return Bt(t,()=>Pv(Bk)),n}function Pv(e,t=!1){t&&!am()||st(G,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:s}=Hk(r),a={args:r,fetchData:{method:i,url:s},startTimestamp:Ae()*1e3,virtualError:o,headers:$k(r)};return e||mt("fetch",{...a}),n.apply(G,r).then(async l=>(e?e(l):mt("fetch",{...a,endTimestamp:Ae()*1e3,response:l}),l),l=>{mt("fetch",{...a,endTimestamp:Ae()*1e3,error:l}),Un(l)&&l.stack===void 0&&(l.stack=o.stack,Ve(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})`:Ve(l,"__sentry_fetch_url_host__",h)}catch{}throw l})}})}async function Fk(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 Bk(e){let t;try{t=e.clone()}catch{return}Fk(t,()=>{mt("fetch-body-resolved",{endTimestamp:Ae()*1e3,response:e})})}function du(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Mv(e){return typeof e=="string"?e:e?du(e,"url")?e.url:e.toString?e.toString():"":""}function Hk(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:Mv(n),method:du(r,"method")?String(r.method).toUpperCase():wa(n)&&du(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:Mv(t),method:du(t,"method")?String(t.method).toUpperCase():"GET"}}function $k(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(wa(t))return new Headers(t.headers)}catch{}}var Lv=G;function hn(){try{return Lv.document.location.href}catch{return""}}function ys(e,t=5){if(!Lv.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 ee=G,lm=0;function cm(){return lm>0}function EN(){lm++,setTimeout(()=>{lm--})}function yi(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(So(e))return e}catch{return e}let r=function(...o){G._sentryWrappedDepth=(G._sentryWrappedDepth||0)+1;try{let i=o.map(s=>yi(s,t));return e.apply(this,i)}catch(i){throw EN(),$n(s=>{s.addEventProcessor(a=>(t.mechanism&&(ii(a,void 0,void 0),Hn(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),Gr(i)}),i}finally{G._sentryWrappedDepth=(G._sentryWrappedDepth||0)-1}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}Ca(r,e),Ve(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Ss(){let e=hn(),{referrer:t}=ee.document||{},{userAgent:n}=ee.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function pu(e,t){let n=mu(e,t),r={type:RN(t),value:xN(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function TN(e,t,n,r){let i=$()?.getOptions().normalizeDepth,s=NN(t),a={__serialized__:xa(t,i)};if(s)return{exception:{values:[pu(e,s)]},extra:a};let l={exception:{values:[{type:yo(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:bN(t,{isUnhandledRejection:r})}]},extra:a};if(n){let c=mu(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function um(e,t){return{exception:{values:[pu(e,t)]}}}function mu(e,t){let n=t.stacktrace||t.stack||"",r=wN(t),o=CN(t);try{return e(n,r,o)}catch{}return[]}var IN=/Minified React error #\d+;/i;function wN(e){return e&&IN.test(e.message)?1:0}function CN(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Qv(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function RN(e){let t=e?.name;return!t&&Qv(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function xN(e){let t=e?.message;return Qv(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?au(t.error):au(e):"No error message"}function Zv(e,t,n,r){let o=n?.syntheticException||void 0,i=hu(e,t,o,r);return Hn(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),wr(i)}function eE(e,t,n="info",r,o){let i=r?.syntheticException||void 0,s=dm(e,t,i,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),wr(s)}function hu(e,t,n,r,o){let i;if(Xi(t)&&t.error)return um(e,t.error);if(Ia(t)||Nc(t)){let s=t;if("stack"in t){i=um(e,t);let a=i.exception?.values?.[0];if(r&&n&&a&&!a.stacktrace){let l=mu(e,n);l.length&&(a.stacktrace={frames:l},Hn(i,{synthetic:!0}))}}else{let a=s.name||(Ia(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;i=dm(e,l,n,r),ii(i,l)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return Un(t)?um(e,t):Fn(t)||yo(t)?(i=TN(e,t,n,o),Hn(i,{synthetic:!0}),i):(i=dm(e,t,n,r),ii(i,`${t}`,void 0),Hn(i,{synthetic:!0}),i)}function dm(e,t,n,r){let o={};if(r&&n){let i=mu(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),Hn(o,{synthetic:!0})}if(go(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 bN(e,{isUnhandledRejection:t}){let n=Mc(e),r=t?"promise rejection":"exception";return Xi(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:yo(e)?`Event \`${kN(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function kN(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function NN(e){return Object.values(e).find(t=>t instanceof Error)}var gu=class extends tl{constructor(t){let n=AN(t),r=ee.SENTRY_SDK_SOURCE||Gp();nl(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;ee.document&&(i||s||c)&&ee.document.addEventListener("visibilitychange",()=>{ee.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&ps(this),c&&Xa(this))}),o&&this.on("beforeSendSession",Qp)}eventFromException(t,n){return Zv(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return eE(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 AN(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:ee.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Ct=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var q=G;var MN=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Cr=(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=MN(t.value,n),e(t)))}};var qr=(e=!0)=>{let t=q.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t};var Wn=()=>qr()?.activationStart??0;function Gn(e,t,n){q.document&&q.addEventListener(e,t,n)}function Si(e,t,n){q.document&&q.removeEventListener(e,t,n)}var _s=-1,tE=new Set,PN=()=>q.document?.visibilityState==="hidden"&&!q.document?.prerendering?0:1/0,yu=e=>{if(LN(e)&&_s>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(let t of tE)t();isFinite(_s)||(_s=e.type==="visibilitychange"?e.timeStamp:0,Si("prerenderingchange",yu,!0))}},Rr=()=>{if(q.document&&_s<0){let e=Wn();_s=(q.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??PN(),Gn("visibilitychange",yu,!0),Gn("pagehide",yu,!0),Gn("prerenderingchange",yu,!0)}return{get firstHiddenTime(){return _s},onHidden(e){tE.add(e)}}};function LN(e){return e.type==="pagehide"||q.document?.visibilityState==="hidden"}var nE=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var xr=(e,t=-1)=>{let n=qr(),r="navigate";return n&&(q.document?.prerendering||Wn()>0?r="prerender":q.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:nE(),navigationType:r}};var fm=new WeakMap;function vs(e,t){try{return fm.get(e)||fm.set(e,new t),fm.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 Vn=(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 Es=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var xo=e=>{q.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};var ON=[1800,3e3],rE=(e,t={})=>{xo(()=>{let n=Rr(),r=xr("FCP"),o,s=Vn("paint",a=>{for(let l of a)l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Wn(),0),r.entries.push(l),o(!0)))});s&&(o=Cr(e,r,ON,t.reportAllChanges))})};var DN=[.1,.25],oE=(e,t={})=>{rE(Es(()=>{let n=xr("CLS",0),r,o=Rr(),i=vs(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=Vn("layout-shift",s);a&&(r=Cr(e,n,DN,t.reportAllChanges),o.onHidden(()=>{s(a.takeRecords()),r(!0)}),q?.setTimeout?.(r))}))};var iE=0,pm=1/0,_u=0,UN=e=>{e.forEach(t=>{t.interactionId&&(pm=Math.min(pm,t.interactionId),_u=Math.max(_u,t.interactionId),iE=_u?(_u-pm)/7+1:0)})},mm,hm=()=>mm?iE:performance.interactionCount||0,sE=()=>{"interactionCount"in performance||mm||(mm=Vn("event",UN,{type:"event",buffered:!0,durationThreshold:0}))};var gm=10,aE=0,FN=()=>hm()-aE,vu=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){aE=hm(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let t=Math.min(this._longestInteractionList.length-1,Math.floor(FN()/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<gm||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>gm){let o=this._longestInteractionList.splice(gm);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var Eu=e=>{let t=q.requestIdleCallback||q.setTimeout;q.document?.visibilityState==="hidden"?e():(e=Es(e),Gn("visibilitychange",e,{once:!0,capture:!0}),Gn("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Si("visibilitychange",e,{capture:!0}),Si("pagehide",e,{capture:!0})}))};var BN=[200,500],HN=40,lE=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=Rr();xo(()=>{sE();let r=xr("INP"),o,i=vs(t,vu),s=l=>{Eu(()=>{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=Vn("event",s,{durationThreshold:t.durationThreshold??HN});o=Cr(e,r,BN,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),o(!0)}))})};var Tu=class{_processEntry(t){this._onBeforeProcessingEntry?.(t)}};var $N=[2500,4e3],cE=(e,t={})=>{xo(()=>{let n=Rr(),r=xr("LCP"),o,i=vs(t,Tu),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-Wn(),0),r.entries=[c],o())},a=Vn("largest-contentful-paint",s);if(a){o=Cr(e,r,$N,t.reportAllChanges);let l=Es(()=>{s(a.takeRecords()),a.disconnect(),o(!0)}),c=u=>{u.isTrusted&&(Eu(l),Si(u.type,c,{capture:!0}))};for(let u of["keydown","click","visibilitychange"])Gn(u,c,{capture:!0})}})};var zN=[800,1800],ym=e=>{q.document?.prerendering?xo(()=>ym(e)):q.document?.readyState!=="complete"?addEventListener("load",()=>ym(e),!0):setTimeout(e)},uE=(e,t={})=>{let n=xr("TTFB"),r=Cr(e,n,zN,t.reportAllChanges);ym(()=>{let o=qr();o&&(n.value=Math.max(o.responseStart-Wn(),0),n.entries=[o],r(!0))})};var il={},Iu={},dE,fE,pE,mE;function Yr(e,t=!1){return wu("cls",e,jN,dE,t)}function Kr(e,t=!1){return wu("lcp",e,WN,fE,t)}function Sm(e){return wu("ttfb",e,GN,pE)}function _i(e){return wu("inp",e,VN,mE)}function cr(e,t){return hE(e,t),Iu[e]||(qN(e),Iu[e]=!0),gE(e,t)}function sl(e,t){let n=il[e];if(n?.length)for(let r of n)try{r(t)}catch(o){Ct&&C.error(`Error while triggering instrumentation handler.
24
+ Url: ${iu(e)}`),!0}return!1}function Sk(e,t){return t?.length?nu(e).some(n=>Nt(n,t)):!1}function _k(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Nt(n,t):!1}function vk(e,t){if(!t?.length)return!1;let n=iu(e);return n?Nt(n,t):!1}function Ek(e,t){if(!t?.length)return!0;let n=iu(e);return n?Nt(n,t):!0}function Tk(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 iu(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Tk(n):null}catch{return O&&C.error(`Cannot extract url for event ${sr(e)}`),null}}function Ik(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function nm(e,t,n,r,o,i){if(!o.exception?.values||!i||!ir(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=tm(e,t,r,i.originalException,n,o.exception.values,s,0))}function tm(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let l=[...i];if(ir(r[o],Error)){Iv(s,a,r);let c=e(t,r[o]),u=l.length;wv(c,o,u,a),l=tm(e,t,n,r[o],o,[c,...l],c,u)}return Cv(r)&&r.errors.forEach((c,u)=>{if(ir(c,Error)){Iv(s,a,r);let f=e(t,c),p=l.length;wv(f,`errors[${u}]`,p,a),l=tm(e,t,n,c,o,[f,...l],f,p)}}),l}function Cv(e){return Array.isArray(e.errors)}function Iv(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Cv(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function wv(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function wk(e){return Un(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function au(e){return wk(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var Rv=new Set([]);function rm(e){let t="console",n=Ft(t,e);return Bt(t,Ck),n}function Ck(){"console"in G&&xc.forEach(function(e){e in G.console&&st(G.console,e,function(t){return ti[e]=t,function(...n){let r=n[0],o=ti[e],i=Rv.size&&typeof r=="string"&&Nt(r,Rv);i||mt("console",{args:n,level:e}),(!i||O&&C.isEnabled())&&o?.apply(G.console,n)}})})}function gs(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var Rk="Dedupe",xk=(()=>{let e;return{name:Rk,processEvent(t){if(t.type)return t;try{if(bk(t,e))return O&&C.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),lu=xk;function bk(e,t){return t?!!(kk(e,t)||Nk(e,t)):!1}function kk(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!kv(e,t)||!bv(e,t))}function Nk(e,t){let n=xv(t),r=xv(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!kv(e,t)||!bv(e,t))}function bv(e,t){let n=_a(e),r=_a(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 kv(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 xv(e){return e.exception?.values?.[0]}var Ak="ConversationId",Mk=(()=>({name:Ak,setup(e){e.on("spanStart",t=>{let n=te().getScopeData(),r=Xe().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:s,description:a}=ne(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(Fc,o)}})}})),om=Mk;function im(e,t,n,r,o){if(!e.fetchData)return;let{method:i,url:s}=e.fetchData,a=Et()&&t(s);if(e.endTimestamp){let y=e.fetchData.__span;if(!y)return;let _=r[y];_&&(a&&(Lk(_,e),Pk(_,e,o)),delete r[y]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},u=$(),p=!!Me()||!!u&&Mt(u),h=a&&p?wt(Uk(s,i,l)):new At;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 y=e.args[0],_={...e.args[1]||{}},T=Av(y,_,Et()&&p?h:void 0,c);T&&(e.args[1]=_,_.headers=T)}if(u){let y={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit("beforeOutgoingRequestSpan",h,y)}return h}function Pk(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Av(e,t,n,r){let o=hs({span:n,propagateTraceparent:r}),i=o["sentry-trace"],s=o.baggage,a=o.traceparent;if(!i)return;let l=t.headers||(wa(e)?e.headers:void 0);if(l)if(Ok(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?cu(u)||c.set("baggage",`${u},${s}`):c.set("baggage",s)}return c}else if(Dk(l)){let c=[...l];c.find(f=>f[0]==="sentry-trace")||c.push(["sentry-trace",i]),r&&a&&!c.find(f=>f[0]==="traceparent")&&c.push(["traceparent",a]);let u=l.find(f=>f[0]==="baggage"&&typeof f[1]=="string"&&cu(f[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,f="baggage"in l?l.baggage:void 0,p=f?Array.isArray(f)?[...f]:[f]:[],h=f&&(Array.isArray(f)?f.find(_=>cu(_)):cu(f));s&&!h&&p.push(s);let y=Object.assign({},l,{"sentry-trace":c??i,baggage:p.length>0?p.join(","):void 0});return r&&a&&!u&&(y.traceparent=a),y}else return{...o}}function Lk(e,t){if(t.response){rs(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 cu(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(Aa))}function Ok(e){return typeof Headers<"u"&&ir(e,Headers)}function Dk(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function Uk(e,t,n){if(e.startsWith("data:")){let i=Wt(e);return{name:`${t} ${i}`,attributes:Nv(e,void 0,t,n)}}let r=Ir(e),o=r?us(r):e;return{name:`${t} ${o}`,attributes:Nv(e,r,t,n)}}function Nv(e,t,n,r){let o={url:Wt(e),type:"fetch","http.method":n,[we]:r,[qe]:"http.client"};return t&&(di(t)||(o["http.url"]=Wt(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function uu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var rl=G;function sm(){return"history"in rl&&!!rl.history}function Fk(){if(!("fetch"in rl))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ol(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function am(){if(typeof EdgeRuntime=="string")return!0;if(!Fk())return!1;if(ol(rl.fetch))return!0;let e=!1,t=rl.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ol(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){O&&C.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Co(e,t){let n="fetch",r=Ft(n,e);return Bt(n,()=>Pv(void 0,t)),r}function fu(e){let t="fetch-body-resolved",n=Ft(t,e);return Bt(t,()=>Pv(Hk)),n}function Pv(e,t=!1){t&&!am()||st(G,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:s}=$k(r),a={args:r,fetchData:{method:i,url:s},startTimestamp:Ae()*1e3,virtualError:o,headers:zk(r)};return e||mt("fetch",{...a}),n.apply(G,r).then(async l=>(e?e(l):mt("fetch",{...a,endTimestamp:Ae()*1e3,response:l}),l),l=>{mt("fetch",{...a,endTimestamp:Ae()*1e3,error:l}),Un(l)&&l.stack===void 0&&(l.stack=o.stack,Ve(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})`:Ve(l,"__sentry_fetch_url_host__",h)}catch{}throw l})}})}async function Bk(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 Hk(e){let t;try{t=e.clone()}catch{return}Bk(t,()=>{mt("fetch-body-resolved",{endTimestamp:Ae()*1e3,response:e})})}function du(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Mv(e){return typeof e=="string"?e:e?du(e,"url")?e.url:e.toString?e.toString():"":""}function $k(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:Mv(n),method:du(r,"method")?String(r.method).toUpperCase():wa(n)&&du(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:Mv(t),method:du(t,"method")?String(t.method).toUpperCase():"GET"}}function zk(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(wa(t))return new Headers(t.headers)}catch{}}var Lv=G;function hn(){try{return Lv.document.location.href}catch{return""}}function ys(e,t=5){if(!Lv.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 ee=G,lm=0;function cm(){return lm>0}function TN(){lm++,setTimeout(()=>{lm--})}function yi(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(So(e))return e}catch{return e}let r=function(...o){G._sentryWrappedDepth=(G._sentryWrappedDepth||0)+1;try{let i=o.map(s=>yi(s,t));return e.apply(this,i)}catch(i){throw TN(),$n(s=>{s.addEventProcessor(a=>(t.mechanism&&(ii(a,void 0,void 0),Hn(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),Gr(i)}),i}finally{G._sentryWrappedDepth=(G._sentryWrappedDepth||0)-1}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}Ca(r,e),Ve(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Ss(){let e=hn(),{referrer:t}=ee.document||{},{userAgent:n}=ee.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function pu(e,t){let n=mu(e,t),r={type:xN(t),value:bN(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function IN(e,t,n,r){let i=$()?.getOptions().normalizeDepth,s=AN(t),a={__serialized__:xa(t,i)};if(s)return{exception:{values:[pu(e,s)]},extra:a};let l={exception:{values:[{type:yo(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:kN(t,{isUnhandledRejection:r})}]},extra:a};if(n){let c=mu(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function um(e,t){return{exception:{values:[pu(e,t)]}}}function mu(e,t){let n=t.stacktrace||t.stack||"",r=CN(t),o=RN(t);try{return e(n,r,o)}catch{}return[]}var wN=/Minified React error #\d+;/i;function CN(e){return e&&wN.test(e.message)?1:0}function RN(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Qv(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function xN(e){let t=e?.name;return!t&&Qv(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function bN(e){let t=e?.message;return Qv(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?au(t.error):au(e):"No error message"}function Zv(e,t,n,r){let o=n?.syntheticException||void 0,i=hu(e,t,o,r);return Hn(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),wr(i)}function eE(e,t,n="info",r,o){let i=r?.syntheticException||void 0,s=dm(e,t,i,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),wr(s)}function hu(e,t,n,r,o){let i;if(Xi(t)&&t.error)return um(e,t.error);if(Ia(t)||Nc(t)){let s=t;if("stack"in t){i=um(e,t);let a=i.exception?.values?.[0];if(r&&n&&a&&!a.stacktrace){let l=mu(e,n);l.length&&(a.stacktrace={frames:l},Hn(i,{synthetic:!0}))}}else{let a=s.name||(Ia(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;i=dm(e,l,n,r),ii(i,l)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return Un(t)?um(e,t):Fn(t)||yo(t)?(i=IN(e,t,n,o),Hn(i,{synthetic:!0}),i):(i=dm(e,t,n,r),ii(i,`${t}`,void 0),Hn(i,{synthetic:!0}),i)}function dm(e,t,n,r){let o={};if(r&&n){let i=mu(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),Hn(o,{synthetic:!0})}if(go(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 kN(e,{isUnhandledRejection:t}){let n=Mc(e),r=t?"promise rejection":"exception";return Xi(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:yo(e)?`Event \`${NN(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function NN(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function AN(e){return Object.values(e).find(t=>t instanceof Error)}var gu=class extends tl{constructor(t){let n=MN(t),r=ee.SENTRY_SDK_SOURCE||Gp();nl(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;ee.document&&(i||s||c)&&ee.document.addEventListener("visibilitychange",()=>{ee.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&ps(this),c&&Xa(this))}),o&&this.on("beforeSendSession",Qp)}eventFromException(t,n){return Zv(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return eE(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 MN(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:ee.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Ct=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var q=G;var PN=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Cr=(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=PN(t.value,n),e(t)))}};var qr=(e=!0)=>{let t=q.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t};var Wn=()=>qr()?.activationStart??0;function Gn(e,t,n){q.document&&q.addEventListener(e,t,n)}function Si(e,t,n){q.document&&q.removeEventListener(e,t,n)}var _s=-1,tE=new Set,LN=()=>q.document?.visibilityState==="hidden"&&!q.document?.prerendering?0:1/0,yu=e=>{if(ON(e)&&_s>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(let t of tE)t();isFinite(_s)||(_s=e.type==="visibilitychange"?e.timeStamp:0,Si("prerenderingchange",yu,!0))}},Rr=()=>{if(q.document&&_s<0){let e=Wn();_s=(q.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??LN(),Gn("visibilitychange",yu,!0),Gn("pagehide",yu,!0),Gn("prerenderingchange",yu,!0)}return{get firstHiddenTime(){return _s},onHidden(e){tE.add(e)}}};function ON(e){return e.type==="pagehide"||q.document?.visibilityState==="hidden"}var nE=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var xr=(e,t=-1)=>{let n=qr(),r="navigate";return n&&(q.document?.prerendering||Wn()>0?r="prerender":q.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:nE(),navigationType:r}};var fm=new WeakMap;function vs(e,t){try{return fm.get(e)||fm.set(e,new t),fm.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 Vn=(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 Es=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var xo=e=>{q.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};var DN=[1800,3e3],rE=(e,t={})=>{xo(()=>{let n=Rr(),r=xr("FCP"),o,s=Vn("paint",a=>{for(let l of a)l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Wn(),0),r.entries.push(l),o(!0)))});s&&(o=Cr(e,r,DN,t.reportAllChanges))})};var UN=[.1,.25],oE=(e,t={})=>{rE(Es(()=>{let n=xr("CLS",0),r,o=Rr(),i=vs(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=Vn("layout-shift",s);a&&(r=Cr(e,n,UN,t.reportAllChanges),o.onHidden(()=>{s(a.takeRecords()),r(!0)}),q?.setTimeout?.(r))}))};var iE=0,pm=1/0,_u=0,FN=e=>{e.forEach(t=>{t.interactionId&&(pm=Math.min(pm,t.interactionId),_u=Math.max(_u,t.interactionId),iE=_u?(_u-pm)/7+1:0)})},mm,hm=()=>mm?iE:performance.interactionCount||0,sE=()=>{"interactionCount"in performance||mm||(mm=Vn("event",FN,{type:"event",buffered:!0,durationThreshold:0}))};var gm=10,aE=0,BN=()=>hm()-aE,vu=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){aE=hm(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let t=Math.min(this._longestInteractionList.length-1,Math.floor(BN()/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<gm||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>gm){let o=this._longestInteractionList.splice(gm);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var Eu=e=>{let t=q.requestIdleCallback||q.setTimeout;q.document?.visibilityState==="hidden"?e():(e=Es(e),Gn("visibilitychange",e,{once:!0,capture:!0}),Gn("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Si("visibilitychange",e,{capture:!0}),Si("pagehide",e,{capture:!0})}))};var HN=[200,500],$N=40,lE=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=Rr();xo(()=>{sE();let r=xr("INP"),o,i=vs(t,vu),s=l=>{Eu(()=>{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=Vn("event",s,{durationThreshold:t.durationThreshold??$N});o=Cr(e,r,HN,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),o(!0)}))})};var Tu=class{_processEntry(t){this._onBeforeProcessingEntry?.(t)}};var zN=[2500,4e3],cE=(e,t={})=>{xo(()=>{let n=Rr(),r=xr("LCP"),o,i=vs(t,Tu),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-Wn(),0),r.entries=[c],o())},a=Vn("largest-contentful-paint",s);if(a){o=Cr(e,r,zN,t.reportAllChanges);let l=Es(()=>{s(a.takeRecords()),a.disconnect(),o(!0)}),c=u=>{u.isTrusted&&(Eu(l),Si(u.type,c,{capture:!0}))};for(let u of["keydown","click","visibilitychange"])Gn(u,c,{capture:!0})}})};var jN=[800,1800],ym=e=>{q.document?.prerendering?xo(()=>ym(e)):q.document?.readyState!=="complete"?addEventListener("load",()=>ym(e),!0):setTimeout(e)},uE=(e,t={})=>{let n=xr("TTFB"),r=Cr(e,n,jN,t.reportAllChanges);ym(()=>{let o=qr();o&&(n.value=Math.max(o.responseStart-Wn(),0),n.entries=[o],r(!0))})};var il={},Iu={},dE,fE,pE,mE;function Yr(e,t=!1){return wu("cls",e,WN,dE,t)}function Kr(e,t=!1){return wu("lcp",e,GN,fE,t)}function Sm(e){return wu("ttfb",e,VN,pE)}function _i(e){return wu("inp",e,qN,mE)}function cr(e,t){return hE(e,t),Iu[e]||(YN(e),Iu[e]=!0),gE(e,t)}function sl(e,t){let n=il[e];if(n?.length)for(let r of n)try{r(t)}catch(o){Ct&&C.error(`Error while triggering instrumentation handler.
25
25
  Type: ${e}
26
26
  Name: ${Qt(r)}
27
- Error:`,o)}}function jN(){return oE(e=>{sl("cls",{metric:e}),dE=e},{reportAllChanges:!0})}function WN(){return cE(e=>{sl("lcp",{metric:e}),fE=e},{reportAllChanges:!0})}function GN(){return uE(e=>{sl("ttfb",{metric:e}),pE=e})}function VN(){return lE(e=>{sl("inp",{metric:e}),mE=e})}function wu(e,t,n,r,o=!1){hE(e,t);let i;return Iu[e]||(i=n(),Iu[e]=!0),r&&t({metric:r}),gE(e,t,o?i:void 0)}function qN(e){let t={};e==="event"&&(t.durationThreshold=0),Vn(e,n=>{sl(e,{entries:n})},t)}function hE(e,t){il[e]=il[e]||[],il[e].push(t)}function gE(e,t,n){return()=>{n&&n();let r=il[e];if(!r)return;let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function yE(e){return"duration"in e}var YN=80;function Ue(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,f=!Array.isArray(t)&&t.maxStringLength||YN;for(;n&&i++<r&&(c=KN(n,u),!(c==="html"||i>1&&s+o.length*l+c.length>=f));)o.push(c),s+=c.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function KN(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&&Ht(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 SE=e=>{let t=n=>{(n.type==="pagehide"||q.document?.visibilityState==="hidden")&&e(n)};Gn("visibilitychange",t,{capture:!0,once:!0}),Gn("pagehide",t,{capture:!0,once:!0})};function Cu(e){return typeof e=="number"&&isFinite(e)}function Jr(e,t,n,{...r}){let o=ne(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),ls(e,()=>{let i=wt({startTime:t,...r});return i&&i.end(n),i})}function Ts(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(),f=te(),p=f.getUser(),h=p!==void 0?p.email||p.id||p.ip_address:void 0,y;try{y=f.getScopeData().contexts.profile.profile_id}catch{}let _={release:s,environment:a,user:h||void 0,profile_id:y||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":q.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return wt({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function Xr(){return q.addEventListener&&q.performance}function Pe(e){return e/1e3}function _E(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 vi(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Ei(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}SE(()=>{o("pagehide")});let i=e.on("beforeStartNavigationSpan",(a,l)=>{l?.isRedirect||(o("navigation"),i(),s())}),s=e.on("afterStartPageLoadSpan",a=>{n=a,s()})}function vE(e){let t=0,n;if(!vi("layout-shift"))return;let r=Yr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);Ei(e,(o,i)=>{JN(t,n,i,o),r()})}function JN(e,t,n,r){Ct&&C.log(`Sending CLS span (${e})`);let o=t?Pe((He()||0)+t.startTime):Ae(),i=te().getScopeData().transactionName,s=t?Ue(t.sources[0]?.node):"Layout shift",a={[we]:"auto.http.browser.cls",[qe]:"ui.webvital.cls",[jt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((c,u)=>{a[`cls.source.${u+1}`]=Ue(c.node)});let l=Ts({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("cls",{[ar]:"",[lr]:e}),l.end(o))}var XN=6e4;function Ti(e){return e!=null&&e>0&&e<=XN}function EE(e){let t=0,n;if(!vi("largest-contentful-paint"))return;let r=Kr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ti(o.value)||(t=o.value,n=i)},!0);Ei(e,(o,i)=>{QN(t,n,i,o),r()})}function QN(e,t,n,r){if(!Ti(e))return;Ct&&C.log(`Sending LCP span (${e})`);let o=Pe((He()||0)+(t?.startTime||0)),i=te().getScopeData().transactionName,s=t?Ue(t.element):"Largest contentful paint",a={[we]:"auto.http.browser.lcp",[qe]:"ui.webvital.lcp",[jt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Ue(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=Ts({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[ar]:"millisecond",[lr]:e}),l.end(o))}function qn(e){return e&&((He()||performance.timeOrigin)+e)/1e3}function al(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=_E(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return He()||Xr()?.timeOrigin?ZN({...t,"http.request.redirect_start":qn(e.redirectStart),"http.request.redirect_end":qn(e.redirectEnd),"http.request.worker_start":qn(e.workerStart),"http.request.fetch_start":qn(e.fetchStart),"http.request.domain_lookup_start":qn(e.domainLookupStart),"http.request.domain_lookup_end":qn(e.domainLookupEnd),"http.request.connect_start":qn(e.connectStart),"http.request.secure_connection_start":qn(e.secureConnectionStart),"http.request.connection_end":qn(e.connectEnd),"http.request.request_start":qn(e.requestStart),"http.request.response_start":qn(e.responseStart),"http.request.response_end":qn(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function ZN(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var eA=2147483647,TE=0,tn={},gn,xu;function _m({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=Xr();if(r&&He()){r.mark&&q.performance.mark("sentry-tracing-init");let o=t?EE(n):t===!1?nA():void 0,i=e?vE(n):e===!1?tA():void 0,s=rA();return()=>{s(),o?.(),i?.()}}return()=>{}}function vm(){cr("longtask",({entries:e})=>{let t=Me();if(!t)return;let{op:n,start_timestamp:r}=ne(t);for(let o of e){let i=Pe(He()+o.startTime),s=Pe(o.duration);n==="navigation"&&r&&i<r||Jr(t,i,i+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[we]:"auto.ui.browser.metrics"}})}})}function Em(){new PerformanceObserver(t=>{let n=Me();if(n)for(let r of t.getEntries()){if(!r.scripts[0])continue;let o=Pe(He()+r.startTime),{start_timestamp:i,op:s}=ne(n);if(s==="navigation"&&i&&o<i)continue;let a=Pe(r.duration),l={[we]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:u,invokerType:f,sourceURL:p,sourceFunctionName:h,sourceCharPosition:y}=c;l["browser.script.invoker"]=u,l["browser.script.invoker_type"]=f,p&&(l["code.filepath"]=p),h&&(l["code.function"]=h),y!==-1&&(l["browser.script.source_char_position"]=y),Jr(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function Tm(){cr("event",({entries:e})=>{let t=Me();if(t){for(let n of e)if(n.name==="click"){let r=Pe(He()+n.startTime),o=Pe(n.duration),i={name:Ue(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[we]:"auto.ui.browser.metrics"}},s=ys(n.target);s&&(i.attributes["ui.component_name"]=s),Jr(t,r,r+o,i)}}})}function tA(){return Yr(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(tn.cls={value:e.value,unit:""},xu=t)},!0)}function nA(){return Kr(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!Ti(e.value)||(tn.lcp={value:e.value,unit:"millisecond"},gn=t)},!0)}function rA(){return Sm(({metric:e})=>{e.entries[e.entries.length-1]&&(tn.ttfb={value:e.value,unit:"millisecond"})})}function Im(e,t){let n=Xr(),r=He();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:s,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:l}=t,c=Pe(r),u=n.getEntries(),{op:f,start_timestamp:p}=ne(e);if(u.slice(TE).forEach(h=>{let y=Pe(h.startTime),_=Pe(Math.max(0,h.duration));if(!(f==="navigation"&&p&&c+y<p))switch(h.entryType){case"navigation":{aA(e,h,c);break}case"mark":case"paint":case"measure":{iA(e,h,y,_,c,i);let T=Rr(),g=h.startTime<T.firstHiddenTime;h.name==="first-paint"&&g&&(tn.fp={value:h.startTime,unit:"millisecond"}),h.name==="first-contentful-paint"&&g&&(tn.fcp={value:h.startTime,unit:"millisecond"});break}case"resource":{uA(e,h,h.name,y,_,c,s);break}}}),TE=Math.max(u.length-1,0),dA(e,o),f==="pageload"){if(mA(tn),o){let h=(y,_,T)=>{let g=T??`browser.web_vital.${y}.value`;e.setAttribute(g,_),Ct&&C.log("Setting web vital attribute",{[g]:_},"on pageload span")};["ttfb","fp","fcp"].forEach(y=>{tn[y]&&h(y,tn[y].value)}),tn["ttfb.requestTime"]&&h("ttfb.requestTime",tn["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete tn.cls,l||delete tn.lcp,Object.entries(tn).forEach(([h,y])=>{Kc(h,y.value,y.unit)}),fA(e,t);e.setAttribute(o?"browser.performance.time_origin":"performance.timeOrigin",c),e.setAttribute(o?"browser.performance.navigation.activation_start":"performance.activationStart",Wn())}gn=void 0,xu=void 0,tn={}}function oA(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components \u269B"}catch{return}}function iA(e,t,n,r,o,i){if(oA(t)||["mark","measure"].includes(t.entryType)&&Nt(t.name,i))return;let s=qr(!1),a=Pe(s?s.requestStart:0),l=o+Math.max(n,a),c=o+n,u=c+r,f={[we]:"auto.resource.browser.metrics"};l!==c&&(f["sentry.browser.measure_happened_before_request"]=!0,f["sentry.browser.measure_start_time"]=l),sA(f,t),l<=u&&Jr(e,l,u,{name:t.name,op:t.entryType,attributes:f})}function sA(e,t){try{let n=t.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&un(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(un(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function aA(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ru(e,t,r,n)}),Ru(e,t,"secureConnection",n,"TLS/SSL"),Ru(e,t,"fetch",n,"cache"),Ru(e,t,"domainLookup",n,"DNS"),cA(e,t,n)}function Ru(e,t,n,r,o=n){let i=lA(n),s=t[i],a=t[`${n}Start`];!a||!s||Jr(e,r+Pe(a),r+Pe(s),{op:`browser.${o}`,name:t.name,attributes:{[we]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function lA(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function cA(e,t,n){let r=n+Pe(t.requestStart),o=n+Pe(t.responseEnd),i=n+Pe(t.responseStart);t.responseEnd&&(Jr(e,r,o,{op:"browser.request",name:t.name,attributes:{[we]:"auto.ui.browser.metrics"}}),Jr(e,i,o,{op:"browser.response",name:t.name,attributes:{[we]:"auto.ui.browser.metrics"}}))}function uA(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={[we]:"auto.resource.browser.metrics"},c=zn(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(q.location.origin),pA(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,...al(t)},f=i+r,p=f+o;Jr(e,f,p,{name:n.replace(q.location.origin,""),op:a,attributes:u})}function dA(e,t){let n=q.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),Cu(r.rtt)&&(tn["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),Cu(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),Cu(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function fA(e,t){gn&&t.recordLcpOnPageloadSpan&&(gn.element&&e.setAttribute("lcp.element",Ue(gn.element)),gn.id&&e.setAttribute("lcp.id",gn.id),gn.url&&e.setAttribute("lcp.url",gn.url.trim().slice(0,200)),gn.loadTime!=null&&e.setAttribute("lcp.loadTime",gn.loadTime),gn.renderTime!=null&&e.setAttribute("lcp.renderTime",gn.renderTime),e.setAttribute("lcp.size",gn.size)),xu?.sources&&t.recordClsOnPageloadSpan&&xu.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ue(n.node)))}function pA(e,t,n){n.forEach(([r,o])=>{let i=e[r];i!=null&&(typeof i=="number"&&i<eA||typeof i=="string")&&(t[o]=i)})}function mA(e){let t=qr(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var wm=[],ll=new Map,Is=new Map,Cm=60;function Rm(){if(Xr()&&He()){let t=hA();return()=>{t()}}return()=>{}}var ws={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 hA(){return _i(gA)}var gA=({metric:e})=>{if(e.value==null)return;let t=Pe(e.value);if(t>Cm)return;let n=e.entries.find(y=>y.duration===e.value&&ws[y.name]);if(!n)return;let{interactionId:r}=n,o=ws[n.name],i=Pe(He()+n.startTime),s=Me(),a=s?be(s):void 0,l=r!=null?ll.get(r):void 0,c=l?.span||a,u=c?ne(c).description:te().getScopeData().transactionName,f=l?.elementName||Ue(n.target),p={[we]:"auto.http.browser.inp",[qe]:`ui.interaction.${o}`,[jt]:n.duration},h=Ts({name:f,transaction:u,attributes:p,startTime:i});h&&(h.addEvent("inp",{[ar]:"millisecond",[lr]:e.value}),h.end(i+t))};function IE(e){return e!=null?ll.get(e):void 0}function xm(){let e=Object.keys(ws);jn()&&e.forEach(o=>{q.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){let i=o.target;if(!i)return;let s=Ue(i),a=Math.round(o.timeStamp);if(Is.set(a,s),Is.size>50){let l=Is.keys().next().value;l!==void 0&&Is.delete(l)}}function n(o){let i=Math.round(o.startTime),s=Is.get(i);if(!s)for(let a=-5;a<=5;a++){let l=Is.get(i+a);if(l){s=l;break}}return s||"<unknown>"}let r=({entries:o})=>{let i=Me(),s=i&&be(i);o.forEach(a=>{if(!yE(a))return;let l=a.interactionId;if(l==null||ll.has(l))return;let c=a.target?Ue(a.target):n(a);if(wm.length>10){let u=wm.shift();ll.delete(u)}wm.push(l),ll.set(l,{span:s,elementName:c})})};cr("event",r),cr("first-input",r)}function bm(e){let{name:t,op:n,origin:r,metricName:o,value:i,attributes:s,parentSpan:a,reportEvent:l,startTime:c,endTime:u}=e,f=te().getScopeData().transactionName,p={[we]:r,[qe]:n,[jt]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":f,"user_agent.original":q.navigator?.userAgent,...s};a&&Fa(a).attributes?.[qe]==="pageload"&&(p["sentry.pageload.span_id"]=a.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let h=wt({name:t,attributes:p,startTime:c,parentSpan:a});h&&h.end(u??c)}function km(e){let t=0,n;if(!vi("largest-contentful-paint"))return;let r=Kr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ti(o.value)||(t=o.value,n=i)},!0);Ei(e,(o,i,s)=>{yA(t,n,s,o),r()})}function yA(e,t,n,r){if(!Ti(e))return;Ct&&C.log(`Sending LCP span (${e})`);let o=He()||0,i=Pe(o),s=Pe(o+(t?.startTime||0)),a=t?Ue(t.element):"Largest contentful paint",l={};t?.element&&(l["browser.web_vital.lcp.element"]=Ue(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),bm({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 Nm(e){let t=0,n;if(!vi("layout-shift"))return;let r=Yr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);Ei(e,(o,i,s)=>{SA(t,n,s,o),r()})}function SA(e,t,n,r){Ct&&C.log(`Sending CLS span (${e})`);let o=t?Pe((He()||0)+t.startTime):Ae(),i=t?Ue(t.sources[0]?.node):"Layout shift",s={};t?.sources&&t.sources.forEach((a,l)=>{s[`browser.web_vital.cls.source.${l+1}`]=Ue(a.node)}),bm({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:s,parentSpan:n,reportEvent:r,startTime:o})}function Am(){if(!Xr()||!He())return;_i(({metric:n})=>{if(n.value==null||Pe(n.value)>Cm)return;let o=n.entries.find(i=>i.duration===n.value&&ws[i.name]);o&&_A(n.value,o)})}function _A(e,t){Ct&&C.log(`Sending INP span (${e})`);let n=Pe(He()+t.startTime),r=Pe(e),o=ws[t.name],i=IE(t.interactionId),s=Me(),a=s?be(s):void 0,l=i?.span||a,c=l?Fa(l).name:te().getScopeData().transactionName,u=i?.elementName||Ue(t.target);bm({name:u,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[jt]:t.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var vA=1e3,wE,Mm,Pm;function cl(e){Ft("dom",e),Bt("dom",EA)}function EA(){if(!q.document)return;let e=mt.bind(null,"dom"),t=CE(e,!0);q.document.addEventListener("click",t,!1),q.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=q[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(st(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 f=CE(e);u.handler=f,i.call(this,s,f,l)}u.refCount++}catch{}return i.call(this,s,a,l)}}),st(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 TA(e){if(e.type!==Mm)return!1;try{if(!e.target||e.target._sentryId!==Pm)return!1}catch{}return!0}function IA(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function CE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=wA(n);if(IA(n.type,r))return;Ve(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ve(r,"_sentryId",at());let o=n.type==="keypress"?"input":n.type;TA(n)||(e({event:n,name:o,global:t}),Mm=n.type,Pm=r?r._sentryId:void 0),clearTimeout(wE),wE=q.setTimeout(()=>{Pm=void 0,Mm=void 0},vA)}}function wA(e){try{return e.target}catch{return null}}var bu;function Qr(e){let t="history";Ft(t,e),Bt(t,CA)}function CA(){if(q.addEventListener("popstate",()=>{let t=q.location.href,n=bu;if(bu=t,n===t)return;mt("history",{from:n,to:t})}),!sm())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=bu,i=RA(String(r));if(bu=i,o===i)return t.apply(this,n);mt("history",{from:o,to:i})}return t.apply(this,n)}}st(q.history,"pushState",e),st(q.history,"replaceState",e)}function RA(e){try{return new URL(e,q.location.origin).toString()}catch{return e}}var ku={};function Nu(e){let t=ku[e];if(t)return t;let n=q[e];if(ol(n))return ku[e]=n.bind(q);let r=q.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){Ct&&C.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(ku[e]=n.bind(q))}function Lm(e){ku[e]=void 0}function Ii(...e){return Nu("setTimeout")(...e)}var ur="__sentry_xhr_v3__";function ul(e){Ft("xhr",e),Bt("xhr",xA)}function xA(){if(!q.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,i=Ae()*1e3,s=Ht(r[0])?r[0].toUpperCase():void 0,a=bA(r[1]);if(!s||!a)return t.apply(n,r);n[ur]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let l=()=>{let c=n[ur];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}let u={endTimestamp:Ae()*1e3,startTimestamp:i,xhr:n,virtualError:o};mt("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,f){return l(),c.apply(u,f)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,f){let[p,h]=f,y=u[ur];return y&&Ht(p)&&Ht(h)&&(y.request_headers[p.toLowerCase()]=h),c.apply(u,f)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){let o=n[ur];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:Ae()*1e3,xhr:n};return mt("xhr",i),t.apply(n,r)}})}function bA(e){if(Ht(e))return e;try{return e.toString()}catch{}}var kA=Symbol.for("sentry__originalRequestBody");function Au(e){return new URLSearchParams(e).toString()}function Mu(e,t=C){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Au(e)];if(!e)return[void 0]}catch(n){return Ct&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Ct&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Pu(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][kA];return n!==void 0?n:void 0}}function dl(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Ct&&C.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 Om(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var NA=40;function RE(e,t=Nu("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 Lm("fetch"),l}finally{n-=s,r--}}return tu(e,o,gi(e.bufferSize||NA))}var et=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var AA=30;var MA=50;function Dm(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 PA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,LA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,OA=/\((\S*)(?::(\d+))(?::(\d+))\)/,DA=/at (.+?) ?\(data:(.+?),/,UA=e=>{let t=e.match(DA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=PA.exec(e);if(n){let[,o,i,s]=n;return Dm(o,"?",+i,+s)}let r=LA.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=OA.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[i,s]=bE(r[1]||"?",r[2]);return Dm(s,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},FA=[AA,UA],BA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,HA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$A=e=>{let t=BA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=HA.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]=bE(o,r),Dm(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},zA=[MA,$A];var jA=[FA,zA],xE=Sa(...jA),bE=(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 Lu=1024,WA="Breadcrumbs",GA=((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:WA,setup(n){t.console&&rm(YA(n)),t.dom&&cl(qA(n,t.dom)),t.xhr&&ul(KA(n)),t.fetch&&Co(JA(n)),t.history&&Qr(XA(n)),t.sentry&&n.on("beforeSendEvent",VA(n))}}}),kE=GA;function VA(e){return function(n){$()===e&&kn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:sr(n)},{event:n})}}function qA(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>Lu&&(et&&C.warn(`\`dom.maxStringLength\` cannot exceed ${Lu}, but a value of ${a} was configured. Sentry will use ${Lu} instead.`),a=Lu),typeof s=="string"&&(s=[s]);try{let c=r.event,u=QA(c)?c.target:c;o=Ue(u,{keyAttrs:s,maxStringLength:a}),i=ys(u)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${r.name}`,message:o};i&&(l.data={"ui.component_name":i}),kn(l,{event:r.event,name:r.name,global:r.global})}}function YA(e){return function(n){if($()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:gs(n.level),message:ba(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${ba(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;kn(r,{input:n.args,level:n.level})}}function KA(e){return function(n){if($()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[ur];if(!r||!o||!i)return;let{method:s,url:a,status_code:l,body:c}=i,u={method:s,url:a,status_code:l},f={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},p={category:"xhr",data:u,type:"http",level:uu(l)};e.emit("beforeOutgoingRequestBreadcrumb",p,f),kn(p,f)}}function JA(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),kn(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:uu(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),kn(l,a)}}}function XA(e){return function(n){if($()!==e)return;let r=n.from,o=n.to,i=zn(ee.location.href),s=r?zn(r):void 0,a=zn(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),kn({category:"navigation",data:{from:r,to:o}})}}function QA(e){return!!e&&!!e.target}var ZA="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(","),e1="BrowserApiErrors",t1=((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:e1,setupOnce(){t.setTimeout&&st(ee,"setTimeout",NE),t.setInterval&&st(ee,"setInterval",NE),t.requestAnimationFrame&&st(ee,"requestAnimationFrame",n1),t.XMLHttpRequest&&"XMLHttpRequest"in ee&&st(XMLHttpRequest.prototype,"send",r1);let n=t.eventTarget;n&&(Array.isArray(n)?n:ZA).forEach(o=>o1(o,t))}}}),AE=t1;function NE(e){return function(...t){let n=t[0];return t[0]=yi(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Qt(e)}`}}),e.apply(this,t)}}function n1(e){return function(t){return e.apply(this,[yi(t,{mechanism:{data:{handler:Qt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function r1(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&st(n,o,function(i){let s={mechanism:{data:{handler:Qt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=So(i);return a&&(s.mechanism.data.handler=Qt(a)),yi(i,s)})}),e.apply(this,t)}}function o1(e,t){let r=ee[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(st(r,"addEventListener",function(o){return function(i,s,a){try{i1(s)&&(s.handleEvent=yi(s.handleEvent,{mechanism:{data:{handler:Qt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&s1(this,i,s),o.apply(this,[i,yi(s,{mechanism:{data:{handler:Qt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),st(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 i1(e){return typeof e.handleEvent=="function"}function s1(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var ME=(e={})=>{let t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof ee.document>"u"){et&&C.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}fs({ignoreDuration:!0}),hi();let n=Xe(),r=n.getUser();n.addScopeListener(o=>{let i=o.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(hi(),r=i)}),t==="route"&&Qr(({from:o,to:i})=>{o!==i&&(fs({ignoreDuration:!0}),hi())})}}};var a1="CultureContext",l1=(()=>({name:a1,preprocessEvent(e){let t=PE();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=PE();t&&Io(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),LE=l1;function PE(){try{let e=ee.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var c1="GlobalHandlers",u1=((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:c1,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(d1(n),OE("onerror")),t.onunhandledrejection&&(f1(n),OE("onunhandledrejection"))}}}),DE=u1;function d1(e){Ea(t=>{let{stackParser:n,attachStacktrace:r}=UE();if($()!==e||cm())return;let{msg:o,url:i,line:s,column:a,error:l}=t,c=h1(hu(n,l||o,void 0,r,!1),i,s,a);c.level="error",ds(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function f1(e){Ta(t=>{let{stackParser:n,attachStacktrace:r}=UE();if($()!==e||cm())return;let o=p1(t),i=un(o)?m1(o):hu(n,o,void 0,r,!0);i.level="error",ds(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function p1(e){if(un(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 m1(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function h1(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:g1(t)??hn(),function:"?",in_app:!0}),e}function OE(e){et&&C.log(`Global Handler attached: ${e}`)}function UE(){return $()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function g1(e){if(!(!Ht(e)||e.length===0))return e.startsWith("data:")?`<${Wt(e,!1)}>`:e}var FE=()=>({name:"HttpContext",preprocessEvent(e){if(!ee.navigator&&!ee.location&&!ee.document)return;let t=Ss(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!ee.navigator&&!ee.location&&!ee.document)return;let t=Ss();Io(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}});var y1="cause",S1=5,_1="LinkedErrors",v1=((e={})=>{let t=e.limit||S1,n=e.key||y1;return{name:_1,preprocessEvent(r,o,i){let s=i.getOptions();nm(pu,s.stackParser,n,t,r,o)}}}),BE=v1;var E1=/^HTML(\w*)Element$/;function fl(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Om(e)){let t=T1(e);if(E1.test(t))return`[HTMLElement: ${Ue(e)}]`}}function T1(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function HE(){return I1()?(et&&kt(()=>{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 I1(){if(typeof ee.window>"u")return!1;let e=ee;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let n=hn();return!(ee===ee.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function $E(e){return[su(),ou(),om(),AE(),kE(),DE(),BE(),lu(),FE(),LE(),ME()]}function Um(e={}){let t=!e.skipBrowserExtensionCheck&&HE(),n=e.defaultIntegrations==null?$E():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:kc(e.stackParser||xE),integrations:$p({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||RE};return Zi(fl),Kp(gu,r)}function Ou(e={}){let t=ee.document,n=t?.head||t?.body;if(!n){et&&C.error("[showReportDialog] Global document not defined");return}let r=te(),i=$()?.getDsn();if(!i){et&&C.error("[showReportDialog] DSN not configured");return}let s={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||qa()},a=ee.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=Bp(i,s);let{onLoad:l,onClose:c}=s;if(l&&(a.onload=l),c){let u=f=>{if(f.data==="__sentry_reportdialog_closed__")try{c()}finally{ee.removeEventListener("message",u)}};ee.addEventListener("message",u)}n.appendChild(a)}var je=G,ph="sentryReplaySession",w1="replay_event",mh="Unable to send Replay",C1=3e5,R1=9e5,x1=5e3,b1=5500,k1=6e4,N1=5e3,A1=3,zE=15e4,Du=5e3,M1=3e3,P1=300,hh=2e7,L1=4999,O1=5e4,jE=36e5,D1=Object.defineProperty,U1=(e,t,n)=>t in e?D1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WE=(e,t,n)=>U1(e,typeof t!="symbol"?t+"":t,n),gt=(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))(gt||{});function F1(e){return e.nodeType===e.ELEMENT_NODE}function hl(e){return e?.host?.shadowRoot===e}function gl(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function B1(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 H1(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 $u(e){try{let t=e.rules||e.cssRules;return t?B1(Array.from(t,mT).join("")):null}catch{return null}}function $1(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 mT(e){let t;if(j1(e))try{t=$u(e.styleSheet)||H1(e)}catch{}else if(W1(e)){let n=e.cssText,r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=$1(e)),r&&(n=z1(n)),r||o)return n}return t||e.cssText}function z1(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function j1(e){return"styleSheet"in e}function W1(e){return"selectorText"in e}var zu=class{constructor(){WE(this,"idNodeMap",new Map),WE(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 G1(){return new zu}function nd({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 Ms(e){return e.toLowerCase()}function jm(e){return e.toUpperCase()}var GE="__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=GE in i?i[GE]: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 gh(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ms(t):null}function ju(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function hT(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 VE={};function gT(e){let t=VE[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 VE[e]=r.bind(window)}function Wm(...e){return gT("setTimeout")(...e)}function yT(...e){return gT("clearTimeout")(...e)}function ST(e){try{return e.contentDocument}catch{}}function q1(e){try{return e.contentWindow}catch{}}var Y1=1,K1=new RegExp("[^a-z0-9-_:]"),_l=-2;function yh(){return Y1++}function J1(e){if(e instanceof HTMLFormElement)return"form";let t=Ms(e.tagName);return K1.test(t)?"div":t}function X1(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Cs,qE,Q1=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Z1=/^(?:[a-z+]+:)?\/\//i,eM=/^www\..*/i,tM=/^(data:)([^,]*),(.*)/i;function nM(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 Wu(e,t){return(e||"").replace(Q1,(n,r,o,i,s,a)=>{let l=o||s||a,c=r||i||"";if(!l)return n;if(Z1.test(l)||eM.test(l))return`url(${c}${l}${c})`;if(tM.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${X1(t)+l}${c})`;let u=t.split("/"),f=l.split("/");u.pop();for(let p of f)p!=="."&&(p===".."?u.pop():u.push(p));return`url(${c}${u.join("/")}${c})`})}var rM=/^[^ \t\n\r\u000c]+/,oM=/^[, \t\n\r\u000c]+/;function iM(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(oM),!(n>=t.length);){let i=r(rM);if(i.slice(-1)===",")i=bs(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=bs(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 YE=new WeakMap;function bs(e,t){return!t||t.trim()===""?t:rd(e,t)}function sM(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function rd(e,t){let n=YE.get(e);if(n||(n=e.createElement("a"),YE.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function _T(e,t,n,r,o,i,s){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return bs(e,r);if(n==="xlink:href"&&r[0]!=="#")return bs(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return bs(e,r);if(n==="srcset")return iM(e,r);if(n==="style"){let a=Wu(r,rd(e));return s&&s.size>0&&(a=nM(a,s)),a}else if(t==="object"&&n==="data")return bs(e,r);return typeof i=="function"?i(n,r,o):r}function vT(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function aM(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 lM(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function wi(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:wi(e.parentNode,t,n,r+1)}function ks(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(lM(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Ps(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=wi(s,ks(r,o)),l<0)return!0;a=wi(s,ks(t,n),l>=0?l:1/0)}else{if(a=wi(s,ks(t,n)),a<0)return!1;l=wi(s,ks(r,o),a>=0?a:1/0)}return a>=0?l>=0?a<=l:!0:l>=0?!1:!!i}catch{}return!!i}function cM(e,t,n){let r=q1(e);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let a=Wm(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{yT(a),o=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return Wm(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function uM(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let i=Wm(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{yT(i),r=!0,t()})}function dM(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:y={},maskTextFn:_,maskInputFn:T,dataURLOptions:g={},inlineImages:S,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:M=!1,ignoreCSSAttributes:A}=t,I=fM(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:gt.Document,childNodes:[],compatMode:e.compatMode}:{type:gt.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:gt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return mM(e,{doc:n,blockClass:o,blockSelector:i,unblockSelector:s,inlineStylesheet:h,maskAttributeFn:l,maskInputOptions:y,maskInputFn:T,dataURLOptions:g,inlineImages:S,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:M,rootId:I,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,ignoreCSSAttributes:A});case e.TEXT_NODE:return pM(e,{doc:n,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,maskTextFn:_,maskInputOptions:y,maskInputFn:T,rootId:I});case e.CDATA_SECTION_NODE:return{type:gt.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:gt.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function fM(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function pM(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:s,maskTextFn:a,maskInputOptions:l,maskInputFn:c,rootId:u}=t,f=e.parentNode&&e.parentNode.tagName,p=e.textContent,h=f==="STYLE"?!0:void 0,y=f==="SCRIPT"?!0:void 0,_=f==="TEXTAREA"?!0:void 0;if(h&&p){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(p=$u(e.parentNode.sheet))}catch(g){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${g}`,e)}p=Wu(p,rd(t.doc))}y&&(p="SCRIPT_PLACEHOLDER");let T=Ps(e,r,i,o,s,n);if(!h&&!y&&!_&&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,"*")),f==="OPTION"&&p){let g=nd({type:null,tagName:f,maskInputOptions:l});p=Sl({isMasked:Ps(e,r,i,o,s,g),element:e,value:p,maskInputFn:c})}return{type:gt.Text,textContent:p||"",isStyle:h,rootId:u}}function mM(e,t){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:s,maskInputOptions:a={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:u={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:y=!1,rootId:_,maskTextClass:T,unmaskTextClass:g,maskTextSelector:S,unmaskTextSelector:E,ignoreCSSAttributes:R}=t,M=aM(e,r,o,i),A=J1(e),I={},N=e.attributes.length;for(let x=0;x<N;x++){let H=e.attributes[x];H.name&&!vT(A,H.name,H.value)&&(I[H.name]=_T(n,A,Ms(H.name),H.value,e,l,R))}if(A==="link"&&s){let x=Array.from(n.styleSheets).find(j=>j.href===e.href),H=null;x&&(H=$u(x)),H&&(I.rel=null,I.href=null,I.crossorigin=null,I._cssText=Wu(H,x.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let x=$u(e.sheet);x&&(I._cssText=Wu(x,rd(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){let x=e,H=gh(x),j=ju(x,jm(A),H),ge=x.checked;if(H!=="submit"&&H!=="button"&&j){let X=Ps(x,T,S,g,E,nd({type:H,tagName:jm(A),maskInputOptions:a}));I.value=Sl({isMasked:X,element:x,value:j,maskInputFn:c})}ge&&(I.checked=ge)}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 x=e.toDataURL(u.type,u.quality),H=n.createElement("canvas");H.width=e.width,H.height=e.height;let j=H.toDataURL(u.type,u.quality);x!==j&&(I.rr_dataURL=x)}}if(A==="img"&&f){Cs||(Cs=n.createElement("canvas"),qE=Cs.getContext("2d"));let x=e,H=x.currentSrc||x.getAttribute("src")||"<unknown-src>",j=x.crossOrigin,ge=()=>{x.removeEventListener("load",ge);try{Cs.width=x.naturalWidth,Cs.height=x.naturalHeight,qE.drawImage(x,0,0),I.rr_dataURL=Cs.toDataURL(u.type,u.quality)}catch(X){if(x.crossOrigin!=="anonymous"){x.crossOrigin="anonymous",x.complete&&x.naturalWidth!==0?ge():x.addEventListener("load",ge);return}else console.warn(`Cannot inline img src=${H}! Error: ${X}`)}x.crossOrigin==="anonymous"&&(j?I.crossOrigin=j:x.removeAttribute("crossorigin"))};x.complete&&x.naturalWidth!==0?ge():x.addEventListener("load",ge)}if((A==="audio"||A==="video")&&(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop)),M){let{width:x,height:H}=e.getBoundingClientRect();I={class:I.class,rr_width:`${x}px`,rr_height:`${H}px`}}A==="iframe"&&!h(I.src)&&(!M&&!ST(e)&&(I.rr_src=I.src),delete I.src);let U;try{customElements.get(A)&&(U=!0)}catch{}return{type:gt.Element,tagName:A,attributes:I,childNodes:[],isSVG:sM(e)||void 0,needBlock:M,rootId:_,isCustom:U}}function ze(e){return e==null?"":e.toLowerCase()}function hM(e,t){if(t.comment&&e.type===gt.Comment)return!0;if(e.type===gt.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"&&hT(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ze(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ze(e.attributes.name)==="application-name"||ze(e.attributes.rel)==="icon"||ze(e.attributes.rel)==="apple-touch-icon"||ze(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ze(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ze(e.attributes.property).match(/^(og|twitter|fb):/)||ze(e.attributes.name).match(/^(og|twitter):/)||ze(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ze(e.attributes.name)==="robots"||ze(e.attributes.name)==="googlebot"||ze(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ze(e.attributes.name)==="author"||ze(e.attributes.name)==="generator"||ze(e.attributes.name)==="framework"||ze(e.attributes.name)==="publisher"||ze(e.attributes.name)==="progid"||ze(e.attributes.property).match(/^article:/)||ze(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ze(e.attributes.name)==="google-site-verification"||ze(e.attributes.name)==="yandex-verification"||ze(e.attributes.name)==="csrf-token"||ze(e.attributes.name)==="p:domain_verify"||ze(e.attributes.name)==="verify-v1"||ze(e.attributes.name)==="verification"||ze(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ns(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:y={},maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E={},inlineImages:R=!1,recordCanvas:M=!1,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N=5e3,onBlockedImageLoad:U,onStylesheetLoad:x,stylesheetLoadTimeout:H=5e3,keepIframeSrcFn:j=()=>!1,newlyAddedElement:ge=!1,ignoreCSSAttributes:X}=t,{preserveWhiteSpace:Ze=!0}=t,fe=dM(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,dataURLOptions:E,inlineImages:R,recordCanvas:M,keepIframeSrcFn:j,newlyAddedElement:ge,ignoreCSSAttributes:X});if(!fe)return console.warn(e,"not serialized"),null;let de;r.hasNode(e)?de=r.getId(e):hM(fe,S)||!Ze&&fe.type===gt.Text&&!fe.isStyle&&!fe.textContent.trim().length?de=_l:de=yh();let D=Object.assign(fe,{id:de});if(r.add(e,D),de===_l)return null;A&&A(e);let ye=!p;if(D.type===gt.Element){ye=ye&&!D.needBlock;let Q=e.shadowRoot;Q&&gl(Q)&&(D.isShadowHost=!0)}if((D.type===gt.Document||D.type===gt.Element)&&ye){S.headWhitespace&&D.type===gt.Element&&D.tagName==="head"&&(Ze=!1);let Q={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:p,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:Ze,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onBlockedImageLoad:U,onStylesheetLoad:x,stylesheetLoadTimeout:H,keepIframeSrcFn:j,ignoreCSSAttributes:X},ae=e.childNodes?Array.from(e.childNodes):[];for(let Re of ae){let Te=Ns(Re,Q);Te&&D.childNodes.push(Te)}if(F1(e)&&e.shadowRoot)for(let Re of Array.from(e.shadowRoot.childNodes)){let Te=Ns(Re,Q);Te&&(gl(e.shadowRoot)&&(Te.isShadow=!0),D.childNodes.push(Te))}}if(e.parentNode&&hl(e.parentNode)&&gl(e.parentNode)&&(D.isShadow=!0),D.type===gt.Element&&D.tagName==="iframe"&&!D.needBlock&&cM(e,()=>{let Q=ST(e);if(Q&&I){let ae=Ns(Q,{doc:Q,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:Ze,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:x,stylesheetLoadTimeout:H,keepIframeSrcFn:j,ignoreCSSAttributes:X});ae&&I(e,ae)}},N),D.type===gt.Element&&D.tagName==="img"&&!e.complete&&D.needBlock){let Q=e,ae=()=>{if(Q.isConnected&&!Q.complete&&U)try{let Re=Q.getBoundingClientRect();Re.width>0&&Re.height>0&&U(Q,D,Re)}catch{}Q.removeEventListener("load",ae)};Q.isConnected&&Q.addEventListener("load",ae)}return D.type===gt.Element&&D.tagName==="link"&&typeof D.attributes.rel=="string"&&(D.attributes.rel==="stylesheet"||D.attributes.rel==="preload"&&typeof D.attributes.href=="string"&&hT(D.attributes.href)==="css")&&uM(e,()=>{if(x){let Q=Ns(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:Ze,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:x,stylesheetLoadTimeout:H,keepIframeSrcFn:j,ignoreCSSAttributes:X});Q&&x(e,Q)}},H),D.type===gt.Element&&delete D.needBlock,D}function gM(e,t){let{mirror:n=new zu,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:f=!0,inlineImages:p=!1,recordCanvas:h=!1,maskAllInputs:y=!1,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOM:S=!1,dataURLOptions:E,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:x,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:j=new Set([])}=t||{};return Ns(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:s,maskTextClass:a,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:y===!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}:y===!1?{}:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,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:E,inlineImages:p,recordCanvas:h,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:x,keepIframeSrcFn:H,newlyAddedElement:!1,ignoreCSSAttributes:j})}function rn(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Rs=`Please stop import mirror directly. Instead of that,\r
27
+ Error:`,o)}}function WN(){return oE(e=>{sl("cls",{metric:e}),dE=e},{reportAllChanges:!0})}function GN(){return cE(e=>{sl("lcp",{metric:e}),fE=e},{reportAllChanges:!0})}function VN(){return uE(e=>{sl("ttfb",{metric:e}),pE=e})}function qN(){return lE(e=>{sl("inp",{metric:e}),mE=e})}function wu(e,t,n,r,o=!1){hE(e,t);let i;return Iu[e]||(i=n(),Iu[e]=!0),r&&t({metric:r}),gE(e,t,o?i:void 0)}function YN(e){let t={};e==="event"&&(t.durationThreshold=0),Vn(e,n=>{sl(e,{entries:n})},t)}function hE(e,t){il[e]=il[e]||[],il[e].push(t)}function gE(e,t,n){return()=>{n&&n();let r=il[e];if(!r)return;let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function yE(e){return"duration"in e}var KN=80;function Ue(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,f=!Array.isArray(t)&&t.maxStringLength||KN;for(;n&&i++<r&&(c=JN(n,u),!(c==="html"||i>1&&s+o.length*l+c.length>=f));)o.push(c),s+=c.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function JN(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&&Ht(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 SE=e=>{let t=n=>{(n.type==="pagehide"||q.document?.visibilityState==="hidden")&&e(n)};Gn("visibilitychange",t,{capture:!0,once:!0}),Gn("pagehide",t,{capture:!0,once:!0})};function Cu(e){return typeof e=="number"&&isFinite(e)}function Jr(e,t,n,{...r}){let o=ne(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),ls(e,()=>{let i=wt({startTime:t,...r});return i&&i.end(n),i})}function Ts(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(),f=te(),p=f.getUser(),h=p!==void 0?p.email||p.id||p.ip_address:void 0,y;try{y=f.getScopeData().contexts.profile.profile_id}catch{}let _={release:s,environment:a,user:h||void 0,profile_id:y||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":q.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return wt({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function Xr(){return q.addEventListener&&q.performance}function Pe(e){return e/1e3}function _E(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 vi(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Ei(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}SE(()=>{o("pagehide")});let i=e.on("beforeStartNavigationSpan",(a,l)=>{l?.isRedirect||(o("navigation"),i(),s())}),s=e.on("afterStartPageLoadSpan",a=>{n=a,s()})}function vE(e){let t=0,n;if(!vi("layout-shift"))return;let r=Yr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);Ei(e,(o,i)=>{XN(t,n,i,o),r()})}function XN(e,t,n,r){Ct&&C.log(`Sending CLS span (${e})`);let o=t?Pe((He()||0)+t.startTime):Ae(),i=te().getScopeData().transactionName,s=t?Ue(t.sources[0]?.node):"Layout shift",a={[we]:"auto.http.browser.cls",[qe]:"ui.webvital.cls",[jt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((c,u)=>{a[`cls.source.${u+1}`]=Ue(c.node)});let l=Ts({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("cls",{[ar]:"",[lr]:e}),l.end(o))}var QN=6e4;function Ti(e){return e!=null&&e>0&&e<=QN}function EE(e){let t=0,n;if(!vi("largest-contentful-paint"))return;let r=Kr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ti(o.value)||(t=o.value,n=i)},!0);Ei(e,(o,i)=>{ZN(t,n,i,o),r()})}function ZN(e,t,n,r){if(!Ti(e))return;Ct&&C.log(`Sending LCP span (${e})`);let o=Pe((He()||0)+(t?.startTime||0)),i=te().getScopeData().transactionName,s=t?Ue(t.element):"Largest contentful paint",a={[we]:"auto.http.browser.lcp",[qe]:"ui.webvital.lcp",[jt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Ue(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=Ts({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[ar]:"millisecond",[lr]:e}),l.end(o))}function qn(e){return e&&((He()||performance.timeOrigin)+e)/1e3}function al(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=_E(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return He()||Xr()?.timeOrigin?eA({...t,"http.request.redirect_start":qn(e.redirectStart),"http.request.redirect_end":qn(e.redirectEnd),"http.request.worker_start":qn(e.workerStart),"http.request.fetch_start":qn(e.fetchStart),"http.request.domain_lookup_start":qn(e.domainLookupStart),"http.request.domain_lookup_end":qn(e.domainLookupEnd),"http.request.connect_start":qn(e.connectStart),"http.request.secure_connection_start":qn(e.secureConnectionStart),"http.request.connection_end":qn(e.connectEnd),"http.request.request_start":qn(e.requestStart),"http.request.response_start":qn(e.responseStart),"http.request.response_end":qn(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function eA(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var tA=2147483647,TE=0,tn={},gn,xu;function _m({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=Xr();if(r&&He()){r.mark&&q.performance.mark("sentry-tracing-init");let o=t?EE(n):t===!1?rA():void 0,i=e?vE(n):e===!1?nA():void 0,s=oA();return()=>{s(),o?.(),i?.()}}return()=>{}}function vm(){cr("longtask",({entries:e})=>{let t=Me();if(!t)return;let{op:n,start_timestamp:r}=ne(t);for(let o of e){let i=Pe(He()+o.startTime),s=Pe(o.duration);n==="navigation"&&r&&i<r||Jr(t,i,i+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[we]:"auto.ui.browser.metrics"}})}})}function Em(){new PerformanceObserver(t=>{let n=Me();if(n)for(let r of t.getEntries()){if(!r.scripts[0])continue;let o=Pe(He()+r.startTime),{start_timestamp:i,op:s}=ne(n);if(s==="navigation"&&i&&o<i)continue;let a=Pe(r.duration),l={[we]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:u,invokerType:f,sourceURL:p,sourceFunctionName:h,sourceCharPosition:y}=c;l["browser.script.invoker"]=u,l["browser.script.invoker_type"]=f,p&&(l["code.filepath"]=p),h&&(l["code.function"]=h),y!==-1&&(l["browser.script.source_char_position"]=y),Jr(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function Tm(){cr("event",({entries:e})=>{let t=Me();if(t){for(let n of e)if(n.name==="click"){let r=Pe(He()+n.startTime),o=Pe(n.duration),i={name:Ue(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[we]:"auto.ui.browser.metrics"}},s=ys(n.target);s&&(i.attributes["ui.component_name"]=s),Jr(t,r,r+o,i)}}})}function nA(){return Yr(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(tn.cls={value:e.value,unit:""},xu=t)},!0)}function rA(){return Kr(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!Ti(e.value)||(tn.lcp={value:e.value,unit:"millisecond"},gn=t)},!0)}function oA(){return Sm(({metric:e})=>{e.entries[e.entries.length-1]&&(tn.ttfb={value:e.value,unit:"millisecond"})})}function Im(e,t){let n=Xr(),r=He();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:s,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:l}=t,c=Pe(r),u=n.getEntries(),{op:f,start_timestamp:p}=ne(e);if(u.slice(TE).forEach(h=>{let y=Pe(h.startTime),_=Pe(Math.max(0,h.duration));if(!(f==="navigation"&&p&&c+y<p))switch(h.entryType){case"navigation":{lA(e,h,c);break}case"mark":case"paint":case"measure":{sA(e,h,y,_,c,i);let T=Rr(),g=h.startTime<T.firstHiddenTime;h.name==="first-paint"&&g&&(tn.fp={value:h.startTime,unit:"millisecond"}),h.name==="first-contentful-paint"&&g&&(tn.fcp={value:h.startTime,unit:"millisecond"});break}case"resource":{dA(e,h,h.name,y,_,c,s);break}}}),TE=Math.max(u.length-1,0),fA(e,o),f==="pageload"){if(hA(tn),o){let h=(y,_,T)=>{let g=T??`browser.web_vital.${y}.value`;e.setAttribute(g,_),Ct&&C.log("Setting web vital attribute",{[g]:_},"on pageload span")};["ttfb","fp","fcp"].forEach(y=>{tn[y]&&h(y,tn[y].value)}),tn["ttfb.requestTime"]&&h("ttfb.requestTime",tn["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete tn.cls,l||delete tn.lcp,Object.entries(tn).forEach(([h,y])=>{Kc(h,y.value,y.unit)}),pA(e,t);e.setAttribute(o?"browser.performance.time_origin":"performance.timeOrigin",c),e.setAttribute(o?"browser.performance.navigation.activation_start":"performance.activationStart",Wn())}gn=void 0,xu=void 0,tn={}}function iA(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components \u269B"}catch{return}}function sA(e,t,n,r,o,i){if(iA(t)||["mark","measure"].includes(t.entryType)&&Nt(t.name,i))return;let s=qr(!1),a=Pe(s?s.requestStart:0),l=o+Math.max(n,a),c=o+n,u=c+r,f={[we]:"auto.resource.browser.metrics"};l!==c&&(f["sentry.browser.measure_happened_before_request"]=!0,f["sentry.browser.measure_start_time"]=l),aA(f,t),l<=u&&Jr(e,l,u,{name:t.name,op:t.entryType,attributes:f})}function aA(e,t){try{let n=t.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&un(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(un(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function lA(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ru(e,t,r,n)}),Ru(e,t,"secureConnection",n,"TLS/SSL"),Ru(e,t,"fetch",n,"cache"),Ru(e,t,"domainLookup",n,"DNS"),uA(e,t,n)}function Ru(e,t,n,r,o=n){let i=cA(n),s=t[i],a=t[`${n}Start`];!a||!s||Jr(e,r+Pe(a),r+Pe(s),{op:`browser.${o}`,name:t.name,attributes:{[we]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function cA(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function uA(e,t,n){let r=n+Pe(t.requestStart),o=n+Pe(t.responseEnd),i=n+Pe(t.responseStart);t.responseEnd&&(Jr(e,r,o,{op:"browser.request",name:t.name,attributes:{[we]:"auto.ui.browser.metrics"}}),Jr(e,i,o,{op:"browser.response",name:t.name,attributes:{[we]:"auto.ui.browser.metrics"}}))}function dA(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={[we]:"auto.resource.browser.metrics"},c=zn(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(q.location.origin),mA(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,...al(t)},f=i+r,p=f+o;Jr(e,f,p,{name:n.replace(q.location.origin,""),op:a,attributes:u})}function fA(e,t){let n=q.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),Cu(r.rtt)&&(tn["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),Cu(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),Cu(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function pA(e,t){gn&&t.recordLcpOnPageloadSpan&&(gn.element&&e.setAttribute("lcp.element",Ue(gn.element)),gn.id&&e.setAttribute("lcp.id",gn.id),gn.url&&e.setAttribute("lcp.url",gn.url.trim().slice(0,200)),gn.loadTime!=null&&e.setAttribute("lcp.loadTime",gn.loadTime),gn.renderTime!=null&&e.setAttribute("lcp.renderTime",gn.renderTime),e.setAttribute("lcp.size",gn.size)),xu?.sources&&t.recordClsOnPageloadSpan&&xu.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ue(n.node)))}function mA(e,t,n){n.forEach(([r,o])=>{let i=e[r];i!=null&&(typeof i=="number"&&i<tA||typeof i=="string")&&(t[o]=i)})}function hA(e){let t=qr(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var wm=[],ll=new Map,Is=new Map,Cm=60;function Rm(){if(Xr()&&He()){let t=gA();return()=>{t()}}return()=>{}}var ws={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 gA(){return _i(yA)}var yA=({metric:e})=>{if(e.value==null)return;let t=Pe(e.value);if(t>Cm)return;let n=e.entries.find(y=>y.duration===e.value&&ws[y.name]);if(!n)return;let{interactionId:r}=n,o=ws[n.name],i=Pe(He()+n.startTime),s=Me(),a=s?be(s):void 0,l=r!=null?ll.get(r):void 0,c=l?.span||a,u=c?ne(c).description:te().getScopeData().transactionName,f=l?.elementName||Ue(n.target),p={[we]:"auto.http.browser.inp",[qe]:`ui.interaction.${o}`,[jt]:n.duration},h=Ts({name:f,transaction:u,attributes:p,startTime:i});h&&(h.addEvent("inp",{[ar]:"millisecond",[lr]:e.value}),h.end(i+t))};function IE(e){return e!=null?ll.get(e):void 0}function xm(){let e=Object.keys(ws);jn()&&e.forEach(o=>{q.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){let i=o.target;if(!i)return;let s=Ue(i),a=Math.round(o.timeStamp);if(Is.set(a,s),Is.size>50){let l=Is.keys().next().value;l!==void 0&&Is.delete(l)}}function n(o){let i=Math.round(o.startTime),s=Is.get(i);if(!s)for(let a=-5;a<=5;a++){let l=Is.get(i+a);if(l){s=l;break}}return s||"<unknown>"}let r=({entries:o})=>{let i=Me(),s=i&&be(i);o.forEach(a=>{if(!yE(a))return;let l=a.interactionId;if(l==null||ll.has(l))return;let c=a.target?Ue(a.target):n(a);if(wm.length>10){let u=wm.shift();ll.delete(u)}wm.push(l),ll.set(l,{span:s,elementName:c})})};cr("event",r),cr("first-input",r)}function bm(e){let{name:t,op:n,origin:r,metricName:o,value:i,attributes:s,parentSpan:a,reportEvent:l,startTime:c,endTime:u}=e,f=te().getScopeData().transactionName,p={[we]:r,[qe]:n,[jt]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":f,"user_agent.original":q.navigator?.userAgent,...s};a&&Fa(a).attributes?.[qe]==="pageload"&&(p["sentry.pageload.span_id"]=a.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let h=wt({name:t,attributes:p,startTime:c,parentSpan:a});h&&h.end(u??c)}function km(e){let t=0,n;if(!vi("largest-contentful-paint"))return;let r=Kr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ti(o.value)||(t=o.value,n=i)},!0);Ei(e,(o,i,s)=>{SA(t,n,s,o),r()})}function SA(e,t,n,r){if(!Ti(e))return;Ct&&C.log(`Sending LCP span (${e})`);let o=He()||0,i=Pe(o),s=Pe(o+(t?.startTime||0)),a=t?Ue(t.element):"Largest contentful paint",l={};t?.element&&(l["browser.web_vital.lcp.element"]=Ue(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),bm({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 Nm(e){let t=0,n;if(!vi("layout-shift"))return;let r=Yr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);Ei(e,(o,i,s)=>{_A(t,n,s,o),r()})}function _A(e,t,n,r){Ct&&C.log(`Sending CLS span (${e})`);let o=t?Pe((He()||0)+t.startTime):Ae(),i=t?Ue(t.sources[0]?.node):"Layout shift",s={};t?.sources&&t.sources.forEach((a,l)=>{s[`browser.web_vital.cls.source.${l+1}`]=Ue(a.node)}),bm({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:s,parentSpan:n,reportEvent:r,startTime:o})}function Am(){if(!Xr()||!He())return;_i(({metric:n})=>{if(n.value==null||Pe(n.value)>Cm)return;let o=n.entries.find(i=>i.duration===n.value&&ws[i.name]);o&&vA(n.value,o)})}function vA(e,t){Ct&&C.log(`Sending INP span (${e})`);let n=Pe(He()+t.startTime),r=Pe(e),o=ws[t.name],i=IE(t.interactionId),s=Me(),a=s?be(s):void 0,l=i?.span||a,c=l?Fa(l).name:te().getScopeData().transactionName,u=i?.elementName||Ue(t.target);bm({name:u,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[jt]:t.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var EA=1e3,wE,Mm,Pm;function cl(e){Ft("dom",e),Bt("dom",TA)}function TA(){if(!q.document)return;let e=mt.bind(null,"dom"),t=CE(e,!0);q.document.addEventListener("click",t,!1),q.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=q[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(st(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 f=CE(e);u.handler=f,i.call(this,s,f,l)}u.refCount++}catch{}return i.call(this,s,a,l)}}),st(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 IA(e){if(e.type!==Mm)return!1;try{if(!e.target||e.target._sentryId!==Pm)return!1}catch{}return!0}function wA(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function CE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=CA(n);if(wA(n.type,r))return;Ve(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ve(r,"_sentryId",at());let o=n.type==="keypress"?"input":n.type;IA(n)||(e({event:n,name:o,global:t}),Mm=n.type,Pm=r?r._sentryId:void 0),clearTimeout(wE),wE=q.setTimeout(()=>{Pm=void 0,Mm=void 0},EA)}}function CA(e){try{return e.target}catch{return null}}var bu;function Qr(e){let t="history";Ft(t,e),Bt(t,RA)}function RA(){if(q.addEventListener("popstate",()=>{let t=q.location.href,n=bu;if(bu=t,n===t)return;mt("history",{from:n,to:t})}),!sm())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=bu,i=xA(String(r));if(bu=i,o===i)return t.apply(this,n);mt("history",{from:o,to:i})}return t.apply(this,n)}}st(q.history,"pushState",e),st(q.history,"replaceState",e)}function xA(e){try{return new URL(e,q.location.origin).toString()}catch{return e}}var ku={};function Nu(e){let t=ku[e];if(t)return t;let n=q[e];if(ol(n))return ku[e]=n.bind(q);let r=q.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){Ct&&C.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(ku[e]=n.bind(q))}function Lm(e){ku[e]=void 0}function Ii(...e){return Nu("setTimeout")(...e)}var ur="__sentry_xhr_v3__";function ul(e){Ft("xhr",e),Bt("xhr",bA)}function bA(){if(!q.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,i=Ae()*1e3,s=Ht(r[0])?r[0].toUpperCase():void 0,a=kA(r[1]);if(!s||!a)return t.apply(n,r);n[ur]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let l=()=>{let c=n[ur];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}let u={endTimestamp:Ae()*1e3,startTimestamp:i,xhr:n,virtualError:o};mt("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,f){return l(),c.apply(u,f)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,f){let[p,h]=f,y=u[ur];return y&&Ht(p)&&Ht(h)&&(y.request_headers[p.toLowerCase()]=h),c.apply(u,f)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){let o=n[ur];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:Ae()*1e3,xhr:n};return mt("xhr",i),t.apply(n,r)}})}function kA(e){if(Ht(e))return e;try{return e.toString()}catch{}}var NA=Symbol.for("sentry__originalRequestBody");function Au(e){return new URLSearchParams(e).toString()}function Mu(e,t=C){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Au(e)];if(!e)return[void 0]}catch(n){return Ct&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Ct&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Pu(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][NA];return n!==void 0?n:void 0}}function dl(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Ct&&C.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 Om(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var AA=40;function RE(e,t=Nu("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 Lm("fetch"),l}finally{n-=s,r--}}return tu(e,o,gi(e.bufferSize||AA))}var et=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var MA=30;var PA=50;function Dm(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 LA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,OA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,DA=/\((\S*)(?::(\d+))(?::(\d+))\)/,UA=/at (.+?) ?\(data:(.+?),/,FA=e=>{let t=e.match(UA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=LA.exec(e);if(n){let[,o,i,s]=n;return Dm(o,"?",+i,+s)}let r=OA.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=DA.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[i,s]=bE(r[1]||"?",r[2]);return Dm(s,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},BA=[MA,FA],HA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$A=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,zA=e=>{let t=HA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=$A.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]=bE(o,r),Dm(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},jA=[PA,zA];var WA=[BA,jA],xE=Sa(...WA),bE=(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 Lu=1024,GA="Breadcrumbs",VA=((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:GA,setup(n){t.console&&rm(KA(n)),t.dom&&cl(YA(n,t.dom)),t.xhr&&ul(JA(n)),t.fetch&&Co(XA(n)),t.history&&Qr(QA(n)),t.sentry&&n.on("beforeSendEvent",qA(n))}}}),kE=VA;function qA(e){return function(n){$()===e&&kn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:sr(n)},{event:n})}}function YA(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>Lu&&(et&&C.warn(`\`dom.maxStringLength\` cannot exceed ${Lu}, but a value of ${a} was configured. Sentry will use ${Lu} instead.`),a=Lu),typeof s=="string"&&(s=[s]);try{let c=r.event,u=ZA(c)?c.target:c;o=Ue(u,{keyAttrs:s,maxStringLength:a}),i=ys(u)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${r.name}`,message:o};i&&(l.data={"ui.component_name":i}),kn(l,{event:r.event,name:r.name,global:r.global})}}function KA(e){return function(n){if($()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:gs(n.level),message:ba(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${ba(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;kn(r,{input:n.args,level:n.level})}}function JA(e){return function(n){if($()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[ur];if(!r||!o||!i)return;let{method:s,url:a,status_code:l,body:c}=i,u={method:s,url:a,status_code:l},f={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},p={category:"xhr",data:u,type:"http",level:uu(l)};e.emit("beforeOutgoingRequestBreadcrumb",p,f),kn(p,f)}}function XA(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),kn(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:uu(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),kn(l,a)}}}function QA(e){return function(n){if($()!==e)return;let r=n.from,o=n.to,i=zn(ee.location.href),s=r?zn(r):void 0,a=zn(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),kn({category:"navigation",data:{from:r,to:o}})}}function ZA(e){return!!e&&!!e.target}var e1="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(","),t1="BrowserApiErrors",n1=((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:t1,setupOnce(){t.setTimeout&&st(ee,"setTimeout",NE),t.setInterval&&st(ee,"setInterval",NE),t.requestAnimationFrame&&st(ee,"requestAnimationFrame",r1),t.XMLHttpRequest&&"XMLHttpRequest"in ee&&st(XMLHttpRequest.prototype,"send",o1);let n=t.eventTarget;n&&(Array.isArray(n)?n:e1).forEach(o=>i1(o,t))}}}),AE=n1;function NE(e){return function(...t){let n=t[0];return t[0]=yi(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Qt(e)}`}}),e.apply(this,t)}}function r1(e){return function(t){return e.apply(this,[yi(t,{mechanism:{data:{handler:Qt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function o1(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&st(n,o,function(i){let s={mechanism:{data:{handler:Qt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=So(i);return a&&(s.mechanism.data.handler=Qt(a)),yi(i,s)})}),e.apply(this,t)}}function i1(e,t){let r=ee[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(st(r,"addEventListener",function(o){return function(i,s,a){try{s1(s)&&(s.handleEvent=yi(s.handleEvent,{mechanism:{data:{handler:Qt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&a1(this,i,s),o.apply(this,[i,yi(s,{mechanism:{data:{handler:Qt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),st(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 s1(e){return typeof e.handleEvent=="function"}function a1(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var ME=(e={})=>{let t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof ee.document>"u"){et&&C.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}fs({ignoreDuration:!0}),hi();let n=Xe(),r=n.getUser();n.addScopeListener(o=>{let i=o.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(hi(),r=i)}),t==="route"&&Qr(({from:o,to:i})=>{o!==i&&(fs({ignoreDuration:!0}),hi())})}}};var l1="CultureContext",c1=(()=>({name:l1,preprocessEvent(e){let t=PE();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=PE();t&&Io(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),LE=c1;function PE(){try{let e=ee.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var u1="GlobalHandlers",d1=((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:u1,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(f1(n),OE("onerror")),t.onunhandledrejection&&(p1(n),OE("onunhandledrejection"))}}}),DE=d1;function f1(e){Ea(t=>{let{stackParser:n,attachStacktrace:r}=UE();if($()!==e||cm())return;let{msg:o,url:i,line:s,column:a,error:l}=t,c=g1(hu(n,l||o,void 0,r,!1),i,s,a);c.level="error",ds(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function p1(e){Ta(t=>{let{stackParser:n,attachStacktrace:r}=UE();if($()!==e||cm())return;let o=m1(t),i=un(o)?h1(o):hu(n,o,void 0,r,!0);i.level="error",ds(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function m1(e){if(un(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 h1(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function g1(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:y1(t)??hn(),function:"?",in_app:!0}),e}function OE(e){et&&C.log(`Global Handler attached: ${e}`)}function UE(){return $()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function y1(e){if(!(!Ht(e)||e.length===0))return e.startsWith("data:")?`<${Wt(e,!1)}>`:e}var FE=()=>({name:"HttpContext",preprocessEvent(e){if(!ee.navigator&&!ee.location&&!ee.document)return;let t=Ss(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!ee.navigator&&!ee.location&&!ee.document)return;let t=Ss();Io(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}});var S1="cause",_1=5,v1="LinkedErrors",E1=((e={})=>{let t=e.limit||_1,n=e.key||S1;return{name:v1,preprocessEvent(r,o,i){let s=i.getOptions();nm(pu,s.stackParser,n,t,r,o)}}}),BE=E1;var T1=/^HTML(\w*)Element$/;function fl(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Om(e)){let t=I1(e);if(T1.test(t))return`[HTMLElement: ${Ue(e)}]`}}function I1(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function HE(){return w1()?(et&&kt(()=>{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 w1(){if(typeof ee.window>"u")return!1;let e=ee;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let n=hn();return!(ee===ee.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function $E(e){return[su(),ou(),om(),AE(),kE(),DE(),BE(),lu(),FE(),LE(),ME()]}function Um(e={}){let t=!e.skipBrowserExtensionCheck&&HE(),n=e.defaultIntegrations==null?$E():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:kc(e.stackParser||xE),integrations:$p({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||RE};return Zi(fl),Kp(gu,r)}function Ou(e={}){let t=ee.document,n=t?.head||t?.body;if(!n){et&&C.error("[showReportDialog] Global document not defined");return}let r=te(),i=$()?.getDsn();if(!i){et&&C.error("[showReportDialog] DSN not configured");return}let s={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||qa()},a=ee.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=Bp(i,s);let{onLoad:l,onClose:c}=s;if(l&&(a.onload=l),c){let u=f=>{if(f.data==="__sentry_reportdialog_closed__")try{c()}finally{ee.removeEventListener("message",u)}};ee.addEventListener("message",u)}n.appendChild(a)}var je=G,ph="sentryReplaySession",C1="replay_event",mh="Unable to send Replay",R1=3e5,x1=9e5,b1=5e3,k1=5500,N1=6e4,A1=5e3,M1=3,zE=15e4,Du=5e3,P1=3e3,L1=300,hh=2e7,O1=4999,D1=5e4,jE=36e5,U1=Object.defineProperty,F1=(e,t,n)=>t in e?U1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WE=(e,t,n)=>F1(e,typeof t!="symbol"?t+"":t,n),gt=(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))(gt||{});function B1(e){return e.nodeType===e.ELEMENT_NODE}function hl(e){return e?.host?.shadowRoot===e}function gl(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function H1(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 $1(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 $u(e){try{let t=e.rules||e.cssRules;return t?H1(Array.from(t,mT).join("")):null}catch{return null}}function z1(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 mT(e){let t;if(W1(e))try{t=$u(e.styleSheet)||$1(e)}catch{}else if(G1(e)){let n=e.cssText,r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=z1(e)),r&&(n=j1(n)),r||o)return n}return t||e.cssText}function j1(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function W1(e){return"styleSheet"in e}function G1(e){return"selectorText"in e}var zu=class{constructor(){WE(this,"idNodeMap",new Map),WE(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 V1(){return new zu}function nd({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 Ms(e){return e.toLowerCase()}function jm(e){return e.toUpperCase()}var GE="__rrweb_original__";function q1(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=GE in i?i[GE]: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 gh(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ms(t):null}function ju(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function hT(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 VE={};function gT(e){let t=VE[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 VE[e]=r.bind(window)}function Wm(...e){return gT("setTimeout")(...e)}function yT(...e){return gT("clearTimeout")(...e)}function ST(e){try{return e.contentDocument}catch{}}function Y1(e){try{return e.contentWindow}catch{}}var K1=1,J1=new RegExp("[^a-z0-9-_:]"),_l=-2;function yh(){return K1++}function X1(e){if(e instanceof HTMLFormElement)return"form";let t=Ms(e.tagName);return J1.test(t)?"div":t}function Q1(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Cs,qE,Z1=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,eM=/^(?:[a-z+]+:)?\/\//i,tM=/^www\..*/i,nM=/^(data:)([^,]*),(.*)/i;function rM(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 Wu(e,t){return(e||"").replace(Z1,(n,r,o,i,s,a)=>{let l=o||s||a,c=r||i||"";if(!l)return n;if(eM.test(l)||tM.test(l))return`url(${c}${l}${c})`;if(nM.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${Q1(t)+l}${c})`;let u=t.split("/"),f=l.split("/");u.pop();for(let p of f)p!=="."&&(p===".."?u.pop():u.push(p));return`url(${c}${u.join("/")}${c})`})}var oM=/^[^ \t\n\r\u000c]+/,iM=/^[, \t\n\r\u000c]+/;function sM(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(iM),!(n>=t.length);){let i=r(oM);if(i.slice(-1)===",")i=bs(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=bs(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 YE=new WeakMap;function bs(e,t){return!t||t.trim()===""?t:rd(e,t)}function aM(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function rd(e,t){let n=YE.get(e);if(n||(n=e.createElement("a"),YE.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function _T(e,t,n,r,o,i,s){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return bs(e,r);if(n==="xlink:href"&&r[0]!=="#")return bs(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return bs(e,r);if(n==="srcset")return sM(e,r);if(n==="style"){let a=Wu(r,rd(e));return s&&s.size>0&&(a=rM(a,s)),a}else if(t==="object"&&n==="data")return bs(e,r);return typeof i=="function"?i(n,r,o):r}function vT(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function lM(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 cM(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function wi(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:wi(e.parentNode,t,n,r+1)}function ks(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(cM(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Ps(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=wi(s,ks(r,o)),l<0)return!0;a=wi(s,ks(t,n),l>=0?l:1/0)}else{if(a=wi(s,ks(t,n)),a<0)return!1;l=wi(s,ks(r,o),a>=0?a:1/0)}return a>=0?l>=0?a<=l:!0:l>=0?!1:!!i}catch{}return!!i}function uM(e,t,n){let r=Y1(e);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let a=Wm(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{yT(a),o=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return Wm(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function dM(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let i=Wm(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{yT(i),r=!0,t()})}function fM(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:y={},maskTextFn:_,maskInputFn:T,dataURLOptions:g={},inlineImages:S,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:M=!1,ignoreCSSAttributes:A}=t,I=pM(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:gt.Document,childNodes:[],compatMode:e.compatMode}:{type:gt.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:gt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return hM(e,{doc:n,blockClass:o,blockSelector:i,unblockSelector:s,inlineStylesheet:h,maskAttributeFn:l,maskInputOptions:y,maskInputFn:T,dataURLOptions:g,inlineImages:S,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:M,rootId:I,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,ignoreCSSAttributes:A});case e.TEXT_NODE:return mM(e,{doc:n,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,maskTextFn:_,maskInputOptions:y,maskInputFn:T,rootId:I});case e.CDATA_SECTION_NODE:return{type:gt.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:gt.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function pM(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function mM(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:s,maskTextFn:a,maskInputOptions:l,maskInputFn:c,rootId:u}=t,f=e.parentNode&&e.parentNode.tagName,p=e.textContent,h=f==="STYLE"?!0:void 0,y=f==="SCRIPT"?!0:void 0,_=f==="TEXTAREA"?!0:void 0;if(h&&p){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(p=$u(e.parentNode.sheet))}catch(g){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${g}`,e)}p=Wu(p,rd(t.doc))}y&&(p="SCRIPT_PLACEHOLDER");let T=Ps(e,r,i,o,s,n);if(!h&&!y&&!_&&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,"*")),f==="OPTION"&&p){let g=nd({type:null,tagName:f,maskInputOptions:l});p=Sl({isMasked:Ps(e,r,i,o,s,g),element:e,value:p,maskInputFn:c})}return{type:gt.Text,textContent:p||"",isStyle:h,rootId:u}}function hM(e,t){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:s,maskInputOptions:a={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:u={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:y=!1,rootId:_,maskTextClass:T,unmaskTextClass:g,maskTextSelector:S,unmaskTextSelector:E,ignoreCSSAttributes:R}=t,M=lM(e,r,o,i),A=X1(e),I={},N=e.attributes.length;for(let x=0;x<N;x++){let H=e.attributes[x];H.name&&!vT(A,H.name,H.value)&&(I[H.name]=_T(n,A,Ms(H.name),H.value,e,l,R))}if(A==="link"&&s){let x=Array.from(n.styleSheets).find(j=>j.href===e.href),H=null;x&&(H=$u(x)),H&&(I.rel=null,I.href=null,I.crossorigin=null,I._cssText=Wu(H,x.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let x=$u(e.sheet);x&&(I._cssText=Wu(x,rd(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){let x=e,H=gh(x),j=ju(x,jm(A),H),he=x.checked;if(H!=="submit"&&H!=="button"&&j){let X=Ps(x,T,S,g,E,nd({type:H,tagName:jm(A),maskInputOptions:a}));I.value=Sl({isMasked:X,element:x,value:j,maskInputFn:c})}he&&(I.checked=he)}if(A==="option"&&(e.selected&&!a.select?I.selected=!0:delete I.selected),A==="canvas"&&p){if(e.__context==="2d")q1(e)||(I.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){let x=e.toDataURL(u.type,u.quality),H=n.createElement("canvas");H.width=e.width,H.height=e.height;let j=H.toDataURL(u.type,u.quality);x!==j&&(I.rr_dataURL=x)}}if(A==="img"&&f){Cs||(Cs=n.createElement("canvas"),qE=Cs.getContext("2d"));let x=e,H=x.currentSrc||x.getAttribute("src")||"<unknown-src>",j=x.crossOrigin,he=()=>{x.removeEventListener("load",he);try{Cs.width=x.naturalWidth,Cs.height=x.naturalHeight,qE.drawImage(x,0,0),I.rr_dataURL=Cs.toDataURL(u.type,u.quality)}catch(X){if(x.crossOrigin!=="anonymous"){x.crossOrigin="anonymous",x.complete&&x.naturalWidth!==0?he():x.addEventListener("load",he);return}else console.warn(`Cannot inline img src=${H}! Error: ${X}`)}x.crossOrigin==="anonymous"&&(j?I.crossOrigin=j:x.removeAttribute("crossorigin"))};x.complete&&x.naturalWidth!==0?he():x.addEventListener("load",he)}if((A==="audio"||A==="video")&&(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop)),M){let{width:x,height:H}=e.getBoundingClientRect();I={class:I.class,rr_width:`${x}px`,rr_height:`${H}px`}}A==="iframe"&&!h(I.src)&&(!M&&!ST(e)&&(I.rr_src=I.src),delete I.src);let U;try{customElements.get(A)&&(U=!0)}catch{}return{type:gt.Element,tagName:A,attributes:I,childNodes:[],isSVG:aM(e)||void 0,needBlock:M,rootId:_,isCustom:U}}function ze(e){return e==null?"":e.toLowerCase()}function gM(e,t){if(t.comment&&e.type===gt.Comment)return!0;if(e.type===gt.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"&&hT(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ze(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ze(e.attributes.name)==="application-name"||ze(e.attributes.rel)==="icon"||ze(e.attributes.rel)==="apple-touch-icon"||ze(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ze(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ze(e.attributes.property).match(/^(og|twitter|fb):/)||ze(e.attributes.name).match(/^(og|twitter):/)||ze(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ze(e.attributes.name)==="robots"||ze(e.attributes.name)==="googlebot"||ze(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ze(e.attributes.name)==="author"||ze(e.attributes.name)==="generator"||ze(e.attributes.name)==="framework"||ze(e.attributes.name)==="publisher"||ze(e.attributes.name)==="progid"||ze(e.attributes.property).match(/^article:/)||ze(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ze(e.attributes.name)==="google-site-verification"||ze(e.attributes.name)==="yandex-verification"||ze(e.attributes.name)==="csrf-token"||ze(e.attributes.name)==="p:domain_verify"||ze(e.attributes.name)==="verify-v1"||ze(e.attributes.name)==="verification"||ze(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ns(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:y={},maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E={},inlineImages:R=!1,recordCanvas:M=!1,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N=5e3,onBlockedImageLoad:U,onStylesheetLoad:x,stylesheetLoadTimeout:H=5e3,keepIframeSrcFn:j=()=>!1,newlyAddedElement:he=!1,ignoreCSSAttributes:X}=t,{preserveWhiteSpace:Ze=!0}=t,fe=fM(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,dataURLOptions:E,inlineImages:R,recordCanvas:M,keepIframeSrcFn:j,newlyAddedElement:he,ignoreCSSAttributes:X});if(!fe)return console.warn(e,"not serialized"),null;let de;r.hasNode(e)?de=r.getId(e):gM(fe,S)||!Ze&&fe.type===gt.Text&&!fe.isStyle&&!fe.textContent.trim().length?de=_l:de=yh();let D=Object.assign(fe,{id:de});if(r.add(e,D),de===_l)return null;A&&A(e);let ge=!p;if(D.type===gt.Element){ge=ge&&!D.needBlock;let Q=e.shadowRoot;Q&&gl(Q)&&(D.isShadowHost=!0)}if((D.type===gt.Document||D.type===gt.Element)&&ge){S.headWhitespace&&D.type===gt.Element&&D.tagName==="head"&&(Ze=!1);let Q={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:p,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:Ze,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onBlockedImageLoad:U,onStylesheetLoad:x,stylesheetLoadTimeout:H,keepIframeSrcFn:j,ignoreCSSAttributes:X},ae=e.childNodes?Array.from(e.childNodes):[];for(let Re of ae){let Te=Ns(Re,Q);Te&&D.childNodes.push(Te)}if(B1(e)&&e.shadowRoot)for(let Re of Array.from(e.shadowRoot.childNodes)){let Te=Ns(Re,Q);Te&&(gl(e.shadowRoot)&&(Te.isShadow=!0),D.childNodes.push(Te))}}if(e.parentNode&&hl(e.parentNode)&&gl(e.parentNode)&&(D.isShadow=!0),D.type===gt.Element&&D.tagName==="iframe"&&!D.needBlock&&uM(e,()=>{let Q=ST(e);if(Q&&I){let ae=Ns(Q,{doc:Q,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:Ze,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:x,stylesheetLoadTimeout:H,keepIframeSrcFn:j,ignoreCSSAttributes:X});ae&&I(e,ae)}},N),D.type===gt.Element&&D.tagName==="img"&&!e.complete&&D.needBlock){let Q=e,ae=()=>{if(Q.isConnected&&!Q.complete&&U)try{let Re=Q.getBoundingClientRect();Re.width>0&&Re.height>0&&U(Q,D,Re)}catch{}Q.removeEventListener("load",ae)};Q.isConnected&&Q.addEventListener("load",ae)}return D.type===gt.Element&&D.tagName==="link"&&typeof D.attributes.rel=="string"&&(D.attributes.rel==="stylesheet"||D.attributes.rel==="preload"&&typeof D.attributes.href=="string"&&hT(D.attributes.href)==="css")&&dM(e,()=>{if(x){let Q=Ns(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:Ze,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:x,stylesheetLoadTimeout:H,keepIframeSrcFn:j,ignoreCSSAttributes:X});Q&&x(e,Q)}},H),D.type===gt.Element&&delete D.needBlock,D}function yM(e,t){let{mirror:n=new zu,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:f=!0,inlineImages:p=!1,recordCanvas:h=!1,maskAllInputs:y=!1,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOM:S=!1,dataURLOptions:E,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:x,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:j=new Set([])}=t||{};return Ns(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:s,maskTextClass:a,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:y===!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}:y===!1?{}:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,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:E,inlineImages:p,recordCanvas:h,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:x,keepIframeSrcFn:H,newlyAddedElement:!1,ignoreCSSAttributes:j})}function rn(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Rs=`Please stop import mirror directly. Instead of that,\r
29
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.`,KE={map:{},getId(){return console.error(Rs),-1},getNode(){return console.error(Rs),null},removeNodeFromMap(){console.error(Rs)},has(){return console.error(Rs),!1},reset(){console.error(Rs)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(KE=new Proxy(KE,{get(e,t,n){return t==="map"&&console.error(Rs),Reflect.get(e,t,n)}}));function vl(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&&(TM(r),r=null),o=s,e.apply(l,i)):!r&&n.trailing!==!1&&(r=od(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(l,i)},a))}}function ET(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){od(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>ET(e,t,i||{},!0)}function Sh(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 Gu=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Gu=()=>new Date().getTime());function TT(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 IT(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function wT(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function CT(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Nn(e,t,n,r,o){if(!e)return!1;let i=CT(e);if(!i)return!1;let s=ks(t,n);if(!o){let c=r&&i.matches(r);return s(i)&&!c}let a=wi(i,s),l=-1;return a<0?!1:(r&&(l=wi(i,ks(null,r))),a>-1&&l<0?!0:a<l)}function yM(e,t){return t.getId(e)!==-1}function Fm(e,t){return t.getId(e)===_l}function RT(e,t){if(hl(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?RT(e.parentNode,t):!0:!0}function Gm(e){return!!e.changedTouches}function SM(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 xT(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function bT(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Vm(e){return!!e?.shadowRoot}var qm=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 kT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function _M(e){let t=e,n;for(;n=kT(t);)t=n;return t}function vM(e){let t=e.ownerDocument;if(!t)return!1;let n=_M(e);return t.contains(n)}function NT(e){let t=e.ownerDocument;return t?t.contains(e)||vM(e):!1}var JE={};function _h(e){let t=JE[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 JE[e]=r.bind(window)}function EM(...e){return _h("requestAnimationFrame")(...e)}function od(...e){return _h("setTimeout")(...e)}function TM(...e){return _h("clearTimeout")(...e)}var me=(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))(me||{}),se=(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))(se||{}),nn=(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))(nn||{}),Zr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Zr||{}),xs=(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))(xs||{}),yl;function IM(e){yl=e}function wM(){yl=void 0}var Ce=e=>yl?((...n)=>{try{return e(...n)}catch(r){if(yl&&yl(r)===!0)return()=>{};throw r}}):e,XE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",CM=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(pl=0;pl<XE.length;pl++)CM[XE.charCodeAt(pl)]=pl;var pl,Vu=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function vh(e){try{return e.contentDocument}catch{}}function El(e){try{return e.contentWindow}catch{}}var Ym=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 QE(e){return"__ln"in e}var Km=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&&QE(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&&QE(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--)}},ZE=(e,t)=>`${e}@${t}`,Jm=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 Km,o=l=>{let c=l,u=_l;for(;u===_l;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},i=l=>{if(!l.parentNode||!NT(l))return;let c=hl(l.parentNode)?this.mirror.getId(kT(l)):this.mirror.getId(l.parentNode),u=o(l);if(c===-1||u===-1)return r.addNode(l);let f=Ns(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=>{xT(p,this.mirror)&&!Nn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),bT(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Vm(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,h)=>{if(Nn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,h);let y=El(p);y&&this.canvasManager.addWindow(y),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,h)=>{this.stylesheetManager.attachLinkElement(p,h)},onBlockedImageLoad:(p,h,{width:y,height:_})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:h.id,attributes:{style:{width:`${y}px`,height:`${_}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});f&&(t.push({parentId:c,nextId:u,node:f}),n.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)eT(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(let l of this.addedSet)!tT(this.droppedSet,l)&&!eT(this.removes,l,this.mirror)||tT(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 f=this.mirror.getId(u.value.parentNode);if(o(u.value)===-1)continue;if(f!==-1){l=u;break}else{let h=u.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let y=h.parentNode.host;if(this.mirror.getId(y)!==-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),f=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+f).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(!Fm(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!Nn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Ps(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,CT(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=gh(n),a=n.tagName;o=ju(n,a,s);let l=nd({maskInputOptions:this.maskInputOptions,tagName:a,type:s}),c=Ps(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=Sl({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(Nn(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(!vh(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"),!vT(n.tagName,r)&&(i.attributes[r]=_T(this.doc,Ms(n.tagName),Ms(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(Nn(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=hl(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Nn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Fm(n,this.mirror)||!yM(n,this.mirror)||(this.addedSet.has(n)?(Xm(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||RT(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[ZE(r,o)]?Xm(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:hl(t.target)&&gl(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(Fm(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[ZE(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Nn(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Vm(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 Ym(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 Xm(e,t){e.delete(t),t.childNodes?.forEach(n=>Xm(e,n))}function eT(e,t,n){return e.length===0?!1:RM(e,t,n)}function RM(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 tT(e,t){return e.size===0?!1:AT(e,t)}function AT(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:AT(e,n):!1}var As=[];function Rl(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 MT(e,t){let n=new Jm;As.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(Ce(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 xM({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=vl(Ce(f=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),f),s=[],a=null}),i),c=Ce(vl(Ce(f=>{let p=Rl(f),{clientX:h,clientY:y}=Gm(f)?f.changedTouches[0]:f;a||(a=Gu()),s.push({x:h,y,id:r.getId(p),timeOffset:Gu()-a}),l(typeof DragEvent<"u"&&f instanceof DragEvent?se.Drag:f instanceof MouseEvent?se.MouseMove:se.TouchMove)}),o,{trailing:!1})),u=[rn("mousemove",c,n),rn("touchmove",c,n),rn("drag",c,n)];return Ce(()=>{u.forEach(f=>f())})}function bM({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=f=>p=>{let h=Rl(p);if(Nn(h,r,o,i,!0))return;let y=null,_=f;if("pointerType"in p){switch(p.pointerType){case"mouse":y=Zr.Mouse;break;case"touch":y=Zr.Touch;break;case"pen":y=Zr.Pen;break}y===Zr.Touch?nn[f]===nn.MouseDown?_="TouchStart":nn[f]===nn.MouseUp&&(_="TouchEnd"):Zr.Pen}else Gm(p)&&(y=Zr.Touch);y!==null?(c=y,(_.startsWith("Touch")&&y===Zr.Touch||_.startsWith("Mouse")&&y===Zr.Mouse)&&(y=null)):nn[f]===nn.Click&&(y=c,c=null);let T=Gm(p)?p.changedTouches[0]:p;if(!T)return;let g=n.getId(h),{clientX:S,clientY:E}=T;Ce(e)({type:nn[_],id:g,x:S,y:E,...y!==null&&{pointerType:y}})};return Object.keys(nn).filter(f=>Number.isNaN(Number(f))&&!f.endsWith("_Departed")&&a[f]!==!1).forEach(f=>{let p=Ms(f),h=u(f);if(window.PointerEvent)switch(nn[f]){case nn.MouseDown:case nn.MouseUp:p=p.replace("mouse","pointer");break;case nn.TouchStart:case nn.TouchEnd:return}l.push(rn(p,h,t))}),Ce(()=>{l.forEach(f=>f())})}function PT({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){let a=Ce(vl(Ce(l=>{let c=Rl(l);if(!c||Nn(c,r,o,i,!0))return;let u=n.getId(c);if(c===t&&t.defaultView){let f=TT(t.defaultView);e({id:u,x:f.left,y:f.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}),s.scroll||100));return rn("scroll",a,t)}function kM({viewportResizeCb:e},{win:t}){let n=-1,r=-1,o=Ce(vl(Ce(()=>{let i=IT(),s=wT();(n!==i||r!==s)&&(e({width:Number(s),height:Number(i)}),n=i,r=s)}),200));return rn("resize",o,t)}var NM=["INPUT","TEXTAREA","SELECT"],nT=new WeakMap;function AM({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:f,maskTextClass:p,unmaskTextClass:h,maskTextSelector:y,unmaskTextSelector:_}){function T(I){let N=Rl(I),U=I.isTrusted,x=N&&jm(N.tagName);if(x==="OPTION"&&(N=N.parentElement),!N||!x||NM.indexOf(x)<0||Nn(N,r,o,i,!0))return;let H=N;if(H.classList.contains(s)||a&&H.matches(a))return;let j=gh(N),ge=ju(H,x,j),X=!1,Ze=nd({maskInputOptions:l,tagName:x,type:j}),fe=Ps(N,p,y,h,_,Ze);(j==="radio"||j==="checkbox")&&(X=N.checked),ge=Sl({isMasked:fe,element:N,value:ge,maskInputFn:c}),g(N,f?{text:ge,isChecked:X,userTriggered:U}:{text:ge,isChecked:X});let de=N.name;j==="radio"&&de&&X&&t.querySelectorAll(`input[type="radio"][name="${de}"]`).forEach(D=>{if(D!==N){let ye=Sl({isMasked:fe,element:D,value:ju(D,x,j),maskInputFn:c});g(D,f?{text:ye,isChecked:!X,userTriggered:!1}:{text:ye,isChecked:!X})}})}function g(I,N){let U=nT.get(I);if(!U||U.text!==N.text||U.isChecked!==N.isChecked){nT.set(I,N);let x=n.getId(I);Ce(e)({...N,id:x})}}let E=(u.input==="last"?["change"]:["input","change"]).map(I=>rn(I,Ce(T),t)),R=t.defaultView;if(!R)return()=>{E.forEach(I=>I())};let M=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value"),A=[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]];return M&&M.set&&E.push(...A.map(I=>ET(I[0],I[1],{set(){Ce(T)({target:this,isTrusted:!1})}},!1,R))),Ce(()=>{E.forEach(I=>I())})}function qu(e){let t=[];function n(r,o){if(Uu("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Uu("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Uu("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Uu("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 bo(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function MM({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:Ce((u,f,p)=>{let[h,y]=p,{id:_,styleId:T}=bo(f,t,n.styleMirror);return(_&&_!==-1||T&&T!==-1)&&e({id:_,styleId:T,adds:[{rule:h,index:y}]}),u.apply(f,p)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Ce((u,f,p)=>{let[h]=p,{id:y,styleId:_}=bo(f,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,removes:[{index:h}]}),u.apply(f,p)})});let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ce((u,f,p)=>{let[h]=p,{id:y,styleId:_}=bo(f,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,replace:h}),u.apply(f,p)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ce((u,f,p)=>{let[h]=p,{id:y,styleId:_}=bo(f,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,replaceSync:h}),u.apply(f,p)})}));let l={};Fu("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Fu("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Fu("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Fu("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,f])=>{c[u]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(c[u].insertRule,{apply:Ce((p,h,y)=>{let[_,T]=y,{id:g,styleId:S}=bo(h.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,adds:[{rule:_,index:[...qu(h),T||0]}]}),p.apply(h,y)})}),f.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:Ce((p,h,y)=>{let[_]=y,{id:T,styleId:g}=bo(h.parentStyleSheet,t,n.styleMirror);return(T&&T!==-1||g&&g!==-1)&&e({id:T,styleId:g,removes:[{index:[...qu(h),_]}]}),p.apply(h,y)})})}),Ce(()=>{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,f])=>{f.prototype.insertRule=c[u].insertRule,f.prototype.deleteRule=c[u].deleteRule})})}function LT({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}}),Ce(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function PM({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Ce((a,l,c)=>{let[u,f,p]=c;if(n.has(u))return i.apply(l,[u,f,p]);let{id:h,styleId:y}=bo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||y&&y!==-1)&&e({id:h,styleId:y,set:{property:u,value:f,priority:p},index:qu(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Ce((a,l,c)=>{let[u]=c;if(n.has(u))return s.apply(l,[u]);let{id:f,styleId:p}=bo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||p&&p!==-1)&&e({id:f,styleId:p,remove:{property:u},index:qu(l.parentRule)}),a.apply(l,c)})}),Ce(()=>{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=Ce(c=>vl(Ce(u=>{let f=Rl(u);if(!f||Nn(f,t,n,r,!0))return;let{currentTime:p,volume:h,muted:y,playbackRate:_}=f;e({type:c,id:o.getId(f),currentTime:p,volume:h,muted:y,playbackRate:_})}),i.media||500)),l=[rn("play",a(xs.Play),s),rn("pause",a(xs.Pause),s),rn("seeked",a(xs.Seeked),s),rn("volumechange",a(xs.VolumeChange),s),rn("ratechange",a(xs.RateChange),s)];return Ce(()=>{l.forEach(c=>c())})}function OM({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 f=new i(l,c,u);return o.set(f,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),f};let s=Sh(t.fonts,"add",function(a){return function(l){return od(Ce(()=>{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),Ce(()=>{r.forEach(a=>a())})}function DM(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:s}=e,a=!0,l=Ce(()=>{let c=t.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;let u=[],f=c.rangeCount||0;for(let p=0;p<f;p++){let h=c.getRangeAt(p),{startContainer:y,startOffset:_,endContainer:T,endOffset:g}=h;Nn(y,r,o,i,!0)||Nn(T,r,o,i,!0)||u.push({start:n.getId(y),startOffset:_,end:n.getId(T),endOffset:g})}s({ranges:u})});return l(),rn("selectionchange",l)}function UM({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Sh(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=MT(e,e.doc));let o=xM(e),i=bM(e),s=PT(e),a=kM(e,{win:n}),l=AM(e),c=LM(e),u=()=>{},f=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(u=MM(e,{win:n}),f=LT(e,e.doc),p=PM(e,{win:n}),e.collectFonts&&(h=OM(e)));let y=DM(e),_=UM(e),T=[];for(let g of e.plugins)T.push(g.observer(g.callback,n,g.options));return Ce(()=>{As.forEach(g=>g.reset()),r?.disconnect(),o(),i(),s(),a(),l(),c(),u(),f(),p(),h(),y(),_(),T.forEach(g=>g())})}function Uu(e){return typeof window[e]<"u"}function Fu(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var Tl=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}},Qm=class{constructor(){this.crossOriginIframeMirror=new Tl(yh),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Zm=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Tl(yh),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tl(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=El(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&&El(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);let r=vh(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 me.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:me.IncrementalSnapshot,data:{source:se.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case me.Meta:case me.Load:case me.DomContentLoaded:return!1;case me.Plugin:return n;case me.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case me.IncrementalSnapshot:switch(n.data.source){case se.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 se.Drag:case se.TouchMove:case se.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case se.ViewportResize:return!1;case se.MediaInteraction:case se.MouseInteraction:case se.Scroll:case se.CanvasMutation:case se.Input:return this.replaceIds(n.data,t,["id"]),n;case se.StyleSheetRule:case se.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case se.Font:return n;case se.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case se.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!==gt.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},eh=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},th=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(!gl(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);let r=MT({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(PT({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),od(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(LT({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){let n=vh(t),r=El(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(Sh(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i);return this.shadowRoot&&NT(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()}},nh=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new qm,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:mT(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){}},rh=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,EM(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},lt,Yu;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 dr=G1();function fr(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:f=null,maskTextSelector:p=null,unmaskTextSelector:h=null,inlineStylesheet:y=!0,maskAllInputs:_,maskInputOptions:T,slimDOMOptions:g,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,maxCanvasSize:M=null,packFn:A,sampling:I={},dataURLOptions:N={},mousemoveWait:U,recordDOM:x=!0,recordCanvas:H=!1,recordCrossOriginIframes:j=!1,recordAfter:ge=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:X=!1,collectFonts:Ze=!1,inlineImages:fe=!1,plugins:de,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:ye=new Set([]),errorHandler:Q,onMutation:ae,getCanvasManager:Re}=e;IM(Q);let Te=j?window.parent===window:!0,St=!1;if(!Te)try{window.parent.document&&(St=!1)}catch{St=!0}if(Te&&!t)throw new Error("emit function is required");if(!Te&&!St)return()=>{};U!==void 0&&I.mousemove===void 0&&(I.mousemove=U),dr.reset();let ot=_===!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:{},bt=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};SM();let it,In=0,Dt=J=>{for(let $e of de||[])$e.eventProcessor&&(J=$e.eventProcessor(J));return A&&!St&&(J=A(J)),J};lt=(J,$e)=>{let he=J;if(he.timestamp=Gu(),As[0]?.isFrozen()&&he.type!==me.FullSnapshot&&!(he.type===me.IncrementalSnapshot&&he.data.source===se.Mutation)&&As.forEach(Je=>Je.unfreeze()),Te)t?.(Dt(he),$e);else if(St){let Je={type:"rrweb",event:Dt(he),origin:window.location.origin,isCheckout:$e};window.parent.postMessage(Je,"*")}if(he.type===me.FullSnapshot)it=he,In=0;else if(he.type===me.IncrementalSnapshot){if(he.data.source===se.Mutation&&he.data.isAttachIframe)return;In++;let Je=r&&In>=r,Se=n&&it&&he.timestamp-it.timestamp>n;(Je||Se)&&dt(!0)}};let wn=J=>{lt({type:me.IncrementalSnapshot,data:{source:se.Mutation,...J}})},nr=J=>lt({type:me.IncrementalSnapshot,data:{source:se.Scroll,...J}}),Vi=J=>lt({type:me.IncrementalSnapshot,data:{source:se.CanvasMutation,...J}}),Zo=J=>lt({type:me.IncrementalSnapshot,data:{source:se.AdoptedStyleSheet,...J}}),P=new nh({mutationCb:wn,adoptedStyleSheetCb:Zo}),V=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Qm:new Zm({mirror:dr,mutationCb:wn,stylesheetManager:P,recordCrossOriginIframes:j,wrappedEmit:lt});for(let J of de||[])J.getMirror&&J.getMirror({nodeMirror:dr,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});let ie=new rh,Y=HM(Re,{mirror:dr,win:window,mutationCb:J=>lt({type:me.IncrementalSnapshot,data:{source:se.CanvasMutation,...J}}),recordCanvas:H,blockClass:o,blockSelector:i,unblockSelector:s,maxCanvasSize:M,sampling:I.canvas,dataURLOptions:N,errorHandler:Q}),Ie=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new eh:new th({mutationCb:wn,scrollCb:nr,bypassOptions:{onMutation:ae,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskInputOptions:ot,dataURLOptions:N,maskAttributeFn:S,maskTextFn:R,maskInputFn:E,recordCanvas:H,inlineImages:fe,sampling:I,slimDOMOptions:bt,iframeManager:V,stylesheetManager:P,canvasManager:Y,keepIframeSrcFn:D,processedNodeManager:ie,ignoreCSSAttributes:ye},mirror:dr}),dt=(J=!1)=>{if(!x)return;lt({type:me.Meta,data:{href:window.location.href,width:wT(),height:IT()}},J),P.reset(),Ie.init(),As.forEach(he=>he.lock());let $e=gM(document,{mirror:dr,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskAllInputs:ot,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,slimDOM:bt,dataURLOptions:N,recordCanvas:H,inlineImages:fe,onSerialize:he=>{xT(he,dr)&&V.addIframe(he),bT(he,dr)&&P.trackLinkElement(he),Vm(he)&&Ie.addShadowRoot(he.shadowRoot,document)},onIframeLoad:(he,Je)=>{V.attachIframe(he,Je);let Se=El(he);Se&&Y.addWindow(Se),Ie.observeAttachShadow(he)},onStylesheetLoad:(he,Je)=>{P.attachLinkElement(he,Je)},onBlockedImageLoad:(he,Je,{width:Se,height:Ur})=>{wn({adds:[],removes:[],texts:[],attributes:[{id:Je.id,attributes:{style:{width:`${Se}px`,height:`${Ur}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:ye});if(!$e)return console.warn("Failed to snapshot the document");lt({type:me.FullSnapshot,data:{node:$e,initialOffset:TT(window)}}),As.forEach(he=>he.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,dr.getId(document))};Yu=dt;try{let J=[],$e=Je=>Ce(FM)({onMutation:ae,mutationCb:wn,mousemoveCb:(Se,Ur)=>lt({type:me.IncrementalSnapshot,data:{source:Ur,positions:Se}}),mouseInteractionCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.MouseInteraction,...Se}}),scrollCb:nr,viewportResizeCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.ViewportResize,...Se}}),inputCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.Input,...Se}}),mediaInteractionCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.MediaInteraction,...Se}}),styleSheetRuleCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.StyleSheetRule,...Se}}),styleDeclarationCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.StyleDeclaration,...Se}}),canvasMutationCb:Vi,fontCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.Font,...Se}}),selectionCb:Se=>{lt({type:me.IncrementalSnapshot,data:{source:se.Selection,...Se}})},customElementCb:Se=>{lt({type:me.IncrementalSnapshot,data:{source:se.CustomElement,...Se}})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskAllText:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:h,maskInputOptions:ot,inlineStylesheet:y,sampling:I,recordDOM:x,recordCanvas:H,inlineImages:fe,userTriggeredOnInput:X,collectFonts:Ze,doc:Je,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,keepIframeSrcFn:D,blockSelector:i,unblockSelector:s,slimDOMOptions:bt,dataURLOptions:N,mirror:dr,iframeManager:V,stylesheetManager:P,shadowDomManager:Ie,processedNodeManager:ie,canvasManager:Y,ignoreCSSAttributes:ye,plugins:de?.filter(Se=>Se.observer)?.map(Se=>({observer:Se.observer,options:Se.options,callback:Ur=>lt({type:me.Plugin,data:{plugin:Se.name,payload:Ur}})}))||[]},{});V.addLoadListener(Je=>{try{J.push($e(Je.contentDocument))}catch(Se){console.warn(Se)}});let he=()=>{dt(),J.push($e(document))};return document.readyState==="interactive"||document.readyState==="complete"?he():(J.push(rn("DOMContentLoaded",()=>{lt({type:me.DomContentLoaded,data:{}}),ge==="DOMContentLoaded"&&he()})),J.push(rn("load",()=>{lt({type:me.Load,data:{}}),ge==="load"&&he()},window))),()=>{J.forEach(Je=>Je()),ie.destroy(),Yu=void 0,wM()}}catch(J){console.warn(J)}}function BM(e){if(!Yu)throw new Error("please take full snapshot after start recording");Yu(e)}fr.mirror=dr;fr.takeFullSnapshot=BM;function HM(e,t){try{return e?e(t):new Vu}catch{return console.warn("Unable to initialize CanvasManager"),new Vu}}var rT;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(rT||(rT={}));var $M=3,zM=5;function Eh(e){return e>9999999999?e:e*1e3}function Bm(e){return e>9999999999?e/1e3:e}function xl(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:me.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:$t(t,10,1e3)}}),t.category==="console")))}var jM="button,a";function OT(e){return e.closest(jM)||e}function DT(e){let t=UT(e);return!t||!(t instanceof Element)?t:OT(t)}function UT(e){return WM(e)?e.target:e}function WM(e){return typeof e=="object"&&!!e&&"target"in e}var ko;function GM(e){return ko||(ko=[],VM()),ko.push(e),()=>{let t=ko?ko.indexOf(e):-1;t>-1&&ko.splice(t,1)}}function VM(){st(je,"open",function(e){return function(...t){if(ko)try{ko.forEach(n=>n())}catch{}return e.apply(je,t)}})}var qM=new Set([se.Mutation,se.StyleSheetRule,se.StyleDeclaration,se.AdoptedStyleSheet,se.CanvasMutation,se.Selection,se.MediaInteraction]);function YM(e,t,n){e.handleClick(t,n)}var oh=class{constructor(t,n,r=xl){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=GM(()=>{this._lastMutation=oT()});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(JM(n,this._ignoreSelector)||!XM(t))return;let r={timestamp:Bm(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=Bm(t)}registerScroll(t=Date.now()){this._lastScroll=Bm(t)}registerClick(t){let n=OT(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=oT();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:je.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:je.location.href,route:n.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Ii(()=>this._checkClicks(),1e3)}},KM=["A","BUTTON","INPUT"];function JM(e,t){return!!(!KM.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 XM(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function oT(){return Date.now()/1e3}function QM(e,t){try{if(!ZM(t))return;let{source:n}=t.data;if(qM.has(n)&&e.registerMutation(t.timestamp),n===se.Scroll&&e.registerScroll(t.timestamp),eP(t)){let{type:r,id:o}=t.data,i=fr.mirror.getNode(o);i instanceof HTMLElement&&r===nn.Click&&e.registerClick(i)}}catch{}}function ZM(e){return e.type===$M}function eP(e){return e.data.source===se.MouseInteraction}function br(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var id=(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))(id||{}),tP=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function nP(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(tP.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}var rP=e=>t=>{if(!e.isEnabled())return;let n=oP(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&&YM(e.clickDetector,n,DT(t.event)),xl(e,n)};function FT(e,t){let n=fr.mirror.getId(e),r=n&&fr.mirror.getNode(n),o=r&&fr.mirror.getMeta(r),i=o&&sP(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===id.Text&&s.textContent).filter(Boolean).map(s=>s.trim()).join(""),attributes:nP(i.attributes)}}:{}}}function oP(e){let{target:t,message:n}=iP(e);return br({category:`ui.${e.name}`,...FT(t,n)})}function iP(e){let t=e.name==="click",n,r=null;try{r=t?DT(e.event):UT(e.event),n=Ue(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function sP(e){return e.type===id.Element}function aP(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=lP(t);n&&xl(e,n)}function lP(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:s}=e;if(!s||cP(s)||!i)return null;let a=t||r||o,l=i.length===1;if(!a&&l)return null;let c=Ue(s,{maxStringLength:200})||"<unknown>",u=FT(s,c);return br({category:"ui.keyDown",message:c,data:{...u.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function cP(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var uP={resource:hP,paint:pP,navigation:mP};function Hm(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function dP(e){return e.map(fP).filter(Boolean)}function fP(e){let t=uP[e.entryType];return t?t(e):null}function Ls(e){return((He()||je.performance.timeOrigin)+e)/1e3}function pP(e){let{duration:t,entryType:n,name:r,startTime:o}=e,i=Ls(o);return{type:n,name:r,start:i,end:i+t,data:void 0}}function mP(e){let{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:u,loadEventEnd:f,redirectCount:p,startTime:h,transferSize:y,type:_}=e;return o===0?null:{type:`${t}.${_}`,start:Ls(h),end:Ls(i),name:n,data:{size:y,decodedBodySize:r,encodedBodySize:s,duration:o,domInteractive:c,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,loadEventStart:u,loadEventEnd:f,domComplete:i,redirectCount:p}}}function hP(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:Ls(i),end:Ls(o),name:r,data:{size:c,statusCode:l,decodedBodySize:s,encodedBodySize:a}}}function gP(e){let t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return Th(e,"largest-contentful-paint",n)}function yP(e){return e.sources!==void 0}function SP(e){let t=[],n=[];for(let r of e.entries)if(yP(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let s=fr.mirror.getId(i.node);s&&o.push(s)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return Th(e,"cumulative-layout-shift",n,t)}function _P(e){let t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return Th(e,"interaction-to-next-paint",n)}function Th(e,t,n,r){let o=e.value,i=e.rating,s=Ls(o);return{type:"web-vital",name:t,start:s,end:s,data:{value:o,size:o,rating:i,nodeIds:n?n.map(a=>fr.mirror.getId(a)):void 0,attributions:r}}}function vP(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(cr(o,n))}),r.push(Kr(Hm(gP,e)),Yr(Hm(SP,e)),_i(Hm(_P,e))),()=>{r.forEach(o=>o())}}var re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,EP='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 TP(){let e=new Blob([EP]);return URL.createObjectURL(e)}var iT=["log","warn","error"],Hu="[Replay] ";function $m(e,t="info"){kn({category:"console",data:{logger:"replay"},level:t,message:`${Hu}${e}`},{level:t})}function IP(){let e=!1,t=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return re?(iT.forEach(r=>{n[r]=(...o)=>{C[r](Hu,...o),t&&$m(o.join(""),gs(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),C.error(Hu,r),e?Gr(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&$m(r,"error")},n.infoTick=(...r)=>{C.log(Hu,...r),t&&setTimeout(()=>$m(r[0]),0)}):iT.forEach(r=>{n[r]=()=>{}}),n}var oe=IP(),Il=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${hh}.`)}},Ku=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>hh)throw new Il;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:Eh(t)}},ih=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){re&&oe.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():(re&&oe.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{re&&oe.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(){re&&oe.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++}},sh=class{constructor(t){this._worker=new ih(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=Eh(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>hh?Promise.reject(new Il):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{re&&oe.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}},ah=class{constructor(t){this._fallback=new Ku,this._compression=new sh(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){re&&oe.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){re&&oe.exception(i,"Failed to add events when switching buffers.")}}};function wP({useCompression:e,workerUrl:t}){if(e&&window.Worker){let n=CP(t);if(n)return n}return re&&oe.log("Using simple buffer"),new Ku}function CP(e){try{let t=e||RP();if(!t)return;re&&oe.log(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new ah(n)}catch(t){re&&oe.exception(t,"Failed to create compression worker")}}function RP(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?TP():""}function Ih(){try{return"sessionStorage"in je&&!!je.sessionStorage}catch{return!1}}function xP(e){bP(),e.session=void 0}function bP(){if(Ih())try{je.sessionStorage.removeItem(ph)}catch{}}function BT(e){return e===void 0?!1:Math.random()<e}function sd(e){if(Ih())try{je.sessionStorage.setItem(ph,JSON.stringify(e))}catch{}}function HT(e){let t=Date.now(),n=e.id||at(),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 kP(e,t){return BT(e)?"session":t?"buffer":!1}function sT({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let o=kP(e,t),i=HT({sampled:o,previousSessionId:r});return n&&sd(i),i}function NP(){if(!Ih())return null;try{let e=je.sessionStorage.getItem(ph);if(!e)return null;let t=JSON.parse(e);return re&&oe.infoTick("Loading existing session"),HT(t)}catch{return null}}function lh(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function AP(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return lh(e.started,t,r)||lh(e.lastActivity,n,r)}function Ju(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!AP(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function zm({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let o=r.stickySession&&NP();return o?Ju(o,{sessionIdleExpire:e,maxReplayDuration:t})?(re&&oe.infoTick("Session in sessionStorage is expired, creating new one..."),sT(r,{previousSessionId:o.id})):o:(re&&oe.infoTick("Creating new session"),sT(r,{previousSessionId:n}))}function MP(e){return e.type===me.Custom}function wh(e,t,n){return zT(e,t)?($T(e,t,n),!0):!1}function PP(e,t,n){return zT(e,t)?$T(e,t,n):Promise.resolve(null)}async function $T(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 Il,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 zT(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=Eh(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(re&&oe.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function LP(e,t){try{if(typeof t=="function"&&MP(e))return t(e)}catch(n){return re&&oe.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Ch(e){return!e.type}function ch(e){return e.type==="transaction"}function OP(e){return e.type==="replay_event"}function aT(e){return e.type==="feedback"}function DP(e){return(t,n)=>{if(!e.isEnabled()||!Ch(t)&&!ch(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(ch(t)){UP(e,t);return}FP(e,t)}}}function UP(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)||Ii(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function BP(e){return t=>{!e.isEnabled()||!Ch(t)||HP(e,t)}}function HP(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=br({category:"replay.hydrate-error",data:{url:hn()}});xl(e,r)}}function $P(e){let t=$();t&&t.on("beforeAddBreadcrumb",n=>zP(e,n))}function zP(e,t){if(!e.isEnabled()||!jT(t))return;let n=jP(t);n&&xl(e,n)}function jP(e){return!jT(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?WP(e):br(e)}function WP(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return br(e);let n=!1,r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>Du?(n=!0,`${o.slice(0,Du)}\u2026`):o;if(typeof o=="object")try{let i=$t(o,7);return JSON.stringify(i).length>Du?(n=!0,`${JSON.stringify(i,null,2).slice(0,Du)}\u2026`):i}catch{}return o});return br({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function jT(e){return!!e.category}function GP(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Xu(){let e=te().getPropagationContext().dsc;e&&delete e.replay_id;let t=Me();if(t){let n=ht(t);delete n.replay_id}}function lT(e){let t=te().getPropagationContext().dsc;t&&(t.replay_id=e);let n=Me();if(n){let r=ht(n);r.replay_id=e}}function VP(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:me.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 qP(e,t){return e.recordingMode!=="buffer"||t.message===mh||!t.exception||t.type?!1:BT(e.getOptions().errorSampleRate)}function YP(e){return Object.assign((t,n)=>{if(e.session&&Ju(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Xu(),!e.isEnabled()||e.isPaused())return t;if(OP(t))return delete t.breadcrumbs,t;if(!Ch(t)&&!ch(t)&&!aT(t))return t;if(!e.checkAndHandleExpiredSession())return Xu(),t;if(aT(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),VP(e,t),t;if(GP(t,n)&&!e.getOptions()._experiments.captureExceptions)return re&&oe.log("Ignoring error from rrweb internals",t),null;let o=qP(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&&sd(s)}return t},{id:"Replay"})}function ad(e,t){return t.map(({type:n,start:r,end:o,name:i,data:s})=>{let a=e.throttledAddEvent({type:me.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 KP(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 JP(e){return t=>{if(!e.isEnabled())return;let n=KP(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(ad(e,[n]),!1)))}}function XP(e,t){return re&&e.getOptions()._experiments.traceInternals?!1:Xp(t,$())}function WT(e,t){e.isEnabled()&&t!==null&&(XP(e,t.name)||e.addUpdate(()=>(ad(e,[t]),!0)))}function ld(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=Au(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function GT(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Qu(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 VT(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 wl(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function No(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}=QP(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function uh(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 QP(e){if(!e||typeof e!="string")return{body:e};let t=e.length>zE,n=ZP(e);if(t){let r=e.slice(0,zE);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 ZP(e){let t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Zu(e,t){let n=eL(e);return Nt(n,t)}function eL(e,t=je.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(je.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 tL(e,t,n){try{let r=await rL(e,t,n),o=VT("resource.fetch",r);WT(n.replay,o)}catch(r){re&&oe.exception(r,"Failed to capture fetch breadcrumb")}}function nL(e,t){let{input:n,response:r}=t,o=n?Pu(n):void 0,i=ld(o),s=r?GT(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 rL(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,f=Zu(s,n.networkDetailAllowUrls)&&!Zu(s,n.networkDetailDenyUrls),p=f?oL(n,t.input,c):wl(c),h=await iL(f,n,t.response,u);return{startTimestamp:o,endTimestamp:i,url:s,method:a,statusCode:l,request:p,response:h}}function oL({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let o=n?lL(n,t):{};if(!e)return No(o,r,void 0);let i=Pu(n),[s,a]=Mu(i,oe),l=No(o,r,s);return a?Qu(l,a):l}async function iL(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return wl(o);let i=r?qT(r.headers,n):{};if(!r||!t&&o!==void 0)return No(i,o,void 0);let[s,a]=await aL(r),l=sL(s,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:i});return a?Qu(l,a):l}function sL(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{let i=e?.length&&n===void 0?ld(e):n;return r?t?No(o,i,e):No(o,i,void 0):wl(i)}catch(i){return re&&oe.exception(i,"Failed to serialize response body"),No(o,n,void 0)}}async function aL(e){let t=cL(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await uL(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(re&&oe.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(re&&oe.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function qT(e,t){let n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function lL(e,t){return e.length===1&&typeof e[0]!="string"?cT(e[0],t):e.length===2?cT(e[1],t):{}}function cT(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?qT(n,t):Array.isArray(n)?{}:uh(n,t):{}}function cL(e){try{return e.clone()}catch(t){re&&oe.exception(t,"Failed to clone response body")}}function uL(e){return new Promise((t,n)=>{let r=Ii(()=>n(new Error("Timeout while trying to read response body")),500);dL(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function dL(e){return await e.text()}async function fL(e,t,n){try{let r=mL(e,t,n),o=VT("resource.xhr",r);WT(n.replay,o)}catch(r){re&&oe.exception(r,"Failed to capture xhr breadcrumb")}}function pL(e,t){let{xhr:n,input:r}=t;if(!n)return;let o=ld(r),i=n.getResponseHeader("content-length")?GT(n.getResponseHeader("content-length")):yL(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}function mL(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:f,response_body_size:p}=e.data;if(!l)return null;if(!a||!Zu(l,n.networkDetailAllowUrls)||Zu(l,n.networkDetailDenyUrls)){let A=wl(f),I=wl(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:A,response:I}}let h=a[ur],y=h?uh(h.request_headers,n.networkRequestHeaders):{},_=uh(dl(a),n.networkResponseHeaders),[T,g]=n.networkCaptureBodies?Mu(s,oe):[void 0],[S,E]=n.networkCaptureBodies?hL(a):[void 0],R=No(y,f,T),M=No(_,p,S);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:g?Qu(R,g):R,response:E?Qu(M,E):M}}function hL(e){let t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return gL(e.response,e.responseType)}catch(n){t.push(n)}return re&&oe.warn("Failed to get xhr response body",...t),[void 0]}function gL(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 re&&oe.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return re&&oe.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function yL(e,t){try{let n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return ld(n)}catch{return}}function SL(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)=>_L(a,l,c))}catch{}}function _L(e,t,n){if(t.data)try{vL(t)&&TL(n)&&(pL(t,n),fL(t,n,e)),EL(t)&&IL(n)&&(nL(t,n),tL(t,n,e))}catch(r){re&&oe.exception(r,"Error when enriching network breadcrumb")}}function vL(e){return e.category==="xhr"}function EL(e){return e.category==="fetch"}function TL(e){return e?.xhr}function IL(e){return e?.input!==void 0}function wL(e){let t=$();cl(rP(e)),Qr(JP(e)),$P(e),SL(e);let n=YP(e);Ka(n),t&&(t.on("beforeSendEvent",BP(e)),t.on("afterSendEvent",DP(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 CL(e){try{return Promise.all(ad(e,[RL(je.performance.memory)]))}catch{return[]}}function RL(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 xL(e,t,n){return Zp(e,t,{...n,setTimeoutImpl:Ii})}var Bu=G.navigator;function bL(){return/iPhone|iPad|iPod/i.test(Bu?.userAgent??"")||/Macintosh/i.test(Bu?.userAgent??"")&&Bu?.maxTouchPoints&&Bu?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function kL(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){re&&oe.warn("Received replay event after session expired.");return}let o=r||!t;t=!0,NL(n),e.clickDetector&&QM(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!wh(e,n,o))return!0;if(!o)return!1;let i=e.session;if(ML(e,o),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){let s=e.eventBuffer.getEarliestTimestamp();s&&(re&&oe.log(`Updating session start time to earliest event in buffer to ${new Date(s)}`),i.started=s,e.getOptions().stickySession&&sd(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function NL(e){let t=e.data;if(!(e.type!==me.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==se.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(let n of t.attributes){let r=fr.mirror.getNode(n.id),o=r&&fr.mirror.getMeta(r);if(o?.type===id.Element)for(let[i,s]of Object.entries(n.attributes))s===null?delete o.attributes[i]:o.attributes[i]=s}}function AL(e){let t=e.getOptions();return{type:me.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 ML(e,t){!t||e.session?.segmentId!==0||wh(e,AL(e),!1)}function PL(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function LL(e,t,n,r){return en(ja(e,as(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function OL({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 DL({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 Va(e.getOptions(),r,i,t,e,Xe());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 UL({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:i}){let s=OL({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:l,traceIds:c,initialTimestamp:u}=r,f=$(),p=te(),h=f?.getTransport(),y=f?.getDsn();if(!f||!h||!y||!i.sampled)return Promise.resolve({});let _={type:w1,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 DL({scope:p,client:f,replayId:t,event:_});if(!T)return f.recordDroppedEvent("event_processor","replay"),re&&oe.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete T.sdkProcessingMetadata;let g=LL(T,s,y,f.getOptions().tunnel),S;try{S=await h.send(g)}catch(R){let M=new Error(mh);try{M.cause=R}catch{}throw M}let E=Za({},S);if(Qa(E,"replay"))throw new Cl(E);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new ed(S.statusCode);return S}var ed=class extends Error{constructor(t){super(`Transport returned status code ${t}`)}},Cl=class extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}},td=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function YT(e,t={count:0,interval:N1}){let{recordingData:n,onError:r}=e;if(n.length)try{return await UL(e),!0}catch(o){if(o instanceof ed||o instanceof Cl)throw o;if(mi("Replays",{_retryCount:t.count}),r&&r(o),t.count>=A1){let i=new Error(`${mh} - max retries exceeded`);try{i.cause=o}catch{}throw i}return t.interval*=++t.count,new Promise((i,s)=>{Ii(async()=>{try{await YT(e,t),i(!0)}catch(a){s(a)}},t.interval)})}}var KT="__THROTTLED",FL="__SKIPPED";function BL(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?FL:KT}s=!1;let c=r.get(l)||0;return r.set(l,c+1),e(...a)}}var dh=class{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:C1,sessionIdleExpire:R1},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=xL(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=BL((s,a)=>PP(this,s,a),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(M1,r),timeout:r,scrollTimeout:P1,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new oh(this,i)),re){let s=t._experiments;oe.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{je.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let s=br({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{let s=br({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{aP(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){re&&oe.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){re&&oe.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",re&&oe.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){re&&oe.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){re&&oe.log("Buffering is in progress, call `flush()` to save the replay");return}re&&oe.infoTick("Starting replay in session mode"),this._updateUserActivity();let t=zm({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){re&&oe.log("Buffering is in progress, call `flush()` to save the replay");return}re&&oe.infoTick("Starting replay in buffer mode");let t=zm({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=fr({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:k1}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:kL(this),...bL(),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{re&&oe.log(`Stopping Replay triggered by ${r}`),Xu(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,xP(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),re&&oe.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),re&&oe.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();re&&oe.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(),lT(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&&lh(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let t=`${je.location.pathname}${je.location.hash}${je.location.search}`,n=`${je.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===KT){let o=br({category:"replay.throttled"});this.addUpdate(()=>!wh(this,{type:zM,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let t=this.lastActiveSpan||Me(),n=t&&be(t),o=(n&&ne(n).data||{})[vt];if(!(!n||!o||!["route","custom"].includes(o)))return ne(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=wP({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&&lT(this.session.id)}_initializeSessionForSampling(t){let n=this._options.errorSampleRate>0,r=zm({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 Ju(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{je.document.addEventListener("visibilitychange",this._handleVisibilityChange),je.addEventListener("blur",this._handleWindowBlur),je.addEventListener("focus",this._handleWindowFocus),je.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(wL(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=vP(this)}_removeListeners(){try{je.document.removeEventListener("visibilitychange",this._handleVisibilityChange),je.removeEventListener("blur",this._handleWindowBlur),je.removeEventListener("focus",this._handleWindowFocus),je.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(Ju(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Xu();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){re&&oe.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:me.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=dP(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(ad(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){re&&oe.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await CL(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new td;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await YT({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 Cl?o="ratelimit_backoff":n instanceof td?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){re&&oe.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){re&&oe.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&&re&&oe.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&&sd(this.session)}_onMutationHandler(t){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{let l=PL(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=br({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function ml(e,t){return[...e,...t].join(",")}function HL({mask:e,unmask:t,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],s=ml(e,[".sentry-mask","[data-sentry-mask]"]),a=ml(t,[]);return{maskTextSelector:s,unmaskTextSelector:a,blockSelector:ml(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:ml(r,[]),ignoreSelector:ml(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function $L({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 uT='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',zL=["content-length","content-type","accept"],jL=Symbol.for("sentry__originalRequestBody"),dT=!1,fT=!1;function WL(){if(typeof Request>"u"||fT)return;let e=Request;try{let t=function(n,r){let o=new e(n,r);return r?.body!=null&&(o[jL]=r.body),o};t.prototype=e.prototype,G.Request=t,fT=!0}catch{}}var Rh=(e=>new fh(e)),fh=class{constructor({flushMinDelay:t=x1,flushMaxDelay:n=b1,minReplayDuration:r=L1,maxReplayDuration:o=jE,stickySession:i=!0,useCompression:s=!0,workerUrl:a,_experiments:l={},maskAllText:c=!0,maskAllInputs:u=!0,blockAllMedia:f=!0,mutationBreadcrumbLimit:p=750,mutationLimit:h=1e4,slowClickTimeout:y=7e3,slowClickIgnoreSelectors:_=[],networkDetailAllowUrls:T=[],networkDetailDenyUrls:g=[],networkCaptureBodies:S=!0,networkRequestHeaders:E=[],networkResponseHeaders:R=[],mask:M=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:I=[],block:N=[],unblock:U=[],ignore:x=[],maskFn:H,beforeAddRecordingEvent:j,beforeErrorSampling:ge,onError:X,attachRawBodyFromRequest:Ze=!1}={}){this.name="Replay";let fe=HL({mask:M,unmask:I,block:N,unblock:U,ignore:x});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:H,maskInputFn:H,maskAttributeFn:(de,D,ye)=>$L({maskAttributes:A,maskAllText:c,privacyOptions:fe,key:de,value:D,el:ye}),...fe,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:de=>{try{de.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!l.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,O1),maxReplayDuration:Math.min(o,jE),stickySession:i,useCompression:s,workerUrl:a,blockAllMedia:f,maskAllInputs:u,maskAllText:c,mutationBreadcrumbLimit:p,mutationLimit:h,slowClickTimeout:y,slowClickIgnoreSelectors:_,networkDetailAllowUrls:T,networkDetailDenyUrls:g,networkCaptureBodies:S,networkRequestHeaders:pT(E),networkResponseHeaders:pT(R),beforeAddRecordingEvent:j,beforeErrorSampling:ge,onError:X,attachRawBodyFromRequest:Ze,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${uT}`:uT,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&jn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return dT}set _isInitialized(t){dT=t}afterAllSetup(t){!jn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&WL(),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&&Io(t,{"sentry.replay_id":n})}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){let n=GL(this._initialOptions,t);this._replay=new dh({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{let n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function GL(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=bn(n.replaysSessionSampleRate),i=bn(n.replaysOnErrorSampleRate);return o==null&&i==null&&kt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function pT(e){return[...zL,...e.map(t=>t.toLowerCase())]}function JT(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function xh(e){try{return new URL(e,ee.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 bh(e){try{return new Headers(e)}catch{return}}var kh={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function ZT(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:s,onRequestSpanStart:a,onRequestSpanEnd:l}={...kh,...t},c=typeof o=="function"?o:h=>!0,u=h=>qL(h,s),f={},p=e.getOptions().propagateTraceparent;n&&Co(h=>{let y=im(h,c,u,f,{propagateTraceparent:p,onRequestSpanEnd:l});if(y){let _=xh(h.fetchData.url),T=_?zn(_).host:void 0;y.setAttributes({"http.url":_?Wt(_):void 0,"server.address":T}),i&&QT(y,e),a?.(y,{headers:h.headers})}}),r&&ul(h=>{let y=YL(h,c,u,f,p,l);y&&(i&&QT(y,e),a?.(y,{headers:bh(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}var VL=300;function QT(e,t){let{url:n}=ne(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(Mt(t)){let i=e.end.bind(e);e.end=s=>{let a=s??Ae(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(a),clearTimeout(u))};r=c;let u=setTimeout(c,VL)}}let o=cr("resource",({entries:i})=>{i.forEach(s=>{XT(s)&&s.name.endsWith(n)&&(e.setAttributes(al(s)),r())})})}function qL(e,t){let n=hn();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?Nt(r.toString(),t)||i&&Nt(r.pathname,t):i}else{let r=!!e.match(/^\/(?!\/)/);return t?Nt(e,t):r}}function YL(e,t,n,r,o,i){let s=e.xhr,a=s?.[ur];if(!s||s.__sentry_own_request__||!a)return;let{url:l,method:c}=a,u=Et()&&t(l);if(e.endTimestamp){let S=s.__sentry_xhr_span_id__;if(!S)return;let E=r[S];E&&(u&&a.status_code!==void 0&&(rs(E,a.status_code),E.end(),i?.(E,{headers:bh(dl(s)),error:e.error})),delete r[S]);return}let f=xh(l),p=f?zn(f):zn(l),h=Wt(Zc(l)),y=$(),T=!!Me()||!!y&&Mt(y),g=u&&T?wt({name:`${c} ${h}`,attributes:{url:Wt(l),type:"xhr","http.method":c,"http.url":f?Wt(f):void 0,"server.address":p?.host,[we]:"auto.http.browser",[qe]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new At;return u&&!T&&y?.recordDroppedEvent("no_parent_span","span"),s.__sentry_xhr_span_id__=g.spanContext().spanId,r[s.__sentry_xhr_span_id__]=g,n(l)&&KL(s,Et()&&T?g:void 0,o),y&&y.emit("beforeOutgoingRequestSpan",g,e),g}function KL(e,t,n){let{"sentry-trace":r,baggage:o,traceparent:i}=hs({span:t,propagateTraceparent:n});r&&JL(e,r,o,i)}function JL(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||!JT(i))&&e.setRequestHeader("baggage",n)}}catch{}}var eI=new WeakMap,tI=new WeakMap,XL=9e4,QL=["text/event-stream","application/x-ndjson","application/stream+json"],nI=()=>({name:"FetchStreamPerformance",setup(){fu(e=>{if(e.response){let t=eI.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=tI.get(e.response);n&&clearTimeout(n)}}}),Co(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!QL.some(l=>t.startsWith(l)))return;let n=e.fetchData?.url||"",r=e.fetchData?.method||"GET",o=Ir(n),i=n.startsWith("data:")?Wt(n):o?us(o):n,s=wt({name:`${r} ${i}`,startTime:e.endTimestamp,attributes:{url:Wt(n),"http.method":r,type:"fetch",[qe]:"http.client.stream",[we]:"auto.http.browser.stream"}});eI.set(e.response,s);let a=setTimeout(()=>{s.isRecording()&&s.end()},XL);tI.set(e.response,a)}})}});function rI(){ee.document?ee.document.addEventListener("visibilitychange",()=>{let e=Me();if(!e)return;let t=be(e);if(ee.document.hidden&&t){let n="cancelled",{op:r,status:o}=ne(t);et&&C.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()}}):et&&C.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var ZL=3600,oI="sentry_previous_trace",eO="sentry.previous_trace";function iI(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t==="session-storage",o=r?rO():void 0;e.on("spanStart",s=>{if(be(s)!==s)return;let a=te().getPropagationContext();o=tO(o,s,a),r&&nO(o)});let i=!0;n&&e.on("beforeSampling",s=>{if(!o)return;let a=te(),l=a.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(Nh(o.spanContext))},sampleRand:o.sampleRand}),s.parentSampled=Nh(o.spanContext),s.parentSampleRate=o.sampleRate,s.spanAttributes={...s.spanAttributes,[ts]:o.sampleRate}})}function tO(e,t,n){let r=ne(t);function o(){try{let a=Number(r.data?.[$r]??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<=ZL&&(et&&C.log(`Adding previous_trace \`${JSON.stringify(s)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:s,attributes:{[Uc]:"previous_trace"}}),t.setAttribute(eO,`${s.traceId}-${s.spanId}-${Nh(s)?1:0}`)),i)}function nO(e){try{ee.sessionStorage.setItem(oI,JSON.stringify(e))}catch(t){et&&C.warn("Could not store previous trace in sessionStorage",t)}}function rO(){try{let e=ee.sessionStorage?.getItem(oI);return JSON.parse(e)}catch{return}}function Nh(e){return e.traceFlags===1}var oO="BrowserTracing",iO=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function uI(){let e=ee.navigator;return e?.userAgent?iO.test(e.userAgent):!1}var sO={...cs,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...kh},Ah=((e={})=>{"enableElementTiming"in e&&kt(()=>{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=ee.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:s,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:u,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:y,traceXHR:_,trackFetchStreamPerformance:T,shouldCreateSpanForRequest:g,enableHTTPTimings:S,ignoreResourceSpans:E,ignorePerformanceApiSpans:R,instrumentPageLoad:M,instrumentNavigation:A,detectRedirects:I,linkPreviousTrace:N,consistentTraceSampling:U,enableReportPageLoaded:x,onRequestSpanStart:H,onRequestSpanEnd:j}={...sO,...e},ge=uI(),X,Ze,fe;function de(D,ye,Q=!0){let ae=ye.op==="pageload",Re=ye.name,Te=c?c(ye):ye,St=Te.attributes||{};if(Re!==Te.name&&(St[vt]="custom",Te.attributes=St),!Q){let it=dn();wt({...Te,startTime:it}).end(it);return}t.name=Te.name,t.source=St[vt];let ot=Xc(Te,{idleTimeout:u,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:ae,beforeSpanEnd:it=>{X?.();let In=Mt(D);Im(it,{recordClsOnPageloadSpan:!In&&!a,recordLcpOnPageloadSpan:!In&&!l,ignoreResourceSpans:E,ignorePerformanceApiSpans:R,spanStreamingEnabled:In}),lI(D,void 0);let Dt=te(),wn=Dt.getPropagationContext();Dt.setPropagationContext({...wn,traceId:ot.spanContext().traceId,sampled:mn(ot),dsc:ht(it)}),ae&&(fe=void 0)},trimIdleSpanEndTimestamp:!x});ae&&x&&(fe=ot),lI(D,ot);function bt(){n&&["interactive","complete"].includes(n.readyState)&&D.emit("idleSpanEnableAutoFinish",ot)}ae&&!x&&n&&(n.addEventListener("readystatechange",()=>{bt()}),bt())}return{name:oO,setup(D){if(ge){et&&C.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}Wc();let ye=Mt(D);if(X=_m({recordClsStandaloneSpans:ye?void 0:a||!1,recordLcpStandaloneSpans:ye?void 0:l||!1,client:D}),ye?(km(D),Nm(D),r&&Am()):r&&Rm(),i&&G.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?Em():o&&vm(),s&&Tm(),I&&n){let ae=()=>{Ze=Ae()};addEventListener("click",ae,{capture:!0}),addEventListener("keydown",ae,{capture:!0,passive:!0})}function Q(){let ae=bl(D);ae&&!ne(ae).timestamp&&(et&&C.log(`[Tracing] Finishing current active span with op: ${ne(ae).op}`),ae.setAttribute(zr,"cancelled"),ae.end())}D.on("startNavigationSpan",(ae,Re)=>{if($()!==D)return;if(Re?.isRedirect){et&&C.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),de(D,{op:"navigation.redirect",...ae},!1);return}Ze=void 0,Q(),Xe().setPropagationContext({traceId:Zt(),sampleRand:Math.random(),propagationSpanId:Et()?void 0:zt()});let Te=te();Te.setPropagationContext({traceId:Zt(),sampleRand:Math.random(),propagationSpanId:Et()?void 0:zt()}),Te.setSDKProcessingMetadata({normalizedRequest:void 0}),de(D,{op:"navigation",...ae,parentSpan:null,forceTransaction:!0})}),D.on("startPageLoadSpan",(ae,Re={})=>{if($()!==D)return;Q();let Te=Re.sentryTrace||sI("sentry-trace")||aI("sentry-trace"),St=Re.baggage||sI("baggage")||aI("baggage"),ot=Ip(Te,St),bt=te();bt.setPropagationContext(ot),Et()||(bt.getPropagationContext().propagationSpanId=zt()),bt.setSDKProcessingMetadata({normalizedRequest:Ss()}),de(D,{op:"pageload",...ae})}),D.on("endPageloadSpan",()=>{x&&fe&&(fe.setAttribute(zr,"reportPageLoaded"),fe.end())})},afterAllSetup(D){if(ge)return;let ye=hn();if(N!=="off"&&iI(D,{linkPreviousTrace:N,consistentTraceSampling:U}),ee.location){if(M){let Q=He();dI(D,{name:ee.location.pathname,startTime:Q?Q/1e3:void 0,attributes:{[vt]:"url",[we]:"auto.pageload.browser"}})}A&&Qr(({to:Q,from:ae})=>{if(ae===void 0&&ye?.indexOf(Q)!==-1){ye=void 0;return}ye=void 0;let Re=Ir(Q),Te=bl(D),St=Te&&I&&lO(Te,Ze);fI(D,{name:Re?.pathname||ee.location.pathname,attributes:{[vt]:"url",[we]:"auto.navigation.browser"}},{url:Q,isRedirect:St})})}h&&rI(),s&&aO(D,u,f,p,t),r&&xm(),ZT(D,{traceFetch:y,traceXHR:_,tracePropagationTargets:D.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:g,enableHTTPTimings:S,onRequestSpanStart:H,onRequestSpanEnd:j}),T&&D.addIntegration(nI())}}});function dI(e,t,n){e.emit("startPageLoadSpan",t,n),te().setTransactionName(t.name);let r=bl(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function fI(e,t,n){let{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});let i=te();return i.setTransactionName(t.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...Ss(),url:r}}),bl(e)}function sI(e){return ee.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function aI(e){return ee.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function aO(e,t,n,r,o){let i=ee.document,s,a=()=>{let l="ui.action.click",c=bl(e);if(c){let u=ne(c).op;if(["navigation","pageload"].includes(u)){et&&C.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(zr,"interactionInterrupted"),s.end(),s=void 0),!o.name){et&&C.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}s=Xc({name:o.name,op:l,attributes:{[vt]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}var pI="_sentry_idleSpan";function bl(e){return e[pI]}function lI(e,t){Ve(e,pI,t)}var cI=1.5;function lO(e,t){let n=ne(e),r=dn(),o=n.start_timestamp;return!(r-o>cI||t&&r-t<=cI)}var bI=Cn(eo(),1);function xI(e){return Fn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Uh(e){let t={...e};nl(t,"react"),mi("react",{version:bI.version});let n=Um(t);return Zi(wO),n}function wO(e){return xI(e)?"[SyntheticEvent]":fl(e)}var kI=Cn(eo(),1);function CO(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function RO(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 NI(e,{componentStack:t},n){if(CO(kI.version)&&Un(e)&&t){let r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,RO(e,r)}return $n(r=>(r.setContext("react",{componentStack:t}),Gr(e,n)))}var Ci=Cn(eo(),1);var AI=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Fh={componentStack:null,error:null,eventId:null},Ds=class extends Ci.Component{constructor(t){super(t),this.state=Fh,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&&Ou({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:s,dialogOptions:a}=this.props;$n(l=>{o&&o(l,t,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,u=NI(t,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(t,r,u),s&&(this._lastEventId=u,this._openFallbackReportDialog&&Ou({...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===Fh?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(Fh)}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"?Ci.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return Ci.isValidElement(o)?o:(t&&AI&&C.warn("fallback did not produce a valid ReactElement"),null)}};function Bh(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 to=window.__vidfarmSentry,PI=to?.dsn?.trim()||"";if(PI){let e=to?.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,...to?.tracePropagationTargets??[]].filter(Boolean)));Uh({dsn:PI,environment:e,release:to?.release?.trim()||void 0,integrations:[Ah(),Rh({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:Bh(to?.tracesSampleRate,t),tracePropagationTargets:o,replaysSessionSampleRate:Bh(to?.replaysSessionSampleRate,n),replaysOnErrorSampleRate:Bh(to?.replaysOnErrorSampleRate,1),enableLogs:to?.enableLogs??!0,sendDefaultPii:to?.sendDefaultPii??!0})}var Gi=Cn(eo(),1),QR=Cn(Mf(),1),ZR=Cn(ZC(),1);var eR=e=>{let t,n=new Set,r=(c,u)=>{let f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){let p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),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},Pf=(e=>e?eR(e):eR);var Ec=Cn(eo(),1);var kU=e=>e;function tR(e,t=kU){let n=Ec.default.useSyncExternalStore(e.subscribe,Ec.default.useCallback(()=>t(e.getState()),[e,t]),Ec.default.useCallback(()=>t(e.getInitialState()),[e,t]));return Ec.default.useDebugValue(n),n}var NU="[vidfarm]";function AU(e){if(e!=="debug")return!0;if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("debug")||window.localStorage?.getItem("VIDFARM_DEBUG")==="1"}catch{return!1}}function eS(e,t,n){let r={event:t,detail:n,timestamp:new Date().toISOString()};typeof window<"u"&&(window.__VIDFARM_DEBUG_LOGS__=window.__VIDFARM_DEBUG_LOGS__??[],window.__VIDFARM_DEBUG_LOGS__.push(r),window.__VIDFARM_DEBUG_LOGS__.length>1e3&&window.__VIDFARM_DEBUG_LOGS__.splice(0,window.__VIDFARM_DEBUG_LOGS__.length-1e3)),AU(e)&&console[e==="debug"?"log":e](NU,t,n??"")}function Or(e,t){eS("info",e,t)}function nR(e,t){eS("warn",e,t)}function po(e,t){eS("error",e,t)}function rR(){typeof window>"u"||window.__VIDFARM_DEBUG_HOOKS__||(window.__VIDFARM_DEBUG_HOOKS__=!0,Or("boot.hooks-installed",{href:window.location.href,readyState:document.readyState,userAgent:navigator.userAgent}),window.addEventListener("error",e=>{po("window.error",{message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,error:e.error instanceof Error?e.error.stack:e.error})}),window.addEventListener("unhandledrejection",e=>{po("window.unhandledrejection",{reason:e.reason instanceof Error?e.reason.stack:e.reason})}))}var MU="vidfarm:flockposter-cache:v1",PU="public",Lf={channels:[],posts:[],channelsUpdatedAt:null,calendarUpdatedAt:null,calendarRangeStart:null,calendarRangeEnd:null};function sR(e){return`${MU}_${e?.trim()||PU}`}function nS(e){if(typeof window>"u")return Lf;try{let t=window.localStorage.getItem(sR(e));if(!t)return Lf;let n=JSON.parse(t);return!n||typeof n!="object"?Lf:{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 Lf}}function oR(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(sR(t),JSON.stringify(e))}catch{}}function aR(e){let t=nS(e);return Pf((n,r)=>({...t,setChannelsData:o=>{let i=r(),s={...i,channels:[...i.channels.filter(iR),...o.filter(a=>!iR(a))],channelsUpdatedAt:new Date().toISOString()};oR(s,e),n(s)},setCalendarData:o=>{let i=r(),s=LU([...i.channels,...o.channels]),a=o.replaceRange?OU(i.posts,o.posts,o.rangeStart,o.rangeEnd):tS([...i.posts,...o.posts]),l={...i,channels:s,posts:a,channelsUpdatedAt:new Date().toISOString(),calendarUpdatedAt:new Date().toISOString(),calendarRangeStart:DU(i.calendarRangeStart,o.rangeStart),calendarRangeEnd:UU(i.calendarRangeEnd,o.rangeEnd)};oR(l,e),n(l)}}))}function LU(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function iR(e){return e.id.startsWith("email:")||e.platform?.toLowerCase()==="email"}function tS(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function OU(e,t,n,r){let o=Date.parse(n),i=Date.parse(r);return Number.isNaN(o)||Number.isNaN(i)?tS([...e,...t]):tS([...e.filter(s=>{let a=Date.parse(s.scheduledAt);return Number.isNaN(a)||a<o||a>i}),...t])}function DU(e,t){return e?Date.parse(t)<Date.parse(e)?t:e:t}function UU(e,t){return e?Date.parse(t)>Date.parse(e)?t:e:t}function lR(e){return Pf(t=>({boot:e,hydratedAt:null,setHydratedAt:n=>t({hydratedAt:n})}))}var k=Cn(eo(),1),Wi=Cn(Mf(),1);var d=Cn(Tc(),1),Vf=1024*1024,OR=50*Vf,WU=2*Vf,GU=3*Vf,VU=Math.floor(3.5*Vf),qU=2048,DR="chat";function pa(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 jf(e){return e.contentType.startsWith("image/")}function uS(e){return e.contentType.startsWith("video/")}var YU=new Set(["apng","avif","gif","jpeg","jpg","png","svg","webp"]),KU=new Set(["m4v","mov","mp4","mpeg","mpg","ogv","webm"]),fR=1200,rS=24,oS=80,JU=/^data:([^;,]+)[^,]*,/i,pR=/authorization|api[-_]?key|secret|token|vidfarm-api-key/i,XU=48e3,iS=14,QU=12e3,ZU=1200,eF=30;function Bf(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 Hf(e){let t=JU.exec(e);return t?`[${t[1]} data URL omitted, ${e.length.toLocaleString()} chars]`:e.length>fR?`${e.slice(0,fR)}\u2026 [truncated ${e.length.toLocaleString()} chars]`:e}function ji(e,t=0){if(e==null)return e;if(typeof e=="string")return Hf(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,rS).map(r=>ji(r,t+1));return e.length>rS&&n.push(`[${e.length-rS} more items omitted]`),n}if(typeof e=="object"){let n={},r=Object.entries(e);for(let[o,i]of r.slice(0,oS)){let s=ji(i,t+1);s!==void 0&&(n[o]=s)}return r.length>oS&&(n.__omitted_keys=r.length-oS),n}return String(e)}}function UR(e){return ji(e)}function Cc(e){return{...e,request:{...e.request,headers:Object.fromEntries(Object.entries(e.request.headers).map(([t,n])=>[t,pR.test(t)?"[redacted]":Hf(n)])),body:ji(e.request.body)},result:{...e.result,headers:Object.fromEntries(Object.entries(e.result.headers).map(([t,n])=>[t,pR.test(t)?"[redacted]":Hf(n)])),body:ji(e.result.body),error:e.result.error?Hf(e.result.error):e.result.error}}}function tF(){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 FR(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function sS(e){let t=FR(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 BR(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>${FR(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>${sS(c)}</li>`).join("")}</ul>`:i.every(l=>/^\d+\.\s+/.test(l.trim()))?`<ol>${i.map(c=>c.trim().replace(/^\d+\.\s+/,"")).map(c=>`<li>${sS(c)}</li>`).join("")}</ol>`:`<p>${i.map(l=>sS(l.trim())).join("<br />")}</p>`}).filter(Boolean).join(""):""}function nF(e){return e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function rF(e){return/^item \d+$/i.test(e.trim())||/^output$/i.test(e.trim())}function oF(e){try{let n=new URL(e).searchParams.get("key");return n?.trim()?n.trim().replace(/^\/+/,""):null}catch{return null}}function Wf(e){try{return decodeURIComponent(e)}catch{return e}}function mS(e){let t=oF(e);if(t){let n=Wf(t.split("/").filter(Boolean).pop()||"");if(n)return n}try{let n=new URL(e).pathname;return Wf(n.split("/").filter(Boolean).pop()||"")}catch{return""}}function HR(e){return mS(e)||"Output"}function $R(e,t){let n=mS(e);return n||t.trim().replace(/[\\/:*?"<>|]+/g,"-")||"download"}function iF(e){let n=mS(e).split(".").pop()?.trim().toLowerCase()||"";return YU.has(n)?"image":KU.has(n)?"video":null}function sF(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 aF(e,t=[]){let n=new Set(t),r=new Set,o=[];for(let i of sF(e)){if(n.has(i)||r.has(i))continue;let s=iF(i);s&&(r.add(i),o.push({kind:s,url:i,label:HR(i)}))}return o}function dS(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=nF(i),a=HR(o);t.push({label:a!=="Output"?a:s&&!rF(i)?s:a,url:o})}return}if(Array.isArray(e)){for(let[o,i]of e.entries())if(dS(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(dS(i,t,n,[...r,o]),t.length>=12)return}}}function mR(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(`
30
+ or you can use record.mirror to access the mirror instance during recording.`,KE={map:{},getId(){return console.error(Rs),-1},getNode(){return console.error(Rs),null},removeNodeFromMap(){console.error(Rs)},has(){return console.error(Rs),!1},reset(){console.error(Rs)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(KE=new Proxy(KE,{get(e,t,n){return t==="map"&&console.error(Rs),Reflect.get(e,t,n)}}));function vl(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&&(IM(r),r=null),o=s,e.apply(l,i)):!r&&n.trailing!==!1&&(r=od(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(l,i)},a))}}function ET(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){od(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>ET(e,t,i||{},!0)}function Sh(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 Gu=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Gu=()=>new Date().getTime());function TT(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 IT(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function wT(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function CT(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Nn(e,t,n,r,o){if(!e)return!1;let i=CT(e);if(!i)return!1;let s=ks(t,n);if(!o){let c=r&&i.matches(r);return s(i)&&!c}let a=wi(i,s),l=-1;return a<0?!1:(r&&(l=wi(i,ks(null,r))),a>-1&&l<0?!0:a<l)}function SM(e,t){return t.getId(e)!==-1}function Fm(e,t){return t.getId(e)===_l}function RT(e,t){if(hl(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?RT(e.parentNode,t):!0:!0}function Gm(e){return!!e.changedTouches}function _M(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 xT(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function bT(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Vm(e){return!!e?.shadowRoot}var qm=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 kT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function vM(e){let t=e,n;for(;n=kT(t);)t=n;return t}function EM(e){let t=e.ownerDocument;if(!t)return!1;let n=vM(e);return t.contains(n)}function NT(e){let t=e.ownerDocument;return t?t.contains(e)||EM(e):!1}var JE={};function _h(e){let t=JE[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 JE[e]=r.bind(window)}function TM(...e){return _h("requestAnimationFrame")(...e)}function od(...e){return _h("setTimeout")(...e)}function IM(...e){return _h("clearTimeout")(...e)}var me=(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))(me||{}),se=(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))(se||{}),nn=(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))(nn||{}),Zr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Zr||{}),xs=(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))(xs||{}),yl;function wM(e){yl=e}function CM(){yl=void 0}var Ce=e=>yl?((...n)=>{try{return e(...n)}catch(r){if(yl&&yl(r)===!0)return()=>{};throw r}}):e,XE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",RM=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(pl=0;pl<XE.length;pl++)RM[XE.charCodeAt(pl)]=pl;var pl,Vu=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function vh(e){try{return e.contentDocument}catch{}}function El(e){try{return e.contentWindow}catch{}}var Ym=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 QE(e){return"__ln"in e}var Km=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&&QE(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&&QE(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--)}},ZE=(e,t)=>`${e}@${t}`,Jm=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 Km,o=l=>{let c=l,u=_l;for(;u===_l;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},i=l=>{if(!l.parentNode||!NT(l))return;let c=hl(l.parentNode)?this.mirror.getId(kT(l)):this.mirror.getId(l.parentNode),u=o(l);if(c===-1||u===-1)return r.addNode(l);let f=Ns(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=>{xT(p,this.mirror)&&!Nn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),bT(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Vm(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,h)=>{if(Nn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,h);let y=El(p);y&&this.canvasManager.addWindow(y),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,h)=>{this.stylesheetManager.attachLinkElement(p,h)},onBlockedImageLoad:(p,h,{width:y,height:_})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:h.id,attributes:{style:{width:`${y}px`,height:`${_}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});f&&(t.push({parentId:c,nextId:u,node:f}),n.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)eT(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(let l of this.addedSet)!tT(this.droppedSet,l)&&!eT(this.removes,l,this.mirror)||tT(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 f=this.mirror.getId(u.value.parentNode);if(o(u.value)===-1)continue;if(f!==-1){l=u;break}else{let h=u.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let y=h.parentNode.host;if(this.mirror.getId(y)!==-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),f=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+f).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(!Fm(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!Nn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Ps(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,CT(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=gh(n),a=n.tagName;o=ju(n,a,s);let l=nd({maskInputOptions:this.maskInputOptions,tagName:a,type:s}),c=Ps(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=Sl({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(Nn(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(!vh(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"),!vT(n.tagName,r)&&(i.attributes[r]=_T(this.doc,Ms(n.tagName),Ms(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(Nn(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=hl(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Nn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Fm(n,this.mirror)||!SM(n,this.mirror)||(this.addedSet.has(n)?(Xm(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||RT(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[ZE(r,o)]?Xm(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:hl(t.target)&&gl(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(Fm(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[ZE(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Nn(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Vm(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 Ym(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 Xm(e,t){e.delete(t),t.childNodes?.forEach(n=>Xm(e,n))}function eT(e,t,n){return e.length===0?!1:xM(e,t,n)}function xM(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 tT(e,t){return e.size===0?!1:AT(e,t)}function AT(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:AT(e,n):!1}var As=[];function Rl(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 MT(e,t){let n=new Jm;As.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(Ce(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 bM({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=vl(Ce(f=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),f),s=[],a=null}),i),c=Ce(vl(Ce(f=>{let p=Rl(f),{clientX:h,clientY:y}=Gm(f)?f.changedTouches[0]:f;a||(a=Gu()),s.push({x:h,y,id:r.getId(p),timeOffset:Gu()-a}),l(typeof DragEvent<"u"&&f instanceof DragEvent?se.Drag:f instanceof MouseEvent?se.MouseMove:se.TouchMove)}),o,{trailing:!1})),u=[rn("mousemove",c,n),rn("touchmove",c,n),rn("drag",c,n)];return Ce(()=>{u.forEach(f=>f())})}function kM({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=f=>p=>{let h=Rl(p);if(Nn(h,r,o,i,!0))return;let y=null,_=f;if("pointerType"in p){switch(p.pointerType){case"mouse":y=Zr.Mouse;break;case"touch":y=Zr.Touch;break;case"pen":y=Zr.Pen;break}y===Zr.Touch?nn[f]===nn.MouseDown?_="TouchStart":nn[f]===nn.MouseUp&&(_="TouchEnd"):Zr.Pen}else Gm(p)&&(y=Zr.Touch);y!==null?(c=y,(_.startsWith("Touch")&&y===Zr.Touch||_.startsWith("Mouse")&&y===Zr.Mouse)&&(y=null)):nn[f]===nn.Click&&(y=c,c=null);let T=Gm(p)?p.changedTouches[0]:p;if(!T)return;let g=n.getId(h),{clientX:S,clientY:E}=T;Ce(e)({type:nn[_],id:g,x:S,y:E,...y!==null&&{pointerType:y}})};return Object.keys(nn).filter(f=>Number.isNaN(Number(f))&&!f.endsWith("_Departed")&&a[f]!==!1).forEach(f=>{let p=Ms(f),h=u(f);if(window.PointerEvent)switch(nn[f]){case nn.MouseDown:case nn.MouseUp:p=p.replace("mouse","pointer");break;case nn.TouchStart:case nn.TouchEnd:return}l.push(rn(p,h,t))}),Ce(()=>{l.forEach(f=>f())})}function PT({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){let a=Ce(vl(Ce(l=>{let c=Rl(l);if(!c||Nn(c,r,o,i,!0))return;let u=n.getId(c);if(c===t&&t.defaultView){let f=TT(t.defaultView);e({id:u,x:f.left,y:f.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}),s.scroll||100));return rn("scroll",a,t)}function NM({viewportResizeCb:e},{win:t}){let n=-1,r=-1,o=Ce(vl(Ce(()=>{let i=IT(),s=wT();(n!==i||r!==s)&&(e({width:Number(s),height:Number(i)}),n=i,r=s)}),200));return rn("resize",o,t)}var AM=["INPUT","TEXTAREA","SELECT"],nT=new WeakMap;function MM({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:f,maskTextClass:p,unmaskTextClass:h,maskTextSelector:y,unmaskTextSelector:_}){function T(I){let N=Rl(I),U=I.isTrusted,x=N&&jm(N.tagName);if(x==="OPTION"&&(N=N.parentElement),!N||!x||AM.indexOf(x)<0||Nn(N,r,o,i,!0))return;let H=N;if(H.classList.contains(s)||a&&H.matches(a))return;let j=gh(N),he=ju(H,x,j),X=!1,Ze=nd({maskInputOptions:l,tagName:x,type:j}),fe=Ps(N,p,y,h,_,Ze);(j==="radio"||j==="checkbox")&&(X=N.checked),he=Sl({isMasked:fe,element:N,value:he,maskInputFn:c}),g(N,f?{text:he,isChecked:X,userTriggered:U}:{text:he,isChecked:X});let de=N.name;j==="radio"&&de&&X&&t.querySelectorAll(`input[type="radio"][name="${de}"]`).forEach(D=>{if(D!==N){let ge=Sl({isMasked:fe,element:D,value:ju(D,x,j),maskInputFn:c});g(D,f?{text:ge,isChecked:!X,userTriggered:!1}:{text:ge,isChecked:!X})}})}function g(I,N){let U=nT.get(I);if(!U||U.text!==N.text||U.isChecked!==N.isChecked){nT.set(I,N);let x=n.getId(I);Ce(e)({...N,id:x})}}let E=(u.input==="last"?["change"]:["input","change"]).map(I=>rn(I,Ce(T),t)),R=t.defaultView;if(!R)return()=>{E.forEach(I=>I())};let M=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value"),A=[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]];return M&&M.set&&E.push(...A.map(I=>ET(I[0],I[1],{set(){Ce(T)({target:this,isTrusted:!1})}},!1,R))),Ce(()=>{E.forEach(I=>I())})}function qu(e){let t=[];function n(r,o){if(Uu("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Uu("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Uu("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Uu("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 bo(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function PM({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:Ce((u,f,p)=>{let[h,y]=p,{id:_,styleId:T}=bo(f,t,n.styleMirror);return(_&&_!==-1||T&&T!==-1)&&e({id:_,styleId:T,adds:[{rule:h,index:y}]}),u.apply(f,p)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Ce((u,f,p)=>{let[h]=p,{id:y,styleId:_}=bo(f,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,removes:[{index:h}]}),u.apply(f,p)})});let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ce((u,f,p)=>{let[h]=p,{id:y,styleId:_}=bo(f,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,replace:h}),u.apply(f,p)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ce((u,f,p)=>{let[h]=p,{id:y,styleId:_}=bo(f,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,replaceSync:h}),u.apply(f,p)})}));let l={};Fu("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Fu("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Fu("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Fu("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,f])=>{c[u]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(c[u].insertRule,{apply:Ce((p,h,y)=>{let[_,T]=y,{id:g,styleId:S}=bo(h.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,adds:[{rule:_,index:[...qu(h),T||0]}]}),p.apply(h,y)})}),f.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:Ce((p,h,y)=>{let[_]=y,{id:T,styleId:g}=bo(h.parentStyleSheet,t,n.styleMirror);return(T&&T!==-1||g&&g!==-1)&&e({id:T,styleId:g,removes:[{index:[...qu(h),_]}]}),p.apply(h,y)})})}),Ce(()=>{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,f])=>{f.prototype.insertRule=c[u].insertRule,f.prototype.deleteRule=c[u].deleteRule})})}function LT({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}}),Ce(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function LM({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Ce((a,l,c)=>{let[u,f,p]=c;if(n.has(u))return i.apply(l,[u,f,p]);let{id:h,styleId:y}=bo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||y&&y!==-1)&&e({id:h,styleId:y,set:{property:u,value:f,priority:p},index:qu(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Ce((a,l,c)=>{let[u]=c;if(n.has(u))return s.apply(l,[u]);let{id:f,styleId:p}=bo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||p&&p!==-1)&&e({id:f,styleId:p,remove:{property:u},index:qu(l.parentRule)}),a.apply(l,c)})}),Ce(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function OM({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:s}){let a=Ce(c=>vl(Ce(u=>{let f=Rl(u);if(!f||Nn(f,t,n,r,!0))return;let{currentTime:p,volume:h,muted:y,playbackRate:_}=f;e({type:c,id:o.getId(f),currentTime:p,volume:h,muted:y,playbackRate:_})}),i.media||500)),l=[rn("play",a(xs.Play),s),rn("pause",a(xs.Pause),s),rn("seeked",a(xs.Seeked),s),rn("volumechange",a(xs.VolumeChange),s),rn("ratechange",a(xs.RateChange),s)];return Ce(()=>{l.forEach(c=>c())})}function DM({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 f=new i(l,c,u);return o.set(f,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),f};let s=Sh(t.fonts,"add",function(a){return function(l){return od(Ce(()=>{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),Ce(()=>{r.forEach(a=>a())})}function UM(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:s}=e,a=!0,l=Ce(()=>{let c=t.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;let u=[],f=c.rangeCount||0;for(let p=0;p<f;p++){let h=c.getRangeAt(p),{startContainer:y,startOffset:_,endContainer:T,endOffset:g}=h;Nn(y,r,o,i,!0)||Nn(T,r,o,i,!0)||u.push({start:n.getId(y),startOffset:_,end:n.getId(T),endOffset:g})}s({ranges:u})});return l(),rn("selectionchange",l)}function FM({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Sh(n.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{}return o.apply(this,[i,s,a])}})}function BM(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=MT(e,e.doc));let o=bM(e),i=kM(e),s=PT(e),a=NM(e,{win:n}),l=MM(e),c=OM(e),u=()=>{},f=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(u=PM(e,{win:n}),f=LT(e,e.doc),p=LM(e,{win:n}),e.collectFonts&&(h=DM(e)));let y=UM(e),_=FM(e),T=[];for(let g of e.plugins)T.push(g.observer(g.callback,n,g.options));return Ce(()=>{As.forEach(g=>g.reset()),r?.disconnect(),o(),i(),s(),a(),l(),c(),u(),f(),p(),h(),y(),_(),T.forEach(g=>g())})}function Uu(e){return typeof window[e]<"u"}function Fu(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var Tl=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}},Qm=class{constructor(){this.crossOriginIframeMirror=new Tl(yh),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Zm=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Tl(yh),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tl(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=El(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&&El(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);let r=vh(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 me.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:me.IncrementalSnapshot,data:{source:se.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case me.Meta:case me.Load:case me.DomContentLoaded:return!1;case me.Plugin:return n;case me.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case me.IncrementalSnapshot:switch(n.data.source){case se.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 se.Drag:case se.TouchMove:case se.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case se.ViewportResize:return!1;case se.MediaInteraction:case se.MouseInteraction:case se.Scroll:case se.CanvasMutation:case se.Input:return this.replaceIds(n.data,t,["id"]),n;case se.StyleSheetRule:case se.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case se.Font:return n;case se.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case se.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!==gt.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},eh=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},th=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(!gl(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);let r=MT({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(PT({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),od(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(LT({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){let n=vh(t),r=El(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(Sh(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i);return this.shadowRoot&&NT(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()}},nh=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new qm,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:mT(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){}},rh=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,TM(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},lt,Yu;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 dr=V1();function fr(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:f=null,maskTextSelector:p=null,unmaskTextSelector:h=null,inlineStylesheet:y=!0,maskAllInputs:_,maskInputOptions:T,slimDOMOptions:g,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,maxCanvasSize:M=null,packFn:A,sampling:I={},dataURLOptions:N={},mousemoveWait:U,recordDOM:x=!0,recordCanvas:H=!1,recordCrossOriginIframes:j=!1,recordAfter:he=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:X=!1,collectFonts:Ze=!1,inlineImages:fe=!1,plugins:de,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:ge=new Set([]),errorHandler:Q,onMutation:ae,getCanvasManager:Re}=e;wM(Q);let Te=j?window.parent===window:!0,St=!1;if(!Te)try{window.parent.document&&(St=!1)}catch{St=!0}if(Te&&!t)throw new Error("emit function is required");if(!Te&&!St)return()=>{};U!==void 0&&I.mousemove===void 0&&(I.mousemove=U),dr.reset();let ot=_===!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:{},bt=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};_M();let it,In=0,Dt=J=>{for(let $e of de||[])$e.eventProcessor&&(J=$e.eventProcessor(J));return A&&!St&&(J=A(J)),J};lt=(J,$e)=>{let ye=J;if(ye.timestamp=Gu(),As[0]?.isFrozen()&&ye.type!==me.FullSnapshot&&!(ye.type===me.IncrementalSnapshot&&ye.data.source===se.Mutation)&&As.forEach(Je=>Je.unfreeze()),Te)t?.(Dt(ye),$e);else if(St){let Je={type:"rrweb",event:Dt(ye),origin:window.location.origin,isCheckout:$e};window.parent.postMessage(Je,"*")}if(ye.type===me.FullSnapshot)it=ye,In=0;else if(ye.type===me.IncrementalSnapshot){if(ye.data.source===se.Mutation&&ye.data.isAttachIframe)return;In++;let Je=r&&In>=r,Se=n&&it&&ye.timestamp-it.timestamp>n;(Je||Se)&&dt(!0)}};let wn=J=>{lt({type:me.IncrementalSnapshot,data:{source:se.Mutation,...J}})},nr=J=>lt({type:me.IncrementalSnapshot,data:{source:se.Scroll,...J}}),Vi=J=>lt({type:me.IncrementalSnapshot,data:{source:se.CanvasMutation,...J}}),Zo=J=>lt({type:me.IncrementalSnapshot,data:{source:se.AdoptedStyleSheet,...J}}),P=new nh({mutationCb:wn,adoptedStyleSheetCb:Zo}),V=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Qm:new Zm({mirror:dr,mutationCb:wn,stylesheetManager:P,recordCrossOriginIframes:j,wrappedEmit:lt});for(let J of de||[])J.getMirror&&J.getMirror({nodeMirror:dr,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});let ie=new rh,Y=$M(Re,{mirror:dr,win:window,mutationCb:J=>lt({type:me.IncrementalSnapshot,data:{source:se.CanvasMutation,...J}}),recordCanvas:H,blockClass:o,blockSelector:i,unblockSelector:s,maxCanvasSize:M,sampling:I.canvas,dataURLOptions:N,errorHandler:Q}),Ie=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new eh:new th({mutationCb:wn,scrollCb:nr,bypassOptions:{onMutation:ae,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskInputOptions:ot,dataURLOptions:N,maskAttributeFn:S,maskTextFn:R,maskInputFn:E,recordCanvas:H,inlineImages:fe,sampling:I,slimDOMOptions:bt,iframeManager:V,stylesheetManager:P,canvasManager:Y,keepIframeSrcFn:D,processedNodeManager:ie,ignoreCSSAttributes:ge},mirror:dr}),dt=(J=!1)=>{if(!x)return;lt({type:me.Meta,data:{href:window.location.href,width:wT(),height:IT()}},J),P.reset(),Ie.init(),As.forEach(ye=>ye.lock());let $e=yM(document,{mirror:dr,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskAllInputs:ot,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,slimDOM:bt,dataURLOptions:N,recordCanvas:H,inlineImages:fe,onSerialize:ye=>{xT(ye,dr)&&V.addIframe(ye),bT(ye,dr)&&P.trackLinkElement(ye),Vm(ye)&&Ie.addShadowRoot(ye.shadowRoot,document)},onIframeLoad:(ye,Je)=>{V.attachIframe(ye,Je);let Se=El(ye);Se&&Y.addWindow(Se),Ie.observeAttachShadow(ye)},onStylesheetLoad:(ye,Je)=>{P.attachLinkElement(ye,Je)},onBlockedImageLoad:(ye,Je,{width:Se,height:Ur})=>{wn({adds:[],removes:[],texts:[],attributes:[{id:Je.id,attributes:{style:{width:`${Se}px`,height:`${Ur}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:ge});if(!$e)return console.warn("Failed to snapshot the document");lt({type:me.FullSnapshot,data:{node:$e,initialOffset:TT(window)}}),As.forEach(ye=>ye.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,dr.getId(document))};Yu=dt;try{let J=[],$e=Je=>Ce(BM)({onMutation:ae,mutationCb:wn,mousemoveCb:(Se,Ur)=>lt({type:me.IncrementalSnapshot,data:{source:Ur,positions:Se}}),mouseInteractionCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.MouseInteraction,...Se}}),scrollCb:nr,viewportResizeCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.ViewportResize,...Se}}),inputCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.Input,...Se}}),mediaInteractionCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.MediaInteraction,...Se}}),styleSheetRuleCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.StyleSheetRule,...Se}}),styleDeclarationCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.StyleDeclaration,...Se}}),canvasMutationCb:Vi,fontCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.Font,...Se}}),selectionCb:Se=>{lt({type:me.IncrementalSnapshot,data:{source:se.Selection,...Se}})},customElementCb:Se=>{lt({type:me.IncrementalSnapshot,data:{source:se.CustomElement,...Se}})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskAllText:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:h,maskInputOptions:ot,inlineStylesheet:y,sampling:I,recordDOM:x,recordCanvas:H,inlineImages:fe,userTriggeredOnInput:X,collectFonts:Ze,doc:Je,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,keepIframeSrcFn:D,blockSelector:i,unblockSelector:s,slimDOMOptions:bt,dataURLOptions:N,mirror:dr,iframeManager:V,stylesheetManager:P,shadowDomManager:Ie,processedNodeManager:ie,canvasManager:Y,ignoreCSSAttributes:ge,plugins:de?.filter(Se=>Se.observer)?.map(Se=>({observer:Se.observer,options:Se.options,callback:Ur=>lt({type:me.Plugin,data:{plugin:Se.name,payload:Ur}})}))||[]},{});V.addLoadListener(Je=>{try{J.push($e(Je.contentDocument))}catch(Se){console.warn(Se)}});let ye=()=>{dt(),J.push($e(document))};return document.readyState==="interactive"||document.readyState==="complete"?ye():(J.push(rn("DOMContentLoaded",()=>{lt({type:me.DomContentLoaded,data:{}}),he==="DOMContentLoaded"&&ye()})),J.push(rn("load",()=>{lt({type:me.Load,data:{}}),he==="load"&&ye()},window))),()=>{J.forEach(Je=>Je()),ie.destroy(),Yu=void 0,CM()}}catch(J){console.warn(J)}}function HM(e){if(!Yu)throw new Error("please take full snapshot after start recording");Yu(e)}fr.mirror=dr;fr.takeFullSnapshot=HM;function $M(e,t){try{return e?e(t):new Vu}catch{return console.warn("Unable to initialize CanvasManager"),new Vu}}var rT;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(rT||(rT={}));var zM=3,jM=5;function Eh(e){return e>9999999999?e:e*1e3}function Bm(e){return e>9999999999?e/1e3:e}function xl(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:me.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:$t(t,10,1e3)}}),t.category==="console")))}var WM="button,a";function OT(e){return e.closest(WM)||e}function DT(e){let t=UT(e);return!t||!(t instanceof Element)?t:OT(t)}function UT(e){return GM(e)?e.target:e}function GM(e){return typeof e=="object"&&!!e&&"target"in e}var ko;function VM(e){return ko||(ko=[],qM()),ko.push(e),()=>{let t=ko?ko.indexOf(e):-1;t>-1&&ko.splice(t,1)}}function qM(){st(je,"open",function(e){return function(...t){if(ko)try{ko.forEach(n=>n())}catch{}return e.apply(je,t)}})}var YM=new Set([se.Mutation,se.StyleSheetRule,se.StyleDeclaration,se.AdoptedStyleSheet,se.CanvasMutation,se.Selection,se.MediaInteraction]);function KM(e,t,n){e.handleClick(t,n)}var oh=class{constructor(t,n,r=xl){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=VM(()=>{this._lastMutation=oT()});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(XM(n,this._ignoreSelector)||!QM(t))return;let r={timestamp:Bm(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=Bm(t)}registerScroll(t=Date.now()){this._lastScroll=Bm(t)}registerClick(t){let n=OT(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=oT();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:je.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:je.location.href,route:n.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Ii(()=>this._checkClicks(),1e3)}},JM=["A","BUTTON","INPUT"];function XM(e,t){return!!(!JM.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 QM(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function oT(){return Date.now()/1e3}function ZM(e,t){try{if(!eP(t))return;let{source:n}=t.data;if(YM.has(n)&&e.registerMutation(t.timestamp),n===se.Scroll&&e.registerScroll(t.timestamp),tP(t)){let{type:r,id:o}=t.data,i=fr.mirror.getNode(o);i instanceof HTMLElement&&r===nn.Click&&e.registerClick(i)}}catch{}}function eP(e){return e.type===zM}function tP(e){return e.data.source===se.MouseInteraction}function br(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var id=(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))(id||{}),nP=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function rP(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(nP.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}var oP=e=>t=>{if(!e.isEnabled())return;let n=iP(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&&KM(e.clickDetector,n,DT(t.event)),xl(e,n)};function FT(e,t){let n=fr.mirror.getId(e),r=n&&fr.mirror.getNode(n),o=r&&fr.mirror.getMeta(r),i=o&&aP(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===id.Text&&s.textContent).filter(Boolean).map(s=>s.trim()).join(""),attributes:rP(i.attributes)}}:{}}}function iP(e){let{target:t,message:n}=sP(e);return br({category:`ui.${e.name}`,...FT(t,n)})}function sP(e){let t=e.name==="click",n,r=null;try{r=t?DT(e.event):UT(e.event),n=Ue(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function aP(e){return e.type===id.Element}function lP(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=cP(t);n&&xl(e,n)}function cP(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:s}=e;if(!s||uP(s)||!i)return null;let a=t||r||o,l=i.length===1;if(!a&&l)return null;let c=Ue(s,{maxStringLength:200})||"<unknown>",u=FT(s,c);return br({category:"ui.keyDown",message:c,data:{...u.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function uP(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var dP={resource:gP,paint:mP,navigation:hP};function Hm(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function fP(e){return e.map(pP).filter(Boolean)}function pP(e){let t=dP[e.entryType];return t?t(e):null}function Ls(e){return((He()||je.performance.timeOrigin)+e)/1e3}function mP(e){let{duration:t,entryType:n,name:r,startTime:o}=e,i=Ls(o);return{type:n,name:r,start:i,end:i+t,data:void 0}}function hP(e){let{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:u,loadEventEnd:f,redirectCount:p,startTime:h,transferSize:y,type:_}=e;return o===0?null:{type:`${t}.${_}`,start:Ls(h),end:Ls(i),name:n,data:{size:y,decodedBodySize:r,encodedBodySize:s,duration:o,domInteractive:c,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,loadEventStart:u,loadEventEnd:f,domComplete:i,redirectCount:p}}}function gP(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:Ls(i),end:Ls(o),name:r,data:{size:c,statusCode:l,decodedBodySize:s,encodedBodySize:a}}}function yP(e){let t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return Th(e,"largest-contentful-paint",n)}function SP(e){return e.sources!==void 0}function _P(e){let t=[],n=[];for(let r of e.entries)if(SP(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let s=fr.mirror.getId(i.node);s&&o.push(s)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return Th(e,"cumulative-layout-shift",n,t)}function vP(e){let t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return Th(e,"interaction-to-next-paint",n)}function Th(e,t,n,r){let o=e.value,i=e.rating,s=Ls(o);return{type:"web-vital",name:t,start:s,end:s,data:{value:o,size:o,rating:i,nodeIds:n?n.map(a=>fr.mirror.getId(a)):void 0,attributions:r}}}function EP(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(cr(o,n))}),r.push(Kr(Hm(yP,e)),Yr(Hm(_P,e)),_i(Hm(vP,e))),()=>{r.forEach(o=>o())}}var re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,TP='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 IP(){let e=new Blob([TP]);return URL.createObjectURL(e)}var iT=["log","warn","error"],Hu="[Replay] ";function $m(e,t="info"){kn({category:"console",data:{logger:"replay"},level:t,message:`${Hu}${e}`},{level:t})}function wP(){let e=!1,t=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return re?(iT.forEach(r=>{n[r]=(...o)=>{C[r](Hu,...o),t&&$m(o.join(""),gs(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),C.error(Hu,r),e?Gr(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&$m(r,"error")},n.infoTick=(...r)=>{C.log(Hu,...r),t&&setTimeout(()=>$m(r[0]),0)}):iT.forEach(r=>{n[r]=()=>{}}),n}var oe=wP(),Il=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${hh}.`)}},Ku=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>hh)throw new Il;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:Eh(t)}},ih=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){re&&oe.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():(re&&oe.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{re&&oe.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(){re&&oe.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++}},sh=class{constructor(t){this._worker=new ih(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=Eh(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>hh?Promise.reject(new Il):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{re&&oe.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}},ah=class{constructor(t){this._fallback=new Ku,this._compression=new sh(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){re&&oe.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){re&&oe.exception(i,"Failed to add events when switching buffers.")}}};function CP({useCompression:e,workerUrl:t}){if(e&&window.Worker){let n=RP(t);if(n)return n}return re&&oe.log("Using simple buffer"),new Ku}function RP(e){try{let t=e||xP();if(!t)return;re&&oe.log(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new ah(n)}catch(t){re&&oe.exception(t,"Failed to create compression worker")}}function xP(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?IP():""}function Ih(){try{return"sessionStorage"in je&&!!je.sessionStorage}catch{return!1}}function bP(e){kP(),e.session=void 0}function kP(){if(Ih())try{je.sessionStorage.removeItem(ph)}catch{}}function BT(e){return e===void 0?!1:Math.random()<e}function sd(e){if(Ih())try{je.sessionStorage.setItem(ph,JSON.stringify(e))}catch{}}function HT(e){let t=Date.now(),n=e.id||at(),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 NP(e,t){return BT(e)?"session":t?"buffer":!1}function sT({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let o=NP(e,t),i=HT({sampled:o,previousSessionId:r});return n&&sd(i),i}function AP(){if(!Ih())return null;try{let e=je.sessionStorage.getItem(ph);if(!e)return null;let t=JSON.parse(e);return re&&oe.infoTick("Loading existing session"),HT(t)}catch{return null}}function lh(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function MP(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return lh(e.started,t,r)||lh(e.lastActivity,n,r)}function Ju(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!MP(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function zm({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let o=r.stickySession&&AP();return o?Ju(o,{sessionIdleExpire:e,maxReplayDuration:t})?(re&&oe.infoTick("Session in sessionStorage is expired, creating new one..."),sT(r,{previousSessionId:o.id})):o:(re&&oe.infoTick("Creating new session"),sT(r,{previousSessionId:n}))}function PP(e){return e.type===me.Custom}function wh(e,t,n){return zT(e,t)?($T(e,t,n),!0):!1}function LP(e,t,n){return zT(e,t)?$T(e,t,n):Promise.resolve(null)}async function $T(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=OP(t,i.beforeAddRecordingEvent);return s?await r.addEvent(s):void 0}catch(i){let s=i&&i instanceof Il,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 zT(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=Eh(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(re&&oe.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function OP(e,t){try{if(typeof t=="function"&&PP(e))return t(e)}catch(n){return re&&oe.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Ch(e){return!e.type}function ch(e){return e.type==="transaction"}function DP(e){return e.type==="replay_event"}function aT(e){return e.type==="feedback"}function UP(e){return(t,n)=>{if(!e.isEnabled()||!Ch(t)&&!ch(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(ch(t)){FP(e,t);return}BP(e,t)}}}function FP(e,t){let n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function BP(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)||Ii(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function HP(e){return t=>{!e.isEnabled()||!Ch(t)||$P(e,t)}}function $P(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=br({category:"replay.hydrate-error",data:{url:hn()}});xl(e,r)}}function zP(e){let t=$();t&&t.on("beforeAddBreadcrumb",n=>jP(e,n))}function jP(e,t){if(!e.isEnabled()||!jT(t))return;let n=WP(t);n&&xl(e,n)}function WP(e){return!jT(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?GP(e):br(e)}function GP(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return br(e);let n=!1,r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>Du?(n=!0,`${o.slice(0,Du)}\u2026`):o;if(typeof o=="object")try{let i=$t(o,7);return JSON.stringify(i).length>Du?(n=!0,`${JSON.stringify(i,null,2).slice(0,Du)}\u2026`):i}catch{}return o});return br({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function jT(e){return!!e.category}function VP(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Xu(){let e=te().getPropagationContext().dsc;e&&delete e.replay_id;let t=Me();if(t){let n=ht(t);delete n.replay_id}}function lT(e){let t=te().getPropagationContext().dsc;t&&(t.replay_id=e);let n=Me();if(n){let r=ht(n);r.replay_id=e}}function qP(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:me.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 YP(e,t){return e.recordingMode!=="buffer"||t.message===mh||!t.exception||t.type?!1:BT(e.getOptions().errorSampleRate)}function KP(e){return Object.assign((t,n)=>{if(e.session&&Ju(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Xu(),!e.isEnabled()||e.isPaused())return t;if(DP(t))return delete t.breadcrumbs,t;if(!Ch(t)&&!ch(t)&&!aT(t))return t;if(!e.checkAndHandleExpiredSession())return Xu(),t;if(aT(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),qP(e,t),t;if(VP(t,n)&&!e.getOptions()._experiments.captureExceptions)return re&&oe.log("Ignoring error from rrweb internals",t),null;let o=YP(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&&sd(s)}return t},{id:"Replay"})}function ad(e,t){return t.map(({type:n,start:r,end:o,name:i,data:s})=>{let a=e.throttledAddEvent({type:me.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 JP(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 XP(e){return t=>{if(!e.isEnabled())return;let n=JP(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(ad(e,[n]),!1)))}}function QP(e,t){return re&&e.getOptions()._experiments.traceInternals?!1:Xp(t,$())}function WT(e,t){e.isEnabled()&&t!==null&&(QP(e,t.name)||e.addUpdate(()=>(ad(e,[t]),!0)))}function ld(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=Au(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function GT(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Qu(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 VT(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 wl(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function No(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}=ZP(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function uh(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 ZP(e){if(!e||typeof e!="string")return{body:e};let t=e.length>zE,n=eL(e);if(t){let r=e.slice(0,zE);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 eL(e){let t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Zu(e,t){let n=tL(e);return Nt(n,t)}function tL(e,t=je.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(je.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 nL(e,t,n){try{let r=await oL(e,t,n),o=VT("resource.fetch",r);WT(n.replay,o)}catch(r){re&&oe.exception(r,"Failed to capture fetch breadcrumb")}}function rL(e,t){let{input:n,response:r}=t,o=n?Pu(n):void 0,i=ld(o),s=r?GT(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 oL(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,f=Zu(s,n.networkDetailAllowUrls)&&!Zu(s,n.networkDetailDenyUrls),p=f?iL(n,t.input,c):wl(c),h=await sL(f,n,t.response,u);return{startTimestamp:o,endTimestamp:i,url:s,method:a,statusCode:l,request:p,response:h}}function iL({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let o=n?cL(n,t):{};if(!e)return No(o,r,void 0);let i=Pu(n),[s,a]=Mu(i,oe),l=No(o,r,s);return a?Qu(l,a):l}async function sL(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return wl(o);let i=r?qT(r.headers,n):{};if(!r||!t&&o!==void 0)return No(i,o,void 0);let[s,a]=await lL(r),l=aL(s,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:i});return a?Qu(l,a):l}function aL(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{let i=e?.length&&n===void 0?ld(e):n;return r?t?No(o,i,e):No(o,i,void 0):wl(i)}catch(i){return re&&oe.exception(i,"Failed to serialize response body"),No(o,n,void 0)}}async function lL(e){let t=uL(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await dL(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(re&&oe.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(re&&oe.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function qT(e,t){let n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function cL(e,t){return e.length===1&&typeof e[0]!="string"?cT(e[0],t):e.length===2?cT(e[1],t):{}}function cT(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?qT(n,t):Array.isArray(n)?{}:uh(n,t):{}}function uL(e){try{return e.clone()}catch(t){re&&oe.exception(t,"Failed to clone response body")}}function dL(e){return new Promise((t,n)=>{let r=Ii(()=>n(new Error("Timeout while trying to read response body")),500);fL(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function fL(e){return await e.text()}async function pL(e,t,n){try{let r=hL(e,t,n),o=VT("resource.xhr",r);WT(n.replay,o)}catch(r){re&&oe.exception(r,"Failed to capture xhr breadcrumb")}}function mL(e,t){let{xhr:n,input:r}=t;if(!n)return;let o=ld(r),i=n.getResponseHeader("content-length")?GT(n.getResponseHeader("content-length")):SL(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}function hL(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:f,response_body_size:p}=e.data;if(!l)return null;if(!a||!Zu(l,n.networkDetailAllowUrls)||Zu(l,n.networkDetailDenyUrls)){let A=wl(f),I=wl(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:A,response:I}}let h=a[ur],y=h?uh(h.request_headers,n.networkRequestHeaders):{},_=uh(dl(a),n.networkResponseHeaders),[T,g]=n.networkCaptureBodies?Mu(s,oe):[void 0],[S,E]=n.networkCaptureBodies?gL(a):[void 0],R=No(y,f,T),M=No(_,p,S);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:g?Qu(R,g):R,response:E?Qu(M,E):M}}function gL(e){let t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return yL(e.response,e.responseType)}catch(n){t.push(n)}return re&&oe.warn("Failed to get xhr response body",...t),[void 0]}function yL(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 re&&oe.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return re&&oe.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function SL(e,t){try{let n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return ld(n)}catch{return}}function _L(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)=>vL(a,l,c))}catch{}}function vL(e,t,n){if(t.data)try{EL(t)&&IL(n)&&(mL(t,n),pL(t,n,e)),TL(t)&&wL(n)&&(rL(t,n),nL(t,n,e))}catch(r){re&&oe.exception(r,"Error when enriching network breadcrumb")}}function EL(e){return e.category==="xhr"}function TL(e){return e.category==="fetch"}function IL(e){return e?.xhr}function wL(e){return e?.input!==void 0}function CL(e){let t=$();cl(oP(e)),Qr(XP(e)),zP(e),_L(e);let n=KP(e);Ka(n),t&&(t.on("beforeSendEvent",HP(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 RL(e){try{return Promise.all(ad(e,[xL(je.performance.memory)]))}catch{return[]}}function xL(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 bL(e,t,n){return Zp(e,t,{...n,setTimeoutImpl:Ii})}var Bu=G.navigator;function kL(){return/iPhone|iPad|iPod/i.test(Bu?.userAgent??"")||/Macintosh/i.test(Bu?.userAgent??"")&&Bu?.maxTouchPoints&&Bu?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function NL(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){re&&oe.warn("Received replay event after session expired.");return}let o=r||!t;t=!0,AL(n),e.clickDetector&&ZM(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!wh(e,n,o))return!0;if(!o)return!1;let i=e.session;if(PL(e,o),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){let s=e.eventBuffer.getEarliestTimestamp();s&&(re&&oe.log(`Updating session start time to earliest event in buffer to ${new Date(s)}`),i.started=s,e.getOptions().stickySession&&sd(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function AL(e){let t=e.data;if(!(e.type!==me.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==se.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(let n of t.attributes){let r=fr.mirror.getNode(n.id),o=r&&fr.mirror.getMeta(r);if(o?.type===id.Element)for(let[i,s]of Object.entries(n.attributes))s===null?delete o.attributes[i]:o.attributes[i]=s}}function ML(e){let t=e.getOptions();return{type:me.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 PL(e,t){!t||e.session?.segmentId!==0||wh(e,ML(e),!1)}function LL(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function OL(e,t,n,r){return en(ja(e,as(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function DL({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 UL({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 Va(e.getOptions(),r,i,t,e,Xe());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 FL({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:i}){let s=DL({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:l,traceIds:c,initialTimestamp:u}=r,f=$(),p=te(),h=f?.getTransport(),y=f?.getDsn();if(!f||!h||!y||!i.sampled)return Promise.resolve({});let _={type:C1,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 UL({scope:p,client:f,replayId:t,event:_});if(!T)return f.recordDroppedEvent("event_processor","replay"),re&&oe.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete T.sdkProcessingMetadata;let g=OL(T,s,y,f.getOptions().tunnel),S;try{S=await h.send(g)}catch(R){let M=new Error(mh);try{M.cause=R}catch{}throw M}let E=Za({},S);if(Qa(E,"replay"))throw new Cl(E);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new ed(S.statusCode);return S}var ed=class extends Error{constructor(t){super(`Transport returned status code ${t}`)}},Cl=class extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}},td=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function YT(e,t={count:0,interval:A1}){let{recordingData:n,onError:r}=e;if(n.length)try{return await FL(e),!0}catch(o){if(o instanceof ed||o instanceof Cl)throw o;if(mi("Replays",{_retryCount:t.count}),r&&r(o),t.count>=M1){let i=new Error(`${mh} - max retries exceeded`);try{i.cause=o}catch{}throw i}return t.interval*=++t.count,new Promise((i,s)=>{Ii(async()=>{try{await YT(e,t),i(!0)}catch(a){s(a)}},t.interval)})}}var KT="__THROTTLED",BL="__SKIPPED";function HL(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?BL:KT}s=!1;let c=r.get(l)||0;return r.set(l,c+1),e(...a)}}var dh=class{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:R1,sessionIdleExpire:x1},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=bL(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=HL((s,a)=>LP(this,s,a),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(P1,r),timeout:r,scrollTimeout:L1,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new oh(this,i)),re){let s=t._experiments;oe.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{je.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let s=br({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{let s=br({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{lP(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){re&&oe.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){re&&oe.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",re&&oe.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){re&&oe.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){re&&oe.log("Buffering is in progress, call `flush()` to save the replay");return}re&&oe.infoTick("Starting replay in session mode"),this._updateUserActivity();let t=zm({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){re&&oe.log("Buffering is in progress, call `flush()` to save the replay");return}re&&oe.infoTick("Starting replay in buffer mode");let t=zm({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=fr({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:N1}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:NL(this),...kL(),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{re&&oe.log(`Stopping Replay triggered by ${r}`),Xu(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,bP(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),re&&oe.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),re&&oe.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();re&&oe.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(),lT(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&&lh(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let t=`${je.location.pathname}${je.location.hash}${je.location.search}`,n=`${je.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===KT){let o=br({category:"replay.throttled"});this.addUpdate(()=>!wh(this,{type:jM,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let t=this.lastActiveSpan||Me(),n=t&&be(t),o=(n&&ne(n).data||{})[vt];if(!(!n||!o||!["route","custom"].includes(o)))return ne(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=CP({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&&lT(this.session.id)}_initializeSessionForSampling(t){let n=this._options.errorSampleRate>0,r=zm({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 Ju(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{je.document.addEventListener("visibilitychange",this._handleVisibilityChange),je.addEventListener("blur",this._handleWindowBlur),je.addEventListener("focus",this._handleWindowFocus),je.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(CL(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=EP(this)}_removeListeners(){try{je.document.removeEventListener("visibilitychange",this._handleVisibilityChange),je.removeEventListener("blur",this._handleWindowBlur),je.removeEventListener("focus",this._handleWindowFocus),je.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(Ju(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Xu();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){re&&oe.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:me.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=fP(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(ad(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){re&&oe.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await RL(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new td;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await YT({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 Cl?o="ratelimit_backoff":n instanceof td?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){re&&oe.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){re&&oe.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&&re&&oe.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&&sd(this.session)}_onMutationHandler(t){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{let l=LL(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=br({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function ml(e,t){return[...e,...t].join(",")}function $L({mask:e,unmask:t,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],s=ml(e,[".sentry-mask","[data-sentry-mask]"]),a=ml(t,[]);return{maskTextSelector:s,unmaskTextSelector:a,blockSelector:ml(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:ml(r,[]),ignoreSelector:ml(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function zL({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 uT='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',jL=["content-length","content-type","accept"],WL=Symbol.for("sentry__originalRequestBody"),dT=!1,fT=!1;function GL(){if(typeof Request>"u"||fT)return;let e=Request;try{let t=function(n,r){let o=new e(n,r);return r?.body!=null&&(o[WL]=r.body),o};t.prototype=e.prototype,G.Request=t,fT=!0}catch{}}var Rh=(e=>new fh(e)),fh=class{constructor({flushMinDelay:t=b1,flushMaxDelay:n=k1,minReplayDuration:r=O1,maxReplayDuration:o=jE,stickySession:i=!0,useCompression:s=!0,workerUrl:a,_experiments:l={},maskAllText:c=!0,maskAllInputs:u=!0,blockAllMedia:f=!0,mutationBreadcrumbLimit:p=750,mutationLimit:h=1e4,slowClickTimeout:y=7e3,slowClickIgnoreSelectors:_=[],networkDetailAllowUrls:T=[],networkDetailDenyUrls:g=[],networkCaptureBodies:S=!0,networkRequestHeaders:E=[],networkResponseHeaders:R=[],mask:M=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:I=[],block:N=[],unblock:U=[],ignore:x=[],maskFn:H,beforeAddRecordingEvent:j,beforeErrorSampling:he,onError:X,attachRawBodyFromRequest:Ze=!1}={}){this.name="Replay";let fe=$L({mask:M,unmask:I,block:N,unblock:U,ignore:x});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:H,maskInputFn:H,maskAttributeFn:(de,D,ge)=>zL({maskAttributes:A,maskAllText:c,privacyOptions:fe,key:de,value:D,el:ge}),...fe,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:de=>{try{de.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!l.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,D1),maxReplayDuration:Math.min(o,jE),stickySession:i,useCompression:s,workerUrl:a,blockAllMedia:f,maskAllInputs:u,maskAllText:c,mutationBreadcrumbLimit:p,mutationLimit:h,slowClickTimeout:y,slowClickIgnoreSelectors:_,networkDetailAllowUrls:T,networkDetailDenyUrls:g,networkCaptureBodies:S,networkRequestHeaders:pT(E),networkResponseHeaders:pT(R),beforeAddRecordingEvent:j,beforeErrorSampling:he,onError:X,attachRawBodyFromRequest:Ze,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${uT}`:uT,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&jn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return dT}set _isInitialized(t){dT=t}afterAllSetup(t){!jn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&GL(),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&&Io(t,{"sentry.replay_id":n})}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){let n=VL(this._initialOptions,t);this._replay=new dh({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{let n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function VL(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=bn(n.replaysSessionSampleRate),i=bn(n.replaysOnErrorSampleRate);return o==null&&i==null&&kt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function pT(e){return[...jL,...e.map(t=>t.toLowerCase())]}function JT(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function xh(e){try{return new URL(e,ee.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 bh(e){try{return new Headers(e)}catch{return}}var kh={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function ZT(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:s,onRequestSpanStart:a,onRequestSpanEnd:l}={...kh,...t},c=typeof o=="function"?o:h=>!0,u=h=>YL(h,s),f={},p=e.getOptions().propagateTraceparent;n&&Co(h=>{let y=im(h,c,u,f,{propagateTraceparent:p,onRequestSpanEnd:l});if(y){let _=xh(h.fetchData.url),T=_?zn(_).host:void 0;y.setAttributes({"http.url":_?Wt(_):void 0,"server.address":T}),i&&QT(y,e),a?.(y,{headers:h.headers})}}),r&&ul(h=>{let y=KL(h,c,u,f,p,l);y&&(i&&QT(y,e),a?.(y,{headers:bh(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}var qL=300;function QT(e,t){let{url:n}=ne(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(Mt(t)){let i=e.end.bind(e);e.end=s=>{let a=s??Ae(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(a),clearTimeout(u))};r=c;let u=setTimeout(c,qL)}}let o=cr("resource",({entries:i})=>{i.forEach(s=>{XT(s)&&s.name.endsWith(n)&&(e.setAttributes(al(s)),r())})})}function YL(e,t){let n=hn();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?Nt(r.toString(),t)||i&&Nt(r.pathname,t):i}else{let r=!!e.match(/^\/(?!\/)/);return t?Nt(e,t):r}}function KL(e,t,n,r,o,i){let s=e.xhr,a=s?.[ur];if(!s||s.__sentry_own_request__||!a)return;let{url:l,method:c}=a,u=Et()&&t(l);if(e.endTimestamp){let S=s.__sentry_xhr_span_id__;if(!S)return;let E=r[S];E&&(u&&a.status_code!==void 0&&(rs(E,a.status_code),E.end(),i?.(E,{headers:bh(dl(s)),error:e.error})),delete r[S]);return}let f=xh(l),p=f?zn(f):zn(l),h=Wt(Zc(l)),y=$(),T=!!Me()||!!y&&Mt(y),g=u&&T?wt({name:`${c} ${h}`,attributes:{url:Wt(l),type:"xhr","http.method":c,"http.url":f?Wt(f):void 0,"server.address":p?.host,[we]:"auto.http.browser",[qe]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new At;return u&&!T&&y?.recordDroppedEvent("no_parent_span","span"),s.__sentry_xhr_span_id__=g.spanContext().spanId,r[s.__sentry_xhr_span_id__]=g,n(l)&&JL(s,Et()&&T?g:void 0,o),y&&y.emit("beforeOutgoingRequestSpan",g,e),g}function JL(e,t,n){let{"sentry-trace":r,baggage:o,traceparent:i}=hs({span:t,propagateTraceparent:n});r&&XL(e,r,o,i)}function XL(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||!JT(i))&&e.setRequestHeader("baggage",n)}}catch{}}var eI=new WeakMap,tI=new WeakMap,QL=9e4,ZL=["text/event-stream","application/x-ndjson","application/stream+json"],nI=()=>({name:"FetchStreamPerformance",setup(){fu(e=>{if(e.response){let t=eI.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=tI.get(e.response);n&&clearTimeout(n)}}}),Co(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!ZL.some(l=>t.startsWith(l)))return;let n=e.fetchData?.url||"",r=e.fetchData?.method||"GET",o=Ir(n),i=n.startsWith("data:")?Wt(n):o?us(o):n,s=wt({name:`${r} ${i}`,startTime:e.endTimestamp,attributes:{url:Wt(n),"http.method":r,type:"fetch",[qe]:"http.client.stream",[we]:"auto.http.browser.stream"}});eI.set(e.response,s);let a=setTimeout(()=>{s.isRecording()&&s.end()},QL);tI.set(e.response,a)}})}});function rI(){ee.document?ee.document.addEventListener("visibilitychange",()=>{let e=Me();if(!e)return;let t=be(e);if(ee.document.hidden&&t){let n="cancelled",{op:r,status:o}=ne(t);et&&C.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()}}):et&&C.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var eO=3600,oI="sentry_previous_trace",tO="sentry.previous_trace";function iI(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t==="session-storage",o=r?oO():void 0;e.on("spanStart",s=>{if(be(s)!==s)return;let a=te().getPropagationContext();o=nO(o,s,a),r&&rO(o)});let i=!0;n&&e.on("beforeSampling",s=>{if(!o)return;let a=te(),l=a.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(Nh(o.spanContext))},sampleRand:o.sampleRand}),s.parentSampled=Nh(o.spanContext),s.parentSampleRate=o.sampleRate,s.spanAttributes={...s.spanAttributes,[ts]:o.sampleRate}})}function nO(e,t,n){let r=ne(t);function o(){try{let a=Number(r.data?.[$r]??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<=eO&&(et&&C.log(`Adding previous_trace \`${JSON.stringify(s)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:s,attributes:{[Uc]:"previous_trace"}}),t.setAttribute(tO,`${s.traceId}-${s.spanId}-${Nh(s)?1:0}`)),i)}function rO(e){try{ee.sessionStorage.setItem(oI,JSON.stringify(e))}catch(t){et&&C.warn("Could not store previous trace in sessionStorage",t)}}function oO(){try{let e=ee.sessionStorage?.getItem(oI);return JSON.parse(e)}catch{return}}function Nh(e){return e.traceFlags===1}var iO="BrowserTracing",sO=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function uI(){let e=ee.navigator;return e?.userAgent?sO.test(e.userAgent):!1}var aO={...cs,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...kh},Ah=((e={})=>{"enableElementTiming"in e&&kt(()=>{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=ee.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:s,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:u,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:y,traceXHR:_,trackFetchStreamPerformance:T,shouldCreateSpanForRequest:g,enableHTTPTimings:S,ignoreResourceSpans:E,ignorePerformanceApiSpans:R,instrumentPageLoad:M,instrumentNavigation:A,detectRedirects:I,linkPreviousTrace:N,consistentTraceSampling:U,enableReportPageLoaded:x,onRequestSpanStart:H,onRequestSpanEnd:j}={...aO,...e},he=uI(),X,Ze,fe;function de(D,ge,Q=!0){let ae=ge.op==="pageload",Re=ge.name,Te=c?c(ge):ge,St=Te.attributes||{};if(Re!==Te.name&&(St[vt]="custom",Te.attributes=St),!Q){let it=dn();wt({...Te,startTime:it}).end(it);return}t.name=Te.name,t.source=St[vt];let ot=Xc(Te,{idleTimeout:u,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:ae,beforeSpanEnd:it=>{X?.();let In=Mt(D);Im(it,{recordClsOnPageloadSpan:!In&&!a,recordLcpOnPageloadSpan:!In&&!l,ignoreResourceSpans:E,ignorePerformanceApiSpans:R,spanStreamingEnabled:In}),lI(D,void 0);let Dt=te(),wn=Dt.getPropagationContext();Dt.setPropagationContext({...wn,traceId:ot.spanContext().traceId,sampled:mn(ot),dsc:ht(it)}),ae&&(fe=void 0)},trimIdleSpanEndTimestamp:!x});ae&&x&&(fe=ot),lI(D,ot);function bt(){n&&["interactive","complete"].includes(n.readyState)&&D.emit("idleSpanEnableAutoFinish",ot)}ae&&!x&&n&&(n.addEventListener("readystatechange",()=>{bt()}),bt())}return{name:iO,setup(D){if(he){et&&C.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}Wc();let ge=Mt(D);if(X=_m({recordClsStandaloneSpans:ge?void 0:a||!1,recordLcpStandaloneSpans:ge?void 0:l||!1,client:D}),ge?(km(D),Nm(D),r&&Am()):r&&Rm(),i&&G.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?Em():o&&vm(),s&&Tm(),I&&n){let ae=()=>{Ze=Ae()};addEventListener("click",ae,{capture:!0}),addEventListener("keydown",ae,{capture:!0,passive:!0})}function Q(){let ae=bl(D);ae&&!ne(ae).timestamp&&(et&&C.log(`[Tracing] Finishing current active span with op: ${ne(ae).op}`),ae.setAttribute(zr,"cancelled"),ae.end())}D.on("startNavigationSpan",(ae,Re)=>{if($()!==D)return;if(Re?.isRedirect){et&&C.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),de(D,{op:"navigation.redirect",...ae},!1);return}Ze=void 0,Q(),Xe().setPropagationContext({traceId:Zt(),sampleRand:Math.random(),propagationSpanId:Et()?void 0:zt()});let Te=te();Te.setPropagationContext({traceId:Zt(),sampleRand:Math.random(),propagationSpanId:Et()?void 0:zt()}),Te.setSDKProcessingMetadata({normalizedRequest:void 0}),de(D,{op:"navigation",...ae,parentSpan:null,forceTransaction:!0})}),D.on("startPageLoadSpan",(ae,Re={})=>{if($()!==D)return;Q();let Te=Re.sentryTrace||sI("sentry-trace")||aI("sentry-trace"),St=Re.baggage||sI("baggage")||aI("baggage"),ot=Ip(Te,St),bt=te();bt.setPropagationContext(ot),Et()||(bt.getPropagationContext().propagationSpanId=zt()),bt.setSDKProcessingMetadata({normalizedRequest:Ss()}),de(D,{op:"pageload",...ae})}),D.on("endPageloadSpan",()=>{x&&fe&&(fe.setAttribute(zr,"reportPageLoaded"),fe.end())})},afterAllSetup(D){if(he)return;let ge=hn();if(N!=="off"&&iI(D,{linkPreviousTrace:N,consistentTraceSampling:U}),ee.location){if(M){let Q=He();dI(D,{name:ee.location.pathname,startTime:Q?Q/1e3:void 0,attributes:{[vt]:"url",[we]:"auto.pageload.browser"}})}A&&Qr(({to:Q,from:ae})=>{if(ae===void 0&&ge?.indexOf(Q)!==-1){ge=void 0;return}ge=void 0;let Re=Ir(Q),Te=bl(D),St=Te&&I&&cO(Te,Ze);fI(D,{name:Re?.pathname||ee.location.pathname,attributes:{[vt]:"url",[we]:"auto.navigation.browser"}},{url:Q,isRedirect:St})})}h&&rI(),s&&lO(D,u,f,p,t),r&&xm(),ZT(D,{traceFetch:y,traceXHR:_,tracePropagationTargets:D.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:g,enableHTTPTimings:S,onRequestSpanStart:H,onRequestSpanEnd:j}),T&&D.addIntegration(nI())}}});function dI(e,t,n){e.emit("startPageLoadSpan",t,n),te().setTransactionName(t.name);let r=bl(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function fI(e,t,n){let{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});let i=te();return i.setTransactionName(t.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...Ss(),url:r}}),bl(e)}function sI(e){return ee.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function aI(e){return ee.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function lO(e,t,n,r,o){let i=ee.document,s,a=()=>{let l="ui.action.click",c=bl(e);if(c){let u=ne(c).op;if(["navigation","pageload"].includes(u)){et&&C.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(zr,"interactionInterrupted"),s.end(),s=void 0),!o.name){et&&C.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}s=Xc({name:o.name,op:l,attributes:{[vt]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}var pI="_sentry_idleSpan";function bl(e){return e[pI]}function lI(e,t){Ve(e,pI,t)}var cI=1.5;function cO(e,t){let n=ne(e),r=dn(),o=n.start_timestamp;return!(r-o>cI||t&&r-t<=cI)}var bI=Cn(eo(),1);function xI(e){return Fn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Uh(e){let t={...e};nl(t,"react"),mi("react",{version:bI.version});let n=Um(t);return Zi(CO),n}function CO(e){return xI(e)?"[SyntheticEvent]":fl(e)}var kI=Cn(eo(),1);function RO(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function xO(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 NI(e,{componentStack:t},n){if(RO(kI.version)&&Un(e)&&t){let r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,xO(e,r)}return $n(r=>(r.setContext("react",{componentStack:t}),Gr(e,n)))}var Ci=Cn(eo(),1);var AI=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Fh={componentStack:null,error:null,eventId:null},Ds=class extends Ci.Component{constructor(t){super(t),this.state=Fh,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&&Ou({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:s,dialogOptions:a}=this.props;$n(l=>{o&&o(l,t,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,u=NI(t,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(t,r,u),s&&(this._lastEventId=u,this._openFallbackReportDialog&&Ou({...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===Fh?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(Fh)}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"?Ci.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return Ci.isValidElement(o)?o:(t&&AI&&C.warn("fallback did not produce a valid ReactElement"),null)}};function Bh(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 to=window.__vidfarmSentry,PI=to?.dsn?.trim()||"";if(PI){let e=to?.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,...to?.tracePropagationTargets??[]].filter(Boolean)));Uh({dsn:PI,environment:e,release:to?.release?.trim()||void 0,integrations:[Ah(),Rh({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:Bh(to?.tracesSampleRate,t),tracePropagationTargets:o,replaysSessionSampleRate:Bh(to?.replaysSessionSampleRate,n),replaysOnErrorSampleRate:Bh(to?.replaysOnErrorSampleRate,1),enableLogs:to?.enableLogs??!0,sendDefaultPii:to?.sendDefaultPii??!0})}var Gi=Cn(eo(),1),ZR=Cn(Mf(),1),ex=Cn(ZC(),1);var eR=e=>{let t,n=new Set,r=(c,u)=>{let f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){let p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),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},Pf=(e=>e?eR(e):eR);var Ec=Cn(eo(),1);var NU=e=>e;function tR(e,t=NU){let n=Ec.default.useSyncExternalStore(e.subscribe,Ec.default.useCallback(()=>t(e.getState()),[e,t]),Ec.default.useCallback(()=>t(e.getInitialState()),[e,t]));return Ec.default.useDebugValue(n),n}var AU="[vidfarm]";function MU(e){if(e!=="debug")return!0;if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("debug")||window.localStorage?.getItem("VIDFARM_DEBUG")==="1"}catch{return!1}}function eS(e,t,n){let r={event:t,detail:n,timestamp:new Date().toISOString()};typeof window<"u"&&(window.__VIDFARM_DEBUG_LOGS__=window.__VIDFARM_DEBUG_LOGS__??[],window.__VIDFARM_DEBUG_LOGS__.push(r),window.__VIDFARM_DEBUG_LOGS__.length>1e3&&window.__VIDFARM_DEBUG_LOGS__.splice(0,window.__VIDFARM_DEBUG_LOGS__.length-1e3)),MU(e)&&console[e==="debug"?"log":e](AU,t,n??"")}function Or(e,t){eS("info",e,t)}function nR(e,t){eS("warn",e,t)}function po(e,t){eS("error",e,t)}function rR(){typeof window>"u"||window.__VIDFARM_DEBUG_HOOKS__||(window.__VIDFARM_DEBUG_HOOKS__=!0,Or("boot.hooks-installed",{href:window.location.href,readyState:document.readyState,userAgent:navigator.userAgent}),window.addEventListener("error",e=>{po("window.error",{message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,error:e.error instanceof Error?e.error.stack:e.error})}),window.addEventListener("unhandledrejection",e=>{po("window.unhandledrejection",{reason:e.reason instanceof Error?e.reason.stack:e.reason})}))}var PU="vidfarm:flockposter-cache:v1",LU="public",Lf={channels:[],posts:[],channelsUpdatedAt:null,calendarUpdatedAt:null,calendarRangeStart:null,calendarRangeEnd:null};function sR(e){return`${PU}_${e?.trim()||LU}`}function nS(e){if(typeof window>"u")return Lf;try{let t=window.localStorage.getItem(sR(e));if(!t)return Lf;let n=JSON.parse(t);return!n||typeof n!="object"?Lf:{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 Lf}}function oR(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(sR(t),JSON.stringify(e))}catch{}}function aR(e){let t=nS(e);return Pf((n,r)=>({...t,setChannelsData:o=>{let i=r(),s={...i,channels:[...i.channels.filter(iR),...o.filter(a=>!iR(a))],channelsUpdatedAt:new Date().toISOString()};oR(s,e),n(s)},setCalendarData:o=>{let i=r(),s=OU([...i.channels,...o.channels]),a=o.replaceRange?DU(i.posts,o.posts,o.rangeStart,o.rangeEnd):tS([...i.posts,...o.posts]),l={...i,channels:s,posts:a,channelsUpdatedAt:new Date().toISOString(),calendarUpdatedAt:new Date().toISOString(),calendarRangeStart:UU(i.calendarRangeStart,o.rangeStart),calendarRangeEnd:FU(i.calendarRangeEnd,o.rangeEnd)};oR(l,e),n(l)}}))}function OU(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function iR(e){return e.id.startsWith("email:")||e.platform?.toLowerCase()==="email"}function tS(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function DU(e,t,n,r){let o=Date.parse(n),i=Date.parse(r);return Number.isNaN(o)||Number.isNaN(i)?tS([...e,...t]):tS([...e.filter(s=>{let a=Date.parse(s.scheduledAt);return Number.isNaN(a)||a<o||a>i}),...t])}function UU(e,t){return e?Date.parse(t)<Date.parse(e)?t:e:t}function FU(e,t){return e?Date.parse(t)>Date.parse(e)?t:e:t}function lR(e){return Pf(t=>({boot:e,hydratedAt:null,setHydratedAt:n=>t({hydratedAt:n})}))}var k=Cn(eo(),1),Wi=Cn(Mf(),1);var d=Cn(Tc(),1);function fR(){if(typeof window>"u")return null;try{let e=new URL(window.location.href).pathname.match(/^\/editor\/[^/]+\/fork\/([^/]+)\/?$/);if(!e)return null;let t=decodeURIComponent(e[1]);return t==="new"?null:t}catch{return null}}var Vf=1024*1024,DR=50*Vf,GU=2*Vf,VU=3*Vf,qU=Math.floor(3.5*Vf),YU=2048,UR="chat";function pa(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 jf(e){return e.contentType.startsWith("image/")}function uS(e){return e.contentType.startsWith("video/")}var KU=new Set(["apng","avif","gif","jpeg","jpg","png","svg","webp"]),JU=new Set(["m4v","mov","mp4","mpeg","mpg","ogv","webm"]),pR=1200,rS=24,oS=80,XU=/^data:([^;,]+)[^,]*,/i,mR=/authorization|api[-_]?key|secret|token|vidfarm-api-key/i,QU=48e3,iS=14,ZU=12e3,eF=1200,tF=30;function Bf(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 Hf(e){let t=XU.exec(e);return t?`[${t[1]} data URL omitted, ${e.length.toLocaleString()} chars]`:e.length>pR?`${e.slice(0,pR)}\u2026 [truncated ${e.length.toLocaleString()} chars]`:e}function ji(e,t=0){if(e==null)return e;if(typeof e=="string")return Hf(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,rS).map(r=>ji(r,t+1));return e.length>rS&&n.push(`[${e.length-rS} more items omitted]`),n}if(typeof e=="object"){let n={},r=Object.entries(e);for(let[o,i]of r.slice(0,oS)){let s=ji(i,t+1);s!==void 0&&(n[o]=s)}return r.length>oS&&(n.__omitted_keys=r.length-oS),n}return String(e)}}function FR(e){return ji(e)}function Cc(e){return{...e,request:{...e.request,headers:Object.fromEntries(Object.entries(e.request.headers).map(([t,n])=>[t,mR.test(t)?"[redacted]":Hf(n)])),body:ji(e.request.body)},result:{...e.result,headers:Object.fromEntries(Object.entries(e.result.headers).map(([t,n])=>[t,mR.test(t)?"[redacted]":Hf(n)])),body:ji(e.result.body),error:e.result.error?Hf(e.result.error):e.result.error}}}function nF(){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 BR(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function sS(e){let t=BR(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 HR(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>${BR(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>${sS(c)}</li>`).join("")}</ul>`:i.every(l=>/^\d+\.\s+/.test(l.trim()))?`<ol>${i.map(c=>c.trim().replace(/^\d+\.\s+/,"")).map(c=>`<li>${sS(c)}</li>`).join("")}</ol>`:`<p>${i.map(l=>sS(l.trim())).join("<br />")}</p>`}).filter(Boolean).join(""):""}function rF(e){return e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function oF(e){return/^item \d+$/i.test(e.trim())||/^output$/i.test(e.trim())}function iF(e){try{let n=new URL(e).searchParams.get("key");return n?.trim()?n.trim().replace(/^\/+/,""):null}catch{return null}}function Wf(e){try{return decodeURIComponent(e)}catch{return e}}function mS(e){let t=iF(e);if(t){let n=Wf(t.split("/").filter(Boolean).pop()||"");if(n)return n}try{let n=new URL(e).pathname;return Wf(n.split("/").filter(Boolean).pop()||"")}catch{return""}}function $R(e){return mS(e)||"Output"}function zR(e,t){let n=mS(e);return n||t.trim().replace(/[\\/:*?"<>|]+/g,"-")||"download"}function sF(e){let n=mS(e).split(".").pop()?.trim().toLowerCase()||"";return KU.has(n)?"image":JU.has(n)?"video":null}function aF(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 lF(e,t=[]){let n=new Set(t),r=new Set,o=[];for(let i of aF(e)){if(n.has(i)||r.has(i))continue;let s=sF(i);s&&(r.add(i),o.push({kind:s,url:i,label:$R(i)}))}return o}function dS(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=rF(i),a=$R(o);t.push({label:a!=="Output"?a:s&&!oF(i)?s:a,url:o})}return}if(Array.isArray(e)){for(let[o,i]of e.entries())if(dS(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(dS(i,t,n,[...r,o]),t.length>=12)return}}}function hR(e){return[`Started job \`${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
34
 
35
- `)}function hS(e){return typeof e=="string"&&e.startsWith("primitive:brainstorm_")}function gS(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 zR(e){return e?Wf(e.split("/").filter(Boolean).pop()||"result.json"):"JSON result"}function lF(e){return Wf(e?.split("/").filter(Boolean).pop()||"")}function cF(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 jR(e){if(e.status!=="succeeded"||!hS(e.primitive_id))return[];let t=[];for(let[n,r]of gS(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=zR(r.storage_key),l=cF(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 uF(e){return e==="primitive:brainstorm_awareness_stages"?"Awareness response":"Brainstorm response"}function WR(e){if(e.status!=="succeeded"||!hS(e.primitive_id))return[];let t=[];for(let[n,r]of gS(e.artifacts).entries()){let o=r.public_url?.trim(),i=r.storage_key?.trim(),s=lF(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=uF(e.primitive_id);t.push({key:r.artifact_id||`${e.job_id}:${o}:${n}`,url:o,label:s==="response.md"||s==="response.txt"?u:zR(i),jobId:e.job_id,format:l?"markdown":"text"})}return t}function Df(e){if(e.status==="succeeded"){let t=[];dS(e.result,t);let n=[`Render \`${e.job_id}\` succeeded.`];return hS(e.primitive_id)&&(jR(e).length||WR(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(`
35
+ `)}function hS(e){return typeof e=="string"&&e.startsWith("primitive:brainstorm_")}function gS(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 jR(e){return e?Wf(e.split("/").filter(Boolean).pop()||"result.json"):"JSON result"}function cF(e){return Wf(e?.split("/").filter(Boolean).pop()||"")}function uF(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 WR(e){if(e.status!=="succeeded"||!hS(e.primitive_id))return[];let t=[];for(let[n,r]of gS(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=jR(r.storage_key),l=uF(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 dF(e){return e==="primitive:brainstorm_awareness_stages"?"Awareness response":"Brainstorm response"}function GR(e){if(e.status!=="succeeded"||!hS(e.primitive_id))return[];let t=[];for(let[n,r]of gS(e.artifacts).entries()){let o=r.public_url?.trim(),i=r.storage_key?.trim(),s=cF(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=dF(e.primitive_id);t.push({key:r.artifact_id||`${e.job_id}:${o}:${n}`,url:o,label:s==="response.md"||s==="response.txt"?u:jR(i),jobId:e.job_id,format:l?"markdown":"text"})}return t}function Df(e){if(e.status==="succeeded"){let t=[];dS(e.result,t);let n=[`Render \`${e.job_id}\` succeeded.`];return hS(e.primitive_id)&&(WR(e).length||GR(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
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 Ic(e,t){let n=e.trim(),r=t.trim();return!r||n.includes(r)?e:n?`${n}
37
37
 
38
- ${r}`:r}var dF=48;function fF(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=dF}function pF(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 hR=3e4,mF=18e4,gR=4,yR=40,hF=1500,SR=250;function $i(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:gS(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 gF(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 fa(e){return e==="succeeded"||e==="failed"||e==="cancelled"}function _R(e,t,n){return`${e}::${t}::${n}`}function ut(e,t){let n=new Headers;return e&&n.set("vidfarm-api-key",e),t&&n.set("content-type",t),n}async function zi(e){return await e.json()}async function aS(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 vR(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 yF(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 GR(e){return e.reduce((t,n)=>t+yF(n.transportData),0)}async function SF(e,t,n){return await new Promise(r=>{e.toBlob(o=>r(o),t,n)})}async function _F(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 vF(e,t){if(!e.type.startsWith("image/")||t<=0)return;let n=Math.min(GU,t),r=Math.min(WU,n);if(e.size<=r)return aS(e);let o=await _F(e);if(!o||o.width<=0||o.height<=0)return e.size<=n?aS(e):void 0;try{let i=null,s=[qU,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)),f=Math.max(1,Math.round(o.height*c)),p=document.createElement("canvas");p.width=u,p.height=f;let h=p.getContext("2d");if(h){h.fillStyle="#fff",h.fillRect(0,0,u,f),h.drawImage(o.source,0,0,u,f);for(let y of a){let _=await SF(p,"image/jpeg",y);if(_&&(_.size<=n&&(!i||_.size<i.size)&&(i=_),_.size<=r))return vR(_)}}}return i&&(e.size>n||i.size<e.size)?vR(i):e.size<=n?aS(e):void 0}finally{o.close?.()}}async function VR(e){let t=VU-e.currentInlineBytes,n=await vF(e.file,t).catch(()=>{});return n?{...e.attachment,transportData:n}:e.attachment}async function EF(e){let t=e.maxBytes??OR,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||""),Or("chat.upload.attempt",{file_name:e.file.name,size_bytes:e.file.size,folder_path:e.folderPath});let o=await fetch("/api/v1/user/me/attachments/upload",{method:"POST",headers:ut(e.apiKey),body:r}),i=await zi(o);if(!o.ok||!i.attachment)throw po("chat.upload.failed",{file_name:e.file.name,status:o.status,error:i.error}),new Error(i.error||"Unable to upload attachment.");return Or("chat.upload.succeeded",{file_name:e.file.name,attachment_id:i.attachment.id}),pa(i.attachment)??(()=>{throw new Error("Attachment response was incomplete.")})()}async function TF(e){let t=await fetch("/api/v1/user/me/attachments",{headers:ut(e)}),n=await zi(t);if(!t.ok)throw new Error(n.error||"Unable to load My Files.");let r=[];for(let o of n.attachments??[]){let i=pa(o);i&&r.push({...i,createdAt:o.createdAt??o.created_at})}return{attachments:r,folders:n.folders??[]}}async function qR(e){if(e.file.size>100*1024*1024)throw new Error("Temporary files can be at most 100 MB.");Or("chat.temp_upload.attempt",{file_name:e.file.name,size_bytes:e.file.size,content_type:e.file.type});let t=await fetch("/api/v1/user/me/temporary-files/presign",{method:"POST",headers:ut(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 zi(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:ut(e.apiKey),body:a}),c=await zi(l);if(!l.ok||!c.file)throw new Error(c.error||"Unable to upload temporary file.");let u=pa(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:ut(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 zi(o);if(!o.ok||!i.file)throw new Error(i.error||"Unable to save temporary file.");let s=pa(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 IF(e){let t=await fetch("/api/v1/user/me/temporary-files",{headers:ut(e)}),n=await zi(t);if(!t.ok)throw new Error(n.error||"Unable to load temporary files.");let r=[];for(let o of n.files??[]){let i=pa(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 ER(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:ut(e)}),o=await zi(r);if(!r.ok)throw new Error(o.error||"Unable to load recent media.");let i=[];for(let s of o.media??[]){let a=pa(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 wF(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 CF(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 RF(e){if(e.length<=iS||wF(e)<=XU)return e;let t=e.slice(-iS),n=e.slice(0,-iS),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}]: ${CF(`${i.text}${s}`,ZU)}`;if(o+a.length>QU){r.push(`[${n.length-r.length} earlier messages omitted]`);break}r.push(a),o+=a.length}return[{id:$f("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(`
38
+ ${r}`:r}var fF=48;function pF(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=fF}function mF(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 gR=3e4,hF=18e4,yR=4,SR=40,gF=1500,_R=250;function $i(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:gS(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 yF(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 fa(e){return e==="succeeded"||e==="failed"||e==="cancelled"}function vR(e,t,n){return`${e}::${t}::${n}`}function ut(e,t){let n=new Headers;return e&&n.set("vidfarm-api-key",e),t&&n.set("content-type",t),n}async function zi(e){return await e.json()}async function aS(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 ER(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 SF(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 VR(e){return e.reduce((t,n)=>t+SF(n.transportData),0)}async function _F(e,t,n){return await new Promise(r=>{e.toBlob(o=>r(o),t,n)})}async function vF(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 EF(e,t){if(!e.type.startsWith("image/")||t<=0)return;let n=Math.min(VU,t),r=Math.min(GU,n);if(e.size<=r)return aS(e);let o=await vF(e);if(!o||o.width<=0||o.height<=0)return e.size<=n?aS(e):void 0;try{let i=null,s=[YU,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)),f=Math.max(1,Math.round(o.height*c)),p=document.createElement("canvas");p.width=u,p.height=f;let h=p.getContext("2d");if(h){h.fillStyle="#fff",h.fillRect(0,0,u,f),h.drawImage(o.source,0,0,u,f);for(let y of a){let _=await _F(p,"image/jpeg",y);if(_&&(_.size<=n&&(!i||_.size<i.size)&&(i=_),_.size<=r))return ER(_)}}}return i&&(e.size>n||i.size<e.size)?ER(i):e.size<=n?aS(e):void 0}finally{o.close?.()}}async function qR(e){let t=qU-e.currentInlineBytes,n=await EF(e.file,t).catch(()=>{});return n?{...e.attachment,transportData:n}:e.attachment}async function TF(e){let t=e.maxBytes??DR,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||""),Or("chat.upload.attempt",{file_name:e.file.name,size_bytes:e.file.size,folder_path:e.folderPath});let o=await fetch("/api/v1/user/me/attachments/upload",{method:"POST",headers:ut(e.apiKey),body:r}),i=await zi(o);if(!o.ok||!i.attachment)throw po("chat.upload.failed",{file_name:e.file.name,status:o.status,error:i.error}),new Error(i.error||"Unable to upload attachment.");return Or("chat.upload.succeeded",{file_name:e.file.name,attachment_id:i.attachment.id}),pa(i.attachment)??(()=>{throw new Error("Attachment response was incomplete.")})()}async function IF(e){let t=await fetch("/api/v1/user/me/attachments",{headers:ut(e)}),n=await zi(t);if(!t.ok)throw new Error(n.error||"Unable to load My Files.");let r=[];for(let o of n.attachments??[]){let i=pa(o);i&&r.push({...i,createdAt:o.createdAt??o.created_at})}return{attachments:r,folders:n.folders??[]}}async function YR(e){if(e.file.size>100*1024*1024)throw new Error("Temporary files can be at most 100 MB.");Or("chat.temp_upload.attempt",{file_name:e.file.name,size_bytes:e.file.size,content_type:e.file.type});let t=await fetch("/api/v1/user/me/temporary-files/presign",{method:"POST",headers:ut(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 zi(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:ut(e.apiKey),body:a}),c=await zi(l);if(!l.ok||!c.file)throw new Error(c.error||"Unable to upload temporary file.");let u=pa(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:ut(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 zi(o);if(!o.ok||!i.file)throw new Error(i.error||"Unable to save temporary file.");let s=pa(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 wF(e){let t=await fetch("/api/v1/user/me/temporary-files",{headers:ut(e)}),n=await zi(t);if(!t.ok)throw new Error(n.error||"Unable to load temporary files.");let r=[];for(let o of n.files??[]){let i=pa(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 TR(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:ut(e)}),o=await zi(r);if(!r.ok)throw new Error(o.error||"Unable to load recent media.");let i=[];for(let s of o.media??[]){let a=pa(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 CF(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 RF(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 xF(e){if(e.length<=iS||CF(e)<=QU)return e;let t=e.slice(-iS),n=e.slice(0,-iS),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}]: ${RF(`${i.text}${s}`,eF)}`;if(o+a.length>ZU){r.push(`[${n.length-r.length} earlier messages omitted]`);break}r.push(a),o+=a.length}return[{id:$f("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
39
 
40
40
  `)].join(`
41
- `),attachments:[]},...t]}function xF(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 bF(e){let t=e.length-1;return e.map((n,r)=>{let o=xF(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 kF(){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 AF(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(`
41
+ `),attachments:[]},...t]}function bF(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 kF(e){let t=e.length-1;return e.map((n,r)=>{let o=bF(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 NF(){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 AF(){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 MF(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
43
 
44
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 f;try{f=JSON.parse(u)}catch{continue}if(!f||typeof f!="object")continue;let p=f;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 MF(e){return{threads:`vidfarm-editor-chat-threads:${e}`,activeThread:`vidfarm-editor-chat-active-thread:${e}`}}function PF(){if(typeof window>"u")return null;try{return window.sessionStorage}catch{try{return window.localStorage}catch{return null}}}function TR(){return`thread-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function $f(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 tr(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 lS(...e){return tr(e.flat())}function LF(e){let t=e.trim();return!t||t.startsWith("archived_")?t:`archived_${t}`}function fS(){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 OF(e){return(e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tracer").slice(0,28)}function DF(e,t){let n=OF(e),r="";do r=`${n}-${fS()}`;while(t.includes(r));return r}function UF(e,t){let n=e.trim();if(!n)return"";if(/-[a-z0-9]{8}$/i.test(n))return n;let r=`${n}-${fS()}`;for(;t.includes(r);)r=`${n}-${fS()}`;return r}function zf(){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 tr(n)}function IR(){let e=new URLSearchParams(window.location.search);return(e.get("thread_id")||e.get("threadId")||e.get("chat_id")||e.get("chatId")||"").trim()}function Uf(e){let t=e.trim().replace(/\s+/g," ");return t?t.length>42?`${t.slice(0,42).trimEnd()}\u2026`:t:"New chat"}function wR(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(-eF):[]).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:ji(o.args),result:UR(o.result)})),httpExchanges:r.httpExchanges?.map(Cc)}))}))}function FF(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:tr(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 CR(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:tr(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 RR(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 BF(e){return[...e].sort((t,n)=>Date.parse(n.updatedAt)-Date.parse(t.updatedAt))}function wc(e,t){return t.length?e.tracers.some(n=>t.some(r=>HF(n,r))):!0}function HF(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 $F(e){return(0,d.jsxs)("div",{className:"vf-editor-chat-attachment",children:[(0,d.jsx)("span",{className:"vf-editor-chat-attachment-name",children:e.attachment.fileName}),e.onRemove?(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-attachment-remove","aria-label":"Remove attachment",onClick:e.onRemove,children:"\xD7"}):null]})}function yS(){return(0,d.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,d.jsx)("path",{d:"M10 3v9"}),(0,d.jsx)("path",{d:"m6.5 8.5 3.5 3.5 3.5-3.5"}),(0,d.jsx)("path",{d:"M4 16h12"})]})}function zF(){return(0,d.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,d.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,d.jsx)("path",{d:"m10.7 11.6 5.2-5.2a1.9 1.9 0 0 0-2.7-2.7L8 8.9"}),(0,d.jsx)("path",{d:"m7.9 9 3.1 3.1"}),(0,d.jsx)("path",{d:"M3.5 16.5c1.4.5 3.6.5 4.9-.8"})]})}function SS(){return(0,d.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,d.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,d.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 _S(){return(0,d.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,d.jsx)("rect",{x:"7",y:"7",width:"9",height:"9",rx:"2"}),(0,d.jsx)("path",{d:"M5 12H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1"})]})}function Ff(e){return(0,d.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,d.jsx)("path",{d:"m7 4 6 6-6 6"})})}function YR(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 xR(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()??zf())[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||YR(e)),n.toString()}function jF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.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,k.useState)(a),u=s[l]||e.preview,f=s.length>1,p=u.kind==="image",h=p&&xR(u,!1)||"/inpaint";(0,k.useEffect)(()=>{n(!0)},[]),(0,k.useEffect)(()=>{o("")},[u.url]);let y=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 g=xR(u,!0);if(!g){T.preventDefault();return}T.preventDefault(),window.open(g,"_blank","noopener,noreferrer")};return(0,k.useEffect)(()=>{let T=g=>{if(g.key==="Escape"){i();return}f&&(g.key==="ArrowLeft"?(g.preventDefault(),c(S=>(S-1+s.length)%s.length)):g.key==="ArrowRight"&&(g.preventDefault(),c(S=>(S+1)%s.length)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[f,s.length,i]),t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal",onClick:T=>T.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:u.url,target:"_blank",rel:"noopener noreferrer",children:f?`${u.label} (${l+1} of ${s.length})`:u.label}),(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[f?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.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,d.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,d.jsx)(zF,{})}):null,(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:u.url,download:YR(u),"aria-label":"Download media",title:"Download",children:(0,d.jsx)(yS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{y()},"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,d.jsx)(SS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close media preview",title:"Close",children:"\xD7"})]})]}),(0,d.jsx)("div",{className:"vf-editor-chat-media-modal-body",children:u.kind==="image"?(0,d.jsx)("img",{src:u.url,alt:u.label,className:"vf-editor-chat-media-modal-image"}):(0,d.jsx)("video",{src:u.url,className:"vf-editor-chat-media-modal-video",controls:!0,autoPlay:!0,playsInline:!0})})]})}),document.body):null}function WF(e){let[t,n]=(0,k.useState)(!1);return(0,d.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,d.jsx)("span",{className:"vf-editor-chat-message-thumb-fallback",children:"Preview unavailable"}):(0,d.jsx)("img",{src:e.preview.url,alt:e.preview.label,className:"vf-editor-chat-message-attachment-thumb",loading:"lazy",onError:()=>n(!0)})})}function bR(e){return(0,d.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,d.jsxs)("button",{type:"button",className:"vf-editor-chat-message-thumb-button",onClick:()=>e.onOpenModal(e.preview),"aria-label":`Preview ${e.preview.label}`,children:[(0,d.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,d.jsx)("span",{className:"vf-editor-chat-message-video-play","aria-hidden":"true"})]})})}function kR(e){return e.previews.length?(0,d.jsx)("div",{className:"vf-editor-chat-message-image-rail","aria-label":"Image previews",children:e.previews.map(t=>(0,d.jsx)(WF,{preview:t,previews:e.previews,onOpenModal:e.onOpenModal},t.url))}):null}function GF(e){return(0,d.jsxs)("div",{className:"vf-editor-chat-composer-attachment-item",children:[jf(e.attachment)?(0,d.jsx)("img",{src:e.attachment.viewUrl,alt:e.attachment.fileName,className:"vf-editor-chat-composer-attachment-thumb"}):(0,d.jsx)("div",{className:"vf-editor-chat-composer-attachment-file","aria-hidden":"true",children:e.attachment.fileName.slice(0,1).toUpperCase()}),(0,d.jsx)("div",{className:"vf-editor-chat-composer-attachment-meta",children:(0,d.jsx)("span",{className:"vf-editor-chat-composer-attachment-name",children:e.attachment.fileName})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-composer-attachment-remove","aria-label":`Remove ${e.attachment.fileName}`,onClick:e.onRemove,children:"\xD7"})]})}function VF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),i=Bf(e.exchange.request.body),s=Bf(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,k.useEffect)(()=>{o(!0)},[]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-card",children:(0,d.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,d.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,d.jsx)("span",{className:"vf-editor-chat-http-url",title:a,children:l}),(0,d.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,d.jsx)("span",{className:"vf-editor-chat-http-expand","aria-hidden":"true",children:"+"})]})}),r&&t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-http-modal-backdrop",onClick:()=>n(!1),children:(0,d.jsxs)("div",{className:"vf-editor-chat-http-modal",onClick:f=>f.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-http-modal-header",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-http-modal-header-main",children:[(0,d.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,d.jsx)("span",{className:"vf-editor-chat-http-modal-url",children:a}),(0,d.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,d.jsx)("button",{type:"button",className:"vf-editor-chat-http-modal-close",onClick:()=>n(!1),"aria-label":"Close HTTP details",children:"\xD7"})]}),(0,d.jsxs)("div",{className:"vf-editor-chat-http-card-body is-modal",children:[e.exchange.explanation?(0,d.jsx)("div",{className:"vf-editor-chat-http-note",children:e.exchange.explanation}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"URL"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:a})]}),i?(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"Request"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:i})]}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"Response"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:e.exchange.result.error||s||"(empty)"})]}),Object.keys(e.exchange.result.headers).length?(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"Headers"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:Bf(e.exchange.result.headers)})]}):null]})]})}),document.body):null]})}function NR(e){return typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"?String(e):e===null?"null":JSON.stringify(e)}function vS(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 Dr(e){return(0,d.jsxs)("div",{className:"vf-editor-chat-json-line",style:{paddingLeft:`${e.depth*18+12}px`},children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-copy","aria-label":"Copy line",title:"Copy line",onClick:()=>e.onCopy(e.text),children:(0,d.jsx)(_S,{})}),(0,d.jsx)("span",{className:"vf-editor-chat-json-line-text",children:e.text})]})}function pS(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,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Expand JSON block",children:(0,d.jsx)(Ff,{open:!1})}),(0,d.jsx)(Dr,{text:`${e.linePrefix??""}[ \u2026 ]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Collapse JSON block",children:(0,d.jsx)(Ff,{open:!0})}),(0,d.jsx)(Dr,{text:i,depth:e.depth,onCopy:e.onCopy})]}),t.map((s,a)=>(0,d.jsx)(pS,{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,d.jsx)(Dr,{text:`]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsx)(Dr,{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,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Expand JSON block",children:(0,d.jsx)(Ff,{open:!1})}),(0,d.jsx)(Dr,{text:`${e.linePrefix??""}{ \u2026 }${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Collapse JSON block",children:(0,d.jsx)(Ff,{open:!0})}),(0,d.jsx)(Dr,{text:s,depth:e.depth,onCopy:e.onCopy})]}),r.map(([a,l],c)=>{let u=`${JSON.stringify(a)}: `;return l&&typeof l=="object"?(0,d.jsx)(pS,{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,d.jsx)(Dr,{text:`${u}${NR(l)}${c===r.length-1?"":","}`,depth:e.depth+1,onCopy:e.onCopy},`${o}:${a}`)}),(0,d.jsx)(Dr,{text:`}${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsx)(Dr,{text:`${e.linePrefix??""}{}${n}`,depth:e.depth,onCopy:e.onCopy})}return(0,d.jsx)(Dr,{text:`${e.linePrefix??""}${NR(t)}${n}`,depth:e.depth,onCopy:e.onCopy})}function KR(e){let[t,n]=(0,k.useState)(new Set),[r,o]=(0,k.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 vS(a),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1400)};return(0,d.jsxs)("div",{className:"vf-editor-chat-json-viewer",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-toolbar",children:[(0,d.jsx)("span",{className:"vf-editor-chat-json-file",children:e.storageKey}),(0,d.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,d.jsx)("div",{className:"vf-editor-chat-json-scroll",children:(0,d.jsx)(pS,{value:e.value,depth:0,path:"root",collapsedPaths:t,togglePath:i,onCopy:s})})]})}function qF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),i=$R(e.artifact.url,`${e.artifact.label}.json`),s=Bf(e.data);(0,k.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await vS(s),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,k.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,d.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,d.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,d.jsx)(_S,{})}),(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,download:i,title:"Download JSON","aria-label":"Download JSON",children:(0,d.jsx)(yS,{})}),(0,d.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,d.jsx)(SS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close JSON preview",title:"Close",children:"\xD7"})]})]}),(0,d.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,d.jsx)(KR,{value:e.data,storageKey:e.artifact.label})})]})}),document.body):null}function YF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)(null),[c,u]=(0,k.useState)(!1),f=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).json();s(_)}catch(y){l(y instanceof Error?y.message:"Unable to load JSON artifact.")}finally{u(!1)}}},p=()=>{let y=!t;n(y),y&&f()},h=()=>{f(),o(!0)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:"JSON result"}),(0,d.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview JSON"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,d.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,d.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading JSON\u2026"}):a?(0,d.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,d.jsx)(KR,{value:i,storageKey:e.artifact.label}):null}):null]}),r&&i!==null?(0,d.jsx)(qF,{artifact:e.artifact,data:i,onClose:()=>o(!1)}):null]})}function JR(e){return e.format==="markdown"?(0,d.jsx)("div",{className:"vf-editor-chat-doc-markdown",dangerouslySetInnerHTML:{__html:BR(e.text)}}):(0,d.jsx)("pre",{className:"vf-editor-chat-doc-pre",children:e.text})}function KF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),i=e.artifact.format==="markdown"?".md":".txt",s=$R(e.artifact.url,`${e.artifact.label}${i}`);(0,k.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await vS(e.text),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,k.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,d.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,d.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,d.jsx)(_S,{})}),(0,d.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,d.jsx)(yS,{})}),(0,d.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,d.jsx)(SS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close document preview",title:"Close",children:"\xD7"})]})]}),(0,d.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,d.jsx)("div",{className:"vf-editor-chat-doc-viewer",children:(0,d.jsx)(JR,{text:e.text,format:e.artifact.format})})})]})}),document.body):null}function JF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)(null),[c,u]=(0,k.useState)(!1),f=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).text();s(_)}catch(y){l(y instanceof Error?y.message:"Unable to load document artifact.")}finally{u(!1)}}},p=()=>{let y=!t;n(y),y&&f()},h=()=>{f(),o(!0)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:e.artifact.format==="markdown"?"Markdown result":"Text result"}),(0,d.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,d.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,d.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading document\u2026"}):a?(0,d.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,d.jsx)("div",{className:"vf-editor-chat-doc-viewer is-inline",children:(0,d.jsx)(JR,{text:i,format:e.artifact.format})}):null}):null]}),r&&i!==null?(0,d.jsx)(KF,{artifact:e.artifact,text:i,onClose:()=>o(!1)}):null]})}var XF=(0,k.memo)(function(t){let n=t.message.role==="assistant",r=t.message.text.trim().length>0,o=r?BR(t.message.text):"",[i,s]=(0,k.useState)(null),a=t.message.attachments.filter(jf),l=t.message.attachments.filter(uS),c=t.message.attachments.filter(_=>!jf(_)&&!uS(_)),u=r?aF(t.message.text,t.message.attachments.map(_=>_.viewUrl)):[],f=u.filter(_=>_.kind==="image"),p=u.filter(_=>_.kind==="video"),h=(t.message.httpExchanges??[]).flatMap(_=>{let T=$i(_.result.body);return T?jR(T):[]}).filter((_,T,g)=>g.findIndex(S=>S.url===_.url)===T),y=(t.message.httpExchanges??[]).flatMap(_=>{let T=$i(_.result.body);return T?WR(T):[]}).filter((_,T,g)=>g.findIndex(S=>S.url===_.url)===T);return(0,d.jsxs)("div",{className:`vf-editor-chat-message ${n?"is-assistant":"is-user"}`,children:[(0,d.jsx)("div",{className:"vf-editor-chat-message-meta",children:n?"Copilot":"You"}),(0,d.jsxs)("div",{className:"vf-editor-chat-bubble","data-pending":t.message.isPending?"true":"false",children:[t.message.attachments.length?(0,d.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[c.map(_=>(0,d.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,d.jsx)("a",{className:"vf-editor-chat-message-preview-link",href:_.viewUrl,target:"_blank",rel:"noopener noreferrer",children:(0,d.jsx)($F,{attachment:_})})},_.id)),(0,d.jsx)(kR,{previews:a.map(_=>({kind:"image",url:_.viewUrl,label:_.fileName})),onOpenModal:(_,T)=>s({preview:_,gallery:T})}),l.map(_=>(0,d.jsx)(bR,{preview:{kind:"video",url:_.viewUrl,label:_.fileName},onOpenModal:T=>s({preview:T,gallery:[T]})},_.id))]}):null,t.message.statusText?(0,d.jsxs)("div",{className:"vf-editor-chat-message-status","aria-live":"polite",children:[(0,d.jsx)("span",{className:"vf-editor-chat-status-dot"}),t.message.statusText]}):null,t.message.httpExchanges?.length?(0,d.jsx)("div",{className:"vf-editor-chat-http-list",children:t.message.httpExchanges.map((_,T)=>(0,d.jsx)(VF,{exchange:_},`${_.request.method}:${_.request.url}:${T}`))}):null,r?(0,d.jsx)("div",{className:"vf-editor-chat-message-body",dangerouslySetInnerHTML:{__html:o}}):t.message.isPending?(0,d.jsxs)("div",{className:"vf-editor-chat-message-loading","aria-hidden":"true",children:[(0,d.jsx)("span",{}),(0,d.jsx)("span",{}),(0,d.jsx)("span",{})]}):null,u.length?(0,d.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[(0,d.jsx)(kR,{previews:f,onOpenModal:(_,T)=>s({preview:_,gallery:T})}),p.map(_=>(0,d.jsx)(bR,{preview:_,onOpenModal:T=>s({preview:T,gallery:[T]})},_.url))]}):null,h.length?(0,d.jsx)("div",{className:"vf-editor-chat-json-list",children:h.map(_=>(0,d.jsx)(YF,{artifact:_},_.key))}):null,y.length?(0,d.jsx)("div",{className:"vf-editor-chat-json-list",children:y.map(_=>(0,d.jsx)(JF,{artifact:_},_.key))}):null]}),i?(0,d.jsx)(jF,{preview:i.preview,gallery:i.gallery,onClose:()=>s(null)}):null]})});function AR(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 MR(e){return jf(e.file)?(0,d.jsx)("img",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,alt:e.file.fileName}):uS(e.file)?(0,d.jsx)("video",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,muted:!0,playsInline:!0}):(0,d.jsx)("div",{className:"vf-editor-upload-file-icon","aria-hidden":"true",children:e.file.fileName.slice(0,1).toUpperCase()})}function mo(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Gf(e,t){return mo([e,t].filter(Boolean).join("/"))}function PR(e){let t=mo(e).split("/").filter(Boolean);return t.pop(),t.join("/")}function LR(e){return mo(e).split("/").filter(Boolean).at(-1)||"All files"}function QF(e){let t=mo(e.currentFolder),n=t?`${t}/`:"",r=new Map;for(let o of e.folders){let i=mo(o);if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Gf(t,a))}for(let o of e.files){let i=mo(o.folderPath??"");if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Gf(t,a))}return Array.from(r.entries()).map(([o,i])=>({name:o,path:i})).sort((o,i)=>o.name.localeCompare(i.name))}function cS(e){return e.name==="share"?(0,d.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M14 4h6v6"}),(0,d.jsx)("path",{d:"M10 14 20 4"}),(0,d.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,d.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,d.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,d.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,d.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M3 6h18"}),(0,d.jsx)("path",{d:"M8 6V4h8v2"}),(0,d.jsx)("path",{d:"M19 6 18 20H6L5 6"}),(0,d.jsx)("path",{d:"M10 11v5"}),(0,d.jsx)("path",{d:"M14 11v5"})]})}function ZF(e){let[t,n]=(0,k.useState)("my-files"),[r,o]=(0,k.useState)([]),[i,s]=(0,k.useState)([]),[a,l]=(0,k.useState)([]),[c,u]=(0,k.useState)(()=>new Set),[f,p]=(0,k.useState)([]),[h,y]=(0,k.useState)([]),[_,T]=(0,k.useState)(()=>new Set),[g,S]=(0,k.useState)(null),[E,R]=(0,k.useState)(!1),[M,A]=(0,k.useState)(""),[I,N]=(0,k.useState)(null),[U,x]=(0,k.useState)(null),[H,j]=(0,k.useState)(null),[ge,X]=(0,k.useState)(null),[Ze,fe]=(0,k.useState)(null),de=(0,k.useRef)(null),D=(0,k.useRef)(null),ye=(0,k.useMemo)(()=>{let P=f.map(ie=>({...ie,recentSource:"generated"}));return[...h.map(ie=>({...ie,recentSource:"temporary"})),...P].sort((ie,Y)=>{let Ie=ie.createdAt?Date.parse(ie.createdAt):0;return(Y.createdAt?Date.parse(Y.createdAt):0)-Ie})},[f,h]),Q=t==="upload"?r:t==="my-files"?i.filter(P=>c.has(P.id)):t==="recents"?ye.filter(P=>_.has(P.id)):[];async function ae(){let P=await TF(e.apiKey);s(P.attachments),l(P.folders)}async function Re(P){R(!0);try{let[V,ie]=P?[await ER(e.apiKey,P),null]:await Promise.all([ER(e.apiKey),IF(e.apiKey)]);p(Y=>P?[...Y,...V.media]:V.media),ie&&y(ie.files),S(V.nextCursor),P||T(new Set)}finally{R(!1)}}(0,k.useEffect)(()=>{e.open&&(X(null),j(null),ae().catch(P=>X(P instanceof Error?P.message:"Unable to load My Files.")),Re().catch(P=>X(P instanceof Error?P.message:"Unable to load recent media.")))},[e.open]);function Te(){o([]),u(new Set),T(new Set),j(null),X(null),N(null),x(null),e.onClose()}async function St(P){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(P);else{let V=document.createElement("textarea");V.value=P,V.style.position="fixed",V.style.opacity="0",document.body.appendChild(V),V.focus(),V.select(),document.execCommand("copy"),document.body.removeChild(V)}j("File URL copied.")}catch{X("Unable to copy file URL.")}}async function ot(P,V){if(!P.length)return;X(null);let ie=[];for(let Y of P)try{if(j(`Uploading ${Y.name}...`),V==="upload"){let dt=await qR({apiKey:e.apiKey,file:Y,folderPath:DR}),J=await VR({attachment:dt,file:Y,currentInlineBytes:GR([...r,...ie])});ie.push(J);continue}let Ie=await EF({apiKey:e.apiKey,file:Y,folderPath:M,maxBytes:OR,limitLabel:"50 MB"});ie.push(Ie)}catch(Ie){X(Ie instanceof Error?Ie.message:"Upload failed.")}V==="upload"?(o(Y=>[...Y,...ie]),await Re().catch(Y=>X(Y instanceof Error?Y.message:"Unable to refresh recent files."))):V==="my-files"&&(await ae(),u(Y=>new Set([...Y,...ie.map(Ie=>Ie.id)]))),ie.length&&j(`${ie.length} file${ie.length===1?"":"s"} uploaded.`)}async function bt(P,V){let ie=V==="my-files"?`/api/v1/user/me/attachments/${encodeURIComponent(P.id)}`:`/api/v1/user/me/temporary-files/${encodeURIComponent(P.id)}`,Y=await fetch(ie,{method:"DELETE",headers:ut(e.apiKey,"application/json")}),Ie=await Y.json().catch(()=>({}));if(!Y.ok)throw new Error(Ie.error||"Unable to delete file.");V==="my-files"&&(s(dt=>dt.filter(J=>J.id!==P.id)),u(dt=>{let J=new Set(dt);return J.delete(P.id),J})),fe(null),j("File deleted.")}async function it(P){if(P!=="my-files"||!U||U.mode!=="create")return;let V=Gf(U.baseFolder,U.value);if(!V){X("Choose a folder name.");return}let ie=await fetch("/api/v1/user/me/attachments/folders",{method:"POST",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({folder_path:V})}),Y=await ie.json().catch(()=>({}));if(!ie.ok){X(Y.error||"Unable to create folder.");return}l(Ie=>Array.from(new Set([...Ie,V])).sort()),x(null),j("Folder created.")}async function In(P,V){if(P!=="my-files"||!U||U.mode!=="rename")return;let ie=U.value.trim(),Y=Gf(PR(V),ie);if(!Y||Y===V)return;let Ie=await fetch("/api/v1/user/me/attachments/folders",{method:"PATCH",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({from_folder_path:V,to_folder_path:Y})}),dt=await Ie.json().catch(()=>({}));if(!Ie.ok){X(dt.error||"Unable to rename folder.");return}A(J=>J===V||J.startsWith(`${V}/`)?`${Y}${J.slice(V.length)}`:J),await ae(),N(null),x(null),j("Folder renamed.")}async function Dt(P,V){if(P!=="my-files")return;let ie=await fetch("/api/v1/user/me/attachments/folders",{method:"DELETE",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({folder_path:V})}),Y=await ie.json().catch(()=>({}));if(!ie.ok){X(Y.error||"Unable to delete folder.");return}A(Ie=>Ie===V||Ie.startsWith(`${V}/`)?PR(V):Ie),await ae(),N(null),x(null),j("Folder deleted.")}function wn(P){let V=a,ie=i,Y=M,Ie=A,dt=QF({folders:V,files:ie,currentFolder:Y}),J=mo(Y).split("/").filter(Boolean);return(0,d.jsxs)("div",{className:"vf-editor-upload-browser",children:[(0,d.jsxs)("div",{className:"vf-editor-upload-browser-toolbar",children:[(0,d.jsxs)("div",{className:"vf-editor-upload-breadcrumb","aria-label":"Current folder",children:[(0,d.jsx)("button",{type:"button","data-current":!Y,onClick:()=>Ie(""),children:"files"}),J.map(($e,he)=>{let Je=J.slice(0,he+1).join("/");return(0,d.jsxs)("span",{className:"vf-editor-upload-breadcrumb-segment",children:[(0,d.jsx)("span",{"aria-hidden":"true",children:"/"}),(0,d.jsx)("button",{type:"button","data-current":Je===Y,onClick:()=>Ie(Je),children:$e})]},Je)})]}),(0,d.jsx)("button",{type:"button",onClick:()=>x({mode:"create",scope:"my-files",baseFolder:Y,value:""}),children:"New folder"})]}),dt.length?(0,d.jsx)("div",{className:"vf-editor-upload-folder-grid",children:dt.map($e=>(0,d.jsxs)("article",{className:"vf-editor-upload-folder-row",children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-folder-open",onClick:()=>Ie($e.path),children:[(0,d.jsx)("span",{className:"vf-editor-upload-folder-icon","aria-hidden":"true"}),(0,d.jsx)("span",{children:$e.name})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-folder-menu-button","aria-label":`Folder actions for ${$e.name}`,onClick:()=>N(I===$e.path?null:$e.path),children:"..."}),I===$e.path?(0,d.jsxs)("div",{className:"vf-editor-upload-folder-menu",children:[(0,d.jsx)("button",{type:"button",onClick:()=>x({mode:"rename",scope:"my-files",folderPath:$e.path,value:LR($e.path)}),children:"Rename"}),(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>x({mode:"delete",scope:"my-files",folderPath:$e.path,value:""}),children:"Delete"})]}):null]},$e.path))}):null]})}function nr(P,V){let ie=V==="my-files"?c.has(P.id):V==="recents"?_.has(P.id):!1,Y="s3Url"in P&&P.s3Url?P.s3Url:P.viewUrl;return(0,d.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":ie?"true":"false",children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-file-select",onClick:()=>{if(V==="temporary"){St(Y);return}(V==="recents"?T:u)(dt=>{let J=new Set(dt);return J.has(P.id)?J.delete(P.id):J.add(P.id),J})},children:[(0,d.jsx)(MR,{file:P}),(0,d.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,d.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,d.jsxs)("span",{className:"vf-editor-upload-file-meta",children:[AR(P.sizeBytes),P.folderPath?` \xB7 ${P.folderPath}`:""]})]})]}),(0,d.jsxs)("div",{className:"vf-editor-upload-file-actions",children:[V==="my-files"||V==="recents"?(0,d.jsx)("span",{className:"vf-editor-upload-selection-indicator","data-selected":ie?"true":"false","aria-hidden":"true",children:ie?"\u2713":""}):null,(0,d.jsx)("a",{href:P.viewUrl,target:"_blank",rel:"noreferrer","aria-label":`View ${P.fileName}`,children:(0,d.jsx)(cS,{name:"share"})}),(0,d.jsx)("button",{type:"button","aria-label":`Copy URL for ${P.fileName}`,onClick:()=>{St(Y)},children:(0,d.jsx)(cS,{name:"link"})}),V==="recents"?null:(0,d.jsx)("button",{type:"button","aria-label":`Delete ${P.fileName}`,onClick:()=>fe(Ze===P.id?null:P.id),children:(0,d.jsx)(cS,{name:"trash"})})]}),V!=="recents"&&Ze===P.id?(0,d.jsxs)("div",{className:"vf-editor-upload-popconfirm",children:[(0,d.jsx)("span",{children:"Delete this file?"}),(0,d.jsx)("button",{type:"button",onClick:()=>fe(null),children:"Cancel"}),(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{bt(P,V)},children:"Delete"})]}):null]},P.id)}function Vi(){if(!U)return null;let P=U.mode==="create"?"New folder":U.mode==="rename"?"Rename folder":"Delete folder",V=U.mode==="delete"?U.folderPath:"";return(0,d.jsxs)("div",{className:"vf-editor-upload-folder-dialog",role:"dialog","aria-label":P,children:[(0,d.jsx)("div",{className:"vf-editor-upload-folder-dialog-title",children:P}),U.mode==="delete"?(0,d.jsxs)("div",{className:"vf-editor-upload-folder-dialog-copy",children:["Delete ",(0,d.jsx)("strong",{children:V})," and all files inside it?"]}):(0,d.jsx)("input",{value:U.value,autoFocus:!0,placeholder:"folder-name",onChange:ie=>x({...U,value:ie.target.value}),onKeyDown:ie=>{ie.key==="Enter"&&(ie.preventDefault(),U.mode==="create"?it(U.scope):In(U.scope,U.folderPath))}}),(0,d.jsxs)("div",{className:"vf-editor-upload-folder-dialog-actions",children:[(0,d.jsx)("button",{type:"button",onClick:()=>x(null),children:"Cancel"}),U.mode==="create"?(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{it(U.scope)},children:"Create"}):U.mode==="rename"?(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{In(U.scope,U.folderPath)},children:"Rename"}):(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{Dt(U.scope,U.folderPath)},children:"Delete"})]})]})}if(!e.open)return null;let Zo=i.filter(P=>mo(P.folderPath??"")===mo(M));return(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-upload-drawer-backdrop",children:(0,d.jsxs)("aside",{className:"vf-editor-upload-drawer","aria-label":"Upload drawer",children:[(0,d.jsxs)("div",{className:"vf-editor-upload-header",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"vf-editor-upload-title",children:"Upload"}),(0,d.jsx)("div",{className:"vf-editor-upload-subtitle",children:"Upload, attach, and copy file URLs."})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-close","aria-label":"Close upload drawer",onClick:Te,children:"\xD7"})]}),(0,d.jsxs)("div",{className:"vf-editor-upload-tabs",role:"tablist",children:[(0,d.jsx)("button",{type:"button","data-active":t==="upload",onClick:()=>n("upload"),children:"Upload file"}),(0,d.jsx)("button",{type:"button","data-active":t==="my-files",onClick:()=>n("my-files"),children:"My Files"}),(0,d.jsx)("button",{type:"button","data-active":t==="recents",onClick:()=>n("recents"),children:"Recents"})]}),(0,d.jsxs)("div",{className:"vf-editor-upload-body",children:[ge?(0,d.jsx)("div",{className:"vf-editor-upload-status","data-tone":"error",children:ge}):null,H?(0,d.jsx)("div",{className:"vf-editor-upload-status",children:H}):null,Vi(),t==="upload"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>de.current?.click(),children:["Upload files to chat",(0,d.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,d.jsx)("input",{ref:de,type:"file",multiple:!0,hidden:!0,onChange:P=>{ot(Array.from(P.target.files??[]),"upload"),P.target.value=""}}),(0,d.jsx)("div",{className:"vf-editor-upload-list",children:r.map(P=>(0,d.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":"true",children:[(0,d.jsx)(MR,{file:P}),(0,d.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,d.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,d.jsx)("span",{className:"vf-editor-upload-file-meta",children:AR(P.sizeBytes)})]}),(0,d.jsx)("button",{type:"button",onClick:()=>o(V=>V.filter(ie=>ie.id!==P.id)),children:"\xD7"})]},P.id))})]}):t==="my-files"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>D.current?.click(),children:["Add to My Files",(0,d.jsxs)("span",{children:["Uploads into ",LR(M)," and auto-selects. Max 50 MB each."]})]}),(0,d.jsx)("input",{ref:D,type:"file",multiple:!0,hidden:!0,onChange:P=>{ot(Array.from(P.target.files??[]),"my-files"),P.target.value=""}}),wn("my-files"),(0,d.jsx)("div",{className:"vf-editor-upload-list",children:Zo.length?Zo.map(P=>nr(P,"my-files")):(0,d.jsx)("div",{className:"vf-editor-upload-empty",children:"No files in this folder."})})]}):t==="recents"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"vf-editor-upload-list",children:ye.length?ye.map(P=>nr(P,"recents")):(0,d.jsx)("div",{className:"vf-editor-upload-empty",children:E?"Loading recent files...":"No recent files yet."})}),g?(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-more",disabled:E,onClick:()=>{Re(g).catch(P=>X(P instanceof Error?P.message:"Unable to load more recent media."))},children:E?"Loading...":"Load more generated media"}):null]}):null]}),(0,d.jsxs)("div",{className:"vf-editor-upload-footer",children:[(0,d.jsx)("button",{type:"button",onClick:Te,children:"Cancel"}),(0,d.jsxs)("div",{className:"vf-editor-upload-footer-confirm",children:[(0,d.jsxs)("span",{children:[Q.length," file",Q.length===1?"":"s"," selected"]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",disabled:!Q.length,onClick:()=>{e.onConfirm(Q),Te()},children:"Confirm"})]})]})]})}),document.body)}function XR({boot:e}){let t=e.template.templateId==="chat-brainstorm",n=t&&e.template.persistentHistorySidebar===!0,r=(0,k.useMemo)(()=>MF(e.template.templateId),[e.template.templateId]),o=(0,k.useMemo)(()=>PF(),[]),i=(0,k.useRef)(null),s=(0,k.useRef)(null),a=(0,k.useRef)(!0),l=(0,k.useRef)(!1),c=(0,k.useRef)(null),u=(0,k.useRef)(null),f=(0,k.useRef)(new Map),p=(0,k.useRef)({nextAvailableAt:0}),h=(0,k.useRef)([]),y=(0,k.useRef)(new Set),[_,T]=(0,k.useState)([]),[g,S]=(0,k.useState)(null),[E,R]=(0,k.useState)(null),[M,A]=(0,k.useState)(null),[I,N]=(0,k.useState)(""),[U,x]=(0,k.useState)([]),[H,j]=(0,k.useState)(null),[ge,X]=(0,k.useState)(null),[Ze,fe]=(0,k.useState)(null),[de,D]=(0,k.useState)(!1),[ye,Q]=(0,k.useState)(!1),[ae,Re]=(0,k.useState)(!1),[Te,St]=(0,k.useState)(!1),[ot,bt]=(0,k.useState)(!1),[it,In]=(0,k.useState)(!1),[Dt,wn]=(0,k.useState)(null),[nr,Vi]=(0,k.useState)(!1),[Zo,P]=(0,k.useState)(null),[V,ie]=(0,k.useState)(!1),[Y,Ie]=(0,k.useState)(()=>{let m=typeof window<"u"?window.__vidfarmEditorTracers:null;if(m)return m.get();if(typeof window<"u"){let v=zf();if(v.length)return v}return tr(e.template.tracers||[])}),dt=(0,k.useMemo)(()=>{if(!e.threadsUrl)return null;let m=new URL(e.threadsUrl,window.location.origin);return t||m.searchParams.set("template_id",e.template.templateId),m.searchParams.set("include_messages","false"),m.searchParams.set("limit",t?"200":"50"),m.toString()},[e.template.templateId,e.threadsUrl,t]),J=m=>e.threadsUrl?new URL(`${e.threadsUrl.replace(/\/$/,"")}/${encodeURIComponent(m)}`,window.location.origin).toString():null;(0,k.useEffect)(()=>{let m=FF(o?.getItem(r.threads)??null,e.template.templateId),v=o?.getItem(r.activeThread)??null,w=IR(),b=window.__vidfarmEditorTracers?.get()??zf(),F=w&&!m.some(le=>le.id===w)?[{id:w,templateId:e.template.templateId,title:"Loading chat",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),lastMessageAt:null,messageCount:0,tracers:b,hiddenFromView:!1,messages:[]},...m]:m,K=F.filter(le=>!le.hiddenFromView),z=K.find(le=>wc(le,b));h.current=F,T(F),w&&K.some(le=>le.id===w)?S(w):v&&K.some(le=>le.id===v)&&(!b.length||K.some(le=>le.id===v&&wc(le,b)))?S(v):S(z?.id??K[0]?.id??null),D(!0)},[e.template.templateId,o,r]),(0,k.useEffect)(()=>{if(!e.vidfarmApiKey||!dt)return;let m=new AbortController;return(async()=>{try{let v=[],w=null,b=new Set;do{let F=new URL(dt);w&&F.searchParams.set("cursor",w);let K=await fetch(F.toString(),{method:"GET",headers:ut(e.vidfarmApiKey),signal:m.signal});if(!K.ok)return;let z=await K.json().catch(()=>null);Array.isArray(z?.threads)&&v.push(...z.threads.map(pe=>CR(pe,e.template.templateId)).filter(pe=>!!pe));let le=typeof z?.next_cursor=="string"&&z.next_cursor?z.next_cursor:null;!le||b.has(le)?w=null:(b.add(le),w=le)}while(w&&!m.signal.aborted);if(!v.length)return;T(F=>{let K=RR(F,v);return h.current=K,K}),S(F=>F&&h.current.some(K=>K.id===F)?F:v[0]?.id??F)}catch(v){if(v instanceof DOMException&&v.name==="AbortError")return}})(),()=>{m.abort()}},[e.template.templateId,e.vidfarmApiKey,dt]),(0,k.useEffect)(()=>{h.current=_},[_]);let[$e,he]=(0,k.useState)(()=>{if(typeof window>"u")return null;try{return new URL(window.location.href).searchParams.get("fork")}catch{return null}});(0,k.useEffect)(()=>{let m=()=>{try{he(new URL(window.location.href).searchParams.get("fork"))}catch{he(null)}};return window.addEventListener("popstate",m),()=>{window.removeEventListener("popstate",m)}},[]);async function Je(m){if(!e.vidfarmApiKey){P("Sign in to see forks.");return}if(!nr&&!(!m?.force&&Dt!==null)){Vi(!0),P(null);try{let v=await fetch("/api/v1/compositions",{method:"GET",headers:ut(e.vidfarmApiKey)});if(!v.ok){P(v.status===401?"Sign in to see forks.":`Failed to load forks (${v.status}).`),wn([]);return}let w=await v.json().catch(()=>null),F=(Array.isArray(w?.forks)?w.forks:[]).map(K=>{if(!K||typeof K!="object")return null;let z=K,le=typeof z.fork_id=="string"?z.fork_id:null;return le?{forkId:le,templateId:typeof z.template_id=="string"?z.template_id:null,parentForkId:typeof z.parent_fork_id=="string"?z.parent_fork_id:null,parentVersion:typeof z.parent_version=="number"?z.parent_version:null,title:typeof z.title=="string"?z.title:null,visibility:typeof z.visibility=="string"?z.visibility:null,latestVersion:typeof z.latest_version=="number"?z.latest_version:null,ownerCustomerId:typeof z.owner_customer_id=="string"?z.owner_customer_id:null,createdAt:typeof z.created_at=="string"?z.created_at:null,updatedAt:typeof z.updated_at=="string"?z.updated_at:null}:null}).filter(K=>!!K).filter(K=>K.templateId===e.template.templateId).sort((K,z)=>String(z.updatedAt??"").localeCompare(String(K.updatedAt??"")));wn(F)}catch{P("Could not load forks. Please try again."),wn([])}finally{Vi(!1)}}}(0,k.useEffect)(()=>{it&&Dt===null&&!nr&&Je()},[it]),(0,k.useEffect)(()=>{let m=window.__vidfarmEditorTracers;if(m)return Ie(m.get()),m.subscribe(w=>Ie(w));let v=()=>{let w=zf();Ie(w.length?w:tr(e.template.tracers||[]))};return v(),window.addEventListener("popstate",v),()=>{window.removeEventListener("popstate",v)}},[e.template.tracers]);let Se=(0,k.useRef)(_),Ur=(0,k.useRef)(g);(0,k.useEffect)(()=>{Se.current=_,Ur.current=g},[_,g]),(0,k.useEffect)(()=>{if(!de)return;let m=window.setTimeout(()=>{try{o?.setItem(r.threads,JSON.stringify(wR(Se.current,Ur.current)))}catch(v){console.warn("Unable to persist editor chat threads.",v)}},300);return()=>window.clearTimeout(m)},[g,o,de,r,_]),(0,k.useEffect)(()=>{if(de)try{g?o?.setItem(r.activeThread,g):o?.removeItem(r.activeThread)}catch(m){console.warn("Unable to persist active editor chat thread.",m)}},[g,o,de,r]),(0,k.useEffect)(()=>{if(!de||typeof window>"u")return;let m=new URL(window.location.href),v=m.searchParams.get("thread_id");if(g){if(v===g)return;m.searchParams.set("thread_id",g)}else{if(!v)return;m.searchParams.delete("thread_id")}window.history.replaceState({},"",m.toString())},[g,de]);let Jt=(0,k.useMemo)(()=>_.find(m=>m.id===g)??null,[g,_]),qi=(0,k.useMemo)(()=>_.find(m=>m.id===M?.threadId)??null,[M?.threadId,_]);(0,k.useEffect)(()=>{if(!de||!e.vidfarmApiKey||!g)return;let m=h.current.find(z=>z.id===g);if(y.current.has(g))return;let v=IR();if(!!(m&&(m.messageCount??0)===0&&m.messages.length===0)){y.current.add(g);return}let b=J(g);if(!b)return;let F=new AbortController;return!m?.messages.length&&R(g),(async()=>{try{let z=await fetch(b,{method:"GET",headers:ut(e.vidfarmApiKey),signal:F.signal});if(!z.ok){let ce=!!(m&&g!==v),ue=!!(m&&(m.messageCount??0)===0&&m.messages.length===0);z.status===404&&!ce&&!ue&&j(`Chat ID ${g} was not found for this account.`),y.current.add(g);return}let le=await z.json().catch(()=>null),pe=le?.thread?CR(le.thread,e.template.templateId):null;if(!pe)return;y.current.add(pe.id),j(null),T(ce=>{let ue=RR(ce,[pe]);return h.current=ue,ue})}catch(z){if(z instanceof DOMException&&z.name==="AbortError")return}finally{F.signal.aborted||R(z=>z===g?null:z)}})(),()=>{F.abort(),R(z=>z===g?null:z)}},[g,e.vidfarmApiKey,e.threadsUrl,de]),(0,k.useEffect)(()=>{if(!de||Jt&&!Jt.hiddenFromView)return;let m=_.find(v=>!v.hiddenFromView&&wc(v,Y));S(m?.id??_.find(v=>!v.hiddenFromView)?.id??null)},[Jt,de,_,Y]);let Kf=(0,k.useMemo)(()=>Jt?.tracers.length?Jt.tracers:Y,[Jt?.tracers,Y]),Jf=(0,k.useMemo)(()=>_.filter(m=>!m.hiddenFromView).sort((m,v)=>{let w=wc(m,Y),b=wc(v,Y);return w!==b?w?-1:1:Date.parse(v.updatedAt)-Date.parse(m.updatedAt)}),[_,Y]),IS=Kf[0]??null,Xf=Jt?.messages??[],wS=ge!==null,Qf=!!(g&&ge===g),CS=(0,k.useMemo)(()=>(I.trim()||U.length)&&!wS,[I,U.length,wS]);(0,k.useEffect)(()=>{!de||!e.vidfarmApiKey||!Jt||!Jt.messages.length||Sx(Jt)},[Jt,e.vidfarmApiKey,de]);async function Rc(m,v){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let w=J(m.id);w&&await fetch(w,{method:"PATCH",headers:ut(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:e.template.templateId,title:v?.title??m.title,tracers:v?.tracers??m.tracers,hidden_from_view:v?.hiddenFromView??m.hiddenFromView===!0,archived:v?.archived})}).catch(()=>{})}async function tx(m){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let v=J(m.threadId);v&&await fetch(`${v}/exchanges`,{method:"POST",headers:ut(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:m.templateId??e.template.templateId,title:m.title||"New chat",tracers:m.tracers,messages:m.messages.map(w=>({id:w.id,role:w.role,text:w.text,attachments:w.attachments.map(b=>({id:b.id,fileName:b.fileName,contentType:b.contentType,viewUrl:b.viewUrl})),toolExchanges:w.toolExchanges,httpExchanges:w.httpExchanges?.map(Cc)}))})}).catch(()=>{})}async function nx(m){if(!e.vidfarmApiKey||!e.threadsUrl)return;let v=J(m);v&&await fetch(v,{method:"DELETE",headers:ut(e.vidfarmApiKey)}).catch(()=>{})}function RS(m){let v=new URL(window.location.href);m.length?v.searchParams.set("tracers",m.join(",")):v.searchParams.delete("tracers"),window.history.replaceState({},"",v.toString()),window.dispatchEvent(new CustomEvent("vidfarm:editor-tracers-changed",{detail:{tracers:m}}))}function ma(m){let v=tr(m),w=window.__vidfarmEditorTracers;if(w){w.set(v);return}Ie(v),RS(v)}function xS(){let m=window.__vidfarmEditorTracers;if(m)return m.add();let v=DF(e.template.templateSlug,Y);return ma([v,...Y]),v}function bS(m){let v=window.__vidfarmEditorTracers?.get()??Y,w=m?UF(m,v):null,b=window.__vidfarmEditorTracers;return b?b.add(w??void 0):w?(ma([w,...v.filter(F=>F!==w)]),w):xS()}function rx(m){let v=m.trim();if(!v)return;let w=window.__vidfarmEditorTracers;w?w.add(v):Y.includes(v)||ma([v,...Y]),Jt&&ft(Jt.id,b=>({...b,tracers:[v,...b.tracers.filter(F=>F!==v)],updatedAt:new Date().toISOString()}))}function ox(m){let v=window.__vidfarmEditorTracers;if(v){v.remove(m);return}let w=Y.filter(b=>b!==m);ma(w)}(0,k.useEffect)(()=>{RS(Y)},[Y]),(0,k.useEffect)(()=>{let m=s.current;if(!m)return;let v=()=>{a.current=fF(m),a.current||(l.current=!1)};return v(),m.addEventListener("scroll",v,{passive:!0}),()=>{m.removeEventListener("scroll",v)}},[]),(0,k.useLayoutEffect)(()=>{let m=s.current;if(!m)return;let v=c.current!==g;c.current=g,(v||l.current||a.current)&&(m.scrollTo({top:m.scrollHeight,behavior:"auto"}),a.current=!0,l.current=!1)},[Xf,g]),(0,k.useEffect)(()=>()=>{u.current?.abortController.abort(),u.current=null;for(let m of f.current.values())m.timeoutId!==null&&window.clearTimeout(m.timeoutId),m.abortController?.abort();f.current.clear()},[]),(0,k.useEffect)(()=>{if(!M)return;let m=()=>A(null);return document.addEventListener("click",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),()=>{document.removeEventListener("click",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}},[M]),(0,k.useEffect)(()=>{let m=()=>{if(document.visibilityState!=="visible"||!navigator.onLine)return;let v=Date.now();for(let w of f.current.values())w.inFlight||w.nextPollAt!==null&&w.nextPollAt<=v&&w.runPoll&&ep(w,w.runPoll,w.nextPollAt-v)};return window.addEventListener("online",m),document.addEventListener("visibilitychange",m),()=>{window.removeEventListener("online",m),document.removeEventListener("visibilitychange",m)}},[]);function ix(m){if(Jt)return Jt.id;let v=new Date().toISOString(),w=TR(),b={id:w,templateId:e.template.templateId,title:Uf(m||""),createdAt:v,updatedAt:v,lastMessageAt:null,messageCount:0,tracers:tr(Y),messages:[]};return h.current=[b,...h.current],T(F=>[b,...F]),S(w),w}function Zf(m){let v=new Date().toISOString(),w=tr(m?.tracers??Y),b=TR(),F={id:b,templateId:e.template.templateId,title:m?.title||"New chat",createdAt:v,updatedAt:v,lastMessageAt:null,messageCount:0,tracers:w,messages:[]};return h.current=[F,...h.current],T(K=>[F,...K]),m?.activate!==!1&&(S(b),N(""),x([]),j(null)),A(null),b}function kS(){Zf(),bt(!1)}function sx(m){let v=_.find(b=>b.id===m);if(!v||!window.confirm(`Delete conversation "${v.title}"?`))return;let w=_.filter(b=>b.id!==m);h.current=h.current.filter(b=>b.id!==m);for(let[b,F]of f.current.entries())F.threadId===m&&ha(b);T(w),g===m&&S(w[0]?.id??null),j(null),A(null),nx(m)}function ft(m,v){let w=BF(h.current.map(b=>b.id===m?v(b):b));h.current=w,T(w)}function ax(m,v){let w=tr(v);ft(m,F=>({...F,tracers:lS(F.tracers,w),updatedAt:new Date().toISOString()}));let b=h.current.find(F=>F.id===m);b&&Rc({...b,tracers:lS(b.tracers,w),updatedAt:new Date().toISOString()},{tracers:lS(b.tracers,w)})}function NS(m,v){let w=m.trim();return w?h.current.find(b=>!b.hiddenFromView&&b.id!==v&&b.tracers.includes(w))?.id??null:null}function lx(m,v){let w=NS(m);return w||Zf({tracers:[m],title:v?.title||`Tracer ${m}`,activate:v?.activate??!1})}function cx(m){let v=m.toLowerCase();return/(?:own|separate|different|new)\s+(?:tracer\s+and\s+)?chat\s+threads?/.test(v)||/chat\s+threads?.{0,80}(?:own|separate|different|new)\s+tracers?/.test(v)||/each.{0,80}(?:own|separate|different|new).{0,80}chat\s+threads?/.test(v)||/(?:own|separate|different|new)\s+tracers?/.test(v)||/(?:each|every|per|one\s+per).{0,80}(?:own|separate|different|new).{0,80}tracers?/.test(v)||/(?:own|separate|different|new)\s+tracers?.{0,80}(?:each|every|per|outputs?|pieces?|posts?|jobs?|generations?)/.test(v)||/(?:outputs?|pieces?|posts?|jobs?|generations?).{0,80}(?:own|separate|different|new)\s+tracers?/.test(v)}function ux(m){let v=NS(m.tracer,m.sourceThreadId);if(!v&&!m.shouldCreateThread)return null;let w=v??lx(m.tracer,{title:`Tracer ${m.tracer}`,activate:!1});if(!w||w===m.sourceThreadId)return null;let b=$f("assistant"),F=new Date().toISOString(),K=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?Df(m.job):mR(m.job),z=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?null:`Job ${m.job.job_id} is being tracked. ${tp()}`,le={id:b,role:"assistant",text:K,attachments:[],httpExchanges:m.httpExchange?[m.httpExchange]:[],statusText:z,isPending:!1};ft(w,ce=>({...ce,updatedAt:F,messages:[...ce.messages,le]}));let pe=h.current.find(ce=>ce.id===w);return pe&&tx({threadId:w,templateId:pe.templateId,title:pe.title,tracers:pe.tracers,messages:[le]}),{threadId:w,messageId:b}}function dx(m){let v=_.find(F=>F.id===m);if(!v)return;let w=window.prompt("Thread tracers, comma separated",v.tracers.join(", "));if(w===null)return;let b=tr(w.split(","));ft(m,F=>({...F,tracers:b,updatedAt:new Date().toISOString()})),Rc(v,{tracers:b}),A(null)}function fx(m){let v=_.find(F=>F.id===m);if(!v||!window.confirm(`Archive conversation "${v.title}"? Its tracer links will be prefixed with archived_.`))return;let b=tr(v.tracers.map(LF));ft(m,F=>({...F,tracers:b,updatedAt:new Date().toISOString()})),Rc(v,{tracers:b,archived:!0}),A(null)}function px(m){let v=_.find(b=>b.id===m);if(!(!v||!window.confirm(`Remove conversation "${v.title}" from this frontend view? The thread and tracer links stay available; Delete removes the thread completely.`))){for(let[b,F]of f.current.entries())F.threadId===m&&ha(b);if(ft(m,b=>({...b,hiddenFromView:!0,updatedAt:new Date().toISOString()})),g===m){let b=Jf.find(F=>F.id!==m);S(b?.id??null)}A(null),j(null),Rc(v,{hiddenFromView:!0})}}async function mx(m){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(m);else{let v=document.createElement("textarea");v.value=m,v.setAttribute("readonly",""),v.style.position="fixed",v.style.opacity="0",document.body.appendChild(v),v.select(),document.execCommand("copy"),document.body.removeChild(v)}j(null)}catch{j("Unable to copy chat ID.")}finally{A(null)}}function hx(m,v){if(M?.threadId===m){A(null);return}let w=v.getBoundingClientRect(),b=148;A({threadId:m,top:w.bottom+6,left:Math.max(8,Math.min(window.innerWidth-b-8,w.right-b))})}function ha(m){let v=f.current.get(m);v&&(v.timeoutId!==null&&window.clearTimeout(v.timeoutId),v.abortController?.abort(),f.current.delete(m))}function ga(m,v,w){let b=f.current.get(m);b&&ep(b,v,w)}function ep(m,v,w){m.timeoutId!==null&&window.clearTimeout(m.timeoutId);let b=Math.max(SR,w);m.nextPollAt=Date.now()+b,m.timeoutId=window.setTimeout(()=>{m.timeoutId=null,v()},b)}function Yi(){return f.current.size>=gR?mF:hR}function Ki(m=Yi()){if(m>=6e4){let v=Math.round(m/6e4);return`${v} min${v===1?"":"s"}`}return`${Math.round(m/1e3)}s`}function tp(m=Yi()){return f.current.size>=gR?`Many renders are active, so the next check is in ${Ki(m)}.`:`Checking again gently every ${Ki(m)}.`}function gx(){let m=Yi();if(m===hR)return;let v=Date.now();for(let w of f.current.values()){if(w.inFlight||!w.runPoll)continue;(w.nextPollAt===null?0:w.nextPollAt-v)<m&&ep(w,w.runPoll,m)}}function yx(m){let v=Math.max(m,p.current.nextAvailableAt);return p.current.nextAvailableAt=v+hF,v-m}function np(m){let v=_R(m.threadId,m.assistantMessageId,m.jobId);if(f.current.has(v))return;f.current.set(v,{timeoutId:null,abortController:null,runPoll:null,inFlight:!1,nextPollAt:null,lastPollAt:null,attempts:0,threadId:m.threadId});let w=async()=>{let K=f.current.get(v);if(!K||K.inFlight)return;let z=Date.now(),le=Yi();if(K.lastPollAt!==null&&z-K.lastPollAt<le){ga(v,w,le-(z-K.lastPollAt));return}if(K.attempts>=yR){ft(m.threadId,ce=>({...ce,updatedAt:new Date().toISOString(),messages:ce.messages.map(ue=>ue.id===m.assistantMessageId?{...ue,statusText:"Background polling stopped after multiple checks. Open the job route when you want to refresh again."}:ue)})),ha(v);return}if(document.visibilityState!=="visible"||!navigator.onLine){ga(v,w,le);return}let pe=yx(Date.now());if(pe>0){ga(v,w,pe);return}K.inFlight=!0,K.lastPollAt=z,K.nextPollAt=null,K.attempts+=1,K.abortController=new AbortController;try{ft(m.threadId,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>Z.id===m.assistantMessageId?{...Z,statusText:`Job ${m.jobId} is being tracked. ${tp(le)}`}:Z)}));let ce=m.primitiveId||gF(m.sourceRequestUrl)?`/api/v1/primitives/jobs/${encodeURIComponent(m.jobId)}`:`/api/v1/templates/${encodeURIComponent(e.template.templateId)}/jobs/${encodeURIComponent(m.jobId)}`,ue=await fetch(ce,{method:"GET",headers:ut(e.vidfarmApiKey),signal:K.abortController.signal}),cn=await ue.json().catch(()=>null),ya=Object.fromEntries(ue.headers.entries()),W=$i(cn);if(ft(m.threadId,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>{if(Z.id!==m.assistantMessageId)return Z;let ve=pF(Z.httpExchanges,Cc({explanation:`Automatic ${Ki(le)} job status check for ${m.jobId}`,pollJobId:m.jobId,pollMode:"automatic",request:{method:"GET",url:ce,headers:Object.fromEntries(ut(e.vidfarmApiKey).entries())},result:{status:ue.status,statusText:ue.statusText,headers:ya,body:cn}})),ke=W?W.status==="succeeded"?`Render ${W.job_id} succeeded.`:W.status==="failed"||W.status==="cancelled"?`Render ${W.job_id} ${W.status}.${W.error?.message?` ${W.error.message}`:""}`:`Render ${W.job_id} is ${W.status}. Next check in ${Ki(le)}.`:`Render ${m.jobId} checked. Next check in ${Ki(le)}.`;return{...Z,httpExchanges:ve,statusText:ke,text:W&&(W.status==="succeeded"||W.status==="failed"||W.status==="cancelled")?Ic(Z.text,Df(W)):Z.text}})})),W&&(W.status==="succeeded"||W.status==="failed"||W.status==="cancelled")){ha(v);return}}catch(ce){if(ce instanceof DOMException&&ce.name==="AbortError")return;ft(m.threadId,ue=>({...ue,updatedAt:new Date().toISOString(),messages:ue.messages.map(cn=>cn.id===m.assistantMessageId?{...cn,statusText:`Automatic polling paused after an error. It will retry in ${Ki()}.`}:cn)}))}finally{let ce=f.current.get(v);if(!ce)return;ce.inFlight=!1,ce.abortController=null,ce.attempts<yR&&ce.timeoutId===null&&f.current.has(v)&&ga(v,w,Yi())}},b=f.current.get(v);b&&(b.runPoll=w),f.current.get(v)&&(ga(v,w,m.initialDelayMs??Yi()),gx())}function Sx(m){for(let v of m.messages)if(!(v.role!=="assistant"||!v.httpExchanges?.length))for(let w of v.httpExchanges){if(w.request.method!=="POST")continue;let b=$i(w.result.body),F=_R(m.id,v.id,b?.job_id??"");!b||fa(b.status)||f.current.has(F)||v.httpExchanges.some(z=>{let le=$i(z.result.body);return le?.job_id===b.job_id&&fa(le.status)})||np({threadId:m.id,assistantMessageId:v.id,jobId:b.job_id,tracer:b.tracer,initialStatus:b.status,primitiveId:b.primitive_id,sourceRequestUrl:w.request.url,initialDelayMs:SR})}}async function rp(m){if(!m.length)return;j(null);let v=[],w=null;for(let b of m)try{let F=await qR({apiKey:e.vidfarmApiKey,file:b,folderPath:DR}),K=await VR({attachment:F,file:b,currentInlineBytes:GR([...U,...v])});v.push(K)}catch(F){w=F instanceof Error?F.message:"Unable to upload attachment."}w&&v.length===0&&j(w),v.length&&(x(b=>[...b,...v]),w&&j(w))}async function _x(m){let v=Array.from(m.target.files??[]);await rp(v),m.target.value=""}async function vx(m){let v=Array.from(m.clipboardData.files??[]).filter(w=>w.size>0);v.length&&(m.preventDefault(),await rp(v))}async function Ex(m){m.preventDefault(),Q(!1);let v=Array.from(m.dataTransfer.files??[]).filter(w=>w.size>0);v.length&&await rp(v)}async function Tx(m,v,w){let b=w??{},F=e.vidfarmApiKey,K=window.location.origin,z=ut(F,"application/json"),le=ut(F),pe=Z=>new Promise(ve=>setTimeout(ve,Z)),ce=(Z,ve)=>{ft(m,ke=>({...ke,updatedAt:new Date().toISOString(),messages:ke.messages.map(Ne=>Ne.id===v?{...Ne,isPending:!1,statusText:Z??Ne.statusText,text:ve?Ic(Ne.text,ve):Ne.text}:Ne)}))},ue=async Z=>{let ve=await Z.text();try{return ve?JSON.parse(ve):null}catch{return null}},cn=async Z=>{let ve=Date.now()+3e5;for(;;){let ke=await fetch(new URL(`/api/v1/videos/${encodeURIComponent(Z)}`,K),{headers:le}),Ne=await ue(ke),Be=String(Ne?.status??"");if(Be==="ready")return Ne;if(Be==="failed")throw new Error(`source video download failed${Ne?.error?`: ${Ne.error}`:""}.`);if(Date.now()>ve)throw new Error("source video download timed out.");await pe(5e3)}},ya=Z=>{let ve=Ee=>typeof Ee=="string"&&Ee.trim()?Ee.trim():null,ke=Z?.result&&typeof Z.result=="object"?Z.result:{},Ne=ke.output&&typeof ke.output=="object"?ke.output:ke,Be=ve(Ne?.primary_file_url)??ve(Ne?.video?.file_url)??ve(Ne?.image?.file_url)??ve(Ne?.render?.output_url);if(Be)return Be;if(Array.isArray(Ne?.files))for(let Ee of Ne.files){let Le=ve(typeof Ee=="string"?Ee:Ee?.file_url??Ee?.url);if(Le)return Le}if(Array.isArray(Z?.artifacts))for(let Ee of Z.artifacts){let Le=ve(Ee?.public_url);if(Le)return Le}return null},W=async Z=>{let ve=Date.now()+48e4;for(;;){await pe(5e3);let ke=await fetch(new URL(`/api/v1/user/me/jobs/${encodeURIComponent(Z)}`,K),{headers:le}),Ne=await ue(ke),Be=String(Ne?.status??""),Ee=ya(Ne);if(Ee)return Ee;if(Be==="failed"||Be==="cancelled")throw new Error(`generation ${Be}.`);if(Date.now()>ve)throw new Error("generation timed out.")}},Fe=async(Z,ve)=>{let ke=await(await fetch(Z)).blob(),Ne=await fetch(new URL("/discover/templates/upload/presign",K),{method:"POST",headers:z,body:JSON.stringify({file_name:"generated.mp4",content_type:"video/mp4",size_bytes:ke.size})}),Be=await ue(Ne);if(!Ne.ok)throw new Error(Be?.error||`upload presign failed (${Ne.status})`);let Ee=Be?.storage_key,Le=Be?.file_name||"generated.mp4";if(Be?.transport==="presigned"&&Be?.upload?.url){let Oe=await fetch(Be.upload.url,{method:Be.upload.method||"PUT",headers:Be.upload.headers||{},body:ke});if(!Oe.ok)throw new Error(`upload failed (${Oe.status})`)}else{let Oe=new FormData;Oe.append("file",ke,"generated.mp4");let Xt=await fetch(new URL(Be?.upload?.url||"/discover/templates/upload",K),{method:"POST",headers:le,body:Oe}),_t=await ue(Xt);if(!Xt.ok||!_t?.storage_key)throw new Error(_t?.error||`upload failed (${Xt.status})`);Ee=_t.storage_key,Le=_t.file_name||"generated.mp4"}if(!Ee)throw new Error("upload did not return a storage key.");let ho=await fetch(new URL("/discover/templates",K),{method:"POST",headers:z,body:JSON.stringify({upload:{storage_key:Ee,file_name:Le},title:ve,origin:"raw"})}),Ut=await ue(ho);if(!ho.ok)throw new Error(Ut?.error||`ingest failed (${ho.status})`);return Ut};try{if(!F){ce(null,"\u26A0\uFE0F You need to be logged in to create a video.");return}let Z=b.mode==="replicate"?"replicate":b.mode==="generate"?"generate":null,ve,ke;if(Z==="replicate"){let Xt=(b.source_url??"").trim();if(!/^https?:\/\//i.test(Xt)){ce(null,"\u26A0\uFE0F I need a video URL (TikTok/YouTube/Instagram/X) to replicate.");return}ke=(b.instructions??"").trim()||null,ce("Fetching the source video\u2026");let _t=await fetch(new URL("/discover/templates",K),{method:"POST",headers:z,body:JSON.stringify({source_url:Xt})}),Fr=await ue(_t);if(!_t.ok)throw new Error(Fr?.error||`couldn't fetch that URL (${_t.status})`);ve=Fr?.status==="ready"?Fr:await cn(Fr?.inspiration_id)}else if(Z==="generate"){let Xt=(b.prompt??"").trim();if(!Xt){ce(null,"\u26A0\uFE0F Tell me what the video should be about and I'll create it.");return}ke=Xt,ce("Generating your video\u2026 (this can take a couple of minutes)");let _t=await fetch(new URL("/api/v1/primitives/videos/generate",K),{method:"POST",headers:z,body:JSON.stringify({tracer:`chat-create-${Date.now().toString(36)}`,payload:{prompt:Xt}})}),Fr=await ue(_t);if(!_t.ok)throw new Error(Fr?.error||`couldn't start generation (${_t.status})`);let Cx=await W(Fr?.job_id);ce("Building an editable template from the generated video\u2026");let op=await Fe(Cx,Xt.slice(0,80));ve=op?.status==="ready"?op:await cn(op?.inspiration_id)}else{ce(null,"\u26A0\uFE0F I couldn't tell whether to generate a new video or replicate a URL \u2014 try rephrasing.");return}let Ne=ve?.template_id,Be=ve?.inspiration_id;if(!Ne||!Be)throw new Error("the template wasn't created from the video.");ce(Z==="replicate"?"Recreating the scenes\u2026 (about a minute)":"Analyzing into an editable timeline\u2026");let Ee=await fetch(new URL(`/api/v1/inspirations/${encodeURIComponent(Be)}/decompose`,K),{method:"POST",headers:z,body:JSON.stringify({user_prompt:ke})});if(!Ee.ok){let Xt=await ue(Ee);throw new Error(Xt?.error||`scene analysis failed (${Ee.status})`)}ce("Finalizing your editable copy\u2026");let Le=await fetch(new URL("/api/v1/compositions",K),{method:"POST",headers:z,body:JSON.stringify({template_id:Ne})}),ho=await ue(Le);if(!Le.ok)throw new Error(ho?.error||`couldn't create an editable copy (${Le.status})`);let Ut=ho?.fork_id,Oe=`${K}/editor/${encodeURIComponent(Ne)}${Ut?`?fork=${encodeURIComponent(Ut)}`:""}`;ce("Your video is ready.",`\u2705 Your video is ready \u2014 [Open it in the editor](${Oe}).`)}catch(Z){ce(null,`\u26A0\uFE0F I couldn't finish creating the video: ${Z instanceof Error?Z.message:String(Z)}`)}}async function AS(){if(!CS)return;l.current=!0;let m=ix(I),v=new Date().toISOString(),w=h.current.find(pe=>pe.id===m),b={id:$f("user"),role:"user",text:I.trim(),attachments:U},F={id:$f("assistant"),role:"assistant",text:"",attachments:[],statusText:"Waiting for AI response\u2026",isPending:!0},K=w?.messages??[],z=RF([...K,b]);ft(m,pe=>({...pe,title:pe.messages.length===0?Uf(b.text):pe.title,updatedAt:v,messages:[...pe.messages,b,F]})),N(""),x([]),j(null),X(m),fe("Waiting for AI response\u2026");let le=new AbortController;u.current={abortController:le,threadId:m,assistantMessageId:F.id};try{let pe=JSON.stringify({messages:bF(z),thread_id:m,thread_template_id:w?.templateId??e.template.templateId,thread_title:K.length===0?Uf(b.text):w?.title??Uf(b.text),thread_tracers:Kf,client_context:tF(),user_message:{id:b.id,role:b.role,text:b.text,attachments:b.attachments.map(W=>({id:W.id,fileName:W.fileName,contentType:W.contentType,viewUrl:W.viewUrl}))},assistant_message:{id:F.id},template:{...e.template,tracers:Kf,defaultRequestTracer:IS,activeTracer:IS},cached_context:{...e.cachedContext,...kF(),...NF()}});Or("chat.send.attempt",{thread_id:m,template_id:e.template.templateId,message_count:z.length,attachment_count:b.attachments.length,text_length:b.text.length});let ce=Date.now(),ue=await fetch(e.apiUrl||"/api/v1/editor-chat",{method:"POST",headers:ut(e.vidfarmApiKey,"application/json"),signal:le.signal,body:pe});if(!ue.ok){let W=await ue.json().catch(()=>({}));throw po("chat.send.rejected",{thread_id:m,status:ue.status,error:typeof W?.error=="string"?W.error:null}),new Error(typeof W?.error=="string"?W.error:`Chat failed with status ${ue.status}.`)}Or("chat.send.stream_open",{thread_id:m,latency_ms:Date.now()-ce});let cn=new Map,ya=cx(b.text);await AF(ue,{onDelta:W=>{fe("AI is responding\u2026"),ft(m,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>Z.id===F.id?{...Z,text:`${Z.text}${W}`,statusText:"AI is responding\u2026",isPending:!1}:Z)}))},onStatus:W=>{fe(W),ft(m,Fe=>({...Fe,messages:Fe.messages.map(Z=>Z.id===F.id?{...Z,statusText:W,isPending:!Z.text}:Z)}))},onToolCall:W=>{cn.set(W.toolCallId,{toolName:W.toolName,args:W.args}),ft(m,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>Z.id===F.id?{...Z,toolExchanges:[...Z.toolExchanges??[],{toolCallId:W.toolCallId,toolName:W.toolName,args:ji(W.args),status:"pending"}]}:Z)}))},onToolResult:W=>{let Fe=UR(W.result),Z=cn.get(W.toolCallId);if(W.toolName==="create_video"&&Tx(m,F.id,W.result),W.toolName==="frontend_action"){let Ee=W.result;if(Ee?.action==="add_tracer")bS(Ee.tracer??void 0);else if(Ee?.action==="remove_tracer"&&Ee.tracer)ox(Ee.tracer);else if(Ee?.action==="activate_tracer"&&Ee.tracer)rx(Ee.tracer);else if(Ee?.action==="create_thread"){let Le=Ee.tracer?bS(Ee.tracer):xS();Zf({tracers:Le?[Le]:[],title:Le?`Tracer ${Le}`:"New chat",activate:!1})}}let ve=W.result,ke=$i(ve?.response?.body),Ne=ve?.request&&ve?.response?Cc({explanation:ve.explanation??null,request:ve.request,result:ve.response}):void 0,Be=ve?.request?.method==="POST"&&ke?.tracer?ux({sourceThreadId:m,tracer:ke.tracer,job:ke,httpExchange:Ne,shouldCreateThread:ya}):null;Be&&ke&&!fa(ke.status)&&np({threadId:Be.threadId,assistantMessageId:Be.messageId,jobId:ke.job_id,tracer:ke.tracer,initialStatus:ke.status,primitiveId:ke.primitive_id,sourceRequestUrl:ve?.request?.url}),ft(m,Ee=>({...Ee,updatedAt:new Date().toISOString(),messages:Ee.messages.map(Le=>{if(Le.id!==F.id)return Le;let ho=(Le.toolExchanges??[]).map(_t=>_t.toolCallId===W.toolCallId?{..._t,result:Fe,status:typeof W.result?.error=="string"?"error":"complete"}:_t),Ut=W.result,Oe=$i(Ut?.response?.body),Xt=Ut?.request&&Ut?.response?[...Le.httpExchanges??[],Cc({explanation:Ut.explanation??null,request:Ut.request,result:Ut.response})]:Le.httpExchanges;if(Z&&cn.delete(W.toolCallId),Ut?.request?.method==="POST"&&Oe?.tracer){let _t=window.__vidfarmEditorTracers;_t?_t.add(Oe.tracer):ma([Oe.tracer,...Y.filter(Fr=>Fr!==Oe.tracer)]),ax(m,[Oe.tracer])}return Oe&&!Be&&!fa(Oe.status)&&np({threadId:m,assistantMessageId:F.id,jobId:Oe.job_id,tracer:Oe.tracer,initialStatus:Oe.status,primitiveId:Oe.primitive_id,sourceRequestUrl:Ut?.request?.url}),{...Le,toolExchanges:ho,httpExchanges:Xt,statusText:Oe&&!fa(Oe.status)?`Job ${Oe.job_id} is being tracked. ${tp()}`:Le.statusText,isPending:!1,text:Oe&&Ut?.request?.method==="POST"&&Ut?.response?.status===202?Ic(Le.text,mR(Oe)):Oe&&fa(Oe.status)||Oe?Ic(Le.text,Df(Oe)):Le.text}})}))},onError:W=>{po("chat.stream.error",{thread_id:m,message:W}),j(W),fe(null),ft(m,Fe=>({...Fe,messages:Fe.messages.filter(Z=>Z.id!==F.id)}))}}),Or("chat.stream.completed",{thread_id:m,duration_ms:Date.now()-ce}),ft(m,W=>({...W,updatedAt:new Date().toISOString(),messages:W.messages.map(Fe=>Fe.id===F.id?{...Fe,statusText:Fe.statusText?.includes("being tracked")?Fe.statusText:null,isPending:!1}:Fe)}))}catch(pe){if(pe instanceof DOMException&&pe.name==="AbortError"){nR("chat.send.aborted",{thread_id:m}),j(null),fe(null),ft(m,ce=>({...ce,updatedAt:new Date().toISOString(),messages:ce.messages.map(ue=>ue.id!==F.id?ue:!!(ue.text.trim()||ue.toolExchanges?.length||ue.httpExchanges?.length)?{...ue,statusText:"Stopped.",isPending:!1}:{...ue,text:"Stopped.",statusText:null,isPending:!1})}));return}po("chat.send.failed",{thread_id:m,message:pe instanceof Error?pe.message:String(pe)}),j(pe instanceof Error?pe.message:"Unable to send chat message."),fe(null),ft(m,ce=>({...ce,messages:ce.messages.map(ue=>ue.id===F.id?{...ue,text:pe instanceof Error?`Error: ${pe.message}`:"Error: Unable to send chat message.",statusText:null,isPending:!1}:ue)}))}finally{u.current?.assistantMessageId===F.id&&(u.current=null),X(pe=>pe===m?null:pe),fe(null)}}function Ix(){fe("Stopping\u2026");let m=u.current;m&&ft(m.threadId,v=>({...v,updatedAt:new Date().toISOString(),messages:v.messages.map(w=>w.id===m.assistantMessageId?{...w,statusText:"Stopping\u2026"}:w)})),u.current?.abortController.abort()}(0,k.useEffect)(()=>()=>{u.current?.abortController.abort();for(let m of f.current.keys())ha(m);try{o?.setItem(r.threads,JSON.stringify(wR(Se.current,Ur.current)))}catch{}},[o,r]);function wx(m){m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),AS())}let MS=(0,d.jsx)("div",{className:`vf-editor-chat-thread-list${t?" vf-editor-chat-thread-list-sidebar":""}`,role:"tablist","aria-label":"Conversation threads",children:Jf.length?Jf.map(m=>(0,d.jsxs)("div",{role:"tab","aria-selected":m.id===g,className:"vf-editor-chat-thread-chip","data-active":m.id===g?"true":"false",children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-chat-thread-chip-main",onClick:()=>{S(m.id),j(null),A(null),bt(!1)},children:[(0,d.jsx)("span",{className:"vf-editor-chat-thread-chip-title",children:m.title}),m.tracers.length?(0,d.jsxs)("span",{className:"vf-editor-chat-thread-chip-tracers",children:[m.tracers.slice(0,2).join(", "),m.tracers.length>2?` +${m.tracers.length-2}`:""]}):null]}),(0,d.jsx)("div",{className:"vf-editor-chat-thread-menu-wrap",children:(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-thread-chip-menu","aria-label":`Actions for ${m.title}`,onClick:v=>{v.stopPropagation(),hx(m.id,v.currentTarget)},children:"..."})})]},m.id)):(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Start a chat to create your first conversation thread."})});return(0,d.jsxs)("div",{className:"vf-editor-chat-shell","data-mobile-open":ae?"true":"false","data-mobile-expanded":Te?"true":"false","data-layout":t?"brainstorm":"default",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-mobile-fab","aria-label":"Open chat","aria-expanded":ae,onClick:()=>{St(!1),Re(!0)},children:(0,d.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(0,d.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"})})}),H?(0,d.jsx)("div",{className:"vf-editor-chat-error",role:"status",children:H}):null,(0,d.jsxs)("div",{className:`${t?"vf-editor-chat-body vf-editor-chat-brainstorm-layout":"vf-editor-chat-body"}${n?" has-sidebar":""}`,"data-history-open":ot||it?"true":"false",children:[n?(0,d.jsxs)("aside",{className:"vf-editor-chat-history-pane",children:[(0,d.jsx)("div",{className:"vf-editor-chat-history-header",children:(0,d.jsxs)("div",{className:"vf-editor-chat-history-header-main",children:[(0,d.jsxs)("a",{className:"vf-editor-chat-back-button",href:"/discover","aria-label":"Back to Discover",children:[(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})}),"Discover"]}),(0,d.jsx)("div",{className:"vf-editor-chat-history-kicker",children:"Chat history"})]})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread vf-editor-chat-new-thread-sidebar",onClick:kS,children:"New chat"}),MS]}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-thread",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-header",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-header-row",children:[(0,d.jsx)("a",{className:"vf-editor-chat-back-button vf-editor-chat-back-button--header",href:"/discover","aria-label":"Back to Discover",children:(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-history-icon","aria-label":ot?"Back to chat":"Open chat history","aria-pressed":ot,onClick:()=>{bt(m=>!m),In(!1)},children:ot?(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"10",cy:"10",r:"7.2"}),(0,d.jsx)("path",{d:"M10 6v4l2.6 1.6"})]})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-history-icon vf-editor-chat-branches-icon","aria-label":it?"Back to chat":"Open template forks","aria-pressed":it,onClick:()=>{In(m=>!m),bt(!1)},children:it?(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"5.5",cy:"4.5",r:"1.9"}),(0,d.jsx)("circle",{cx:"5.5",cy:"15.5",r:"1.9"}),(0,d.jsx)("circle",{cx:"14.5",cy:"8",r:"1.9"}),(0,d.jsx)("path",{d:"M5.5 6.4v7.2"}),(0,d.jsx)("path",{d:"M5.5 13.6c0-3.2 2.4-3.6 4.4-3.9 2-.3 4.6-.5 4.6-3.7"})]})}),(0,d.jsxs)("div",{className:"vf-editor-chat-header-titles",children:[(0,d.jsx)("div",{className:"vf-editor-chat-header-title",children:"Vidfarm"}),(0,d.jsx)("div",{className:"vf-editor-chat-header-subtitle",children:ot?"Chat history":it?"Template forks":e.template.templateTitle})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread",onClick:kS,children:"New chat"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-expand","aria-label":Te?"Shrink chat":"Expand chat","aria-pressed":Te,onClick:()=>St(m=>!m),children:Te?(0,d.jsxs)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M16.5 8.5h-5v-5"}),(0,d.jsx)("path",{d:"M11.5 8.5 17 3"}),(0,d.jsx)("path",{d:"M3.5 11.5h5v5"}),(0,d.jsx)("path",{d:"M8.5 11.5 3 17"})]}):(0,d.jsxs)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M11.5 3.5h5v5"}),(0,d.jsx)("path",{d:"M16.5 3.5 11 9"}),(0,d.jsx)("path",{d:"M8.5 16.5h-5v-5"}),(0,d.jsx)("path",{d:"M3.5 16.5 9 11"})]})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-minimize","aria-label":"Minimize chat",onClick:()=>Re(!1),children:"\xD7"})]}),M&&qi?(0,Wi.createPortal)((0,d.jsxs)("div",{className:"vf-editor-chat-thread-menu",role:"menu",style:{top:M.top,left:M.left},onClick:m=>m.stopPropagation(),children:[(0,d.jsx)("button",{type:"button",onClick:()=>mx(qi.id),children:"Copy Chat ID"}),(0,d.jsx)("button",{type:"button",onClick:()=>dx(qi.id),children:"Edit tracers"}),(0,d.jsx)("button",{type:"button",onClick:()=>px(qi.id),children:"Remove from view"}),(0,d.jsx)("button",{type:"button",onClick:()=>fx(qi.id),children:"Archive thread"}),(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>sx(qi.id),children:"Delete"})]}),document.body):null]}),(0,d.jsx)("div",{className:"vf-editor-chat-viewport",ref:s,children:ot?(0,d.jsx)("div",{className:"vf-editor-chat-history-panel",children:MS}):it?(0,d.jsxs)("div",{className:"vf-editor-chat-history-panel vf-editor-chat-branches-panel",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-branches-header",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-branches-header-main",children:[(0,d.jsx)("div",{className:"vf-editor-chat-branches-kicker",children:"Forks"}),(0,d.jsxs)("div",{className:"vf-editor-chat-branches-title",children:[Dt?.length??0," fork",(Dt?.length??0)===1?"":"s"," of this template"]})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-branches-refresh",onClick:()=>{Je({force:!0})},disabled:nr,"aria-label":"Refresh forks",children:nr?"Loading\u2026":"Refresh"})]}),Zo?(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",role:"status",children:Zo}):nr&&!Dt?(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Loading forks\u2026"}):Dt&&Dt.length?(0,d.jsx)("div",{className:"vf-editor-chat-thread-list",children:Dt.map(m=>{let v=$e===m.forkId,w=`/editor/${encodeURIComponent(e.template.templateId)}?fork=${encodeURIComponent(m.forkId)}`,b=m.title&&m.title.trim()?m.title:m.forkId,F=m.parentForkId?` \xB7 forked from ${m.parentForkId.slice(0,12)}${m.parentVersion?`#v${m.parentVersion}`:""}`:"",K=m.latestVersion&&m.latestVersion>0?` \xB7 v${m.latestVersion}`:"";return(0,d.jsx)("div",{role:"listitem",className:"vf-editor-chat-thread-chip","data-active":v?"true":"false",children:(0,d.jsxs)("a",{className:"vf-editor-chat-thread-chip-main vf-editor-chat-branch-chip-link",href:w,target:"_blank",rel:"noopener noreferrer",children:[(0,d.jsxs)("span",{className:"vf-editor-chat-thread-chip-title",children:[b,v?(0,d.jsx)("span",{className:"vf-editor-chat-branch-current-badge",children:"current"}):null]}),(0,d.jsxs)("span",{className:"vf-editor-chat-thread-chip-tracers",children:[m.visibility??"private",K,F]})]})},m.forkId)})}):(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"No forks yet for this template."})]}):Xf.length?Xf.map(m=>(0,d.jsx)(XF,{message:m},m.id)):g&&E===g?(0,d.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,d.jsx)("div",{className:"vf-editor-chat-kicker",children:"Loading chat"}),(0,d.jsxs)("h2",{children:["Opening ",g]})]}):(0,d.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,d.jsx)("div",{className:"vf-editor-chat-kicker",children:"AI Copilot"}),(0,d.jsx)("h2",{children:t?"Start a new chat.":"Repurpose this video."}),(0,d.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 brainstorm tools to turn this video into a native ad for your product, spot product-placement opportunities, and shape the timeline you can actually test. 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,d.jsx)("div",{className:"vf-editor-chat-empty-prompts","aria-label":"Example prompts",children:t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{children:"I don't know where to start"}),(0,d.jsx)("div",{children:"Help me think of persuasive angles"}),(0,d.jsx)("div",{children:"Help me think of viral hooks"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{children:"I don't know where to start"}),(0,d.jsx)("div",{children:"Repurpose this video into a social media native ad for my product"}),(0,d.jsx)("div",{children:"Help me identify product placement opportunities in this video for my product"})]})})]})}),(0,d.jsx)("div",{className:"vf-editor-chat-footer",hidden:ot||it,children:(0,d.jsxs)("div",{className:"vf-editor-chat-composer","data-drop-target":ye?"true":"false",onDragEnter:m=>{m.preventDefault(),Q(!0)},onDragOver:m=>{m.preventDefault(),ye||Q(!0)},onDragLeave:m=>{m.preventDefault();let v=m.relatedTarget;v instanceof Node&&m.currentTarget.contains(v)||Q(!1)},onDrop:m=>{Ex(m)},children:[ye?(0,d.jsx)("div",{className:"vf-editor-chat-dropzone-hint",children:"Drop files to attach"}):null,U.length?(0,d.jsx)("div",{className:"vf-editor-chat-composer-attachments-strip",children:U.map(m=>(0,d.jsx)(GF,{attachment:m,onRemove:()=>x(v=>v.filter(w=>w.id!==m.id))},m.id))}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-composer-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-attach-button","aria-label":"Open upload drawer",onClick:()=>ie(!0),children:"\u{1F4CE}"}),(0,d.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:I,onChange:m=>N(m.target.value),onKeyDown:wx,onPaste:m=>{vx(m)}}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-send-button",onClick:()=>{if(Qf){Ix();return}AS()},disabled:Qf?!1:!CS,children:Qf?"Stop":"Send"})]}),(0,d.jsx)("input",{ref:i,type:"file",accept:"image/*,video/*,audio/*,application/pdf,text/plain,text/markdown",multiple:!0,hidden:!0,onChange:m=>{_x(m)}})]})})]})]}),(0,d.jsx)(ZF,{apiKey:e.vidfarmApiKey,open:V,onClose:()=>ie(!1),onConfirm:m=>x(v=>[...v,...m])})]})}var Tn=Cn(Tc(),1);rR();function eB(){let e=document.getElementById("page-runtime-boot");return e?.textContent?JSON.parse(e.textContent):null}function qf(e){let t=new Date;return t.setDate(t.getDate()+e),t.toISOString()}async function tB(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:qf(-7),end_date:qf(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||qf(-7),rangeEnd:o.endDate||qf(30),replaceRange:!0}),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated")))}function nB({boot:e}){let t=(0,Gi.useMemo)(()=>lR(e),[e]),n=tR(t,i=>i.boot.title),[r,o]=(0,Gi.useState)(null);return(0,Gi.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,Gi.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,QR.createPortal)((0,Tn.jsx)(Ds,{fallback:(0,Tn.jsx)(rB,{}),children:(0,Tn.jsx)(XR,{boot:e.editorChat})}),r):null}function rB(){return(0,Tn.jsxs)("div",{style:{display:"grid",placeItems:"center",height:"100%",padding:"24px",textAlign:"center",gap:"12px",color:"#5c6a82"},children:[(0,Tn.jsx)("div",{style:{fontSize:"0.72rem",fontWeight:800,letterSpacing:"0.14em",textTransform:"uppercase"},children:"Chat error"}),(0,Tn.jsx)("div",{style:{fontSize:"0.92rem"},children:"Something went wrong loading the chat. Reload the page to try again."}),(0,Tn.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 Qo=eB(),ES=document.getElementById("page-runtime-root"),TS=aR(Qo?.userId??null),Yf=null;function ex(e={}){return!e.force&&Yf||(Yf=tB({userId:Qo?.userId??null,store:TS,force:e.force}).catch(()=>{})),Yf}window.__vidfarmFlockPosterCache={readSnapshot:()=>nS(Qo?.userId??null),ensureHydrated:ex,setChannelsData:e=>{TS.getState().setChannelsData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))},setCalendarData:e=>{TS.getState().setCalendarData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))}};ex();Or("page_runtime.boot",{has_boot:!!Qo,has_root:!!ES,page_kind:Qo?.pageKind??null,editor_chat_template_id:Qo?.editorChat?.template?.templateId??null});Qo&&ES&&(0,ZR.createRoot)(ES).render((0,Tn.jsx)(Ds,{fallback:(0,Tn.jsx)(Tn.Fragment,{}),onError:e=>po("page_runtime.render_error",{message:e instanceof Error?e.message:String(e)}),children:(0,Tn.jsx)(nB,{boot:Qo})}));
45
+ `).map(h=>h.trim()).find(h=>h.startsWith("data:"));if(!c)continue;let u=c.slice(5).trim();if(u==="[DONE]")continue;let f;try{f=JSON.parse(u)}catch{continue}if(!f||typeof f!="object")continue;let p=f;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 PF(e){return{threads:`vidfarm-editor-chat-threads:${e}`,activeThread:`vidfarm-editor-chat-active-thread:${e}`}}function LF(){if(typeof window>"u")return null;try{return window.sessionStorage}catch{try{return window.localStorage}catch{return null}}}function IR(){return`thread-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function $f(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 tr(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 lS(...e){return tr(e.flat())}function OF(e){let t=e.trim();return!t||t.startsWith("archived_")?t:`archived_${t}`}function fS(){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 DF(e){return(e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tracer").slice(0,28)}function UF(e,t){let n=DF(e),r="";do r=`${n}-${fS()}`;while(t.includes(r));return r}function FF(e,t){let n=e.trim();if(!n)return"";if(/-[a-z0-9]{8}$/i.test(n))return n;let r=`${n}-${fS()}`;for(;t.includes(r);)r=`${n}-${fS()}`;return r}function zf(){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 tr(n)}function wR(){let e=new URLSearchParams(window.location.search);return(e.get("thread_id")||e.get("threadId")||e.get("chat_id")||e.get("chatId")||"").trim()}function Uf(e){let t=e.trim().replace(/\s+/g," ");return t?t.length>42?`${t.slice(0,42).trimEnd()}\u2026`:t:"New chat"}function CR(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(-tF):[]).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:ji(o.args),result:FR(o.result)})),httpExchanges:r.httpExchanges?.map(Cc)}))}))}function BF(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:tr(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 RR(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:tr(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 xR(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 HF(e){return[...e].sort((t,n)=>Date.parse(n.updatedAt)-Date.parse(t.updatedAt))}function wc(e,t){return t.length?e.tracers.some(n=>t.some(r=>$F(n,r))):!0}function $F(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 zF(e){return(0,d.jsxs)("div",{className:"vf-editor-chat-attachment",children:[(0,d.jsx)("span",{className:"vf-editor-chat-attachment-name",children:e.attachment.fileName}),e.onRemove?(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-attachment-remove","aria-label":"Remove attachment",onClick:e.onRemove,children:"\xD7"}):null]})}function yS(){return(0,d.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,d.jsx)("path",{d:"M10 3v9"}),(0,d.jsx)("path",{d:"m6.5 8.5 3.5 3.5 3.5-3.5"}),(0,d.jsx)("path",{d:"M4 16h12"})]})}function jF(){return(0,d.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,d.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,d.jsx)("path",{d:"m10.7 11.6 5.2-5.2a1.9 1.9 0 0 0-2.7-2.7L8 8.9"}),(0,d.jsx)("path",{d:"m7.9 9 3.1 3.1"}),(0,d.jsx)("path",{d:"M3.5 16.5c1.4.5 3.6.5 4.9-.8"})]})}function SS(){return(0,d.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,d.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,d.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 _S(){return(0,d.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,d.jsx)("rect",{x:"7",y:"7",width:"9",height:"9",rx:"2"}),(0,d.jsx)("path",{d:"M5 12H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1"})]})}function Ff(e){return(0,d.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,d.jsx)("path",{d:"m7 4 6 6-6 6"})})}function KR(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 bR(e,t=!1){if(typeof window>"u"||e.kind!=="image"||!e.url)return"";let n=new URL("/tools/image",window.location.origin),r=window.__vidfarmEditorTracers,i=(r?.get()??zf())[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||KR(e)),n.toString()}function WF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.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,k.useState)(a),u=s[l]||e.preview,f=s.length>1,p=u.kind==="image",h=p&&bR(u,!1)||"/tools/image";(0,k.useEffect)(()=>{n(!0)},[]),(0,k.useEffect)(()=>{o("")},[u.url]);let y=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 g=bR(u,!0);if(!g){T.preventDefault();return}T.preventDefault(),window.open(g,"_blank","noopener,noreferrer")};return(0,k.useEffect)(()=>{let T=g=>{if(g.key==="Escape"){i();return}f&&(g.key==="ArrowLeft"?(g.preventDefault(),c(S=>(S-1+s.length)%s.length)):g.key==="ArrowRight"&&(g.preventDefault(),c(S=>(S+1)%s.length)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[f,s.length,i]),t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal",onClick:T=>T.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:u.url,target:"_blank",rel:"noopener noreferrer",children:f?`${u.label} (${l+1} of ${s.length})`:u.label}),(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[f?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.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,d.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,d.jsx)(jF,{})}):null,(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:u.url,download:KR(u),"aria-label":"Download media",title:"Download",children:(0,d.jsx)(yS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{y()},"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,d.jsx)(SS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close media preview",title:"Close",children:"\xD7"})]})]}),(0,d.jsx)("div",{className:"vf-editor-chat-media-modal-body",children:u.kind==="image"?(0,d.jsx)("img",{src:u.url,alt:u.label,className:"vf-editor-chat-media-modal-image"}):(0,d.jsx)("video",{src:u.url,className:"vf-editor-chat-media-modal-video",controls:!0,autoPlay:!0,playsInline:!0})})]})}),document.body):null}function GF(e){let[t,n]=(0,k.useState)(!1);return(0,d.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,d.jsx)("span",{className:"vf-editor-chat-message-thumb-fallback",children:"Preview unavailable"}):(0,d.jsx)("img",{src:e.preview.url,alt:e.preview.label,className:"vf-editor-chat-message-attachment-thumb",loading:"lazy",onError:()=>n(!0)})})}function kR(e){return(0,d.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,d.jsxs)("button",{type:"button",className:"vf-editor-chat-message-thumb-button",onClick:()=>e.onOpenModal(e.preview),"aria-label":`Preview ${e.preview.label}`,children:[(0,d.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,d.jsx)("span",{className:"vf-editor-chat-message-video-play","aria-hidden":"true"})]})})}function NR(e){return e.previews.length?(0,d.jsx)("div",{className:"vf-editor-chat-message-image-rail","aria-label":"Image previews",children:e.previews.map(t=>(0,d.jsx)(GF,{preview:t,previews:e.previews,onOpenModal:e.onOpenModal},t.url))}):null}function VF(e){return(0,d.jsxs)("div",{className:"vf-editor-chat-composer-attachment-item",children:[jf(e.attachment)?(0,d.jsx)("img",{src:e.attachment.viewUrl,alt:e.attachment.fileName,className:"vf-editor-chat-composer-attachment-thumb"}):(0,d.jsx)("div",{className:"vf-editor-chat-composer-attachment-file","aria-hidden":"true",children:e.attachment.fileName.slice(0,1).toUpperCase()}),(0,d.jsx)("div",{className:"vf-editor-chat-composer-attachment-meta",children:(0,d.jsx)("span",{className:"vf-editor-chat-composer-attachment-name",children:e.attachment.fileName})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-composer-attachment-remove","aria-label":`Remove ${e.attachment.fileName}`,onClick:e.onRemove,children:"\xD7"})]})}function qF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),i=Bf(e.exchange.request.body),s=Bf(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,k.useEffect)(()=>{o(!0)},[]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-card",children:(0,d.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,d.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,d.jsx)("span",{className:"vf-editor-chat-http-url",title:a,children:l}),(0,d.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,d.jsx)("span",{className:"vf-editor-chat-http-expand","aria-hidden":"true",children:"+"})]})}),r&&t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-http-modal-backdrop",onClick:()=>n(!1),children:(0,d.jsxs)("div",{className:"vf-editor-chat-http-modal",onClick:f=>f.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-http-modal-header",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-http-modal-header-main",children:[(0,d.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,d.jsx)("span",{className:"vf-editor-chat-http-modal-url",children:a}),(0,d.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,d.jsx)("button",{type:"button",className:"vf-editor-chat-http-modal-close",onClick:()=>n(!1),"aria-label":"Close HTTP details",children:"\xD7"})]}),(0,d.jsxs)("div",{className:"vf-editor-chat-http-card-body is-modal",children:[e.exchange.explanation?(0,d.jsx)("div",{className:"vf-editor-chat-http-note",children:e.exchange.explanation}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"URL"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:a})]}),i?(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"Request"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:i})]}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"Response"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:e.exchange.result.error||s||"(empty)"})]}),Object.keys(e.exchange.result.headers).length?(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"Headers"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:Bf(e.exchange.result.headers)})]}):null]})]})}),document.body):null]})}function AR(e){return typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"?String(e):e===null?"null":JSON.stringify(e)}function vS(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 Dr(e){return(0,d.jsxs)("div",{className:"vf-editor-chat-json-line",style:{paddingLeft:`${e.depth*18+12}px`},children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-copy","aria-label":"Copy line",title:"Copy line",onClick:()=>e.onCopy(e.text),children:(0,d.jsx)(_S,{})}),(0,d.jsx)("span",{className:"vf-editor-chat-json-line-text",children:e.text})]})}function pS(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,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Expand JSON block",children:(0,d.jsx)(Ff,{open:!1})}),(0,d.jsx)(Dr,{text:`${e.linePrefix??""}[ \u2026 ]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Collapse JSON block",children:(0,d.jsx)(Ff,{open:!0})}),(0,d.jsx)(Dr,{text:i,depth:e.depth,onCopy:e.onCopy})]}),t.map((s,a)=>(0,d.jsx)(pS,{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,d.jsx)(Dr,{text:`]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsx)(Dr,{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,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Expand JSON block",children:(0,d.jsx)(Ff,{open:!1})}),(0,d.jsx)(Dr,{text:`${e.linePrefix??""}{ \u2026 }${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Collapse JSON block",children:(0,d.jsx)(Ff,{open:!0})}),(0,d.jsx)(Dr,{text:s,depth:e.depth,onCopy:e.onCopy})]}),r.map(([a,l],c)=>{let u=`${JSON.stringify(a)}: `;return l&&typeof l=="object"?(0,d.jsx)(pS,{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,d.jsx)(Dr,{text:`${u}${AR(l)}${c===r.length-1?"":","}`,depth:e.depth+1,onCopy:e.onCopy},`${o}:${a}`)}),(0,d.jsx)(Dr,{text:`}${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsx)(Dr,{text:`${e.linePrefix??""}{}${n}`,depth:e.depth,onCopy:e.onCopy})}return(0,d.jsx)(Dr,{text:`${e.linePrefix??""}${AR(t)}${n}`,depth:e.depth,onCopy:e.onCopy})}function JR(e){let[t,n]=(0,k.useState)(new Set),[r,o]=(0,k.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 vS(a),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1400)};return(0,d.jsxs)("div",{className:"vf-editor-chat-json-viewer",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-toolbar",children:[(0,d.jsx)("span",{className:"vf-editor-chat-json-file",children:e.storageKey}),(0,d.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,d.jsx)("div",{className:"vf-editor-chat-json-scroll",children:(0,d.jsx)(pS,{value:e.value,depth:0,path:"root",collapsedPaths:t,togglePath:i,onCopy:s})})]})}function YF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),i=zR(e.artifact.url,`${e.artifact.label}.json`),s=Bf(e.data);(0,k.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await vS(s),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,k.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,d.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,d.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,d.jsx)(_S,{})}),(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,download:i,title:"Download JSON","aria-label":"Download JSON",children:(0,d.jsx)(yS,{})}),(0,d.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,d.jsx)(SS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close JSON preview",title:"Close",children:"\xD7"})]})]}),(0,d.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,d.jsx)(JR,{value:e.data,storageKey:e.artifact.label})})]})}),document.body):null}function KF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)(null),[c,u]=(0,k.useState)(!1),f=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).json();s(_)}catch(y){l(y instanceof Error?y.message:"Unable to load JSON artifact.")}finally{u(!1)}}},p=()=>{let y=!t;n(y),y&&f()},h=()=>{f(),o(!0)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:"JSON result"}),(0,d.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview JSON"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,d.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,d.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading JSON\u2026"}):a?(0,d.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,d.jsx)(JR,{value:i,storageKey:e.artifact.label}):null}):null]}),r&&i!==null?(0,d.jsx)(YF,{artifact:e.artifact,data:i,onClose:()=>o(!1)}):null]})}function XR(e){return e.format==="markdown"?(0,d.jsx)("div",{className:"vf-editor-chat-doc-markdown",dangerouslySetInnerHTML:{__html:HR(e.text)}}):(0,d.jsx)("pre",{className:"vf-editor-chat-doc-pre",children:e.text})}function JF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),i=e.artifact.format==="markdown"?".md":".txt",s=zR(e.artifact.url,`${e.artifact.label}${i}`);(0,k.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await vS(e.text),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,k.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,d.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,d.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,d.jsx)(_S,{})}),(0,d.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,d.jsx)(yS,{})}),(0,d.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,d.jsx)(SS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close document preview",title:"Close",children:"\xD7"})]})]}),(0,d.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,d.jsx)("div",{className:"vf-editor-chat-doc-viewer",children:(0,d.jsx)(XR,{text:e.text,format:e.artifact.format})})})]})}),document.body):null}function XF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)(null),[c,u]=(0,k.useState)(!1),f=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).text();s(_)}catch(y){l(y instanceof Error?y.message:"Unable to load document artifact.")}finally{u(!1)}}},p=()=>{let y=!t;n(y),y&&f()},h=()=>{f(),o(!0)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:e.artifact.format==="markdown"?"Markdown result":"Text result"}),(0,d.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,d.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,d.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading document\u2026"}):a?(0,d.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,d.jsx)("div",{className:"vf-editor-chat-doc-viewer is-inline",children:(0,d.jsx)(XR,{text:i,format:e.artifact.format})}):null}):null]}),r&&i!==null?(0,d.jsx)(JF,{artifact:e.artifact,text:i,onClose:()=>o(!1)}):null]})}var QF=(0,k.memo)(function(t){let n=t.message.role==="assistant",r=t.message.text.trim().length>0,o=r?HR(t.message.text):"",[i,s]=(0,k.useState)(null),a=t.message.attachments.filter(jf),l=t.message.attachments.filter(uS),c=t.message.attachments.filter(_=>!jf(_)&&!uS(_)),u=r?lF(t.message.text,t.message.attachments.map(_=>_.viewUrl)):[],f=u.filter(_=>_.kind==="image"),p=u.filter(_=>_.kind==="video"),h=(t.message.httpExchanges??[]).flatMap(_=>{let T=$i(_.result.body);return T?WR(T):[]}).filter((_,T,g)=>g.findIndex(S=>S.url===_.url)===T),y=(t.message.httpExchanges??[]).flatMap(_=>{let T=$i(_.result.body);return T?GR(T):[]}).filter((_,T,g)=>g.findIndex(S=>S.url===_.url)===T);return(0,d.jsxs)("div",{className:`vf-editor-chat-message ${n?"is-assistant":"is-user"}`,children:[(0,d.jsx)("div",{className:"vf-editor-chat-message-meta",children:n?"Copilot":"You"}),(0,d.jsxs)("div",{className:"vf-editor-chat-bubble","data-pending":t.message.isPending?"true":"false",children:[t.message.attachments.length?(0,d.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[c.map(_=>(0,d.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,d.jsx)("a",{className:"vf-editor-chat-message-preview-link",href:_.viewUrl,target:"_blank",rel:"noopener noreferrer",children:(0,d.jsx)(zF,{attachment:_})})},_.id)),(0,d.jsx)(NR,{previews:a.map(_=>({kind:"image",url:_.viewUrl,label:_.fileName})),onOpenModal:(_,T)=>s({preview:_,gallery:T})}),l.map(_=>(0,d.jsx)(kR,{preview:{kind:"video",url:_.viewUrl,label:_.fileName},onOpenModal:T=>s({preview:T,gallery:[T]})},_.id))]}):null,t.message.statusText?(0,d.jsxs)("div",{className:"vf-editor-chat-message-status","aria-live":"polite",children:[(0,d.jsx)("span",{className:"vf-editor-chat-status-dot"}),t.message.statusText]}):null,t.message.httpExchanges?.length?(0,d.jsx)("div",{className:"vf-editor-chat-http-list",children:t.message.httpExchanges.map((_,T)=>(0,d.jsx)(qF,{exchange:_},`${_.request.method}:${_.request.url}:${T}`))}):null,r?(0,d.jsx)("div",{className:"vf-editor-chat-message-body",dangerouslySetInnerHTML:{__html:o}}):t.message.isPending?(0,d.jsxs)("div",{className:"vf-editor-chat-message-loading","aria-hidden":"true",children:[(0,d.jsx)("span",{}),(0,d.jsx)("span",{}),(0,d.jsx)("span",{})]}):null,u.length?(0,d.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[(0,d.jsx)(NR,{previews:f,onOpenModal:(_,T)=>s({preview:_,gallery:T})}),p.map(_=>(0,d.jsx)(kR,{preview:_,onOpenModal:T=>s({preview:T,gallery:[T]})},_.url))]}):null,h.length?(0,d.jsx)("div",{className:"vf-editor-chat-json-list",children:h.map(_=>(0,d.jsx)(KF,{artifact:_},_.key))}):null,y.length?(0,d.jsx)("div",{className:"vf-editor-chat-json-list",children:y.map(_=>(0,d.jsx)(XF,{artifact:_},_.key))}):null]}),i?(0,d.jsx)(WF,{preview:i.preview,gallery:i.gallery,onClose:()=>s(null)}):null]})});function MR(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 PR(e){return jf(e.file)?(0,d.jsx)("img",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,alt:e.file.fileName}):uS(e.file)?(0,d.jsx)("video",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,muted:!0,playsInline:!0}):(0,d.jsx)("div",{className:"vf-editor-upload-file-icon","aria-hidden":"true",children:e.file.fileName.slice(0,1).toUpperCase()})}function mo(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Gf(e,t){return mo([e,t].filter(Boolean).join("/"))}function LR(e){let t=mo(e).split("/").filter(Boolean);return t.pop(),t.join("/")}function OR(e){return mo(e).split("/").filter(Boolean).at(-1)||"All files"}function ZF(e){let t=mo(e.currentFolder),n=t?`${t}/`:"",r=new Map;for(let o of e.folders){let i=mo(o);if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Gf(t,a))}for(let o of e.files){let i=mo(o.folderPath??"");if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Gf(t,a))}return Array.from(r.entries()).map(([o,i])=>({name:o,path:i})).sort((o,i)=>o.name.localeCompare(i.name))}function cS(e){return e.name==="share"?(0,d.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M14 4h6v6"}),(0,d.jsx)("path",{d:"M10 14 20 4"}),(0,d.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,d.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,d.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,d.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,d.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M3 6h18"}),(0,d.jsx)("path",{d:"M8 6V4h8v2"}),(0,d.jsx)("path",{d:"M19 6 18 20H6L5 6"}),(0,d.jsx)("path",{d:"M10 11v5"}),(0,d.jsx)("path",{d:"M14 11v5"})]})}function eB(e){let[t,n]=(0,k.useState)("my-files"),[r,o]=(0,k.useState)([]),[i,s]=(0,k.useState)([]),[a,l]=(0,k.useState)([]),[c,u]=(0,k.useState)(()=>new Set),[f,p]=(0,k.useState)([]),[h,y]=(0,k.useState)([]),[_,T]=(0,k.useState)(()=>new Set),[g,S]=(0,k.useState)(null),[E,R]=(0,k.useState)(!1),[M,A]=(0,k.useState)(""),[I,N]=(0,k.useState)(null),[U,x]=(0,k.useState)(null),[H,j]=(0,k.useState)(null),[he,X]=(0,k.useState)(null),[Ze,fe]=(0,k.useState)(null),de=(0,k.useRef)(null),D=(0,k.useRef)(null),ge=(0,k.useMemo)(()=>{let P=f.map(ie=>({...ie,recentSource:"generated"}));return[...h.map(ie=>({...ie,recentSource:"temporary"})),...P].sort((ie,Y)=>{let Ie=ie.createdAt?Date.parse(ie.createdAt):0;return(Y.createdAt?Date.parse(Y.createdAt):0)-Ie})},[f,h]),Q=t==="upload"?r:t==="my-files"?i.filter(P=>c.has(P.id)):t==="recents"?ge.filter(P=>_.has(P.id)):[];async function ae(){let P=await IF(e.apiKey);s(P.attachments),l(P.folders)}async function Re(P){R(!0);try{let[V,ie]=P?[await TR(e.apiKey,P),null]:await Promise.all([TR(e.apiKey),wF(e.apiKey)]);p(Y=>P?[...Y,...V.media]:V.media),ie&&y(ie.files),S(V.nextCursor),P||T(new Set)}finally{R(!1)}}(0,k.useEffect)(()=>{e.open&&(X(null),j(null),ae().catch(P=>X(P instanceof Error?P.message:"Unable to load My Files.")),Re().catch(P=>X(P instanceof Error?P.message:"Unable to load recent media.")))},[e.open]);function Te(){o([]),u(new Set),T(new Set),j(null),X(null),N(null),x(null),e.onClose()}async function St(P){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(P);else{let V=document.createElement("textarea");V.value=P,V.style.position="fixed",V.style.opacity="0",document.body.appendChild(V),V.focus(),V.select(),document.execCommand("copy"),document.body.removeChild(V)}j("File URL copied.")}catch{X("Unable to copy file URL.")}}async function ot(P,V){if(!P.length)return;X(null);let ie=[];for(let Y of P)try{if(j(`Uploading ${Y.name}...`),V==="upload"){let dt=await YR({apiKey:e.apiKey,file:Y,folderPath:UR}),J=await qR({attachment:dt,file:Y,currentInlineBytes:VR([...r,...ie])});ie.push(J);continue}let Ie=await TF({apiKey:e.apiKey,file:Y,folderPath:M,maxBytes:DR,limitLabel:"50 MB"});ie.push(Ie)}catch(Ie){X(Ie instanceof Error?Ie.message:"Upload failed.")}V==="upload"?(o(Y=>[...Y,...ie]),await Re().catch(Y=>X(Y instanceof Error?Y.message:"Unable to refresh recent files."))):V==="my-files"&&(await ae(),u(Y=>new Set([...Y,...ie.map(Ie=>Ie.id)]))),ie.length&&j(`${ie.length} file${ie.length===1?"":"s"} uploaded.`)}async function bt(P,V){let ie=V==="my-files"?`/api/v1/user/me/attachments/${encodeURIComponent(P.id)}`:`/api/v1/user/me/temporary-files/${encodeURIComponent(P.id)}`,Y=await fetch(ie,{method:"DELETE",headers:ut(e.apiKey,"application/json")}),Ie=await Y.json().catch(()=>({}));if(!Y.ok)throw new Error(Ie.error||"Unable to delete file.");V==="my-files"&&(s(dt=>dt.filter(J=>J.id!==P.id)),u(dt=>{let J=new Set(dt);return J.delete(P.id),J})),fe(null),j("File deleted.")}async function it(P){if(P!=="my-files"||!U||U.mode!=="create")return;let V=Gf(U.baseFolder,U.value);if(!V){X("Choose a folder name.");return}let ie=await fetch("/api/v1/user/me/attachments/folders",{method:"POST",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({folder_path:V})}),Y=await ie.json().catch(()=>({}));if(!ie.ok){X(Y.error||"Unable to create folder.");return}l(Ie=>Array.from(new Set([...Ie,V])).sort()),x(null),j("Folder created.")}async function In(P,V){if(P!=="my-files"||!U||U.mode!=="rename")return;let ie=U.value.trim(),Y=Gf(LR(V),ie);if(!Y||Y===V)return;let Ie=await fetch("/api/v1/user/me/attachments/folders",{method:"PATCH",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({from_folder_path:V,to_folder_path:Y})}),dt=await Ie.json().catch(()=>({}));if(!Ie.ok){X(dt.error||"Unable to rename folder.");return}A(J=>J===V||J.startsWith(`${V}/`)?`${Y}${J.slice(V.length)}`:J),await ae(),N(null),x(null),j("Folder renamed.")}async function Dt(P,V){if(P!=="my-files")return;let ie=await fetch("/api/v1/user/me/attachments/folders",{method:"DELETE",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({folder_path:V})}),Y=await ie.json().catch(()=>({}));if(!ie.ok){X(Y.error||"Unable to delete folder.");return}A(Ie=>Ie===V||Ie.startsWith(`${V}/`)?LR(V):Ie),await ae(),N(null),x(null),j("Folder deleted.")}function wn(P){let V=a,ie=i,Y=M,Ie=A,dt=ZF({folders:V,files:ie,currentFolder:Y}),J=mo(Y).split("/").filter(Boolean);return(0,d.jsxs)("div",{className:"vf-editor-upload-browser",children:[(0,d.jsxs)("div",{className:"vf-editor-upload-browser-toolbar",children:[(0,d.jsxs)("div",{className:"vf-editor-upload-breadcrumb","aria-label":"Current folder",children:[(0,d.jsx)("button",{type:"button","data-current":!Y,onClick:()=>Ie(""),children:"files"}),J.map(($e,ye)=>{let Je=J.slice(0,ye+1).join("/");return(0,d.jsxs)("span",{className:"vf-editor-upload-breadcrumb-segment",children:[(0,d.jsx)("span",{"aria-hidden":"true",children:"/"}),(0,d.jsx)("button",{type:"button","data-current":Je===Y,onClick:()=>Ie(Je),children:$e})]},Je)})]}),(0,d.jsx)("button",{type:"button",onClick:()=>x({mode:"create",scope:"my-files",baseFolder:Y,value:""}),children:"New folder"})]}),dt.length?(0,d.jsx)("div",{className:"vf-editor-upload-folder-grid",children:dt.map($e=>(0,d.jsxs)("article",{className:"vf-editor-upload-folder-row",children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-folder-open",onClick:()=>Ie($e.path),children:[(0,d.jsx)("span",{className:"vf-editor-upload-folder-icon","aria-hidden":"true"}),(0,d.jsx)("span",{children:$e.name})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-folder-menu-button","aria-label":`Folder actions for ${$e.name}`,onClick:()=>N(I===$e.path?null:$e.path),children:"..."}),I===$e.path?(0,d.jsxs)("div",{className:"vf-editor-upload-folder-menu",children:[(0,d.jsx)("button",{type:"button",onClick:()=>x({mode:"rename",scope:"my-files",folderPath:$e.path,value:OR($e.path)}),children:"Rename"}),(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>x({mode:"delete",scope:"my-files",folderPath:$e.path,value:""}),children:"Delete"})]}):null]},$e.path))}):null]})}function nr(P,V){let ie=V==="my-files"?c.has(P.id):V==="recents"?_.has(P.id):!1,Y="s3Url"in P&&P.s3Url?P.s3Url:P.viewUrl;return(0,d.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":ie?"true":"false",children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-file-select",onClick:()=>{if(V==="temporary"){St(Y);return}(V==="recents"?T:u)(dt=>{let J=new Set(dt);return J.has(P.id)?J.delete(P.id):J.add(P.id),J})},children:[(0,d.jsx)(PR,{file:P}),(0,d.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,d.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,d.jsxs)("span",{className:"vf-editor-upload-file-meta",children:[MR(P.sizeBytes),P.folderPath?` \xB7 ${P.folderPath}`:""]})]})]}),(0,d.jsxs)("div",{className:"vf-editor-upload-file-actions",children:[V==="my-files"||V==="recents"?(0,d.jsx)("span",{className:"vf-editor-upload-selection-indicator","data-selected":ie?"true":"false","aria-hidden":"true",children:ie?"\u2713":""}):null,(0,d.jsx)("a",{href:P.viewUrl,target:"_blank",rel:"noreferrer","aria-label":`View ${P.fileName}`,children:(0,d.jsx)(cS,{name:"share"})}),(0,d.jsx)("button",{type:"button","aria-label":`Copy URL for ${P.fileName}`,onClick:()=>{St(Y)},children:(0,d.jsx)(cS,{name:"link"})}),V==="recents"?null:(0,d.jsx)("button",{type:"button","aria-label":`Delete ${P.fileName}`,onClick:()=>fe(Ze===P.id?null:P.id),children:(0,d.jsx)(cS,{name:"trash"})})]}),V!=="recents"&&Ze===P.id?(0,d.jsxs)("div",{className:"vf-editor-upload-popconfirm",children:[(0,d.jsx)("span",{children:"Delete this file?"}),(0,d.jsx)("button",{type:"button",onClick:()=>fe(null),children:"Cancel"}),(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{bt(P,V)},children:"Delete"})]}):null]},P.id)}function Vi(){if(!U)return null;let P=U.mode==="create"?"New folder":U.mode==="rename"?"Rename folder":"Delete folder",V=U.mode==="delete"?U.folderPath:"";return(0,d.jsxs)("div",{className:"vf-editor-upload-folder-dialog",role:"dialog","aria-label":P,children:[(0,d.jsx)("div",{className:"vf-editor-upload-folder-dialog-title",children:P}),U.mode==="delete"?(0,d.jsxs)("div",{className:"vf-editor-upload-folder-dialog-copy",children:["Delete ",(0,d.jsx)("strong",{children:V})," and all files inside it?"]}):(0,d.jsx)("input",{value:U.value,autoFocus:!0,placeholder:"folder-name",onChange:ie=>x({...U,value:ie.target.value}),onKeyDown:ie=>{ie.key==="Enter"&&(ie.preventDefault(),U.mode==="create"?it(U.scope):In(U.scope,U.folderPath))}}),(0,d.jsxs)("div",{className:"vf-editor-upload-folder-dialog-actions",children:[(0,d.jsx)("button",{type:"button",onClick:()=>x(null),children:"Cancel"}),U.mode==="create"?(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{it(U.scope)},children:"Create"}):U.mode==="rename"?(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{In(U.scope,U.folderPath)},children:"Rename"}):(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{Dt(U.scope,U.folderPath)},children:"Delete"})]})]})}if(!e.open)return null;let Zo=i.filter(P=>mo(P.folderPath??"")===mo(M));return(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-upload-drawer-backdrop",children:(0,d.jsxs)("aside",{className:"vf-editor-upload-drawer","aria-label":"Upload drawer",children:[(0,d.jsxs)("div",{className:"vf-editor-upload-header",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"vf-editor-upload-title",children:"Upload"}),(0,d.jsx)("div",{className:"vf-editor-upload-subtitle",children:"Upload, attach, and copy file URLs."})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-close","aria-label":"Close upload drawer",onClick:Te,children:"\xD7"})]}),(0,d.jsxs)("div",{className:"vf-editor-upload-tabs",role:"tablist",children:[(0,d.jsx)("button",{type:"button","data-active":t==="upload",onClick:()=>n("upload"),children:"Upload file"}),(0,d.jsx)("button",{type:"button","data-active":t==="my-files",onClick:()=>n("my-files"),children:"My Files"}),(0,d.jsx)("button",{type:"button","data-active":t==="recents",onClick:()=>n("recents"),children:"Recents"})]}),(0,d.jsxs)("div",{className:"vf-editor-upload-body",children:[he?(0,d.jsx)("div",{className:"vf-editor-upload-status","data-tone":"error",children:he}):null,H?(0,d.jsx)("div",{className:"vf-editor-upload-status",children:H}):null,Vi(),t==="upload"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>de.current?.click(),children:["Upload files to chat",(0,d.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,d.jsx)("input",{ref:de,type:"file",multiple:!0,hidden:!0,onChange:P=>{ot(Array.from(P.target.files??[]),"upload"),P.target.value=""}}),(0,d.jsx)("div",{className:"vf-editor-upload-list",children:r.map(P=>(0,d.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":"true",children:[(0,d.jsx)(PR,{file:P}),(0,d.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,d.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,d.jsx)("span",{className:"vf-editor-upload-file-meta",children:MR(P.sizeBytes)})]}),(0,d.jsx)("button",{type:"button",onClick:()=>o(V=>V.filter(ie=>ie.id!==P.id)),children:"\xD7"})]},P.id))})]}):t==="my-files"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>D.current?.click(),children:["Add to My Files",(0,d.jsxs)("span",{children:["Uploads into ",OR(M)," and auto-selects. Max 50 MB each."]})]}),(0,d.jsx)("input",{ref:D,type:"file",multiple:!0,hidden:!0,onChange:P=>{ot(Array.from(P.target.files??[]),"my-files"),P.target.value=""}}),wn("my-files"),(0,d.jsx)("div",{className:"vf-editor-upload-list",children:Zo.length?Zo.map(P=>nr(P,"my-files")):(0,d.jsx)("div",{className:"vf-editor-upload-empty",children:"No files in this folder."})})]}):t==="recents"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"vf-editor-upload-list",children:ge.length?ge.map(P=>nr(P,"recents")):(0,d.jsx)("div",{className:"vf-editor-upload-empty",children:E?"Loading recent files...":"No recent files yet."})}),g?(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-more",disabled:E,onClick:()=>{Re(g).catch(P=>X(P instanceof Error?P.message:"Unable to load more recent media."))},children:E?"Loading...":"Load more generated media"}):null]}):null]}),(0,d.jsxs)("div",{className:"vf-editor-upload-footer",children:[(0,d.jsx)("button",{type:"button",onClick:Te,children:"Cancel"}),(0,d.jsxs)("div",{className:"vf-editor-upload-footer-confirm",children:[(0,d.jsxs)("span",{children:[Q.length," file",Q.length===1?"":"s"," selected"]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",disabled:!Q.length,onClick:()=>{e.onConfirm(Q),Te()},children:"Confirm"})]})]})]})}),document.body)}function QR({boot:e}){let t=e.template.templateId==="chat-brainstorm",n=t&&e.template.persistentHistorySidebar===!0,r=(0,k.useMemo)(()=>PF(e.template.templateId),[e.template.templateId]),o=(0,k.useMemo)(()=>LF(),[]),i=(0,k.useRef)(null),s=(0,k.useRef)(null),a=(0,k.useRef)(!0),l=(0,k.useRef)(!1),c=(0,k.useRef)(null),u=(0,k.useRef)(null),f=(0,k.useRef)(new Map),p=(0,k.useRef)({nextAvailableAt:0}),h=(0,k.useRef)([]),y=(0,k.useRef)(new Set),[_,T]=(0,k.useState)([]),[g,S]=(0,k.useState)(null),[E,R]=(0,k.useState)(null),[M,A]=(0,k.useState)(null),[I,N]=(0,k.useState)(""),[U,x]=(0,k.useState)([]),[H,j]=(0,k.useState)(null),[he,X]=(0,k.useState)(null),[Ze,fe]=(0,k.useState)(null),[de,D]=(0,k.useState)(!1),[ge,Q]=(0,k.useState)(!1),[ae,Re]=(0,k.useState)(!1),[Te,St]=(0,k.useState)(!1),[ot,bt]=(0,k.useState)(!1),[it,In]=(0,k.useState)(!1),[Dt,wn]=(0,k.useState)(null),[nr,Vi]=(0,k.useState)(!1),[Zo,P]=(0,k.useState)(null),[V,ie]=(0,k.useState)(!1),[Y,Ie]=(0,k.useState)(()=>{let m=typeof window<"u"?window.__vidfarmEditorTracers:null;if(m)return m.get();if(typeof window<"u"){let v=zf();if(v.length)return v}return tr(e.template.tracers||[])}),dt=(0,k.useMemo)(()=>{if(!e.threadsUrl)return null;let m=new URL(e.threadsUrl,window.location.origin);return t||m.searchParams.set("template_id",e.template.templateId),m.searchParams.set("include_messages","false"),m.searchParams.set("limit",t?"200":"50"),m.toString()},[e.template.templateId,e.threadsUrl,t]),J=m=>e.threadsUrl?new URL(`${e.threadsUrl.replace(/\/$/,"")}/${encodeURIComponent(m)}`,window.location.origin).toString():null;(0,k.useEffect)(()=>{let m=BF(o?.getItem(r.threads)??null,e.template.templateId),v=o?.getItem(r.activeThread)??null,w=wR(),b=window.__vidfarmEditorTracers?.get()??zf(),F=w&&!m.some(le=>le.id===w)?[{id:w,templateId:e.template.templateId,title:"Loading chat",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),lastMessageAt:null,messageCount:0,tracers:b,hiddenFromView:!1,messages:[]},...m]:m,K=F.filter(le=>!le.hiddenFromView),z=K.find(le=>wc(le,b));h.current=F,T(F),w&&K.some(le=>le.id===w)?S(w):v&&K.some(le=>le.id===v)&&(!b.length||K.some(le=>le.id===v&&wc(le,b)))?S(v):S(z?.id??K[0]?.id??null),D(!0)},[e.template.templateId,o,r]),(0,k.useEffect)(()=>{if(!e.vidfarmApiKey||!dt)return;let m=new AbortController;return(async()=>{try{let v=[],w=null,b=new Set;do{let F=new URL(dt);w&&F.searchParams.set("cursor",w);let K=await fetch(F.toString(),{method:"GET",headers:ut(e.vidfarmApiKey),signal:m.signal});if(!K.ok)return;let z=await K.json().catch(()=>null);Array.isArray(z?.threads)&&v.push(...z.threads.map(pe=>RR(pe,e.template.templateId)).filter(pe=>!!pe));let le=typeof z?.next_cursor=="string"&&z.next_cursor?z.next_cursor:null;!le||b.has(le)?w=null:(b.add(le),w=le)}while(w&&!m.signal.aborted);if(!v.length)return;T(F=>{let K=xR(F,v);return h.current=K,K}),S(F=>F&&h.current.some(K=>K.id===F)?F:v[0]?.id??F)}catch(v){if(v instanceof DOMException&&v.name==="AbortError")return}})(),()=>{m.abort()}},[e.template.templateId,e.vidfarmApiKey,dt]),(0,k.useEffect)(()=>{h.current=_},[_]);let[$e,ye]=(0,k.useState)(()=>fR());(0,k.useEffect)(()=>{let m=()=>{ye(fR())};return window.addEventListener("popstate",m),()=>{window.removeEventListener("popstate",m)}},[]);async function Je(m){if(!e.vidfarmApiKey){P("Sign in to see forks.");return}if(!nr&&!(!m?.force&&Dt!==null)){Vi(!0),P(null);try{let v=await fetch("/api/v1/compositions",{method:"GET",headers:ut(e.vidfarmApiKey)});if(!v.ok){P(v.status===401?"Sign in to see forks.":`Failed to load forks (${v.status}).`),wn([]);return}let w=await v.json().catch(()=>null),F=(Array.isArray(w?.forks)?w.forks:[]).map(K=>{if(!K||typeof K!="object")return null;let z=K,le=typeof z.fork_id=="string"?z.fork_id:null;return le?{forkId:le,templateId:typeof z.template_id=="string"?z.template_id:null,parentForkId:typeof z.parent_fork_id=="string"?z.parent_fork_id:null,parentVersion:typeof z.parent_version=="number"?z.parent_version:null,title:typeof z.title=="string"?z.title:null,visibility:typeof z.visibility=="string"?z.visibility:null,latestVersion:typeof z.latest_version=="number"?z.latest_version:null,ownerCustomerId:typeof z.owner_customer_id=="string"?z.owner_customer_id:null,createdAt:typeof z.created_at=="string"?z.created_at:null,updatedAt:typeof z.updated_at=="string"?z.updated_at:null}:null}).filter(K=>!!K).filter(K=>K.templateId===e.template.templateId).sort((K,z)=>String(z.updatedAt??"").localeCompare(String(K.updatedAt??"")));wn(F)}catch{P("Could not load forks. Please try again."),wn([])}finally{Vi(!1)}}}(0,k.useEffect)(()=>{it&&Dt===null&&!nr&&Je()},[it]),(0,k.useEffect)(()=>{let m=window.__vidfarmEditorTracers;if(m)return Ie(m.get()),m.subscribe(w=>Ie(w));let v=()=>{let w=zf();Ie(w.length?w:tr(e.template.tracers||[]))};return v(),window.addEventListener("popstate",v),()=>{window.removeEventListener("popstate",v)}},[e.template.tracers]);let Se=(0,k.useRef)(_),Ur=(0,k.useRef)(g);(0,k.useEffect)(()=>{Se.current=_,Ur.current=g},[_,g]),(0,k.useEffect)(()=>{if(!de)return;let m=window.setTimeout(()=>{try{o?.setItem(r.threads,JSON.stringify(CR(Se.current,Ur.current)))}catch(v){console.warn("Unable to persist editor chat threads.",v)}},300);return()=>window.clearTimeout(m)},[g,o,de,r,_]),(0,k.useEffect)(()=>{if(de)try{g?o?.setItem(r.activeThread,g):o?.removeItem(r.activeThread)}catch(m){console.warn("Unable to persist active editor chat thread.",m)}},[g,o,de,r]),(0,k.useEffect)(()=>{if(!de||typeof window>"u")return;let m=new URL(window.location.href),v=m.searchParams.get("thread_id");if(g){if(v===g)return;m.searchParams.set("thread_id",g)}else{if(!v)return;m.searchParams.delete("thread_id")}window.history.replaceState({},"",m.toString())},[g,de]);let Jt=(0,k.useMemo)(()=>_.find(m=>m.id===g)??null,[g,_]),qi=(0,k.useMemo)(()=>_.find(m=>m.id===M?.threadId)??null,[M?.threadId,_]);(0,k.useEffect)(()=>{if(!de||!e.vidfarmApiKey||!g)return;let m=h.current.find(z=>z.id===g);if(y.current.has(g))return;let v=wR();if(!!(m&&(m.messageCount??0)===0&&m.messages.length===0)){y.current.add(g);return}let b=J(g);if(!b)return;let F=new AbortController;return!m?.messages.length&&R(g),(async()=>{try{let z=await fetch(b,{method:"GET",headers:ut(e.vidfarmApiKey),signal:F.signal});if(!z.ok){let ce=!!(m&&g!==v),ue=!!(m&&(m.messageCount??0)===0&&m.messages.length===0);z.status===404&&!ce&&!ue&&j(`Chat ID ${g} was not found for this account.`),y.current.add(g);return}let le=await z.json().catch(()=>null),pe=le?.thread?RR(le.thread,e.template.templateId):null;if(!pe)return;y.current.add(pe.id),j(null),T(ce=>{let ue=xR(ce,[pe]);return h.current=ue,ue})}catch(z){if(z instanceof DOMException&&z.name==="AbortError")return}finally{F.signal.aborted||R(z=>z===g?null:z)}})(),()=>{F.abort(),R(z=>z===g?null:z)}},[g,e.vidfarmApiKey,e.threadsUrl,de]),(0,k.useEffect)(()=>{if(!de||Jt&&!Jt.hiddenFromView)return;let m=_.find(v=>!v.hiddenFromView&&wc(v,Y));S(m?.id??_.find(v=>!v.hiddenFromView)?.id??null)},[Jt,de,_,Y]);let Kf=(0,k.useMemo)(()=>Jt?.tracers.length?Jt.tracers:Y,[Jt?.tracers,Y]),Jf=(0,k.useMemo)(()=>_.filter(m=>!m.hiddenFromView).sort((m,v)=>{let w=wc(m,Y),b=wc(v,Y);return w!==b?w?-1:1:Date.parse(v.updatedAt)-Date.parse(m.updatedAt)}),[_,Y]),IS=Kf[0]??null,Xf=Jt?.messages??[],wS=he!==null,Qf=!!(g&&he===g),CS=(0,k.useMemo)(()=>(I.trim()||U.length)&&!wS,[I,U.length,wS]);(0,k.useEffect)(()=>{!de||!e.vidfarmApiKey||!Jt||!Jt.messages.length||_x(Jt)},[Jt,e.vidfarmApiKey,de]);async function Rc(m,v){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let w=J(m.id);w&&await fetch(w,{method:"PATCH",headers:ut(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:e.template.templateId,title:v?.title??m.title,tracers:v?.tracers??m.tracers,hidden_from_view:v?.hiddenFromView??m.hiddenFromView===!0,archived:v?.archived})}).catch(()=>{})}async function nx(m){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let v=J(m.threadId);v&&await fetch(`${v}/exchanges`,{method:"POST",headers:ut(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:m.templateId??e.template.templateId,title:m.title||"New chat",tracers:m.tracers,messages:m.messages.map(w=>({id:w.id,role:w.role,text:w.text,attachments:w.attachments.map(b=>({id:b.id,fileName:b.fileName,contentType:b.contentType,viewUrl:b.viewUrl})),toolExchanges:w.toolExchanges,httpExchanges:w.httpExchanges?.map(Cc)}))})}).catch(()=>{})}async function rx(m){if(!e.vidfarmApiKey||!e.threadsUrl)return;let v=J(m);v&&await fetch(v,{method:"DELETE",headers:ut(e.vidfarmApiKey)}).catch(()=>{})}function RS(m){let v=new URL(window.location.href);m.length?v.searchParams.set("tracers",m.join(",")):v.searchParams.delete("tracers"),window.history.replaceState({},"",v.toString()),window.dispatchEvent(new CustomEvent("vidfarm:editor-tracers-changed",{detail:{tracers:m}}))}function ma(m){let v=tr(m),w=window.__vidfarmEditorTracers;if(w){w.set(v);return}Ie(v),RS(v)}function xS(){let m=window.__vidfarmEditorTracers;if(m)return m.add();let v=UF(e.template.templateSlug,Y);return ma([v,...Y]),v}function bS(m){let v=window.__vidfarmEditorTracers?.get()??Y,w=m?FF(m,v):null,b=window.__vidfarmEditorTracers;return b?b.add(w??void 0):w?(ma([w,...v.filter(F=>F!==w)]),w):xS()}function ox(m){let v=m.trim();if(!v)return;let w=window.__vidfarmEditorTracers;w?w.add(v):Y.includes(v)||ma([v,...Y]),Jt&&ft(Jt.id,b=>({...b,tracers:[v,...b.tracers.filter(F=>F!==v)],updatedAt:new Date().toISOString()}))}function ix(m){let v=window.__vidfarmEditorTracers;if(v){v.remove(m);return}let w=Y.filter(b=>b!==m);ma(w)}(0,k.useEffect)(()=>{RS(Y)},[Y]),(0,k.useEffect)(()=>{let m=s.current;if(!m)return;let v=()=>{a.current=pF(m),a.current||(l.current=!1)};return v(),m.addEventListener("scroll",v,{passive:!0}),()=>{m.removeEventListener("scroll",v)}},[]),(0,k.useLayoutEffect)(()=>{let m=s.current;if(!m)return;let v=c.current!==g;c.current=g,(v||l.current||a.current)&&(m.scrollTo({top:m.scrollHeight,behavior:"auto"}),a.current=!0,l.current=!1)},[Xf,g]),(0,k.useEffect)(()=>()=>{u.current?.abortController.abort(),u.current=null;for(let m of f.current.values())m.timeoutId!==null&&window.clearTimeout(m.timeoutId),m.abortController?.abort();f.current.clear()},[]),(0,k.useEffect)(()=>{if(!M)return;let m=()=>A(null);return document.addEventListener("click",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),()=>{document.removeEventListener("click",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}},[M]),(0,k.useEffect)(()=>{let m=()=>{if(document.visibilityState!=="visible"||!navigator.onLine)return;let v=Date.now();for(let w of f.current.values())w.inFlight||w.nextPollAt!==null&&w.nextPollAt<=v&&w.runPoll&&ep(w,w.runPoll,w.nextPollAt-v)};return window.addEventListener("online",m),document.addEventListener("visibilitychange",m),()=>{window.removeEventListener("online",m),document.removeEventListener("visibilitychange",m)}},[]);function sx(m){if(Jt)return Jt.id;let v=new Date().toISOString(),w=IR(),b={id:w,templateId:e.template.templateId,title:Uf(m||""),createdAt:v,updatedAt:v,lastMessageAt:null,messageCount:0,tracers:tr(Y),messages:[]};return h.current=[b,...h.current],T(F=>[b,...F]),S(w),w}function Zf(m){let v=new Date().toISOString(),w=tr(m?.tracers??Y),b=IR(),F={id:b,templateId:e.template.templateId,title:m?.title||"New chat",createdAt:v,updatedAt:v,lastMessageAt:null,messageCount:0,tracers:w,messages:[]};return h.current=[F,...h.current],T(K=>[F,...K]),m?.activate!==!1&&(S(b),N(""),x([]),j(null)),A(null),b}function kS(){Zf(),bt(!1)}function ax(m){let v=_.find(b=>b.id===m);if(!v||!window.confirm(`Delete conversation "${v.title}"?`))return;let w=_.filter(b=>b.id!==m);h.current=h.current.filter(b=>b.id!==m);for(let[b,F]of f.current.entries())F.threadId===m&&ha(b);T(w),g===m&&S(w[0]?.id??null),j(null),A(null),rx(m)}function ft(m,v){let w=HF(h.current.map(b=>b.id===m?v(b):b));h.current=w,T(w)}function lx(m,v){let w=tr(v);ft(m,F=>({...F,tracers:lS(F.tracers,w),updatedAt:new Date().toISOString()}));let b=h.current.find(F=>F.id===m);b&&Rc({...b,tracers:lS(b.tracers,w),updatedAt:new Date().toISOString()},{tracers:lS(b.tracers,w)})}function NS(m,v){let w=m.trim();return w?h.current.find(b=>!b.hiddenFromView&&b.id!==v&&b.tracers.includes(w))?.id??null:null}function cx(m,v){let w=NS(m);return w||Zf({tracers:[m],title:v?.title||`Tracer ${m}`,activate:v?.activate??!1})}function ux(m){let v=m.toLowerCase();return/(?:own|separate|different|new)\s+(?:tracer\s+and\s+)?chat\s+threads?/.test(v)||/chat\s+threads?.{0,80}(?:own|separate|different|new)\s+tracers?/.test(v)||/each.{0,80}(?:own|separate|different|new).{0,80}chat\s+threads?/.test(v)||/(?:own|separate|different|new)\s+tracers?/.test(v)||/(?:each|every|per|one\s+per).{0,80}(?:own|separate|different|new).{0,80}tracers?/.test(v)||/(?:own|separate|different|new)\s+tracers?.{0,80}(?:each|every|per|outputs?|pieces?|posts?|jobs?|generations?)/.test(v)||/(?:outputs?|pieces?|posts?|jobs?|generations?).{0,80}(?:own|separate|different|new)\s+tracers?/.test(v)}function dx(m){let v=NS(m.tracer,m.sourceThreadId);if(!v&&!m.shouldCreateThread)return null;let w=v??cx(m.tracer,{title:`Tracer ${m.tracer}`,activate:!1});if(!w||w===m.sourceThreadId)return null;let b=$f("assistant"),F=new Date().toISOString(),K=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?Df(m.job):hR(m.job),z=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?null:`Job ${m.job.job_id} is being tracked. ${tp()}`,le={id:b,role:"assistant",text:K,attachments:[],httpExchanges:m.httpExchange?[m.httpExchange]:[],statusText:z,isPending:!1};ft(w,ce=>({...ce,updatedAt:F,messages:[...ce.messages,le]}));let pe=h.current.find(ce=>ce.id===w);return pe&&nx({threadId:w,templateId:pe.templateId,title:pe.title,tracers:pe.tracers,messages:[le]}),{threadId:w,messageId:b}}function fx(m){let v=_.find(F=>F.id===m);if(!v)return;let w=window.prompt("Thread tracers, comma separated",v.tracers.join(", "));if(w===null)return;let b=tr(w.split(","));ft(m,F=>({...F,tracers:b,updatedAt:new Date().toISOString()})),Rc(v,{tracers:b}),A(null)}function px(m){let v=_.find(F=>F.id===m);if(!v||!window.confirm(`Archive conversation "${v.title}"? Its tracer links will be prefixed with archived_.`))return;let b=tr(v.tracers.map(OF));ft(m,F=>({...F,tracers:b,updatedAt:new Date().toISOString()})),Rc(v,{tracers:b,archived:!0}),A(null)}function mx(m){let v=_.find(b=>b.id===m);if(!(!v||!window.confirm(`Remove conversation "${v.title}" from this frontend view? The thread and tracer links stay available; Delete removes the thread completely.`))){for(let[b,F]of f.current.entries())F.threadId===m&&ha(b);if(ft(m,b=>({...b,hiddenFromView:!0,updatedAt:new Date().toISOString()})),g===m){let b=Jf.find(F=>F.id!==m);S(b?.id??null)}A(null),j(null),Rc(v,{hiddenFromView:!0})}}async function hx(m){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(m);else{let v=document.createElement("textarea");v.value=m,v.setAttribute("readonly",""),v.style.position="fixed",v.style.opacity="0",document.body.appendChild(v),v.select(),document.execCommand("copy"),document.body.removeChild(v)}j(null)}catch{j("Unable to copy chat ID.")}finally{A(null)}}function gx(m,v){if(M?.threadId===m){A(null);return}let w=v.getBoundingClientRect(),b=148;A({threadId:m,top:w.bottom+6,left:Math.max(8,Math.min(window.innerWidth-b-8,w.right-b))})}function ha(m){let v=f.current.get(m);v&&(v.timeoutId!==null&&window.clearTimeout(v.timeoutId),v.abortController?.abort(),f.current.delete(m))}function ga(m,v,w){let b=f.current.get(m);b&&ep(b,v,w)}function ep(m,v,w){m.timeoutId!==null&&window.clearTimeout(m.timeoutId);let b=Math.max(_R,w);m.nextPollAt=Date.now()+b,m.timeoutId=window.setTimeout(()=>{m.timeoutId=null,v()},b)}function Yi(){return f.current.size>=yR?hF:gR}function Ki(m=Yi()){if(m>=6e4){let v=Math.round(m/6e4);return`${v} min${v===1?"":"s"}`}return`${Math.round(m/1e3)}s`}function tp(m=Yi()){return f.current.size>=yR?`Many renders are active, so the next check is in ${Ki(m)}.`:`Checking again gently every ${Ki(m)}.`}function yx(){let m=Yi();if(m===gR)return;let v=Date.now();for(let w of f.current.values()){if(w.inFlight||!w.runPoll)continue;(w.nextPollAt===null?0:w.nextPollAt-v)<m&&ep(w,w.runPoll,m)}}function Sx(m){let v=Math.max(m,p.current.nextAvailableAt);return p.current.nextAvailableAt=v+gF,v-m}function np(m){let v=vR(m.threadId,m.assistantMessageId,m.jobId);if(f.current.has(v))return;f.current.set(v,{timeoutId:null,abortController:null,runPoll:null,inFlight:!1,nextPollAt:null,lastPollAt:null,attempts:0,threadId:m.threadId});let w=async()=>{let K=f.current.get(v);if(!K||K.inFlight)return;let z=Date.now(),le=Yi();if(K.lastPollAt!==null&&z-K.lastPollAt<le){ga(v,w,le-(z-K.lastPollAt));return}if(K.attempts>=SR){ft(m.threadId,ce=>({...ce,updatedAt:new Date().toISOString(),messages:ce.messages.map(ue=>ue.id===m.assistantMessageId?{...ue,statusText:"Background polling stopped after multiple checks. Open the job route when you want to refresh again."}:ue)})),ha(v);return}if(document.visibilityState!=="visible"||!navigator.onLine){ga(v,w,le);return}let pe=Sx(Date.now());if(pe>0){ga(v,w,pe);return}K.inFlight=!0,K.lastPollAt=z,K.nextPollAt=null,K.attempts+=1,K.abortController=new AbortController;try{ft(m.threadId,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>Z.id===m.assistantMessageId?{...Z,statusText:`Job ${m.jobId} is being tracked. ${tp(le)}`}:Z)}));let ce=m.primitiveId||yF(m.sourceRequestUrl)?`/api/v1/primitives/jobs/${encodeURIComponent(m.jobId)}`:`/api/v1/templates/${encodeURIComponent(e.template.templateId)}/jobs/${encodeURIComponent(m.jobId)}`,ue=await fetch(ce,{method:"GET",headers:ut(e.vidfarmApiKey),signal:K.abortController.signal}),cn=await ue.json().catch(()=>null),ya=Object.fromEntries(ue.headers.entries()),W=$i(cn);if(ft(m.threadId,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>{if(Z.id!==m.assistantMessageId)return Z;let ve=mF(Z.httpExchanges,Cc({explanation:`Automatic ${Ki(le)} job status check for ${m.jobId}`,pollJobId:m.jobId,pollMode:"automatic",request:{method:"GET",url:ce,headers:Object.fromEntries(ut(e.vidfarmApiKey).entries())},result:{status:ue.status,statusText:ue.statusText,headers:ya,body:cn}})),ke=W?W.status==="succeeded"?`Render ${W.job_id} succeeded.`:W.status==="failed"||W.status==="cancelled"?`Render ${W.job_id} ${W.status}.${W.error?.message?` ${W.error.message}`:""}`:`Render ${W.job_id} is ${W.status}. Next check in ${Ki(le)}.`:`Render ${m.jobId} checked. Next check in ${Ki(le)}.`;return{...Z,httpExchanges:ve,statusText:ke,text:W&&(W.status==="succeeded"||W.status==="failed"||W.status==="cancelled")?Ic(Z.text,Df(W)):Z.text}})})),W&&(W.status==="succeeded"||W.status==="failed"||W.status==="cancelled")){ha(v);return}}catch(ce){if(ce instanceof DOMException&&ce.name==="AbortError")return;ft(m.threadId,ue=>({...ue,updatedAt:new Date().toISOString(),messages:ue.messages.map(cn=>cn.id===m.assistantMessageId?{...cn,statusText:`Automatic polling paused after an error. It will retry in ${Ki()}.`}:cn)}))}finally{let ce=f.current.get(v);if(!ce)return;ce.inFlight=!1,ce.abortController=null,ce.attempts<SR&&ce.timeoutId===null&&f.current.has(v)&&ga(v,w,Yi())}},b=f.current.get(v);b&&(b.runPoll=w),f.current.get(v)&&(ga(v,w,m.initialDelayMs??Yi()),yx())}function _x(m){for(let v of m.messages)if(!(v.role!=="assistant"||!v.httpExchanges?.length))for(let w of v.httpExchanges){if(w.request.method!=="POST")continue;let b=$i(w.result.body),F=vR(m.id,v.id,b?.job_id??"");!b||fa(b.status)||f.current.has(F)||v.httpExchanges.some(z=>{let le=$i(z.result.body);return le?.job_id===b.job_id&&fa(le.status)})||np({threadId:m.id,assistantMessageId:v.id,jobId:b.job_id,tracer:b.tracer,initialStatus:b.status,primitiveId:b.primitive_id,sourceRequestUrl:w.request.url,initialDelayMs:_R})}}async function rp(m){if(!m.length)return;j(null);let v=[],w=null;for(let b of m)try{let F=await YR({apiKey:e.vidfarmApiKey,file:b,folderPath:UR}),K=await qR({attachment:F,file:b,currentInlineBytes:VR([...U,...v])});v.push(K)}catch(F){w=F instanceof Error?F.message:"Unable to upload attachment."}w&&v.length===0&&j(w),v.length&&(x(b=>[...b,...v]),w&&j(w))}async function vx(m){let v=Array.from(m.target.files??[]);await rp(v),m.target.value=""}async function Ex(m){let v=Array.from(m.clipboardData.files??[]).filter(w=>w.size>0);v.length&&(m.preventDefault(),await rp(v))}async function Tx(m){m.preventDefault(),Q(!1);let v=Array.from(m.dataTransfer.files??[]).filter(w=>w.size>0);v.length&&await rp(v)}async function Ix(m,v,w){let b=w??{},F=e.vidfarmApiKey,K=window.location.origin,z=ut(F,"application/json"),le=ut(F),pe=Z=>new Promise(ve=>setTimeout(ve,Z)),ce=(Z,ve)=>{ft(m,ke=>({...ke,updatedAt:new Date().toISOString(),messages:ke.messages.map(Ne=>Ne.id===v?{...Ne,isPending:!1,statusText:Z??Ne.statusText,text:ve?Ic(Ne.text,ve):Ne.text}:Ne)}))},ue=async Z=>{let ve=await Z.text();try{return ve?JSON.parse(ve):null}catch{return null}},cn=async Z=>{let ve=Date.now()+3e5;for(;;){let ke=await fetch(new URL(`/api/v1/videos/${encodeURIComponent(Z)}`,K),{headers:le}),Ne=await ue(ke),Be=String(Ne?.status??"");if(Be==="ready")return Ne;if(Be==="failed")throw new Error(`source video download failed${Ne?.error?`: ${Ne.error}`:""}.`);if(Date.now()>ve)throw new Error("source video download timed out.");await pe(5e3)}},ya=Z=>{let ve=Ee=>typeof Ee=="string"&&Ee.trim()?Ee.trim():null,ke=Z?.result&&typeof Z.result=="object"?Z.result:{},Ne=ke.output&&typeof ke.output=="object"?ke.output:ke,Be=ve(Ne?.primary_file_url)??ve(Ne?.video?.file_url)??ve(Ne?.image?.file_url)??ve(Ne?.render?.output_url);if(Be)return Be;if(Array.isArray(Ne?.files))for(let Ee of Ne.files){let Le=ve(typeof Ee=="string"?Ee:Ee?.file_url??Ee?.url);if(Le)return Le}if(Array.isArray(Z?.artifacts))for(let Ee of Z.artifacts){let Le=ve(Ee?.public_url);if(Le)return Le}return null},W=async Z=>{let ve=Date.now()+48e4;for(;;){await pe(5e3);let ke=await fetch(new URL(`/api/v1/user/me/jobs/${encodeURIComponent(Z)}`,K),{headers:le}),Ne=await ue(ke),Be=String(Ne?.status??""),Ee=ya(Ne);if(Ee)return Ee;if(Be==="failed"||Be==="cancelled")throw new Error(`generation ${Be}.`);if(Date.now()>ve)throw new Error("generation timed out.")}},Fe=async(Z,ve)=>{let ke=await(await fetch(Z)).blob(),Ne=await fetch(new URL("/discover/templates/upload/presign",K),{method:"POST",headers:z,body:JSON.stringify({file_name:"generated.mp4",content_type:"video/mp4",size_bytes:ke.size})}),Be=await ue(Ne);if(!Ne.ok)throw new Error(Be?.error||`upload presign failed (${Ne.status})`);let Ee=Be?.storage_key,Le=Be?.file_name||"generated.mp4";if(Be?.transport==="presigned"&&Be?.upload?.url){let Oe=await fetch(Be.upload.url,{method:Be.upload.method||"PUT",headers:Be.upload.headers||{},body:ke});if(!Oe.ok)throw new Error(`upload failed (${Oe.status})`)}else{let Oe=new FormData;Oe.append("file",ke,"generated.mp4");let Xt=await fetch(new URL(Be?.upload?.url||"/discover/templates/upload",K),{method:"POST",headers:le,body:Oe}),_t=await ue(Xt);if(!Xt.ok||!_t?.storage_key)throw new Error(_t?.error||`upload failed (${Xt.status})`);Ee=_t.storage_key,Le=_t.file_name||"generated.mp4"}if(!Ee)throw new Error("upload did not return a storage key.");let ho=await fetch(new URL("/discover/templates",K),{method:"POST",headers:z,body:JSON.stringify({upload:{storage_key:Ee,file_name:Le},title:ve,origin:"raw"})}),Ut=await ue(ho);if(!ho.ok)throw new Error(Ut?.error||`ingest failed (${ho.status})`);return Ut};try{if(!F){ce(null,"\u26A0\uFE0F You need to be logged in to create a video.");return}let Z=b.mode==="replicate"?"replicate":b.mode==="generate"?"generate":null,ve,ke;if(Z==="replicate"){let Xt=(b.source_url??"").trim();if(!/^https?:\/\//i.test(Xt)){ce(null,"\u26A0\uFE0F I need a video URL (TikTok/YouTube/Instagram/X) to replicate.");return}ke=(b.instructions??"").trim()||null,ce("Fetching the source video\u2026");let _t=await fetch(new URL("/discover/templates",K),{method:"POST",headers:z,body:JSON.stringify({source_url:Xt})}),Fr=await ue(_t);if(!_t.ok)throw new Error(Fr?.error||`couldn't fetch that URL (${_t.status})`);ve=Fr?.status==="ready"?Fr:await cn(Fr?.inspiration_id)}else if(Z==="generate"){let Xt=(b.prompt??"").trim();if(!Xt){ce(null,"\u26A0\uFE0F Tell me what the video should be about and I'll create it.");return}ke=Xt,ce("Generating your video\u2026 (this can take a couple of minutes)");let _t=await fetch(new URL("/api/v1/primitives/videos/generate",K),{method:"POST",headers:z,body:JSON.stringify({tracer:`chat-create-${Date.now().toString(36)}`,payload:{prompt:Xt}})}),Fr=await ue(_t);if(!_t.ok)throw new Error(Fr?.error||`couldn't start generation (${_t.status})`);let Rx=await W(Fr?.job_id);ce("Building an editable template from the generated video\u2026");let op=await Fe(Rx,Xt.slice(0,80));ve=op?.status==="ready"?op:await cn(op?.inspiration_id)}else{ce(null,"\u26A0\uFE0F I couldn't tell whether to generate a new video or replicate a URL \u2014 try rephrasing.");return}let Ne=ve?.template_id,Be=ve?.inspiration_id;if(!Ne||!Be)throw new Error("the template wasn't created from the video.");ce(Z==="replicate"?"Recreating the scenes\u2026 (about a minute)":"Analyzing into an editable timeline\u2026");let Ee=await fetch(new URL(`/api/v1/inspirations/${encodeURIComponent(Be)}/decompose`,K),{method:"POST",headers:z,body:JSON.stringify({user_prompt:ke})});if(!Ee.ok){let Xt=await ue(Ee);throw new Error(Xt?.error||`scene analysis failed (${Ee.status})`)}ce("Finalizing your editable copy\u2026");let Le=await fetch(new URL("/api/v1/compositions",K),{method:"POST",headers:z,body:JSON.stringify({template_id:Ne})}),ho=await ue(Le);if(!Le.ok)throw new Error(ho?.error||`couldn't create an editable copy (${Le.status})`);let Ut=ho?.fork_id,Oe=`${K}/editor/${encodeURIComponent(Ne)}${Ut?`/fork/${encodeURIComponent(Ut)}`:""}`;ce("Your video is ready.",`\u2705 Your video is ready \u2014 [Open it in the editor](${Oe}).`)}catch(Z){ce(null,`\u26A0\uFE0F I couldn't finish creating the video: ${Z instanceof Error?Z.message:String(Z)}`)}}async function AS(){if(!CS)return;l.current=!0;let m=sx(I),v=new Date().toISOString(),w=h.current.find(pe=>pe.id===m),b={id:$f("user"),role:"user",text:I.trim(),attachments:U},F={id:$f("assistant"),role:"assistant",text:"",attachments:[],statusText:"Waiting for AI response\u2026",isPending:!0},K=w?.messages??[],z=xF([...K,b]);ft(m,pe=>({...pe,title:pe.messages.length===0?Uf(b.text):pe.title,updatedAt:v,messages:[...pe.messages,b,F]})),N(""),x([]),j(null),X(m),fe("Waiting for AI response\u2026");let le=new AbortController;u.current={abortController:le,threadId:m,assistantMessageId:F.id};try{let pe=JSON.stringify({messages:kF(z),thread_id:m,thread_template_id:w?.templateId??e.template.templateId,thread_title:K.length===0?Uf(b.text):w?.title??Uf(b.text),thread_tracers:Kf,client_context:nF(),user_message:{id:b.id,role:b.role,text:b.text,attachments:b.attachments.map(W=>({id:W.id,fileName:W.fileName,contentType:W.contentType,viewUrl:W.viewUrl}))},assistant_message:{id:F.id},template:{...e.template,tracers:Kf,defaultRequestTracer:IS,activeTracer:IS},cached_context:{...e.cachedContext,...NF(),...AF()}});Or("chat.send.attempt",{thread_id:m,template_id:e.template.templateId,message_count:z.length,attachment_count:b.attachments.length,text_length:b.text.length});let ce=Date.now(),ue=await fetch(e.apiUrl||"/api/v1/editor-chat",{method:"POST",headers:ut(e.vidfarmApiKey,"application/json"),signal:le.signal,body:pe});if(!ue.ok){let W=await ue.json().catch(()=>({}));throw po("chat.send.rejected",{thread_id:m,status:ue.status,error:typeof W?.error=="string"?W.error:null}),new Error(typeof W?.error=="string"?W.error:`Chat failed with status ${ue.status}.`)}Or("chat.send.stream_open",{thread_id:m,latency_ms:Date.now()-ce});let cn=new Map,ya=ux(b.text);await MF(ue,{onDelta:W=>{fe("AI is responding\u2026"),ft(m,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>Z.id===F.id?{...Z,text:`${Z.text}${W}`,statusText:"AI is responding\u2026",isPending:!1}:Z)}))},onStatus:W=>{fe(W),ft(m,Fe=>({...Fe,messages:Fe.messages.map(Z=>Z.id===F.id?{...Z,statusText:W,isPending:!Z.text}:Z)}))},onToolCall:W=>{cn.set(W.toolCallId,{toolName:W.toolName,args:W.args}),ft(m,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>Z.id===F.id?{...Z,toolExchanges:[...Z.toolExchanges??[],{toolCallId:W.toolCallId,toolName:W.toolName,args:ji(W.args),status:"pending"}]}:Z)}))},onToolResult:W=>{let Fe=FR(W.result),Z=cn.get(W.toolCallId);if(W.toolName==="create_video"&&Ix(m,F.id,W.result),W.toolName==="frontend_action"){let Ee=W.result;if(Ee?.action==="add_tracer")bS(Ee.tracer??void 0);else if(Ee?.action==="remove_tracer"&&Ee.tracer)ix(Ee.tracer);else if(Ee?.action==="activate_tracer"&&Ee.tracer)ox(Ee.tracer);else if(Ee?.action==="create_thread"){let Le=Ee.tracer?bS(Ee.tracer):xS();Zf({tracers:Le?[Le]:[],title:Le?`Tracer ${Le}`:"New chat",activate:!1})}}let ve=W.result,ke=$i(ve?.response?.body),Ne=ve?.request&&ve?.response?Cc({explanation:ve.explanation??null,request:ve.request,result:ve.response}):void 0,Be=ve?.request?.method==="POST"&&ke?.tracer?dx({sourceThreadId:m,tracer:ke.tracer,job:ke,httpExchange:Ne,shouldCreateThread:ya}):null;Be&&ke&&!fa(ke.status)&&np({threadId:Be.threadId,assistantMessageId:Be.messageId,jobId:ke.job_id,tracer:ke.tracer,initialStatus:ke.status,primitiveId:ke.primitive_id,sourceRequestUrl:ve?.request?.url}),ft(m,Ee=>({...Ee,updatedAt:new Date().toISOString(),messages:Ee.messages.map(Le=>{if(Le.id!==F.id)return Le;let ho=(Le.toolExchanges??[]).map(_t=>_t.toolCallId===W.toolCallId?{..._t,result:Fe,status:typeof W.result?.error=="string"?"error":"complete"}:_t),Ut=W.result,Oe=$i(Ut?.response?.body),Xt=Ut?.request&&Ut?.response?[...Le.httpExchanges??[],Cc({explanation:Ut.explanation??null,request:Ut.request,result:Ut.response})]:Le.httpExchanges;if(Z&&cn.delete(W.toolCallId),Ut?.request?.method==="POST"&&Oe?.tracer){let _t=window.__vidfarmEditorTracers;_t?_t.add(Oe.tracer):ma([Oe.tracer,...Y.filter(Fr=>Fr!==Oe.tracer)]),lx(m,[Oe.tracer])}return Oe&&!Be&&!fa(Oe.status)&&np({threadId:m,assistantMessageId:F.id,jobId:Oe.job_id,tracer:Oe.tracer,initialStatus:Oe.status,primitiveId:Oe.primitive_id,sourceRequestUrl:Ut?.request?.url}),{...Le,toolExchanges:ho,httpExchanges:Xt,statusText:Oe&&!fa(Oe.status)?`Job ${Oe.job_id} is being tracked. ${tp()}`:Le.statusText,isPending:!1,text:Oe&&Ut?.request?.method==="POST"&&Ut?.response?.status===202?Ic(Le.text,hR(Oe)):Oe&&fa(Oe.status)||Oe?Ic(Le.text,Df(Oe)):Le.text}})}))},onError:W=>{po("chat.stream.error",{thread_id:m,message:W}),j(W),fe(null),ft(m,Fe=>({...Fe,messages:Fe.messages.filter(Z=>Z.id!==F.id)}))}}),Or("chat.stream.completed",{thread_id:m,duration_ms:Date.now()-ce}),ft(m,W=>({...W,updatedAt:new Date().toISOString(),messages:W.messages.map(Fe=>Fe.id===F.id?{...Fe,statusText:Fe.statusText?.includes("being tracked")?Fe.statusText:null,isPending:!1}:Fe)}))}catch(pe){if(pe instanceof DOMException&&pe.name==="AbortError"){nR("chat.send.aborted",{thread_id:m}),j(null),fe(null),ft(m,ce=>({...ce,updatedAt:new Date().toISOString(),messages:ce.messages.map(ue=>ue.id!==F.id?ue:!!(ue.text.trim()||ue.toolExchanges?.length||ue.httpExchanges?.length)?{...ue,statusText:"Stopped.",isPending:!1}:{...ue,text:"Stopped.",statusText:null,isPending:!1})}));return}po("chat.send.failed",{thread_id:m,message:pe instanceof Error?pe.message:String(pe)}),j(pe instanceof Error?pe.message:"Unable to send chat message."),fe(null),ft(m,ce=>({...ce,messages:ce.messages.map(ue=>ue.id===F.id?{...ue,text:pe instanceof Error?`Error: ${pe.message}`:"Error: Unable to send chat message.",statusText:null,isPending:!1}:ue)}))}finally{u.current?.assistantMessageId===F.id&&(u.current=null),X(pe=>pe===m?null:pe),fe(null)}}function wx(){fe("Stopping\u2026");let m=u.current;m&&ft(m.threadId,v=>({...v,updatedAt:new Date().toISOString(),messages:v.messages.map(w=>w.id===m.assistantMessageId?{...w,statusText:"Stopping\u2026"}:w)})),u.current?.abortController.abort()}(0,k.useEffect)(()=>()=>{u.current?.abortController.abort();for(let m of f.current.keys())ha(m);try{o?.setItem(r.threads,JSON.stringify(CR(Se.current,Ur.current)))}catch{}},[o,r]);function Cx(m){m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),AS())}let MS=(0,d.jsx)("div",{className:`vf-editor-chat-thread-list${t?" vf-editor-chat-thread-list-sidebar":""}`,role:"tablist","aria-label":"Conversation threads",children:Jf.length?Jf.map(m=>(0,d.jsxs)("div",{role:"tab","aria-selected":m.id===g,className:"vf-editor-chat-thread-chip","data-active":m.id===g?"true":"false",children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-chat-thread-chip-main",onClick:()=>{S(m.id),j(null),A(null),bt(!1)},children:[(0,d.jsx)("span",{className:"vf-editor-chat-thread-chip-title",children:m.title}),m.tracers.length?(0,d.jsxs)("span",{className:"vf-editor-chat-thread-chip-tracers",children:[m.tracers.slice(0,2).join(", "),m.tracers.length>2?` +${m.tracers.length-2}`:""]}):null]}),(0,d.jsx)("div",{className:"vf-editor-chat-thread-menu-wrap",children:(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-thread-chip-menu","aria-label":`Actions for ${m.title}`,onClick:v=>{v.stopPropagation(),gx(m.id,v.currentTarget)},children:"..."})})]},m.id)):(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Start a chat to create your first conversation thread."})});return(0,d.jsxs)("div",{className:"vf-editor-chat-shell","data-mobile-open":ae?"true":"false","data-mobile-expanded":Te?"true":"false","data-layout":t?"brainstorm":"default",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-mobile-fab","aria-label":"Open chat","aria-expanded":ae,onClick:()=>{St(!1),Re(!0)},children:(0,d.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(0,d.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"})})}),H?(0,d.jsx)("div",{className:"vf-editor-chat-error",role:"status",children:H}):null,(0,d.jsxs)("div",{className:`${t?"vf-editor-chat-body vf-editor-chat-brainstorm-layout":"vf-editor-chat-body"}${n?" has-sidebar":""}`,"data-history-open":ot||it?"true":"false",children:[n?(0,d.jsxs)("aside",{className:"vf-editor-chat-history-pane",children:[(0,d.jsx)("div",{className:"vf-editor-chat-history-header",children:(0,d.jsxs)("div",{className:"vf-editor-chat-history-header-main",children:[(0,d.jsxs)("a",{className:"vf-editor-chat-back-button",href:"/discover","aria-label":"Back to Discover",children:[(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})}),"Discover"]}),(0,d.jsx)("div",{className:"vf-editor-chat-history-kicker",children:"Chat history"})]})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread vf-editor-chat-new-thread-sidebar",onClick:kS,children:"New chat"}),MS]}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-thread",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-header",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-header-row",children:[(0,d.jsx)("a",{className:"vf-editor-chat-back-button vf-editor-chat-back-button--header",href:"/discover","aria-label":"Back to Discover",children:(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-history-icon","aria-label":ot?"Back to chat":"Open chat history","aria-pressed":ot,onClick:()=>{bt(m=>!m),In(!1)},children:ot?(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"10",cy:"10",r:"7.2"}),(0,d.jsx)("path",{d:"M10 6v4l2.6 1.6"})]})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-history-icon vf-editor-chat-branches-icon","aria-label":it?"Back to chat":"Open template forks","aria-pressed":it,onClick:()=>{In(m=>!m),bt(!1)},children:it?(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"5.5",cy:"4.5",r:"1.9"}),(0,d.jsx)("circle",{cx:"5.5",cy:"15.5",r:"1.9"}),(0,d.jsx)("circle",{cx:"14.5",cy:"8",r:"1.9"}),(0,d.jsx)("path",{d:"M5.5 6.4v7.2"}),(0,d.jsx)("path",{d:"M5.5 13.6c0-3.2 2.4-3.6 4.4-3.9 2-.3 4.6-.5 4.6-3.7"})]})}),(0,d.jsxs)("div",{className:"vf-editor-chat-header-titles",children:[(0,d.jsx)("div",{className:"vf-editor-chat-header-title",children:"Vidfarm"}),(0,d.jsx)("div",{className:"vf-editor-chat-header-subtitle",children:ot?"Chat history":it?"Template forks":e.template.templateTitle})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread",onClick:kS,children:"New chat"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-expand","aria-label":Te?"Shrink chat":"Expand chat","aria-pressed":Te,onClick:()=>St(m=>!m),children:Te?(0,d.jsxs)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M16.5 8.5h-5v-5"}),(0,d.jsx)("path",{d:"M11.5 8.5 17 3"}),(0,d.jsx)("path",{d:"M3.5 11.5h5v5"}),(0,d.jsx)("path",{d:"M8.5 11.5 3 17"})]}):(0,d.jsxs)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M11.5 3.5h5v5"}),(0,d.jsx)("path",{d:"M16.5 3.5 11 9"}),(0,d.jsx)("path",{d:"M8.5 16.5h-5v-5"}),(0,d.jsx)("path",{d:"M3.5 16.5 9 11"})]})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-minimize","aria-label":"Minimize chat",onClick:()=>Re(!1),children:"\xD7"})]}),M&&qi?(0,Wi.createPortal)((0,d.jsxs)("div",{className:"vf-editor-chat-thread-menu",role:"menu",style:{top:M.top,left:M.left},onClick:m=>m.stopPropagation(),children:[(0,d.jsx)("button",{type:"button",onClick:()=>hx(qi.id),children:"Copy Chat ID"}),(0,d.jsx)("button",{type:"button",onClick:()=>fx(qi.id),children:"Edit tracers"}),(0,d.jsx)("button",{type:"button",onClick:()=>mx(qi.id),children:"Remove from view"}),(0,d.jsx)("button",{type:"button",onClick:()=>px(qi.id),children:"Archive thread"}),(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>ax(qi.id),children:"Delete"})]}),document.body):null]}),(0,d.jsx)("div",{className:"vf-editor-chat-viewport",ref:s,children:ot?(0,d.jsx)("div",{className:"vf-editor-chat-history-panel",children:MS}):it?(0,d.jsxs)("div",{className:"vf-editor-chat-history-panel vf-editor-chat-branches-panel",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-branches-header",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-branches-header-main",children:[(0,d.jsx)("div",{className:"vf-editor-chat-branches-kicker",children:"Forks"}),(0,d.jsxs)("div",{className:"vf-editor-chat-branches-title",children:[Dt?.length??0," fork",(Dt?.length??0)===1?"":"s"," of this template"]})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-branches-refresh",onClick:()=>{Je({force:!0})},disabled:nr,"aria-label":"Refresh forks",children:nr?"Loading\u2026":"Refresh"})]}),Zo?(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",role:"status",children:Zo}):nr&&!Dt?(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Loading forks\u2026"}):Dt&&Dt.length?(0,d.jsx)("div",{className:"vf-editor-chat-thread-list",children:Dt.map(m=>{let v=$e===m.forkId,w=`/editor/${encodeURIComponent(e.template.templateId)}/fork/${encodeURIComponent(m.forkId)}`,b=m.title&&m.title.trim()?m.title:m.forkId,F=m.parentForkId?` \xB7 forked from ${m.parentForkId.slice(0,12)}${m.parentVersion?`#v${m.parentVersion}`:""}`:"",K=m.latestVersion&&m.latestVersion>0?` \xB7 v${m.latestVersion}`:"";return(0,d.jsx)("div",{role:"listitem",className:"vf-editor-chat-thread-chip","data-active":v?"true":"false",children:(0,d.jsxs)("a",{className:"vf-editor-chat-thread-chip-main vf-editor-chat-branch-chip-link",href:w,target:"_blank",rel:"noopener noreferrer",children:[(0,d.jsxs)("span",{className:"vf-editor-chat-thread-chip-title",children:[b,v?(0,d.jsx)("span",{className:"vf-editor-chat-branch-current-badge",children:"current"}):null]}),(0,d.jsxs)("span",{className:"vf-editor-chat-thread-chip-tracers",children:[m.visibility??"private",K,F]})]})},m.forkId)})}):(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"No forks yet for this template."})]}):Xf.length?Xf.map(m=>(0,d.jsx)(QF,{message:m},m.id)):g&&E===g?(0,d.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,d.jsx)("div",{className:"vf-editor-chat-kicker",children:"Loading chat"}),(0,d.jsxs)("h2",{children:["Opening ",g]})]}):(0,d.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,d.jsx)("div",{className:"vf-editor-chat-kicker",children:"AI Copilot"}),(0,d.jsx)("h2",{children:t?"Start a new chat.":"Repurpose this video."}),(0,d.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 brainstorm tools to turn this video into a native ad for your product, spot product-placement opportunities, and shape the timeline you can actually test. 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,d.jsx)("div",{className:"vf-editor-chat-empty-prompts","aria-label":"Example prompts",children:t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{children:"I don't know where to start"}),(0,d.jsx)("div",{children:"Help me think of persuasive angles"}),(0,d.jsx)("div",{children:"Help me think of viral hooks"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{children:"I don't know where to start"}),(0,d.jsx)("div",{children:"Repurpose this video into a social media native ad for my product"}),(0,d.jsx)("div",{children:"Help me identify product placement opportunities in this video for my product"})]})})]})}),(0,d.jsx)("div",{className:"vf-editor-chat-footer",hidden:ot||it,children:(0,d.jsxs)("div",{className:"vf-editor-chat-composer","data-drop-target":ge?"true":"false",onDragEnter:m=>{m.preventDefault(),Q(!0)},onDragOver:m=>{m.preventDefault(),ge||Q(!0)},onDragLeave:m=>{m.preventDefault();let v=m.relatedTarget;v instanceof Node&&m.currentTarget.contains(v)||Q(!1)},onDrop:m=>{Tx(m)},children:[ge?(0,d.jsx)("div",{className:"vf-editor-chat-dropzone-hint",children:"Drop files to attach"}):null,U.length?(0,d.jsx)("div",{className:"vf-editor-chat-composer-attachments-strip",children:U.map(m=>(0,d.jsx)(VF,{attachment:m,onRemove:()=>x(v=>v.filter(w=>w.id!==m.id))},m.id))}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-composer-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-attach-button","aria-label":"Open upload drawer",onClick:()=>ie(!0),children:"\u{1F4CE}"}),(0,d.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:I,onChange:m=>N(m.target.value),onKeyDown:Cx,onPaste:m=>{Ex(m)}}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-send-button",onClick:()=>{if(Qf){wx();return}AS()},disabled:Qf?!1:!CS,children:Qf?"Stop":"Send"})]}),(0,d.jsx)("input",{ref:i,type:"file",accept:"image/*,video/*,audio/*,application/pdf,text/plain,text/markdown",multiple:!0,hidden:!0,onChange:m=>{vx(m)}})]})})]})]}),(0,d.jsx)(eB,{apiKey:e.vidfarmApiKey,open:V,onClose:()=>ie(!1),onConfirm:m=>x(v=>[...v,...m])})]})}var Tn=Cn(Tc(),1);rR();function tB(){let e=document.getElementById("page-runtime-boot");return e?.textContent?JSON.parse(e.textContent):null}function qf(e){let t=new Date;return t.setDate(t.getDate()+e),t.toISOString()}async function nB(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:qf(-7),end_date:qf(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||qf(-7),rangeEnd:o.endDate||qf(30),replaceRange:!0}),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated")))}function rB({boot:e}){let t=(0,Gi.useMemo)(()=>lR(e),[e]),n=tR(t,i=>i.boot.title),[r,o]=(0,Gi.useState)(null);return(0,Gi.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,Gi.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,ZR.createPortal)((0,Tn.jsx)(Ds,{fallback:(0,Tn.jsx)(oB,{}),children:(0,Tn.jsx)(QR,{boot:e.editorChat})}),r):null}function oB(){return(0,Tn.jsxs)("div",{style:{display:"grid",placeItems:"center",height:"100%",padding:"24px",textAlign:"center",gap:"12px",color:"#5c6a82"},children:[(0,Tn.jsx)("div",{style:{fontSize:"0.72rem",fontWeight:800,letterSpacing:"0.14em",textTransform:"uppercase"},children:"Chat error"}),(0,Tn.jsx)("div",{style:{fontSize:"0.92rem"},children:"Something went wrong loading the chat. Reload the page to try again."}),(0,Tn.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 Qo=tB(),ES=document.getElementById("page-runtime-root"),TS=aR(Qo?.userId??null),Yf=null;function tx(e={}){return!e.force&&Yf||(Yf=nB({userId:Qo?.userId??null,store:TS,force:e.force}).catch(()=>{})),Yf}window.__vidfarmFlockPosterCache={readSnapshot:()=>nS(Qo?.userId??null),ensureHydrated:tx,setChannelsData:e=>{TS.getState().setChannelsData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))},setCalendarData:e=>{TS.getState().setCalendarData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))}};tx();Or("page_runtime.boot",{has_boot:!!Qo,has_root:!!ES,page_kind:Qo?.pageKind??null,editor_chat_template_id:Qo?.editorChat?.template?.templateId??null});Qo&&ES&&(0,ex.createRoot)(ES).render((0,Tn.jsx)(Ds,{fallback:(0,Tn.jsx)(Tn.Fragment,{}),onError:e=>po("page_runtime.render_error",{message:e instanceof Error?e.message:String(e)}),children:(0,Tn.jsx)(rB,{boot:Qo})}));
46
46
  /*! Bundled license information:
47
47
 
48
48
  react/cjs/react.production.min.js: