@mevdragon/vidfarm-devcli 0.8.0 → 0.10.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.
- package/README.md +27 -1
- package/SKILL.director.md +57 -0
- package/SKILL.platform.md +13 -1
- package/demo/dist/app.js +56 -28
- package/dist/src/account-pages-legacy.js +15 -10
- package/dist/src/app.js +678 -189
- package/dist/src/cli.js +341 -54
- package/dist/src/config.js +5 -0
- package/dist/src/devcli/clips.js +312 -49
- package/dist/src/devcli/telemetry.js +236 -0
- package/dist/src/editor-chat.js +1 -1
- package/dist/src/frontend/homepage-view.js +0 -5
- package/dist/src/frontend/template-editor-chat.js +212 -0
- package/dist/src/page-shell.js +47 -0
- package/dist/src/primitive-registry.js +7 -0
- package/dist/src/services/billing.js +3 -0
- package/dist/src/services/clip-curation/ffmpeg.js +59 -17
- package/dist/src/services/clip-curation/gemini.js +72 -23
- package/dist/src/services/clip-curation/hunt.js +332 -0
- package/dist/src/services/clip-curation/index.js +3 -1
- package/dist/src/services/clip-curation/local-agent.js +247 -0
- package/dist/src/services/clip-curation/refine.js +7 -29
- package/dist/src/services/clip-curation/scan.js +37 -10
- package/dist/src/services/hyperframes.js +22 -9
- package/dist/src/services/serverless-records.js +9 -2
- package/dist/src/services/storage.js +16 -1
- package/package.json +1 -1
- package/public/assets/homepage-client-app.js +17 -17
- package/public/assets/page-runtime-client-app.js +31 -31
package/demo/dist/app.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{a as Ea,b as X6,c as Qm}from"./chunks/chunk-S7OWAJDS.js";import{c as Jm,d as _0,e as Kr}from"./chunks/chunk-DXB73IDG.js";var $O=Jm(
|
|
1
|
+
import{a as Ea,b as X6,c as Qm}from"./chunks/chunk-S7OWAJDS.js";import{c as Jm,d as _0,e as Kr}from"./chunks/chunk-DXB73IDG.js";var $O=Jm(ze=>{"use strict";function wT(t,e){var n=t.length;t.push(e);t:for(;0<n;){var r=n-1>>>1,o=t[r];if(0<gy(o,e))t[r]=e,t[n]=o,n=r;else break t}}function Ti(t){return t.length===0?null:t[0]}function by(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;t:for(var r=0,o=t.length,i=o>>>1;r<i;){var a=2*(r+1)-1,s=t[a],l=a+1,c=t[l];if(0>gy(s,n))l<o&&0>gy(c,s)?(t[r]=c,t[l]=n,r=l):(t[r]=s,t[a]=n,r=a);else if(l<o&&0>gy(c,n))t[r]=c,t[l]=n,r=l;else break t}}return e}function gy(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}ze.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(DO=performance,ze.unstable_now=function(){return DO.now()}):(ST=Date,LO=ST.now(),ze.unstable_now=function(){return ST.now()-LO});var DO,ST,LO,ea=[],os=[],mY=1,mo=null,Xn=3,xT=!1,xp=!1,Ap=!1,AT=!1,PO=typeof setTimeout=="function"?setTimeout:null,zO=typeof clearTimeout=="function"?clearTimeout:null,UO=typeof setImmediate<"u"?setImmediate:null;function hy(t){for(var e=Ti(os);e!==null;){if(e.callback===null)by(os);else if(e.startTime<=t)by(os),e.sortIndex=e.expirationTime,wT(ea,e);else break;e=Ti(os)}}function kT(t){if(Ap=!1,hy(t),!xp)if(Ti(ea)!==null)xp=!0,Ku||(Ku=!0,Wu());else{var e=Ti(os);e!==null&&IT(kT,e.startTime-t)}}var Ku=!1,kp=-1,FO=5,HO=-1;function GO(){return AT?!0:!(ze.unstable_now()-HO<FO)}function ET(){if(AT=!1,Ku){var t=ze.unstable_now();HO=t;var e=!0;try{t:{xp=!1,Ap&&(Ap=!1,zO(kp),kp=-1),xT=!0;var n=Xn;try{e:{for(hy(t),mo=Ti(ea);mo!==null&&!(mo.expirationTime>t&&GO());){var r=mo.callback;if(typeof r=="function"){mo.callback=null,Xn=mo.priorityLevel;var o=r(mo.expirationTime<=t);if(t=ze.unstable_now(),typeof o=="function"){mo.callback=o,hy(t),e=!0;break e}mo===Ti(ea)&&by(ea),hy(t)}else by(ea);mo=Ti(ea)}if(mo!==null)e=!0;else{var i=Ti(os);i!==null&&IT(kT,i.startTime-t),e=!1}}break t}finally{mo=null,Xn=n,xT=!1}e=void 0}}finally{e?Wu():Ku=!1}}}var Wu;typeof UO=="function"?Wu=function(){UO(ET)}:typeof MessageChannel<"u"?(TT=new MessageChannel,BO=TT.port2,TT.port1.onmessage=ET,Wu=function(){BO.postMessage(null)}):Wu=function(){PO(ET,0)};var TT,BO;function IT(t,e){kp=PO(function(){t(ze.unstable_now())},e)}ze.unstable_IdlePriority=5;ze.unstable_ImmediatePriority=1;ze.unstable_LowPriority=4;ze.unstable_NormalPriority=3;ze.unstable_Profiling=null;ze.unstable_UserBlockingPriority=2;ze.unstable_cancelCallback=function(t){t.callback=null};ze.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):FO=0<t?Math.floor(1e3/t):5};ze.unstable_getCurrentPriorityLevel=function(){return Xn};ze.unstable_next=function(t){switch(Xn){case 1:case 2:case 3:var e=3;break;default:e=Xn}var n=Xn;Xn=e;try{return t()}finally{Xn=n}};ze.unstable_requestPaint=function(){AT=!0};ze.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=Xn;Xn=t;try{return e()}finally{Xn=n}};ze.unstable_scheduleCallback=function(t,e,n){var r=ze.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,t){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,t={id:mY++,callback:e,priorityLevel:t,startTime:n,expirationTime:o,sortIndex:-1},n>r?(t.sortIndex=n,wT(os,t),Ti(ea)===null&&t===Ti(os)&&(Ap?(zO(kp),kp=-1):Ap=!0,IT(kT,n-r))):(t.sortIndex=o,wT(ea,t),xp||xT||(xp=!0,Ku||(Ku=!0,Wu()))),t};ze.unstable_shouldYield=GO;ze.unstable_wrapCallback=function(t){var e=Xn;return function(){var n=Xn;Xn=e;try{return t.apply(this,arguments)}finally{Xn=n}}}});var qO=Jm((Pvt,jO)=>{"use strict";jO.exports=$O()});var rU=Jm(G_=>{"use strict";var yn=qO(),bL=Ea(),gY=X6();function j(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function yL(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function pm(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function _L(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function vL(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function VO(t){if(pm(t)!==t)throw Error(j(188))}function hY(t){var e=t.alternate;if(!e){if(e=pm(t),e===null)throw Error(j(188));return e!==t?null:t}for(var n=t,r=e;;){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 VO(o),t;if(i===r)return VO(o),e;i=i.sibling}throw Error(j(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a){for(s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a)throw Error(j(189))}}if(n.alternate!==r)throw Error(j(190))}if(n.tag!==3)throw Error(j(188));return n.stateNode.current===n?t:e}function SL(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=SL(t),e!==null)return e;t=t.sibling}return null}var Ne=Object.assign,bY=Symbol.for("react.element"),yy=Symbol.for("react.transitional.element"),Lp=Symbol.for("react.portal"),ed=Symbol.for("react.fragment"),EL=Symbol.for("react.strict_mode"),lw=Symbol.for("react.profiler"),TL=Symbol.for("react.consumer"),ca=Symbol.for("react.context"),rx=Symbol.for("react.forward_ref"),cw=Symbol.for("react.suspense"),uw=Symbol.for("react.suspense_list"),ox=Symbol.for("react.memo"),is=Symbol.for("react.lazy");Symbol.for("react.scope");var dw=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var yY=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var YO=Symbol.iterator;function Ip(t){return t===null||typeof t!="object"?null:(t=YO&&t[YO]||t["@@iterator"],typeof t=="function"?t:null)}var _Y=Symbol.for("react.client.reference");function fw(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===_Y?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ed:return"Fragment";case lw:return"Profiler";case EL:return"StrictMode";case cw:return"Suspense";case uw:return"SuspenseList";case dw:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Lp:return"Portal";case ca:return t.displayName||"Context";case TL:return(t._context.displayName||"Context")+".Consumer";case rx:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ox:return e=t.displayName||null,e!==null?e:fw(t.type)||"Memo";case is:e=t._payload,t=t._init;try{return fw(t(e))}catch{}}return null}var Up=Array.isArray,At=bL.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=gY.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Dl={pending:!1,data:null,method:null,action:null},pw=[],nd=-1;function Ii(t){return{current:t}}function Rn(t){0>nd||(t.current=pw[nd],pw[nd]=null,nd--)}function xe(t,e){nd++,pw[nd]=t.current,t.current=e}var ki=Ii(null),Zp=Ii(null),hs=Ii(null),Jy=Ii(null);function Qy(t,e){switch(xe(hs,e),xe(Zp,t),xe(ki,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?tL(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=tL(e),t=$3(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Rn(ki),xe(ki,t)}function vd(){Rn(ki),Rn(Zp),Rn(hs)}function mw(t){t.memoizedState!==null&&xe(Jy,t);var e=ki.current,n=$3(e,t.type);e!==n&&(xe(Zp,t),xe(ki,n))}function Zy(t){Zp.current===t&&(Rn(ki),Rn(Zp)),Jy.current===t&&(Rn(Jy),um._currentValue=Dl)}var RT,WO;function Nl(t){if(RT===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);RT=e&&e[1]||"",WO=-1<n.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
3
|
`+RT+t+WO}var NT=!1;function CT(t,e){if(!t||NT)return"";NT=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(e){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(f){var p=f}Reflect.construct(t,[],u)}else{try{u.call()}catch(f){p=f}t.call(u.prototype)}}else{try{throw Error()}catch(f){p=f}(u=t())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(f){if(f&&p&&typeof f.stack=="string")return[f.stack,p.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),a=i[0],s=i[1];if(a&&s){var l=a.split(`
|
|
4
4
|
`),c=s.split(`
|
|
5
5
|
`);for(o=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;o<c.length&&!c[o].includes("DetermineComponentFrameRoot");)o++;if(r===l.length||o===c.length)for(r=l.length-1,o=c.length-1;1<=r&&0<=o&&l[r]!==c[o];)o--;for(;1<=r&&0<=o;r--,o--)if(l[r]!==c[o]){if(r!==1||o!==1)do if(r--,o--,0>o||l[r]!==c[o]){var d=`
|
|
6
6
|
`+l[r].replace(" at new "," at ");return t.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",t.displayName)),d}while(1<=r&&0<=o);break}}}finally{NT=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Nl(n):""}function vY(t,e){switch(t.tag){case 26:case 27:case 5:return Nl(t.type);case 16:return Nl("Lazy");case 13:return t.child!==e&&e!==null?Nl("Suspense Fallback"):Nl("Suspense");case 19:return Nl("SuspenseList");case 0:case 15:return CT(t.type,!1);case 11:return CT(t.type.render,!1);case 1:return CT(t.type,!0);case 31:return Nl("Activity");default:return""}}function KO(t){try{var e="",n=null;do e+=vY(t,n),n=t,t=t.return;while(t);return e}catch(r){return`
|
|
7
7
|
Error generating stack: `+r.message+`
|
|
8
|
-
`+r.stack}}var gw=Object.prototype.hasOwnProperty,ix=yn.unstable_scheduleCallback,MT=yn.unstable_cancelCallback,SY=yn.unstable_shouldYield,EY=yn.unstable_requestPaint,Gr=yn.unstable_now,TY=yn.unstable_getCurrentPriorityLevel,wL=yn.unstable_ImmediatePriority,xL=yn.unstable_UserBlockingPriority,t_=yn.unstable_NormalPriority,wY=yn.unstable_LowPriority,AL=yn.unstable_IdlePriority,xY=yn.log,AY=yn.unstable_setDisableYieldValue,mm=null,$r=null;function ds(t){if(typeof xY=="function"&&AY(t),$r&&typeof $r.setStrictMode=="function")try{$r.setStrictMode(mm,t)}catch{}}var jr=Math.clz32?Math.clz32:RY,kY=Math.log,IY=Math.LN2;function RY(t){return t>>>=0,t===0?32:31-(kY(t)/IY|0)|0}var _y=256,vy=262144,Sy=4194304;function Cl(t){var e=t&42;if(e!==0)return e;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function A_(t,e,n){var r=t.pendingLanes;if(r===0)return 0;var o=0,i=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var s=r&134217727;return s!==0?(r=s&~i,r!==0?o=Cl(r):(a&=s,a!==0?o=Cl(a):n||(n=s&~t,n!==0&&(o=Cl(n))))):(s=r&~i,s!==0?o=Cl(s):a!==0?o=Cl(a):n||(n=r&~t,n!==0&&(o=Cl(n)))),o===0?0:e!==0&&e!==o&&(e&i)===0&&(i=o&-o,n=e&-e,i>=n||i===32&&(n&4194048)!==0)?e:o}function gm(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function NY(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32: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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kL(){var t=Sy;return Sy<<=1,(Sy&62914560)===0&&(Sy=4194304),t}function OT(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function hm(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function CY(t,e,n,r,o,i){var a=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=a&~n;0<n;){var d=31-jr(n),u=1<<d;s[d]=0,l[d]=-1;var p=c[d];if(p!==null)for(c[d]=null,d=0;d<p.length;d++){var f=p[d];f!==null&&(f.lane&=-536870913)}n&=~u}r!==0&&IL(t,r,0),i!==0&&o===0&&t.tag!==0&&(t.suspendedLanes|=i&~(a&~e))}function IL(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-jr(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|n&261930}function RL(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-jr(n),o=1<<r;o&e|t[r]&e&&(t[r]|=e),n&=~o}}function NL(t,e){var n=e&-e;return n=(n&42)!==0?1:ax(n),(n&(t.suspendedLanes|e))!==0?0:n}function ax(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function sx(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function CL(){var t=ce.p;return t!==0?t:(t=window.event,t===void 0?32:tU(t.type))}function XO(t,e){var n=ce.p;try{return ce.p=t,e()}finally{ce.p=n}}var Rs=Math.random().toString(36).slice(2),On="__reactFiber$"+Rs,wr="__reactProps$"+Rs,Cd="__reactContainer$"+Rs,hw="__reactEvents$"+Rs,MY="__reactListeners$"+Rs,OY="__reactHandles$"+Rs,JO="__reactResources$"+Rs,bm="__reactMarker$"+Rs;function lx(t){delete t[On],delete t[wr],delete t[hw],delete t[MY],delete t[OY]}function rd(t){var e=t[On];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Cd]||n[On]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=iL(t);t!==null;){if(n=t[On])return n;t=iL(t)}return e}t=n,n=t.parentNode}return null}function Md(t){if(t=t[On]||t[Cd]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Bp(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(j(33))}function pd(t){var e=t[JO];return e||(e=t[JO]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function In(t){t[bm]=!0}var ML=new Set,OL={};function jl(t,e){Sd(t,e),Sd(t+"Capture",e)}function Sd(t,e){for(OL[t]=e,t=0;t<e.length;t++)ML.add(e[t])}var DY=RegExp("^[: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]*$"),QO={},ZO={};function LY(t){return gw.call(ZO,t)?!0:gw.call(QO,t)?!1:DY.test(t)?ZO[t]=!0:(QO[t]=!0,!1)}function Uy(t,e,n){if(LY(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var r=e.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Ey(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function na(t,e,n,r){if(r===null)t.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+r)}}function ho(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function DL(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function UY(t,e,n){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function bw(t){if(!t._valueTracker){var e=DL(t)?"checked":"value";t._valueTracker=UY(t,e,""+t[e])}}function LL(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=DL(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function e_(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var BY=/[\n"\\]/g;function _o(t){return t.replace(BY,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function yw(t,e,n,r,o,i,a,s){t.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?t.type=a:t.removeAttribute("type"),e!=null?a==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ho(e)):t.value!==""+ho(e)&&(t.value=""+ho(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?_w(t,a,ho(e)):n!=null?_w(t,a,ho(n)):r!=null&&t.removeAttribute("value"),o==null&&i!=null&&(t.defaultChecked=!!i),o!=null&&(t.checked=o&&typeof o!="function"&&typeof o!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+ho(s):t.removeAttribute("name")}function UL(t,e,n,r,o,i,a,s){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.type=i),e!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||e!=null)){bw(t);return}n=n!=null?""+ho(n):"",e=e!=null?""+ho(e):n,s||e===t.value||(t.value=e),t.defaultValue=e}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=s?t.checked:!!r,t.defaultChecked=!!r,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.name=a),bw(t)}function _w(t,e,n){e==="number"&&e_(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function md(t,e,n,r){if(t=t.options,e){e={};for(var o=0;o<n.length;o++)e["$"+n[o]]=!0;for(n=0;n<t.length;n++)o=e.hasOwnProperty("$"+t[n].value),t[n].selected!==o&&(t[n].selected=o),o&&r&&(t[n].defaultSelected=!0)}else{for(n=""+ho(n),e=null,o=0;o<t.length;o++){if(t[o].value===n){t[o].selected=!0,r&&(t[o].defaultSelected=!0);return}e!==null||t[o].disabled||(e=t[o])}e!==null&&(e.selected=!0)}}function BL(t,e,n){if(e!=null&&(e=""+ho(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+ho(n):""}function PL(t,e,n,r){if(e==null){if(r!=null){if(n!=null)throw Error(j(92));if(Up(r)){if(1<r.length)throw Error(j(93));r=r[0]}n=r}n==null&&(n=""),e=n}n=ho(e),t.defaultValue=n,r=t.textContent,r===n&&r!==""&&r!==null&&(t.value=r),bw(t)}function Ed(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var PY=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tD(t,e,n){var r=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":r?t.setProperty(e,n):typeof n!="number"||n===0||PY.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function zL(t,e,n){if(e!=null&&typeof e!="object")throw Error(j(62));if(t=t.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||e!=null&&e.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var o in e)r=e[o],e.hasOwnProperty(o)&&n[o]!==r&&tD(t,o,r)}else for(var i in e)e.hasOwnProperty(i)&&tD(t,i,e[i])}function cx(t){if(t.indexOf("-")===-1)return!1;switch(t){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 zY=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),FY=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function By(t){return FY.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ua(){}var vw=null;function ux(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var od=null,gd=null;function eD(t){var e=Md(t);if(e&&(t=e.stateNode)){var n=t[wr]||null;t:switch(t=e.stateNode,e.type){case"input":if(yw(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_o(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var o=r[wr]||null;if(!o)throw Error(j(90));yw(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(e=0;e<n.length;e++)r=n[e],r.form===t.form&&LL(r)}break t;case"textarea":BL(t,n.value,n.defaultValue);break t;case"select":e=n.value,e!=null&&md(t,!!n.multiple,e,!1)}}}var DT=!1;function FL(t,e,n){if(DT)return t(e,n);DT=!0;try{var r=t(e);return r}finally{if(DT=!1,(od!==null||gd!==null)&&(P_(),od&&(e=od,t=gd,gd=od=null,eD(e),t)))for(e=0;e<t.length;e++)eD(t[e])}}function tm(t,e){var n=t.stateNode;if(n===null)return null;var r=n[wr]||null;if(r===null)return null;n=r[e];t:switch(e){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)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break t;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(j(231,e,typeof n));return n}var ga=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sw=!1;if(ga)try{Xu={},Object.defineProperty(Xu,"passive",{get:function(){Sw=!0}}),window.addEventListener("test",Xu,Xu),window.removeEventListener("test",Xu,Xu)}catch{Sw=!1}var Xu,fs=null,dx=null,Py=null;function HL(){if(Py)return Py;var t,e=dx,n=e.length,r,o="value"in fs?fs.value:fs.textContent,i=o.length;for(t=0;t<n&&e[t]===o[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===o[i-r];r++);return Py=o.slice(t,1<r?1-r:void 0)}function zy(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Ty(){return!0}function nD(){return!1}function xr(t){function e(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(i):i[s]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ty:nD,this.isPropagationStopped=nD,this}return Ne(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ty)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ty)},persist:function(){},isPersistent:Ty}),e}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},k_=xr(ql),ym=Ne({},ql,{view:0,detail:0}),HY=xr(ym),LT,UT,Rp,I_=Ne({},ym,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fx,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Rp&&(Rp&&t.type==="mousemove"?(LT=t.screenX-Rp.screenX,UT=t.screenY-Rp.screenY):UT=LT=0,Rp=t),LT)},movementY:function(t){return"movementY"in t?t.movementY:UT}}),rD=xr(I_),GY=Ne({},I_,{dataTransfer:0}),$Y=xr(GY),jY=Ne({},ym,{relatedTarget:0}),BT=xr(jY),qY=Ne({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),VY=xr(qY),YY=Ne({},ql,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),WY=xr(YY),KY=Ne({},ql,{data:0}),oD=xr(KY),XY={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JY={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"},QY={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZY(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=QY[t])?!!e[t]:!1}function fx(){return ZY}var tW=Ne({},ym,{key:function(t){if(t.key){var e=XY[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=zy(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?JY[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fx,charCode:function(t){return t.type==="keypress"?zy(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zy(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),eW=xr(tW),nW=Ne({},I_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iD=xr(nW),rW=Ne({},ym,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fx}),oW=xr(rW),iW=Ne({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),aW=xr(iW),sW=Ne({},I_,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),lW=xr(sW),cW=Ne({},ql,{newState:0,oldState:0}),uW=xr(cW),dW=[9,13,27,32],px=ga&&"CompositionEvent"in window,Fp=null;ga&&"documentMode"in document&&(Fp=document.documentMode);var fW=ga&&"TextEvent"in window&&!Fp,GL=ga&&(!px||Fp&&8<Fp&&11>=Fp),aD=" ",sD=!1;function $L(t,e){switch(t){case"keyup":return dW.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jL(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var id=!1;function pW(t,e){switch(t){case"compositionend":return jL(e);case"keypress":return e.which!==32?null:(sD=!0,aD);case"textInput":return t=e.data,t===aD&&sD?null:t;default:return null}}function mW(t,e){if(id)return t==="compositionend"||!px&&$L(t,e)?(t=HL(),Py=dx=fs=null,id=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return GL&&e.locale!=="ko"?null:e.data;default:return null}}var gW={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 lD(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!gW[t.type]:e==="textarea"}function qL(t,e,n,r){od?gd?gd.push(r):gd=[r]:od=r,e=__(e,"onChange"),0<e.length&&(n=new k_("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Hp=null,em=null;function hW(t){F3(t,0)}function R_(t){var e=Bp(t);if(LL(e))return t}function cD(t,e){if(t==="change")return e}var VL=!1;ga&&(ga?(xy="oninput"in document,xy||(PT=document.createElement("div"),PT.setAttribute("oninput","return;"),xy=typeof PT.oninput=="function"),wy=xy):wy=!1,VL=wy&&(!document.documentMode||9<document.documentMode));var wy,xy,PT;function uD(){Hp&&(Hp.detachEvent("onpropertychange",YL),em=Hp=null)}function YL(t){if(t.propertyName==="value"&&R_(em)){var e=[];qL(e,em,t,ux(t)),FL(hW,e)}}function bW(t,e,n){t==="focusin"?(uD(),Hp=e,em=n,Hp.attachEvent("onpropertychange",YL)):t==="focusout"&&uD()}function yW(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return R_(em)}function _W(t,e){if(t==="click")return R_(e)}function vW(t,e){if(t==="input"||t==="change")return R_(e)}function SW(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Vr=typeof Object.is=="function"?Object.is:SW;function nm(t,e){if(Vr(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!gw.call(e,o)||!Vr(t[o],e[o]))return!1}return!0}function dD(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function fD(t,e){var n=dD(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=dD(n)}}function WL(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?WL(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function KL(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=e_(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=e_(t.document)}return e}function mx(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var EW=ga&&"documentMode"in document&&11>=document.documentMode,ad=null,Ew=null,Gp=null,Tw=!1;function pD(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tw||ad==null||ad!==e_(r)||(r=ad,"selectionStart"in r&&mx(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}),Gp&&nm(Gp,r)||(Gp=r,r=__(Ew,"onSelect"),0<r.length&&(e=new k_("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=ad)))}function Rl(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var sd={animationend:Rl("Animation","AnimationEnd"),animationiteration:Rl("Animation","AnimationIteration"),animationstart:Rl("Animation","AnimationStart"),transitionrun:Rl("Transition","TransitionRun"),transitionstart:Rl("Transition","TransitionStart"),transitioncancel:Rl("Transition","TransitionCancel"),transitionend:Rl("Transition","TransitionEnd")},zT={},XL={};ga&&(XL=document.createElement("div").style,"AnimationEvent"in window||(delete sd.animationend.animation,delete sd.animationiteration.animation,delete sd.animationstart.animation),"TransitionEvent"in window||delete sd.transitionend.transition);function Vl(t){if(zT[t])return zT[t];if(!sd[t])return t;var e=sd[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in XL)return zT[t]=e[n];return t}var JL=Vl("animationend"),QL=Vl("animationiteration"),ZL=Vl("animationstart"),TW=Vl("transitionrun"),wW=Vl("transitionstart"),xW=Vl("transitioncancel"),t5=Vl("transitionend"),e5=new Map,ww="abort auxClick beforeToggle 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(" ");ww.push("scrollEnd");function Jo(t,e){e5.set(t,e),jl(e,[t])}var n_=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},go=[],ld=0,gx=0;function N_(){for(var t=ld,e=gx=ld=0;e<t;){var n=go[e];go[e++]=null;var r=go[e];go[e++]=null;var o=go[e];go[e++]=null;var i=go[e];if(go[e++]=null,r!==null&&o!==null){var a=r.pending;a===null?o.next=o:(o.next=a.next,a.next=o),r.pending=o}i!==0&&n5(n,o,i)}}function C_(t,e,n,r){go[ld++]=t,go[ld++]=e,go[ld++]=n,go[ld++]=r,gx|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function hx(t,e,n,r){return C_(t,e,n,r),r_(t)}function Yl(t,e){return C_(t,null,null,e),r_(t)}function n5(t,e,n){t.lanes|=n;var r=t.alternate;r!==null&&(r.lanes|=n);for(var o=!1,i=t.return;i!==null;)i.childLanes|=n,r=i.alternate,r!==null&&(r.childLanes|=n),i.tag===22&&(t=i.stateNode,t===null||t._visibility&1||(o=!0)),t=i,i=i.return;return t.tag===3?(i=t.stateNode,o&&e!==null&&(o=31-jr(n),t=i.hiddenUpdates,r=t[o],r===null?t[o]=[e]:r.push(e),e.lane=n|536870912),i):null}function r_(t){if(50<Jp)throw Jp=0,qw=null,Error(j(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var cd={};function AW(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,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 Fr(t,e,n,r){return new AW(t,e,n,r)}function bx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fa(t,e){var n=t.alternate;return n===null?(n=Fr(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function r5(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Fy(t,e,n,r,o,i){var a=0;if(r=t,typeof t=="function")bx(t)&&(a=1);else if(typeof t=="string")a=RK(t,n,ki.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case dw:return t=Fr(31,n,e,o),t.elementType=dw,t.lanes=i,t;case ed:return Ll(n.children,o,i,e);case EL:a=8,o|=24;break;case lw:return t=Fr(12,n,e,o|2),t.elementType=lw,t.lanes=i,t;case cw:return t=Fr(13,n,e,o),t.elementType=cw,t.lanes=i,t;case uw:return t=Fr(19,n,e,o),t.elementType=uw,t.lanes=i,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ca:a=10;break t;case TL:a=9;break t;case rx:a=11;break t;case ox:a=14;break t;case is:a=16,r=null;break t}a=29,n=Error(j(130,t===null?"null":typeof t,"")),r=null}return e=Fr(a,n,e,o),e.elementType=t,e.type=r,e.lanes=i,e}function Ll(t,e,n,r){return t=Fr(7,t,r,e),t.lanes=n,t}function FT(t,e,n){return t=Fr(6,t,null,e),t.lanes=n,t}function o5(t){var e=Fr(18,null,null,0);return e.stateNode=t,e}function HT(t,e,n){return e=Fr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var mD=new WeakMap;function vo(t,e){if(typeof t=="object"&&t!==null){var n=mD.get(t);return n!==void 0?n:(e={value:t,source:e,stack:KO(e)},mD.set(t,e),e)}return{value:t,source:e,stack:KO(e)}}var ud=[],dd=0,o_=null,rm=0,bo=[],yo=0,xs=null,wi=1,xi="";function sa(t,e){ud[dd++]=rm,ud[dd++]=o_,o_=t,rm=e}function i5(t,e,n){bo[yo++]=wi,bo[yo++]=xi,bo[yo++]=xs,xs=t;var r=wi;t=xi;var o=32-jr(r)-1;r&=~(1<<o),n+=1;var i=32-jr(e)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,wi=1<<32-jr(e)+o|n<<o|r,xi=i+t}else wi=1<<i|n<<o|r,xi=t}function yx(t){t.return!==null&&(sa(t,1),i5(t,1,0))}function _x(t){for(;t===o_;)o_=ud[--dd],ud[dd]=null,rm=ud[--dd],ud[dd]=null;for(;t===xs;)xs=bo[--yo],bo[yo]=null,xi=bo[--yo],bo[yo]=null,wi=bo[--yo],bo[yo]=null}function a5(t,e){bo[yo++]=wi,bo[yo++]=xi,bo[yo++]=xs,wi=e.id,xi=e.overflow,xs=t}var Dn=null,Re=null,Zt=!1,bs=null,So=!1,xw=Error(j(519));function As(t){var e=Error(j(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw om(vo(e,t)),xw}function gD(t){var e=t.stateNode,n=t.type,r=t.memoizedProps;switch(e[On]=t,e[wr]=r,n){case"dialog":Yt("cancel",e),Yt("close",e);break;case"iframe":case"object":case"embed":Yt("load",e);break;case"video":case"audio":for(n=0;n<lm.length;n++)Yt(lm[n],e);break;case"source":Yt("error",e);break;case"img":case"image":case"link":Yt("error",e),Yt("load",e);break;case"details":Yt("toggle",e);break;case"input":Yt("invalid",e),UL(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Yt("invalid",e);break;case"textarea":Yt("invalid",e),PL(e,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||r.suppressHydrationWarning===!0||G3(e.textContent,n)?(r.popover!=null&&(Yt("beforetoggle",e),Yt("toggle",e)),r.onScroll!=null&&Yt("scroll",e),r.onScrollEnd!=null&&Yt("scrollend",e),r.onClick!=null&&(e.onclick=ua),e=!0):e=!1,e||As(t,!0)}function hD(t){for(Dn=t.return;Dn;)switch(Dn.tag){case 5:case 31:case 13:So=!1;return;case 27:case 3:So=!0;return;default:Dn=Dn.return}}function Ju(t){if(t!==Dn)return!1;if(!Zt)return hD(t),Zt=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Xw(t.type,t.memoizedProps)),n=!n),n&&Re&&As(t),hD(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(j(317));Re=oL(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(j(317));Re=oL(t)}else e===27?(e=Re,Ns(t.type)?(t=tx,tx=null,Re=t):Re=e):Re=Dn?To(t.stateNode.nextSibling):null;return!0}function zl(){Re=Dn=null,Zt=!1}function GT(){var t=bs;return t!==null&&(Er===null?Er=t:Er.push.apply(Er,t),bs=null),t}function om(t){bs===null?bs=[t]:bs.push(t)}var Aw=Ii(null),Wl=null,da=null;function ss(t,e,n){xe(Aw,e._currentValue),e._currentValue=n}function pa(t){t._currentValue=Aw.current,Rn(Aw)}function kw(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Iw(t,e,n,r){var o=t.child;for(o!==null&&(o.return=t);o!==null;){var i=o.dependencies;if(i!==null){var a=o.child;i=i.firstContext;t:for(;i!==null;){var s=i;i=o;for(var l=0;l<e.length;l++)if(s.context===e[l]){i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),kw(i.return,n,t),r||(a=null);break t}i=s.next}}else if(o.tag===18){if(a=o.return,a===null)throw Error(j(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),kw(a,n,t),a=null}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}}function Od(t,e,n,r){t=null;for(var o=e,i=!1;o!==null;){if(!i){if((o.flags&524288)!==0)i=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var a=o.alternate;if(a===null)throw Error(j(387));if(a=a.memoizedProps,a!==null){var s=o.type;Vr(o.pendingProps.value,a.value)||(t!==null?t.push(s):t=[s])}}else if(o===Jy.current){if(a=o.alternate,a===null)throw Error(j(387));a.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(t!==null?t.push(um):t=[um])}o=o.return}t!==null&&Iw(e,t,n,r),e.flags|=262144}function i_(t){for(t=t.firstContext;t!==null;){if(!Vr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Fl(t){Wl=t,da=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ln(t){return s5(Wl,t)}function Ay(t,e){return Wl===null&&Fl(t),s5(t,e)}function s5(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},da===null){if(t===null)throw Error(j(308));da=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else da=da.next=e;return n}var kW=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,r){t.push(r)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},IW=yn.unstable_scheduleCallback,RW=yn.unstable_NormalPriority,sn={$$typeof:ca,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vx(){return{controller:new kW,data:new Map,refCount:0}}function _m(t){t.refCount--,t.refCount===0&&IW(RW,function(){t.controller.abort()})}var $p=null,Rw=0,Td=0,hd=null;function NW(t,e){if($p===null){var n=$p=[];Rw=0,Td=qx(),hd={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Rw++,e.then(bD,bD),e}function bD(){if(--Rw===0&&$p!==null){hd!==null&&(hd.status="fulfilled");var t=$p;$p=null,Td=0,hd=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function CW(t,e){var n=[],r={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return t.then(function(){r.status="fulfilled",r.value=e;for(var o=0;o<n.length;o++)(0,n[o])(e)},function(o){for(r.status="rejected",r.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),r}var yD=At.S;At.S=function(t,e){S3=Gr(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&NW(t,e),yD!==null&&yD(t,e)};var Ul=Ii(null);function Sx(){var t=Ul.current;return t!==null?t:Se.pooledCache}function Hy(t,e){e===null?xe(Ul,Ul.current):xe(Ul,e.pool)}function l5(){var t=Sx();return t===null?null:{parent:sn._currentValue,pool:t}}var Dd=Error(j(460)),Ex=Error(j(474)),M_=Error(j(542)),a_={then:function(){}};function _D(t){return t=t.status,t==="fulfilled"||t==="rejected"}function c5(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(ua,ua),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,SD(t),t;default:if(typeof e.status=="string")e.then(ua,ua);else{if(t=Se,t!==null&&100<t.shellSuspendCounter)throw Error(j(482));t=e,t.status="pending",t.then(function(r){if(e.status==="pending"){var o=e;o.status="fulfilled",o.value=r}},function(r){if(e.status==="pending"){var o=e;o.status="rejected",o.reason=r}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,SD(t),t}throw Bl=e,Dd}}function Ml(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Bl=n,Dd):n}}var Bl=null;function vD(){if(Bl===null)throw Error(j(459));var t=Bl;return Bl=null,t}function SD(t){if(t===Dd||t===M_)throw Error(j(483))}var bd=null,im=0;function ky(t){var e=im;return im+=1,bd===null&&(bd=[]),c5(bd,t,e)}function Np(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Iy(t,e){throw e.$$typeof===bY?Error(j(525)):(t=Object.prototype.toString.call(e),Error(j(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function u5(t){function e(h,y){if(t){var S=h.deletions;S===null?(h.deletions=[y],h.flags|=16):S.push(y)}}function n(h,y){if(!t)return null;for(;y!==null;)e(h,y),y=y.sibling;return null}function r(h){for(var y=new Map;h!==null;)h.key!==null?y.set(h.key,h):y.set(h.index,h),h=h.sibling;return y}function o(h,y){return h=fa(h,y),h.index=0,h.sibling=null,h}function i(h,y,S){return h.index=S,t?(S=h.alternate,S!==null?(S=S.index,S<y?(h.flags|=67108866,y):S):(h.flags|=67108866,y)):(h.flags|=1048576,y)}function a(h){return t&&h.alternate===null&&(h.flags|=67108866),h}function s(h,y,S,E){return y===null||y.tag!==6?(y=FT(S,h.mode,E),y.return=h,y):(y=o(y,S),y.return=h,y)}function l(h,y,S,E){var R=S.type;return R===ed?d(h,y,S.props.children,E,S.key):y!==null&&(y.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===is&&Ml(R)===y.type)?(y=o(y,S.props),Np(y,S),y.return=h,y):(y=Fy(S.type,S.key,S.props,null,h.mode,E),Np(y,S),y.return=h,y)}function c(h,y,S,E){return y===null||y.tag!==4||y.stateNode.containerInfo!==S.containerInfo||y.stateNode.implementation!==S.implementation?(y=HT(S,h.mode,E),y.return=h,y):(y=o(y,S.children||[]),y.return=h,y)}function d(h,y,S,E,R){return y===null||y.tag!==7?(y=Ll(S,h.mode,E,R),y.return=h,y):(y=o(y,S),y.return=h,y)}function u(h,y,S){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=FT(""+y,h.mode,S),y.return=h,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case yy:return S=Fy(y.type,y.key,y.props,null,h.mode,S),Np(S,y),S.return=h,S;case Lp:return y=HT(y,h.mode,S),y.return=h,y;case is:return y=Ml(y),u(h,y,S)}if(Up(y)||Ip(y))return y=Ll(y,h.mode,S,null),y.return=h,y;if(typeof y.then=="function")return u(h,ky(y),S);if(y.$$typeof===ca)return u(h,Ay(h,y),S);Iy(h,y)}return null}function p(h,y,S,E){var R=y!==null?y.key:null;if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return R!==null?null:s(h,y,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case yy:return S.key===R?l(h,y,S,E):null;case Lp:return S.key===R?c(h,y,S,E):null;case is:return S=Ml(S),p(h,y,S,E)}if(Up(S)||Ip(S))return R!==null?null:d(h,y,S,E,null);if(typeof S.then=="function")return p(h,y,ky(S),E);if(S.$$typeof===ca)return p(h,y,Ay(h,S),E);Iy(h,S)}return null}function f(h,y,S,E,R){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return h=h.get(S)||null,s(y,h,""+E,R);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case yy:return h=h.get(E.key===null?S:E.key)||null,l(y,h,E,R);case Lp:return h=h.get(E.key===null?S:E.key)||null,c(y,h,E,R);case is:return E=Ml(E),f(h,y,S,E,R)}if(Up(E)||Ip(E))return h=h.get(S)||null,d(y,h,E,R,null);if(typeof E.then=="function")return f(h,y,S,ky(E),R);if(E.$$typeof===ca)return f(h,y,S,Ay(y,E),R);Iy(y,E)}return null}function m(h,y,S,E){for(var R=null,C=null,I=y,L=y=0,z=null;I!==null&&L<S.length;L++){I.index>L?(z=I,I=null):z=I.sibling;var U=p(h,I,S[L],E);if(U===null){I===null&&(I=z);break}t&&I&&U.alternate===null&&e(h,I),y=i(U,y,L),C===null?R=U:C.sibling=U,C=U,I=z}if(L===S.length)return n(h,I),Zt&&sa(h,L),R;if(I===null){for(;L<S.length;L++)I=u(h,S[L],E),I!==null&&(y=i(I,y,L),C===null?R=I:C.sibling=I,C=I);return Zt&&sa(h,L),R}for(I=r(I);L<S.length;L++)z=f(I,h,L,S[L],E),z!==null&&(t&&z.alternate!==null&&I.delete(z.key===null?L:z.key),y=i(z,y,L),C===null?R=z:C.sibling=z,C=z);return t&&I.forEach(function(D){return e(h,D)}),Zt&&sa(h,L),R}function _(h,y,S,E){if(S==null)throw Error(j(151));for(var R=null,C=null,I=y,L=y=0,z=null,U=S.next();I!==null&&!U.done;L++,U=S.next()){I.index>L?(z=I,I=null):z=I.sibling;var D=p(h,I,U.value,E);if(D===null){I===null&&(I=z);break}t&&I&&D.alternate===null&&e(h,I),y=i(D,y,L),C===null?R=D:C.sibling=D,C=D,I=z}if(U.done)return n(h,I),Zt&&sa(h,L),R;if(I===null){for(;!U.done;L++,U=S.next())U=u(h,U.value,E),U!==null&&(y=i(U,y,L),C===null?R=U:C.sibling=U,C=U);return Zt&&sa(h,L),R}for(I=r(I);!U.done;L++,U=S.next())U=f(I,h,L,U.value,E),U!==null&&(t&&U.alternate!==null&&I.delete(U.key===null?L:U.key),y=i(U,y,L),C===null?R=U:C.sibling=U,C=U);return t&&I.forEach(function(N){return e(h,N)}),Zt&&sa(h,L),R}function v(h,y,S,E){if(typeof S=="object"&&S!==null&&S.type===ed&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case yy:t:{for(var R=S.key;y!==null;){if(y.key===R){if(R=S.type,R===ed){if(y.tag===7){n(h,y.sibling),E=o(y,S.props.children),E.return=h,h=E;break t}}else if(y.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===is&&Ml(R)===y.type){n(h,y.sibling),E=o(y,S.props),Np(E,S),E.return=h,h=E;break t}n(h,y);break}else e(h,y);y=y.sibling}S.type===ed?(E=Ll(S.props.children,h.mode,E,S.key),E.return=h,h=E):(E=Fy(S.type,S.key,S.props,null,h.mode,E),Np(E,S),E.return=h,h=E)}return a(h);case Lp:t:{for(R=S.key;y!==null;){if(y.key===R)if(y.tag===4&&y.stateNode.containerInfo===S.containerInfo&&y.stateNode.implementation===S.implementation){n(h,y.sibling),E=o(y,S.children||[]),E.return=h,h=E;break t}else{n(h,y);break}else e(h,y);y=y.sibling}E=HT(S,h.mode,E),E.return=h,h=E}return a(h);case is:return S=Ml(S),v(h,y,S,E)}if(Up(S))return m(h,y,S,E);if(Ip(S)){if(R=Ip(S),typeof R!="function")throw Error(j(150));return S=R.call(S),_(h,y,S,E)}if(typeof S.then=="function")return v(h,y,ky(S),E);if(S.$$typeof===ca)return v(h,y,Ay(h,S),E);Iy(h,S)}return typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint"?(S=""+S,y!==null&&y.tag===6?(n(h,y.sibling),E=o(y,S),E.return=h,h=E):(n(h,y),E=FT(S,h.mode,E),E.return=h,h=E),a(h)):n(h,y)}return function(h,y,S,E){try{im=0;var R=v(h,y,S,E);return bd=null,R}catch(I){if(I===Dd||I===M_)throw I;var C=Fr(29,I,null,h.mode);return C.lanes=E,C.return=h,C}finally{}}}var Hl=u5(!0),d5=u5(!1),as=!1;function Tx(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nw(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ys(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function _s(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(le&2)!==0){var o=r.pending;return o===null?e.next=e:(e.next=o.next,o.next=e),r.pending=e,e=r_(t),n5(t,null,n),e}return C_(t,r,e,n),r_(t)}function jp(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,RL(t,n)}}function $T(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=e:i=i.next=e}else o=i=e;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Cw=!1;function qp(){if(Cw){var t=hd;if(t!==null)throw t}}function Vp(t,e,n,r){Cw=!1;var o=t.updateQueue;as=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?i=c:a.next=c,a=l;var d=t.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==a&&(s===null?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l))}if(i!==null){var u=o.baseState;a=0,d=c=l=null,s=i;do{var p=s.lane&-536870913,f=p!==s.lane;if(f?(Jt&p)===p:(r&p)===p){p!==0&&p===Td&&(Cw=!0),d!==null&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});t:{var m=t,_=s;p=e;var v=n;switch(_.tag){case 1:if(m=_.payload,typeof m=="function"){u=m.call(v,u,p);break t}u=m;break t;case 3:m.flags=m.flags&-65537|128;case 0:if(m=_.payload,p=typeof m=="function"?m.call(v,u,p):m,p==null)break t;u=Ne({},u,p);break t;case 2:as=!0}}p=s.callback,p!==null&&(t.flags|=64,f&&(t.flags|=8192),f=o.callbacks,f===null?o.callbacks=[p]:f.push(p))}else f={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(c=d=f,l=u):d=d.next=f,a|=p;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;f=s,s=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);d===null&&(l=u),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=d,i===null&&(o.shared.lanes=0),Is|=a,t.lanes=a,t.memoizedState=u}}function f5(t,e){if(typeof t!="function")throw Error(j(191,t));t.call(e)}function p5(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)f5(n[t],e)}var wd=Ii(null),s_=Ii(0);function ED(t,e){t=_a,xe(s_,t),xe(wd,e),_a=t|e.baseLanes}function Mw(){xe(s_,_a),xe(wd,wd.current)}function wx(){_a=s_.current,Rn(wd),Rn(s_)}var Yr=Ii(null),Eo=null;function ls(t){var e=t.alternate;xe(Ke,Ke.current&1),xe(Yr,t),Eo===null&&(e===null||wd.current!==null||e.memoizedState!==null)&&(Eo=t)}function Ow(t){xe(Ke,Ke.current),xe(Yr,t),Eo===null&&(Eo=t)}function m5(t){t.tag===22?(xe(Ke,Ke.current),xe(Yr,t),Eo===null&&(Eo=t)):cs(t)}function cs(){xe(Ke,Ke.current),xe(Yr,Yr.current)}function zr(t){Rn(Yr),Eo===t&&(Eo=null),Rn(Ke)}var Ke=Ii(0);function l_(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Qw(n)||Zw(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var ha=0,zt=null,ge=null,on=null,c_=!1,yd=!1,Gl=!1,u_=0,am=0,_d=null,MW=0;function Ve(){throw Error(j(321))}function xx(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Vr(t[n],e[n]))return!1;return!0}function Ax(t,e,n,r,o,i){return ha=i,zt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,At.H=t===null||t.memoizedState===null?q5:Bx,Gl=!1,i=n(r,o),Gl=!1,yd&&(i=h5(e,n,r,o)),g5(t),i}function g5(t){At.H=sm;var e=ge!==null&&ge.next!==null;if(ha=0,on=ge=zt=null,c_=!1,am=0,_d=null,e)throw Error(j(300));t===null||ln||(t=t.dependencies,t!==null&&i_(t)&&(ln=!0))}function h5(t,e,n,r){zt=t;var o=0;do{if(yd&&(_d=null),am=0,yd=!1,25<=o)throw Error(j(301));if(o+=1,on=ge=null,t.updateQueue!=null){var i=t.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}At.H=V5,i=e(n,r)}while(yd);return i}function OW(){var t=At.H,e=t.useState()[0];return e=typeof e.then=="function"?vm(e):e,t=t.useState()[0],(ge!==null?ge.memoizedState:null)!==t&&(zt.flags|=1024),e}function kx(){var t=u_!==0;return u_=0,t}function Ix(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function Rx(t){if(c_){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}c_=!1}ha=0,on=ge=zt=null,yd=!1,am=u_=0,_d=null}function rr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?zt.memoizedState=on=t:on=on.next=t,on}function Xe(){if(ge===null){var t=zt.alternate;t=t!==null?t.memoizedState:null}else t=ge.next;var e=on===null?zt.memoizedState:on.next;if(e!==null)on=e,ge=t;else{if(t===null)throw zt.alternate===null?Error(j(467)):Error(j(310));ge=t,t={memoizedState:ge.memoizedState,baseState:ge.baseState,baseQueue:ge.baseQueue,queue:ge.queue,next:null},on===null?zt.memoizedState=on=t:on=on.next=t}return on}function O_(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vm(t){var e=am;return am+=1,_d===null&&(_d=[]),t=c5(_d,t,e),e=zt,(on===null?e.memoizedState:on.next)===null&&(e=e.alternate,At.H=e===null||e.memoizedState===null?q5:Bx),t}function D_(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return vm(t);if(t.$$typeof===ca)return Ln(t)}throw Error(j(438,String(t)))}function Nx(t){var e=null,n=zt.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var r=zt.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(e={data:r.data.map(function(o){return o.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=O_(),zt.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),r=0;r<t;r++)n[r]=yY;return e.index++,n}function ba(t,e){return typeof e=="function"?e(t):e}function Gy(t){var e=Xe();return Cx(e,ge,t)}function Cx(t,e,n){var r=t.queue;if(r===null)throw Error(j(311));r.lastRenderedReducer=n;var o=t.baseQueue,i=r.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}e.baseQueue=o=i,r.pending=null}if(i=t.baseState,o===null)t.memoizedState=i;else{e=o.next;var s=a=null,l=null,c=e,d=!1;do{var u=c.lane&-536870913;if(u!==c.lane?(Jt&u)===u:(ha&u)===u){var p=c.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),u===Td&&(d=!0);else if((ha&p)===p){c=c.next,p===Td&&(d=!0);continue}else u={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=u,a=i):l=l.next=u,zt.lanes|=p,Is|=p;u=c.action,Gl&&n(i,u),i=c.hasEagerState?c.eagerState:n(i,u)}else p={lane:u,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=p,a=i):l=l.next=p,zt.lanes|=u,Is|=u;c=c.next}while(c!==null&&c!==e);if(l===null?a=i:l.next=s,!Vr(i,t.memoizedState)&&(ln=!0,d&&(n=hd,n!==null)))throw n;t.memoizedState=i,t.baseState=a,t.baseQueue=l,r.lastRenderedState=i}return o===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function jT(t){var e=Xe(),n=e.queue;if(n===null)throw Error(j(311));n.lastRenderedReducer=t;var r=n.dispatch,o=n.pending,i=e.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=t(i,a.action),a=a.next;while(a!==o);Vr(i,e.memoizedState)||(ln=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function b5(t,e,n){var r=zt,o=Xe(),i=Zt;if(i){if(n===void 0)throw Error(j(407));n=n()}else n=e();var a=!Vr((ge||o).memoizedState,n);if(a&&(o.memoizedState=n,ln=!0),o=o.queue,Mx(v5.bind(null,r,o,t),[t]),o.getSnapshot!==e||a||on!==null&&on.memoizedState.tag&1){if(r.flags|=2048,xd(9,{destroy:void 0},_5.bind(null,r,o,n,e),null),Se===null)throw Error(j(349));i||(ha&127)!==0||y5(r,e,n)}return n}function y5(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=zt.updateQueue,e===null?(e=O_(),zt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function _5(t,e,n,r){e.value=n,e.getSnapshot=r,S5(e)&&E5(t)}function v5(t,e,n){return n(function(){S5(e)&&E5(t)})}function S5(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Vr(t,n)}catch{return!0}}function E5(t){var e=Yl(t,2);e!==null&&Tr(e,t,2)}function Dw(t){var e=rr();if(typeof t=="function"){var n=t;if(t=n(),Gl){ds(!0);try{n()}finally{ds(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:t},e}function T5(t,e,n,r){return t.baseState=n,Cx(t,ge,typeof r=="function"?r:ba)}function DW(t,e,n,r,o){if(U_(t))throw Error(j(485));if(t=e.action,t!==null){var i={payload:o,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){i.listeners.push(a)}};At.T!==null?n(!0):i.isTransition=!1,r(i),n=e.pending,n===null?(i.next=e.pending=i,w5(e,i)):(i.next=n.next,e.pending=n.next=i)}}function w5(t,e){var n=e.action,r=e.payload,o=t.state;if(e.isTransition){var i=At.T,a={};At.T=a;try{var s=n(o,r),l=At.S;l!==null&&l(a,s),TD(t,e,s)}catch(c){Lw(t,e,c)}finally{i!==null&&a.types!==null&&(i.types=a.types),At.T=i}}else try{i=n(o,r),TD(t,e,i)}catch(c){Lw(t,e,c)}}function TD(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){wD(t,e,r)},function(r){return Lw(t,e,r)}):wD(t,e,n)}function wD(t,e,n){e.status="fulfilled",e.value=n,x5(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,w5(t,n)))}function Lw(t,e,n){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=n,x5(e),e=e.next;while(e!==r)}t.action=null}function x5(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function A5(t,e){return e}function xD(t,e){if(Zt){var n=Se.formState;if(n!==null){t:{var r=zt;if(Zt){if(Re){e:{for(var o=Re,i=So;o.nodeType!==8;){if(!i){o=null;break e}if(o=To(o.nextSibling),o===null){o=null;break e}}i=o.data,o=i==="F!"||i==="F"?o:null}if(o){Re=To(o.nextSibling),r=o.data==="F!";break t}}As(r)}r=!1}r&&(e=n[0])}}return n=rr(),n.memoizedState=n.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:A5,lastRenderedState:e},n.queue=r,n=G5.bind(null,zt,r),r.dispatch=n,r=Dw(!1),i=Ux.bind(null,zt,!1,r.queue),r=rr(),o={state:e,dispatch:null,action:t,pending:null},r.queue=o,n=DW.bind(null,zt,o,i,n),o.dispatch=n,r.memoizedState=t,[e,n,!1]}function AD(t){var e=Xe();return k5(e,ge,t)}function k5(t,e,n){if(e=Cx(t,e,A5)[0],t=Gy(ba)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=vm(e)}catch(a){throw a===Dd?M_:a}else r=e;e=Xe();var o=e.queue,i=o.dispatch;return n!==e.memoizedState&&(zt.flags|=2048,xd(9,{destroy:void 0},LW.bind(null,o,n),null)),[r,i,t]}function LW(t,e){t.action=e}function kD(t){var e=Xe(),n=ge;if(n!==null)return k5(e,n,t);Xe(),e=e.memoizedState,n=Xe();var r=n.queue.dispatch;return n.memoizedState=t,[e,r,!1]}function xd(t,e,n,r){return t={tag:t,create:n,deps:r,inst:e,next:null},e=zt.updateQueue,e===null&&(e=O_(),zt.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t),t}function I5(){return Xe().memoizedState}function $y(t,e,n,r){var o=rr();zt.flags|=t,o.memoizedState=xd(1|e,{destroy:void 0},n,r===void 0?null:r)}function L_(t,e,n,r){var o=Xe();r=r===void 0?null:r;var i=o.memoizedState.inst;ge!==null&&r!==null&&xx(r,ge.memoizedState.deps)?o.memoizedState=xd(e,i,n,r):(zt.flags|=t,o.memoizedState=xd(1|e,i,n,r))}function ID(t,e){$y(8390656,8,t,e)}function Mx(t,e){L_(2048,8,t,e)}function UW(t){zt.flags|=4;var e=zt.updateQueue;if(e===null)e=O_(),zt.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function R5(t){var e=Xe().memoizedState;return UW({ref:e,nextImpl:t}),function(){if((le&2)!==0)throw Error(j(440));return e.impl.apply(void 0,arguments)}}function N5(t,e){return L_(4,2,t,e)}function C5(t,e){return L_(4,4,t,e)}function M5(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function O5(t,e,n){n=n!=null?n.concat([t]):null,L_(4,4,M5.bind(null,e,t),n)}function Ox(){}function D5(t,e){var n=Xe();e=e===void 0?null:e;var r=n.memoizedState;return e!==null&&xx(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function L5(t,e){var n=Xe();e=e===void 0?null:e;var r=n.memoizedState;if(e!==null&&xx(e,r[1]))return r[0];if(r=t(),Gl){ds(!0);try{t()}finally{ds(!1)}}return n.memoizedState=[r,e],r}function Dx(t,e,n){return n===void 0||(ha&1073741824)!==0&&(Jt&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=T3(),zt.lanes|=t,Is|=t,n)}function U5(t,e,n,r){return Vr(n,e)?n:wd.current!==null?(t=Dx(t,n,r),Vr(t,e)||(ln=!0),t):(ha&42)===0||(ha&1073741824)!==0&&(Jt&261930)===0?(ln=!0,t.memoizedState=n):(t=T3(),zt.lanes|=t,Is|=t,e)}function B5(t,e,n,r,o){var i=ce.p;ce.p=i!==0&&8>i?i:8;var a=At.T,s={};At.T=s,Ux(t,!1,e,n);try{var l=o(),c=At.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var d=CW(l,r);Yp(t,e,d,qr(t))}else Yp(t,e,r,qr(t))}catch(u){Yp(t,e,{then:function(){},status:"rejected",reason:u},qr())}finally{ce.p=i,a!==null&&s.types!==null&&(a.types=s.types),At.T=a}}function BW(){}function Uw(t,e,n,r){if(t.tag!==5)throw Error(j(476));var o=P5(t).queue;B5(t,o,e,Dl,n===null?BW:function(){return z5(t),n(r)})}function P5(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Dl,baseState:Dl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:Dl},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function z5(t){var e=P5(t);e.next===null&&(e=t.alternate.memoizedState),Yp(t,e.next.queue,{},qr())}function Lx(){return Ln(um)}function F5(){return Xe().memoizedState}function H5(){return Xe().memoizedState}function PW(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=qr();t=ys(n);var r=_s(e,t,n);r!==null&&(Tr(r,e,n),jp(r,e,n)),e={cache:vx()},t.payload=e;return}e=e.return}}function zW(t,e,n){var r=qr();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},U_(t)?$5(e,n):(n=hx(t,e,n,r),n!==null&&(Tr(n,t,r),j5(n,e,r)))}function G5(t,e,n){var r=qr();Yp(t,e,n,r)}function Yp(t,e,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(U_(t))$5(e,o);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Vr(s,a))return C_(t,e,o,0),Se===null&&N_(),!1}catch{}finally{}if(n=hx(t,e,o,r),n!==null)return Tr(n,t,r),j5(n,e,r),!0}return!1}function Ux(t,e,n,r){if(r={lane:2,revertLane:qx(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},U_(t)){if(e)throw Error(j(479))}else e=hx(t,n,r,2),e!==null&&Tr(e,t,2)}function U_(t){var e=t.alternate;return t===zt||e!==null&&e===zt}function $5(t,e){yd=c_=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function j5(t,e,n){if((n&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,RL(t,n)}}var sm={readContext:Ln,use:D_,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useLayoutEffect:Ve,useInsertionEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useSyncExternalStore:Ve,useId:Ve,useHostTransitionStatus:Ve,useFormState:Ve,useActionState:Ve,useOptimistic:Ve,useMemoCache:Ve,useCacheRefresh:Ve};sm.useEffectEvent=Ve;var q5={readContext:Ln,use:D_,useCallback:function(t,e){return rr().memoizedState=[t,e===void 0?null:e],t},useContext:Ln,useEffect:ID,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,$y(4194308,4,M5.bind(null,e,t),n)},useLayoutEffect:function(t,e){return $y(4194308,4,t,e)},useInsertionEffect:function(t,e){$y(4,2,t,e)},useMemo:function(t,e){var n=rr();e=e===void 0?null:e;var r=t();if(Gl){ds(!0);try{t()}finally{ds(!1)}}return n.memoizedState=[r,e],r},useReducer:function(t,e,n){var r=rr();if(n!==void 0){var o=n(e);if(Gl){ds(!0);try{n(e)}finally{ds(!1)}}}else o=e;return r.memoizedState=r.baseState=o,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:o},r.queue=t,t=t.dispatch=zW.bind(null,zt,t),[r.memoizedState,t]},useRef:function(t){var e=rr();return t={current:t},e.memoizedState=t},useState:function(t){t=Dw(t);var e=t.queue,n=G5.bind(null,zt,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Ox,useDeferredValue:function(t,e){var n=rr();return Dx(n,t,e)},useTransition:function(){var t=Dw(!1);return t=B5.bind(null,zt,t.queue,!0,!1),rr().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var r=zt,o=rr();if(Zt){if(n===void 0)throw Error(j(407));n=n()}else{if(n=e(),Se===null)throw Error(j(349));(Jt&127)!==0||y5(r,e,n)}o.memoizedState=n;var i={value:n,getSnapshot:e};return o.queue=i,ID(v5.bind(null,r,i,t),[t]),r.flags|=2048,xd(9,{destroy:void 0},_5.bind(null,r,i,n,e),null),n},useId:function(){var t=rr(),e=Se.identifierPrefix;if(Zt){var n=xi,r=wi;n=(r&~(1<<32-jr(r)-1)).toString(32)+n,e="_"+e+"R_"+n,n=u_++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=MW++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Lx,useFormState:xD,useActionState:xD,useOptimistic:function(t){var e=rr();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Ux.bind(null,zt,!0,n),n.dispatch=e,[t,e]},useMemoCache:Nx,useCacheRefresh:function(){return rr().memoizedState=PW.bind(null,zt)},useEffectEvent:function(t){var e=rr(),n={impl:t};return e.memoizedState=n,function(){if((le&2)!==0)throw Error(j(440));return n.impl.apply(void 0,arguments)}}},Bx={readContext:Ln,use:D_,useCallback:D5,useContext:Ln,useEffect:Mx,useImperativeHandle:O5,useInsertionEffect:N5,useLayoutEffect:C5,useMemo:L5,useReducer:Gy,useRef:I5,useState:function(){return Gy(ba)},useDebugValue:Ox,useDeferredValue:function(t,e){var n=Xe();return U5(n,ge.memoizedState,t,e)},useTransition:function(){var t=Gy(ba)[0],e=Xe().memoizedState;return[typeof t=="boolean"?t:vm(t),e]},useSyncExternalStore:b5,useId:F5,useHostTransitionStatus:Lx,useFormState:AD,useActionState:AD,useOptimistic:function(t,e){var n=Xe();return T5(n,ge,t,e)},useMemoCache:Nx,useCacheRefresh:H5};Bx.useEffectEvent=R5;var V5={readContext:Ln,use:D_,useCallback:D5,useContext:Ln,useEffect:Mx,useImperativeHandle:O5,useInsertionEffect:N5,useLayoutEffect:C5,useMemo:L5,useReducer:jT,useRef:I5,useState:function(){return jT(ba)},useDebugValue:Ox,useDeferredValue:function(t,e){var n=Xe();return ge===null?Dx(n,t,e):U5(n,ge.memoizedState,t,e)},useTransition:function(){var t=jT(ba)[0],e=Xe().memoizedState;return[typeof t=="boolean"?t:vm(t),e]},useSyncExternalStore:b5,useId:F5,useHostTransitionStatus:Lx,useFormState:kD,useActionState:kD,useOptimistic:function(t,e){var n=Xe();return ge!==null?T5(n,ge,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Nx,useCacheRefresh:H5};V5.useEffectEvent=R5;function qT(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Ne({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Bw={enqueueSetState:function(t,e,n){t=t._reactInternals;var r=qr(),o=ys(r);o.payload=e,n!=null&&(o.callback=n),e=_s(t,o,r),e!==null&&(Tr(e,t,r),jp(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=qr(),o=ys(r);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=_s(t,o,r),e!==null&&(Tr(e,t,r),jp(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=qr(),r=ys(n);r.tag=2,e!=null&&(r.callback=e),e=_s(t,r,n),e!==null&&(Tr(e,t,n),jp(e,t,n))}};function RD(t,e,n,r,o,i,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,a):e.prototype&&e.prototype.isPureReactComponent?!nm(n,r)||!nm(o,i):!0}function ND(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Bw.enqueueReplaceState(e,e.state,null)}function $l(t,e){var n=e;if("ref"in e){n={};for(var r in e)r!=="ref"&&(n[r]=e[r])}if(t=t.defaultProps){n===e&&(n=Ne({},n));for(var o in t)n[o]===void 0&&(n[o]=t[o])}return n}function Y5(t){n_(t)}function W5(t){console.error(t)}function K5(t){n_(t)}function d_(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function CD(t,e,n){try{var r=t.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Pw(t,e,n){return n=ys(n),n.tag=3,n.payload={element:null},n.callback=function(){d_(t,e)},n}function X5(t){return t=ys(t),t.tag=3,t}function J5(t,e,n,r){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var i=r.value;t.payload=function(){return o(i)},t.callback=function(){CD(e,n,r)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){CD(e,n,r),typeof o!="function"&&(vs===null?vs=new Set([this]):vs.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function FW(t,e,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=n.alternate,e!==null&&Od(e,n,o,!0),n=Yr.current,n!==null){switch(n.tag){case 31:case 13:return Eo===null?h_():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===a_?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([r]):e.add(r),nw(t,r,o)),!1;case 22:return n.flags|=65536,r===a_?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([r]):n.add(r)),nw(t,r,o)),!1}throw Error(j(435,n.tag))}return nw(t,r,o),h_(),!1}if(Zt)return e=Yr.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=o,r!==xw&&(t=Error(j(422),{cause:r}),om(vo(t,n)))):(r!==xw&&(e=Error(j(423),{cause:r}),om(vo(e,n))),t=t.current.alternate,t.flags|=65536,o&=-o,t.lanes|=o,r=vo(r,n),o=Pw(t.stateNode,r,o),$T(t,o),Ye!==4&&(Ye=2)),!1;var i=Error(j(520),{cause:r});if(i=vo(i,n),Xp===null?Xp=[i]:Xp.push(i),Ye!==4&&(Ye=2),e===null)return!0;r=vo(r,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=o&-o,n.lanes|=t,t=Pw(n.stateNode,r,t),$T(n,t),!1;case 1:if(e=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(vs===null||!vs.has(i))))return n.flags|=65536,o&=-o,n.lanes|=o,o=X5(o),J5(o,t,n,r),$T(n,o),!1}n=n.return}while(n!==null);return!1}var Px=Error(j(461)),ln=!1;function Mn(t,e,n,r){e.child=t===null?d5(e,null,n,r):Hl(e,t.child,n,r)}function MD(t,e,n,r,o){n=n.render;var i=e.ref;if("ref"in r){var a={};for(var s in r)s!=="ref"&&(a[s]=r[s])}else a=r;return Fl(e),r=Ax(t,e,n,a,i,o),s=kx(),t!==null&&!ln?(Ix(t,e,o),ya(t,e,o)):(Zt&&s&&yx(e),e.flags|=1,Mn(t,e,r,o),e.child)}function OD(t,e,n,r,o){if(t===null){var i=n.type;return typeof i=="function"&&!bx(i)&&i.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=i,Q5(t,e,i,r,o)):(t=Fy(n.type,null,r,e,e.mode,o),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!zx(t,o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:nm,n(a,r)&&t.ref===e.ref)return ya(t,e,o)}return e.flags|=1,t=fa(i,r),t.ref=e.ref,t.return=e,e.child=t}function Q5(t,e,n,r,o){if(t!==null){var i=t.memoizedProps;if(nm(i,r)&&t.ref===e.ref)if(ln=!1,e.pendingProps=r=i,zx(t,o))(t.flags&131072)!==0&&(ln=!0);else return e.lanes=t.lanes,ya(t,e,o)}return zw(t,e,n,r,o)}function Z5(t,e,n,r){var o=r.children,i=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((e.flags&128)!==0){if(i=i!==null?i.baseLanes|n:n,t!==null){for(r=e.child=t.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~i}else r=0,e.child=null;return DD(t,e,i,n,r)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Hy(e,i!==null?i.cachePool:null),i!==null?ED(e,i):Mw(),m5(e);else return r=e.lanes=536870912,DD(t,e,i!==null?i.baseLanes|n:n,n,r)}else i!==null?(Hy(e,i.cachePool),ED(e,i),cs(e),e.memoizedState=null):(t!==null&&Hy(e,null),Mw(),cs(e));return Mn(t,e,o,n),e.child}function Pp(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function DD(t,e,n,r,o){var i=Sx();return i=i===null?null:{parent:sn._currentValue,pool:i},e.memoizedState={baseLanes:n,cachePool:i},t!==null&&Hy(e,null),Mw(),m5(e),t!==null&&Od(t,e,r,!0),e.childLanes=o,null}function jy(t,e){return e=f_({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function LD(t,e,n){return Hl(e,t.child,null,n),t=jy(e,e.pendingProps),t.flags|=2,zr(e),e.memoizedState=null,t}function HW(t,e,n){var r=e.pendingProps,o=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(Zt){if(r.mode==="hidden")return t=jy(e,r),e.lanes=536870912,Pp(null,t);if(Ow(e),(t=Re)?(t=q3(t,So),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:xs!==null?{id:wi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},n=o5(t),n.return=e,e.child=n,Dn=e,Re=null)):t=null,t===null)throw As(e);return e.lanes=536870912,null}return jy(e,r)}var i=t.memoizedState;if(i!==null){var a=i.dehydrated;if(Ow(e),o)if(e.flags&256)e.flags&=-257,e=LD(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(j(558));else if(ln||Od(t,e,n,!1),o=(n&t.childLanes)!==0,ln||o){if(r=Se,r!==null&&(a=NL(r,n),a!==0&&a!==i.retryLane))throw i.retryLane=a,Yl(t,a),Tr(r,t,a),Px;h_(),e=LD(t,e,n)}else t=i.treeContext,Re=To(a.nextSibling),Dn=e,Zt=!0,bs=null,So=!1,t!==null&&a5(e,t),e=jy(e,r),e.flags|=4096;return e}return t=fa(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function qy(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(j(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function zw(t,e,n,r,o){return Fl(e),n=Ax(t,e,n,r,void 0,o),r=kx(),t!==null&&!ln?(Ix(t,e,o),ya(t,e,o)):(Zt&&r&&yx(e),e.flags|=1,Mn(t,e,n,o),e.child)}function UD(t,e,n,r,o,i){return Fl(e),e.updateQueue=null,n=h5(e,r,n,o),g5(t),r=kx(),t!==null&&!ln?(Ix(t,e,i),ya(t,e,i)):(Zt&&r&&yx(e),e.flags|=1,Mn(t,e,n,i),e.child)}function BD(t,e,n,r,o){if(Fl(e),e.stateNode===null){var i=cd,a=n.contextType;typeof a=="object"&&a!==null&&(i=Ln(a)),i=new n(r,i),e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Bw,e.stateNode=i,i._reactInternals=e,i=e.stateNode,i.props=r,i.state=e.memoizedState,i.refs={},Tx(e),a=n.contextType,i.context=typeof a=="object"&&a!==null?Ln(a):cd,i.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(qT(e,n,a,r),i.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(a=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),a!==i.state&&Bw.enqueueReplaceState(i,i.state,null),Vp(e,r,i,o),qp(),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308),r=!0}else if(t===null){i=e.stateNode;var s=e.memoizedProps,l=$l(n,s);i.props=l;var c=i.context,d=n.contextType;a=cd,typeof d=="object"&&d!==null&&(a=Ln(d));var u=n.getDerivedStateFromProps;d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s||c!==a)&&ND(e,i,r,a),as=!1;var p=e.memoizedState;i.state=p,Vp(e,r,i,o),qp(),c=e.memoizedState,s||p!==c||as?(typeof u=="function"&&(qT(e,n,u,r),c=e.memoizedState),(l=as||RD(e,n,l,r,p,c,a))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(e.flags|=4194308)):(typeof i.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),i.props=r,i.state=c,i.context=a,r=l):(typeof i.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{i=e.stateNode,Nw(t,e),a=e.memoizedProps,d=$l(n,a),i.props=d,u=e.pendingProps,p=i.context,c=n.contextType,l=cd,typeof c=="object"&&c!==null&&(l=Ln(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==u||p!==l)&&ND(e,i,r,l),as=!1,p=e.memoizedState,i.state=p,Vp(e,r,i,o),qp();var f=e.memoizedState;a!==u||p!==f||as||t!==null&&t.dependencies!==null&&i_(t.dependencies)?(typeof s=="function"&&(qT(e,n,s,r),f=e.memoizedState),(d=as||RD(e,n,d,r,p,f,l)||t!==null&&t.dependencies!==null&&i_(t.dependencies))?(c||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,f,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,f,l)),typeof i.componentDidUpdate=="function"&&(e.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=f),i.props=r,i.state=f,i.context=l,r=d):(typeof i.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return i=r,qy(t,e),r=(e.flags&128)!==0,i||r?(i=e.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:i.render(),e.flags|=1,t!==null&&r?(e.child=Hl(e,t.child,null,o),e.child=Hl(e,null,n,o)):Mn(t,e,n,o),e.memoizedState=i.state,t=e.child):t=ya(t,e,o),t}function PD(t,e,n,r){return zl(),e.flags|=256,Mn(t,e,n,r),e.child}var VT={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function YT(t){return{baseLanes:t,cachePool:l5()}}function WT(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Hr),t}function t3(t,e,n){var r=e.pendingProps,o=!1,i=(e.flags&128)!==0,a;if((a=i)||(a=t!==null&&t.memoizedState===null?!1:(Ke.current&2)!==0),a&&(o=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(Zt){if(o?ls(e):cs(e),(t=Re)?(t=q3(t,So),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:xs!==null?{id:wi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},n=o5(t),n.return=e,e.child=n,Dn=e,Re=null)):t=null,t===null)throw As(e);return Zw(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,o?(cs(e),o=e.mode,s=f_({mode:"hidden",children:s},o),r=Ll(r,o,n,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=YT(n),r.childLanes=WT(t,a,n),e.memoizedState=VT,Pp(null,r)):(ls(e),Fw(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(i)e.flags&256?(ls(e),e.flags&=-257,e=KT(t,e,n)):e.memoizedState!==null?(cs(e),e.child=t.child,e.flags|=128,e=null):(cs(e),s=r.fallback,o=e.mode,r=f_({mode:"visible",children:r.children},o),s=Ll(s,o,n,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Hl(e,t.child,null,n),r=e.child,r.memoizedState=YT(n),r.childLanes=WT(t,a,n),e.memoizedState=VT,e=Pp(null,r));else if(ls(e),Zw(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,r=Error(j(419)),r.stack="",r.digest=a,om({value:r,source:null,stack:null}),e=KT(t,e,n)}else if(ln||Od(t,e,n,!1),a=(n&t.childLanes)!==0,ln||a){if(a=Se,a!==null&&(r=NL(a,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Yl(t,r),Tr(a,t,r),Px;Qw(s)||h_(),e=KT(t,e,n)}else Qw(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Re=To(s.nextSibling),Dn=e,Zt=!0,bs=null,So=!1,t!==null&&a5(e,t),e=Fw(e,r.children),e.flags|=4096);return e}return o?(cs(e),s=r.fallback,o=e.mode,l=t.child,c=l.sibling,r=fa(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=fa(c,s):(s=Ll(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,Pp(null,r),r=e.child,s=t.child.memoizedState,s===null?s=YT(n):(o=s.cachePool,o!==null?(l=sn._currentValue,o=o.parent!==l?{parent:l,pool:l}:o):o=l5(),s={baseLanes:s.baseLanes|n,cachePool:o}),r.memoizedState=s,r.childLanes=WT(t,a,n),e.memoizedState=VT,Pp(t.child,r)):(ls(e),n=t.child,t=n.sibling,n=fa(n,{mode:"visible",children:r.children}),n.return=e,n.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=n,e.memoizedState=null,n)}function Fw(t,e){return e=f_({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function f_(t,e){return t=Fr(22,t,null,e),t.lanes=0,t}function KT(t,e,n){return Hl(e,t.child,null,n),t=Fw(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function zD(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),kw(t.return,e,n)}function XT(t,e,n,r,o,i){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:i}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o,a.treeForkCount=i)}function e3(t,e,n){var r=e.pendingProps,o=r.revealOrder,i=r.tail;r=r.children;var a=Ke.current,s=(a&2)!==0;if(s?(a=a&1|2,e.flags|=128):a&=1,xe(Ke,a),Mn(t,e,r,n),r=Zt?rm:0,!s&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&zD(t,n,e);else if(t.tag===19)zD(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(o){case"forwards":for(n=e.child,o=null;n!==null;)t=n.alternate,t!==null&&l_(t)===null&&(o=n),n=n.sibling;n=o,n===null?(o=e.child,e.child=null):(o=n.sibling,n.sibling=null),XT(e,!1,o,n,i,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=e.child,e.child=null;o!==null;){if(t=o.alternate,t!==null&&l_(t)===null){e.child=o;break}t=o.sibling,o.sibling=n,n=o,o=t}XT(e,!0,n,null,i,r);break;case"together":XT(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function ya(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Is|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Od(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(j(153));if(e.child!==null){for(t=e.child,n=fa(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=fa(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function zx(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&i_(t)))}function GW(t,e,n){switch(e.tag){case 3:Qy(e,e.stateNode.containerInfo),ss(e,sn,t.memoizedState.cache),zl();break;case 27:case 5:mw(e);break;case 4:Qy(e,e.stateNode.containerInfo);break;case 10:ss(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Ow(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(ls(e),e.flags|=128,null):(n&e.child.childLanes)!==0?t3(t,e,n):(ls(e),t=ya(t,e,n),t!==null?t.sibling:null);ls(e);break;case 19:var o=(t.flags&128)!==0;if(r=(n&e.childLanes)!==0,r||(Od(t,e,n,!1),r=(n&e.childLanes)!==0),o){if(r)return e3(t,e,n);e.flags|=128}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),xe(Ke,Ke.current),r)break;return null;case 22:return e.lanes=0,Z5(t,e,n,e.pendingProps);case 24:ss(e,sn,t.memoizedState.cache)}return ya(t,e,n)}function n3(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ln=!0;else{if(!zx(t,n)&&(e.flags&128)===0)return ln=!1,GW(t,e,n);ln=(t.flags&131072)!==0}else ln=!1,Zt&&(e.flags&1048576)!==0&&i5(e,rm,e.index);switch(e.lanes=0,e.tag){case 16:t:{var r=e.pendingProps;if(t=Ml(e.elementType),e.type=t,typeof t=="function")bx(t)?(r=$l(t,r),e.tag=1,e=BD(null,e,t,r,n)):(e.tag=0,e=zw(null,e,t,r,n));else{if(t!=null){var o=t.$$typeof;if(o===rx){e.tag=11,e=MD(null,e,t,r,n);break t}else if(o===ox){e.tag=14,e=OD(null,e,t,r,n);break t}}throw e=fw(t)||t,Error(j(306,e,""))}}return e;case 0:return zw(t,e,e.type,e.pendingProps,n);case 1:return r=e.type,o=$l(r,e.pendingProps),BD(t,e,r,o,n);case 3:t:{if(Qy(e,e.stateNode.containerInfo),t===null)throw Error(j(387));r=e.pendingProps;var i=e.memoizedState;o=i.element,Nw(t,e),Vp(e,r,null,n);var a=e.memoizedState;if(r=a.cache,ss(e,sn,r),r!==i.cache&&Iw(e,[sn],n,!0),qp(),r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){e=PD(t,e,r,n);break t}else if(r!==o){o=vo(Error(j(424)),e),om(o),e=PD(t,e,r,n);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Re=To(t.firstChild),Dn=e,Zt=!0,bs=null,So=!0,n=d5(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zl(),r===o){e=ya(t,e,n);break t}Mn(t,e,r,n)}e=e.child}return e;case 26:return qy(t,e),t===null?(n=sL(e.type,null,e.pendingProps,null))?e.memoizedState=n:Zt||(n=e.type,t=e.pendingProps,r=v_(hs.current).createElement(n),r[On]=e,r[wr]=t,Un(r,n,t),In(r),e.stateNode=r):e.memoizedState=sL(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return mw(e),t===null&&Zt&&(r=e.stateNode=V3(e.type,e.pendingProps,hs.current),Dn=e,So=!0,o=Re,Ns(e.type)?(tx=o,Re=To(r.firstChild)):Re=o),Mn(t,e,e.pendingProps.children,n),qy(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Zt&&((o=r=Re)&&(r=hK(r,e.type,e.pendingProps,So),r!==null?(e.stateNode=r,Dn=e,Re=To(r.firstChild),So=!1,o=!0):o=!1),o||As(e)),mw(e),o=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,r=i.children,Xw(o,i)?r=null:a!==null&&Xw(o,a)&&(e.flags|=32),e.memoizedState!==null&&(o=Ax(t,e,OW,null,null,n),um._currentValue=o),qy(t,e),Mn(t,e,r,n),e.child;case 6:return t===null&&Zt&&((t=n=Re)&&(n=bK(n,e.pendingProps,So),n!==null?(e.stateNode=n,Dn=e,Re=null,t=!0):t=!1),t||As(e)),null;case 13:return t3(t,e,n);case 4:return Qy(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Hl(e,null,r,n):Mn(t,e,r,n),e.child;case 11:return MD(t,e,e.type,e.pendingProps,n);case 7:return Mn(t,e,e.pendingProps,n),e.child;case 8:return Mn(t,e,e.pendingProps.children,n),e.child;case 12:return Mn(t,e,e.pendingProps.children,n),e.child;case 10:return r=e.pendingProps,ss(e,e.type,r.value),Mn(t,e,r.children,n),e.child;case 9:return o=e.type._context,r=e.pendingProps.children,Fl(e),o=Ln(o),r=r(o),e.flags|=1,Mn(t,e,r,n),e.child;case 14:return OD(t,e,e.type,e.pendingProps,n);case 15:return Q5(t,e,e.type,e.pendingProps,n);case 19:return e3(t,e,n);case 31:return HW(t,e,n);case 22:return Z5(t,e,n,e.pendingProps);case 24:return Fl(e),r=Ln(sn),t===null?(o=Sx(),o===null&&(o=Se,i=vx(),o.pooledCache=i,i.refCount++,i!==null&&(o.pooledCacheLanes|=n),o=i),e.memoizedState={parent:r,cache:o},Tx(e),ss(e,sn,o)):((t.lanes&n)!==0&&(Nw(t,e),Vp(e,null,null,n),qp()),o=t.memoizedState,i=e.memoizedState,o.parent!==r?(o={parent:r,cache:r},e.memoizedState=o,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=o),ss(e,sn,r)):(r=i.cache,ss(e,sn,r),r!==o.cache&&Iw(e,[sn],n,!0))),Mn(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(j(156,e.tag))}function ra(t){t.flags|=4}function JT(t,e,n,r,o){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(o&335544128)===o)if(t.stateNode.complete)t.flags|=8192;else if(A3())t.flags|=8192;else throw Bl=a_,Ex}else t.flags&=-16777217}function FD(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!K3(e))if(A3())t.flags|=8192;else throw Bl=a_,Ex}function Ry(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?kL():536870912,t.lanes|=e,Ad|=e)}function Cp(t,e){if(!Zt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Ie(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&65011712,r|=o.flags&65011712,o.return=t,o=o.sibling;else for(o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=t,o=o.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function $W(t,e,n){var r=e.pendingProps;switch(_x(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(e),null;case 1:return Ie(e),null;case 3:return n=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),pa(sn),vd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Ju(e)?ra(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,GT())),Ie(e),null;case 26:var o=e.type,i=e.memoizedState;return t===null?(ra(e),i!==null?(Ie(e),FD(e,i)):(Ie(e),JT(e,o,null,r,n))):i?i!==t.memoizedState?(ra(e),Ie(e),FD(e,i)):(Ie(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&ra(e),Ie(e),JT(e,o,t,r,n)),null;case 27:if(Zy(e),n=hs.current,o=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ra(e);else{if(!r){if(e.stateNode===null)throw Error(j(166));return Ie(e),null}t=ki.current,Ju(e)?gD(e,t):(t=V3(o,r,n),e.stateNode=t,ra(e))}return Ie(e),null;case 5:if(Zy(e),o=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ra(e);else{if(!r){if(e.stateNode===null)throw Error(j(166));return Ie(e),null}if(i=ki.current,Ju(e))gD(e,i);else{var a=v_(hs.current);switch(i){case 1:i=a.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:i=a.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":i=a.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":i=a.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":i=a.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?a.createElement(o,{is:r.is}):a.createElement(o)}}i[On]=e,i[wr]=r;t:for(a=e.child;a!==null;){if(a.tag===5||a.tag===6)i.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break t;for(;a.sibling===null;){if(a.return===null||a.return===e)break t;a=a.return}a.sibling.return=a.return,a=a.sibling}e.stateNode=i;t:switch(Un(i,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break t;case"img":r=!0;break t;default:r=!1}r&&ra(e)}}return Ie(e),JT(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&ra(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(j(166));if(t=hs.current,Ju(e)){if(t=e.stateNode,n=e.memoizedProps,r=null,o=Dn,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}t[On]=e,t=!!(t.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||G3(t.nodeValue,n)),t||As(e,!0)}else t=v_(t).createTextNode(r),t[On]=e,e.stateNode=t}return Ie(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(r=Ju(e),n!==null){if(t===null){if(!r)throw Error(j(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(j(557));t[On]=e}else zl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ie(e),t=!1}else n=GT(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(zr(e),e):(zr(e),null);if((e.flags&128)!==0)throw Error(j(558))}return Ie(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(o=Ju(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(j(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(j(317));o[On]=e}else zl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ie(e),o=!1}else o=GT(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),o=!0;if(!o)return e.flags&256?(zr(e),e):(zr(e),null)}return zr(e),(e.flags&128)!==0?(e.lanes=n,e):(n=r!==null,t=t!==null&&t.memoizedState!==null,n&&(r=e.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==o&&(r.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Ry(e,e.updateQueue),Ie(e),null);case 4:return vd(),t===null&&Vx(e.stateNode.containerInfo),Ie(e),null;case 10:return pa(e.type),Ie(e),null;case 19:if(Rn(Ke),r=e.memoizedState,r===null)return Ie(e),null;if(o=(e.flags&128)!==0,i=r.rendering,i===null)if(o)Cp(r,!1);else{if(Ye!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(i=l_(t),i!==null){for(e.flags|=128,Cp(r,!1),t=i.updateQueue,e.updateQueue=t,Ry(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)r5(n,t),n=n.sibling;return xe(Ke,Ke.current&1|2),Zt&&sa(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&Gr()>m_&&(e.flags|=128,o=!0,Cp(r,!1),e.lanes=4194304)}else{if(!o)if(t=l_(i),t!==null){if(e.flags|=128,o=!0,t=t.updateQueue,e.updateQueue=t,Ry(e,t),Cp(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Zt)return Ie(e),null}else 2*Gr()-r.renderingStartTime>m_&&n!==536870912&&(e.flags|=128,o=!0,Cp(r,!1),e.lanes=4194304);r.isBackwards?(i.sibling=e.child,e.child=i):(t=r.last,t!==null?t.sibling=i:e.child=i,r.last=i)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=Gr(),t.sibling=null,n=Ke.current,xe(Ke,o?n&1|2:n&1),Zt&&sa(e,r.treeForkCount),t):(Ie(e),null);case 22:case 23:return zr(e),wx(),r=e.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(e.flags|=8192):r&&(e.flags|=8192),r?(n&536870912)!==0&&(e.flags&128)===0&&(Ie(e),e.subtreeFlags&6&&(e.flags|=8192)):Ie(e),n=e.updateQueue,n!==null&&Ry(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),r=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),r!==n&&(e.flags|=2048),t!==null&&Rn(Ul),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),pa(sn),Ie(e),null;case 25:return null;case 30:return null}throw Error(j(156,e.tag))}function jW(t,e){switch(_x(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return pa(sn),vd(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Zy(e),null;case 31:if(e.memoizedState!==null){if(zr(e),e.alternate===null)throw Error(j(340));zl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(zr(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(j(340));zl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Rn(Ke),null;case 4:return vd(),null;case 10:return pa(e.type),null;case 22:case 23:return zr(e),wx(),t!==null&&Rn(Ul),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return pa(sn),null;case 25:return null;default:return null}}function r3(t,e){switch(_x(e),e.tag){case 3:pa(sn),vd();break;case 26:case 27:case 5:Zy(e);break;case 4:vd();break;case 31:e.memoizedState!==null&&zr(e);break;case 13:zr(e);break;case 19:Rn(Ke);break;case 10:pa(e.type);break;case 22:case 23:zr(e),wx(),t!==null&&Rn(Ul);break;case 24:pa(sn)}}function Sm(t,e){try{var n=e.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&t)===t){r=void 0;var i=n.create,a=n.inst;r=i(),a.destroy=r}n=n.next}while(n!==o)}}catch(s){fe(e,e.return,s)}}function ks(t,e,n){try{var r=e.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var i=o.next;r=i;do{if((r.tag&t)===t){var a=r.inst,s=a.destroy;if(s!==void 0){a.destroy=void 0,o=e;var l=n,c=s;try{c()}catch(d){fe(o,l,d)}}}r=r.next}while(r!==i)}}catch(d){fe(e,e.return,d)}}function o3(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{p5(e,n)}catch(r){fe(t,t.return,r)}}}function i3(t,e,n){n.props=$l(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(r){fe(t,e,r)}}function Wp(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof n=="function"?t.refCleanup=n(r):n.current=r}}catch(o){fe(t,e,o)}}function Ai(t,e){var n=t.ref,r=t.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(o){fe(t,e,o)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){fe(t,e,o)}else n.current=null}function a3(t){var e=t.type,n=t.memoizedProps,r=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break t;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){fe(t,t.return,o)}}function QT(t,e,n){try{var r=t.stateNode;uK(r,t.type,n,e),r[wr]=e}catch(o){fe(t,t.return,o)}}function s3(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ns(t.type)||t.tag===4}function ZT(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||s3(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ns(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Hw(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ua));else if(r!==4&&(r===27&&Ns(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Hw(t,e,n),t=t.sibling;t!==null;)Hw(t,e,n),t=t.sibling}function p_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(r===27&&Ns(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(p_(t,e,n),t=t.sibling;t!==null;)p_(t,e,n),t=t.sibling}function l3(t){var e=t.stateNode,n=t.memoizedProps;try{for(var r=t.type,o=e.attributes;o.length;)e.removeAttributeNode(o[0]);Un(e,r,n),e[On]=t,e[wr]=n}catch(i){fe(t,t.return,i)}}var la=!1,an=!1,tw=!1,HD=typeof WeakSet=="function"?WeakSet:Set,kn=null;function qW(t,e){if(t=t.containerInfo,Ww=w_,t=KL(t),mx(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.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 t}var a=0,s=-1,l=-1,c=0,d=0,u=t,p=null;e:for(;;){for(var f;u!==n||o!==0&&u.nodeType!==3||(s=a+o),u!==i||r!==0&&u.nodeType!==3||(l=a+r),u.nodeType===3&&(a+=u.nodeValue.length),(f=u.firstChild)!==null;)p=u,u=f;for(;;){if(u===t)break e;if(p===n&&++c===o&&(s=a),p===i&&++d===r&&(l=a),(f=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=f}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Kw={focusedElem:t,selectionRange:n},w_=!1,kn=e;kn!==null;)if(e=kn,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,kn=t;else for(;kn!==null;){switch(e=kn,i=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)o=t[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&i!==null){t=void 0,n=e,o=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var m=$l(n.type,o);t=r.getSnapshotBeforeUpdate(m,i),r.__reactInternalSnapshotBeforeUpdate=t}catch(_){fe(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Jw(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Jw(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(j(163))}if(t=e.sibling,t!==null){t.return=e.return,kn=t;break}kn=e.return}}function c3(t,e,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ia(t,n),r&4&&Sm(5,n);break;case 1:if(ia(t,n),r&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){fe(n,n.return,a)}else{var o=$l(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(o,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){fe(n,n.return,a)}}r&64&&o3(n),r&512&&Wp(n,n.return);break;case 3:if(ia(t,n),r&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{p5(t,e)}catch(a){fe(n,n.return,a)}}break;case 27:e===null&&r&4&&l3(n);case 26:case 5:ia(t,n),e===null&&r&4&&a3(n),r&512&&Wp(n,n.return);break;case 12:ia(t,n);break;case 31:ia(t,n),r&4&&f3(t,n);break;case 13:ia(t,n),r&4&&p3(t,n),r&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=tK.bind(null,n),yK(t,n))));break;case 22:if(r=n.memoizedState!==null||la,!r){e=e!==null&&e.memoizedState!==null||an,o=la;var i=an;la=r,(an=e)&&!i?aa(t,n,(n.subtreeFlags&8772)!==0):ia(t,n),la=o,an=i}break;case 30:break;default:ia(t,n)}}function u3(t){var e=t.alternate;e!==null&&(t.alternate=null,u3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&lx(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ze=null,Sr=!1;function oa(t,e,n){for(n=n.child;n!==null;)d3(t,e,n),n=n.sibling}function d3(t,e,n){if($r&&typeof $r.onCommitFiberUnmount=="function")try{$r.onCommitFiberUnmount(mm,n)}catch{}switch(n.tag){case 26:an||Ai(n,e),oa(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:an||Ai(n,e);var r=ze,o=Sr;Ns(n.type)&&(ze=n.stateNode,Sr=!1),oa(t,e,n),Qp(n.stateNode),ze=r,Sr=o;break;case 5:an||Ai(n,e);case 6:if(r=ze,o=Sr,ze=null,oa(t,e,n),ze=r,Sr=o,ze!==null)if(Sr)try{(ze.nodeType===9?ze.body:ze.nodeName==="HTML"?ze.ownerDocument.body:ze).removeChild(n.stateNode)}catch(i){fe(n,e,i)}else try{ze.removeChild(n.stateNode)}catch(i){fe(n,e,i)}break;case 18:ze!==null&&(Sr?(t=ze,nL(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Nd(t)):nL(ze,n.stateNode));break;case 4:r=ze,o=Sr,ze=n.stateNode.containerInfo,Sr=!0,oa(t,e,n),ze=r,Sr=o;break;case 0:case 11:case 14:case 15:ks(2,n,e),an||ks(4,n,e),oa(t,e,n);break;case 1:an||(Ai(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"&&i3(n,e,r)),oa(t,e,n);break;case 21:oa(t,e,n);break;case 22:an=(r=an)||n.memoizedState!==null,oa(t,e,n),an=r;break;default:oa(t,e,n)}}function f3(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Nd(t)}catch(n){fe(e,e.return,n)}}}function p3(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Nd(t)}catch(n){fe(e,e.return,n)}}function VW(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new HD),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new HD),e;default:throw Error(j(435,t.tag))}}function Ny(t,e){var n=VW(t);e.forEach(function(r){if(!n.has(r)){n.add(r);var o=eK.bind(null,t,r);r.then(o,o)}})}function _r(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],i=t,a=e,s=a;t:for(;s!==null;){switch(s.tag){case 27:if(Ns(s.type)){ze=s.stateNode,Sr=!1;break t}break;case 5:ze=s.stateNode,Sr=!1;break t;case 3:case 4:ze=s.stateNode.containerInfo,Sr=!0;break t}s=s.return}if(ze===null)throw Error(j(160));d3(i,a,o),ze=null,Sr=!1,i=o.alternate,i!==null&&(i.return=null),o.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)m3(e,t),e=e.sibling}var Xo=null;function m3(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:_r(e,t),vr(t),r&4&&(ks(3,t,t.return),Sm(3,t),ks(5,t,t.return));break;case 1:_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),r&64&&la&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=Xo;if(_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),r&4){var i=n!==null?n.memoizedState:null;if(r=t.memoizedState,n===null)if(r===null)if(t.stateNode===null){t:{r=t.type,n=t.memoizedProps,o=o.ownerDocument||o;e:switch(r){case"title":i=o.getElementsByTagName("title")[0],(!i||i[bm]||i[On]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=o.createElement(r),o.head.insertBefore(i,o.querySelector("head > title"))),Un(i,r,n),i[On]=t,In(i),r=i;break t;case"link":var a=cL("link","href",o).get(r+(n.href||""));if(a){for(var s=0;s<a.length;s++)if(i=a[s],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break e}}i=o.createElement(r),Un(i,r,n),o.head.appendChild(i);break;case"meta":if(a=cL("meta","content",o).get(r+(n.content||""))){for(s=0;s<a.length;s++)if(i=a[s],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(s,1);break e}}i=o.createElement(r),Un(i,r,n),o.head.appendChild(i);break;default:throw Error(j(468,r))}i[On]=t,In(i),r=i}t.stateNode=r}else uL(o,t.type,t.stateNode);else t.stateNode=lL(o,r,t.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?uL(o,t.type,t.stateNode):lL(o,r,t.memoizedProps)):r===null&&t.stateNode!==null&&QT(t,t.memoizedProps,n.memoizedProps)}break;case 27:_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),n!==null&&r&4&&QT(t,t.memoizedProps,n.memoizedProps);break;case 5:if(_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),t.flags&32){o=t.stateNode;try{Ed(o,"")}catch(m){fe(t,t.return,m)}}r&4&&t.stateNode!=null&&(o=t.memoizedProps,QT(t,o,n!==null?n.memoizedProps:o)),r&1024&&(tw=!0);break;case 6:if(_r(e,t),vr(t),r&4){if(t.stateNode===null)throw Error(j(162));r=t.memoizedProps,n=t.stateNode;try{n.nodeValue=r}catch(m){fe(t,t.return,m)}}break;case 3:if(Wy=null,o=Xo,Xo=S_(e.containerInfo),_r(e,t),Xo=o,vr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Nd(e.containerInfo)}catch(m){fe(t,t.return,m)}tw&&(tw=!1,g3(t));break;case 4:r=Xo,Xo=S_(t.stateNode.containerInfo),_r(e,t),vr(t),Xo=r;break;case 12:_r(e,t),vr(t);break;case 31:_r(e,t),vr(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ny(t,r)));break;case 13:_r(e,t),vr(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(B_=Gr()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ny(t,r)));break;case 22:o=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=la,d=an;if(la=c||o,an=d||l,_r(e,t),an=d,la=c,vr(t),r&8192)t:for(e=t.stateNode,e._visibility=o?e._visibility&-2:e._visibility|1,o&&(n===null||l||la||an||Ol(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(i=l.stateNode,o)a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{s=l.stateNode;var u=l.memoizedProps.style,p=u!=null&&u.hasOwnProperty("display")?u.display:null;s.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(m){fe(l,l.return,m)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=o?"":l.memoizedProps}catch(m){fe(l,l.return,m)}}}else if(e.tag===18){if(n===null){l=e;try{var f=l.stateNode;o?rL(f,!0):rL(l.stateNode,!1)}catch(m){fe(l,l.return,m)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}r&4&&(r=t.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Ny(t,n))));break;case 19:_r(e,t),vr(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ny(t,r)));break;case 30:break;case 21:break;default:_r(e,t),vr(t)}}function vr(t){var e=t.flags;if(e&2){try{for(var n,r=t.return;r!==null;){if(s3(r)){n=r;break}r=r.return}if(n==null)throw Error(j(160));switch(n.tag){case 27:var o=n.stateNode,i=ZT(t);p_(t,i,o);break;case 5:var a=n.stateNode;n.flags&32&&(Ed(a,""),n.flags&=-33);var s=ZT(t);p_(t,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=ZT(t);Hw(t,c,l);break;default:throw Error(j(161))}}catch(d){fe(t,t.return,d)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function g3(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;g3(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function ia(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)c3(t,e.alternate,e),e=e.sibling}function Ol(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ks(4,e,e.return),Ol(e);break;case 1:Ai(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&i3(e,e.return,n),Ol(e);break;case 27:Qp(e.stateNode);case 26:case 5:Ai(e,e.return),Ol(e);break;case 22:e.memoizedState===null&&Ol(e);break;case 30:Ol(e);break;default:Ol(e)}t=t.sibling}}function aa(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var r=e.alternate,o=t,i=e,a=i.flags;switch(i.tag){case 0:case 11:case 15:aa(o,i,n),Sm(4,i);break;case 1:if(aa(o,i,n),r=i,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(c){fe(r,r.return,c)}if(r=i,o=r.updateQueue,o!==null){var s=r.stateNode;try{var l=o.shared.hiddenCallbacks;if(l!==null)for(o.shared.hiddenCallbacks=null,o=0;o<l.length;o++)f5(l[o],s)}catch(c){fe(r,r.return,c)}}n&&a&64&&o3(i),Wp(i,i.return);break;case 27:l3(i);case 26:case 5:aa(o,i,n),n&&r===null&&a&4&&a3(i),Wp(i,i.return);break;case 12:aa(o,i,n);break;case 31:aa(o,i,n),n&&a&4&&f3(o,i);break;case 13:aa(o,i,n),n&&a&4&&p3(o,i);break;case 22:i.memoizedState===null&&aa(o,i,n),Wp(i,i.return);break;case 30:break;default:aa(o,i,n)}e=e.sibling}}function Fx(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&_m(n))}function Hx(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&_m(t))}function Ko(t,e,n,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)h3(t,e,n,r),e=e.sibling}function h3(t,e,n,r){var o=e.flags;switch(e.tag){case 0:case 11:case 15:Ko(t,e,n,r),o&2048&&Sm(9,e);break;case 1:Ko(t,e,n,r);break;case 3:Ko(t,e,n,r),o&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&_m(t)));break;case 12:if(o&2048){Ko(t,e,n,r),t=e.stateNode;try{var i=e.memoizedProps,a=i.id,s=i.onPostCommit;typeof s=="function"&&s(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){fe(e,e.return,l)}}else Ko(t,e,n,r);break;case 31:Ko(t,e,n,r);break;case 13:Ko(t,e,n,r);break;case 23:break;case 22:i=e.stateNode,a=e.alternate,e.memoizedState!==null?i._visibility&2?Ko(t,e,n,r):Kp(t,e):i._visibility&2?Ko(t,e,n,r):(i._visibility|=2,Zu(t,e,n,r,(e.subtreeFlags&10256)!==0||!1)),o&2048&&Fx(a,e);break;case 24:Ko(t,e,n,r),o&2048&&Hx(e.alternate,e);break;default:Ko(t,e,n,r)}}function Zu(t,e,n,r,o){for(o=o&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var i=t,a=e,s=n,l=r,c=a.flags;switch(a.tag){case 0:case 11:case 15:Zu(i,a,s,l,o),Sm(8,a);break;case 23:break;case 22:var d=a.stateNode;a.memoizedState!==null?d._visibility&2?Zu(i,a,s,l,o):Kp(i,a):(d._visibility|=2,Zu(i,a,s,l,o)),o&&c&2048&&Fx(a.alternate,a);break;case 24:Zu(i,a,s,l,o),o&&c&2048&&Hx(a.alternate,a);break;default:Zu(i,a,s,l,o)}e=e.sibling}}function Kp(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,r=e,o=r.flags;switch(r.tag){case 22:Kp(n,r),o&2048&&Fx(r.alternate,r);break;case 24:Kp(n,r),o&2048&&Hx(r.alternate,r);break;default:Kp(n,r)}e=e.sibling}}var zp=8192;function Qu(t,e,n){if(t.subtreeFlags&zp)for(t=t.child;t!==null;)b3(t,e,n),t=t.sibling}function b3(t,e,n){switch(t.tag){case 26:Qu(t,e,n),t.flags&zp&&t.memoizedState!==null&&NK(n,Xo,t.memoizedState,t.memoizedProps);break;case 5:Qu(t,e,n);break;case 3:case 4:var r=Xo;Xo=S_(t.stateNode.containerInfo),Qu(t,e,n),Xo=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=zp,zp=16777216,Qu(t,e,n),zp=r):Qu(t,e,n));break;default:Qu(t,e,n)}}function y3(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Mp(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var r=e[n];kn=r,v3(r,t)}y3(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_3(t),t=t.sibling}function _3(t){switch(t.tag){case 0:case 11:case 15:Mp(t),t.flags&2048&&ks(9,t,t.return);break;case 3:Mp(t);break;case 12:Mp(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Vy(t)):Mp(t);break;default:Mp(t)}}function Vy(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var r=e[n];kn=r,v3(r,t)}y3(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ks(8,e,e.return),Vy(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Vy(e));break;default:Vy(e)}t=t.sibling}}function v3(t,e){for(;kn!==null;){var n=kn;switch(n.tag){case 0:case 11:case 15:ks(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:_m(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,kn=r;else t:for(n=t;kn!==null;){r=kn;var o=r.sibling,i=r.return;if(u3(r),r===n){kn=null;break t}if(o!==null){o.return=i,kn=o;break t}kn=i}}}var YW={getCacheForType:function(t){var e=Ln(sn),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return Ln(sn).controller.signal}},WW=typeof WeakMap=="function"?WeakMap:Map,le=0,Se=null,Wt=null,Jt=0,de=0,Pr=null,ps=!1,Ld=!1,Gx=!1,_a=0,Ye=0,Is=0,Pl=0,$x=0,Hr=0,Ad=0,Xp=null,Er=null,Gw=!1,B_=0,S3=0,m_=1/0,g_=null,vs=null,bn=0,Ss=null,kd=null,ma=0,$w=0,jw=null,E3=null,Jp=0,qw=null;function qr(){return(le&2)!==0&&Jt!==0?Jt&-Jt:At.T!==null?qx():CL()}function T3(){if(Hr===0)if((Jt&536870912)===0||Zt){var t=vy;vy<<=1,(vy&3932160)===0&&(vy=262144),Hr=t}else Hr=536870912;return t=Yr.current,t!==null&&(t.flags|=32),Hr}function Tr(t,e,n){(t===Se&&(de===2||de===9)||t.cancelPendingCommit!==null)&&(Id(t,0),ms(t,Jt,Hr,!1)),hm(t,n),((le&2)===0||t!==Se)&&(t===Se&&((le&2)===0&&(Pl|=n),Ye===4&&ms(t,Jt,Hr,!1)),Ri(t))}function w3(t,e,n){if((le&6)!==0)throw Error(j(327));var r=!n&&(e&127)===0&&(e&t.expiredLanes)===0||gm(t,e),o=r?JW(t,e):ew(t,e,!0),i=r;do{if(o===0){Ld&&!r&&ms(t,e,0,!1);break}else{if(n=t.current.alternate,i&&!KW(n)){o=ew(t,e,!1),i=!1;continue}if(o===2){if(i=e,t.errorRecoveryDisabledLanes&i)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;t:{var s=t;o=Xp;var l=s.current.memoizedState.isDehydrated;if(l&&(Id(s,a).flags|=256),a=ew(s,a,!1),a!==2){if(Gx&&!l){s.errorRecoveryDisabledLanes|=i,Pl|=i,o=4;break t}i=Er,Er=o,i!==null&&(Er===null?Er=i:Er.push.apply(Er,i))}o=a}if(i=!1,o!==2)continue}}if(o===1){Id(t,0),ms(t,e,0,!0);break}t:{switch(r=t,i=o,i){case 0:case 1:throw Error(j(345));case 4:if((e&4194048)!==e)break;case 6:ms(r,e,Hr,!ps);break t;case 2:Er=null;break;case 3:case 5:break;default:throw Error(j(329))}if((e&62914560)===e&&(o=B_+300-Gr(),10<o)){if(ms(r,e,Hr,!ps),A_(r,0,!0)!==0)break t;ma=e,r.timeoutHandle=j3(GD.bind(null,r,n,Er,g_,Gw,e,Hr,Pl,Ad,ps,i,"Throttled",-0,0),o);break t}GD(r,n,Er,g_,Gw,e,Hr,Pl,Ad,ps,i,null,-0,0)}}break}while(!0);Ri(t)}function GD(t,e,n,r,o,i,a,s,l,c,d,u,p,f){if(t.timeoutHandle=-1,u=e.subtreeFlags,u&8192||(u&16785408)===16785408){u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ua},b3(e,i,u);var m=(i&62914560)===i?B_-Gr():(i&4194048)===i?S3-Gr():0;if(m=CK(u,m),m!==null){ma=i,t.cancelPendingCommit=m(jD.bind(null,t,e,i,n,r,o,a,s,l,d,u,null,p,f)),ms(t,i,a,!c);return}}jD(t,e,i,n,r,o,a,s,l)}function KW(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,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=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ms(t,e,n,r){e&=~$x,e&=~Pl,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var o=e;0<o;){var i=31-jr(o),a=1<<i;r[i]=-1,o&=~a}n!==0&&IL(t,n,e)}function P_(){return(le&6)===0?(Em(0,!1),!1):!0}function jx(){if(Wt!==null){if(de===0)var t=Wt.return;else t=Wt,da=Wl=null,Rx(t),bd=null,im=0,t=Wt;for(;t!==null;)r3(t.alternate,t),t=t.return;Wt=null}}function Id(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,pK(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),ma=0,jx(),Se=t,Wt=n=fa(t.current,null),Jt=e,de=0,Pr=null,ps=!1,Ld=gm(t,e),Gx=!1,Ad=Hr=$x=Pl=Is=Ye=0,Er=Xp=null,Gw=!1,(e&8)!==0&&(e|=e&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=e;0<r;){var o=31-jr(r),i=1<<o;e|=t[o],r&=~i}return _a=e,N_(),n}function x3(t,e){zt=null,At.H=sm,e===Dd||e===M_?(e=vD(),de=3):e===Ex?(e=vD(),de=4):de=e===Px?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Pr=e,Wt===null&&(Ye=1,d_(t,vo(e,t.current)))}function A3(){var t=Yr.current;return t===null?!0:(Jt&4194048)===Jt?Eo===null:(Jt&62914560)===Jt||(Jt&536870912)!==0?t===Eo:!1}function k3(){var t=At.H;return At.H=sm,t===null?sm:t}function I3(){var t=At.A;return At.A=YW,t}function h_(){Ye=4,ps||(Jt&4194048)!==Jt&&Yr.current!==null||(Ld=!0),(Is&134217727)===0&&(Pl&134217727)===0||Se===null||ms(Se,Jt,Hr,!1)}function ew(t,e,n){var r=le;le|=2;var o=k3(),i=I3();(Se!==t||Jt!==e)&&(g_=null,Id(t,e)),e=!1;var a=Ye;t:do try{if(de!==0&&Wt!==null){var s=Wt,l=Pr;switch(de){case 8:jx(),a=6;break t;case 3:case 2:case 9:case 6:Yr.current===null&&(e=!0);var c=de;if(de=0,Pr=null,fd(t,s,l,c),n&&Ld){a=0;break t}break;default:c=de,de=0,Pr=null,fd(t,s,l,c)}}XW(),a=Ye;break}catch(d){x3(t,d)}while(!0);return e&&t.shellSuspendCounter++,da=Wl=null,le=r,At.H=o,At.A=i,Wt===null&&(Se=null,Jt=0,N_()),a}function XW(){for(;Wt!==null;)R3(Wt)}function JW(t,e){var n=le;le|=2;var r=k3(),o=I3();Se!==t||Jt!==e?(g_=null,m_=Gr()+500,Id(t,e)):Ld=gm(t,e);t:do try{if(de!==0&&Wt!==null){e=Wt;var i=Pr;e:switch(de){case 1:de=0,Pr=null,fd(t,e,i,1);break;case 2:case 9:if(_D(i)){de=0,Pr=null,$D(e);break}e=function(){de!==2&&de!==9||Se!==t||(de=7),Ri(t)},i.then(e,e);break t;case 3:de=7;break t;case 4:de=5;break t;case 7:_D(i)?(de=0,Pr=null,$D(e)):(de=0,Pr=null,fd(t,e,i,7));break;case 5:var a=null;switch(Wt.tag){case 26:a=Wt.memoizedState;case 5:case 27:var s=Wt;if(a?K3(a):s.stateNode.complete){de=0,Pr=null;var l=s.sibling;if(l!==null)Wt=l;else{var c=s.return;c!==null?(Wt=c,z_(c)):Wt=null}break e}}de=0,Pr=null,fd(t,e,i,5);break;case 6:de=0,Pr=null,fd(t,e,i,6);break;case 8:jx(),Ye=6;break t;default:throw Error(j(462))}}QW();break}catch(d){x3(t,d)}while(!0);return da=Wl=null,At.H=r,At.A=o,le=n,Wt!==null?0:(Se=null,Jt=0,N_(),Ye)}function QW(){for(;Wt!==null&&!SY();)R3(Wt)}function R3(t){var e=n3(t.alternate,t,_a);t.memoizedProps=t.pendingProps,e===null?z_(t):Wt=e}function $D(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=UD(n,e,e.pendingProps,e.type,void 0,Jt);break;case 11:e=UD(n,e,e.pendingProps,e.type.render,e.ref,Jt);break;case 5:Rx(e);default:r3(n,e),e=Wt=r5(e,_a),e=n3(n,e,_a)}t.memoizedProps=t.pendingProps,e===null?z_(t):Wt=e}function fd(t,e,n,r){da=Wl=null,Rx(e),bd=null,im=0;var o=e.return;try{if(FW(t,o,e,n,Jt)){Ye=1,d_(t,vo(n,t.current)),Wt=null;return}}catch(i){if(o!==null)throw Wt=o,i;Ye=1,d_(t,vo(n,t.current)),Wt=null;return}e.flags&32768?(Zt||r===1?t=!0:Ld||(Jt&536870912)!==0?t=!1:(ps=t=!0,(r===2||r===9||r===3||r===6)&&(r=Yr.current,r!==null&&r.tag===13&&(r.flags|=16384))),N3(e,t)):z_(e)}function z_(t){var e=t;do{if((e.flags&32768)!==0){N3(e,ps);return}t=e.return;var n=$W(e.alternate,e,_a);if(n!==null){Wt=n;return}if(e=e.sibling,e!==null){Wt=e;return}Wt=e=t}while(e!==null);Ye===0&&(Ye=5)}function N3(t,e){do{var n=jW(t.alternate,t);if(n!==null){n.flags&=32767,Wt=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Wt=t;return}Wt=t=n}while(t!==null);Ye=6,Wt=null}function jD(t,e,n,r,o,i,a,s,l){t.cancelPendingCommit=null;do F_();while(bn!==0);if((le&6)!==0)throw Error(j(327));if(e!==null){if(e===t.current)throw Error(j(177));if(i=e.lanes|e.childLanes,i|=gx,CY(t,n,i,a,s,l),t===Se&&(Wt=Se=null,Jt=0),kd=e,Ss=t,ma=n,$w=i,jw=o,E3=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,nK(t_,function(){return L3(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=At.T,At.T=null,o=ce.p,ce.p=2,a=le,le|=4;try{qW(t,e,n)}finally{le=a,ce.p=o,At.T=r}}bn=1,C3(),M3(),O3()}}function C3(){if(bn===1){bn=0;var t=Ss,e=kd,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=At.T,At.T=null;var r=ce.p;ce.p=2;var o=le;le|=4;try{m3(e,t);var i=Kw,a=KL(t.containerInfo),s=i.focusedElem,l=i.selectionRange;if(a!==s&&s&&s.ownerDocument&&WL(s.ownerDocument.documentElement,s)){if(l!==null&&mx(s)){var c=l.start,d=l.end;if(d===void 0&&(d=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(d,s.value.length);else{var u=s.ownerDocument||document,p=u&&u.defaultView||window;if(p.getSelection){var f=p.getSelection(),m=s.textContent.length,_=Math.min(l.start,m),v=l.end===void 0?_:Math.min(l.end,m);!f.extend&&_>v&&(a=v,v=_,_=a);var h=fD(s,_),y=fD(s,v);if(h&&y&&(f.rangeCount!==1||f.anchorNode!==h.node||f.anchorOffset!==h.offset||f.focusNode!==y.node||f.focusOffset!==y.offset)){var S=u.createRange();S.setStart(h.node,h.offset),f.removeAllRanges(),_>v?(f.addRange(S),f.extend(y.node,y.offset)):(S.setEnd(y.node,y.offset),f.addRange(S))}}}}for(u=[],f=s;f=f.parentNode;)f.nodeType===1&&u.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<u.length;s++){var E=u[s];E.element.scrollLeft=E.left,E.element.scrollTop=E.top}}w_=!!Ww,Kw=Ww=null}finally{le=o,ce.p=r,At.T=n}}t.current=e,bn=2}}function M3(){if(bn===2){bn=0;var t=Ss,e=kd,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=At.T,At.T=null;var r=ce.p;ce.p=2;var o=le;le|=4;try{c3(t,e.alternate,e)}finally{le=o,ce.p=r,At.T=n}}bn=3}}function O3(){if(bn===4||bn===3){bn=0,EY();var t=Ss,e=kd,n=ma,r=E3;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?bn=5:(bn=0,kd=Ss=null,D3(t,t.pendingLanes));var o=t.pendingLanes;if(o===0&&(vs=null),sx(n),e=e.stateNode,$r&&typeof $r.onCommitFiberRoot=="function")try{$r.onCommitFiberRoot(mm,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=At.T,o=ce.p,ce.p=2,At.T=null;try{for(var i=t.onRecoverableError,a=0;a<r.length;a++){var s=r[a];i(s.value,{componentStack:s.stack})}}finally{At.T=e,ce.p=o}}(ma&3)!==0&&F_(),Ri(t),o=t.pendingLanes,(n&261930)!==0&&(o&42)!==0?t===qw?Jp++:(Jp=0,qw=t):Jp=0,Em(0,!1)}}function D3(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,_m(e)))}function F_(){return C3(),M3(),O3(),L3()}function L3(){if(bn!==5)return!1;var t=Ss,e=$w;$w=0;var n=sx(ma),r=At.T,o=ce.p;try{ce.p=32>n?32:n,At.T=null,n=jw,jw=null;var i=Ss,a=ma;if(bn=0,kd=Ss=null,ma=0,(le&6)!==0)throw Error(j(331));var s=le;if(le|=4,_3(i.current),h3(i,i.current,a,n),le=s,Em(0,!1),$r&&typeof $r.onPostCommitFiberRoot=="function")try{$r.onPostCommitFiberRoot(mm,i)}catch{}return!0}finally{ce.p=o,At.T=r,D3(t,e)}}function qD(t,e,n){e=vo(n,e),e=Pw(t.stateNode,e,2),t=_s(t,e,2),t!==null&&(hm(t,2),Ri(t))}function fe(t,e,n){if(t.tag===3)qD(t,t,n);else for(;e!==null;){if(e.tag===3){qD(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(vs===null||!vs.has(r))){t=vo(n,t),n=X5(2),r=_s(e,n,2),r!==null&&(J5(n,r,e,t),hm(r,2),Ri(r));break}}e=e.return}}function nw(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new WW;var o=new Set;r.set(e,o)}else o=r.get(e),o===void 0&&(o=new Set,r.set(e,o));o.has(n)||(Gx=!0,o.add(n),t=ZW.bind(null,t,e,n),e.then(t,t))}function ZW(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Se===t&&(Jt&n)===n&&(Ye===4||Ye===3&&(Jt&62914560)===Jt&&300>Gr()-B_?(le&2)===0&&Id(t,0):$x|=n,Ad===Jt&&(Ad=0)),Ri(t)}function U3(t,e){e===0&&(e=kL()),t=Yl(t,e),t!==null&&(hm(t,e),Ri(t))}function tK(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),U3(t,n)}function eK(t,e){var n=0;switch(t.tag){case 31:case 13:var r=t.stateNode,o=t.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(j(314))}r!==null&&r.delete(e),U3(t,n)}function nK(t,e){return ix(t,e)}var b_=null,td=null,Vw=!1,y_=!1,rw=!1,gs=0;function Ri(t){t!==td&&t.next===null&&(td===null?b_=td=t:td=td.next=t),y_=!0,Vw||(Vw=!0,oK())}function Em(t,e){if(!rw&&y_){rw=!0;do for(var n=!1,r=b_;r!==null;){if(!e)if(t!==0){var o=r.pendingLanes;if(o===0)var i=0;else{var a=r.suspendedLanes,s=r.pingedLanes;i=(1<<31-jr(42|t)+1)-1,i&=o&~(a&~s),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,VD(r,i))}else i=Jt,i=A_(r,r===Se?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||gm(r,i)||(n=!0,VD(r,i));r=r.next}while(n);rw=!1}}function rK(){B3()}function B3(){y_=Vw=!1;var t=0;gs!==0&&fK()&&(t=gs);for(var e=Gr(),n=null,r=b_;r!==null;){var o=r.next,i=P3(r,e);i===0?(r.next=null,n===null?b_=o:n.next=o,o===null&&(td=n)):(n=r,(t!==0||(i&3)!==0)&&(y_=!0)),r=o}bn!==0&&bn!==5||Em(t,!1),gs!==0&&(gs=0)}function P3(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,o=t.expirationTimes,i=t.pendingLanes&-62914561;0<i;){var a=31-jr(i),s=1<<a,l=o[a];l===-1?((s&n)===0||(s&r)!==0)&&(o[a]=NY(s,e)):l<=e&&(t.expiredLanes|=s),i&=~s}if(e=Se,n=Jt,n=A_(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,n===0||t===e&&(de===2||de===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&MT(r),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||gm(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(r!==null&&MT(r),sx(n)){case 2:case 8:n=xL;break;case 32:n=t_;break;case 268435456:n=AL;break;default:n=t_}return r=z3.bind(null,t),n=ix(n,r),t.callbackPriority=e,t.callbackNode=n,e}return r!==null&&r!==null&&MT(r),t.callbackPriority=2,t.callbackNode=null,2}function z3(t,e){if(bn!==0&&bn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(F_()&&t.callbackNode!==n)return null;var r=Jt;return r=A_(t,t===Se?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(w3(t,r,e),P3(t,Gr()),t.callbackNode!=null&&t.callbackNode===n?z3.bind(null,t):null)}function VD(t,e){if(F_())return null;w3(t,e,!0)}function oK(){mK(function(){(le&6)!==0?ix(wL,rK):B3()})}function qx(){if(gs===0){var t=Td;t===0&&(t=_y,_y<<=1,(_y&261888)===0&&(_y=256)),gs=t}return gs}function YD(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:By(""+t)}function WD(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function iK(t,e,n,r,o){if(e==="submit"&&n&&n.stateNode===o){var i=YD((o[wr]||null).action),a=r.submitter;a&&(e=(e=a[wr]||null)?YD(e.formAction):a.getAttribute("formAction"),e!==null&&(i=e,a=null));var s=new k_("action","action",null,r,o);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(gs!==0){var l=a?WD(o,a):new FormData(o);Uw(n,{pending:!0,data:l,method:o.method,action:i},null,l)}}else typeof i=="function"&&(s.preventDefault(),l=a?WD(o,a):new FormData(o),Uw(n,{pending:!0,data:l,method:o.method,action:i},i,l))},currentTarget:o}]})}}for(Cy=0;Cy<ww.length;Cy++)My=ww[Cy],KD=My.toLowerCase(),XD=My[0].toUpperCase()+My.slice(1),Jo(KD,"on"+XD);var My,KD,XD,Cy;Jo(JL,"onAnimationEnd");Jo(QL,"onAnimationIteration");Jo(ZL,"onAnimationStart");Jo("dblclick","onDoubleClick");Jo("focusin","onFocus");Jo("focusout","onBlur");Jo(TW,"onTransitionRun");Jo(wW,"onTransitionStart");Jo(xW,"onTransitionCancel");Jo(t5,"onTransitionEnd");Sd("onMouseEnter",["mouseout","mouseover"]);Sd("onMouseLeave",["mouseout","mouseover"]);Sd("onPointerEnter",["pointerout","pointerover"]);Sd("onPointerLeave",["pointerout","pointerover"]);jl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));jl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));jl("onBeforeInput",["compositionend","keypress","textInput","paste"]);jl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));jl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));jl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lm="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(" "),aK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(lm));function F3(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],o=r.event;r=r.listeners;t:{var i=void 0;if(e)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break t;i=s,o.currentTarget=c;try{i(o)}catch(d){n_(d)}o.currentTarget=null,i=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break t;i=s,o.currentTarget=c;try{i(o)}catch(d){n_(d)}o.currentTarget=null,i=l}}}}function Yt(t,e){var n=e[hw];n===void 0&&(n=e[hw]=new Set);var r=t+"__bubble";n.has(r)||(H3(e,t,2,!1),n.add(r))}function ow(t,e,n){var r=0;e&&(r|=4),H3(n,t,r,e)}var Oy="_reactListening"+Math.random().toString(36).slice(2);function Vx(t){if(!t[Oy]){t[Oy]=!0,ML.forEach(function(n){n!=="selectionchange"&&(aK.has(n)||ow(n,!1,t),ow(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Oy]||(e[Oy]=!0,ow("selectionchange",!1,e))}}function H3(t,e,n,r){switch(tU(e)){case 2:var o=DK;break;case 8:o=LK;break;default:o=Xx}n=o.bind(null,e,n,t),o=void 0,!Sw||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(o=!0),r?o!==void 0?t.addEventListener(e,n,{capture:!0,passive:o}):t.addEventListener(e,n,!0):o!==void 0?t.addEventListener(e,n,{passive:o}):t.addEventListener(e,n,!1)}function iw(t,e,n,r,o){var i=r;if((e&1)===0&&(e&2)===0&&r!==null)t:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===o)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===o)return;a=a.return}for(;s!==null;){if(a=rd(s),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){r=i=a;continue t}s=s.parentNode}}r=r.return}FL(function(){var c=i,d=ux(n),u=[];t:{var p=e5.get(t);if(p!==void 0){var f=k_,m=t;switch(t){case"keypress":if(zy(n)===0)break t;case"keydown":case"keyup":f=eW;break;case"focusin":m="focus",f=BT;break;case"focusout":m="blur",f=BT;break;case"beforeblur":case"afterblur":f=BT;break;case"click":if(n.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=rD;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=$Y;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=oW;break;case JL:case QL:case ZL:f=VY;break;case t5:f=aW;break;case"scroll":case"scrollend":f=HY;break;case"wheel":f=lW;break;case"copy":case"cut":case"paste":f=WY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=iD;break;case"toggle":case"beforetoggle":f=uW}var _=(e&4)!==0,v=!_&&(t==="scroll"||t==="scrollend"),h=_?p!==null?p+"Capture":null:p;_=[];for(var y=c,S;y!==null;){var E=y;if(S=E.stateNode,E=E.tag,E!==5&&E!==26&&E!==27||S===null||h===null||(E=tm(y,h),E!=null&&_.push(cm(y,E,S))),v)break;y=y.return}0<_.length&&(p=new f(p,m,null,n,d),u.push({event:p,listeners:_}))}}if((e&7)===0){t:{if(p=t==="mouseover"||t==="pointerover",f=t==="mouseout"||t==="pointerout",p&&n!==vw&&(m=n.relatedTarget||n.fromElement)&&(rd(m)||m[Cd]))break t;if((f||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,f?(m=n.relatedTarget||n.toElement,f=c,m=m?rd(m):null,m!==null&&(v=pm(m),_=m.tag,m!==v||_!==5&&_!==27&&_!==6)&&(m=null)):(f=null,m=c),f!==m)){if(_=rD,E="onMouseLeave",h="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(_=iD,E="onPointerLeave",h="onPointerEnter",y="pointer"),v=f==null?p:Bp(f),S=m==null?p:Bp(m),p=new _(E,y+"leave",f,n,d),p.target=v,p.relatedTarget=S,E=null,rd(d)===c&&(_=new _(h,y+"enter",m,n,d),_.target=S,_.relatedTarget=v,E=_),v=E,f&&m)e:{for(_=sK,h=f,y=m,S=0,E=h;E;E=_(E))S++;E=0;for(var R=y;R;R=_(R))E++;for(;0<S-E;)h=_(h),S--;for(;0<E-S;)y=_(y),E--;for(;S--;){if(h===y||y!==null&&h===y.alternate){_=h;break e}h=_(h),y=_(y)}_=null}else _=null;f!==null&&JD(u,p,f,_,!1),m!==null&&v!==null&&JD(u,v,m,_,!0)}}t:{if(p=c?Bp(c):window,f=p.nodeName&&p.nodeName.toLowerCase(),f==="select"||f==="input"&&p.type==="file")var C=cD;else if(lD(p))if(VL)C=vW;else{C=yW;var I=bW}else f=p.nodeName,!f||f.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?c&&cx(c.elementType)&&(C=cD):C=_W;if(C&&(C=C(t,c))){qL(u,C,n,d);break t}I&&I(t,p,c),t==="focusout"&&c&&p.type==="number"&&c.memoizedProps.value!=null&&_w(p,"number",p.value)}switch(I=c?Bp(c):window,t){case"focusin":(lD(I)||I.contentEditable==="true")&&(ad=I,Ew=c,Gp=null);break;case"focusout":Gp=Ew=ad=null;break;case"mousedown":Tw=!0;break;case"contextmenu":case"mouseup":case"dragend":Tw=!1,pD(u,n,d);break;case"selectionchange":if(EW)break;case"keydown":case"keyup":pD(u,n,d)}var L;if(px)t:{switch(t){case"compositionstart":var z="onCompositionStart";break t;case"compositionend":z="onCompositionEnd";break t;case"compositionupdate":z="onCompositionUpdate";break t}z=void 0}else id?$L(t,n)&&(z="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(z="onCompositionStart");z&&(GL&&n.locale!=="ko"&&(id||z!=="onCompositionStart"?z==="onCompositionEnd"&&id&&(L=HL()):(fs=d,dx="value"in fs?fs.value:fs.textContent,id=!0)),I=__(c,z),0<I.length&&(z=new oD(z,t,null,n,d),u.push({event:z,listeners:I}),L?z.data=L:(L=jL(n),L!==null&&(z.data=L)))),(L=fW?pW(t,n):mW(t,n))&&(z=__(c,"onBeforeInput"),0<z.length&&(I=new oD("onBeforeInput","beforeinput",null,n,d),u.push({event:I,listeners:z}),I.data=L)),iK(u,t,c,n,d)}F3(u,e)})}function cm(t,e,n){return{instance:t,listener:e,currentTarget:n}}function __(t,e){for(var n=e+"Capture",r=[];t!==null;){var o=t,i=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||i===null||(o=tm(t,n),o!=null&&r.unshift(cm(t,o,i)),o=tm(t,e),o!=null&&r.push(cm(t,o,i))),t.tag===3)return r;t=t.return}return[]}function sK(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function JD(t,e,n,r,o){for(var i=e._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||c===null||(l=c,o?(c=tm(n,i),c!=null&&a.unshift(cm(n,c,l))):o||(c=tm(n,i),c!=null&&a.push(cm(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var lK=/\r\n?/g,cK=/\u0000|\uFFFD/g;function QD(t){return(typeof t=="string"?t:""+t).replace(lK,`
|
|
9
|
-
`).replace(cK,"")}function G3(t,e){return e=QD(e),QD(t)===e}function me(t,e,n,r,o,i){switch(n){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||Ed(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&Ed(t,""+r);break;case"className":Ey(t,"class",r);break;case"tabIndex":Ey(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ey(t,n,r);break;case"style":zL(t,r,i);break;case"data":if(e!=="object"){Ey(t,"data",r);break}case"src":case"href":if(r===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(n);break}r=By(""+r),t.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(e!=="input"&&me(t,e,"name",o.name,o,null),me(t,e,"formEncType",o.formEncType,o,null),me(t,e,"formMethod",o.formMethod,o,null),me(t,e,"formTarget",o.formTarget,o,null)):(me(t,e,"encType",o.encType,o,null),me(t,e,"method",o.method,o,null),me(t,e,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(n);break}r=By(""+r),t.setAttribute(n,r);break;case"onClick":r!=null&&(t.onclick=ua);break;case"onScroll":r!=null&&Yt("scroll",t);break;case"onScrollEnd":r!=null&&Yt("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(j(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(j(60));t.innerHTML=n}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){t.removeAttribute("xlink:href");break}n=By(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(n,""+r):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":r===!0?t.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(n,r):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(n,r):t.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(n):t.setAttribute(n,r);break;case"popover":Yt("beforetoggle",t),Yt("toggle",t),Uy(t,"popover",r);break;case"xlinkActuate":na(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":na(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":na(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":na(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":na(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":na(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":na(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":na(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":na(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Uy(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=zY.get(n)||n,Uy(t,n,r))}}function Yw(t,e,n,r,o,i){switch(n){case"style":zL(t,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(j(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(j(60));t.innerHTML=n}}break;case"children":typeof r=="string"?Ed(t,r):(typeof r=="number"||typeof r=="bigint")&&Ed(t,""+r);break;case"onScroll":r!=null&&Yt("scroll",t);break;case"onScrollEnd":r!=null&&Yt("scrollend",t);break;case"onClick":r!=null&&(t.onclick=ua);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!OL.hasOwnProperty(n))t:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),e=n.slice(2,o?n.length-7:void 0),i=t[wr]||null,i=i!=null?i[n]:null,typeof i=="function"&&t.removeEventListener(e,i,o),typeof r=="function")){typeof i!="function"&&i!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,r,o);break t}n in t?t[n]=r:r===!0?t.setAttribute(n,""):Uy(t,n,r)}}}function Un(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Yt("error",t),Yt("load",t);var r=!1,o=!1,i;for(i in n)if(n.hasOwnProperty(i)){var a=n[i];if(a!=null)switch(i){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(j(137,e));default:me(t,e,i,a,n,null)}}o&&me(t,e,"srcSet",n.srcSet,n,null),r&&me(t,e,"src",n.src,n,null);return;case"input":Yt("invalid",t);var s=i=a=o=null,l=null,c=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case"name":o=d;break;case"type":a=d;break;case"checked":l=d;break;case"defaultChecked":c=d;break;case"value":i=d;break;case"defaultValue":s=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(j(137,e));break;default:me(t,e,r,d,n,null)}}UL(t,i,s,l,c,a,o,!1);return;case"select":Yt("invalid",t),r=a=i=null;for(o in n)if(n.hasOwnProperty(o)&&(s=n[o],s!=null))switch(o){case"value":i=s;break;case"defaultValue":a=s;break;case"multiple":r=s;default:me(t,e,o,s,n,null)}e=i,n=a,t.multiple=!!r,e!=null?md(t,!!r,e,!1):n!=null&&md(t,!!r,n,!0);return;case"textarea":Yt("invalid",t),i=o=r=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":r=s;break;case"defaultValue":o=s;break;case"children":i=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(j(91));break;default:me(t,e,a,s,n,null)}PL(t,r,o,i);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":t.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:me(t,e,l,r,n,null)}return;case"dialog":Yt("beforetoggle",t),Yt("toggle",t),Yt("cancel",t),Yt("close",t);break;case"iframe":case"object":Yt("load",t);break;case"video":case"audio":for(r=0;r<lm.length;r++)Yt(lm[r],t);break;case"image":Yt("error",t),Yt("load",t);break;case"details":Yt("toggle",t);break;case"embed":case"source":case"link":Yt("error",t),Yt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(r=n[c],r!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(j(137,e));default:me(t,e,c,r,n,null)}return;default:if(cx(e)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Yw(t,e,d,r,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(r=n[s],r!=null&&me(t,e,s,r,n,null))}function uK(t,e,n,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,i=null,a=null,s=null,l=null,c=null,d=null;for(f in n){var u=n[f];if(n.hasOwnProperty(f)&&u!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":l=u;default:r.hasOwnProperty(f)||me(t,e,f,null,r,u)}}for(var p in r){var f=r[p];if(u=n[p],r.hasOwnProperty(p)&&(f!=null||u!=null))switch(p){case"type":i=f;break;case"name":o=f;break;case"checked":c=f;break;case"defaultChecked":d=f;break;case"value":a=f;break;case"defaultValue":s=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(j(137,e));break;default:f!==u&&me(t,e,p,f,r,u)}}yw(t,a,s,l,c,d,i,o);return;case"select":f=a=s=p=null;for(i in n)if(l=n[i],n.hasOwnProperty(i)&&l!=null)switch(i){case"value":break;case"multiple":f=l;default:r.hasOwnProperty(i)||me(t,e,i,null,r,l)}for(o in r)if(i=r[o],l=n[o],r.hasOwnProperty(o)&&(i!=null||l!=null))switch(o){case"value":p=i;break;case"defaultValue":s=i;break;case"multiple":a=i;default:i!==l&&me(t,e,o,i,r,l)}e=s,n=a,r=f,p!=null?md(t,!!n,p,!1):!!r!=!!n&&(e!=null?md(t,!!n,e,!0):md(t,!!n,n?[]:"",!1));return;case"textarea":f=p=null;for(s in n)if(o=n[s],n.hasOwnProperty(s)&&o!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:me(t,e,s,null,r,o)}for(a in r)if(o=r[a],i=n[a],r.hasOwnProperty(a)&&(o!=null||i!=null))switch(a){case"value":p=o;break;case"defaultValue":f=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(j(91));break;default:o!==i&&me(t,e,a,o,r,i)}BL(t,p,f);return;case"option":for(var m in n)if(p=n[m],n.hasOwnProperty(m)&&p!=null&&!r.hasOwnProperty(m))switch(m){case"selected":t.selected=!1;break;default:me(t,e,m,null,r,p)}for(l in r)if(p=r[l],f=n[l],r.hasOwnProperty(l)&&p!==f&&(p!=null||f!=null))switch(l){case"selected":t.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:me(t,e,l,p,r,f)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!=null&&!r.hasOwnProperty(_)&&me(t,e,_,null,r,p);for(c in r)if(p=r[c],f=n[c],r.hasOwnProperty(c)&&p!==f&&(p!=null||f!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(j(137,e));break;default:me(t,e,c,p,r,f)}return;default:if(cx(e)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!==void 0&&!r.hasOwnProperty(v)&&Yw(t,e,v,void 0,r,p);for(d in r)p=r[d],f=n[d],!r.hasOwnProperty(d)||p===f||p===void 0&&f===void 0||Yw(t,e,d,p,r,f);return}}for(var h in n)p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h)&&me(t,e,h,null,r,p);for(u in r)p=r[u],f=n[u],!r.hasOwnProperty(u)||p===f||p==null&&f==null||me(t,e,u,p,r,f)}function ZD(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dK(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],i=o.transferSize,a=o.initiatorType,s=o.duration;if(i&&s&&ZD(a)){for(a=0,s=o.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>s)break;var d=l.transferSize,u=l.initiatorType;d&&ZD(u)&&(l=l.responseEnd,a+=d*(l<s?1:(s-c)/(l-c)))}if(--r,e+=8*(i+a)/(o.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Ww=null,Kw=null;function v_(t){return t.nodeType===9?t:t.ownerDocument}function tL(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $3(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Xw(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var aw=null;function fK(){var t=window.event;return t&&t.type==="popstate"?t===aw?!1:(aw=t,!0):(aw=null,!1)}var j3=typeof setTimeout=="function"?setTimeout:void 0,pK=typeof clearTimeout=="function"?clearTimeout:void 0,eL=typeof Promise=="function"?Promise:void 0,mK=typeof queueMicrotask=="function"?queueMicrotask:typeof eL<"u"?function(t){return eL.resolve(null).then(t).catch(gK)}:j3;function gK(t){setTimeout(function(){throw t})}function Ns(t){return t==="head"}function nL(t,e){var n=e,r=0;do{var o=n.nextSibling;if(t.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(r===0){t.removeChild(o),Nd(e);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Qp(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Qp(n);for(var i=n.firstChild;i;){var a=i.nextSibling,s=i.nodeName;i[bm]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=a}}else n==="body"&&Qp(t.ownerDocument.body);n=o}while(n);Nd(e)}function rL(t,e){var n=t;t=0;do{var r=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=r}while(n)}function Jw(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Jw(n),lx(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function hK(t,e,n,r){for(;t.nodeType===1;){var o=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){if(!t[bm])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(i=t.getAttribute("rel"),i==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(i!==o.rel||t.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||t.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||t.getAttribute("title")!==(o.title==null?null:o.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(i=t.getAttribute("src"),(i!==(o.src==null?null:o.src)||t.getAttribute("type")!==(o.type==null?null:o.type)||t.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&i&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var i=o.name==null?null:""+o.name;if(o.type==="hidden"&&t.getAttribute("name")===i)return t}else return t;if(t=To(t.nextSibling),t===null)break}return null}function bK(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=To(t.nextSibling),t===null))return null;return t}function q3(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=To(t.nextSibling),t===null))return null;return t}function Qw(t){return t.data==="$?"||t.data==="$~"}function Zw(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function yK(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var r=function(){e(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function To(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var tx=null;function oL(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return To(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function iL(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function V3(t,e,n){switch(e=v_(n),t){case"html":if(t=e.documentElement,!t)throw Error(j(452));return t;case"head":if(t=e.head,!t)throw Error(j(453));return t;case"body":if(t=e.body,!t)throw Error(j(454));return t;default:throw Error(j(451))}}function Qp(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);lx(t)}var wo=new Map,aL=new Set;function S_(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var va=ce.d;ce.d={f:_K,r:vK,D:SK,C:EK,L:TK,m:wK,X:AK,S:xK,M:kK};function _K(){var t=va.f(),e=P_();return t||e}function vK(t){var e=Md(t);e!==null&&e.tag===5&&e.type==="form"?z5(e):va.r(t)}var Ud=typeof document>"u"?null:document;function Y3(t,e,n){var r=Ud;if(r&&typeof e=="string"&&e){var o=_o(e);o='link[rel="'+t+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),aL.has(o)||(aL.add(o),t={rel:t,crossOrigin:n,href:e},r.querySelector(o)===null&&(e=r.createElement("link"),Un(e,"link",t),In(e),r.head.appendChild(e)))}}function SK(t){va.D(t),Y3("dns-prefetch",t,null)}function EK(t,e){va.C(t,e),Y3("preconnect",t,e)}function TK(t,e,n){va.L(t,e,n);var r=Ud;if(r&&t&&e){var o='link[rel="preload"][as="'+_o(e)+'"]';e==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+_o(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+_o(n.imageSizes)+'"]')):o+='[href="'+_o(t)+'"]';var i=o;switch(e){case"style":i=Rd(t);break;case"script":i=Bd(t)}wo.has(i)||(t=Ne({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),wo.set(i,t),r.querySelector(o)!==null||e==="style"&&r.querySelector(Tm(i))||e==="script"&&r.querySelector(wm(i))||(e=r.createElement("link"),Un(e,"link",t),In(e),r.head.appendChild(e)))}}function wK(t,e){va.m(t,e);var n=Ud;if(n&&t){var r=e&&typeof e.as=="string"?e.as:"script",o='link[rel="modulepreload"][as="'+_o(r)+'"][href="'+_o(t)+'"]',i=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Bd(t)}if(!wo.has(i)&&(t=Ne({rel:"modulepreload",href:t},e),wo.set(i,t),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wm(i)))return}r=n.createElement("link"),Un(r,"link",t),In(r),n.head.appendChild(r)}}}function xK(t,e,n){va.S(t,e,n);var r=Ud;if(r&&t){var o=pd(r).hoistableStyles,i=Rd(t);e=e||"default";var a=o.get(i);if(!a){var s={loading:0,preload:null};if(a=r.querySelector(Tm(i)))s.loading=5;else{t=Ne({rel:"stylesheet",href:t,"data-precedence":e},n),(n=wo.get(i))&&Yx(t,n);var l=a=r.createElement("link");In(l),Un(l,"link",t),l._p=new Promise(function(c,d){l.onload=c,l.onerror=d}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Yy(a,e,r)}a={type:"stylesheet",instance:a,count:1,state:s},o.set(i,a)}}}function AK(t,e){va.X(t,e);var n=Ud;if(n&&t){var r=pd(n).hoistableScripts,o=Bd(t),i=r.get(o);i||(i=n.querySelector(wm(o)),i||(t=Ne({src:t,async:!0},e),(e=wo.get(o))&&Wx(t,e),i=n.createElement("script"),In(i),Un(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}}function kK(t,e){va.M(t,e);var n=Ud;if(n&&t){var r=pd(n).hoistableScripts,o=Bd(t),i=r.get(o);i||(i=n.querySelector(wm(o)),i||(t=Ne({src:t,async:!0,type:"module"},e),(e=wo.get(o))&&Wx(t,e),i=n.createElement("script"),In(i),Un(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}}function sL(t,e,n,r){var o=(o=hs.current)?S_(o):null;if(!o)throw Error(j(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Rd(n.href),n=pd(o).hoistableStyles,r=n.get(e),r||(r={type:"style",instance:null,count:0,state:null},n.set(e,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Rd(n.href);var i=pd(o).hoistableStyles,a=i.get(t);if(a||(o=o.ownerDocument||o,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(t,a),(i=o.querySelector(Tm(t)))&&!i._p&&(a.instance=i,a.state.loading=5),wo.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wo.set(t,n),i||IK(o,t,n,a.state))),e&&r===null)throw Error(j(528,""));return a}if(e&&r!==null)throw Error(j(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Bd(n),n=pd(o).hoistableScripts,r=n.get(e),r||(r={type:"script",instance:null,count:0,state:null},n.set(e,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(j(444,t))}}function Rd(t){return'href="'+_o(t)+'"'}function Tm(t){return'link[rel="stylesheet"]['+t+"]"}function W3(t){return Ne({},t,{"data-precedence":t.precedence,precedence:null})}function IK(t,e,n,r){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?r.loading=1:(e=t.createElement("link"),r.preload=e,e.addEventListener("load",function(){return r.loading|=1}),e.addEventListener("error",function(){return r.loading|=2}),Un(e,"link",n),In(e),t.head.appendChild(e))}function Bd(t){return'[src="'+_o(t)+'"]'}function wm(t){return"script[async]"+t}function lL(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+_o(n.href)+'"]');if(r)return e.instance=r,In(r),r;var o=Ne({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),In(r),Un(r,"style",o),Yy(r,n.precedence,t),e.instance=r;case"stylesheet":o=Rd(n.href);var i=t.querySelector(Tm(o));if(i)return e.state.loading|=4,e.instance=i,In(i),i;r=W3(n),(o=wo.get(o))&&Yx(r,o),i=(t.ownerDocument||t).createElement("link"),In(i);var a=i;return a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),Un(i,"link",r),e.state.loading|=4,Yy(i,n.precedence,t),e.instance=i;case"script":return i=Bd(n.src),(o=t.querySelector(wm(i)))?(e.instance=o,In(o),o):(r=n,(o=wo.get(i))&&(r=Ne({},n),Wx(r,o)),t=t.ownerDocument||t,o=t.createElement("script"),In(o),Un(o,"link",r),t.head.appendChild(o),e.instance=o);case"void":return null;default:throw Error(j(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,Yy(r,n.precedence,t));return e.instance}function Yy(t,e,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,i=o,a=0;a<r.length;a++){var s=r[a];if(s.dataset.precedence===e)i=s;else if(i!==o)break}i?i.parentNode.insertBefore(t,i.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function Yx(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Wx(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Wy=null;function cL(t,e,n){if(Wy===null){var r=new Map,o=Wy=new Map;o.set(n,r)}else o=Wy,r=o.get(n),r||(r=new Map,o.set(n,r));if(r.has(t))return r;for(r.set(t,null),n=n.getElementsByTagName(t),o=0;o<n.length;o++){var i=n[o];if(!(i[bm]||i[On]||t==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var a=i.getAttribute(e)||"";a=t+a;var s=r.get(a);s?s.push(i):r.set(a,[i])}}return r}function uL(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function RK(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function K3(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function NK(t,e,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=Rd(r.href),i=e.querySelector(Tm(o));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=E_.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=i,In(i);return}i=e.ownerDocument||e,r=W3(r),(o=wo.get(o))&&Yx(r,o),i=i.createElement("link"),In(i);var a=i;a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),Un(i,"link",r),n.instance=i}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=E_.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var sw=0;function CK(t,e){return t.stylesheets&&t.count===0&&Ky(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var r=setTimeout(function(){if(t.stylesheets&&Ky(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4+e);0<t.imgBytes&&sw===0&&(sw=62500*dK());var o=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ky(t,t.stylesheets),t.unsuspend)){var i=t.unsuspend;t.unsuspend=null,i()}},(t.imgBytes>sw?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function E_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ky(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var T_=null;function Ky(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,T_=new Map,e.forEach(MK,t),T_=null,E_.call(t))}function MK(t,e){if(!(e.state.loading&4)){var n=T_.get(t);if(n)var r=n.get(null);else{n=new Map,T_.set(t,n);for(var o=t.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<o.length;i++){var a=o[i];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}o=e.instance,a=o.getAttribute("data-precedence"),i=n.get(a)||r,i===r&&n.set(null,o),n.set(a,o),this.count++,r=E_.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),i?i.parentNode.insertBefore(o,i.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(o,t.firstChild)),e.state.loading|=4}}var um={$$typeof:ca,Provider:null,Consumer:null,_currentValue:Dl,_currentValue2:Dl,_threadCount:0};function OK(t,e,n,r,o,i,a,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=OT(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=OT(0),this.hiddenUpdates=OT(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=i,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function X3(t,e,n,r,o,i,a,s,l,c,d,u){return t=new OK(t,e,n,a,l,c,d,u,s),e=1,i===!0&&(e|=24),i=Fr(3,null,null,e),t.current=i,i.stateNode=t,e=vx(),e.refCount++,t.pooledCache=e,e.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:e},Tx(i),t}function J3(t){return t?(t=cd,t):cd}function Q3(t,e,n,r,o,i){o=J3(o),r.context===null?r.context=o:r.pendingContext=o,r=ys(e),r.payload={element:n},i=i===void 0?null:i,i!==null&&(r.callback=i),n=_s(t,r,e),n!==null&&(Tr(n,t,e),jp(n,t,e))}function dL(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Kx(t,e){dL(t,e),(t=t.alternate)&&dL(t,e)}function Z3(t){if(t.tag===13||t.tag===31){var e=Yl(t,67108864);e!==null&&Tr(e,t,67108864),Kx(t,67108864)}}function fL(t){if(t.tag===13||t.tag===31){var e=qr();e=ax(e);var n=Yl(t,e);n!==null&&Tr(n,t,e),Kx(t,e)}}var w_=!0;function DK(t,e,n,r){var o=At.T;At.T=null;var i=ce.p;try{ce.p=2,Xx(t,e,n,r)}finally{ce.p=i,At.T=o}}function LK(t,e,n,r){var o=At.T;At.T=null;var i=ce.p;try{ce.p=8,Xx(t,e,n,r)}finally{ce.p=i,At.T=o}}function Xx(t,e,n,r){if(w_){var o=ex(r);if(o===null)iw(t,e,r,x_,n),pL(t,r);else if(BK(o,t,e,n,r))r.stopPropagation();else if(pL(t,r),e&4&&-1<UK.indexOf(t)){for(;o!==null;){var i=Md(o);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var a=Cl(i.pendingLanes);if(a!==0){var s=i;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-jr(a);s.entanglements[1]|=l,a&=~l}Ri(i),(le&6)===0&&(m_=Gr()+500,Em(0,!1))}}break;case 31:case 13:s=Yl(i,2),s!==null&&Tr(s,i,2),P_(),Kx(i,2)}if(i=ex(r),i===null&&iw(t,e,r,x_,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else iw(t,e,r,null,n)}}function ex(t){return t=ux(t),Jx(t)}var x_=null;function Jx(t){if(x_=null,t=rd(t),t!==null){var e=pm(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=_L(e),t!==null)return t;t=null}else if(n===31){if(t=vL(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return x_=t,null}function tU(t){switch(t){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(TY()){case wL:return 2;case xL:return 8;case t_:case wY:return 32;case AL:return 268435456;default:return 32}default:return 32}}var nx=!1,Es=null,Ts=null,ws=null,dm=new Map,fm=new Map,us=[],UK="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".split(" ");function pL(t,e){switch(t){case"focusin":case"focusout":Es=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":ws=null;break;case"pointerover":case"pointerout":dm.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":fm.delete(e.pointerId)}}function Op(t,e,n,r,o,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},e!==null&&(e=Md(e),e!==null&&Z3(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,o!==null&&e.indexOf(o)===-1&&e.push(o),t)}function BK(t,e,n,r,o){switch(e){case"focusin":return Es=Op(Es,t,e,n,r,o),!0;case"dragenter":return Ts=Op(Ts,t,e,n,r,o),!0;case"mouseover":return ws=Op(ws,t,e,n,r,o),!0;case"pointerover":var i=o.pointerId;return dm.set(i,Op(dm.get(i)||null,t,e,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,fm.set(i,Op(fm.get(i)||null,t,e,n,r,o)),!0}return!1}function eU(t){var e=rd(t.target);if(e!==null){var n=pm(e);if(n!==null){if(e=n.tag,e===13){if(e=_L(n),e!==null){t.blockedOn=e,XO(t.priority,function(){fL(n)});return}}else if(e===31){if(e=vL(n),e!==null){t.blockedOn=e,XO(t.priority,function(){fL(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Xy(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=ex(t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);vw=r,n.target.dispatchEvent(r),vw=null}else return e=Md(n),e!==null&&Z3(e),t.blockedOn=n,!1;e.shift()}return!0}function mL(t,e,n){Xy(t)&&n.delete(e)}function PK(){nx=!1,Es!==null&&Xy(Es)&&(Es=null),Ts!==null&&Xy(Ts)&&(Ts=null),ws!==null&&Xy(ws)&&(ws=null),dm.forEach(mL),fm.forEach(mL)}function Dy(t,e){t.blockedOn===e&&(t.blockedOn=null,nx||(nx=!0,yn.unstable_scheduleCallback(yn.unstable_NormalPriority,PK)))}var Ly=null;function gL(t){Ly!==t&&(Ly=t,yn.unstable_scheduleCallback(yn.unstable_NormalPriority,function(){Ly===t&&(Ly=null);for(var e=0;e<t.length;e+=3){var n=t[e],r=t[e+1],o=t[e+2];if(typeof r!="function"){if(Jx(r||n)===null)continue;break}var i=Md(n);i!==null&&(t.splice(e,3),e-=3,Uw(i,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Nd(t){function e(l){return Dy(l,t)}Es!==null&&Dy(Es,t),Ts!==null&&Dy(Ts,t),ws!==null&&Dy(ws,t),dm.forEach(e),fm.forEach(e);for(var n=0;n<us.length;n++){var r=us[n];r.blockedOn===t&&(r.blockedOn=null)}for(;0<us.length&&(n=us[0],n.blockedOn===null);)eU(n),n.blockedOn===null&&us.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var o=n[r],i=n[r+1],a=o[wr]||null;if(typeof i=="function")a||gL(n);else if(a){var s=null;if(i&&i.hasAttribute("formAction")){if(o=i,a=i[wr]||null)s=a.formAction;else if(Jx(o)!==null)continue}else s=a.action;typeof s=="function"?n[r+1]=s:(n.splice(r,3),r-=3),gL(n)}}}function nU(){function t(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(a){return o=a})},focusReset:"manual",scroll:"manual"})}function e(){o!==null&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,o=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),o!==null&&(o(),o=null)}}}function Qx(t){this._internalRoot=t}H_.prototype.render=Qx.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(j(409));var n=e.current,r=qr();Q3(n,r,t,e,null,null)};H_.prototype.unmount=Qx.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Q3(t.current,2,null,t,null,null),P_(),e[Cd]=null}};function H_(t){this._internalRoot=t}H_.prototype.unstable_scheduleHydration=function(t){if(t){var e=CL();t={blockedOn:null,target:t,priority:e};for(var n=0;n<us.length&&e!==0&&e<us[n].priority;n++);us.splice(n,0,t),n===0&&eU(t)}};var hL=bL.version;if(hL!=="19.2.7")throw Error(j(527,hL,"19.2.7"));ce.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(j(188)):(t=Object.keys(t).join(","),Error(j(268,t)));return t=hY(e),t=t!==null?SL(t):null,t=t===null?null:t.stateNode,t};var zK={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:At,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Dp=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Dp.isDisabled&&Dp.supportsFiber))try{mm=Dp.inject(zK),$r=Dp}catch{}var Dp;G_.createRoot=function(t,e){if(!yL(t))throw Error(j(299));var n=!1,r="",o=Y5,i=W5,a=K5;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onUncaughtError!==void 0&&(o=e.onUncaughtError),e.onCaughtError!==void 0&&(i=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=X3(t,1,!1,null,null,n,r,null,o,i,a,nU),t[Cd]=e.current,Vx(t),new Qx(e)};G_.hydrateRoot=function(t,e,n){if(!yL(t))throw Error(j(299));var r=!1,o="",i=Y5,a=W5,s=K5,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=X3(t,1,!0,e,n??null,r,o,l,i,a,s,nU),e.context=J3(null),n=e.current,r=qr(),r=ax(r),o=ys(r),o.callback=null,_s(n,o,r),n=r,e.current.lanes=n,hm(e,n),Ri(e),t[Cd]=e.current,Vx(t),new H_(e)};G_.version="19.2.7"});var aU=Jm((Fvt,iU)=>{"use strict";function oU(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oU)}catch(t){console.error(t)}}oU(),iU.exports=rU()});var Yu={};_0(Yu,{BrowserClient:()=>fu,ErrorBoundary:()=>_p,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>Fc,OpenFeatureIntegrationHook:()=>uy,Profiler:()=>Pu,SDK_VERSION:()=>ir,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>ht,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>at,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>ni,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>Ot,Scope:()=>$n,WINDOW:()=>q,addBreadcrumb:()=>wn,addEventProcessor:()=>Uc,addIntegration:()=>Xs,bindScopeToEmitter:()=>W0,breadcrumbsIntegration:()=>mb,browserApiErrorsIntegration:()=>gb,browserProfilingIntegration:()=>cM,browserSessionIntegration:()=>hb,browserTracingIntegration:()=>Br,buildLaunchDarklyFlagUsedHandler:()=>fM,captureConsoleIntegration:()=>Av,captureEvent:()=>Qr,captureException:()=>Et,captureFeedback:()=>jc,captureMessage:()=>Da,captureReactException:()=>yp,captureSession:()=>Ua,chromeStackLineParser:()=>VS,close:()=>Qg,consoleLoggingIntegration:()=>Uv,contextLinesIntegration:()=>QN,continueTrace:()=>zg,createConsolaReporter:()=>Pv,createLangChainCallbackHandler:()=>eu,createReduxEnhancer:()=>LM,createTransport:()=>If,createUserFeedbackEnvelope:()=>BN,cultureContextIntegration:()=>bb,dedupeIntegration:()=>Lf,defaultRequestInstrumentationOptions:()=>gp,defaultStackLineParsers:()=>WS,defaultStackParser:()=>fb,diagnoseSdkConnectivity:()=>bM,elementTimingIntegration:()=>OS,endSession:()=>Bc,eventFiltersIntegration:()=>uh,eventFromException:()=>Jh,eventFromMessage:()=>Qh,exceptionFromError:()=>uu,extraErrorDataIntegration:()=>kv,featureFlagsIntegration:()=>Mv,feedbackAsyncIntegration:()=>oN,feedbackIntegration:()=>bS,feedbackSyncIntegration:()=>bS,fetchStreamPerformanceIntegration:()=>ry,flush:()=>Jg,forceLoad:()=>$N,functionToStringIntegration:()=>Of,geckoStackLineParser:()=>YS,getActiveSpan:()=>Dt,getClient:()=>P,getCurrentScope:()=>rt,getDefaultIntegrations:()=>JS,getFeedback:()=>jR,getGlobalScope:()=>lr,getIsolationScope:()=>Pt,getReplay:()=>p2,getRootSpan:()=>Bt,getSpanDescendants:()=>ii,getSpanStatusFromHttpCode:()=>wg,getTraceData:()=>el,globalHandlersIntegration:()=>yb,graphqlClientIntegration:()=>nC,growthbookIntegration:()=>gM,httpClientIntegration:()=>WN,httpContextIntegration:()=>_b,inboundFiltersIntegration:()=>Df,init:()=>dy,instrumentAnthropicAiClient:()=>Vv,instrumentCreateReactAgent:()=>Jv,instrumentGoogleGenAIClient:()=>Wv,instrumentLangChainEmbeddings:()=>Zv,instrumentLangGraph:()=>Qv,instrumentOpenAiClient:()=>$v,instrumentOutgoingRequests:()=>ny,instrumentSupabaseClient:()=>hh,isBotUserAgent:()=>QE,isEnabled:()=>Lc,isInitialized:()=>Zg,lastEventId:()=>Dc,launchDarklyIntegration:()=>dM,lazyLoadIntegration:()=>Kh,linkedErrorsIntegration:()=>vb,logger:()=>_h,makeBrowserOfflineTransport:()=>q2,makeFetchTransport:()=>Su,makeMultiplexedTransport:()=>yv,metrics:()=>Fa,moduleMetadataIntegration:()=>xv,normalizeStringifyValue:()=>Tu,onLoad:()=>jN,openFeatureIntegration:()=>pM,opera10StackLineParser:()=>DN,opera11StackLineParser:()=>LN,parameterize:()=>lh,reactErrorHandler:()=>wM,reactRouterBrowserTracingIntegration:()=>kO,reactRouterV3BrowserTracingIntegration:()=>BM,reactRouterV4BrowserTracingIntegration:()=>HM,reactRouterV5BrowserTracingIntegration:()=>GM,reactRouterV6BrowserTracingIntegration:()=>bO,reactRouterV7BrowserTracingIntegration:()=>EO,registerSpanErrorInstrumentation:()=>mf,registerWebWorker:()=>vM,replayCanvasIntegration:()=>I2,replayIntegration:()=>Jb,reportPageLoaded:()=>G2,reportingObserverIntegration:()=>VN,rewriteFramesIntegration:()=>Iv,sendFeedback:()=>cS,setActiveSpanInBrowser:()=>$2,setAttribute:()=>Wg,setAttributes:()=>Yg,setContext:()=>La,setConversationId:()=>Xg,setCurrentClient:()=>sh,setExtra:()=>qg,setExtras:()=>jg,setHttpStatus:()=>ri,setMeasurement:()=>qs,setTag:()=>Oc,setTags:()=>Vg,setUser:()=>Kg,showReportDialog:()=>Qf,spanStreamingIntegration:()=>j2,spanToBaggageHeader:()=>Dg,spanToJSON:()=>et,spanToTraceHeader:()=>kc,spotlightBrowserIntegration:()=>uM,startBrowserTracingNavigationSpan:()=>Wo,startBrowserTracingPageLoadSpan:()=>Yo,startInactiveSpan:()=>Ae,startNewTrace:()=>Sf,startSession:()=>Ks,startSpan:()=>nn,startSpanManual:()=>qn,statsigIntegration:()=>hM,supabaseIntegration:()=>Rv,suppressTracing:()=>Nc,tanstackRouterBrowserTracingIntegration:()=>zM,thirdPartyErrorFilterIntegration:()=>Cv,uiProfiler:()=>MN,unleashIntegration:()=>mM,updateSpanName:()=>Mg,useProfiler:()=>OM,viewHierarchyIntegration:()=>rC,webVitalsIntegration:()=>oy,webWorkerIntegration:()=>_M,winjsStackLineParser:()=>ON,withActiveSpan:()=>Jr,withErrorBoundary:()=>DM,withIsolationScope:()=>rf,withProfiler:()=>MM,withScope:()=>Oe,withSentryReactRouterV6Routing:()=>SO,withSentryReactRouterV7Routing:()=>TO,withSentryRouting:()=>qM,withStreamedSpan:()=>$0,wrapCreateBrowserRouter:()=>RO,wrapCreateBrowserRouterV6:()=>_O,wrapCreateBrowserRouterV7:()=>wO,wrapCreateMemoryRouter:()=>NO,wrapCreateMemoryRouterV6:()=>vO,wrapCreateMemoryRouterV7:()=>xO,wrapReactRouterRouting:()=>IO,wrapUseRoutes:()=>CO,wrapUseRoutesV6:()=>yO,wrapUseRoutesV7:()=>AO,zodErrorsIntegration:()=>Nv});var $=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var tt=globalThis;var ir="10.63.0";function Jn(){return Ta(tt),tt}function Ta(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||ir,e[ir]=e[ir]||{}}function Mo(t,e,n=tt){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[ir]=r[ir]||{};return o[t]||(o[t]=e())}var wa=["debug","info","warn","error","log","assert","trace"],J6="Sentry Logger ",Ls={};function pn(t){if(!("console"in tt))return t();let e=tt.console,n={},r=Object.keys(Ls);r.forEach(o=>{let i=Ls[o];n[o]=e[o],e[o]=i});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function Q6(){S0().enabled=!0}function Z6(){S0().enabled=!1}function B1(){return S0().enabled}function tB(...t){v0("log",...t)}function eB(...t){v0("warn",...t)}function nB(...t){v0("error",...t)}function v0(t,...e){$&&B1()&&pn(()=>{tt.console[t](`${J6}[${t}]:`,...e)})}function S0(){return $?Mo("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var w={enable:Q6,disable:Z6,isEnabled:B1,log:tB,warn:eB,error:nB};var P1=/\(error: (.*)\)/,z1=/captureMessage|captureException/;function Yd(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let i=[],a=n.split(`
|
|
8
|
+
`+r.stack}}var gw=Object.prototype.hasOwnProperty,ix=yn.unstable_scheduleCallback,MT=yn.unstable_cancelCallback,SY=yn.unstable_shouldYield,EY=yn.unstable_requestPaint,Gr=yn.unstable_now,TY=yn.unstable_getCurrentPriorityLevel,wL=yn.unstable_ImmediatePriority,xL=yn.unstable_UserBlockingPriority,t_=yn.unstable_NormalPriority,wY=yn.unstable_LowPriority,AL=yn.unstable_IdlePriority,xY=yn.log,AY=yn.unstable_setDisableYieldValue,mm=null,$r=null;function ds(t){if(typeof xY=="function"&&AY(t),$r&&typeof $r.setStrictMode=="function")try{$r.setStrictMode(mm,t)}catch{}}var jr=Math.clz32?Math.clz32:RY,kY=Math.log,IY=Math.LN2;function RY(t){return t>>>=0,t===0?32:31-(kY(t)/IY|0)|0}var _y=256,vy=262144,Sy=4194304;function Cl(t){var e=t&42;if(e!==0)return e;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function A_(t,e,n){var r=t.pendingLanes;if(r===0)return 0;var o=0,i=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var s=r&134217727;return s!==0?(r=s&~i,r!==0?o=Cl(r):(a&=s,a!==0?o=Cl(a):n||(n=s&~t,n!==0&&(o=Cl(n))))):(s=r&~i,s!==0?o=Cl(s):a!==0?o=Cl(a):n||(n=r&~t,n!==0&&(o=Cl(n)))),o===0?0:e!==0&&e!==o&&(e&i)===0&&(i=o&-o,n=e&-e,i>=n||i===32&&(n&4194048)!==0)?e:o}function gm(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function NY(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32: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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kL(){var t=Sy;return Sy<<=1,(Sy&62914560)===0&&(Sy=4194304),t}function OT(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function hm(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function CY(t,e,n,r,o,i){var a=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var s=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=a&~n;0<n;){var d=31-jr(n),u=1<<d;s[d]=0,l[d]=-1;var p=c[d];if(p!==null)for(c[d]=null,d=0;d<p.length;d++){var f=p[d];f!==null&&(f.lane&=-536870913)}n&=~u}r!==0&&IL(t,r,0),i!==0&&o===0&&t.tag!==0&&(t.suspendedLanes|=i&~(a&~e))}function IL(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-jr(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|n&261930}function RL(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-jr(n),o=1<<r;o&e|t[r]&e&&(t[r]|=e),n&=~o}}function NL(t,e){var n=e&-e;return n=(n&42)!==0?1:ax(n),(n&(t.suspendedLanes|e))!==0?0:n}function ax(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function sx(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function CL(){var t=ce.p;return t!==0?t:(t=window.event,t===void 0?32:tU(t.type))}function XO(t,e){var n=ce.p;try{return ce.p=t,e()}finally{ce.p=n}}var Rs=Math.random().toString(36).slice(2),On="__reactFiber$"+Rs,wr="__reactProps$"+Rs,Cd="__reactContainer$"+Rs,hw="__reactEvents$"+Rs,MY="__reactListeners$"+Rs,OY="__reactHandles$"+Rs,JO="__reactResources$"+Rs,bm="__reactMarker$"+Rs;function lx(t){delete t[On],delete t[wr],delete t[hw],delete t[MY],delete t[OY]}function rd(t){var e=t[On];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Cd]||n[On]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=iL(t);t!==null;){if(n=t[On])return n;t=iL(t)}return e}t=n,n=t.parentNode}return null}function Md(t){if(t=t[On]||t[Cd]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Bp(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(j(33))}function pd(t){var e=t[JO];return e||(e=t[JO]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function In(t){t[bm]=!0}var ML=new Set,OL={};function jl(t,e){Sd(t,e),Sd(t+"Capture",e)}function Sd(t,e){for(OL[t]=e,t=0;t<e.length;t++)ML.add(e[t])}var DY=RegExp("^[: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]*$"),QO={},ZO={};function LY(t){return gw.call(ZO,t)?!0:gw.call(QO,t)?!1:DY.test(t)?ZO[t]=!0:(QO[t]=!0,!1)}function Uy(t,e,n){if(LY(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var r=e.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Ey(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function na(t,e,n,r){if(r===null)t.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+r)}}function ho(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function DL(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function UY(t,e,n){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function bw(t){if(!t._valueTracker){var e=DL(t)?"checked":"value";t._valueTracker=UY(t,e,""+t[e])}}function LL(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=DL(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function e_(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var BY=/[\n"\\]/g;function _o(t){return t.replace(BY,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function yw(t,e,n,r,o,i,a,s){t.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?t.type=a:t.removeAttribute("type"),e!=null?a==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ho(e)):t.value!==""+ho(e)&&(t.value=""+ho(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?_w(t,a,ho(e)):n!=null?_w(t,a,ho(n)):r!=null&&t.removeAttribute("value"),o==null&&i!=null&&(t.defaultChecked=!!i),o!=null&&(t.checked=o&&typeof o!="function"&&typeof o!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+ho(s):t.removeAttribute("name")}function UL(t,e,n,r,o,i,a,s){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.type=i),e!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||e!=null)){bw(t);return}n=n!=null?""+ho(n):"",e=e!=null?""+ho(e):n,s||e===t.value||(t.value=e),t.defaultValue=e}r=r??o,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=s?t.checked:!!r,t.defaultChecked=!!r,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.name=a),bw(t)}function _w(t,e,n){e==="number"&&e_(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function md(t,e,n,r){if(t=t.options,e){e={};for(var o=0;o<n.length;o++)e["$"+n[o]]=!0;for(n=0;n<t.length;n++)o=e.hasOwnProperty("$"+t[n].value),t[n].selected!==o&&(t[n].selected=o),o&&r&&(t[n].defaultSelected=!0)}else{for(n=""+ho(n),e=null,o=0;o<t.length;o++){if(t[o].value===n){t[o].selected=!0,r&&(t[o].defaultSelected=!0);return}e!==null||t[o].disabled||(e=t[o])}e!==null&&(e.selected=!0)}}function BL(t,e,n){if(e!=null&&(e=""+ho(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+ho(n):""}function PL(t,e,n,r){if(e==null){if(r!=null){if(n!=null)throw Error(j(92));if(Up(r)){if(1<r.length)throw Error(j(93));r=r[0]}n=r}n==null&&(n=""),e=n}n=ho(e),t.defaultValue=n,r=t.textContent,r===n&&r!==""&&r!==null&&(t.value=r),bw(t)}function Ed(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var PY=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tD(t,e,n){var r=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":r?t.setProperty(e,n):typeof n!="number"||n===0||PY.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function zL(t,e,n){if(e!=null&&typeof e!="object")throw Error(j(62));if(t=t.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||e!=null&&e.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var o in e)r=e[o],e.hasOwnProperty(o)&&n[o]!==r&&tD(t,o,r)}else for(var i in e)e.hasOwnProperty(i)&&tD(t,i,e[i])}function cx(t){if(t.indexOf("-")===-1)return!1;switch(t){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 zY=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),FY=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function By(t){return FY.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ua(){}var vw=null;function ux(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var od=null,gd=null;function eD(t){var e=Md(t);if(e&&(t=e.stateNode)){var n=t[wr]||null;t:switch(t=e.stateNode,e.type){case"input":if(yw(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_o(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var o=r[wr]||null;if(!o)throw Error(j(90));yw(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(e=0;e<n.length;e++)r=n[e],r.form===t.form&&LL(r)}break t;case"textarea":BL(t,n.value,n.defaultValue);break t;case"select":e=n.value,e!=null&&md(t,!!n.multiple,e,!1)}}}var DT=!1;function FL(t,e,n){if(DT)return t(e,n);DT=!0;try{var r=t(e);return r}finally{if(DT=!1,(od!==null||gd!==null)&&(P_(),od&&(e=od,t=gd,gd=od=null,eD(e),t)))for(e=0;e<t.length;e++)eD(t[e])}}function tm(t,e){var n=t.stateNode;if(n===null)return null;var r=n[wr]||null;if(r===null)return null;n=r[e];t:switch(e){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)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break t;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(j(231,e,typeof n));return n}var ga=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sw=!1;if(ga)try{Xu={},Object.defineProperty(Xu,"passive",{get:function(){Sw=!0}}),window.addEventListener("test",Xu,Xu),window.removeEventListener("test",Xu,Xu)}catch{Sw=!1}var Xu,fs=null,dx=null,Py=null;function HL(){if(Py)return Py;var t,e=dx,n=e.length,r,o="value"in fs?fs.value:fs.textContent,i=o.length;for(t=0;t<n&&e[t]===o[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===o[i-r];r++);return Py=o.slice(t,1<r?1-r:void 0)}function zy(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Ty(){return!0}function nD(){return!1}function xr(t){function e(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(i):i[s]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ty:nD,this.isPropagationStopped=nD,this}return Ne(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ty)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ty)},persist:function(){},isPersistent:Ty}),e}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},k_=xr(ql),ym=Ne({},ql,{view:0,detail:0}),HY=xr(ym),LT,UT,Rp,I_=Ne({},ym,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fx,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Rp&&(Rp&&t.type==="mousemove"?(LT=t.screenX-Rp.screenX,UT=t.screenY-Rp.screenY):UT=LT=0,Rp=t),LT)},movementY:function(t){return"movementY"in t?t.movementY:UT}}),rD=xr(I_),GY=Ne({},I_,{dataTransfer:0}),$Y=xr(GY),jY=Ne({},ym,{relatedTarget:0}),BT=xr(jY),qY=Ne({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),VY=xr(qY),YY=Ne({},ql,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),WY=xr(YY),KY=Ne({},ql,{data:0}),oD=xr(KY),XY={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JY={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"},QY={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZY(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=QY[t])?!!e[t]:!1}function fx(){return ZY}var tW=Ne({},ym,{key:function(t){if(t.key){var e=XY[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=zy(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?JY[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fx,charCode:function(t){return t.type==="keypress"?zy(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zy(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),eW=xr(tW),nW=Ne({},I_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iD=xr(nW),rW=Ne({},ym,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fx}),oW=xr(rW),iW=Ne({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),aW=xr(iW),sW=Ne({},I_,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),lW=xr(sW),cW=Ne({},ql,{newState:0,oldState:0}),uW=xr(cW),dW=[9,13,27,32],px=ga&&"CompositionEvent"in window,Fp=null;ga&&"documentMode"in document&&(Fp=document.documentMode);var fW=ga&&"TextEvent"in window&&!Fp,GL=ga&&(!px||Fp&&8<Fp&&11>=Fp),aD=" ",sD=!1;function $L(t,e){switch(t){case"keyup":return dW.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jL(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var id=!1;function pW(t,e){switch(t){case"compositionend":return jL(e);case"keypress":return e.which!==32?null:(sD=!0,aD);case"textInput":return t=e.data,t===aD&&sD?null:t;default:return null}}function mW(t,e){if(id)return t==="compositionend"||!px&&$L(t,e)?(t=HL(),Py=dx=fs=null,id=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return GL&&e.locale!=="ko"?null:e.data;default:return null}}var gW={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 lD(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!gW[t.type]:e==="textarea"}function qL(t,e,n,r){od?gd?gd.push(r):gd=[r]:od=r,e=__(e,"onChange"),0<e.length&&(n=new k_("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Hp=null,em=null;function hW(t){F3(t,0)}function R_(t){var e=Bp(t);if(LL(e))return t}function cD(t,e){if(t==="change")return e}var VL=!1;ga&&(ga?(xy="oninput"in document,xy||(PT=document.createElement("div"),PT.setAttribute("oninput","return;"),xy=typeof PT.oninput=="function"),wy=xy):wy=!1,VL=wy&&(!document.documentMode||9<document.documentMode));var wy,xy,PT;function uD(){Hp&&(Hp.detachEvent("onpropertychange",YL),em=Hp=null)}function YL(t){if(t.propertyName==="value"&&R_(em)){var e=[];qL(e,em,t,ux(t)),FL(hW,e)}}function bW(t,e,n){t==="focusin"?(uD(),Hp=e,em=n,Hp.attachEvent("onpropertychange",YL)):t==="focusout"&&uD()}function yW(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return R_(em)}function _W(t,e){if(t==="click")return R_(e)}function vW(t,e){if(t==="input"||t==="change")return R_(e)}function SW(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Vr=typeof Object.is=="function"?Object.is:SW;function nm(t,e){if(Vr(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!gw.call(e,o)||!Vr(t[o],e[o]))return!1}return!0}function dD(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function fD(t,e){var n=dD(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=dD(n)}}function WL(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?WL(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function KL(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=e_(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=e_(t.document)}return e}function mx(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var EW=ga&&"documentMode"in document&&11>=document.documentMode,ad=null,Ew=null,Gp=null,Tw=!1;function pD(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tw||ad==null||ad!==e_(r)||(r=ad,"selectionStart"in r&&mx(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}),Gp&&nm(Gp,r)||(Gp=r,r=__(Ew,"onSelect"),0<r.length&&(e=new k_("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=ad)))}function Rl(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var sd={animationend:Rl("Animation","AnimationEnd"),animationiteration:Rl("Animation","AnimationIteration"),animationstart:Rl("Animation","AnimationStart"),transitionrun:Rl("Transition","TransitionRun"),transitionstart:Rl("Transition","TransitionStart"),transitioncancel:Rl("Transition","TransitionCancel"),transitionend:Rl("Transition","TransitionEnd")},zT={},XL={};ga&&(XL=document.createElement("div").style,"AnimationEvent"in window||(delete sd.animationend.animation,delete sd.animationiteration.animation,delete sd.animationstart.animation),"TransitionEvent"in window||delete sd.transitionend.transition);function Vl(t){if(zT[t])return zT[t];if(!sd[t])return t;var e=sd[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in XL)return zT[t]=e[n];return t}var JL=Vl("animationend"),QL=Vl("animationiteration"),ZL=Vl("animationstart"),TW=Vl("transitionrun"),wW=Vl("transitionstart"),xW=Vl("transitioncancel"),t5=Vl("transitionend"),e5=new Map,ww="abort auxClick beforeToggle 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(" ");ww.push("scrollEnd");function Jo(t,e){e5.set(t,e),jl(e,[t])}var n_=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},go=[],ld=0,gx=0;function N_(){for(var t=ld,e=gx=ld=0;e<t;){var n=go[e];go[e++]=null;var r=go[e];go[e++]=null;var o=go[e];go[e++]=null;var i=go[e];if(go[e++]=null,r!==null&&o!==null){var a=r.pending;a===null?o.next=o:(o.next=a.next,a.next=o),r.pending=o}i!==0&&n5(n,o,i)}}function C_(t,e,n,r){go[ld++]=t,go[ld++]=e,go[ld++]=n,go[ld++]=r,gx|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function hx(t,e,n,r){return C_(t,e,n,r),r_(t)}function Yl(t,e){return C_(t,null,null,e),r_(t)}function n5(t,e,n){t.lanes|=n;var r=t.alternate;r!==null&&(r.lanes|=n);for(var o=!1,i=t.return;i!==null;)i.childLanes|=n,r=i.alternate,r!==null&&(r.childLanes|=n),i.tag===22&&(t=i.stateNode,t===null||t._visibility&1||(o=!0)),t=i,i=i.return;return t.tag===3?(i=t.stateNode,o&&e!==null&&(o=31-jr(n),t=i.hiddenUpdates,r=t[o],r===null?t[o]=[e]:r.push(e),e.lane=n|536870912),i):null}function r_(t){if(50<Jp)throw Jp=0,qw=null,Error(j(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var cd={};function AW(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,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 Fr(t,e,n,r){return new AW(t,e,n,r)}function bx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fa(t,e){var n=t.alternate;return n===null?(n=Fr(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function r5(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Fy(t,e,n,r,o,i){var a=0;if(r=t,typeof t=="function")bx(t)&&(a=1);else if(typeof t=="string")a=RK(t,n,ki.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case dw:return t=Fr(31,n,e,o),t.elementType=dw,t.lanes=i,t;case ed:return Ll(n.children,o,i,e);case EL:a=8,o|=24;break;case lw:return t=Fr(12,n,e,o|2),t.elementType=lw,t.lanes=i,t;case cw:return t=Fr(13,n,e,o),t.elementType=cw,t.lanes=i,t;case uw:return t=Fr(19,n,e,o),t.elementType=uw,t.lanes=i,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ca:a=10;break t;case TL:a=9;break t;case rx:a=11;break t;case ox:a=14;break t;case is:a=16,r=null;break t}a=29,n=Error(j(130,t===null?"null":typeof t,"")),r=null}return e=Fr(a,n,e,o),e.elementType=t,e.type=r,e.lanes=i,e}function Ll(t,e,n,r){return t=Fr(7,t,r,e),t.lanes=n,t}function FT(t,e,n){return t=Fr(6,t,null,e),t.lanes=n,t}function o5(t){var e=Fr(18,null,null,0);return e.stateNode=t,e}function HT(t,e,n){return e=Fr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var mD=new WeakMap;function vo(t,e){if(typeof t=="object"&&t!==null){var n=mD.get(t);return n!==void 0?n:(e={value:t,source:e,stack:KO(e)},mD.set(t,e),e)}return{value:t,source:e,stack:KO(e)}}var ud=[],dd=0,o_=null,rm=0,bo=[],yo=0,xs=null,wi=1,xi="";function sa(t,e){ud[dd++]=rm,ud[dd++]=o_,o_=t,rm=e}function i5(t,e,n){bo[yo++]=wi,bo[yo++]=xi,bo[yo++]=xs,xs=t;var r=wi;t=xi;var o=32-jr(r)-1;r&=~(1<<o),n+=1;var i=32-jr(e)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,wi=1<<32-jr(e)+o|n<<o|r,xi=i+t}else wi=1<<i|n<<o|r,xi=t}function yx(t){t.return!==null&&(sa(t,1),i5(t,1,0))}function _x(t){for(;t===o_;)o_=ud[--dd],ud[dd]=null,rm=ud[--dd],ud[dd]=null;for(;t===xs;)xs=bo[--yo],bo[yo]=null,xi=bo[--yo],bo[yo]=null,wi=bo[--yo],bo[yo]=null}function a5(t,e){bo[yo++]=wi,bo[yo++]=xi,bo[yo++]=xs,wi=e.id,xi=e.overflow,xs=t}var Dn=null,Re=null,te=!1,bs=null,So=!1,xw=Error(j(519));function As(t){var e=Error(j(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw om(vo(e,t)),xw}function gD(t){var e=t.stateNode,n=t.type,r=t.memoizedProps;switch(e[On]=t,e[wr]=r,n){case"dialog":Yt("cancel",e),Yt("close",e);break;case"iframe":case"object":case"embed":Yt("load",e);break;case"video":case"audio":for(n=0;n<lm.length;n++)Yt(lm[n],e);break;case"source":Yt("error",e);break;case"img":case"image":case"link":Yt("error",e),Yt("load",e);break;case"details":Yt("toggle",e);break;case"input":Yt("invalid",e),UL(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Yt("invalid",e);break;case"textarea":Yt("invalid",e),PL(e,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||r.suppressHydrationWarning===!0||G3(e.textContent,n)?(r.popover!=null&&(Yt("beforetoggle",e),Yt("toggle",e)),r.onScroll!=null&&Yt("scroll",e),r.onScrollEnd!=null&&Yt("scrollend",e),r.onClick!=null&&(e.onclick=ua),e=!0):e=!1,e||As(t,!0)}function hD(t){for(Dn=t.return;Dn;)switch(Dn.tag){case 5:case 31:case 13:So=!1;return;case 27:case 3:So=!0;return;default:Dn=Dn.return}}function Ju(t){if(t!==Dn)return!1;if(!te)return hD(t),te=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Xw(t.type,t.memoizedProps)),n=!n),n&&Re&&As(t),hD(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(j(317));Re=oL(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(j(317));Re=oL(t)}else e===27?(e=Re,Ns(t.type)?(t=tx,tx=null,Re=t):Re=e):Re=Dn?To(t.stateNode.nextSibling):null;return!0}function zl(){Re=Dn=null,te=!1}function GT(){var t=bs;return t!==null&&(Er===null?Er=t:Er.push.apply(Er,t),bs=null),t}function om(t){bs===null?bs=[t]:bs.push(t)}var Aw=Ii(null),Wl=null,da=null;function ss(t,e,n){xe(Aw,e._currentValue),e._currentValue=n}function pa(t){t._currentValue=Aw.current,Rn(Aw)}function kw(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Iw(t,e,n,r){var o=t.child;for(o!==null&&(o.return=t);o!==null;){var i=o.dependencies;if(i!==null){var a=o.child;i=i.firstContext;t:for(;i!==null;){var s=i;i=o;for(var l=0;l<e.length;l++)if(s.context===e[l]){i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),kw(i.return,n,t),r||(a=null);break t}i=s.next}}else if(o.tag===18){if(a=o.return,a===null)throw Error(j(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),kw(a,n,t),a=null}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}}function Od(t,e,n,r){t=null;for(var o=e,i=!1;o!==null;){if(!i){if((o.flags&524288)!==0)i=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var a=o.alternate;if(a===null)throw Error(j(387));if(a=a.memoizedProps,a!==null){var s=o.type;Vr(o.pendingProps.value,a.value)||(t!==null?t.push(s):t=[s])}}else if(o===Jy.current){if(a=o.alternate,a===null)throw Error(j(387));a.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(t!==null?t.push(um):t=[um])}o=o.return}t!==null&&Iw(e,t,n,r),e.flags|=262144}function i_(t){for(t=t.firstContext;t!==null;){if(!Vr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Fl(t){Wl=t,da=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ln(t){return s5(Wl,t)}function Ay(t,e){return Wl===null&&Fl(t),s5(t,e)}function s5(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},da===null){if(t===null)throw Error(j(308));da=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else da=da.next=e;return n}var kW=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,r){t.push(r)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},IW=yn.unstable_scheduleCallback,RW=yn.unstable_NormalPriority,sn={$$typeof:ca,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vx(){return{controller:new kW,data:new Map,refCount:0}}function _m(t){t.refCount--,t.refCount===0&&IW(RW,function(){t.controller.abort()})}var $p=null,Rw=0,Td=0,hd=null;function NW(t,e){if($p===null){var n=$p=[];Rw=0,Td=qx(),hd={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Rw++,e.then(bD,bD),e}function bD(){if(--Rw===0&&$p!==null){hd!==null&&(hd.status="fulfilled");var t=$p;$p=null,Td=0,hd=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function CW(t,e){var n=[],r={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return t.then(function(){r.status="fulfilled",r.value=e;for(var o=0;o<n.length;o++)(0,n[o])(e)},function(o){for(r.status="rejected",r.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),r}var yD=At.S;At.S=function(t,e){S3=Gr(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&NW(t,e),yD!==null&&yD(t,e)};var Ul=Ii(null);function Sx(){var t=Ul.current;return t!==null?t:Se.pooledCache}function Hy(t,e){e===null?xe(Ul,Ul.current):xe(Ul,e.pool)}function l5(){var t=Sx();return t===null?null:{parent:sn._currentValue,pool:t}}var Dd=Error(j(460)),Ex=Error(j(474)),M_=Error(j(542)),a_={then:function(){}};function _D(t){return t=t.status,t==="fulfilled"||t==="rejected"}function c5(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(ua,ua),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,SD(t),t;default:if(typeof e.status=="string")e.then(ua,ua);else{if(t=Se,t!==null&&100<t.shellSuspendCounter)throw Error(j(482));t=e,t.status="pending",t.then(function(r){if(e.status==="pending"){var o=e;o.status="fulfilled",o.value=r}},function(r){if(e.status==="pending"){var o=e;o.status="rejected",o.reason=r}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,SD(t),t}throw Bl=e,Dd}}function Ml(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Bl=n,Dd):n}}var Bl=null;function vD(){if(Bl===null)throw Error(j(459));var t=Bl;return Bl=null,t}function SD(t){if(t===Dd||t===M_)throw Error(j(483))}var bd=null,im=0;function ky(t){var e=im;return im+=1,bd===null&&(bd=[]),c5(bd,t,e)}function Np(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Iy(t,e){throw e.$$typeof===bY?Error(j(525)):(t=Object.prototype.toString.call(e),Error(j(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function u5(t){function e(h,y){if(t){var S=h.deletions;S===null?(h.deletions=[y],h.flags|=16):S.push(y)}}function n(h,y){if(!t)return null;for(;y!==null;)e(h,y),y=y.sibling;return null}function r(h){for(var y=new Map;h!==null;)h.key!==null?y.set(h.key,h):y.set(h.index,h),h=h.sibling;return y}function o(h,y){return h=fa(h,y),h.index=0,h.sibling=null,h}function i(h,y,S){return h.index=S,t?(S=h.alternate,S!==null?(S=S.index,S<y?(h.flags|=67108866,y):S):(h.flags|=67108866,y)):(h.flags|=1048576,y)}function a(h){return t&&h.alternate===null&&(h.flags|=67108866),h}function s(h,y,S,E){return y===null||y.tag!==6?(y=FT(S,h.mode,E),y.return=h,y):(y=o(y,S),y.return=h,y)}function l(h,y,S,E){var R=S.type;return R===ed?d(h,y,S.props.children,E,S.key):y!==null&&(y.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===is&&Ml(R)===y.type)?(y=o(y,S.props),Np(y,S),y.return=h,y):(y=Fy(S.type,S.key,S.props,null,h.mode,E),Np(y,S),y.return=h,y)}function c(h,y,S,E){return y===null||y.tag!==4||y.stateNode.containerInfo!==S.containerInfo||y.stateNode.implementation!==S.implementation?(y=HT(S,h.mode,E),y.return=h,y):(y=o(y,S.children||[]),y.return=h,y)}function d(h,y,S,E,R){return y===null||y.tag!==7?(y=Ll(S,h.mode,E,R),y.return=h,y):(y=o(y,S),y.return=h,y)}function u(h,y,S){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=FT(""+y,h.mode,S),y.return=h,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case yy:return S=Fy(y.type,y.key,y.props,null,h.mode,S),Np(S,y),S.return=h,S;case Lp:return y=HT(y,h.mode,S),y.return=h,y;case is:return y=Ml(y),u(h,y,S)}if(Up(y)||Ip(y))return y=Ll(y,h.mode,S,null),y.return=h,y;if(typeof y.then=="function")return u(h,ky(y),S);if(y.$$typeof===ca)return u(h,Ay(h,y),S);Iy(h,y)}return null}function p(h,y,S,E){var R=y!==null?y.key:null;if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return R!==null?null:s(h,y,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case yy:return S.key===R?l(h,y,S,E):null;case Lp:return S.key===R?c(h,y,S,E):null;case is:return S=Ml(S),p(h,y,S,E)}if(Up(S)||Ip(S))return R!==null?null:d(h,y,S,E,null);if(typeof S.then=="function")return p(h,y,ky(S),E);if(S.$$typeof===ca)return p(h,y,Ay(h,S),E);Iy(h,S)}return null}function f(h,y,S,E,R){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return h=h.get(S)||null,s(y,h,""+E,R);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case yy:return h=h.get(E.key===null?S:E.key)||null,l(y,h,E,R);case Lp:return h=h.get(E.key===null?S:E.key)||null,c(y,h,E,R);case is:return E=Ml(E),f(h,y,S,E,R)}if(Up(E)||Ip(E))return h=h.get(S)||null,d(y,h,E,R,null);if(typeof E.then=="function")return f(h,y,S,ky(E),R);if(E.$$typeof===ca)return f(h,y,S,Ay(y,E),R);Iy(y,E)}return null}function m(h,y,S,E){for(var R=null,C=null,k=y,L=y=0,F=null;k!==null&&L<S.length;L++){k.index>L?(F=k,k=null):F=k.sibling;var U=p(h,k,S[L],E);if(U===null){k===null&&(k=F);break}t&&k&&U.alternate===null&&e(h,k),y=i(U,y,L),C===null?R=U:C.sibling=U,C=U,k=F}if(L===S.length)return n(h,k),te&&sa(h,L),R;if(k===null){for(;L<S.length;L++)k=u(h,S[L],E),k!==null&&(y=i(k,y,L),C===null?R=k:C.sibling=k,C=k);return te&&sa(h,L),R}for(k=r(k);L<S.length;L++)F=f(k,h,L,S[L],E),F!==null&&(t&&F.alternate!==null&&k.delete(F.key===null?L:F.key),y=i(F,y,L),C===null?R=F:C.sibling=F,C=F);return t&&k.forEach(function(D){return e(h,D)}),te&&sa(h,L),R}function _(h,y,S,E){if(S==null)throw Error(j(151));for(var R=null,C=null,k=y,L=y=0,F=null,U=S.next();k!==null&&!U.done;L++,U=S.next()){k.index>L?(F=k,k=null):F=k.sibling;var D=p(h,k,U.value,E);if(D===null){k===null&&(k=F);break}t&&k&&D.alternate===null&&e(h,k),y=i(D,y,L),C===null?R=D:C.sibling=D,C=D,k=F}if(U.done)return n(h,k),te&&sa(h,L),R;if(k===null){for(;!U.done;L++,U=S.next())U=u(h,U.value,E),U!==null&&(y=i(U,y,L),C===null?R=U:C.sibling=U,C=U);return te&&sa(h,L),R}for(k=r(k);!U.done;L++,U=S.next())U=f(k,h,L,U.value,E),U!==null&&(t&&U.alternate!==null&&k.delete(U.key===null?L:U.key),y=i(U,y,L),C===null?R=U:C.sibling=U,C=U);return t&&k.forEach(function(N){return e(h,N)}),te&&sa(h,L),R}function v(h,y,S,E){if(typeof S=="object"&&S!==null&&S.type===ed&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case yy:t:{for(var R=S.key;y!==null;){if(y.key===R){if(R=S.type,R===ed){if(y.tag===7){n(h,y.sibling),E=o(y,S.props.children),E.return=h,h=E;break t}}else if(y.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===is&&Ml(R)===y.type){n(h,y.sibling),E=o(y,S.props),Np(E,S),E.return=h,h=E;break t}n(h,y);break}else e(h,y);y=y.sibling}S.type===ed?(E=Ll(S.props.children,h.mode,E,S.key),E.return=h,h=E):(E=Fy(S.type,S.key,S.props,null,h.mode,E),Np(E,S),E.return=h,h=E)}return a(h);case Lp:t:{for(R=S.key;y!==null;){if(y.key===R)if(y.tag===4&&y.stateNode.containerInfo===S.containerInfo&&y.stateNode.implementation===S.implementation){n(h,y.sibling),E=o(y,S.children||[]),E.return=h,h=E;break t}else{n(h,y);break}else e(h,y);y=y.sibling}E=HT(S,h.mode,E),E.return=h,h=E}return a(h);case is:return S=Ml(S),v(h,y,S,E)}if(Up(S))return m(h,y,S,E);if(Ip(S)){if(R=Ip(S),typeof R!="function")throw Error(j(150));return S=R.call(S),_(h,y,S,E)}if(typeof S.then=="function")return v(h,y,ky(S),E);if(S.$$typeof===ca)return v(h,y,Ay(h,S),E);Iy(h,S)}return typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint"?(S=""+S,y!==null&&y.tag===6?(n(h,y.sibling),E=o(y,S),E.return=h,h=E):(n(h,y),E=FT(S,h.mode,E),E.return=h,h=E),a(h)):n(h,y)}return function(h,y,S,E){try{im=0;var R=v(h,y,S,E);return bd=null,R}catch(k){if(k===Dd||k===M_)throw k;var C=Fr(29,k,null,h.mode);return C.lanes=E,C.return=h,C}finally{}}}var Hl=u5(!0),d5=u5(!1),as=!1;function Tx(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nw(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ys(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function _s(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(le&2)!==0){var o=r.pending;return o===null?e.next=e:(e.next=o.next,o.next=e),r.pending=e,e=r_(t),n5(t,null,n),e}return C_(t,r,e,n),r_(t)}function jp(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,RL(t,n)}}function $T(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=e:i=i.next=e}else o=i=e;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Cw=!1;function qp(){if(Cw){var t=hd;if(t!==null)throw t}}function Vp(t,e,n,r){Cw=!1;var o=t.updateQueue;as=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?i=c:a.next=c,a=l;var d=t.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==a&&(s===null?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l))}if(i!==null){var u=o.baseState;a=0,d=c=l=null,s=i;do{var p=s.lane&-536870913,f=p!==s.lane;if(f?(Jt&p)===p:(r&p)===p){p!==0&&p===Td&&(Cw=!0),d!==null&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});t:{var m=t,_=s;p=e;var v=n;switch(_.tag){case 1:if(m=_.payload,typeof m=="function"){u=m.call(v,u,p);break t}u=m;break t;case 3:m.flags=m.flags&-65537|128;case 0:if(m=_.payload,p=typeof m=="function"?m.call(v,u,p):m,p==null)break t;u=Ne({},u,p);break t;case 2:as=!0}}p=s.callback,p!==null&&(t.flags|=64,f&&(t.flags|=8192),f=o.callbacks,f===null?o.callbacks=[p]:f.push(p))}else f={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(c=d=f,l=u):d=d.next=f,a|=p;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;f=s,s=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);d===null&&(l=u),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=d,i===null&&(o.shared.lanes=0),Is|=a,t.lanes=a,t.memoizedState=u}}function f5(t,e){if(typeof t!="function")throw Error(j(191,t));t.call(e)}function p5(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)f5(n[t],e)}var wd=Ii(null),s_=Ii(0);function ED(t,e){t=_a,xe(s_,t),xe(wd,e),_a=t|e.baseLanes}function Mw(){xe(s_,_a),xe(wd,wd.current)}function wx(){_a=s_.current,Rn(wd),Rn(s_)}var Yr=Ii(null),Eo=null;function ls(t){var e=t.alternate;xe(Ke,Ke.current&1),xe(Yr,t),Eo===null&&(e===null||wd.current!==null||e.memoizedState!==null)&&(Eo=t)}function Ow(t){xe(Ke,Ke.current),xe(Yr,t),Eo===null&&(Eo=t)}function m5(t){t.tag===22?(xe(Ke,Ke.current),xe(Yr,t),Eo===null&&(Eo=t)):cs(t)}function cs(){xe(Ke,Ke.current),xe(Yr,Yr.current)}function zr(t){Rn(Yr),Eo===t&&(Eo=null),Rn(Ke)}var Ke=Ii(0);function l_(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Qw(n)||Zw(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var ha=0,zt=null,ge=null,on=null,c_=!1,yd=!1,Gl=!1,u_=0,am=0,_d=null,MW=0;function Ye(){throw Error(j(321))}function xx(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Vr(t[n],e[n]))return!1;return!0}function Ax(t,e,n,r,o,i){return ha=i,zt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,At.H=t===null||t.memoizedState===null?q5:Bx,Gl=!1,i=n(r,o),Gl=!1,yd&&(i=h5(e,n,r,o)),g5(t),i}function g5(t){At.H=sm;var e=ge!==null&&ge.next!==null;if(ha=0,on=ge=zt=null,c_=!1,am=0,_d=null,e)throw Error(j(300));t===null||ln||(t=t.dependencies,t!==null&&i_(t)&&(ln=!0))}function h5(t,e,n,r){zt=t;var o=0;do{if(yd&&(_d=null),am=0,yd=!1,25<=o)throw Error(j(301));if(o+=1,on=ge=null,t.updateQueue!=null){var i=t.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}At.H=V5,i=e(n,r)}while(yd);return i}function OW(){var t=At.H,e=t.useState()[0];return e=typeof e.then=="function"?vm(e):e,t=t.useState()[0],(ge!==null?ge.memoizedState:null)!==t&&(zt.flags|=1024),e}function kx(){var t=u_!==0;return u_=0,t}function Ix(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function Rx(t){if(c_){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}c_=!1}ha=0,on=ge=zt=null,yd=!1,am=u_=0,_d=null}function rr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?zt.memoizedState=on=t:on=on.next=t,on}function Xe(){if(ge===null){var t=zt.alternate;t=t!==null?t.memoizedState:null}else t=ge.next;var e=on===null?zt.memoizedState:on.next;if(e!==null)on=e,ge=t;else{if(t===null)throw zt.alternate===null?Error(j(467)):Error(j(310));ge=t,t={memoizedState:ge.memoizedState,baseState:ge.baseState,baseQueue:ge.baseQueue,queue:ge.queue,next:null},on===null?zt.memoizedState=on=t:on=on.next=t}return on}function O_(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vm(t){var e=am;return am+=1,_d===null&&(_d=[]),t=c5(_d,t,e),e=zt,(on===null?e.memoizedState:on.next)===null&&(e=e.alternate,At.H=e===null||e.memoizedState===null?q5:Bx),t}function D_(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return vm(t);if(t.$$typeof===ca)return Ln(t)}throw Error(j(438,String(t)))}function Nx(t){var e=null,n=zt.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var r=zt.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(e={data:r.data.map(function(o){return o.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=O_(),zt.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),r=0;r<t;r++)n[r]=yY;return e.index++,n}function ba(t,e){return typeof e=="function"?e(t):e}function Gy(t){var e=Xe();return Cx(e,ge,t)}function Cx(t,e,n){var r=t.queue;if(r===null)throw Error(j(311));r.lastRenderedReducer=n;var o=t.baseQueue,i=r.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}e.baseQueue=o=i,r.pending=null}if(i=t.baseState,o===null)t.memoizedState=i;else{e=o.next;var s=a=null,l=null,c=e,d=!1;do{var u=c.lane&-536870913;if(u!==c.lane?(Jt&u)===u:(ha&u)===u){var p=c.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),u===Td&&(d=!0);else if((ha&p)===p){c=c.next,p===Td&&(d=!0);continue}else u={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=u,a=i):l=l.next=u,zt.lanes|=p,Is|=p;u=c.action,Gl&&n(i,u),i=c.hasEagerState?c.eagerState:n(i,u)}else p={lane:u,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=p,a=i):l=l.next=p,zt.lanes|=u,Is|=u;c=c.next}while(c!==null&&c!==e);if(l===null?a=i:l.next=s,!Vr(i,t.memoizedState)&&(ln=!0,d&&(n=hd,n!==null)))throw n;t.memoizedState=i,t.baseState=a,t.baseQueue=l,r.lastRenderedState=i}return o===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function jT(t){var e=Xe(),n=e.queue;if(n===null)throw Error(j(311));n.lastRenderedReducer=t;var r=n.dispatch,o=n.pending,i=e.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=t(i,a.action),a=a.next;while(a!==o);Vr(i,e.memoizedState)||(ln=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function b5(t,e,n){var r=zt,o=Xe(),i=te;if(i){if(n===void 0)throw Error(j(407));n=n()}else n=e();var a=!Vr((ge||o).memoizedState,n);if(a&&(o.memoizedState=n,ln=!0),o=o.queue,Mx(v5.bind(null,r,o,t),[t]),o.getSnapshot!==e||a||on!==null&&on.memoizedState.tag&1){if(r.flags|=2048,xd(9,{destroy:void 0},_5.bind(null,r,o,n,e),null),Se===null)throw Error(j(349));i||(ha&127)!==0||y5(r,e,n)}return n}function y5(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=zt.updateQueue,e===null?(e=O_(),zt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function _5(t,e,n,r){e.value=n,e.getSnapshot=r,S5(e)&&E5(t)}function v5(t,e,n){return n(function(){S5(e)&&E5(t)})}function S5(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Vr(t,n)}catch{return!0}}function E5(t){var e=Yl(t,2);e!==null&&Tr(e,t,2)}function Dw(t){var e=rr();if(typeof t=="function"){var n=t;if(t=n(),Gl){ds(!0);try{n()}finally{ds(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:t},e}function T5(t,e,n,r){return t.baseState=n,Cx(t,ge,typeof r=="function"?r:ba)}function DW(t,e,n,r,o){if(U_(t))throw Error(j(485));if(t=e.action,t!==null){var i={payload:o,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){i.listeners.push(a)}};At.T!==null?n(!0):i.isTransition=!1,r(i),n=e.pending,n===null?(i.next=e.pending=i,w5(e,i)):(i.next=n.next,e.pending=n.next=i)}}function w5(t,e){var n=e.action,r=e.payload,o=t.state;if(e.isTransition){var i=At.T,a={};At.T=a;try{var s=n(o,r),l=At.S;l!==null&&l(a,s),TD(t,e,s)}catch(c){Lw(t,e,c)}finally{i!==null&&a.types!==null&&(i.types=a.types),At.T=i}}else try{i=n(o,r),TD(t,e,i)}catch(c){Lw(t,e,c)}}function TD(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){wD(t,e,r)},function(r){return Lw(t,e,r)}):wD(t,e,n)}function wD(t,e,n){e.status="fulfilled",e.value=n,x5(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,w5(t,n)))}function Lw(t,e,n){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=n,x5(e),e=e.next;while(e!==r)}t.action=null}function x5(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function A5(t,e){return e}function xD(t,e){if(te){var n=Se.formState;if(n!==null){t:{var r=zt;if(te){if(Re){e:{for(var o=Re,i=So;o.nodeType!==8;){if(!i){o=null;break e}if(o=To(o.nextSibling),o===null){o=null;break e}}i=o.data,o=i==="F!"||i==="F"?o:null}if(o){Re=To(o.nextSibling),r=o.data==="F!";break t}}As(r)}r=!1}r&&(e=n[0])}}return n=rr(),n.memoizedState=n.baseState=e,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:A5,lastRenderedState:e},n.queue=r,n=G5.bind(null,zt,r),r.dispatch=n,r=Dw(!1),i=Ux.bind(null,zt,!1,r.queue),r=rr(),o={state:e,dispatch:null,action:t,pending:null},r.queue=o,n=DW.bind(null,zt,o,i,n),o.dispatch=n,r.memoizedState=t,[e,n,!1]}function AD(t){var e=Xe();return k5(e,ge,t)}function k5(t,e,n){if(e=Cx(t,e,A5)[0],t=Gy(ba)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=vm(e)}catch(a){throw a===Dd?M_:a}else r=e;e=Xe();var o=e.queue,i=o.dispatch;return n!==e.memoizedState&&(zt.flags|=2048,xd(9,{destroy:void 0},LW.bind(null,o,n),null)),[r,i,t]}function LW(t,e){t.action=e}function kD(t){var e=Xe(),n=ge;if(n!==null)return k5(e,n,t);Xe(),e=e.memoizedState,n=Xe();var r=n.queue.dispatch;return n.memoizedState=t,[e,r,!1]}function xd(t,e,n,r){return t={tag:t,create:n,deps:r,inst:e,next:null},e=zt.updateQueue,e===null&&(e=O_(),zt.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t),t}function I5(){return Xe().memoizedState}function $y(t,e,n,r){var o=rr();zt.flags|=t,o.memoizedState=xd(1|e,{destroy:void 0},n,r===void 0?null:r)}function L_(t,e,n,r){var o=Xe();r=r===void 0?null:r;var i=o.memoizedState.inst;ge!==null&&r!==null&&xx(r,ge.memoizedState.deps)?o.memoizedState=xd(e,i,n,r):(zt.flags|=t,o.memoizedState=xd(1|e,i,n,r))}function ID(t,e){$y(8390656,8,t,e)}function Mx(t,e){L_(2048,8,t,e)}function UW(t){zt.flags|=4;var e=zt.updateQueue;if(e===null)e=O_(),zt.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function R5(t){var e=Xe().memoizedState;return UW({ref:e,nextImpl:t}),function(){if((le&2)!==0)throw Error(j(440));return e.impl.apply(void 0,arguments)}}function N5(t,e){return L_(4,2,t,e)}function C5(t,e){return L_(4,4,t,e)}function M5(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function O5(t,e,n){n=n!=null?n.concat([t]):null,L_(4,4,M5.bind(null,e,t),n)}function Ox(){}function D5(t,e){var n=Xe();e=e===void 0?null:e;var r=n.memoizedState;return e!==null&&xx(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function L5(t,e){var n=Xe();e=e===void 0?null:e;var r=n.memoizedState;if(e!==null&&xx(e,r[1]))return r[0];if(r=t(),Gl){ds(!0);try{t()}finally{ds(!1)}}return n.memoizedState=[r,e],r}function Dx(t,e,n){return n===void 0||(ha&1073741824)!==0&&(Jt&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=T3(),zt.lanes|=t,Is|=t,n)}function U5(t,e,n,r){return Vr(n,e)?n:wd.current!==null?(t=Dx(t,n,r),Vr(t,e)||(ln=!0),t):(ha&42)===0||(ha&1073741824)!==0&&(Jt&261930)===0?(ln=!0,t.memoizedState=n):(t=T3(),zt.lanes|=t,Is|=t,e)}function B5(t,e,n,r,o){var i=ce.p;ce.p=i!==0&&8>i?i:8;var a=At.T,s={};At.T=s,Ux(t,!1,e,n);try{var l=o(),c=At.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var d=CW(l,r);Yp(t,e,d,qr(t))}else Yp(t,e,r,qr(t))}catch(u){Yp(t,e,{then:function(){},status:"rejected",reason:u},qr())}finally{ce.p=i,a!==null&&s.types!==null&&(a.types=s.types),At.T=a}}function BW(){}function Uw(t,e,n,r){if(t.tag!==5)throw Error(j(476));var o=P5(t).queue;B5(t,o,e,Dl,n===null?BW:function(){return z5(t),n(r)})}function P5(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Dl,baseState:Dl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:Dl},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function z5(t){var e=P5(t);e.next===null&&(e=t.alternate.memoizedState),Yp(t,e.next.queue,{},qr())}function Lx(){return Ln(um)}function F5(){return Xe().memoizedState}function H5(){return Xe().memoizedState}function PW(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=qr();t=ys(n);var r=_s(e,t,n);r!==null&&(Tr(r,e,n),jp(r,e,n)),e={cache:vx()},t.payload=e;return}e=e.return}}function zW(t,e,n){var r=qr();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},U_(t)?$5(e,n):(n=hx(t,e,n,r),n!==null&&(Tr(n,t,r),j5(n,e,r)))}function G5(t,e,n){var r=qr();Yp(t,e,n,r)}function Yp(t,e,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(U_(t))$5(e,o);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Vr(s,a))return C_(t,e,o,0),Se===null&&N_(),!1}catch{}finally{}if(n=hx(t,e,o,r),n!==null)return Tr(n,t,r),j5(n,e,r),!0}return!1}function Ux(t,e,n,r){if(r={lane:2,revertLane:qx(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},U_(t)){if(e)throw Error(j(479))}else e=hx(t,n,r,2),e!==null&&Tr(e,t,2)}function U_(t){var e=t.alternate;return t===zt||e!==null&&e===zt}function $5(t,e){yd=c_=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function j5(t,e,n){if((n&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,RL(t,n)}}var sm={readContext:Ln,use:D_,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};sm.useEffectEvent=Ye;var q5={readContext:Ln,use:D_,useCallback:function(t,e){return rr().memoizedState=[t,e===void 0?null:e],t},useContext:Ln,useEffect:ID,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,$y(4194308,4,M5.bind(null,e,t),n)},useLayoutEffect:function(t,e){return $y(4194308,4,t,e)},useInsertionEffect:function(t,e){$y(4,2,t,e)},useMemo:function(t,e){var n=rr();e=e===void 0?null:e;var r=t();if(Gl){ds(!0);try{t()}finally{ds(!1)}}return n.memoizedState=[r,e],r},useReducer:function(t,e,n){var r=rr();if(n!==void 0){var o=n(e);if(Gl){ds(!0);try{n(e)}finally{ds(!1)}}}else o=e;return r.memoizedState=r.baseState=o,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:o},r.queue=t,t=t.dispatch=zW.bind(null,zt,t),[r.memoizedState,t]},useRef:function(t){var e=rr();return t={current:t},e.memoizedState=t},useState:function(t){t=Dw(t);var e=t.queue,n=G5.bind(null,zt,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Ox,useDeferredValue:function(t,e){var n=rr();return Dx(n,t,e)},useTransition:function(){var t=Dw(!1);return t=B5.bind(null,zt,t.queue,!0,!1),rr().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var r=zt,o=rr();if(te){if(n===void 0)throw Error(j(407));n=n()}else{if(n=e(),Se===null)throw Error(j(349));(Jt&127)!==0||y5(r,e,n)}o.memoizedState=n;var i={value:n,getSnapshot:e};return o.queue=i,ID(v5.bind(null,r,i,t),[t]),r.flags|=2048,xd(9,{destroy:void 0},_5.bind(null,r,i,n,e),null),n},useId:function(){var t=rr(),e=Se.identifierPrefix;if(te){var n=xi,r=wi;n=(r&~(1<<32-jr(r)-1)).toString(32)+n,e="_"+e+"R_"+n,n=u_++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=MW++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Lx,useFormState:xD,useActionState:xD,useOptimistic:function(t){var e=rr();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Ux.bind(null,zt,!0,n),n.dispatch=e,[t,e]},useMemoCache:Nx,useCacheRefresh:function(){return rr().memoizedState=PW.bind(null,zt)},useEffectEvent:function(t){var e=rr(),n={impl:t};return e.memoizedState=n,function(){if((le&2)!==0)throw Error(j(440));return n.impl.apply(void 0,arguments)}}},Bx={readContext:Ln,use:D_,useCallback:D5,useContext:Ln,useEffect:Mx,useImperativeHandle:O5,useInsertionEffect:N5,useLayoutEffect:C5,useMemo:L5,useReducer:Gy,useRef:I5,useState:function(){return Gy(ba)},useDebugValue:Ox,useDeferredValue:function(t,e){var n=Xe();return U5(n,ge.memoizedState,t,e)},useTransition:function(){var t=Gy(ba)[0],e=Xe().memoizedState;return[typeof t=="boolean"?t:vm(t),e]},useSyncExternalStore:b5,useId:F5,useHostTransitionStatus:Lx,useFormState:AD,useActionState:AD,useOptimistic:function(t,e){var n=Xe();return T5(n,ge,t,e)},useMemoCache:Nx,useCacheRefresh:H5};Bx.useEffectEvent=R5;var V5={readContext:Ln,use:D_,useCallback:D5,useContext:Ln,useEffect:Mx,useImperativeHandle:O5,useInsertionEffect:N5,useLayoutEffect:C5,useMemo:L5,useReducer:jT,useRef:I5,useState:function(){return jT(ba)},useDebugValue:Ox,useDeferredValue:function(t,e){var n=Xe();return ge===null?Dx(n,t,e):U5(n,ge.memoizedState,t,e)},useTransition:function(){var t=jT(ba)[0],e=Xe().memoizedState;return[typeof t=="boolean"?t:vm(t),e]},useSyncExternalStore:b5,useId:F5,useHostTransitionStatus:Lx,useFormState:kD,useActionState:kD,useOptimistic:function(t,e){var n=Xe();return ge!==null?T5(n,ge,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Nx,useCacheRefresh:H5};V5.useEffectEvent=R5;function qT(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Ne({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Bw={enqueueSetState:function(t,e,n){t=t._reactInternals;var r=qr(),o=ys(r);o.payload=e,n!=null&&(o.callback=n),e=_s(t,o,r),e!==null&&(Tr(e,t,r),jp(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=qr(),o=ys(r);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=_s(t,o,r),e!==null&&(Tr(e,t,r),jp(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=qr(),r=ys(n);r.tag=2,e!=null&&(r.callback=e),e=_s(t,r,n),e!==null&&(Tr(e,t,n),jp(e,t,n))}};function RD(t,e,n,r,o,i,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,a):e.prototype&&e.prototype.isPureReactComponent?!nm(n,r)||!nm(o,i):!0}function ND(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Bw.enqueueReplaceState(e,e.state,null)}function $l(t,e){var n=e;if("ref"in e){n={};for(var r in e)r!=="ref"&&(n[r]=e[r])}if(t=t.defaultProps){n===e&&(n=Ne({},n));for(var o in t)n[o]===void 0&&(n[o]=t[o])}return n}function Y5(t){n_(t)}function W5(t){console.error(t)}function K5(t){n_(t)}function d_(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function CD(t,e,n){try{var r=t.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Pw(t,e,n){return n=ys(n),n.tag=3,n.payload={element:null},n.callback=function(){d_(t,e)},n}function X5(t){return t=ys(t),t.tag=3,t}function J5(t,e,n,r){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var i=r.value;t.payload=function(){return o(i)},t.callback=function(){CD(e,n,r)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){CD(e,n,r),typeof o!="function"&&(vs===null?vs=new Set([this]):vs.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function FW(t,e,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=n.alternate,e!==null&&Od(e,n,o,!0),n=Yr.current,n!==null){switch(n.tag){case 31:case 13:return Eo===null?h_():n.alternate===null&&We===0&&(We=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===a_?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([r]):e.add(r),nw(t,r,o)),!1;case 22:return n.flags|=65536,r===a_?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([r]):n.add(r)),nw(t,r,o)),!1}throw Error(j(435,n.tag))}return nw(t,r,o),h_(),!1}if(te)return e=Yr.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=o,r!==xw&&(t=Error(j(422),{cause:r}),om(vo(t,n)))):(r!==xw&&(e=Error(j(423),{cause:r}),om(vo(e,n))),t=t.current.alternate,t.flags|=65536,o&=-o,t.lanes|=o,r=vo(r,n),o=Pw(t.stateNode,r,o),$T(t,o),We!==4&&(We=2)),!1;var i=Error(j(520),{cause:r});if(i=vo(i,n),Xp===null?Xp=[i]:Xp.push(i),We!==4&&(We=2),e===null)return!0;r=vo(r,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=o&-o,n.lanes|=t,t=Pw(n.stateNode,r,t),$T(n,t),!1;case 1:if(e=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(vs===null||!vs.has(i))))return n.flags|=65536,o&=-o,n.lanes|=o,o=X5(o),J5(o,t,n,r),$T(n,o),!1}n=n.return}while(n!==null);return!1}var Px=Error(j(461)),ln=!1;function Mn(t,e,n,r){e.child=t===null?d5(e,null,n,r):Hl(e,t.child,n,r)}function MD(t,e,n,r,o){n=n.render;var i=e.ref;if("ref"in r){var a={};for(var s in r)s!=="ref"&&(a[s]=r[s])}else a=r;return Fl(e),r=Ax(t,e,n,a,i,o),s=kx(),t!==null&&!ln?(Ix(t,e,o),ya(t,e,o)):(te&&s&&yx(e),e.flags|=1,Mn(t,e,r,o),e.child)}function OD(t,e,n,r,o){if(t===null){var i=n.type;return typeof i=="function"&&!bx(i)&&i.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=i,Q5(t,e,i,r,o)):(t=Fy(n.type,null,r,e,e.mode,o),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!zx(t,o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:nm,n(a,r)&&t.ref===e.ref)return ya(t,e,o)}return e.flags|=1,t=fa(i,r),t.ref=e.ref,t.return=e,e.child=t}function Q5(t,e,n,r,o){if(t!==null){var i=t.memoizedProps;if(nm(i,r)&&t.ref===e.ref)if(ln=!1,e.pendingProps=r=i,zx(t,o))(t.flags&131072)!==0&&(ln=!0);else return e.lanes=t.lanes,ya(t,e,o)}return zw(t,e,n,r,o)}function Z5(t,e,n,r){var o=r.children,i=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((e.flags&128)!==0){if(i=i!==null?i.baseLanes|n:n,t!==null){for(r=e.child=t.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~i}else r=0,e.child=null;return DD(t,e,i,n,r)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Hy(e,i!==null?i.cachePool:null),i!==null?ED(e,i):Mw(),m5(e);else return r=e.lanes=536870912,DD(t,e,i!==null?i.baseLanes|n:n,n,r)}else i!==null?(Hy(e,i.cachePool),ED(e,i),cs(e),e.memoizedState=null):(t!==null&&Hy(e,null),Mw(),cs(e));return Mn(t,e,o,n),e.child}function Pp(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function DD(t,e,n,r,o){var i=Sx();return i=i===null?null:{parent:sn._currentValue,pool:i},e.memoizedState={baseLanes:n,cachePool:i},t!==null&&Hy(e,null),Mw(),m5(e),t!==null&&Od(t,e,r,!0),e.childLanes=o,null}function jy(t,e){return e=f_({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function LD(t,e,n){return Hl(e,t.child,null,n),t=jy(e,e.pendingProps),t.flags|=2,zr(e),e.memoizedState=null,t}function HW(t,e,n){var r=e.pendingProps,o=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(te){if(r.mode==="hidden")return t=jy(e,r),e.lanes=536870912,Pp(null,t);if(Ow(e),(t=Re)?(t=q3(t,So),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:xs!==null?{id:wi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},n=o5(t),n.return=e,e.child=n,Dn=e,Re=null)):t=null,t===null)throw As(e);return e.lanes=536870912,null}return jy(e,r)}var i=t.memoizedState;if(i!==null){var a=i.dehydrated;if(Ow(e),o)if(e.flags&256)e.flags&=-257,e=LD(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(j(558));else if(ln||Od(t,e,n,!1),o=(n&t.childLanes)!==0,ln||o){if(r=Se,r!==null&&(a=NL(r,n),a!==0&&a!==i.retryLane))throw i.retryLane=a,Yl(t,a),Tr(r,t,a),Px;h_(),e=LD(t,e,n)}else t=i.treeContext,Re=To(a.nextSibling),Dn=e,te=!0,bs=null,So=!1,t!==null&&a5(e,t),e=jy(e,r),e.flags|=4096;return e}return t=fa(t.child,{mode:r.mode,children:r.children}),t.ref=e.ref,e.child=t,t.return=e,t}function qy(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(j(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function zw(t,e,n,r,o){return Fl(e),n=Ax(t,e,n,r,void 0,o),r=kx(),t!==null&&!ln?(Ix(t,e,o),ya(t,e,o)):(te&&r&&yx(e),e.flags|=1,Mn(t,e,n,o),e.child)}function UD(t,e,n,r,o,i){return Fl(e),e.updateQueue=null,n=h5(e,r,n,o),g5(t),r=kx(),t!==null&&!ln?(Ix(t,e,i),ya(t,e,i)):(te&&r&&yx(e),e.flags|=1,Mn(t,e,n,i),e.child)}function BD(t,e,n,r,o){if(Fl(e),e.stateNode===null){var i=cd,a=n.contextType;typeof a=="object"&&a!==null&&(i=Ln(a)),i=new n(r,i),e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Bw,e.stateNode=i,i._reactInternals=e,i=e.stateNode,i.props=r,i.state=e.memoizedState,i.refs={},Tx(e),a=n.contextType,i.context=typeof a=="object"&&a!==null?Ln(a):cd,i.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(qT(e,n,a,r),i.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(a=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),a!==i.state&&Bw.enqueueReplaceState(i,i.state,null),Vp(e,r,i,o),qp(),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308),r=!0}else if(t===null){i=e.stateNode;var s=e.memoizedProps,l=$l(n,s);i.props=l;var c=i.context,d=n.contextType;a=cd,typeof d=="object"&&d!==null&&(a=Ln(d));var u=n.getDerivedStateFromProps;d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s||c!==a)&&ND(e,i,r,a),as=!1;var p=e.memoizedState;i.state=p,Vp(e,r,i,o),qp(),c=e.memoizedState,s||p!==c||as?(typeof u=="function"&&(qT(e,n,u,r),c=e.memoizedState),(l=as||RD(e,n,l,r,p,c,a))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(e.flags|=4194308)):(typeof i.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),i.props=r,i.state=c,i.context=a,r=l):(typeof i.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{i=e.stateNode,Nw(t,e),a=e.memoizedProps,d=$l(n,a),i.props=d,u=e.pendingProps,p=i.context,c=n.contextType,l=cd,typeof c=="object"&&c!==null&&(l=Ln(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==u||p!==l)&&ND(e,i,r,l),as=!1,p=e.memoizedState,i.state=p,Vp(e,r,i,o),qp();var f=e.memoizedState;a!==u||p!==f||as||t!==null&&t.dependencies!==null&&i_(t.dependencies)?(typeof s=="function"&&(qT(e,n,s,r),f=e.memoizedState),(d=as||RD(e,n,d,r,p,f,l)||t!==null&&t.dependencies!==null&&i_(t.dependencies))?(c||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,f,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,f,l)),typeof i.componentDidUpdate=="function"&&(e.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=f),i.props=r,i.state=f,i.context=l,r=d):(typeof i.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return i=r,qy(t,e),r=(e.flags&128)!==0,i||r?(i=e.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:i.render(),e.flags|=1,t!==null&&r?(e.child=Hl(e,t.child,null,o),e.child=Hl(e,null,n,o)):Mn(t,e,n,o),e.memoizedState=i.state,t=e.child):t=ya(t,e,o),t}function PD(t,e,n,r){return zl(),e.flags|=256,Mn(t,e,n,r),e.child}var VT={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function YT(t){return{baseLanes:t,cachePool:l5()}}function WT(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Hr),t}function t3(t,e,n){var r=e.pendingProps,o=!1,i=(e.flags&128)!==0,a;if((a=i)||(a=t!==null&&t.memoizedState===null?!1:(Ke.current&2)!==0),a&&(o=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(te){if(o?ls(e):cs(e),(t=Re)?(t=q3(t,So),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:xs!==null?{id:wi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},n=o5(t),n.return=e,e.child=n,Dn=e,Re=null)):t=null,t===null)throw As(e);return Zw(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,o?(cs(e),o=e.mode,s=f_({mode:"hidden",children:s},o),r=Ll(r,o,n,null),s.return=e,r.return=e,s.sibling=r,e.child=s,r=e.child,r.memoizedState=YT(n),r.childLanes=WT(t,a,n),e.memoizedState=VT,Pp(null,r)):(ls(e),Fw(e,s))}var l=t.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(i)e.flags&256?(ls(e),e.flags&=-257,e=KT(t,e,n)):e.memoizedState!==null?(cs(e),e.child=t.child,e.flags|=128,e=null):(cs(e),s=r.fallback,o=e.mode,r=f_({mode:"visible",children:r.children},o),s=Ll(s,o,n,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,Hl(e,t.child,null,n),r=e.child,r.memoizedState=YT(n),r.childLanes=WT(t,a,n),e.memoizedState=VT,e=Pp(null,r));else if(ls(e),Zw(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,r=Error(j(419)),r.stack="",r.digest=a,om({value:r,source:null,stack:null}),e=KT(t,e,n)}else if(ln||Od(t,e,n,!1),a=(n&t.childLanes)!==0,ln||a){if(a=Se,a!==null&&(r=NL(a,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Yl(t,r),Tr(a,t,r),Px;Qw(s)||h_(),e=KT(t,e,n)}else Qw(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Re=To(s.nextSibling),Dn=e,te=!0,bs=null,So=!1,t!==null&&a5(e,t),e=Fw(e,r.children),e.flags|=4096);return e}return o?(cs(e),s=r.fallback,o=e.mode,l=t.child,c=l.sibling,r=fa(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=fa(c,s):(s=Ll(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,Pp(null,r),r=e.child,s=t.child.memoizedState,s===null?s=YT(n):(o=s.cachePool,o!==null?(l=sn._currentValue,o=o.parent!==l?{parent:l,pool:l}:o):o=l5(),s={baseLanes:s.baseLanes|n,cachePool:o}),r.memoizedState=s,r.childLanes=WT(t,a,n),e.memoizedState=VT,Pp(t.child,r)):(ls(e),n=t.child,t=n.sibling,n=fa(n,{mode:"visible",children:r.children}),n.return=e,n.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=n,e.memoizedState=null,n)}function Fw(t,e){return e=f_({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function f_(t,e){return t=Fr(22,t,null,e),t.lanes=0,t}function KT(t,e,n){return Hl(e,t.child,null,n),t=Fw(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function zD(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),kw(t.return,e,n)}function XT(t,e,n,r,o,i){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:i}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o,a.treeForkCount=i)}function e3(t,e,n){var r=e.pendingProps,o=r.revealOrder,i=r.tail;r=r.children;var a=Ke.current,s=(a&2)!==0;if(s?(a=a&1|2,e.flags|=128):a&=1,xe(Ke,a),Mn(t,e,r,n),r=te?rm:0,!s&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&zD(t,n,e);else if(t.tag===19)zD(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(o){case"forwards":for(n=e.child,o=null;n!==null;)t=n.alternate,t!==null&&l_(t)===null&&(o=n),n=n.sibling;n=o,n===null?(o=e.child,e.child=null):(o=n.sibling,n.sibling=null),XT(e,!1,o,n,i,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=e.child,e.child=null;o!==null;){if(t=o.alternate,t!==null&&l_(t)===null){e.child=o;break}t=o.sibling,o.sibling=n,n=o,o=t}XT(e,!0,n,null,i,r);break;case"together":XT(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function ya(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Is|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Od(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(j(153));if(e.child!==null){for(t=e.child,n=fa(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=fa(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function zx(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&i_(t)))}function GW(t,e,n){switch(e.tag){case 3:Qy(e,e.stateNode.containerInfo),ss(e,sn,t.memoizedState.cache),zl();break;case 27:case 5:mw(e);break;case 4:Qy(e,e.stateNode.containerInfo);break;case 10:ss(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Ow(e),null;break;case 13:var r=e.memoizedState;if(r!==null)return r.dehydrated!==null?(ls(e),e.flags|=128,null):(n&e.child.childLanes)!==0?t3(t,e,n):(ls(e),t=ya(t,e,n),t!==null?t.sibling:null);ls(e);break;case 19:var o=(t.flags&128)!==0;if(r=(n&e.childLanes)!==0,r||(Od(t,e,n,!1),r=(n&e.childLanes)!==0),o){if(r)return e3(t,e,n);e.flags|=128}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),xe(Ke,Ke.current),r)break;return null;case 22:return e.lanes=0,Z5(t,e,n,e.pendingProps);case 24:ss(e,sn,t.memoizedState.cache)}return ya(t,e,n)}function n3(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ln=!0;else{if(!zx(t,n)&&(e.flags&128)===0)return ln=!1,GW(t,e,n);ln=(t.flags&131072)!==0}else ln=!1,te&&(e.flags&1048576)!==0&&i5(e,rm,e.index);switch(e.lanes=0,e.tag){case 16:t:{var r=e.pendingProps;if(t=Ml(e.elementType),e.type=t,typeof t=="function")bx(t)?(r=$l(t,r),e.tag=1,e=BD(null,e,t,r,n)):(e.tag=0,e=zw(null,e,t,r,n));else{if(t!=null){var o=t.$$typeof;if(o===rx){e.tag=11,e=MD(null,e,t,r,n);break t}else if(o===ox){e.tag=14,e=OD(null,e,t,r,n);break t}}throw e=fw(t)||t,Error(j(306,e,""))}}return e;case 0:return zw(t,e,e.type,e.pendingProps,n);case 1:return r=e.type,o=$l(r,e.pendingProps),BD(t,e,r,o,n);case 3:t:{if(Qy(e,e.stateNode.containerInfo),t===null)throw Error(j(387));r=e.pendingProps;var i=e.memoizedState;o=i.element,Nw(t,e),Vp(e,r,null,n);var a=e.memoizedState;if(r=a.cache,ss(e,sn,r),r!==i.cache&&Iw(e,[sn],n,!0),qp(),r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){e=PD(t,e,r,n);break t}else if(r!==o){o=vo(Error(j(424)),e),om(o),e=PD(t,e,r,n);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Re=To(t.firstChild),Dn=e,te=!0,bs=null,So=!0,n=d5(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zl(),r===o){e=ya(t,e,n);break t}Mn(t,e,r,n)}e=e.child}return e;case 26:return qy(t,e),t===null?(n=sL(e.type,null,e.pendingProps,null))?e.memoizedState=n:te||(n=e.type,t=e.pendingProps,r=v_(hs.current).createElement(n),r[On]=e,r[wr]=t,Un(r,n,t),In(r),e.stateNode=r):e.memoizedState=sL(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return mw(e),t===null&&te&&(r=e.stateNode=V3(e.type,e.pendingProps,hs.current),Dn=e,So=!0,o=Re,Ns(e.type)?(tx=o,Re=To(r.firstChild)):Re=o),Mn(t,e,e.pendingProps.children,n),qy(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&te&&((o=r=Re)&&(r=hK(r,e.type,e.pendingProps,So),r!==null?(e.stateNode=r,Dn=e,Re=To(r.firstChild),So=!1,o=!0):o=!1),o||As(e)),mw(e),o=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,r=i.children,Xw(o,i)?r=null:a!==null&&Xw(o,a)&&(e.flags|=32),e.memoizedState!==null&&(o=Ax(t,e,OW,null,null,n),um._currentValue=o),qy(t,e),Mn(t,e,r,n),e.child;case 6:return t===null&&te&&((t=n=Re)&&(n=bK(n,e.pendingProps,So),n!==null?(e.stateNode=n,Dn=e,Re=null,t=!0):t=!1),t||As(e)),null;case 13:return t3(t,e,n);case 4:return Qy(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Hl(e,null,r,n):Mn(t,e,r,n),e.child;case 11:return MD(t,e,e.type,e.pendingProps,n);case 7:return Mn(t,e,e.pendingProps,n),e.child;case 8:return Mn(t,e,e.pendingProps.children,n),e.child;case 12:return Mn(t,e,e.pendingProps.children,n),e.child;case 10:return r=e.pendingProps,ss(e,e.type,r.value),Mn(t,e,r.children,n),e.child;case 9:return o=e.type._context,r=e.pendingProps.children,Fl(e),o=Ln(o),r=r(o),e.flags|=1,Mn(t,e,r,n),e.child;case 14:return OD(t,e,e.type,e.pendingProps,n);case 15:return Q5(t,e,e.type,e.pendingProps,n);case 19:return e3(t,e,n);case 31:return HW(t,e,n);case 22:return Z5(t,e,n,e.pendingProps);case 24:return Fl(e),r=Ln(sn),t===null?(o=Sx(),o===null&&(o=Se,i=vx(),o.pooledCache=i,i.refCount++,i!==null&&(o.pooledCacheLanes|=n),o=i),e.memoizedState={parent:r,cache:o},Tx(e),ss(e,sn,o)):((t.lanes&n)!==0&&(Nw(t,e),Vp(e,null,null,n),qp()),o=t.memoizedState,i=e.memoizedState,o.parent!==r?(o={parent:r,cache:r},e.memoizedState=o,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=o),ss(e,sn,r)):(r=i.cache,ss(e,sn,r),r!==o.cache&&Iw(e,[sn],n,!0))),Mn(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(j(156,e.tag))}function ra(t){t.flags|=4}function JT(t,e,n,r,o){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(o&335544128)===o)if(t.stateNode.complete)t.flags|=8192;else if(A3())t.flags|=8192;else throw Bl=a_,Ex}else t.flags&=-16777217}function FD(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!K3(e))if(A3())t.flags|=8192;else throw Bl=a_,Ex}function Ry(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?kL():536870912,t.lanes|=e,Ad|=e)}function Cp(t,e){if(!te)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Ie(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&65011712,r|=o.flags&65011712,o.return=t,o=o.sibling;else for(o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=t,o=o.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function $W(t,e,n){var r=e.pendingProps;switch(_x(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(e),null;case 1:return Ie(e),null;case 3:return n=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),pa(sn),vd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Ju(e)?ra(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,GT())),Ie(e),null;case 26:var o=e.type,i=e.memoizedState;return t===null?(ra(e),i!==null?(Ie(e),FD(e,i)):(Ie(e),JT(e,o,null,r,n))):i?i!==t.memoizedState?(ra(e),Ie(e),FD(e,i)):(Ie(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&ra(e),Ie(e),JT(e,o,t,r,n)),null;case 27:if(Zy(e),n=hs.current,o=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ra(e);else{if(!r){if(e.stateNode===null)throw Error(j(166));return Ie(e),null}t=ki.current,Ju(e)?gD(e,t):(t=V3(o,r,n),e.stateNode=t,ra(e))}return Ie(e),null;case 5:if(Zy(e),o=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ra(e);else{if(!r){if(e.stateNode===null)throw Error(j(166));return Ie(e),null}if(i=ki.current,Ju(e))gD(e,i);else{var a=v_(hs.current);switch(i){case 1:i=a.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:i=a.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":i=a.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":i=a.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":i=a.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?a.createElement(o,{is:r.is}):a.createElement(o)}}i[On]=e,i[wr]=r;t:for(a=e.child;a!==null;){if(a.tag===5||a.tag===6)i.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break t;for(;a.sibling===null;){if(a.return===null||a.return===e)break t;a=a.return}a.sibling.return=a.return,a=a.sibling}e.stateNode=i;t:switch(Un(i,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break t;case"img":r=!0;break t;default:r=!1}r&&ra(e)}}return Ie(e),JT(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==r&&ra(e);else{if(typeof r!="string"&&e.stateNode===null)throw Error(j(166));if(t=hs.current,Ju(e)){if(t=e.stateNode,n=e.memoizedProps,r=null,o=Dn,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}t[On]=e,t=!!(t.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||G3(t.nodeValue,n)),t||As(e,!0)}else t=v_(t).createTextNode(r),t[On]=e,e.stateNode=t}return Ie(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(r=Ju(e),n!==null){if(t===null){if(!r)throw Error(j(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(j(557));t[On]=e}else zl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ie(e),t=!1}else n=GT(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(zr(e),e):(zr(e),null);if((e.flags&128)!==0)throw Error(j(558))}return Ie(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(o=Ju(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(j(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(j(317));o[On]=e}else zl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ie(e),o=!1}else o=GT(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),o=!0;if(!o)return e.flags&256?(zr(e),e):(zr(e),null)}return zr(e),(e.flags&128)!==0?(e.lanes=n,e):(n=r!==null,t=t!==null&&t.memoizedState!==null,n&&(r=e.child,o=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(o=r.alternate.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==o&&(r.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),Ry(e,e.updateQueue),Ie(e),null);case 4:return vd(),t===null&&Vx(e.stateNode.containerInfo),Ie(e),null;case 10:return pa(e.type),Ie(e),null;case 19:if(Rn(Ke),r=e.memoizedState,r===null)return Ie(e),null;if(o=(e.flags&128)!==0,i=r.rendering,i===null)if(o)Cp(r,!1);else{if(We!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(i=l_(t),i!==null){for(e.flags|=128,Cp(r,!1),t=i.updateQueue,e.updateQueue=t,Ry(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)r5(n,t),n=n.sibling;return xe(Ke,Ke.current&1|2),te&&sa(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&Gr()>m_&&(e.flags|=128,o=!0,Cp(r,!1),e.lanes=4194304)}else{if(!o)if(t=l_(i),t!==null){if(e.flags|=128,o=!0,t=t.updateQueue,e.updateQueue=t,Ry(e,t),Cp(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!te)return Ie(e),null}else 2*Gr()-r.renderingStartTime>m_&&n!==536870912&&(e.flags|=128,o=!0,Cp(r,!1),e.lanes=4194304);r.isBackwards?(i.sibling=e.child,e.child=i):(t=r.last,t!==null?t.sibling=i:e.child=i,r.last=i)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=Gr(),t.sibling=null,n=Ke.current,xe(Ke,o?n&1|2:n&1),te&&sa(e,r.treeForkCount),t):(Ie(e),null);case 22:case 23:return zr(e),wx(),r=e.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(e.flags|=8192):r&&(e.flags|=8192),r?(n&536870912)!==0&&(e.flags&128)===0&&(Ie(e),e.subtreeFlags&6&&(e.flags|=8192)):Ie(e),n=e.updateQueue,n!==null&&Ry(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),r=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),r!==n&&(e.flags|=2048),t!==null&&Rn(Ul),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),pa(sn),Ie(e),null;case 25:return null;case 30:return null}throw Error(j(156,e.tag))}function jW(t,e){switch(_x(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return pa(sn),vd(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Zy(e),null;case 31:if(e.memoizedState!==null){if(zr(e),e.alternate===null)throw Error(j(340));zl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(zr(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(j(340));zl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Rn(Ke),null;case 4:return vd(),null;case 10:return pa(e.type),null;case 22:case 23:return zr(e),wx(),t!==null&&Rn(Ul),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return pa(sn),null;case 25:return null;default:return null}}function r3(t,e){switch(_x(e),e.tag){case 3:pa(sn),vd();break;case 26:case 27:case 5:Zy(e);break;case 4:vd();break;case 31:e.memoizedState!==null&&zr(e);break;case 13:zr(e);break;case 19:Rn(Ke);break;case 10:pa(e.type);break;case 22:case 23:zr(e),wx(),t!==null&&Rn(Ul);break;case 24:pa(sn)}}function Sm(t,e){try{var n=e.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&t)===t){r=void 0;var i=n.create,a=n.inst;r=i(),a.destroy=r}n=n.next}while(n!==o)}}catch(s){fe(e,e.return,s)}}function ks(t,e,n){try{var r=e.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var i=o.next;r=i;do{if((r.tag&t)===t){var a=r.inst,s=a.destroy;if(s!==void 0){a.destroy=void 0,o=e;var l=n,c=s;try{c()}catch(d){fe(o,l,d)}}}r=r.next}while(r!==i)}}catch(d){fe(e,e.return,d)}}function o3(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{p5(e,n)}catch(r){fe(t,t.return,r)}}}function i3(t,e,n){n.props=$l(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(r){fe(t,e,r)}}function Wp(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof n=="function"?t.refCleanup=n(r):n.current=r}}catch(o){fe(t,e,o)}}function Ai(t,e){var n=t.ref,r=t.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(o){fe(t,e,o)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){fe(t,e,o)}else n.current=null}function a3(t){var e=t.type,n=t.memoizedProps,r=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break t;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){fe(t,t.return,o)}}function QT(t,e,n){try{var r=t.stateNode;uK(r,t.type,n,e),r[wr]=e}catch(o){fe(t,t.return,o)}}function s3(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ns(t.type)||t.tag===4}function ZT(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||s3(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ns(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Hw(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ua));else if(r!==4&&(r===27&&Ns(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Hw(t,e,n),t=t.sibling;t!==null;)Hw(t,e,n),t=t.sibling}function p_(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(r===27&&Ns(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(p_(t,e,n),t=t.sibling;t!==null;)p_(t,e,n),t=t.sibling}function l3(t){var e=t.stateNode,n=t.memoizedProps;try{for(var r=t.type,o=e.attributes;o.length;)e.removeAttributeNode(o[0]);Un(e,r,n),e[On]=t,e[wr]=n}catch(i){fe(t,t.return,i)}}var la=!1,an=!1,tw=!1,HD=typeof WeakSet=="function"?WeakSet:Set,kn=null;function qW(t,e){if(t=t.containerInfo,Ww=w_,t=KL(t),mx(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.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 t}var a=0,s=-1,l=-1,c=0,d=0,u=t,p=null;e:for(;;){for(var f;u!==n||o!==0&&u.nodeType!==3||(s=a+o),u!==i||r!==0&&u.nodeType!==3||(l=a+r),u.nodeType===3&&(a+=u.nodeValue.length),(f=u.firstChild)!==null;)p=u,u=f;for(;;){if(u===t)break e;if(p===n&&++c===o&&(s=a),p===i&&++d===r&&(l=a),(f=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=f}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Kw={focusedElem:t,selectionRange:n},w_=!1,kn=e;kn!==null;)if(e=kn,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,kn=t;else for(;kn!==null;){switch(e=kn,i=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)o=t[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&i!==null){t=void 0,n=e,o=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var m=$l(n.type,o);t=r.getSnapshotBeforeUpdate(m,i),r.__reactInternalSnapshotBeforeUpdate=t}catch(_){fe(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Jw(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Jw(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(j(163))}if(t=e.sibling,t!==null){t.return=e.return,kn=t;break}kn=e.return}}function c3(t,e,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ia(t,n),r&4&&Sm(5,n);break;case 1:if(ia(t,n),r&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){fe(n,n.return,a)}else{var o=$l(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(o,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){fe(n,n.return,a)}}r&64&&o3(n),r&512&&Wp(n,n.return);break;case 3:if(ia(t,n),r&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{p5(t,e)}catch(a){fe(n,n.return,a)}}break;case 27:e===null&&r&4&&l3(n);case 26:case 5:ia(t,n),e===null&&r&4&&a3(n),r&512&&Wp(n,n.return);break;case 12:ia(t,n);break;case 31:ia(t,n),r&4&&f3(t,n);break;case 13:ia(t,n),r&4&&p3(t,n),r&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=tK.bind(null,n),yK(t,n))));break;case 22:if(r=n.memoizedState!==null||la,!r){e=e!==null&&e.memoizedState!==null||an,o=la;var i=an;la=r,(an=e)&&!i?aa(t,n,(n.subtreeFlags&8772)!==0):ia(t,n),la=o,an=i}break;case 30:break;default:ia(t,n)}}function u3(t){var e=t.alternate;e!==null&&(t.alternate=null,u3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&lx(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Fe=null,Sr=!1;function oa(t,e,n){for(n=n.child;n!==null;)d3(t,e,n),n=n.sibling}function d3(t,e,n){if($r&&typeof $r.onCommitFiberUnmount=="function")try{$r.onCommitFiberUnmount(mm,n)}catch{}switch(n.tag){case 26:an||Ai(n,e),oa(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:an||Ai(n,e);var r=Fe,o=Sr;Ns(n.type)&&(Fe=n.stateNode,Sr=!1),oa(t,e,n),Qp(n.stateNode),Fe=r,Sr=o;break;case 5:an||Ai(n,e);case 6:if(r=Fe,o=Sr,Fe=null,oa(t,e,n),Fe=r,Sr=o,Fe!==null)if(Sr)try{(Fe.nodeType===9?Fe.body:Fe.nodeName==="HTML"?Fe.ownerDocument.body:Fe).removeChild(n.stateNode)}catch(i){fe(n,e,i)}else try{Fe.removeChild(n.stateNode)}catch(i){fe(n,e,i)}break;case 18:Fe!==null&&(Sr?(t=Fe,nL(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Nd(t)):nL(Fe,n.stateNode));break;case 4:r=Fe,o=Sr,Fe=n.stateNode.containerInfo,Sr=!0,oa(t,e,n),Fe=r,Sr=o;break;case 0:case 11:case 14:case 15:ks(2,n,e),an||ks(4,n,e),oa(t,e,n);break;case 1:an||(Ai(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"&&i3(n,e,r)),oa(t,e,n);break;case 21:oa(t,e,n);break;case 22:an=(r=an)||n.memoizedState!==null,oa(t,e,n),an=r;break;default:oa(t,e,n)}}function f3(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Nd(t)}catch(n){fe(e,e.return,n)}}}function p3(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Nd(t)}catch(n){fe(e,e.return,n)}}function VW(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new HD),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new HD),e;default:throw Error(j(435,t.tag))}}function Ny(t,e){var n=VW(t);e.forEach(function(r){if(!n.has(r)){n.add(r);var o=eK.bind(null,t,r);r.then(o,o)}})}function _r(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],i=t,a=e,s=a;t:for(;s!==null;){switch(s.tag){case 27:if(Ns(s.type)){Fe=s.stateNode,Sr=!1;break t}break;case 5:Fe=s.stateNode,Sr=!1;break t;case 3:case 4:Fe=s.stateNode.containerInfo,Sr=!0;break t}s=s.return}if(Fe===null)throw Error(j(160));d3(i,a,o),Fe=null,Sr=!1,i=o.alternate,i!==null&&(i.return=null),o.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)m3(e,t),e=e.sibling}var Xo=null;function m3(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:_r(e,t),vr(t),r&4&&(ks(3,t,t.return),Sm(3,t),ks(5,t,t.return));break;case 1:_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),r&64&&la&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=Xo;if(_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),r&4){var i=n!==null?n.memoizedState:null;if(r=t.memoizedState,n===null)if(r===null)if(t.stateNode===null){t:{r=t.type,n=t.memoizedProps,o=o.ownerDocument||o;e:switch(r){case"title":i=o.getElementsByTagName("title")[0],(!i||i[bm]||i[On]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=o.createElement(r),o.head.insertBefore(i,o.querySelector("head > title"))),Un(i,r,n),i[On]=t,In(i),r=i;break t;case"link":var a=cL("link","href",o).get(r+(n.href||""));if(a){for(var s=0;s<a.length;s++)if(i=a[s],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break e}}i=o.createElement(r),Un(i,r,n),o.head.appendChild(i);break;case"meta":if(a=cL("meta","content",o).get(r+(n.content||""))){for(s=0;s<a.length;s++)if(i=a[s],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(s,1);break e}}i=o.createElement(r),Un(i,r,n),o.head.appendChild(i);break;default:throw Error(j(468,r))}i[On]=t,In(i),r=i}t.stateNode=r}else uL(o,t.type,t.stateNode);else t.stateNode=lL(o,r,t.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?uL(o,t.type,t.stateNode):lL(o,r,t.memoizedProps)):r===null&&t.stateNode!==null&&QT(t,t.memoizedProps,n.memoizedProps)}break;case 27:_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),n!==null&&r&4&&QT(t,t.memoizedProps,n.memoizedProps);break;case 5:if(_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),t.flags&32){o=t.stateNode;try{Ed(o,"")}catch(m){fe(t,t.return,m)}}r&4&&t.stateNode!=null&&(o=t.memoizedProps,QT(t,o,n!==null?n.memoizedProps:o)),r&1024&&(tw=!0);break;case 6:if(_r(e,t),vr(t),r&4){if(t.stateNode===null)throw Error(j(162));r=t.memoizedProps,n=t.stateNode;try{n.nodeValue=r}catch(m){fe(t,t.return,m)}}break;case 3:if(Wy=null,o=Xo,Xo=S_(e.containerInfo),_r(e,t),Xo=o,vr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Nd(e.containerInfo)}catch(m){fe(t,t.return,m)}tw&&(tw=!1,g3(t));break;case 4:r=Xo,Xo=S_(t.stateNode.containerInfo),_r(e,t),vr(t),Xo=r;break;case 12:_r(e,t),vr(t);break;case 31:_r(e,t),vr(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ny(t,r)));break;case 13:_r(e,t),vr(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(B_=Gr()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ny(t,r)));break;case 22:o=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=la,d=an;if(la=c||o,an=d||l,_r(e,t),an=d,la=c,vr(t),r&8192)t:for(e=t.stateNode,e._visibility=o?e._visibility&-2:e._visibility|1,o&&(n===null||l||la||an||Ol(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(i=l.stateNode,o)a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{s=l.stateNode;var u=l.memoizedProps.style,p=u!=null&&u.hasOwnProperty("display")?u.display:null;s.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(m){fe(l,l.return,m)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=o?"":l.memoizedProps}catch(m){fe(l,l.return,m)}}}else if(e.tag===18){if(n===null){l=e;try{var f=l.stateNode;o?rL(f,!0):rL(l.stateNode,!1)}catch(m){fe(l,l.return,m)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}r&4&&(r=t.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Ny(t,n))));break;case 19:_r(e,t),vr(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ny(t,r)));break;case 30:break;case 21:break;default:_r(e,t),vr(t)}}function vr(t){var e=t.flags;if(e&2){try{for(var n,r=t.return;r!==null;){if(s3(r)){n=r;break}r=r.return}if(n==null)throw Error(j(160));switch(n.tag){case 27:var o=n.stateNode,i=ZT(t);p_(t,i,o);break;case 5:var a=n.stateNode;n.flags&32&&(Ed(a,""),n.flags&=-33);var s=ZT(t);p_(t,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=ZT(t);Hw(t,c,l);break;default:throw Error(j(161))}}catch(d){fe(t,t.return,d)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function g3(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;g3(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function ia(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)c3(t,e.alternate,e),e=e.sibling}function Ol(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ks(4,e,e.return),Ol(e);break;case 1:Ai(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&i3(e,e.return,n),Ol(e);break;case 27:Qp(e.stateNode);case 26:case 5:Ai(e,e.return),Ol(e);break;case 22:e.memoizedState===null&&Ol(e);break;case 30:Ol(e);break;default:Ol(e)}t=t.sibling}}function aa(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var r=e.alternate,o=t,i=e,a=i.flags;switch(i.tag){case 0:case 11:case 15:aa(o,i,n),Sm(4,i);break;case 1:if(aa(o,i,n),r=i,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(c){fe(r,r.return,c)}if(r=i,o=r.updateQueue,o!==null){var s=r.stateNode;try{var l=o.shared.hiddenCallbacks;if(l!==null)for(o.shared.hiddenCallbacks=null,o=0;o<l.length;o++)f5(l[o],s)}catch(c){fe(r,r.return,c)}}n&&a&64&&o3(i),Wp(i,i.return);break;case 27:l3(i);case 26:case 5:aa(o,i,n),n&&r===null&&a&4&&a3(i),Wp(i,i.return);break;case 12:aa(o,i,n);break;case 31:aa(o,i,n),n&&a&4&&f3(o,i);break;case 13:aa(o,i,n),n&&a&4&&p3(o,i);break;case 22:i.memoizedState===null&&aa(o,i,n),Wp(i,i.return);break;case 30:break;default:aa(o,i,n)}e=e.sibling}}function Fx(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&_m(n))}function Hx(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&_m(t))}function Ko(t,e,n,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)h3(t,e,n,r),e=e.sibling}function h3(t,e,n,r){var o=e.flags;switch(e.tag){case 0:case 11:case 15:Ko(t,e,n,r),o&2048&&Sm(9,e);break;case 1:Ko(t,e,n,r);break;case 3:Ko(t,e,n,r),o&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&_m(t)));break;case 12:if(o&2048){Ko(t,e,n,r),t=e.stateNode;try{var i=e.memoizedProps,a=i.id,s=i.onPostCommit;typeof s=="function"&&s(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){fe(e,e.return,l)}}else Ko(t,e,n,r);break;case 31:Ko(t,e,n,r);break;case 13:Ko(t,e,n,r);break;case 23:break;case 22:i=e.stateNode,a=e.alternate,e.memoizedState!==null?i._visibility&2?Ko(t,e,n,r):Kp(t,e):i._visibility&2?Ko(t,e,n,r):(i._visibility|=2,Zu(t,e,n,r,(e.subtreeFlags&10256)!==0||!1)),o&2048&&Fx(a,e);break;case 24:Ko(t,e,n,r),o&2048&&Hx(e.alternate,e);break;default:Ko(t,e,n,r)}}function Zu(t,e,n,r,o){for(o=o&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var i=t,a=e,s=n,l=r,c=a.flags;switch(a.tag){case 0:case 11:case 15:Zu(i,a,s,l,o),Sm(8,a);break;case 23:break;case 22:var d=a.stateNode;a.memoizedState!==null?d._visibility&2?Zu(i,a,s,l,o):Kp(i,a):(d._visibility|=2,Zu(i,a,s,l,o)),o&&c&2048&&Fx(a.alternate,a);break;case 24:Zu(i,a,s,l,o),o&&c&2048&&Hx(a.alternate,a);break;default:Zu(i,a,s,l,o)}e=e.sibling}}function Kp(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,r=e,o=r.flags;switch(r.tag){case 22:Kp(n,r),o&2048&&Fx(r.alternate,r);break;case 24:Kp(n,r),o&2048&&Hx(r.alternate,r);break;default:Kp(n,r)}e=e.sibling}}var zp=8192;function Qu(t,e,n){if(t.subtreeFlags&zp)for(t=t.child;t!==null;)b3(t,e,n),t=t.sibling}function b3(t,e,n){switch(t.tag){case 26:Qu(t,e,n),t.flags&zp&&t.memoizedState!==null&&NK(n,Xo,t.memoizedState,t.memoizedProps);break;case 5:Qu(t,e,n);break;case 3:case 4:var r=Xo;Xo=S_(t.stateNode.containerInfo),Qu(t,e,n),Xo=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=zp,zp=16777216,Qu(t,e,n),zp=r):Qu(t,e,n));break;default:Qu(t,e,n)}}function y3(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Mp(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var r=e[n];kn=r,v3(r,t)}y3(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_3(t),t=t.sibling}function _3(t){switch(t.tag){case 0:case 11:case 15:Mp(t),t.flags&2048&&ks(9,t,t.return);break;case 3:Mp(t);break;case 12:Mp(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Vy(t)):Mp(t);break;default:Mp(t)}}function Vy(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var r=e[n];kn=r,v3(r,t)}y3(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ks(8,e,e.return),Vy(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Vy(e));break;default:Vy(e)}t=t.sibling}}function v3(t,e){for(;kn!==null;){var n=kn;switch(n.tag){case 0:case 11:case 15:ks(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:_m(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,kn=r;else t:for(n=t;kn!==null;){r=kn;var o=r.sibling,i=r.return;if(u3(r),r===n){kn=null;break t}if(o!==null){o.return=i,kn=o;break t}kn=i}}}var YW={getCacheForType:function(t){var e=Ln(sn),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return Ln(sn).controller.signal}},WW=typeof WeakMap=="function"?WeakMap:Map,le=0,Se=null,Wt=null,Jt=0,de=0,Pr=null,ps=!1,Ld=!1,Gx=!1,_a=0,We=0,Is=0,Pl=0,$x=0,Hr=0,Ad=0,Xp=null,Er=null,Gw=!1,B_=0,S3=0,m_=1/0,g_=null,vs=null,bn=0,Ss=null,kd=null,ma=0,$w=0,jw=null,E3=null,Jp=0,qw=null;function qr(){return(le&2)!==0&&Jt!==0?Jt&-Jt:At.T!==null?qx():CL()}function T3(){if(Hr===0)if((Jt&536870912)===0||te){var t=vy;vy<<=1,(vy&3932160)===0&&(vy=262144),Hr=t}else Hr=536870912;return t=Yr.current,t!==null&&(t.flags|=32),Hr}function Tr(t,e,n){(t===Se&&(de===2||de===9)||t.cancelPendingCommit!==null)&&(Id(t,0),ms(t,Jt,Hr,!1)),hm(t,n),((le&2)===0||t!==Se)&&(t===Se&&((le&2)===0&&(Pl|=n),We===4&&ms(t,Jt,Hr,!1)),Ri(t))}function w3(t,e,n){if((le&6)!==0)throw Error(j(327));var r=!n&&(e&127)===0&&(e&t.expiredLanes)===0||gm(t,e),o=r?JW(t,e):ew(t,e,!0),i=r;do{if(o===0){Ld&&!r&&ms(t,e,0,!1);break}else{if(n=t.current.alternate,i&&!KW(n)){o=ew(t,e,!1),i=!1;continue}if(o===2){if(i=e,t.errorRecoveryDisabledLanes&i)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;t:{var s=t;o=Xp;var l=s.current.memoizedState.isDehydrated;if(l&&(Id(s,a).flags|=256),a=ew(s,a,!1),a!==2){if(Gx&&!l){s.errorRecoveryDisabledLanes|=i,Pl|=i,o=4;break t}i=Er,Er=o,i!==null&&(Er===null?Er=i:Er.push.apply(Er,i))}o=a}if(i=!1,o!==2)continue}}if(o===1){Id(t,0),ms(t,e,0,!0);break}t:{switch(r=t,i=o,i){case 0:case 1:throw Error(j(345));case 4:if((e&4194048)!==e)break;case 6:ms(r,e,Hr,!ps);break t;case 2:Er=null;break;case 3:case 5:break;default:throw Error(j(329))}if((e&62914560)===e&&(o=B_+300-Gr(),10<o)){if(ms(r,e,Hr,!ps),A_(r,0,!0)!==0)break t;ma=e,r.timeoutHandle=j3(GD.bind(null,r,n,Er,g_,Gw,e,Hr,Pl,Ad,ps,i,"Throttled",-0,0),o);break t}GD(r,n,Er,g_,Gw,e,Hr,Pl,Ad,ps,i,null,-0,0)}}break}while(!0);Ri(t)}function GD(t,e,n,r,o,i,a,s,l,c,d,u,p,f){if(t.timeoutHandle=-1,u=e.subtreeFlags,u&8192||(u&16785408)===16785408){u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ua},b3(e,i,u);var m=(i&62914560)===i?B_-Gr():(i&4194048)===i?S3-Gr():0;if(m=CK(u,m),m!==null){ma=i,t.cancelPendingCommit=m(jD.bind(null,t,e,i,n,r,o,a,s,l,d,u,null,p,f)),ms(t,i,a,!c);return}}jD(t,e,i,n,r,o,a,s,l)}function KW(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,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=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ms(t,e,n,r){e&=~$x,e&=~Pl,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var o=e;0<o;){var i=31-jr(o),a=1<<i;r[i]=-1,o&=~a}n!==0&&IL(t,n,e)}function P_(){return(le&6)===0?(Em(0,!1),!1):!0}function jx(){if(Wt!==null){if(de===0)var t=Wt.return;else t=Wt,da=Wl=null,Rx(t),bd=null,im=0,t=Wt;for(;t!==null;)r3(t.alternate,t),t=t.return;Wt=null}}function Id(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,pK(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),ma=0,jx(),Se=t,Wt=n=fa(t.current,null),Jt=e,de=0,Pr=null,ps=!1,Ld=gm(t,e),Gx=!1,Ad=Hr=$x=Pl=Is=We=0,Er=Xp=null,Gw=!1,(e&8)!==0&&(e|=e&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=e;0<r;){var o=31-jr(r),i=1<<o;e|=t[o],r&=~i}return _a=e,N_(),n}function x3(t,e){zt=null,At.H=sm,e===Dd||e===M_?(e=vD(),de=3):e===Ex?(e=vD(),de=4):de=e===Px?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Pr=e,Wt===null&&(We=1,d_(t,vo(e,t.current)))}function A3(){var t=Yr.current;return t===null?!0:(Jt&4194048)===Jt?Eo===null:(Jt&62914560)===Jt||(Jt&536870912)!==0?t===Eo:!1}function k3(){var t=At.H;return At.H=sm,t===null?sm:t}function I3(){var t=At.A;return At.A=YW,t}function h_(){We=4,ps||(Jt&4194048)!==Jt&&Yr.current!==null||(Ld=!0),(Is&134217727)===0&&(Pl&134217727)===0||Se===null||ms(Se,Jt,Hr,!1)}function ew(t,e,n){var r=le;le|=2;var o=k3(),i=I3();(Se!==t||Jt!==e)&&(g_=null,Id(t,e)),e=!1;var a=We;t:do try{if(de!==0&&Wt!==null){var s=Wt,l=Pr;switch(de){case 8:jx(),a=6;break t;case 3:case 2:case 9:case 6:Yr.current===null&&(e=!0);var c=de;if(de=0,Pr=null,fd(t,s,l,c),n&&Ld){a=0;break t}break;default:c=de,de=0,Pr=null,fd(t,s,l,c)}}XW(),a=We;break}catch(d){x3(t,d)}while(!0);return e&&t.shellSuspendCounter++,da=Wl=null,le=r,At.H=o,At.A=i,Wt===null&&(Se=null,Jt=0,N_()),a}function XW(){for(;Wt!==null;)R3(Wt)}function JW(t,e){var n=le;le|=2;var r=k3(),o=I3();Se!==t||Jt!==e?(g_=null,m_=Gr()+500,Id(t,e)):Ld=gm(t,e);t:do try{if(de!==0&&Wt!==null){e=Wt;var i=Pr;e:switch(de){case 1:de=0,Pr=null,fd(t,e,i,1);break;case 2:case 9:if(_D(i)){de=0,Pr=null,$D(e);break}e=function(){de!==2&&de!==9||Se!==t||(de=7),Ri(t)},i.then(e,e);break t;case 3:de=7;break t;case 4:de=5;break t;case 7:_D(i)?(de=0,Pr=null,$D(e)):(de=0,Pr=null,fd(t,e,i,7));break;case 5:var a=null;switch(Wt.tag){case 26:a=Wt.memoizedState;case 5:case 27:var s=Wt;if(a?K3(a):s.stateNode.complete){de=0,Pr=null;var l=s.sibling;if(l!==null)Wt=l;else{var c=s.return;c!==null?(Wt=c,z_(c)):Wt=null}break e}}de=0,Pr=null,fd(t,e,i,5);break;case 6:de=0,Pr=null,fd(t,e,i,6);break;case 8:jx(),We=6;break t;default:throw Error(j(462))}}QW();break}catch(d){x3(t,d)}while(!0);return da=Wl=null,At.H=r,At.A=o,le=n,Wt!==null?0:(Se=null,Jt=0,N_(),We)}function QW(){for(;Wt!==null&&!SY();)R3(Wt)}function R3(t){var e=n3(t.alternate,t,_a);t.memoizedProps=t.pendingProps,e===null?z_(t):Wt=e}function $D(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=UD(n,e,e.pendingProps,e.type,void 0,Jt);break;case 11:e=UD(n,e,e.pendingProps,e.type.render,e.ref,Jt);break;case 5:Rx(e);default:r3(n,e),e=Wt=r5(e,_a),e=n3(n,e,_a)}t.memoizedProps=t.pendingProps,e===null?z_(t):Wt=e}function fd(t,e,n,r){da=Wl=null,Rx(e),bd=null,im=0;var o=e.return;try{if(FW(t,o,e,n,Jt)){We=1,d_(t,vo(n,t.current)),Wt=null;return}}catch(i){if(o!==null)throw Wt=o,i;We=1,d_(t,vo(n,t.current)),Wt=null;return}e.flags&32768?(te||r===1?t=!0:Ld||(Jt&536870912)!==0?t=!1:(ps=t=!0,(r===2||r===9||r===3||r===6)&&(r=Yr.current,r!==null&&r.tag===13&&(r.flags|=16384))),N3(e,t)):z_(e)}function z_(t){var e=t;do{if((e.flags&32768)!==0){N3(e,ps);return}t=e.return;var n=$W(e.alternate,e,_a);if(n!==null){Wt=n;return}if(e=e.sibling,e!==null){Wt=e;return}Wt=e=t}while(e!==null);We===0&&(We=5)}function N3(t,e){do{var n=jW(t.alternate,t);if(n!==null){n.flags&=32767,Wt=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Wt=t;return}Wt=t=n}while(t!==null);We=6,Wt=null}function jD(t,e,n,r,o,i,a,s,l){t.cancelPendingCommit=null;do F_();while(bn!==0);if((le&6)!==0)throw Error(j(327));if(e!==null){if(e===t.current)throw Error(j(177));if(i=e.lanes|e.childLanes,i|=gx,CY(t,n,i,a,s,l),t===Se&&(Wt=Se=null,Jt=0),kd=e,Ss=t,ma=n,$w=i,jw=o,E3=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,nK(t_,function(){return L3(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=At.T,At.T=null,o=ce.p,ce.p=2,a=le,le|=4;try{qW(t,e,n)}finally{le=a,ce.p=o,At.T=r}}bn=1,C3(),M3(),O3()}}function C3(){if(bn===1){bn=0;var t=Ss,e=kd,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=At.T,At.T=null;var r=ce.p;ce.p=2;var o=le;le|=4;try{m3(e,t);var i=Kw,a=KL(t.containerInfo),s=i.focusedElem,l=i.selectionRange;if(a!==s&&s&&s.ownerDocument&&WL(s.ownerDocument.documentElement,s)){if(l!==null&&mx(s)){var c=l.start,d=l.end;if(d===void 0&&(d=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(d,s.value.length);else{var u=s.ownerDocument||document,p=u&&u.defaultView||window;if(p.getSelection){var f=p.getSelection(),m=s.textContent.length,_=Math.min(l.start,m),v=l.end===void 0?_:Math.min(l.end,m);!f.extend&&_>v&&(a=v,v=_,_=a);var h=fD(s,_),y=fD(s,v);if(h&&y&&(f.rangeCount!==1||f.anchorNode!==h.node||f.anchorOffset!==h.offset||f.focusNode!==y.node||f.focusOffset!==y.offset)){var S=u.createRange();S.setStart(h.node,h.offset),f.removeAllRanges(),_>v?(f.addRange(S),f.extend(y.node,y.offset)):(S.setEnd(y.node,y.offset),f.addRange(S))}}}}for(u=[],f=s;f=f.parentNode;)f.nodeType===1&&u.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<u.length;s++){var E=u[s];E.element.scrollLeft=E.left,E.element.scrollTop=E.top}}w_=!!Ww,Kw=Ww=null}finally{le=o,ce.p=r,At.T=n}}t.current=e,bn=2}}function M3(){if(bn===2){bn=0;var t=Ss,e=kd,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=At.T,At.T=null;var r=ce.p;ce.p=2;var o=le;le|=4;try{c3(t,e.alternate,e)}finally{le=o,ce.p=r,At.T=n}}bn=3}}function O3(){if(bn===4||bn===3){bn=0,EY();var t=Ss,e=kd,n=ma,r=E3;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?bn=5:(bn=0,kd=Ss=null,D3(t,t.pendingLanes));var o=t.pendingLanes;if(o===0&&(vs=null),sx(n),e=e.stateNode,$r&&typeof $r.onCommitFiberRoot=="function")try{$r.onCommitFiberRoot(mm,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=At.T,o=ce.p,ce.p=2,At.T=null;try{for(var i=t.onRecoverableError,a=0;a<r.length;a++){var s=r[a];i(s.value,{componentStack:s.stack})}}finally{At.T=e,ce.p=o}}(ma&3)!==0&&F_(),Ri(t),o=t.pendingLanes,(n&261930)!==0&&(o&42)!==0?t===qw?Jp++:(Jp=0,qw=t):Jp=0,Em(0,!1)}}function D3(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,_m(e)))}function F_(){return C3(),M3(),O3(),L3()}function L3(){if(bn!==5)return!1;var t=Ss,e=$w;$w=0;var n=sx(ma),r=At.T,o=ce.p;try{ce.p=32>n?32:n,At.T=null,n=jw,jw=null;var i=Ss,a=ma;if(bn=0,kd=Ss=null,ma=0,(le&6)!==0)throw Error(j(331));var s=le;if(le|=4,_3(i.current),h3(i,i.current,a,n),le=s,Em(0,!1),$r&&typeof $r.onPostCommitFiberRoot=="function")try{$r.onPostCommitFiberRoot(mm,i)}catch{}return!0}finally{ce.p=o,At.T=r,D3(t,e)}}function qD(t,e,n){e=vo(n,e),e=Pw(t.stateNode,e,2),t=_s(t,e,2),t!==null&&(hm(t,2),Ri(t))}function fe(t,e,n){if(t.tag===3)qD(t,t,n);else for(;e!==null;){if(e.tag===3){qD(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(vs===null||!vs.has(r))){t=vo(n,t),n=X5(2),r=_s(e,n,2),r!==null&&(J5(n,r,e,t),hm(r,2),Ri(r));break}}e=e.return}}function nw(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new WW;var o=new Set;r.set(e,o)}else o=r.get(e),o===void 0&&(o=new Set,r.set(e,o));o.has(n)||(Gx=!0,o.add(n),t=ZW.bind(null,t,e,n),e.then(t,t))}function ZW(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Se===t&&(Jt&n)===n&&(We===4||We===3&&(Jt&62914560)===Jt&&300>Gr()-B_?(le&2)===0&&Id(t,0):$x|=n,Ad===Jt&&(Ad=0)),Ri(t)}function U3(t,e){e===0&&(e=kL()),t=Yl(t,e),t!==null&&(hm(t,e),Ri(t))}function tK(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),U3(t,n)}function eK(t,e){var n=0;switch(t.tag){case 31:case 13:var r=t.stateNode,o=t.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(j(314))}r!==null&&r.delete(e),U3(t,n)}function nK(t,e){return ix(t,e)}var b_=null,td=null,Vw=!1,y_=!1,rw=!1,gs=0;function Ri(t){t!==td&&t.next===null&&(td===null?b_=td=t:td=td.next=t),y_=!0,Vw||(Vw=!0,oK())}function Em(t,e){if(!rw&&y_){rw=!0;do for(var n=!1,r=b_;r!==null;){if(!e)if(t!==0){var o=r.pendingLanes;if(o===0)var i=0;else{var a=r.suspendedLanes,s=r.pingedLanes;i=(1<<31-jr(42|t)+1)-1,i&=o&~(a&~s),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,VD(r,i))}else i=Jt,i=A_(r,r===Se?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||gm(r,i)||(n=!0,VD(r,i));r=r.next}while(n);rw=!1}}function rK(){B3()}function B3(){y_=Vw=!1;var t=0;gs!==0&&fK()&&(t=gs);for(var e=Gr(),n=null,r=b_;r!==null;){var o=r.next,i=P3(r,e);i===0?(r.next=null,n===null?b_=o:n.next=o,o===null&&(td=n)):(n=r,(t!==0||(i&3)!==0)&&(y_=!0)),r=o}bn!==0&&bn!==5||Em(t,!1),gs!==0&&(gs=0)}function P3(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,o=t.expirationTimes,i=t.pendingLanes&-62914561;0<i;){var a=31-jr(i),s=1<<a,l=o[a];l===-1?((s&n)===0||(s&r)!==0)&&(o[a]=NY(s,e)):l<=e&&(t.expiredLanes|=s),i&=~s}if(e=Se,n=Jt,n=A_(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,n===0||t===e&&(de===2||de===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&MT(r),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||gm(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(r!==null&&MT(r),sx(n)){case 2:case 8:n=xL;break;case 32:n=t_;break;case 268435456:n=AL;break;default:n=t_}return r=z3.bind(null,t),n=ix(n,r),t.callbackPriority=e,t.callbackNode=n,e}return r!==null&&r!==null&&MT(r),t.callbackPriority=2,t.callbackNode=null,2}function z3(t,e){if(bn!==0&&bn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(F_()&&t.callbackNode!==n)return null;var r=Jt;return r=A_(t,t===Se?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(w3(t,r,e),P3(t,Gr()),t.callbackNode!=null&&t.callbackNode===n?z3.bind(null,t):null)}function VD(t,e){if(F_())return null;w3(t,e,!0)}function oK(){mK(function(){(le&6)!==0?ix(wL,rK):B3()})}function qx(){if(gs===0){var t=Td;t===0&&(t=_y,_y<<=1,(_y&261888)===0&&(_y=256)),gs=t}return gs}function YD(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:By(""+t)}function WD(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function iK(t,e,n,r,o){if(e==="submit"&&n&&n.stateNode===o){var i=YD((o[wr]||null).action),a=r.submitter;a&&(e=(e=a[wr]||null)?YD(e.formAction):a.getAttribute("formAction"),e!==null&&(i=e,a=null));var s=new k_("action","action",null,r,o);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(gs!==0){var l=a?WD(o,a):new FormData(o);Uw(n,{pending:!0,data:l,method:o.method,action:i},null,l)}}else typeof i=="function"&&(s.preventDefault(),l=a?WD(o,a):new FormData(o),Uw(n,{pending:!0,data:l,method:o.method,action:i},i,l))},currentTarget:o}]})}}for(Cy=0;Cy<ww.length;Cy++)My=ww[Cy],KD=My.toLowerCase(),XD=My[0].toUpperCase()+My.slice(1),Jo(KD,"on"+XD);var My,KD,XD,Cy;Jo(JL,"onAnimationEnd");Jo(QL,"onAnimationIteration");Jo(ZL,"onAnimationStart");Jo("dblclick","onDoubleClick");Jo("focusin","onFocus");Jo("focusout","onBlur");Jo(TW,"onTransitionRun");Jo(wW,"onTransitionStart");Jo(xW,"onTransitionCancel");Jo(t5,"onTransitionEnd");Sd("onMouseEnter",["mouseout","mouseover"]);Sd("onMouseLeave",["mouseout","mouseover"]);Sd("onPointerEnter",["pointerout","pointerover"]);Sd("onPointerLeave",["pointerout","pointerover"]);jl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));jl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));jl("onBeforeInput",["compositionend","keypress","textInput","paste"]);jl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));jl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));jl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lm="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(" "),aK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(lm));function F3(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],o=r.event;r=r.listeners;t:{var i=void 0;if(e)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break t;i=s,o.currentTarget=c;try{i(o)}catch(d){n_(d)}o.currentTarget=null,i=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break t;i=s,o.currentTarget=c;try{i(o)}catch(d){n_(d)}o.currentTarget=null,i=l}}}}function Yt(t,e){var n=e[hw];n===void 0&&(n=e[hw]=new Set);var r=t+"__bubble";n.has(r)||(H3(e,t,2,!1),n.add(r))}function ow(t,e,n){var r=0;e&&(r|=4),H3(n,t,r,e)}var Oy="_reactListening"+Math.random().toString(36).slice(2);function Vx(t){if(!t[Oy]){t[Oy]=!0,ML.forEach(function(n){n!=="selectionchange"&&(aK.has(n)||ow(n,!1,t),ow(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Oy]||(e[Oy]=!0,ow("selectionchange",!1,e))}}function H3(t,e,n,r){switch(tU(e)){case 2:var o=DK;break;case 8:o=LK;break;default:o=Xx}n=o.bind(null,e,n,t),o=void 0,!Sw||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(o=!0),r?o!==void 0?t.addEventListener(e,n,{capture:!0,passive:o}):t.addEventListener(e,n,!0):o!==void 0?t.addEventListener(e,n,{passive:o}):t.addEventListener(e,n,!1)}function iw(t,e,n,r,o){var i=r;if((e&1)===0&&(e&2)===0&&r!==null)t:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===o)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===o)return;a=a.return}for(;s!==null;){if(a=rd(s),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){r=i=a;continue t}s=s.parentNode}}r=r.return}FL(function(){var c=i,d=ux(n),u=[];t:{var p=e5.get(t);if(p!==void 0){var f=k_,m=t;switch(t){case"keypress":if(zy(n)===0)break t;case"keydown":case"keyup":f=eW;break;case"focusin":m="focus",f=BT;break;case"focusout":m="blur",f=BT;break;case"beforeblur":case"afterblur":f=BT;break;case"click":if(n.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=rD;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=$Y;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=oW;break;case JL:case QL:case ZL:f=VY;break;case t5:f=aW;break;case"scroll":case"scrollend":f=HY;break;case"wheel":f=lW;break;case"copy":case"cut":case"paste":f=WY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=iD;break;case"toggle":case"beforetoggle":f=uW}var _=(e&4)!==0,v=!_&&(t==="scroll"||t==="scrollend"),h=_?p!==null?p+"Capture":null:p;_=[];for(var y=c,S;y!==null;){var E=y;if(S=E.stateNode,E=E.tag,E!==5&&E!==26&&E!==27||S===null||h===null||(E=tm(y,h),E!=null&&_.push(cm(y,E,S))),v)break;y=y.return}0<_.length&&(p=new f(p,m,null,n,d),u.push({event:p,listeners:_}))}}if((e&7)===0){t:{if(p=t==="mouseover"||t==="pointerover",f=t==="mouseout"||t==="pointerout",p&&n!==vw&&(m=n.relatedTarget||n.fromElement)&&(rd(m)||m[Cd]))break t;if((f||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,f?(m=n.relatedTarget||n.toElement,f=c,m=m?rd(m):null,m!==null&&(v=pm(m),_=m.tag,m!==v||_!==5&&_!==27&&_!==6)&&(m=null)):(f=null,m=c),f!==m)){if(_=rD,E="onMouseLeave",h="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(_=iD,E="onPointerLeave",h="onPointerEnter",y="pointer"),v=f==null?p:Bp(f),S=m==null?p:Bp(m),p=new _(E,y+"leave",f,n,d),p.target=v,p.relatedTarget=S,E=null,rd(d)===c&&(_=new _(h,y+"enter",m,n,d),_.target=S,_.relatedTarget=v,E=_),v=E,f&&m)e:{for(_=sK,h=f,y=m,S=0,E=h;E;E=_(E))S++;E=0;for(var R=y;R;R=_(R))E++;for(;0<S-E;)h=_(h),S--;for(;0<E-S;)y=_(y),E--;for(;S--;){if(h===y||y!==null&&h===y.alternate){_=h;break e}h=_(h),y=_(y)}_=null}else _=null;f!==null&&JD(u,p,f,_,!1),m!==null&&v!==null&&JD(u,v,m,_,!0)}}t:{if(p=c?Bp(c):window,f=p.nodeName&&p.nodeName.toLowerCase(),f==="select"||f==="input"&&p.type==="file")var C=cD;else if(lD(p))if(VL)C=vW;else{C=yW;var k=bW}else f=p.nodeName,!f||f.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?c&&cx(c.elementType)&&(C=cD):C=_W;if(C&&(C=C(t,c))){qL(u,C,n,d);break t}k&&k(t,p,c),t==="focusout"&&c&&p.type==="number"&&c.memoizedProps.value!=null&&_w(p,"number",p.value)}switch(k=c?Bp(c):window,t){case"focusin":(lD(k)||k.contentEditable==="true")&&(ad=k,Ew=c,Gp=null);break;case"focusout":Gp=Ew=ad=null;break;case"mousedown":Tw=!0;break;case"contextmenu":case"mouseup":case"dragend":Tw=!1,pD(u,n,d);break;case"selectionchange":if(EW)break;case"keydown":case"keyup":pD(u,n,d)}var L;if(px)t:{switch(t){case"compositionstart":var F="onCompositionStart";break t;case"compositionend":F="onCompositionEnd";break t;case"compositionupdate":F="onCompositionUpdate";break t}F=void 0}else id?$L(t,n)&&(F="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(F="onCompositionStart");F&&(GL&&n.locale!=="ko"&&(id||F!=="onCompositionStart"?F==="onCompositionEnd"&&id&&(L=HL()):(fs=d,dx="value"in fs?fs.value:fs.textContent,id=!0)),k=__(c,F),0<k.length&&(F=new oD(F,t,null,n,d),u.push({event:F,listeners:k}),L?F.data=L:(L=jL(n),L!==null&&(F.data=L)))),(L=fW?pW(t,n):mW(t,n))&&(F=__(c,"onBeforeInput"),0<F.length&&(k=new oD("onBeforeInput","beforeinput",null,n,d),u.push({event:k,listeners:F}),k.data=L)),iK(u,t,c,n,d)}F3(u,e)})}function cm(t,e,n){return{instance:t,listener:e,currentTarget:n}}function __(t,e){for(var n=e+"Capture",r=[];t!==null;){var o=t,i=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||i===null||(o=tm(t,n),o!=null&&r.unshift(cm(t,o,i)),o=tm(t,e),o!=null&&r.push(cm(t,o,i))),t.tag===3)return r;t=t.return}return[]}function sK(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function JD(t,e,n,r,o){for(var i=e._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||c===null||(l=c,o?(c=tm(n,i),c!=null&&a.unshift(cm(n,c,l))):o||(c=tm(n,i),c!=null&&a.push(cm(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var lK=/\r\n?/g,cK=/\u0000|\uFFFD/g;function QD(t){return(typeof t=="string"?t:""+t).replace(lK,`
|
|
9
|
+
`).replace(cK,"")}function G3(t,e){return e=QD(e),QD(t)===e}function me(t,e,n,r,o,i){switch(n){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||Ed(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&Ed(t,""+r);break;case"className":Ey(t,"class",r);break;case"tabIndex":Ey(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ey(t,n,r);break;case"style":zL(t,r,i);break;case"data":if(e!=="object"){Ey(t,"data",r);break}case"src":case"href":if(r===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(n);break}r=By(""+r),t.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(e!=="input"&&me(t,e,"name",o.name,o,null),me(t,e,"formEncType",o.formEncType,o,null),me(t,e,"formMethod",o.formMethod,o,null),me(t,e,"formTarget",o.formTarget,o,null)):(me(t,e,"encType",o.encType,o,null),me(t,e,"method",o.method,o,null),me(t,e,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(n);break}r=By(""+r),t.setAttribute(n,r);break;case"onClick":r!=null&&(t.onclick=ua);break;case"onScroll":r!=null&&Yt("scroll",t);break;case"onScrollEnd":r!=null&&Yt("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(j(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(j(60));t.innerHTML=n}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){t.removeAttribute("xlink:href");break}n=By(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(n,""+r):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":r===!0?t.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(n,r):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(n,r):t.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(n):t.setAttribute(n,r);break;case"popover":Yt("beforetoggle",t),Yt("toggle",t),Uy(t,"popover",r);break;case"xlinkActuate":na(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":na(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":na(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":na(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":na(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":na(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":na(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":na(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":na(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Uy(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=zY.get(n)||n,Uy(t,n,r))}}function Yw(t,e,n,r,o,i){switch(n){case"style":zL(t,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(j(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(j(60));t.innerHTML=n}}break;case"children":typeof r=="string"?Ed(t,r):(typeof r=="number"||typeof r=="bigint")&&Ed(t,""+r);break;case"onScroll":r!=null&&Yt("scroll",t);break;case"onScrollEnd":r!=null&&Yt("scrollend",t);break;case"onClick":r!=null&&(t.onclick=ua);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!OL.hasOwnProperty(n))t:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),e=n.slice(2,o?n.length-7:void 0),i=t[wr]||null,i=i!=null?i[n]:null,typeof i=="function"&&t.removeEventListener(e,i,o),typeof r=="function")){typeof i!="function"&&i!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,r,o);break t}n in t?t[n]=r:r===!0?t.setAttribute(n,""):Uy(t,n,r)}}}function Un(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Yt("error",t),Yt("load",t);var r=!1,o=!1,i;for(i in n)if(n.hasOwnProperty(i)){var a=n[i];if(a!=null)switch(i){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(j(137,e));default:me(t,e,i,a,n,null)}}o&&me(t,e,"srcSet",n.srcSet,n,null),r&&me(t,e,"src",n.src,n,null);return;case"input":Yt("invalid",t);var s=i=a=o=null,l=null,c=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case"name":o=d;break;case"type":a=d;break;case"checked":l=d;break;case"defaultChecked":c=d;break;case"value":i=d;break;case"defaultValue":s=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(j(137,e));break;default:me(t,e,r,d,n,null)}}UL(t,i,s,l,c,a,o,!1);return;case"select":Yt("invalid",t),r=a=i=null;for(o in n)if(n.hasOwnProperty(o)&&(s=n[o],s!=null))switch(o){case"value":i=s;break;case"defaultValue":a=s;break;case"multiple":r=s;default:me(t,e,o,s,n,null)}e=i,n=a,t.multiple=!!r,e!=null?md(t,!!r,e,!1):n!=null&&md(t,!!r,n,!0);return;case"textarea":Yt("invalid",t),i=o=r=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":r=s;break;case"defaultValue":o=s;break;case"children":i=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(j(91));break;default:me(t,e,a,s,n,null)}PL(t,r,o,i);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":t.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:me(t,e,l,r,n,null)}return;case"dialog":Yt("beforetoggle",t),Yt("toggle",t),Yt("cancel",t),Yt("close",t);break;case"iframe":case"object":Yt("load",t);break;case"video":case"audio":for(r=0;r<lm.length;r++)Yt(lm[r],t);break;case"image":Yt("error",t),Yt("load",t);break;case"details":Yt("toggle",t);break;case"embed":case"source":case"link":Yt("error",t),Yt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(r=n[c],r!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(j(137,e));default:me(t,e,c,r,n,null)}return;default:if(cx(e)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Yw(t,e,d,r,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(r=n[s],r!=null&&me(t,e,s,r,n,null))}function uK(t,e,n,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,i=null,a=null,s=null,l=null,c=null,d=null;for(f in n){var u=n[f];if(n.hasOwnProperty(f)&&u!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":l=u;default:r.hasOwnProperty(f)||me(t,e,f,null,r,u)}}for(var p in r){var f=r[p];if(u=n[p],r.hasOwnProperty(p)&&(f!=null||u!=null))switch(p){case"type":i=f;break;case"name":o=f;break;case"checked":c=f;break;case"defaultChecked":d=f;break;case"value":a=f;break;case"defaultValue":s=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(j(137,e));break;default:f!==u&&me(t,e,p,f,r,u)}}yw(t,a,s,l,c,d,i,o);return;case"select":f=a=s=p=null;for(i in n)if(l=n[i],n.hasOwnProperty(i)&&l!=null)switch(i){case"value":break;case"multiple":f=l;default:r.hasOwnProperty(i)||me(t,e,i,null,r,l)}for(o in r)if(i=r[o],l=n[o],r.hasOwnProperty(o)&&(i!=null||l!=null))switch(o){case"value":p=i;break;case"defaultValue":s=i;break;case"multiple":a=i;default:i!==l&&me(t,e,o,i,r,l)}e=s,n=a,r=f,p!=null?md(t,!!n,p,!1):!!r!=!!n&&(e!=null?md(t,!!n,e,!0):md(t,!!n,n?[]:"",!1));return;case"textarea":f=p=null;for(s in n)if(o=n[s],n.hasOwnProperty(s)&&o!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:me(t,e,s,null,r,o)}for(a in r)if(o=r[a],i=n[a],r.hasOwnProperty(a)&&(o!=null||i!=null))switch(a){case"value":p=o;break;case"defaultValue":f=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(j(91));break;default:o!==i&&me(t,e,a,o,r,i)}BL(t,p,f);return;case"option":for(var m in n)if(p=n[m],n.hasOwnProperty(m)&&p!=null&&!r.hasOwnProperty(m))switch(m){case"selected":t.selected=!1;break;default:me(t,e,m,null,r,p)}for(l in r)if(p=r[l],f=n[l],r.hasOwnProperty(l)&&p!==f&&(p!=null||f!=null))switch(l){case"selected":t.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:me(t,e,l,p,r,f)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!=null&&!r.hasOwnProperty(_)&&me(t,e,_,null,r,p);for(c in r)if(p=r[c],f=n[c],r.hasOwnProperty(c)&&p!==f&&(p!=null||f!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(j(137,e));break;default:me(t,e,c,p,r,f)}return;default:if(cx(e)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!==void 0&&!r.hasOwnProperty(v)&&Yw(t,e,v,void 0,r,p);for(d in r)p=r[d],f=n[d],!r.hasOwnProperty(d)||p===f||p===void 0&&f===void 0||Yw(t,e,d,p,r,f);return}}for(var h in n)p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h)&&me(t,e,h,null,r,p);for(u in r)p=r[u],f=n[u],!r.hasOwnProperty(u)||p===f||p==null&&f==null||me(t,e,u,p,r,f)}function ZD(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dK(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],i=o.transferSize,a=o.initiatorType,s=o.duration;if(i&&s&&ZD(a)){for(a=0,s=o.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>s)break;var d=l.transferSize,u=l.initiatorType;d&&ZD(u)&&(l=l.responseEnd,a+=d*(l<s?1:(s-c)/(l-c)))}if(--r,e+=8*(i+a)/(o.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Ww=null,Kw=null;function v_(t){return t.nodeType===9?t:t.ownerDocument}function tL(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $3(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Xw(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var aw=null;function fK(){var t=window.event;return t&&t.type==="popstate"?t===aw?!1:(aw=t,!0):(aw=null,!1)}var j3=typeof setTimeout=="function"?setTimeout:void 0,pK=typeof clearTimeout=="function"?clearTimeout:void 0,eL=typeof Promise=="function"?Promise:void 0,mK=typeof queueMicrotask=="function"?queueMicrotask:typeof eL<"u"?function(t){return eL.resolve(null).then(t).catch(gK)}:j3;function gK(t){setTimeout(function(){throw t})}function Ns(t){return t==="head"}function nL(t,e){var n=e,r=0;do{var o=n.nextSibling;if(t.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(r===0){t.removeChild(o),Nd(e);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Qp(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Qp(n);for(var i=n.firstChild;i;){var a=i.nextSibling,s=i.nodeName;i[bm]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=a}}else n==="body"&&Qp(t.ownerDocument.body);n=o}while(n);Nd(e)}function rL(t,e){var n=t;t=0;do{var r=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=r}while(n)}function Jw(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Jw(n),lx(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function hK(t,e,n,r){for(;t.nodeType===1;){var o=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){if(!t[bm])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(i=t.getAttribute("rel"),i==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(i!==o.rel||t.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||t.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||t.getAttribute("title")!==(o.title==null?null:o.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(i=t.getAttribute("src"),(i!==(o.src==null?null:o.src)||t.getAttribute("type")!==(o.type==null?null:o.type)||t.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&i&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var i=o.name==null?null:""+o.name;if(o.type==="hidden"&&t.getAttribute("name")===i)return t}else return t;if(t=To(t.nextSibling),t===null)break}return null}function bK(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=To(t.nextSibling),t===null))return null;return t}function q3(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=To(t.nextSibling),t===null))return null;return t}function Qw(t){return t.data==="$?"||t.data==="$~"}function Zw(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function yK(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var r=function(){e(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function To(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var tx=null;function oL(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return To(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function iL(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function V3(t,e,n){switch(e=v_(n),t){case"html":if(t=e.documentElement,!t)throw Error(j(452));return t;case"head":if(t=e.head,!t)throw Error(j(453));return t;case"body":if(t=e.body,!t)throw Error(j(454));return t;default:throw Error(j(451))}}function Qp(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);lx(t)}var wo=new Map,aL=new Set;function S_(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var va=ce.d;ce.d={f:_K,r:vK,D:SK,C:EK,L:TK,m:wK,X:AK,S:xK,M:kK};function _K(){var t=va.f(),e=P_();return t||e}function vK(t){var e=Md(t);e!==null&&e.tag===5&&e.type==="form"?z5(e):va.r(t)}var Ud=typeof document>"u"?null:document;function Y3(t,e,n){var r=Ud;if(r&&typeof e=="string"&&e){var o=_o(e);o='link[rel="'+t+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),aL.has(o)||(aL.add(o),t={rel:t,crossOrigin:n,href:e},r.querySelector(o)===null&&(e=r.createElement("link"),Un(e,"link",t),In(e),r.head.appendChild(e)))}}function SK(t){va.D(t),Y3("dns-prefetch",t,null)}function EK(t,e){va.C(t,e),Y3("preconnect",t,e)}function TK(t,e,n){va.L(t,e,n);var r=Ud;if(r&&t&&e){var o='link[rel="preload"][as="'+_o(e)+'"]';e==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+_o(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+_o(n.imageSizes)+'"]')):o+='[href="'+_o(t)+'"]';var i=o;switch(e){case"style":i=Rd(t);break;case"script":i=Bd(t)}wo.has(i)||(t=Ne({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),wo.set(i,t),r.querySelector(o)!==null||e==="style"&&r.querySelector(Tm(i))||e==="script"&&r.querySelector(wm(i))||(e=r.createElement("link"),Un(e,"link",t),In(e),r.head.appendChild(e)))}}function wK(t,e){va.m(t,e);var n=Ud;if(n&&t){var r=e&&typeof e.as=="string"?e.as:"script",o='link[rel="modulepreload"][as="'+_o(r)+'"][href="'+_o(t)+'"]',i=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Bd(t)}if(!wo.has(i)&&(t=Ne({rel:"modulepreload",href:t},e),wo.set(i,t),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wm(i)))return}r=n.createElement("link"),Un(r,"link",t),In(r),n.head.appendChild(r)}}}function xK(t,e,n){va.S(t,e,n);var r=Ud;if(r&&t){var o=pd(r).hoistableStyles,i=Rd(t);e=e||"default";var a=o.get(i);if(!a){var s={loading:0,preload:null};if(a=r.querySelector(Tm(i)))s.loading=5;else{t=Ne({rel:"stylesheet",href:t,"data-precedence":e},n),(n=wo.get(i))&&Yx(t,n);var l=a=r.createElement("link");In(l),Un(l,"link",t),l._p=new Promise(function(c,d){l.onload=c,l.onerror=d}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Yy(a,e,r)}a={type:"stylesheet",instance:a,count:1,state:s},o.set(i,a)}}}function AK(t,e){va.X(t,e);var n=Ud;if(n&&t){var r=pd(n).hoistableScripts,o=Bd(t),i=r.get(o);i||(i=n.querySelector(wm(o)),i||(t=Ne({src:t,async:!0},e),(e=wo.get(o))&&Wx(t,e),i=n.createElement("script"),In(i),Un(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}}function kK(t,e){va.M(t,e);var n=Ud;if(n&&t){var r=pd(n).hoistableScripts,o=Bd(t),i=r.get(o);i||(i=n.querySelector(wm(o)),i||(t=Ne({src:t,async:!0,type:"module"},e),(e=wo.get(o))&&Wx(t,e),i=n.createElement("script"),In(i),Un(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}}function sL(t,e,n,r){var o=(o=hs.current)?S_(o):null;if(!o)throw Error(j(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Rd(n.href),n=pd(o).hoistableStyles,r=n.get(e),r||(r={type:"style",instance:null,count:0,state:null},n.set(e,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Rd(n.href);var i=pd(o).hoistableStyles,a=i.get(t);if(a||(o=o.ownerDocument||o,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(t,a),(i=o.querySelector(Tm(t)))&&!i._p&&(a.instance=i,a.state.loading=5),wo.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wo.set(t,n),i||IK(o,t,n,a.state))),e&&r===null)throw Error(j(528,""));return a}if(e&&r!==null)throw Error(j(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Bd(n),n=pd(o).hoistableScripts,r=n.get(e),r||(r={type:"script",instance:null,count:0,state:null},n.set(e,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(j(444,t))}}function Rd(t){return'href="'+_o(t)+'"'}function Tm(t){return'link[rel="stylesheet"]['+t+"]"}function W3(t){return Ne({},t,{"data-precedence":t.precedence,precedence:null})}function IK(t,e,n,r){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?r.loading=1:(e=t.createElement("link"),r.preload=e,e.addEventListener("load",function(){return r.loading|=1}),e.addEventListener("error",function(){return r.loading|=2}),Un(e,"link",n),In(e),t.head.appendChild(e))}function Bd(t){return'[src="'+_o(t)+'"]'}function wm(t){return"script[async]"+t}function lL(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+_o(n.href)+'"]');if(r)return e.instance=r,In(r),r;var o=Ne({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),In(r),Un(r,"style",o),Yy(r,n.precedence,t),e.instance=r;case"stylesheet":o=Rd(n.href);var i=t.querySelector(Tm(o));if(i)return e.state.loading|=4,e.instance=i,In(i),i;r=W3(n),(o=wo.get(o))&&Yx(r,o),i=(t.ownerDocument||t).createElement("link"),In(i);var a=i;return a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),Un(i,"link",r),e.state.loading|=4,Yy(i,n.precedence,t),e.instance=i;case"script":return i=Bd(n.src),(o=t.querySelector(wm(i)))?(e.instance=o,In(o),o):(r=n,(o=wo.get(i))&&(r=Ne({},n),Wx(r,o)),t=t.ownerDocument||t,o=t.createElement("script"),In(o),Un(o,"link",r),t.head.appendChild(o),e.instance=o);case"void":return null;default:throw Error(j(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,Yy(r,n.precedence,t));return e.instance}function Yy(t,e,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,i=o,a=0;a<r.length;a++){var s=r[a];if(s.dataset.precedence===e)i=s;else if(i!==o)break}i?i.parentNode.insertBefore(t,i.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function Yx(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Wx(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Wy=null;function cL(t,e,n){if(Wy===null){var r=new Map,o=Wy=new Map;o.set(n,r)}else o=Wy,r=o.get(n),r||(r=new Map,o.set(n,r));if(r.has(t))return r;for(r.set(t,null),n=n.getElementsByTagName(t),o=0;o<n.length;o++){var i=n[o];if(!(i[bm]||i[On]||t==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var a=i.getAttribute(e)||"";a=t+a;var s=r.get(a);s?s.push(i):r.set(a,[i])}}return r}function uL(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function RK(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function K3(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function NK(t,e,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=Rd(r.href),i=e.querySelector(Tm(o));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=E_.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=i,In(i);return}i=e.ownerDocument||e,r=W3(r),(o=wo.get(o))&&Yx(r,o),i=i.createElement("link"),In(i);var a=i;a._p=new Promise(function(s,l){a.onload=s,a.onerror=l}),Un(i,"link",r),n.instance=i}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=E_.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var sw=0;function CK(t,e){return t.stylesheets&&t.count===0&&Ky(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var r=setTimeout(function(){if(t.stylesheets&&Ky(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4+e);0<t.imgBytes&&sw===0&&(sw=62500*dK());var o=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ky(t,t.stylesheets),t.unsuspend)){var i=t.unsuspend;t.unsuspend=null,i()}},(t.imgBytes>sw?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function E_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ky(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var T_=null;function Ky(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,T_=new Map,e.forEach(MK,t),T_=null,E_.call(t))}function MK(t,e){if(!(e.state.loading&4)){var n=T_.get(t);if(n)var r=n.get(null);else{n=new Map,T_.set(t,n);for(var o=t.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<o.length;i++){var a=o[i];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}o=e.instance,a=o.getAttribute("data-precedence"),i=n.get(a)||r,i===r&&n.set(null,o),n.set(a,o),this.count++,r=E_.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),i?i.parentNode.insertBefore(o,i.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(o,t.firstChild)),e.state.loading|=4}}var um={$$typeof:ca,Provider:null,Consumer:null,_currentValue:Dl,_currentValue2:Dl,_threadCount:0};function OK(t,e,n,r,o,i,a,s,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=OT(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=OT(0),this.hiddenUpdates=OT(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=i,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function X3(t,e,n,r,o,i,a,s,l,c,d,u){return t=new OK(t,e,n,a,l,c,d,u,s),e=1,i===!0&&(e|=24),i=Fr(3,null,null,e),t.current=i,i.stateNode=t,e=vx(),e.refCount++,t.pooledCache=e,e.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:e},Tx(i),t}function J3(t){return t?(t=cd,t):cd}function Q3(t,e,n,r,o,i){o=J3(o),r.context===null?r.context=o:r.pendingContext=o,r=ys(e),r.payload={element:n},i=i===void 0?null:i,i!==null&&(r.callback=i),n=_s(t,r,e),n!==null&&(Tr(n,t,e),jp(n,t,e))}function dL(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Kx(t,e){dL(t,e),(t=t.alternate)&&dL(t,e)}function Z3(t){if(t.tag===13||t.tag===31){var e=Yl(t,67108864);e!==null&&Tr(e,t,67108864),Kx(t,67108864)}}function fL(t){if(t.tag===13||t.tag===31){var e=qr();e=ax(e);var n=Yl(t,e);n!==null&&Tr(n,t,e),Kx(t,e)}}var w_=!0;function DK(t,e,n,r){var o=At.T;At.T=null;var i=ce.p;try{ce.p=2,Xx(t,e,n,r)}finally{ce.p=i,At.T=o}}function LK(t,e,n,r){var o=At.T;At.T=null;var i=ce.p;try{ce.p=8,Xx(t,e,n,r)}finally{ce.p=i,At.T=o}}function Xx(t,e,n,r){if(w_){var o=ex(r);if(o===null)iw(t,e,r,x_,n),pL(t,r);else if(BK(o,t,e,n,r))r.stopPropagation();else if(pL(t,r),e&4&&-1<UK.indexOf(t)){for(;o!==null;){var i=Md(o);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var a=Cl(i.pendingLanes);if(a!==0){var s=i;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-jr(a);s.entanglements[1]|=l,a&=~l}Ri(i),(le&6)===0&&(m_=Gr()+500,Em(0,!1))}}break;case 31:case 13:s=Yl(i,2),s!==null&&Tr(s,i,2),P_(),Kx(i,2)}if(i=ex(r),i===null&&iw(t,e,r,x_,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else iw(t,e,r,null,n)}}function ex(t){return t=ux(t),Jx(t)}var x_=null;function Jx(t){if(x_=null,t=rd(t),t!==null){var e=pm(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=_L(e),t!==null)return t;t=null}else if(n===31){if(t=vL(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return x_=t,null}function tU(t){switch(t){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(TY()){case wL:return 2;case xL:return 8;case t_:case wY:return 32;case AL:return 268435456;default:return 32}default:return 32}}var nx=!1,Es=null,Ts=null,ws=null,dm=new Map,fm=new Map,us=[],UK="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".split(" ");function pL(t,e){switch(t){case"focusin":case"focusout":Es=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":ws=null;break;case"pointerover":case"pointerout":dm.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":fm.delete(e.pointerId)}}function Op(t,e,n,r,o,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},e!==null&&(e=Md(e),e!==null&&Z3(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,o!==null&&e.indexOf(o)===-1&&e.push(o),t)}function BK(t,e,n,r,o){switch(e){case"focusin":return Es=Op(Es,t,e,n,r,o),!0;case"dragenter":return Ts=Op(Ts,t,e,n,r,o),!0;case"mouseover":return ws=Op(ws,t,e,n,r,o),!0;case"pointerover":var i=o.pointerId;return dm.set(i,Op(dm.get(i)||null,t,e,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,fm.set(i,Op(fm.get(i)||null,t,e,n,r,o)),!0}return!1}function eU(t){var e=rd(t.target);if(e!==null){var n=pm(e);if(n!==null){if(e=n.tag,e===13){if(e=_L(n),e!==null){t.blockedOn=e,XO(t.priority,function(){fL(n)});return}}else if(e===31){if(e=vL(n),e!==null){t.blockedOn=e,XO(t.priority,function(){fL(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Xy(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=ex(t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);vw=r,n.target.dispatchEvent(r),vw=null}else return e=Md(n),e!==null&&Z3(e),t.blockedOn=n,!1;e.shift()}return!0}function mL(t,e,n){Xy(t)&&n.delete(e)}function PK(){nx=!1,Es!==null&&Xy(Es)&&(Es=null),Ts!==null&&Xy(Ts)&&(Ts=null),ws!==null&&Xy(ws)&&(ws=null),dm.forEach(mL),fm.forEach(mL)}function Dy(t,e){t.blockedOn===e&&(t.blockedOn=null,nx||(nx=!0,yn.unstable_scheduleCallback(yn.unstable_NormalPriority,PK)))}var Ly=null;function gL(t){Ly!==t&&(Ly=t,yn.unstable_scheduleCallback(yn.unstable_NormalPriority,function(){Ly===t&&(Ly=null);for(var e=0;e<t.length;e+=3){var n=t[e],r=t[e+1],o=t[e+2];if(typeof r!="function"){if(Jx(r||n)===null)continue;break}var i=Md(n);i!==null&&(t.splice(e,3),e-=3,Uw(i,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Nd(t){function e(l){return Dy(l,t)}Es!==null&&Dy(Es,t),Ts!==null&&Dy(Ts,t),ws!==null&&Dy(ws,t),dm.forEach(e),fm.forEach(e);for(var n=0;n<us.length;n++){var r=us[n];r.blockedOn===t&&(r.blockedOn=null)}for(;0<us.length&&(n=us[0],n.blockedOn===null);)eU(n),n.blockedOn===null&&us.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var o=n[r],i=n[r+1],a=o[wr]||null;if(typeof i=="function")a||gL(n);else if(a){var s=null;if(i&&i.hasAttribute("formAction")){if(o=i,a=i[wr]||null)s=a.formAction;else if(Jx(o)!==null)continue}else s=a.action;typeof s=="function"?n[r+1]=s:(n.splice(r,3),r-=3),gL(n)}}}function nU(){function t(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(a){return o=a})},focusReset:"manual",scroll:"manual"})}function e(){o!==null&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,o=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),o!==null&&(o(),o=null)}}}function Qx(t){this._internalRoot=t}H_.prototype.render=Qx.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(j(409));var n=e.current,r=qr();Q3(n,r,t,e,null,null)};H_.prototype.unmount=Qx.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Q3(t.current,2,null,t,null,null),P_(),e[Cd]=null}};function H_(t){this._internalRoot=t}H_.prototype.unstable_scheduleHydration=function(t){if(t){var e=CL();t={blockedOn:null,target:t,priority:e};for(var n=0;n<us.length&&e!==0&&e<us[n].priority;n++);us.splice(n,0,t),n===0&&eU(t)}};var hL=bL.version;if(hL!=="19.2.7")throw Error(j(527,hL,"19.2.7"));ce.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(j(188)):(t=Object.keys(t).join(","),Error(j(268,t)));return t=hY(e),t=t!==null?SL(t):null,t=t===null?null:t.stateNode,t};var zK={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:At,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Dp=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Dp.isDisabled&&Dp.supportsFiber))try{mm=Dp.inject(zK),$r=Dp}catch{}var Dp;G_.createRoot=function(t,e){if(!yL(t))throw Error(j(299));var n=!1,r="",o=Y5,i=W5,a=K5;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onUncaughtError!==void 0&&(o=e.onUncaughtError),e.onCaughtError!==void 0&&(i=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=X3(t,1,!1,null,null,n,r,null,o,i,a,nU),t[Cd]=e.current,Vx(t),new Qx(e)};G_.hydrateRoot=function(t,e,n){if(!yL(t))throw Error(j(299));var r=!1,o="",i=Y5,a=W5,s=K5,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),e=X3(t,1,!0,e,n??null,r,o,l,i,a,s,nU),e.context=J3(null),n=e.current,r=qr(),r=ax(r),o=ys(r),o.callback=null,_s(n,o,r),n=r,e.current.lanes=n,hm(e,n),Ri(e),t[Cd]=e.current,Vx(t),new H_(e)};G_.version="19.2.7"});var aU=Jm((Fvt,iU)=>{"use strict";function oU(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oU)}catch(t){console.error(t)}}oU(),iU.exports=rU()});var Yu={};_0(Yu,{BrowserClient:()=>fu,ErrorBoundary:()=>_p,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>Fc,OpenFeatureIntegrationHook:()=>uy,Profiler:()=>Pu,SDK_VERSION:()=>ir,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>ht,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>at,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>ni,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>Ot,Scope:()=>$n,WINDOW:()=>V,addBreadcrumb:()=>wn,addEventProcessor:()=>Uc,addIntegration:()=>Xs,bindScopeToEmitter:()=>W0,breadcrumbsIntegration:()=>mb,browserApiErrorsIntegration:()=>gb,browserProfilingIntegration:()=>cM,browserSessionIntegration:()=>hb,browserTracingIntegration:()=>Br,buildLaunchDarklyFlagUsedHandler:()=>fM,captureConsoleIntegration:()=>Av,captureEvent:()=>Qr,captureException:()=>Et,captureFeedback:()=>jc,captureMessage:()=>Da,captureReactException:()=>yp,captureSession:()=>Ua,chromeStackLineParser:()=>VS,close:()=>Qg,consoleLoggingIntegration:()=>Uv,contextLinesIntegration:()=>QN,continueTrace:()=>zg,createConsolaReporter:()=>Pv,createLangChainCallbackHandler:()=>eu,createReduxEnhancer:()=>LM,createTransport:()=>If,createUserFeedbackEnvelope:()=>BN,cultureContextIntegration:()=>bb,dedupeIntegration:()=>Lf,defaultRequestInstrumentationOptions:()=>gp,defaultStackLineParsers:()=>WS,defaultStackParser:()=>fb,diagnoseSdkConnectivity:()=>bM,elementTimingIntegration:()=>OS,endSession:()=>Bc,eventFiltersIntegration:()=>uh,eventFromException:()=>Jh,eventFromMessage:()=>Qh,exceptionFromError:()=>uu,extraErrorDataIntegration:()=>kv,featureFlagsIntegration:()=>Mv,feedbackAsyncIntegration:()=>oN,feedbackIntegration:()=>bS,feedbackSyncIntegration:()=>bS,fetchStreamPerformanceIntegration:()=>ry,flush:()=>Jg,forceLoad:()=>$N,functionToStringIntegration:()=>Of,geckoStackLineParser:()=>YS,getActiveSpan:()=>Dt,getClient:()=>z,getCurrentScope:()=>it,getDefaultIntegrations:()=>JS,getFeedback:()=>jR,getGlobalScope:()=>lr,getIsolationScope:()=>Pt,getReplay:()=>p2,getRootSpan:()=>Bt,getSpanDescendants:()=>ii,getSpanStatusFromHttpCode:()=>wg,getTraceData:()=>el,globalHandlersIntegration:()=>yb,graphqlClientIntegration:()=>nC,growthbookIntegration:()=>gM,httpClientIntegration:()=>WN,httpContextIntegration:()=>_b,inboundFiltersIntegration:()=>Df,init:()=>dy,instrumentAnthropicAiClient:()=>Vv,instrumentCreateReactAgent:()=>Jv,instrumentGoogleGenAIClient:()=>Wv,instrumentLangChainEmbeddings:()=>Zv,instrumentLangGraph:()=>Qv,instrumentOpenAiClient:()=>$v,instrumentOutgoingRequests:()=>ny,instrumentSupabaseClient:()=>hh,isBotUserAgent:()=>QE,isEnabled:()=>Lc,isInitialized:()=>Zg,lastEventId:()=>Dc,launchDarklyIntegration:()=>dM,lazyLoadIntegration:()=>Kh,linkedErrorsIntegration:()=>vb,logger:()=>_h,makeBrowserOfflineTransport:()=>q2,makeFetchTransport:()=>Su,makeMultiplexedTransport:()=>yv,metrics:()=>Fa,moduleMetadataIntegration:()=>xv,normalizeStringifyValue:()=>Tu,onLoad:()=>jN,openFeatureIntegration:()=>pM,opera10StackLineParser:()=>DN,opera11StackLineParser:()=>LN,parameterize:()=>lh,reactErrorHandler:()=>wM,reactRouterBrowserTracingIntegration:()=>kO,reactRouterV3BrowserTracingIntegration:()=>BM,reactRouterV4BrowserTracingIntegration:()=>HM,reactRouterV5BrowserTracingIntegration:()=>GM,reactRouterV6BrowserTracingIntegration:()=>bO,reactRouterV7BrowserTracingIntegration:()=>EO,registerSpanErrorInstrumentation:()=>mf,registerWebWorker:()=>vM,replayCanvasIntegration:()=>I2,replayIntegration:()=>Jb,reportPageLoaded:()=>G2,reportingObserverIntegration:()=>VN,rewriteFramesIntegration:()=>Iv,sendFeedback:()=>cS,setActiveSpanInBrowser:()=>$2,setAttribute:()=>Wg,setAttributes:()=>Yg,setContext:()=>La,setConversationId:()=>Xg,setCurrentClient:()=>sh,setExtra:()=>qg,setExtras:()=>jg,setHttpStatus:()=>ri,setMeasurement:()=>qs,setTag:()=>Oc,setTags:()=>Vg,setUser:()=>Kg,showReportDialog:()=>Qf,spanStreamingIntegration:()=>j2,spanToBaggageHeader:()=>Dg,spanToJSON:()=>rt,spanToTraceHeader:()=>kc,spotlightBrowserIntegration:()=>uM,startBrowserTracingNavigationSpan:()=>Wo,startBrowserTracingPageLoadSpan:()=>Yo,startInactiveSpan:()=>Ae,startNewTrace:()=>Sf,startSession:()=>Ks,startSpan:()=>nn,startSpanManual:()=>qn,statsigIntegration:()=>hM,supabaseIntegration:()=>Rv,suppressTracing:()=>Nc,tanstackRouterBrowserTracingIntegration:()=>zM,thirdPartyErrorFilterIntegration:()=>Cv,uiProfiler:()=>MN,unleashIntegration:()=>mM,updateSpanName:()=>Mg,useProfiler:()=>OM,viewHierarchyIntegration:()=>rC,webVitalsIntegration:()=>oy,webWorkerIntegration:()=>_M,winjsStackLineParser:()=>ON,withActiveSpan:()=>Jr,withErrorBoundary:()=>DM,withIsolationScope:()=>rf,withProfiler:()=>MM,withScope:()=>De,withSentryReactRouterV6Routing:()=>SO,withSentryReactRouterV7Routing:()=>TO,withSentryRouting:()=>qM,withStreamedSpan:()=>$0,wrapCreateBrowserRouter:()=>RO,wrapCreateBrowserRouterV6:()=>_O,wrapCreateBrowserRouterV7:()=>wO,wrapCreateMemoryRouter:()=>NO,wrapCreateMemoryRouterV6:()=>vO,wrapCreateMemoryRouterV7:()=>xO,wrapReactRouterRouting:()=>IO,wrapUseRoutes:()=>CO,wrapUseRoutesV6:()=>yO,wrapUseRoutesV7:()=>AO,zodErrorsIntegration:()=>Nv});var $=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var nt=globalThis;var ir="10.63.0";function Jn(){return Ta(nt),nt}function Ta(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||ir,e[ir]=e[ir]||{}}function Mo(t,e,n=nt){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[ir]=r[ir]||{};return o[t]||(o[t]=e())}var wa=["debug","info","warn","error","log","assert","trace"],J6="Sentry Logger ",Ls={};function pn(t){if(!("console"in nt))return t();let e=nt.console,n={},r=Object.keys(Ls);r.forEach(o=>{let i=Ls[o];n[o]=e[o],e[o]=i});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function Q6(){S0().enabled=!0}function Z6(){S0().enabled=!1}function B1(){return S0().enabled}function tB(...t){v0("log",...t)}function eB(...t){v0("warn",...t)}function nB(...t){v0("error",...t)}function v0(t,...e){$&&B1()&&pn(()=>{nt.console[t](`${J6}[${t}]:`,...e)})}function S0(){return $?Mo("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var w={enable:Q6,disable:Z6,isEnabled:B1,log:tB,warn:eB,error:nB};var P1=/\(error: (.*)\)/,z1=/captureMessage|captureException/;function Yd(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let i=[],a=n.split(`
|
|
10
10
|
`);for(let s=r;s<a.length;s++){let l=a[s];l.length>1024&&(l=l.slice(0,1024));let c=P1.test(l)?l.replace(P1,"$1"):l;if(!c.includes("Error: ")){for(let d of e){let u=d(c);if(u){i.push(u);break}}if(i.length>=50+o)break}}return T0(i.slice(o))}}function tg(t){return Array.isArray(t)?Yd(...t):t}function T0(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(Zm(e).function||"")&&e.pop(),e.reverse(),z1.test(Zm(e).function||"")&&(e.pop(),z1.test(Zm(e).function||"")&&e.pop()),e.slice(0,50).map(n=>({...n,filename:n.filename||Zm(e).filename,function:n.function||"?"}))}function Zm(t){return t[t.length-1]||{}}var E0="<anonymous>";function Qn(t){try{return!t||typeof t!="function"?E0:t.name||E0}catch{return E0}}function Us(t){let e=t.exception;if(e){let n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function F1(t){let e=t?.startsWith("file://")?t.slice(7):t;return e?.match(/\/[A-Z]:/)&&(e=e.slice(1)),e}var Wd={},H1={};function zn(t,e){return Wd[t]=Wd[t]||[],Wd[t].push(e),()=>{let n=Wd[t];if(n){let r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}function Fn(t,e){if(!H1[t]){H1[t]=!0;try{e()}catch(n){$&&w.error(`Error while instrumenting ${t}`,n)}}}function Qe(t,e){let n=t&&Wd[t];if(n)for(let r of n)try{r(e)}catch(o){$&&w.error(`Error while triggering instrumentation handler.
|
|
11
11
|
Type: ${t}
|
|
12
12
|
Name: ${Qn(r)}
|
|
13
|
-
Error:`,o)}}var w0=null;function Kd(t){let e="error";zn(e,t),Fn(e,rB)}function rB(){w0=tt.onerror,tt.onerror=function(t,e,n,r,o){return Qe("error",{column:r,error:o,line:n,msg:t,url:e}),w0?w0.apply(this,arguments):!1},tt.onerror.__SENTRY_INSTRUMENTED__=!0}var x0=null;function Xd(t){let e="unhandledrejection";zn(e,t),Fn(e,oB)}function oB(){x0=tt.onunhandledrejection,tt.onunhandledrejection=function(t){return Qe("unhandledrejection",t),x0?x0.apply(this,arguments):!0},tt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var G1=Object.prototype.toString;function mn(t){switch(G1.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Oo(t,Error)}}function hc(t,e){return G1.call(t)===`[object ${e}]`}function bc(t){return hc(t,"ErrorEvent")}function Jd(t){return hc(t,"DOMError")}function eg(t){return hc(t,"DOMException")}function gn(t){return hc(t,"String")}function ei(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function Ze(t){return t===null||ei(t)||typeof t!="object"&&typeof t!="function"}function he(t){return hc(t,"Object")}function xa(t){return typeof Event<"u"&&Oo(t,Event)}function ng(t){return hc(t,"RegExp")}function Nn(t){return!!(t?.then&&typeof t.then=="function")}function Oo(t,e){try{return t instanceof e}catch{return!1}}function Qd(t){return typeof Request<"u"&&Oo(t,Request)}function be(t,e,n){if(!(e in t))return;let r=t[e];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Zd(o,r);try{t[e]=o}catch{$&&w.log(`Failed to replace method "${e}" in object`,t)}}function Gt(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{$&&w.log(`Failed to add non-enumerable property "${String(e)}" to object`,t)}}function Zd(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,Gt(t,"__sentry_original__",e)}catch{}}function Aa(t){return t.__sentry_original__}function tf(t){if(mn(t))return{message:t.message,name:t.name,stack:t.stack,...$1(t)};if(xa(t)){let{type:e,target:n,currentTarget:r,detail:o}=t;return{type:e,target:n,currentTarget:r,...o?{detail:o}:{},...$1(t)}}return t}function $1(t){return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}function rg(t){let e=Object.keys(tf(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}var yc;function Bs(t){if(yc!==void 0)return yc?yc(t):t();let e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=tt;return e in n&&typeof n[e]=="function"?(yc=n[e],yc(t)):(yc=null,t())}function ar(){return Bs(()=>Math.random())}function Hn(){return Bs(()=>Date.now())}var j1=Symbol.for("sentry.skipNormalization"),q1=Symbol.for("sentry.overrideNormalizationDepth");function A0(t){Gt(t,j1,!0)}function k0(t,e){Gt(t,q1,e)}function V1(t){return!!t[j1]}function Y1(t){let e=t[q1];return typeof e=="number"?e:void 0}var I0;function _c(t){I0=t}function ue(t,e=100,n=1/0){try{return R0("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ef(t,e=3,n=100*1024){let r=ue(t,e);return sB(r)>n?ef(t,e-1,n):r}function R0(t,e,n=1/0,r=1/0,o=lB()){let[i,a]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let s=N0(t,e);if(!s.startsWith("[object "))return s;if(V1(e))return e;let l=Y1(e),c=l!==void 0?l:n;if(c===0)return s.replace("object ","");if(i(e))return"[Circular ~]";let d=e;if(d&&typeof d.toJSON=="function")try{let m=d.toJSON();return R0("",m,c-1,r,o)}catch{}let u=Array.isArray(e)?[]:{},p=0,f=tf(e);for(let m in f){if(!Object.prototype.hasOwnProperty.call(f,m))continue;if(p>=r){u[m]="[MaxProperties ~]";break}let _=f[m];u[m]=R0(m,_,c-1,r,o),p++}return a(e),u}function N0(t,e){try{if(I0){let r=I0(e);if(r)return r}return typeof global<"u"&&e===global?"[Global]":typeof e=="number"&&!Number.isFinite(e)?`[${e}]`:typeof e=="function"?`[Function: ${Qn(e)}]`:typeof e=="symbol"?`[${String(e)}]`:typeof e=="bigint"?`[BigInt: ${String(e)}]`:`[object ${iB(e)}]`}catch(n){return`**non-serializable** (${n})`}}function iB(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function aB(t){return~-encodeURI(t).split(/%..|./).length}function sB(t){return aB(JSON.stringify(t))}function lB(){let t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Do(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function vc(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let o=Math.max(e-60,0);o<5&&(o=0);let i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function ka(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let o=t[r];Ze(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(N0(void 0,o))}return n.join(e)}function Ia(t,e,n=!1){return gn(t)?ng(e)?e.test(t):gn(e)?n?t===e:t.includes(e):typeof e=="function"?e(t):!1:!1}function tn(t,e=[],n=!1){for(let r of e)if(Ia(t,r,n))return!0;return!1}function cB(){let t=tt;return t.crypto||t.msCrypto}var C0;function uB(){return ar()*16}function ae(t=cB()){try{if(t?.randomUUID)return Bs(()=>t.randomUUID()).replace(/-/g,"")}catch{}return C0||(C0="10000000100040008000"+1e11),C0.replace(/[018]/g,e=>(e^(uB()&15)>>e/4).toString(16))}function W1(t){return t.exception?.values?.[0]}function Lo(t){let{message:e,event_id:n}=t;if(e)return e;let r=W1(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Ps(t,e,n){let r=t.exception=t.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function En(t,e){let n=W1(t);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...e},e&&"data"in e){let i={...o?.data,...e.data};n.mechanism.data=i}}function og(t,e,n=5){if(e.lineno===void 0)return;let r=t.length,o=Math.max(Math.min(r-1,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,o-n),o).map(a=>vc(a,0));let i=Math.min(r-1,o);e.context_line=vc(t[i],e.colno||0),e.post_context=t.slice(Math.min(o+1,r),o+1+n).map(a=>vc(a,0))}function nf(t){if(M0(t))return!0;try{Gt(t,"__sentry_captured__",!0)}catch{}return!1}function M0(t){try{return t.__sentry_captured__}catch{}}var X1=1e3;function sr(){return Hn()/X1}function dB(){let{performance:t}=tt;if(!t?.now||!t.timeOrigin)return sr;let e=t.timeOrigin;return()=>(e+Bs(()=>t.now()))/X1}var K1;function Mt(){return(K1??(K1=dB()))()}var O0=null;function fB(){let{performance:t}=tt;if(!t?.now)return;let e=3e5,n=Bs(()=>t.now()),r=Hn(),o=t.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<e)return o;let i=t.timing?.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<e?i:r-n}function ne(){return O0===null&&(O0=fB()),O0}function J1(t){let e=Mt(),n={sid:ae(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>pB(n)};return t&&Oi(n,t),n}function Oi(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Mt(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:ae()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Q1(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Oi(t,n)}function pB(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function Ra(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;let r={...t};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=Ra(r[o],e[o],n-1));return r}function Cn(){return ae()}function Gn(){return ae().substring(16)}function ig(t){try{let e=tt.WeakRef;if(typeof e=="function")return new e(t)}catch{}return t}function ag(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}var D0="_sentrySpan";function Zn(t,e){e?Gt(t,D0,ig(e)):delete t[D0]}function Uo(t){return ag(t[D0])}var mB=100,$n=class t{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:Cn(),sampleRand:ar()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Zn(e,Uo(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Oi(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,r=n instanceof t?n.getScopeData():he(n)?e:void 0,{tags:o,attributes:i,extra:a,user:s,contexts:l,level:c,fingerprint:d=[],propagationContext:u,conversationId:p}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...l},s&&Object.keys(s).length&&(this._user=s),c&&(this._level=c),d.length&&(this._fingerprint=d),u&&(this._propagationContext=u),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,Zn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Cn(),sampleRand:ar()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:mB;if(r<=0)return this;let o={timestamp:sr(),...e,message:e.message?Do(e.message,2048):e.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(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,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:Uo(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Ra(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||ae();if(!this._client)return $&&w.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureMessage(e,n,r){let o=r?.event_id||ae();if(!this._client)return $&&w.warn("No client configured on scope - will not capture message!"),o;let i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:i,...r,event_id:o},this),o}captureEvent(e,n){let r=e.event_id||n?.event_id||ae();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):($&&w.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function Z1(){return Mo("defaultCurrentScope",()=>new $n)}function tA(){return Mo("defaultIsolationScope",()=>new $n)}var eA=t=>t instanceof Promise&&!t[nA],nA=Symbol("chained PromiseLike"),sg=(t,e,n)=>{let r=t.then(o=>(e(o),o),o=>{throw n(o),o});return eA(r)&&eA(t)?r:gB(t,r)},gB=(t,e)=>{if(!e)return t;let n=!1;for(let r in t){if(r in e)continue;n=!0;let o=t[r];typeof o=="function"?Object.defineProperty(e,r,{value:(...i)=>o.apply(t,i),enumerable:!0,configurable:!0,writable:!0}):e[r]=o}return n&&Object.assign(e,{[nA]:!0}),e};var L0=class{constructor(e,n){let r;e?r=e:r=new $n;let o;n?o=n:o=new $n,this._stack=[{scope:r}],this._isolationScope=o}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(o){throw this._popScope(),o}return Nn(r)?sg(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 e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Sc(){let t=Jn(),e=Ta(t);return e.stack=e.stack||new L0(Z1(),tA())}function hB(t){return Sc().withScope(t)}function bB(t,e){let n=Sc();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function rA(t){return Sc().withScope(()=>t(Sc().getIsolationScope()))}function oA(){return{withIsolationScope:rA,withScope:hB,withSetScope:bB,withSetIsolationScope:(t,e)=>rA(e),getCurrentScope:()=>Sc().getScope(),getIsolationScope:()=>Sc().getIsolationScope()}}function Xr(t){let e=Ta(t);return e.acs?e.acs:oA()}function yB(t){return typeof t=="object"&&t!=null&&!Array.isArray(t)&&Object.keys(t).includes("value")}function _B(t,e){let{value:n,unit:r}=yB(t)?t:{value:t,unit:void 0},o=vB(n),i=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...i};if(!e||e==="skip-undefined"&&n===void 0)return;let a="";try{a=JSON.stringify(n)??""}catch{}return{value:a,type:"string",...i}}function Di(t,e=!1){let n={};for(let[r,o]of Object.entries(t??{})){let i=_B(o,e);i&&(n[r]=i)}return n}function U0(t){if(!t)return 0;let e=0;for(let[n,r]of Object.entries(t)){e+=n.length*2,e+=r.type.length*2,e+=(r.unit?.length??0)*2;let o=r.value;Array.isArray(o)?e+=iA(o[0])*o.length:Ze(o)?e+=iA(o):e+=100}return e}function iA(t){return typeof t=="string"?t.length*2:typeof t=="boolean"?4:typeof t=="number"?8:0}function vB(t){if(Array.isArray(t))return{value:t,type:"array"};let e=typeof t=="string"?"string":typeof t=="boolean"?"boolean":typeof t=="number"&&!Number.isNaN(t)?Number.isInteger(t)?"integer":"double":null;if(e)return{value:t,type:e}}var aA;function B0(){return aA?.()}function lg(){return aA!==void 0}function rt(){let t=Jn();return Xr(t).getCurrentScope()}function Pt(){let t=Jn();return Xr(t).getIsolationScope()}function lr(){return Mo("globalScope",()=>new $n)}function Oe(...t){let e=Jn(),n=Xr(e);if(t.length===2){let[r,o]=t;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(t[0])}function rf(...t){let e=Jn(),n=Xr(e);if(t.length===2){let[r,o]=t;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(t[0])}function P(){return rt().getClient()}function Ec(t){let e=B0();if(e)return{trace_id:e.traceId,span_id:e.spanId};let n=t.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:i}=n,a={trace_id:r,span_id:i||Gn()};return o&&(a.parent_span_id=o),a}var Ot="sentry.source",ni="sentry.sample_rate",Tc="sentry.previous_trace_sample_rate",ht="sentry.op",at="sentry.origin",cg="sentry.status.message",Li="sentry.idle_span_finish_reason",Bo="sentry.measurement_unit",Po="sentry.measurement_value",ug="sentry.release",dg="sentry.environment",fg="sentry.segment.name",pg="sentry.segment.id",mg="sentry.sdk.name",gg="sentry.sdk.version",hg="sentry.sdk.integrations",bg="user.id",yg="user.email",_g="user.ip_address",vg="user.name",zs="sentry.custom_span_name",Fs="sentry.profile_id",jn="sentry.exclusive_time";var Sg="http.request.method",wc="url.full",Eg="sentry.link.type",Tg="gen_ai.conversation.id";function wg(t){if(t<400&&t>=100)return{code:1};if(t>=400&&t<500)switch(t){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(t>=500&&t<600)switch(t){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 ri(t,e){t.setAttribute("http.response.status_code",e);let n=wg(e);n.message!=="unknown_error"&&t.setStatus(n)}var sA="_sentryScope",lA="_sentryIsolationScope",SB=Symbol.for("sentry.otelSourceInference");function Na(t,e,n){t&&(Gt(t,lA,ig(n)),Gt(t,sA,e))}function oi(t){let e=t;return{scope:e[sA],isolationScope:ag(e[lA])}}function cA(t){return t[SB]===!0}var of="sentry-";var EB=8192;function xc(t){let e=TB(t);if(!e)return;let n=Object.entries(e).reduce((r,[o,i])=>{if(o.startsWith(of)){let a=o.slice(of.length);r[a]=i}return r},{});if(Object.keys(n).length>0)return n}function xg(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,o])=>(o&&(n[`${of}${r}`]=o),n),{});return wB(e)}function TB(t){if(!(!t||!gn(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=uA(n);return Object.entries(r).forEach(([o,i])=>{e[o]=i}),e},{}):uA(t)}function uA(t){return t.split(",").map(e=>{let n=e.indexOf("=");if(n===-1)return[];let r=e.slice(0,n),o=e.slice(n+1);return[r,o].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function wB(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],o)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,a=o===0?i:`${e},${i}`;return a.length>EB?($&&w.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):a},"")}var xB=/^o(\d+)\./,AB=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function kB(t){return t==="http"||t==="https"}function en(t,e=!1){let{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:l}=t;return`${s}://${l}${e&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${a}`}function Ag(t){let e=AB.exec(t);if(!e){pn(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[n,r,o="",i="",a="",s=""]=e.slice(1),l="",c=s,d=c.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),c=d.pop()),c){let u=c.match(/^\d+/);u&&(c=u[0])}return dA({host:i,pass:o,path:l,projectId:c,port:a,protocol:n,publicKey:r})}function dA(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function IB(t){if(!$)return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(a=>t[a]?!1:(w.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:n.match(/^\d+$/)?kB(r)?e&&isNaN(parseInt(e,10))?(w.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(w.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(w.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function RB(t){return t.match(xB)?.[1]}function kg(t){let e=t.getOptions(),{host:n}=t.getDsn()||{},r;return e.orgId?r=String(e.orgId):n&&(r=RB(n)),r}function af(t){let e=typeof t=="string"?Ag(t):dA(t);if(!(!e||!IB(e)))return e}function Rr(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var Ig=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function fA(t){if(!t)return;let e=t.match(Ig);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function sf(t,e){let n=fA(t),r=xc(e);if(!n?.traceId)return{traceId:Cn(),sampleRand:ar()};let o=NB(n,r);r&&(r.sample_rand=o.toString());let{traceId:i,parentSpanId:a,parentSampled:s}=n;return{traceId:i,parentSpanId:a,sampled:s,dsc:r||{},sampleRand:o}}function lf(t=Cn(),e=Gn(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function cf(t=Cn(),e=Gn(),n){return`00-${t}-${e}-${n?"01":"00"}`}function NB(t,e){let n=Rr(e?.sample_rand);if(n!==void 0)return n;let r=Rr(e?.sample_rate);return r&&t?.parentSampled!==void 0?t.parentSampled?ar()*r:r+ar()*(1-r):ar()}function P0(t,e){let n=kg(t);return e&&n&&e!==n?(w.log(`Won't continue trace because org IDs don't match (incoming baggage: ${e}, SDK options: ${n})`),!1):(t.getOptions().strictTraceContinuation||!1)&&(e&&!n||!e&&n)?(w.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${e}, Sentry client: ${n})`),!1):!0}var Rg=0,df=1,pA=!1;function hA(t){let{spanId:e,traceId:n}=t.spanContext(),{data:r,op:o,parent_span_id:i,status:a,origin:s,links:l}=et(t);return{parent_span_id:i,span_id:e,trace_id:n,data:r,op:o,status:a,origin:s,links:l}}function Ac(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),o=r?e:et(t).parent_span_id,i=oi(t).scope,a=r?i?.getPropagationContext().propagationSpanId||Gn():e;return{parent_span_id:o,span_id:a,trace_id:n}}function kc(t){let{traceId:e,spanId:n}=t.spanContext(),r=Tn(t);return lf(e,n,r)}function bA(t){let{traceId:e,spanId:n}=t.spanContext(),r=Tn(t);return cf(e,n,r)}function ff(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...o},attributes:i})=>({span_id:e,trace_id:n,sampled:r===df,attributes:i,...o}))}function F0(t){if(t?.length)return t.map(({context:{spanId:e,traceId:n,traceFlags:r},attributes:o})=>({span_id:e,trace_id:n,sampled:r===df,attributes:o}))}function cr(t){return typeof t=="number"?mA(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?mA(t.getTime()):Mt()}function mA(t){return t>9999999999?t/1e3:t}function et(t){if(vA(t))return t.getSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(_A(t)){let{attributes:r,startTime:o,name:i,endTime:a,status:s,links:l}=t;return{span_id:e,trace_id:n,data:r,description:i,parent_span_id:yA(t),start_timestamp:cr(o),timestamp:cr(a)||void 0,status:pf(s),op:r[ht],origin:r[at],links:ff(l)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function Ca(t){if(vA(t))return t.getStreamedSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(_A(t)){let{attributes:r,startTime:o,name:i,endTime:a,status:s,links:l}=t;return{name:i,span_id:e,trace_id:n,parent_span_id:yA(t),start_timestamp:cr(o),end_timestamp:cr(a),is_segment:t===Gs(t),status:Cg(s),attributes:H0(r,s),links:F0(l)}}return{span_id:e,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:t===Gs(t)}}function yA(t){return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0}function Ng(t){return{...t,attributes:Di(t.attributes),links:t.links?.map(e=>({...e,attributes:Di(e.attributes)}))}}function _A(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function vA(t){return typeof t.getSpanJSON=="function"}function Tn(t){let{traceFlags:e}=t.spanContext();return e===df}function pf(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"internal_error"}function Cg(t){return!t||t.code===1||t.code===0||t.message==="cancelled"?"ok":"error"}function H0(t,e){let n=Cg(e)==="error"?e?.message:void 0;return{...n&&{[cg]:n},...t}}var Hs="_sentryChildSpans",z0="_sentryRootSpan";function Ic(t,e){let n=t[z0]||t;Gt(e,z0,n),t[Hs]?t[Hs].add(e):Gt(t,Hs,new Set([e]))}function SA(t,e){t[Hs]&&t[Hs].delete(e)}function ii(t){let e=new Set;function n(r){if(!e.has(r)&&Tn(r)){e.add(r);let o=r[Hs]?Array.from(r[Hs]):[];for(let i of o)n(i)}}return n(t),Array.from(e)}var Bt=Gs;function Gs(t){return t[z0]||t}function Dt(){let t=Jn(),e=Xr(t);return e.getActiveSpan?e.getActiveSpan():Uo(rt())}function $s(){pA||(pn(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),pA=!0)}function Mg(t,e){t.updateName(e),t.setAttributes({[Ot]:"custom",[zs]:e})}var EA=!1;function mf(){if(EA)return;function t(){let e=Dt(),n=e&&Bt(e);if(n){let r="internal_error";$&&w.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}EA=!0,Kd(t),Xd(t)}function De(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||P()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function TA(t){w.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function Ui(t,e){if(!e?.length)return!1;for(let n of e){if(MB(n)){if(t.description&&Ia(t.description,n))return $&&TA(t),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?t.description&&Ia(t.description,n.name):!0,i=n.op?t.op&&Ia(t.op,n.op):!0,a=n.attributes?Object.entries(n.attributes).every(([s,l])=>CB(t.attributes?.[s],l)):!0;if(o&&i&&a)return $&&TA(t),!0}return!1}function CB(t,e){return typeof t=="string"&&(typeof e=="string"||e instanceof RegExp)?Ia(t,e):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t===e}function wA(t,e){let n=e.parent_span_id,r=e.span_id;if(n)for(let o of t)o.parent_span_id===r&&(o.parent_span_id=n)}function MB(t){return typeof t=="string"||t instanceof RegExp}var xA=Symbol.for("sentry.nonRecordingSpan"),ur=class{constructor(e={}){this._traceId=e.traceId||Cn(),this._spanId=e.spanId||Gn(),this.dropReason=e.dropReason,Gt(this,xA,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Rg}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}};function ai(t){return!!t&&t[xA]===!0}var zo="production";var AA="_frozenDsc";function G0(t,e){Gt(t,AA,e)}function Og(t,e){let n=e.getOptions(),{publicKey:r}=e.getDsn()||{},o={environment:n.environment||zo,release:n.release,public_key:r,trace_id:t,org_id:kg(e)};return e.emit("createDsc",o),o}function Bi(t,e){let n=e.getPropagationContext();return n.dsc||Og(n.traceId,t)}function $e(t){let e=P();if(!e)return{};let n=Bt(t),r=et(n),o=r.data,i=n.spanContext().traceState,a=i?.get("sentry.sample_rate")??o[ni]??o[Tc];function s(m){return(typeof a=="number"||typeof a=="string")&&(m.sample_rate=`${a}`),m}let l=n[AA];if(l)return s(l);if(ai(n)&&!De(e.getOptions())){let m=oi(n).scope;if(m)return s({...Bi(e,m)})}let c=i?.get("sentry.dsc"),d=c&&xc(c);if(d)return s(d);let u=Og(t.spanContext().traceId,e),p=o[Ot]??o["sentry.span.source"],f=r.description;return p!=="url"&&f&&(u.transaction=f),De()&&(u.sampled=String(Tn(n)),u.sample_rand=i?.get("sentry.sample_rand")??oi(n).scope?.getPropagationContext().sampleRand.toString()),s(u),e.emit("createDsc",u,n),u}function Dg(t){let e=$e(t);return xg(e)}function $0(t){return Gt(t,"_streamed",!0),t}function Pi(t){return!!t&&typeof t=="function"&&"_streamed"in t&&!!t._streamed}function Le(t,e=[]){return[t,e]}function gf(t,e){let[n,r]=t;return[n,[...r,e]]}function dr(t,e){let n=t[1];for(let r of n){let o=r[0].type;if(e(r,o))return!0}return!1}function js(t,e){return dr(t,(n,r)=>e.includes(r))}function Lg(t){let e=Ta(tt);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function OB(t){let e=Ta(tt);return e.decodePolyfill?e.decodePolyfill(t):new TextDecoder().decode(t)}function zi(t){let[e,n]=t,r=JSON.stringify(e);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[Lg(r),i]:r.push(typeof i=="string"?Lg(i):i)}for(let i of n){let[a,s]=i;if(o(`
|
|
13
|
+
Error:`,o)}}var w0=null;function Kd(t){let e="error";zn(e,t),Fn(e,rB)}function rB(){w0=nt.onerror,nt.onerror=function(t,e,n,r,o){return Qe("error",{column:r,error:o,line:n,msg:t,url:e}),w0?w0.apply(this,arguments):!1},nt.onerror.__SENTRY_INSTRUMENTED__=!0}var x0=null;function Xd(t){let e="unhandledrejection";zn(e,t),Fn(e,oB)}function oB(){x0=nt.onunhandledrejection,nt.onunhandledrejection=function(t){return Qe("unhandledrejection",t),x0?x0.apply(this,arguments):!0},nt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var G1=Object.prototype.toString;function mn(t){switch(G1.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Oo(t,Error)}}function hc(t,e){return G1.call(t)===`[object ${e}]`}function bc(t){return hc(t,"ErrorEvent")}function Jd(t){return hc(t,"DOMError")}function eg(t){return hc(t,"DOMException")}function gn(t){return hc(t,"String")}function ei(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function Ze(t){return t===null||ei(t)||typeof t!="object"&&typeof t!="function"}function he(t){return hc(t,"Object")}function xa(t){return typeof Event<"u"&&Oo(t,Event)}function ng(t){return hc(t,"RegExp")}function Nn(t){return!!(t?.then&&typeof t.then=="function")}function Oo(t,e){try{return t instanceof e}catch{return!1}}function Qd(t){return typeof Request<"u"&&Oo(t,Request)}function be(t,e,n){if(!(e in t))return;let r=t[e];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Zd(o,r);try{t[e]=o}catch{$&&w.log(`Failed to replace method "${e}" in object`,t)}}function Gt(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{$&&w.log(`Failed to add non-enumerable property "${String(e)}" to object`,t)}}function Zd(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,Gt(t,"__sentry_original__",e)}catch{}}function Aa(t){return t.__sentry_original__}function tf(t){if(mn(t))return{message:t.message,name:t.name,stack:t.stack,...$1(t)};if(xa(t)){let{type:e,target:n,currentTarget:r,detail:o}=t;return{type:e,target:n,currentTarget:r,...o?{detail:o}:{},...$1(t)}}return t}function $1(t){return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}function rg(t){let e=Object.keys(tf(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}var yc;function Bs(t){if(yc!==void 0)return yc?yc(t):t();let e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=nt;return e in n&&typeof n[e]=="function"?(yc=n[e],yc(t)):(yc=null,t())}function ar(){return Bs(()=>Math.random())}function Hn(){return Bs(()=>Date.now())}var j1=Symbol.for("sentry.skipNormalization"),q1=Symbol.for("sentry.overrideNormalizationDepth");function A0(t){Gt(t,j1,!0)}function k0(t,e){Gt(t,q1,e)}function V1(t){return!!t[j1]}function Y1(t){let e=t[q1];return typeof e=="number"?e:void 0}var I0;function _c(t){I0=t}function ue(t,e=100,n=1/0){try{return R0("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ef(t,e=3,n=100*1024){let r=ue(t,e);return sB(r)>n?ef(t,e-1,n):r}function R0(t,e,n=1/0,r=1/0,o=lB()){let[i,a]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let s=N0(t,e);if(!s.startsWith("[object "))return s;if(V1(e))return e;let l=Y1(e),c=l!==void 0?l:n;if(c===0)return s.replace("object ","");if(i(e))return"[Circular ~]";let d=e;if(d&&typeof d.toJSON=="function")try{let m=d.toJSON();return R0("",m,c-1,r,o)}catch{}let u=Array.isArray(e)?[]:{},p=0,f=tf(e);for(let m in f){if(!Object.prototype.hasOwnProperty.call(f,m))continue;if(p>=r){u[m]="[MaxProperties ~]";break}let _=f[m];u[m]=R0(m,_,c-1,r,o),p++}return a(e),u}function N0(t,e){try{if(I0){let r=I0(e);if(r)return r}return typeof global<"u"&&e===global?"[Global]":typeof e=="number"&&!Number.isFinite(e)?`[${e}]`:typeof e=="function"?`[Function: ${Qn(e)}]`:typeof e=="symbol"?`[${String(e)}]`:typeof e=="bigint"?`[BigInt: ${String(e)}]`:`[object ${iB(e)}]`}catch(n){return`**non-serializable** (${n})`}}function iB(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function aB(t){return~-encodeURI(t).split(/%..|./).length}function sB(t){return aB(JSON.stringify(t))}function lB(){let t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Do(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function vc(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let o=Math.max(e-60,0);o<5&&(o=0);let i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function ka(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let o=t[r];Ze(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(N0(void 0,o))}return n.join(e)}function Ia(t,e,n=!1){return gn(t)?ng(e)?e.test(t):gn(e)?n?t===e:t.includes(e):typeof e=="function"?e(t):!1:!1}function tn(t,e=[],n=!1){for(let r of e)if(Ia(t,r,n))return!0;return!1}function cB(){let t=nt;return t.crypto||t.msCrypto}var C0;function uB(){return ar()*16}function ae(t=cB()){try{if(t?.randomUUID)return Bs(()=>t.randomUUID()).replace(/-/g,"")}catch{}return C0||(C0="10000000100040008000"+1e11),C0.replace(/[018]/g,e=>(e^(uB()&15)>>e/4).toString(16))}function W1(t){return t.exception?.values?.[0]}function Lo(t){let{message:e,event_id:n}=t;if(e)return e;let r=W1(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Ps(t,e,n){let r=t.exception=t.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function En(t,e){let n=W1(t);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...e},e&&"data"in e){let i={...o?.data,...e.data};n.mechanism.data=i}}function og(t,e,n=5){if(e.lineno===void 0)return;let r=t.length,o=Math.max(Math.min(r-1,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,o-n),o).map(a=>vc(a,0));let i=Math.min(r-1,o);e.context_line=vc(t[i],e.colno||0),e.post_context=t.slice(Math.min(o+1,r),o+1+n).map(a=>vc(a,0))}function nf(t){if(M0(t))return!0;try{Gt(t,"__sentry_captured__",!0)}catch{}return!1}function M0(t){try{return t.__sentry_captured__}catch{}}var X1=1e3;function sr(){return Hn()/X1}function dB(){let{performance:t}=nt;if(!t?.now||!t.timeOrigin)return sr;let e=t.timeOrigin;return()=>(e+Bs(()=>t.now()))/X1}var K1;function Mt(){return(K1??(K1=dB()))()}var O0=null;function fB(){let{performance:t}=nt;if(!t?.now)return;let e=3e5,n=Bs(()=>t.now()),r=Hn(),o=t.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<e)return o;let i=t.timing?.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<e?i:r-n}function re(){return O0===null&&(O0=fB()),O0}function J1(t){let e=Mt(),n={sid:ae(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>pB(n)};return t&&Oi(n,t),n}function Oi(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Mt(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:ae()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Q1(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Oi(t,n)}function pB(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function Ra(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;let r={...t};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=Ra(r[o],e[o],n-1));return r}function Cn(){return ae()}function Gn(){return ae().substring(16)}function ig(t){try{let e=nt.WeakRef;if(typeof e=="function")return new e(t)}catch{}return t}function ag(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}var D0="_sentrySpan";function Zn(t,e){e?Gt(t,D0,ig(e)):delete t[D0]}function Uo(t){return ag(t[D0])}var mB=100,$n=class t{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:Cn(),sampleRand:ar()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Zn(e,Uo(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Oi(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,r=n instanceof t?n.getScopeData():he(n)?e:void 0,{tags:o,attributes:i,extra:a,user:s,contexts:l,level:c,fingerprint:d=[],propagationContext:u,conversationId:p}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...l},s&&Object.keys(s).length&&(this._user=s),c&&(this._level=c),d.length&&(this._fingerprint=d),u&&(this._propagationContext=u),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,Zn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Cn(),sampleRand:ar()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:mB;if(r<=0)return this;let o={timestamp:sr(),...e,message:e.message?Do(e.message,2048):e.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(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,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:Uo(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Ra(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||ae();if(!this._client)return $&&w.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureMessage(e,n,r){let o=r?.event_id||ae();if(!this._client)return $&&w.warn("No client configured on scope - will not capture message!"),o;let i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:i,...r,event_id:o},this),o}captureEvent(e,n){let r=e.event_id||n?.event_id||ae();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):($&&w.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function Z1(){return Mo("defaultCurrentScope",()=>new $n)}function tA(){return Mo("defaultIsolationScope",()=>new $n)}var eA=t=>t instanceof Promise&&!t[nA],nA=Symbol("chained PromiseLike"),sg=(t,e,n)=>{let r=t.then(o=>(e(o),o),o=>{throw n(o),o});return eA(r)&&eA(t)?r:gB(t,r)},gB=(t,e)=>{if(!e)return t;let n=!1;for(let r in t){if(r in e)continue;n=!0;let o=t[r];typeof o=="function"?Object.defineProperty(e,r,{value:(...i)=>o.apply(t,i),enumerable:!0,configurable:!0,writable:!0}):e[r]=o}return n&&Object.assign(e,{[nA]:!0}),e};var L0=class{constructor(e,n){let r;e?r=e:r=new $n;let o;n?o=n:o=new $n,this._stack=[{scope:r}],this._isolationScope=o}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(o){throw this._popScope(),o}return Nn(r)?sg(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 e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Sc(){let t=Jn(),e=Ta(t);return e.stack=e.stack||new L0(Z1(),tA())}function hB(t){return Sc().withScope(t)}function bB(t,e){let n=Sc();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function rA(t){return Sc().withScope(()=>t(Sc().getIsolationScope()))}function oA(){return{withIsolationScope:rA,withScope:hB,withSetScope:bB,withSetIsolationScope:(t,e)=>rA(e),getCurrentScope:()=>Sc().getScope(),getIsolationScope:()=>Sc().getIsolationScope()}}function Xr(t){let e=Ta(t);return e.acs?e.acs:oA()}function yB(t){return typeof t=="object"&&t!=null&&!Array.isArray(t)&&Object.keys(t).includes("value")}function _B(t,e){let{value:n,unit:r}=yB(t)?t:{value:t,unit:void 0},o=vB(n),i=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...i};if(!e||e==="skip-undefined"&&n===void 0)return;let a="";try{a=JSON.stringify(n)??""}catch{}return{value:a,type:"string",...i}}function Di(t,e=!1){let n={};for(let[r,o]of Object.entries(t??{})){let i=_B(o,e);i&&(n[r]=i)}return n}function U0(t){if(!t)return 0;let e=0;for(let[n,r]of Object.entries(t)){e+=n.length*2,e+=r.type.length*2,e+=(r.unit?.length??0)*2;let o=r.value;Array.isArray(o)?e+=iA(o[0])*o.length:Ze(o)?e+=iA(o):e+=100}return e}function iA(t){return typeof t=="string"?t.length*2:typeof t=="boolean"?4:typeof t=="number"?8:0}function vB(t){if(Array.isArray(t))return{value:t,type:"array"};let e=typeof t=="string"?"string":typeof t=="boolean"?"boolean":typeof t=="number"&&!Number.isNaN(t)?Number.isInteger(t)?"integer":"double":null;if(e)return{value:t,type:e}}var aA;function B0(){return aA?.()}function lg(){return aA!==void 0}function it(){let t=Jn();return Xr(t).getCurrentScope()}function Pt(){let t=Jn();return Xr(t).getIsolationScope()}function lr(){return Mo("globalScope",()=>new $n)}function De(...t){let e=Jn(),n=Xr(e);if(t.length===2){let[r,o]=t;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(t[0])}function rf(...t){let e=Jn(),n=Xr(e);if(t.length===2){let[r,o]=t;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(t[0])}function z(){return it().getClient()}function Ec(t){let e=B0();if(e)return{trace_id:e.traceId,span_id:e.spanId};let n=t.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:i}=n,a={trace_id:r,span_id:i||Gn()};return o&&(a.parent_span_id=o),a}var Ot="sentry.source",ni="sentry.sample_rate",Tc="sentry.previous_trace_sample_rate",ht="sentry.op",at="sentry.origin",cg="sentry.status.message",Li="sentry.idle_span_finish_reason",Bo="sentry.measurement_unit",Po="sentry.measurement_value",ug="sentry.release",dg="sentry.environment",fg="sentry.segment.name",pg="sentry.segment.id",mg="sentry.sdk.name",gg="sentry.sdk.version",hg="sentry.sdk.integrations",bg="user.id",yg="user.email",_g="user.ip_address",vg="user.name",zs="sentry.custom_span_name",Fs="sentry.profile_id",jn="sentry.exclusive_time";var Sg="http.request.method",wc="url.full",Eg="sentry.link.type",Tg="gen_ai.conversation.id";function wg(t){if(t<400&&t>=100)return{code:1};if(t>=400&&t<500)switch(t){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(t>=500&&t<600)switch(t){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 ri(t,e){t.setAttribute("http.response.status_code",e);let n=wg(e);n.message!=="unknown_error"&&t.setStatus(n)}var sA="_sentryScope",lA="_sentryIsolationScope",SB=Symbol.for("sentry.otelSourceInference");function Na(t,e,n){t&&(Gt(t,lA,ig(n)),Gt(t,sA,e))}function oi(t){let e=t;return{scope:e[sA],isolationScope:ag(e[lA])}}function cA(t){return t[SB]===!0}var of="sentry-";var EB=8192;function xc(t){let e=TB(t);if(!e)return;let n=Object.entries(e).reduce((r,[o,i])=>{if(o.startsWith(of)){let a=o.slice(of.length);r[a]=i}return r},{});if(Object.keys(n).length>0)return n}function xg(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,o])=>(o&&(n[`${of}${r}`]=o),n),{});return wB(e)}function TB(t){if(!(!t||!gn(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=uA(n);return Object.entries(r).forEach(([o,i])=>{e[o]=i}),e},{}):uA(t)}function uA(t){return t.split(",").map(e=>{let n=e.indexOf("=");if(n===-1)return[];let r=e.slice(0,n),o=e.slice(n+1);return[r,o].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function wB(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],o)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,a=o===0?i:`${e},${i}`;return a.length>EB?($&&w.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):a},"")}var xB=/^o(\d+)\./,AB=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function kB(t){return t==="http"||t==="https"}function en(t,e=!1){let{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:l}=t;return`${s}://${l}${e&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${a}`}function Ag(t){let e=AB.exec(t);if(!e){pn(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[n,r,o="",i="",a="",s=""]=e.slice(1),l="",c=s,d=c.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),c=d.pop()),c){let u=c.match(/^\d+/);u&&(c=u[0])}return dA({host:i,pass:o,path:l,projectId:c,port:a,protocol:n,publicKey:r})}function dA(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function IB(t){if(!$)return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(a=>t[a]?!1:(w.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:n.match(/^\d+$/)?kB(r)?e&&isNaN(parseInt(e,10))?(w.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(w.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(w.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function RB(t){return t.match(xB)?.[1]}function kg(t){let e=t.getOptions(),{host:n}=t.getDsn()||{},r;return e.orgId?r=String(e.orgId):n&&(r=RB(n)),r}function af(t){let e=typeof t=="string"?Ag(t):dA(t);if(!(!e||!IB(e)))return e}function Rr(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var Ig=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function fA(t){if(!t)return;let e=t.match(Ig);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function sf(t,e){let n=fA(t),r=xc(e);if(!n?.traceId)return{traceId:Cn(),sampleRand:ar()};let o=NB(n,r);r&&(r.sample_rand=o.toString());let{traceId:i,parentSpanId:a,parentSampled:s}=n;return{traceId:i,parentSpanId:a,sampled:s,dsc:r||{},sampleRand:o}}function lf(t=Cn(),e=Gn(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function cf(t=Cn(),e=Gn(),n){return`00-${t}-${e}-${n?"01":"00"}`}function NB(t,e){let n=Rr(e?.sample_rand);if(n!==void 0)return n;let r=Rr(e?.sample_rate);return r&&t?.parentSampled!==void 0?t.parentSampled?ar()*r:r+ar()*(1-r):ar()}function P0(t,e){let n=kg(t);return e&&n&&e!==n?(w.log(`Won't continue trace because org IDs don't match (incoming baggage: ${e}, SDK options: ${n})`),!1):(t.getOptions().strictTraceContinuation||!1)&&(e&&!n||!e&&n)?(w.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${e}, Sentry client: ${n})`),!1):!0}var Rg=0,df=1,pA=!1;function hA(t){let{spanId:e,traceId:n}=t.spanContext(),{data:r,op:o,parent_span_id:i,status:a,origin:s,links:l}=rt(t);return{parent_span_id:i,span_id:e,trace_id:n,data:r,op:o,status:a,origin:s,links:l}}function Ac(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),o=r?e:rt(t).parent_span_id,i=oi(t).scope,a=r?i?.getPropagationContext().propagationSpanId||Gn():e;return{parent_span_id:o,span_id:a,trace_id:n}}function kc(t){let{traceId:e,spanId:n}=t.spanContext(),r=Tn(t);return lf(e,n,r)}function bA(t){let{traceId:e,spanId:n}=t.spanContext(),r=Tn(t);return cf(e,n,r)}function ff(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...o},attributes:i})=>({span_id:e,trace_id:n,sampled:r===df,attributes:i,...o}))}function F0(t){if(t?.length)return t.map(({context:{spanId:e,traceId:n,traceFlags:r},attributes:o})=>({span_id:e,trace_id:n,sampled:r===df,attributes:o}))}function cr(t){return typeof t=="number"?mA(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?mA(t.getTime()):Mt()}function mA(t){return t>9999999999?t/1e3:t}function rt(t){if(vA(t))return t.getSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(_A(t)){let{attributes:r,startTime:o,name:i,endTime:a,status:s,links:l}=t;return{span_id:e,trace_id:n,data:r,description:i,parent_span_id:yA(t),start_timestamp:cr(o),timestamp:cr(a)||void 0,status:pf(s),op:r[ht],origin:r[at],links:ff(l)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function Ca(t){if(vA(t))return t.getStreamedSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(_A(t)){let{attributes:r,startTime:o,name:i,endTime:a,status:s,links:l}=t;return{name:i,span_id:e,trace_id:n,parent_span_id:yA(t),start_timestamp:cr(o),end_timestamp:cr(a),is_segment:t===Gs(t),status:Cg(s),attributes:H0(r,s),links:F0(l)}}return{span_id:e,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:t===Gs(t)}}function yA(t){return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0}function Ng(t){return{...t,attributes:Di(t.attributes),links:t.links?.map(e=>({...e,attributes:Di(e.attributes)}))}}function _A(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function vA(t){return typeof t.getSpanJSON=="function"}function Tn(t){let{traceFlags:e}=t.spanContext();return e===df}function pf(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"internal_error"}function Cg(t){return!t||t.code===1||t.code===0||t.message==="cancelled"?"ok":"error"}function H0(t,e){let n=Cg(e)==="error"?e?.message:void 0;return{...n&&{[cg]:n},...t}}var Hs="_sentryChildSpans",z0="_sentryRootSpan";function Ic(t,e){let n=t[z0]||t;Gt(e,z0,n),t[Hs]?t[Hs].add(e):Gt(t,Hs,new Set([e]))}function SA(t,e){t[Hs]&&t[Hs].delete(e)}function ii(t){let e=new Set;function n(r){if(!e.has(r)&&Tn(r)){e.add(r);let o=r[Hs]?Array.from(r[Hs]):[];for(let i of o)n(i)}}return n(t),Array.from(e)}var Bt=Gs;function Gs(t){return t[z0]||t}function Dt(){let t=Jn(),e=Xr(t);return e.getActiveSpan?e.getActiveSpan():Uo(it())}function $s(){pA||(pn(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),pA=!0)}function Mg(t,e){t.updateName(e),t.setAttributes({[Ot]:"custom",[zs]:e})}var EA=!1;function mf(){if(EA)return;function t(){let e=Dt(),n=e&&Bt(e);if(n){let r="internal_error";$&&w.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}EA=!0,Kd(t),Xd(t)}function Le(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||z()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function TA(t){w.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function Ui(t,e){if(!e?.length)return!1;for(let n of e){if(MB(n)){if(t.description&&Ia(t.description,n))return $&&TA(t),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?t.description&&Ia(t.description,n.name):!0,i=n.op?t.op&&Ia(t.op,n.op):!0,a=n.attributes?Object.entries(n.attributes).every(([s,l])=>CB(t.attributes?.[s],l)):!0;if(o&&i&&a)return $&&TA(t),!0}return!1}function CB(t,e){return typeof t=="string"&&(typeof e=="string"||e instanceof RegExp)?Ia(t,e):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t===e}function wA(t,e){let n=e.parent_span_id,r=e.span_id;if(n)for(let o of t)o.parent_span_id===r&&(o.parent_span_id=n)}function MB(t){return typeof t=="string"||t instanceof RegExp}var xA=Symbol.for("sentry.nonRecordingSpan"),ur=class{constructor(e={}){this._traceId=e.traceId||Cn(),this._spanId=e.spanId||Gn(),this.dropReason=e.dropReason,Gt(this,xA,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Rg}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}};function ai(t){return!!t&&t[xA]===!0}var zo="production";var AA="_frozenDsc";function G0(t,e){Gt(t,AA,e)}function Og(t,e){let n=e.getOptions(),{publicKey:r}=e.getDsn()||{},o={environment:n.environment||zo,release:n.release,public_key:r,trace_id:t,org_id:kg(e)};return e.emit("createDsc",o),o}function Bi(t,e){let n=e.getPropagationContext();return n.dsc||Og(n.traceId,t)}function je(t){let e=z();if(!e)return{};let n=Bt(t),r=rt(n),o=r.data,i=n.spanContext().traceState,a=i?.get("sentry.sample_rate")??o[ni]??o[Tc];function s(m){return(typeof a=="number"||typeof a=="string")&&(m.sample_rate=`${a}`),m}let l=n[AA];if(l)return s(l);if(ai(n)&&!Le(e.getOptions())){let m=oi(n).scope;if(m)return s({...Bi(e,m)})}let c=i?.get("sentry.dsc"),d=c&&xc(c);if(d)return s(d);let u=Og(t.spanContext().traceId,e),p=o[Ot]??o["sentry.span.source"],f=r.description;return p!=="url"&&f&&(u.transaction=f),Le()&&(u.sampled=String(Tn(n)),u.sample_rand=i?.get("sentry.sample_rand")??oi(n).scope?.getPropagationContext().sampleRand.toString()),s(u),e.emit("createDsc",u,n),u}function Dg(t){let e=je(t);return xg(e)}function $0(t){return Gt(t,"_streamed",!0),t}function Pi(t){return!!t&&typeof t=="function"&&"_streamed"in t&&!!t._streamed}function Ue(t,e=[]){return[t,e]}function gf(t,e){let[n,r]=t;return[n,[...r,e]]}function dr(t,e){let n=t[1];for(let r of n){let o=r[0].type;if(e(r,o))return!0}return!1}function js(t,e){return dr(t,(n,r)=>e.includes(r))}function Lg(t){let e=Ta(nt);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function OB(t){let e=Ta(nt);return e.decodePolyfill?e.decodePolyfill(t):new TextDecoder().decode(t)}function zi(t){let[e,n]=t,r=JSON.stringify(e);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[Lg(r),i]:r.push(typeof i=="string"?Lg(i):i)}for(let i of n){let[a,s]=i;if(o(`
|
|
14
14
|
${JSON.stringify(a)}
|
|
15
|
-
`),typeof s=="string"||s instanceof Uint8Array)o(s);else{let l;try{l=JSON.stringify(s)}catch{l=JSON.stringify(ue(s))}o(l)}}return typeof r=="string"?r:DB(r)}function DB(t){let e=t.reduce((o,i)=>o+i.length,0),n=new Uint8Array(e),r=0;for(let o of t)n.set(o,r),r+=o.length;return n}function Ug(t){let e=typeof t=="string"?Lg(t):t;function n(a){let s=e.subarray(0,a);return e=e.subarray(a+1),s}function r(){let a=e.indexOf(10);return a<0&&(a=e.length),JSON.parse(OB(n(a)))}let o=r(),i=[];for(;e.length;){let a=r(),s=typeof a.length=="number"?a.length:void 0;i.push([a,s?n(s):r()])}return[o,i]}function Bg(t){return[{type:"span"},t]}function Pg(t){let e=typeof t.data=="string"?Lg(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var kA={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 LB(t){return t in kA}function hf(t){return LB(t)?kA[t]:t}function Fo(t){if(!t?.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function Rc(t,e,n,r){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date(Hn()).toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:en(r)},...o&&{trace:o}}}function UB(t,e){if(!e)return t;let n=t.sdk||{};return t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...t.sdk?.integrations||[],...e.integrations||[]],packages:[...t.sdk?.packages||[],...e.packages||[]],settings:t.sdk?.settings||e.settings?{...t.sdk?.settings,...e.settings}:void 0},t}function IA(t,e,n,r){let o=Fo(n),i={sent_at:new Date(Hn()).toISOString(),...o&&{sdk:o},...!!r&&e&&{dsn:en(e)}},a="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return
|
|
15
|
+
`),typeof s=="string"||s instanceof Uint8Array)o(s);else{let l;try{l=JSON.stringify(s)}catch{l=JSON.stringify(ue(s))}o(l)}}return typeof r=="string"?r:DB(r)}function DB(t){let e=t.reduce((o,i)=>o+i.length,0),n=new Uint8Array(e),r=0;for(let o of t)n.set(o,r),r+=o.length;return n}function Ug(t){let e=typeof t=="string"?Lg(t):t;function n(a){let s=e.subarray(0,a);return e=e.subarray(a+1),s}function r(){let a=e.indexOf(10);return a<0&&(a=e.length),JSON.parse(OB(n(a)))}let o=r(),i=[];for(;e.length;){let a=r(),s=typeof a.length=="number"?a.length:void 0;i.push([a,s?n(s):r()])}return[o,i]}function Bg(t){return[{type:"span"},t]}function Pg(t){let e=typeof t.data=="string"?Lg(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var kA={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 LB(t){return t in kA}function hf(t){return LB(t)?kA[t]:t}function Fo(t){if(!t?.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function Rc(t,e,n,r){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date(Hn()).toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:en(r)},...o&&{trace:o}}}function UB(t,e){if(!e)return t;let n=t.sdk||{};return t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...t.sdk?.integrations||[],...e.integrations||[]],packages:[...t.sdk?.packages||[],...e.packages||[]],settings:t.sdk?.settings||e.settings?{...t.sdk?.settings,...e.settings}:void 0},t}function IA(t,e,n,r){let o=Fo(n),i={sent_at:new Date(Hn()).toISOString(),...o&&{sdk:o},...!!r&&e&&{dsn:en(e)}},a="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Ue(i,[a])}function RA(t,e,n,r){let o=Fo(n),i=t.type&&t.type!=="replay_event"?t.type:"event";UB(t,n?.sdk);let a=Rc(t,o,r,e);return delete t.sdkProcessingMetadata,Ue(a,[[{type:i},t]])}function NA(t,e){function n(f){return!!f.trace_id&&!!f.public_key}let r=je(t[0]),o=e?.getDsn(),i=e?.getOptions().tunnel,a={sent_at:new Date(Hn()).toISOString(),...n(r)&&{trace:r},...!!i&&o&&{dsn:en(o)}},{beforeSendSpan:s,ignoreSpans:l}=e?.getOptions()||{},c=l?.length?t.filter(f=>{let m=rt(f);return!Ui({description:m.description,op:m.op,attributes:m.data},l)}):t,d=t.length-c.length;d&&e?.recordDroppedEvent("before_send","span",d);let u=s?f=>{let m=rt(f),_=Pi(s)?m:s(m);return _||($s(),m)}:rt,p=[];for(let f of c){let m=u(f);m&&p.push(Bg(m))}return Ue(a,p)}function CA(t){if(!$)return;let{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=rt(t),{spanId:o}=t.spanContext(),i=Tn(t),a=Bt(t),s=a===t,l=`[Tracing] Starting ${i?"sampled":"unsampled"} ${s?"root ":""}span`,c=[`op: ${n}`,`name: ${e}`,`ID: ${o}`];if(r&&c.push(`parent ID: ${r}`),!s){let{op:d,description:u}=rt(a);c.push(`root ID: ${a.spanContext().spanId}`),d&&c.push(`root op: ${d}`),u&&c.push(`root description: ${u}`)}w.log(`${l}
|
|
16
16
|
${c.join(`
|
|
17
|
-
`)}`)}function MA(t){if(!$)return;let{description:e="< unknown name >",op:n="< unknown op >"}=et(t),{spanId:r}=t.spanContext(),i=Bt(t)===t,a=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${e}" with ID ${r}`;w.log(a)}function qs(t,e,n,r=Dt()){let o=r&&Bt(r);o&&($&&w.log(`[Measurement] Setting measurement on root span: ${t} = ${e} ${n}`),o.addEvent(t,{[Po]:e,[Bo]:n}))}function bf(t){if(!t||t.length===0)return;let e={};return t.forEach(n=>{let r=n.attributes||{},o=r[Bo],i=r[Po];typeof o=="string"&&typeof i=="number"&&(e[n.name]={value:i,unit:o})}),e}function je(t){return t.getOptions().traceLifecycle==="stream"}var OA=1e3,Ma=class{constructor(e={}){this._traceId=e.traceId||Cn(),this._spanId=e.spanId||Gn(),this._startTime=e.startTimestamp||Mt(),this._links=e.links,this._attributes={},this.setAttributes({[at]:"manual",[ht]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,n){}spanContext(){let{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?df:Rg}}setAttribute(e,n){return n===void 0?delete this._attributes[e]:this._attributes[e]=n,this}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._startTime=cr(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,cA(this)||this.setAttribute(Ot,"custom"),this}end(e){this._endTime||(this._endTime=cr(e),MA(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ht],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:pf(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[at],profile_id:this._attributes[Fs],exclusive_time:this._attributes[jn],measurements:bf(this._events),is_segment:this._isStandaloneSpan&&Bt(this)===this||void 0,segment_id:this._isStandaloneSpan?Bt(this).spanContext().spanId:void 0,links:ff(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===Bt(this),status:Cg(this._status),attributes:H0(this._attributes,this._status),links:F0(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){$&&w.log("[Tracing] Adding an event to span:",e);let o=DA(n)?n:r||Mt(),i=DA(n)?{}:n||{},a={name:e,time:cr(o),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=P();if(e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Bt(this)))return;if(this._isStandaloneSpan){this._sampled?PB(NA([this],e)):($&&w.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}else if(e&&je(e)){e.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(oi(this).scope||rt()).captureEvent(r)}_convertSpanToTransaction(){if(!LA(et(this)))return;this._name||($&&w.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:e,isolationScope:n}=oi(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=ii(this).filter(u=>u!==this&&!BB(u)).map(u=>et(u)).filter(LA),a=this._attributes[Ot];delete this._attributes[zs];let s=!1;i.forEach(u=>{delete u.data[zs],u.op?.startsWith("gen_ai.")&&(s=!0)});let l={contexts:{trace:hA(this)},spans:i.length>OA?i.sort((u,p)=>u.start_timestamp-p.start_timestamp).slice(0,OA):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:$e(this),hasGenAiSpans:s},request:r,...a&&{transaction_info:{source:a}}},c=bf(this._events);return c&&Object.keys(c).length&&($&&w.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),l.measurements=c),l}};function DA(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function LA(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function BB(t){return t instanceof Ma&&t.isStandaloneSpan()}function PB(t){let e=P();if(!e)return;let n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function yf(t,e,n=()=>{},r=()=>{}){let o;try{o=t()}catch(i){throw e(i),n(),i}return zB(o,e,n,r)}function zB(t,e,n,r){return Nn(t)?sg(t,o=>{n(),r(o)},o=>{e(o),n()}):(n(),r(t),t)}function UA(t,e,n){if(!De(t))return[!1];let r,o;typeof t.tracesSampler=="function"?(o=t.tracesSampler({...e,inheritOrSampleWith:s=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):s}),r=!0):e.parentSampled!==void 0?o=e.parentSampled:typeof t.tracesSampleRate<"u"&&(o=t.tracesSampleRate,r=!0);let i=Rr(o);if(i===void 0)return $&&w.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 $&&w.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];let a=n<i;return a||$&&w.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[a,i,r]}var _f="__SENTRY_SUPPRESS_TRACING__";function nn(t,e){let n=Vs();if(n.startSpan)return n.startSpan(t,e);let r=V0(t),{forceTransaction:o,parentSpan:i,scope:a}=t,s=a?.clone();return Oe(s,()=>PA(i)(()=>{let c=rt(),d=Y0(c,i),u=P(),f=t.onlyIfParent&&!d?j0(c,u):q0({parentSpan:d,spanArguments:r,forceTransaction:o,scope:c});return(!zA(f)||!d)&&Zn(c,f),yf(()=>e(f),()=>{let{status:m}=et(f);f.isRecording()&&(!m||m==="ok")&&f.setStatus({code:2,message:"internal_error"})},()=>{f.end()})}))}function qn(t,e){let n=Vs();if(n.startSpanManual)return n.startSpanManual(t,e);let r=V0(t),{forceTransaction:o,parentSpan:i,scope:a}=t,s=a?.clone();return Oe(s,()=>PA(i)(()=>{let c=rt(),d=Y0(c,i),p=t.onlyIfParent&&!d?j0(c,P()):q0({parentSpan:d,spanArguments:r,forceTransaction:o,scope:c});return(!zA(p)||!d)&&Zn(c,p),yf(()=>e(p,()=>p.end()),()=>{let{status:f}=et(p);p.isRecording()&&(!f||f==="ok")&&p.setStatus({code:2,message:"internal_error"})})}))}function Ae(t){let e=Vs();if(e.startInactiveSpan)return e.startInactiveSpan(t);let n=V0(t),{forceTransaction:r,parentSpan:o}=t;return(t.scope?a=>Oe(t.scope,a):o!==void 0?a=>Jr(o,a):a=>a())(()=>{let a=rt(),s=Y0(a,o),l=P();return t.onlyIfParent&&!s?j0(a,l):q0({parentSpan:s,spanArguments:n,forceTransaction:r,scope:a})})}var zg=(t,e)=>{let n=Jn(),r=Xr(n);if(r.continueTrace)return r.continueTrace(t,e);let{sentryTrace:o,baggage:i}=t,a=P(),s=xc(i);return a&&!P0(a,s?.org_id)?Sf(e):Oe(l=>{let c=sf(o,i);return l.setPropagationContext(c),Zn(l,void 0),e()})};function Jr(t,e){let n=Vs();return n.withActiveSpan?n.withActiveSpan(t,e):Oe(r=>(Zn(r,t||void 0),e(r)))}function Nc(t){let e=Vs();return e.suppressTracing?e.suppressTracing(t):Oe(n=>{n.setSDKProcessingMetadata({[_f]:!0});let r=t();return n.setSDKProcessingMetadata({[_f]:void 0}),r})}function vf(t=rt()){let e=Vs();return e.isTracingSuppressed?e.isTracingSuppressed(t):t.getScopeData().sdkProcessingMetadata[_f]===!0}function Sf(t){let e=Vs();return e.startNewTrace?e.startNewTrace(t):Oe(n=>(n.setPropagationContext({traceId:Cn(),sampleRand:ar()}),$&&w.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),Jr(null,t)))}function j0(t,e){e?.recordDroppedEvent("no_parent_span","span");let n=new ur({traceId:t.getPropagationContext().traceId});return Na(n,t,Pt()),n}function q0({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){let o=Pt();if(!De()){let s={...o.getPropagationContext(),...r.getPropagationContext()},l=t?t.spanContext().traceId:s.traceId,c=new ur({traceId:l});return t&&!n&&Ic(t,c),Na(c,r,o),c}let i=P();if(HB(i,e)){vf(r)||i?.recordDroppedEvent("ignored","span");let s=new ur({dropReason:"ignored",traceId:t?.spanContext().traceId??r.getPropagationContext().traceId});return Na(s,r,o),s}let a;if(t&&!n)a=FB(t,r,e,o),Ic(t,a);else if(t){let s=$e(t),{traceId:l,spanId:c}=t.spanContext(),d=Tn(t);a=BA({traceId:l,parentSpanId:c,...e},r,o,d),G0(a,s)}else{let{traceId:s,dsc:l,parentSpanId:c,sampled:d}={...o.getPropagationContext(),...r.getPropagationContext()};a=BA({traceId:s,parentSpanId:c,...e},r,o,d),l&&G0(a,l)}return CA(a),a}function V0(t){let n={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){let r={...n};return r.startTimestamp=cr(t.startTime),delete r.startTime,r}return n}function Vs(){let t=Jn();return Xr(t)}function BA(t,e,n,r){let o=P(),i=o?.getOptions()||{},{name:a=""}=t,s={spanAttributes:{...t.attributes},spanName:a,parentSampled:r};o?.emit("beforeSampling",s,{decision:!1});let l=s.parentSampled??r,c=s.spanAttributes,d=e.getPropagationContext(),u=vf(e),[p,f,m]=u?[!1]:UA(i,{name:a,parentSampled:l,attributes:c,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:Rr(d.dsc?.sample_rate)},d.sampleRand),_=new Ma({...t,attributes:{[Ot]:"custom",[ni]:f!==void 0&&m?f:void 0,...c},sampled:p});return!p&&o&&!u&&($&&w.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),o.recordDroppedEvent("sample_rate",je(o)?"span":"transaction")),Na(_,e,n),o&&o.emit("spanStart",_),_}function FB(t,e,n,r){let{spanId:o,traceId:i}=t.spanContext(),a=vf(e),s=a?!1:Tn(t),l=s?new Ma({...n,parentSpanId:o,traceId:i,sampled:s}):new ur({traceId:i});Ic(t,l),Na(l,e,r);let c=P();return c&&(je(c)&&ai(l)&&(ai(t)&&t.dropReason?(l.dropReason=t.dropReason,c.recordDroppedEvent(t.dropReason,"span")):a||(l.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span"))),c.emit("spanStart",l),n.endTimestamp&&(c.emit("spanEnd",l),c.emit("afterSpanEnd",l))),l}function Y0(t,e){if(e)return e;if(e===null)return;let n=Uo(t);if(!n)return;let r=P();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Bt(n):n}function PA(t){return t!==void 0?e=>Jr(t,e):e=>e()}function HB(t,e){let n=t?.getOptions().ignoreSpans;return!t||!je(t)||!n?.length?!1:Ui({description:e.name||"",op:e.attributes?.[ht]||e.op,attributes:e.attributes},n)}function zA(t){return ai(t)&&t.dropReason==="ignored"}var Cc={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},GB="heartbeatFailed",$B="idleTimeout",jB="finalTimeout",qB="externalFinish";function Fg(t,e={}){let n=new Map,r=!1,o,i=qB,a=!e.disableAutoFinish,s=[],{idleTimeout:l=Cc.idleTimeout,finalTimeout:c=Cc.finalTimeout,childSpanTimeout:d=Cc.childSpanTimeout,beforeSpanEnd:u,trimIdleSpanEndTimestamp:p=!0}=e,f=P(),m=rt();if(!f||!De()){let I=new ur({traceId:m.getPropagationContext().traceId});return Na(I,m,Pt()),I}let _=Dt(),v=VB(t);v.end=new Proxy(v.end,{apply(I,L,z){if(u&&u(v),ai(L))return;let[U,...D]=z,N=U||Mt(),B=cr(N),V=ii(v).filter(F=>F!==v),st=et(v);if(!V.length||!p)return C(B),Reflect.apply(I,L,[B,...D]);let nt=f.getOptions().ignoreSpans,lt=V?.reduce((F,gt)=>{let J=et(gt);return!J.timestamp||nt&&Ui({description:J.description,op:J.op,attributes:J.data},nt)?F:F?Math.max(F,J.timestamp):J.timestamp},void 0),X=st.start_timestamp,ct=Math.min(X?X+c/1e3:1/0,Math.max(X||-1/0,Math.min(B,lt||1/0)));return C(ct),Reflect.apply(I,L,[ct,...D])}});function h(){o&&(clearTimeout(o),o=void 0)}function y(I){h(),o=setTimeout(()=>{!r&&n.size===0&&a&&(i=$B,v.end(I))},l)}function S(I){o=setTimeout(()=>{!r&&a&&(i=GB,v.end(I))},d)}function E(I){h(),n.set(I,!0);let L=Mt();S(L+d/1e3)}function R(I){if(n.has(I)&&n.delete(I),n.size===0){let L=Mt();y(L+l/1e3)}}function C(I){r=!0,n.clear(),s.forEach(V=>V()),Zn(m,_);let L=et(v),{start_timestamp:z}=L;if(!z)return;L.data[Li]||v.setAttribute(Li,i);let D=L.status;(!D||D==="unknown")&&v.setStatus({code:1}),w.log(`[Tracing] Idle span "${L.op}" finished`);let N=ii(v).filter(V=>V!==v),B=0;N.forEach(V=>{V.isRecording()&&(V.setStatus({code:2,message:"cancelled"}),V.end(I),$&&w.log("[Tracing] Cancelling span since span ended early",JSON.stringify(V,void 0,2)));let st=et(V),{timestamp:nt=0,start_timestamp:lt=0}=st,X=lt<=I,ct=(c+l)/1e3,F=nt-lt<=ct;if($){let gt=JSON.stringify(V,void 0,2);X?F||w.log("[Tracing] Discarding span since it finished after idle span final timeout",gt):w.log("[Tracing] Discarding span since it happened after idle span was finished",gt)}(!F||!X)&&(SA(v,V),B++)}),B>0&&v.setAttribute("sentry.idle_span_discarded_spans",B)}return s.push(f.on("spanStart",I=>{if(r||I===v||et(I).timestamp||I instanceof Ma&&I.isStandaloneSpan())return;ii(v).includes(I)&&E(I.spanContext().spanId)})),s.push(f.on("spanEnd",I=>{r||R(I.spanContext().spanId)})),s.push(f.on("idleSpanEnableAutoFinish",I=>{I===v&&(a=!0,y(),n.size&&S())})),e.disableAutoFinish||y(),setTimeout(()=>{r||(v.setStatus({code:2,message:"deadline_exceeded"}),i=jB,v.end())},c),v}function VB(t){let e=Ae(t);return Zn(rt(),e),$&&w.log("[Tracing] Started span is an idle span"),e}var YB=["addListener","on","once","prependListener","prependOnceListener","addEventListener"],WB=["removeListener","off","removeEventListener"],FA=Symbol("SentryScopeBoundListeners"),Mc;function KB(t){return Mc!==void 0&&(t===Mc||t.listener===Mc)}function W0(t,e=rt()){let n=t;if(Hg(n))return t;K0(n);for(let r of YB)typeof n[r]=="function"&&(n[r]=JB(n,n[r],e));for(let r of WB)typeof n[r]=="function"&&(n[r]=QB(n,n[r]));return typeof n.removeAllListeners=="function"&&(n.removeAllListeners=ZB(n,n.removeAllListeners)),t}function XB(t,e){return function(...n){return Oe(e,()=>t.apply(this,n))}}function HA(t){return typeof t=="function"}function JB(t,e,n){return function(...r){let o=r[0],i=r[1],a=r.slice(2);if(!HA(i)||KB(i))return e.apply(this,r);let s=Hg(t)||K0(t),l=s.get(o);l||(l=new WeakMap,s.set(o,l));let c=l.get(i);c||(c=XB(i,n),l.set(i,c));let d=Mc;Mc=c;try{return e.call(this,o,c,...a)}finally{Mc=d}}}function QB(t,e){return function(...n){let r=n[0],o=n[1],i=n.slice(2),a=HA(o)?Hg(t)?.get(r)?.get(o):void 0;return a?e.call(this,r,a,...i):e.apply(this,n)}}function ZB(t,e){return function(...n){let r=Hg(t);if(r)if(n.length===0)K0(t);else{let o=n[0];r.delete(o)}return e.apply(this,n)}}function K0(t){let e=new Map;return t[FA]=e,e}function Hg(t){return t[FA]}function $A(t,e){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=e;t4(t,e),r&&r4(t,r),o4(t,n),e4(t,o),n4(t,i)}function GA(t,e){let{extra:n,tags:r,attributes:o,user:i,contexts:a,level:s,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:d,eventProcessors:u,attachments:p,propagationContext:f,transactionName:m,span:_}=e;Ef(t,"extra",n),Ef(t,"tags",r),Ef(t,"attributes",o),Ef(t,"user",i),Ef(t,"contexts",a),t.sdkProcessingMetadata=Ra(t.sdkProcessingMetadata,l,2),s&&(t.level=s),m&&(t.transactionName=m),_&&(t.span=_),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),d.length&&(t.fingerprint=[...t.fingerprint,...d]),u.length&&(t.eventProcessors=[...t.eventProcessors,...u]),p.length&&(t.attachments=[...t.attachments,...p]),t.propagationContext={...t.propagationContext,...f}}function Ef(t,e,n){t[e]=Ra(t[e],n,1)}function si(t,e){let n=lr().getScopeData();return t&&GA(n,t.getScopeData()),e&&GA(n,e.getScopeData()),n}function t4(t,e){let{extra:n,tags:r,user:o,contexts:i,level:a,transactionName:s}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(o).length&&(t.user={...o,...t.user}),Object.keys(i).length&&(t.contexts={...i,...t.contexts}),a&&(t.level=a),s&&t.type!=="transaction"&&(t.transaction=s)}function e4(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function n4(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function r4(t,e){t.contexts={trace:Ac(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:$e(e),...t.sdkProcessingMetadata};let n=Bt(e),r=et(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function o4(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}function jA(t){let e={},{response:n,profile:r,cloud_resource:o,culture:i,state:a}=t;if(n&&(n.status_code!=null&&(e["http.response.status_code"]=n.status_code),n.body_size!=null&&(e["http.response.body.size"]=n.body_size)),r&&(r.profile_id&&(e["sentry.profile_id"]=r.profile_id),r.profiler_id&&(e["sentry.profiler_id"]=r.profiler_id)),o)for(let[c,d]of Object.entries(o))d!=null&&(e[c]=d);i&&(i.locale&&(e["culture.locale"]=i.locale),i.timezone&&(e["culture.timezone"]=i.timezone)),a?.state&&typeof a.state.type=="string"&&(e["state.type"]=a.state.type);let s=t.angular;if(s){let c=s.version;(typeof c=="string"||typeof c=="number")&&(e["angular.version"]=c)}let l=t.react;if(l){let c=l.version;(typeof c=="string"||typeof c=="number")&&(e["react.version"]=c)}return e}function Gg(t,e){let n=Ca(t),r=Gs(t),o=Ca(r),{isolationScope:i,scope:a}=oi(t),s=si(i,a);s4(n,o,e,s);let l=t.kind;e.emit("preprocessSpan",n,{spanKind:l}),n.is_segment&&(i4(n,s),a4(n,e),e.emit("processSegmentSpan",n)),e.emit("processSpan",n);let{beforeSendSpan:c}=e.getOptions(),d=c&&Pi(c)?l4(n,c):n,u=d.attributes?.[Ot];return u&&Nr(d,{"sentry.span.source":u}),{...Ng(d),_segmentSpan:r}}function i4(t,e){let n=jA(e.contexts);Nr(t,n)}function Nr(t,e){let n=t.attributes??(t.attributes={});Object.entries(e).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}function a4(t,e){let n=e.getIntegrationNames();n.length&&Nr(t,{[hg]:n})}function s4(t,e,n,r){let o=n.getSdkMetadata(),{release:i,environment:a}=n.getOptions();Nr(t,{[ug]:i,[dg]:a||zo,[fg]:e.name,[pg]:e.span_id,[mg]:o?.sdk?.name,[gg]:o?.sdk?.version,[bg]:r.user?.id,[yg]:r.user?.email,[_g]:r.user?.ip_address,[vg]:r.user?.username,...r.attributes})}function l4(t,e){let n=e(t);return n||($s(),t)}var X0=0,qA=1,VA=2;function li(t){return new Tf(e=>{e(t)})}function Ys(t){return new Tf((e,n)=>{n(t)})}var Tf=class t{constructor(e){this._state=X0,this._handlers=[],this._runExecutor(e)}then(e,n){return new t((r,o)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(a){o(a)}},i=>{if(!n)o(i);else try{r(n(i))}catch(a){o(a)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let o,i;return this.then(a=>{i=!1,o=a,e&&e()},a=>{i=!0,o=a,e&&e()}).then(()=>{if(i){r(o);return}n(o)})})}_executeHandlers(){if(this._state===X0)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===qA&&n[1](this._value),this._state===VA&&n[2](this._value),n[0]=!0)})}_runExecutor(e){let n=(i,a)=>{if(this._state===X0){if(Nn(a)){a.then(r,o);return}this._state=i,this._value=a,this._executeHandlers()}},r=i=>{n(qA,i)},o=i=>{n(VA,i)};try{e(r,o)}catch(i){o(i)}}};function YA(t,e,n,r=0){try{let o=J0(e,n,t,r);return Nn(o)?o:li(o)}catch(o){return Ys(o)}}function J0(t,e,n,r){let o=n[r];if(!t||!o)return t;let i=o({...t},e);return $&&i===null&&w.log(`Event processor "${o.id||"?"}" dropped event`),Nn(i)?i.then(a=>J0(a,e,n,r+1)):J0(i,e,n,r+1)}var Ws,WA,KA,Oa;function $g(t){let e=tt._sentryDebugIds,n=tt._debugIds;if(!e&&!n)return{};let r=e?Object.keys(e):[],o=n?Object.keys(n):[];if(Oa&&r.length===WA&&o.length===KA)return Oa;WA=r.length,KA=o.length,Oa={},Ws||(Ws={});let i=(a,s)=>{for(let l of a){let c=s[l],d=Ws?.[l];if(d&&Oa&&c)Oa[d[0]]=c,Ws&&(Ws[l]=[d[0],c]);else if(c){let u=t(l);for(let p=u.length-1;p>=0;p--){let m=u[p]?.filename;if(m&&Oa&&Ws){Oa[m]=c,Ws[l]=[m,c];break}}}}};return e&&i(r,e),n&&i(o,n),Oa}function Q0(t,e){let n=$g(t);if(!n)return[];let r=[];for(let o of e){let i=F1(o);i&&n[i]&&r.push({type:"sourcemap",code_file:o,debug_id:n[i]})}return r}function wf(t,e,n,r,o,i){let{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=t,l={...e,event_id:e.event_id||n.event_id||ae(),timestamp:e.timestamp||sr()},c=n.integrations||t.integrations.map(h=>h.name);c4(l,t),f4(l,c),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&u4(l,t.stackParser);let d=m4(r,n.captureContext);n.mechanism&&En(l,n.mechanism);let u=o?o.getEventProcessors():[],p=si(i,d),f=[...n.attachments||[],...p.attachments];f.length&&(n.attachments=f),$A(l,p);let m=[...u,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?li(l):YA(m,l,n)).then(h=>(h&&d4(h),typeof a=="number"&&a>0?p4(h,a,s):h))}function c4(t,e){let{environment:n,release:r,dist:o,maxValueLength:i}=e;t.environment=t.environment||n||zo,!t.release&&r&&(t.release=r),!t.dist&&o&&(t.dist=o);let a=t.request;a?.url&&i&&(a.url=Do(a.url,i)),i&&t.exception?.values?.forEach(s=>{s.value&&(s.value=Do(s.value,i))})}function u4(t,e){let n=$g(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function d4(t){let e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.entries(e).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function f4(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function p4(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:ue(o.data,e,n)}}))},...t.user&&{user:ue(t.user,e,n)},...t.contexts&&{contexts:ue(t.contexts,e,n)},...t.extra&&{extra:ue(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=ue(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>({...o,...o.data&&{data:ue(o.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=ue(t.contexts.flags,3,n)),r}function m4(t,e){if(!e)return t;let n=t?t.clone():new $n;return n.update(e),n}function XA(t){if(t)return g4(t)?{captureContext:t}:b4(t)?{captureContext:t}:t}function g4(t){return t instanceof $n||typeof t=="function"}var h4=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function b4(t){return Object.keys(t).some(e=>h4.includes(e))}function Et(t,e){return rt().captureException(t,XA(e))}function Da(t,e){let n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return rt().captureMessage(t,n,r)}function Qr(t,e){return rt().captureEvent(t,e)}function La(t,e){Pt().setContext(t,e)}function jg(t){Pt().setExtras(t)}function qg(t,e){Pt().setExtra(t,e)}function Vg(t){Pt().setTags(t)}function Oc(t,e){Pt().setTag(t,e)}function Yg(t){Pt().setAttributes(t)}function Wg(t,e){Pt().setAttribute(t,e)}function Kg(t){Pt().setUser(t)}function Xg(t){Pt().setConversationId(t)}function Dc(){return Pt().lastEventId()}async function Jg(t){let e=P();return e?e.flush(t):($&&w.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Qg(t){let e=P();return e?e.close(t):($&&w.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function Zg(){return!!P()}function Lc(){let t=P();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function Uc(t){Pt().addEventProcessor(t)}function Ks(t){let e=Pt(),{user:n}=si(e,rt()),{userAgent:r}=tt.navigator||{},o=J1({user:n,...r&&{userAgent:r},...t}),i=e.getSession();return i?.status==="ok"&&Oi(i,{status:"exited"}),Bc(),e.setSession(o),o}function Bc(){let t=Pt(),n=rt().getSession()||t.getSession();n&&Q1(n),JA(),t.setSession()}function JA(){let t=Pt(),e=P(),n=t.getSession();n&&e&&e.captureSession(n)}function Ua(t=!1){if(t){Bc();return}JA()}function Ba(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}var QA="7";function ZA(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function y4(t){return`${ZA(t)}${t.projectId}/envelope/`}function _4(t,e){let n={sentry_version:QA};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function xf(t,e,n){return e||`${y4(t)}?${_4(t,n)}`}function Z0(t,e){let n=af(t);if(!n)return"";let r=`${ZA(n)}embed/error-page/`,o=`dsn=${en(n)}`;for(let i in e)if(i!=="dsn"&&i!=="onClose")if(i==="user"){let a=e.user;if(!a)continue;a.name&&(o+=`&name=${encodeURIComponent(a.name)}`),a.email&&(o+=`&email=${encodeURIComponent(a.email)}`)}else o+=`&${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`;return`${r}?${o}`}var th=[];function v4(t){let e={};return t.forEach(n=>{let{name:r}=n,o=e[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function eh(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){let o=n(e);r=Array.isArray(o)?o:[o]}else r=e;return v4(r)}function tk(t,e){let n={};return e.forEach(r=>{r?.beforeSetup&&r.beforeSetup(t)}),e.forEach(r=>{r&&ev(t,r,n)}),n}function tv(t,e){for(let n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function ev(t,e,n){if(n[e.name]){$&&w.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!th.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),th.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,i)=>r(o,i,t))}if(typeof e.processEvent=="function"){let r=e.processEvent.bind(e),o=Object.assign((i,a)=>r(i,a,t),{id:e.name});t.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=e[r];typeof o=="function"&&t.on(r,i=>o.call(e,i,t))}),$&&w.log(`Integration installed: ${e.name}`)}function Xs(t){let e=P();if(!e){$&&w.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`);return}e.addIntegration(t)}var S4="sentry.timestamp.sequence",nv=0,rv;function nh(t){let e=Math.floor(t*1e3);rv!==void 0&&e!==rv&&(nv=0);let n=nv;return nv++,rv=e,{key:S4,value:{value:n,type:"integer"}}}function rh(t,e){return e?Oe(e,()=>{let n=Dt(),r=n?Ac(n):Ec(e);return[n?$e(n):Bi(t,e),r]}):[void 0,void 0]}var ek={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function ov(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function iv(){return"npm"}function nk(){return!ov()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Vn(){return typeof window<"u"&&(!nk()||E4())}function E4(){return tt.process?.type==="renderer"}function T4(t,e){let n=e?"auto":"never";return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function rk(t,e,n,r,o){let i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=en(r)),Le(i,[T4(t,o)])}var w4=100;function ci(t,e,n,r=!0){n&&(!t[e]||r)&&(t[e]=n)}function ok(t,e){let n=sv(),r=ik(t);r===void 0?n.set(t,[e]):r.length>=w4?(Js(t,r),n.set(t,[e])):n.set(t,[...r,e])}function Pa(t,e=rt(),n=ok){let r=e?.getClient()??P();if(!r){$&&w.warn("No client available to capture log.");return}let{release:o,environment:i,enableLogs:a=!1,beforeSendLog:s}=r.getOptions();if(!a){$&&w.warn("logging option not enabled, log will not be captured.");return}let[,l]=rh(r,e),c={...t.attributes},{user:{id:d,email:u,username:p},attributes:f={}}=si(Pt(),e);ci(c,"user.id",d,!1),ci(c,"user.email",u,!1),ci(c,"user.name",p,!1),ci(c,"sentry.release",o),ci(c,"sentry.environment",i);let{name:m,version:_}=r.getSdkMetadata()?.sdk??{};ci(c,"sentry.sdk.name",m),ci(c,"sentry.sdk.version",_);let v=r.getIntegrationByName("Replay"),h=v?.getReplayId(!0);ci(c,"sentry.replay_id",h),h&&v?.getRecordingMode()==="buffer"&&ci(c,"sentry._internal.replay_is_buffering",!0);let y=t.message;if(ei(y)){let{__sentry_template_string__:B,__sentry_template_values__:V=[]}=y;V?.length&&(c["sentry.message.template"]=B),V.forEach((st,nt)=>{c[`sentry.message.parameter.${nt}`]=st})}let S=Uo(e);ci(c,"sentry.trace.parent_span_id",S?.spanContext().spanId);let E={...t,attributes:c};r.emit("beforeCaptureLog",E);let R=s?pn(()=>s(E)):E;if(!R){r.recordDroppedEvent("before_send","log_item",1),$&&w.warn("beforeSendLog returned null, log will not be captured.");return}let{level:C,message:I,attributes:L={},severityNumber:z}=R,U=Mt(),D=nh(U),N={timestamp:U,level:C,body:av(String(I)),trace_id:l?.trace_id,severity_number:z??ek[C],attributes:x4({...Di(f),...Di(L,!0),[D.key]:D.value})};n(r,N),r.emit("afterCaptureLog",R)}function Js(t,e){let n=e??ik(t)??[];if(n.length===0)return;let r=t.getOptions(),o=rk(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);sv().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(o)}function ik(t){return sv().get(t)}function sv(){return Mo("clientToLogBufferMap",()=>new WeakMap)}function x4(t){let e={};for(let[n,r]of Object.entries(t)){let o=av(n);r.type==="string"?e[o]={...r,value:av(r.value)}:e[o]=r}return e}function av(t){let e=Object(t),n=e.isWellFormed,r=e.toWellFormed;return typeof n=="function"&&typeof r=="function"?n.call(t)?t:r.call(t):t}function A4(t,e){let n=e?"auto":"never";return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function ak(t,e,n,r,o){let i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=en(r)),Le(i,[A4(t,o)])}var k4=1e3;function Fi(t,e,n,r=!0){n&&(r||!(e in t))&&(t[e]=n)}function sk(t,e){let n=cv(),r=lk(t);r===void 0?n.set(t,[e]):r.length>=k4?(Pc(t,r),n.set(t,[e])):n.set(t,[...r,e])}function I4(t,e,n){let{release:r,environment:o}=e.getOptions(),i={...t.attributes};Fi(i,"user.id",n.id,!1),Fi(i,"user.email",n.email,!1),Fi(i,"user.name",n.username,!1),Fi(i,"sentry.release",r),Fi(i,"sentry.environment",o);let{name:a,version:s}=e.getSdkMetadata()?.sdk??{};Fi(i,"sentry.sdk.name",a),Fi(i,"sentry.sdk.version",s);let l=e.getIntegrationByName("Replay"),c=l?.getReplayId(!0);return Fi(i,"sentry.replay_id",c),c&&l?.getRecordingMode()==="buffer"&&Fi(i,"sentry._internal.replay_is_buffering",!0),{...t,attributes:i}}function R4(t,e,n,r){let[,o]=rh(e,n),i=Uo(n),a=i?i.spanContext().traceId:o?.trace_id,s=i?i.spanContext().spanId:void 0,l=Mt(),c=nh(l);return{timestamp:l,trace_id:a??"",span_id:s,name:t.name,type:t.type,unit:t.unit,value:t.value,attributes:{...Di(r),...Di(t.attributes,"skip-undefined"),[c.key]:c.value}}}function lv(t,e){let n=e?.scope??rt(),r=e?.captureSerializedMetric??sk,o=n?.getClient()??P();if(!o){$&&w.warn("No client available to capture metric.");return}let{_experiments:i,enableMetrics:a,beforeSendMetric:s}=o.getOptions();if(!(a??i?.enableMetrics??!0)){$&&w.warn("metrics option not enabled, metric will not be captured.");return}let{user:c,attributes:d}=si(Pt(),n),u=I4(t,o,c);o.emit("processMetric",u);let p=s||i?.beforeSendMetric,f=p?p(u):u;if(!f){$&&w.log("`beforeSendMetric` returned `null`, will not send metric.");return}let m=R4(f,o,n,d);$&&w.log("[Metric]",m),r(o,m),o.emit("afterCaptureMetric",f)}function Pc(t,e){let n=e??lk(t)??[];if(n.length===0)return;let r=t.getOptions(),o=ak(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);cv().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(o)}function lk(t){return cv().get(t)}function cv(){return Mo("clientToMetricBufferMap",()=>new WeakMap)}function ck(t){let e={trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,name:t.description||"",start_timestamp:t.start_timestamp,end_timestamp:t.timestamp||t.start_timestamp,status:!t.status||t.status==="ok"||t.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...t.data},links:t.links};return Ng(e)}function uk(t,e){if(t.type!=="transaction"||!t.spans?.length||!t.sdkProcessingMetadata?.hasGenAiSpans||e.getOptions().streamGenAiSpans===!1||je(e))return;let n=[],r=[];for(let i of t.spans)i.op?.startsWith("gen_ai.")?n.push(ck(i)):r.push(i);if(n.length===0)return;t.spans=r;let o=e.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}var zc=Symbol.for("SentryBufferFullError");function Qs(t=100){let e=new Set;function n(){return e.size<t}function r(a){e.delete(a)}function o(a){if(!n())return Ys(zc);let s=a();return e.add(s),s.then(()=>r(s),()=>r(s)),s}function i(a){if(!e.size)return li(!0);let s=Promise.allSettled(Array.from(e)).then(()=>!0);if(!a)return s;let l=[s,new Promise(c=>Ba(setTimeout(()=>c(!1),a)))];return Promise.race(l)}return{get $(){return Array.from(e)},add:o,drain:i}}var dk=60*1e3;function oh(t,e=Hn()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?dk:r-e}function fk(t,e){return t[e]||t.all||0}function Af(t,e,n=Hn()){return fk(t,e)>n}function kf(t,{statusCode:e,headers:n},r=Hn()){let o={...t},i=n?.["x-sentry-rate-limits"],a=n?.["retry-after"];if(i)for(let s of i.trim().split(",")){let[l,c,,,d]=s.split(":",5),u=parseInt(l,10),p=(isNaN(u)?60:u)*1e3;if(!c)o.all=r+p;else for(let f of c.split(";"))f==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[f]=r+p):o[f]=r+p}else a?o.all=r+oh(a,r):e===429&&(o.all=r+60*1e3);return o}var uv=64;function If(t,e,n=Qs(t.bufferSize||uv)){let r={},o=a=>n.drain(a);function i(a){let s=[];if(dr(a,(u,p)=>{let f=hf(p);Af(r,f)?t.recordDroppedEvent("ratelimit_backoff",f):s.push(u)}),s.length===0)return Promise.resolve({});let l=Le(a[0],s),c=u=>{if(js(l,["client_report"])){$&&w.warn(`Dropping client report. Will not send outcomes (reason: ${u}).`);return}dr(l,(p,f)=>{t.recordDroppedEvent(u,hf(f))})},d=()=>e({body:zi(l)}).then(u=>u.statusCode===413?($&&w.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),u):($&&u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&w.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),r=kf(r,u),u),u=>{throw c("network_error"),$&&w.error("Encountered error running transport request:",u),u});return n.add(d).then(u=>u,u=>{if(u===zc)return $&&w.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw u})}return{send:i,flush:o}}function pk(t,e,n){let r=[{type:"client_report"},{timestamp:n||sr(),discarded_events:t}];return Le(e?{dsn:e}:{},[r])}function ih(t){let e=[];t.message&&e.push(t.message);try{let n=t.exception.values[t.exception.values.length-1];n?.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function mk(t){let{trace_id:e,parent_span_id:n,span_id:r,status:o,origin:i,data:a,op:s}=t.contexts?.trace??{};return{data:a??{},description:t.transaction,op:s,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:o,timestamp:t.timestamp,trace_id:e??"",origin:i,profile_id:a?.[Fs],exclusive_time:a?.[jn],measurements:t.measurements,is_segment:!0}}function gk(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[Fs]:t.profile_id},...t.exclusive_time&&{[jn]:t.exclusive_time}}}},measurements:t.measurements}}var Zs="[Filtered]",Rf=["forwarded","-ip","remote-","via","-user"],dv=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],hk=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function bk(t){return t===!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:7}:{userInfo:!1,cookies:{deny:Rf},httpHeaders:{request:{deny:Rf},response:{deny:Rf}},httpBodies:[],queryParams:{deny:Rf},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:7}}var N4={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};function yk(t){let e=t.dataCollection!=null?N4:bk(t.sendDefaultPii),n=t.dataCollection??{};return{userInfo:n.userInfo??e.userInfo,cookies:n.cookies??e.cookies,httpHeaders:{request:n.httpHeaders?.request??e.httpHeaders.request,response:n.httpHeaders?.response??e.httpHeaders.response},httpBodies:n.httpBodies??e.httpBodies,queryParams:n.queryParams??e.queryParams,genAI:{inputs:n.genAI?.inputs??e.genAI.inputs,outputs:n.genAI?.outputs??e.genAI.outputs},stackFrameVariables:n.stackFrameVariables??e.stackFrameVariables,frameContextLines:n.frameContextLines??e.frameContextLines}}var _k="Not capturing exception because it's already been captured.",vk="Discarded session because of missing or non-string release",Ak=Symbol.for("SentryInternalError"),kk=Symbol.for("SentryDoNotSendEventError"),C4=5e3;function ah(t){return{message:t,[Ak]:!0}}function fv(t){return{message:t,[kk]:!0}}function Sk(t){return!!t&&typeof t=="object"&&Ak in t}function Ek(t){return!!t&&typeof t=="object"&&kk in t}function Tk(t,e,n,r,o){let i=0,a,s=!1;t.on(n,()=>{i=0,clearTimeout(a),s=!1}),t.on(e,l=>{if(i+=r(l),i>=8e5)o(t);else if(!s){let c=t.getOptions()._flushInterval??C4;c>0&&(s=!0,a=Ba(setTimeout(()=>{o(t)},c)))}}),t.on("flush",()=>{o(t)})}var Nf=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Qs(e.transportOptions?.bufferSize??uv),this._dataCollection=yk(e),e.dsn?this._dsn=af(e.dsn):$&&w.warn("No DSN provided, client will not send events."),this._dsn){let r=xf(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Tk(this,"afterCaptureLog","flushLogs",L4,Js),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Tk(this,"afterCaptureMetric","flushMetrics",D4,Pc)}captureException(e,n,r){let o=ae();if(nf(e))return $&&w.log(_k),o;let i={event_id:o,...n};return this._process(()=>this.eventFromException(e,i).then(a=>this._captureEvent(a,i,r)).then(a=>a),"error"),i.event_id}captureMessage(e,n,r,o){let i={event_id:ae(),...r},a=ei(e)?e:String(e),s=Ze(e),l=s?this.eventFromMessage(a,n,i):this.eventFromException(e,i);return this._process(()=>l.then(c=>this._captureEvent(c,i,o)),s?"unknown":"error"),i.event_id}captureEvent(e,n,r){let o=ae();if(n?.originalException&&nf(n.originalException))return $&&w.log(_k),o;let i={event_id:o,...n},a=e.sdkProcessingMetadata||{},s=a.capturedSpanScope,l=a.capturedSpanIsolationScope,c=wk(e.type);return this._process(()=>this._captureEvent(e,i,s||r,l),c),i.event_id}captureSession(e){this.sendSession(e),Oi(e,{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(e){let n=this._transport;if(this.emit("flush"),!n)return!0;let r=await this._isClientDoneProcessing(e),o=await n.flush(e);return r&&o}async close(e){Js(this);let n=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){let n=this._integrations[e.name];!n&&e.beforeSetup&&e.beforeSetup(this),ev(this,e,this._integrations),n||tv(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=uk(e,this),o=RA(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=gf(o,Pg(i));r&&(o=gf(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",e,i))}sendSession(e){let{release:n,environment:r=zo}=this._options;if("aggregates"in e){let i=e.attrs||{};if(!i.release&&!n){$&&w.warn(vk);return}i.release=i.release||n,i.environment=i.environment||r,e.attrs=i}else{if(!e.release&&!n){$&&w.warn(vk);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);let o=IA(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){let o=`${e}:${n}`;$&&w.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(e,n){let r=this._hooks[e]=this._hooks[e]||new Set,o=(...i)=>n(...i);return r.add(o),()=>{r.delete(o)}}emit(e,...n){let r=this._hooks[e];r&&r.forEach(o=>o(...n))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(n){return $&&w.error("Error while sending envelope:",n),{}}return $&&w.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=tk(this,e),tv(this,e)}_updateSessionFromEvent(e,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 a=e.status==="ok";(a&&e.errors===0||a&&r)&&(Oi(e,{...r&&{status:"crashed"},errors:e.errors||Number(o||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let n=0;for(;!e||n<e;){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(e,n,r,o){let i=this.getOptions(),a=this.getIntegrationNames();return!n.integrations&&a.length&&(n.integrations=a),this.emit("preprocessEvent",e,n),e.type||o.setLastEventId(e.event_id||n.event_id),wf(i,e,n,r,this,o).then(s=>{if(s===null)return s;this.emit("postprocessEvent",s,n),s.contexts={trace:{...s.contexts?.trace,...Ec(r)},...s.contexts};let l=Bi(this,r);return s.sdkProcessingMetadata={dynamicSamplingContext:l,...s.sdkProcessingMetadata},s})}_captureEvent(e,n={},r=rt(),o=Pt()){return $&&pv(e)&&w.log(`Captured error event \`${ih(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,o).then(i=>i.event_id,i=>{$&&(Ek(i)?w.log(i.message):Sk(i)?w.warn(i.message):w.warn(i))})}_processEvent(e,n,r,o){let i=this.getOptions(),{sampleRate:a}=i,s=Ik(e),l=pv(e),d=`before send for type \`${e.type||"error"}\``,u=typeof a>"u"?void 0:Rr(a);if(l&&typeof u=="number"&&ar()>u)return this.recordDroppedEvent("sample_rate","error"),Ys(fv(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let p=wk(e.type);return this._prepareEvent(e,n,r,o).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",p),fv("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return f;let _=O4(this,i,f,n);return M4(_,d)}).then(f=>{if(f===null){if(this.recordDroppedEvent("before_send",p),s){let h=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",h)}throw fv(`${d} returned \`null\`, will not send event.`)}let m=r.getSession()||o.getSession();if(l&&m&&this._updateSessionFromEvent(m,f),s){let v=f.sdkProcessingMetadata?.spanCountBeforeProcessing||0,h=f.spans?f.spans.length:0,y=v-h;y>0&&this.recordDroppedEvent("before_send","span",y)}let _=f.transaction_info;if(s&&_&&f.transaction!==e.transaction){let v="custom";f.transaction_info={..._,source:v}}return this.sendEvent(f,n),f}).then(null,f=>{throw Ek(f)||Sk(f)?f:(this.captureException(f,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:f}),ah(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
18
|
-
Reason: ${f}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===zc&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[o,i]=n.split(":");return{reason:o,category:i,quantity:r}})}_flushOutcomes(){$&&w.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){$&&w.log("No outcomes to send");return}if(!this._dsn){$&&w.log("No dsn provided, will not send outcomes");return}$&&w.log("Sending outcomes:",e);let n=pk(e,this._options.tunnel&&en(this._dsn));this.sendEnvelope(n)}};function wk(t){return t==="replay_event"?"replay":t||"error"}function M4(t,e){let n=`${e} must return \`null\` or a valid event.`;if(Nn(t))return t.then(r=>{if(!he(r)&&r!==null)throw ah(n);return r},r=>{throw ah(`${e} rejected with ${r}`)});if(!he(t)&&t!==null)throw ah(n);return t}function O4(t,e,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:a}=e,s=!Pi(e.beforeSendSpan)&&e.beforeSendSpan,l=n;if(pv(l)&&o)return o(l,r);if(Ik(l)){if(s||a){let c=mk(l);if(a?.length&&Ui({description:c.description,op:c.op,attributes:c.data},a))return null;if(s){let d=s(c);d?l=Ra(n,gk(d)):$s()}if(l.spans){let d=[],u=l.spans;for(let f of u){if(a?.length&&Ui({description:f.description,op:f.op,attributes:f.data},a)){wA(u,f);continue}if(s){let m=s(f);m?d.push(m):($s(),d.push(f))}else d.push(f)}let p=l.spans.length-d.length;p&&t.recordDroppedEvent("before_send","span",p),l.spans=d}}if(i){if(l.spans){let c=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return i(l,r)}}return l}function pv(t){return t.type===void 0}function Ik(t){return t.type==="transaction"}function D4(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+Rk(t.attributes)}function L4(t){let e=0;return t.message&&(e+=t.message.length*2),e+Rk(t.attributes)}function Rk(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*xk(n[0]):Ze(n)?e+=xk(n):e+=100}),e}function xk(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function mv(t,e){e.debug===!0&&($?w.enable():pn(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),rt().update(e.initialScope);let r=new t(e);return sh(r),r.init(),r}function sh(t){rt().setClient(t)}var gv=100,hv=5e3,U4=36e5;function bv(t){function e(...n){$&&w.log("[Offline]:",...n)}return n=>{let r=t(n);if(!n.createStore)throw new Error("No `createStore` function was provided");let o=n.createStore(n),i=hv,a;function s(u,p,f){return js(u,["client_report"])?!1:n.shouldStore?n.shouldStore(u,p,f):!0}function l(u){a&&clearTimeout(a),a=Ba(setTimeout(async()=>{a=void 0;let p=await o.shift();p&&(e("Attempting to send previously queued event"),p[0].sent_at=new Date(Hn()).toISOString(),d(p,!0).catch(f=>{e("Failed to retry sending",f)}))},u))}function c(){a||(l(i),i=Math.min(i*2,U4))}async function d(u,p=!1){if(!p&&js(u,["replay_event","replay_recording"]))return await o.push(u),l(gv),{};try{if(n.shouldSend&&await n.shouldSend(u)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");let f=await r.send(u),m=gv;if(f){if(f.headers?.["retry-after"])m=oh(f.headers["retry-after"]);else if(f.headers?.["x-sentry-rate-limits"])m=6e4;else if((f.statusCode||0)>=400)return f}return l(m),i=hv,f}catch(f){if(await s(u,f,i))return p?await o.unshift(u):await o.push(u),c(),e("Error sending. Event queued.",f),{};throw f}}return n.flushAtStartup&&c(),{send:d,flush:u=>(u===void 0&&(i=hv,l(gv)),r.flush(u))}}}var Fc="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function Nk(t,e){let n;return dr(t,(r,o)=>(e.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function B4(t,e){return n=>{let r=t(n);return{...r,send:async o=>{let i=Nk(o,["event","transaction","profile","replay_event"]);return i&&(i.release=e),r.send(o)}}}}function P4(t,e){return Le(e?{...t[0],dsn:e}:t[0],t[1])}function yv(t,e){return n=>{let r=t(n),o=new Map,i=e||(c=>{let d=c.getEvent();return d?.extra?.[Fc]&&Array.isArray(d.extra[Fc])?d.extra[Fc]:[]});function a(c,d){let u=d?`${c}:${d}`:c,p=o.get(u);if(!p){let f=Ag(c);if(!f)return;let m=xf(f,n.tunnel);p=d?B4(t,d)({...n,url:m}):t({...n,url:m}),o.set(u,p)}return[c,p]}async function s(c){function d(m){let _=m?.length?m:["event"];return Nk(c,_)}let u=i({envelope:c,getEvent:d}).map(m=>typeof m=="string"?a(m,void 0):a(m.dsn,m.release)).filter(m=>!!m),p=u.length?u:[["",r]];return(await Promise.all(p.map(([m,_])=>_.send(P4(c,m)))))[0]}async function l(c){let d=[...o.values(),r];return(await Promise.all(d.map(p=>p.flush(c)))).every(p=>p)}return{send:s,flush:l}}}function _v(t,e){return e.some(n=>t.includes(n))}function za(t,e,n){if(e===!1)return{};let r=n!=null?[...dv,...n]:dv,o={};if(e===!0){for(let a of Object.keys(t))o[a]=_v(a.toLowerCase(),r)?Zs:t[a];return o}if("deny"in e){let a=e.deny.map(s=>s.toLowerCase());for(let s of Object.keys(t)){let l=s.toLowerCase(),c=_v(l,r)||a.some(d=>l.includes(d));o[s]=c?Zs:t[s]}return o}let i=e.allow.map(a=>a.toLowerCase());for(let a of Object.keys(t)){let s=a.toLowerCase();if(_v(s,r))o[a]=Zs;else{let l=i.some(c=>s.includes(c));o[a]=l?t[a]:Zs}}return o}function Ck(t){let e={},n=0;for(;n<t.length;){let r=t.indexOf("=",n);if(r===-1)break;let o=t.indexOf(";",n);if(o===-1)o=t.length;else if(o<r){n=t.lastIndexOf(";",r-1)+1;continue}let i=t.slice(n,r).trim();if(e[i]===void 0){let a=t.slice(r+1,o).trim();a.charCodeAt(0)===34&&(a=a.slice(1,-1));try{e[i]=a.indexOf("%")!==-1?decodeURIComponent(a):a}catch{e[i]=a}}n=o+1}return e}function Cf(t,e){if(e===!1)return{};try{let n=Ck(t);return Object.keys(n).length===0?{}:za(n,e,hk)}catch{return Zs}}var z4="thismessage:/";function tl(t){return"isRelative"in t}function ui(t,e){let n=t.indexOf("://")<=0&&t.indexOf("//")!==0,r=e??(n?z4:void 0);try{if("canParse"in URL&&!URL.canParse(t,r))return;let o=new URL(t,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function Hc(t){if(tl(t))return t.pathname;let e=new URL(t);return e.search="",e.hash="",["80","443"].includes(e.port)&&(e.port=""),e.password&&(e.password="%filtered%"),e.username&&(e.username="%filtered%"),e.toString()}function Zr(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Gc(t){return t.split(/[?#]/,1)[0]}function Yn(t,e=!0){if(t.startsWith("data:")){let n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=t.includes(";base64,"),i=t.indexOf(","),a="";if(e&&i!==-1){let s=t.slice(i+1);a=s.length>10?`${s.slice(0,10)}... [truncated]`:s}return`data:${r}${o?",base64":""}${a?`,${a}`:""}`}return t}function $c(t,e){let n=e?.getDsn(),r=e?.getOptions().tunnel;return H4(t,n)||F4(t,r)}function F4(t,e){return e?Mk(t)===Mk(e):!1}function H4(t,e){let n=ui(t);return!n||tl(n)||!e?!1:G4(n.hostname,e.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function G4(t,e){return t===e||e.length>0&&t.endsWith(`.${e}`)}function Mk(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function lh(t,...e){let n=new String(String.raw(t,...e));return n.__sentry_template_string__=t.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=e,n}var vv=lh;function Sv(t){"aggregates"in t?t.attrs?.ip_address===void 0&&(t.attrs={...t.attrs,ip_address:"{{auto}}"}):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function Mf(t,e,n=[e],r="npm"){let o=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${e}`,o.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:ir})),o.version=ir)}function el(t={}){let e=t.client||P();if(!Lc()||!e)return{};let n=Jn(),r=Xr(n);if(r.getTraceData)return r.getTraceData(t);let o=t.scope||rt(),i=t.span||Dt(),a=ai(i)&&!De(e.getOptions());if(!i&&lg())return{};let s=i&&!a?kc(i):$4(o),l=i?$e(i):Bi(e,o),c=xg(l);if(!Ig.test(s))return w.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let u={"sentry-trace":s,baggage:c};return t.propagateTraceparent&&(u.traceparent=i&&!a?bA(i):j4(o)),u}function $4(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return lf(e,r,n)}function j4(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return cf(e,r,n)}function Ev(t,e,n){let r,o,i,a=n?.maxWait?Math.max(n.maxWait,e):0,s=n?.setTimeoutImpl||setTimeout;function l(){return c(),r=t(),r}function c(){o!==void 0&&clearTimeout(o),i!==void 0&&clearTimeout(i),o=i=void 0}function d(){return o!==void 0||i!==void 0?l():r}function u(){return o&&clearTimeout(o),o=s(l,e),a&&i===void 0&&(i=s(l,a)),r}return u.cancel=c,u.flush=d,u}var q4=100;function wn(t,e){let n=P(),r=Pt();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=q4}=n.getOptions();if(i<=0)return;let s={timestamp:sr(),...t},l=o?pn(()=>o(s,e)):s;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,e),r.addBreadcrumb(l,i))}var Ok,V4="FunctionToString",Dk=new WeakMap,Y4=(()=>({name:V4,setupOnce(){Ok=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=Aa(this),n=Dk.has(P())&&e!==void 0?e:this;return Ok.apply(n,t)}}catch{}},setup(t){Dk.set(t,!0)}})),Of=Y4;var W4=[/^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$/],K4="EventFilters",uh=(t={})=>{let e;return{name:K4,setup(n){let r=n.getOptions();e=Lk(t,r)},processEvent(n,r,o){if(!e){let i=o.getOptions();e=Lk(t,i)}return X4(n,e)?null:n}}},Df=((t={})=>({...uh(t),name:"InboundFilters"}));function Lk(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:W4],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function X4(t,e){if(t.type){if(t.type==="transaction"&&Q4(t,e.ignoreTransactions))return $&&w.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
17
|
+
`)}`)}function MA(t){if(!$)return;let{description:e="< unknown name >",op:n="< unknown op >"}=rt(t),{spanId:r}=t.spanContext(),i=Bt(t)===t,a=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${e}" with ID ${r}`;w.log(a)}function qs(t,e,n,r=Dt()){let o=r&&Bt(r);o&&($&&w.log(`[Measurement] Setting measurement on root span: ${t} = ${e} ${n}`),o.addEvent(t,{[Po]:e,[Bo]:n}))}function bf(t){if(!t||t.length===0)return;let e={};return t.forEach(n=>{let r=n.attributes||{},o=r[Bo],i=r[Po];typeof o=="string"&&typeof i=="number"&&(e[n.name]={value:i,unit:o})}),e}function qe(t){return t.getOptions().traceLifecycle==="stream"}var OA=1e3,Ma=class{constructor(e={}){this._traceId=e.traceId||Cn(),this._spanId=e.spanId||Gn(),this._startTime=e.startTimestamp||Mt(),this._links=e.links,this._attributes={},this.setAttributes({[at]:"manual",[ht]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,n){}spanContext(){let{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?df:Rg}}setAttribute(e,n){return n===void 0?delete this._attributes[e]:this._attributes[e]=n,this}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._startTime=cr(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,cA(this)||this.setAttribute(Ot,"custom"),this}end(e){this._endTime||(this._endTime=cr(e),MA(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ht],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:pf(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[at],profile_id:this._attributes[Fs],exclusive_time:this._attributes[jn],measurements:bf(this._events),is_segment:this._isStandaloneSpan&&Bt(this)===this||void 0,segment_id:this._isStandaloneSpan?Bt(this).spanContext().spanId:void 0,links:ff(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===Bt(this),status:Cg(this._status),attributes:H0(this._attributes,this._status),links:F0(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){$&&w.log("[Tracing] Adding an event to span:",e);let o=DA(n)?n:r||Mt(),i=DA(n)?{}:n||{},a={name:e,time:cr(o),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=z();if(e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Bt(this)))return;if(this._isStandaloneSpan){this._sampled?PB(NA([this],e)):($&&w.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}else if(e&&qe(e)){e.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(oi(this).scope||it()).captureEvent(r)}_convertSpanToTransaction(){if(!LA(rt(this)))return;this._name||($&&w.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:e,isolationScope:n}=oi(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=ii(this).filter(u=>u!==this&&!BB(u)).map(u=>rt(u)).filter(LA),a=this._attributes[Ot];delete this._attributes[zs];let s=!1;i.forEach(u=>{delete u.data[zs],u.op?.startsWith("gen_ai.")&&(s=!0)});let l={contexts:{trace:hA(this)},spans:i.length>OA?i.sort((u,p)=>u.start_timestamp-p.start_timestamp).slice(0,OA):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:je(this),hasGenAiSpans:s},request:r,...a&&{transaction_info:{source:a}}},c=bf(this._events);return c&&Object.keys(c).length&&($&&w.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),l.measurements=c),l}};function DA(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function LA(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function BB(t){return t instanceof Ma&&t.isStandaloneSpan()}function PB(t){let e=z();if(!e)return;let n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function yf(t,e,n=()=>{},r=()=>{}){let o;try{o=t()}catch(i){throw e(i),n(),i}return zB(o,e,n,r)}function zB(t,e,n,r){return Nn(t)?sg(t,o=>{n(),r(o)},o=>{e(o),n()}):(n(),r(t),t)}function UA(t,e,n){if(!Le(t))return[!1];let r,o;typeof t.tracesSampler=="function"?(o=t.tracesSampler({...e,inheritOrSampleWith:s=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):s}),r=!0):e.parentSampled!==void 0?o=e.parentSampled:typeof t.tracesSampleRate<"u"&&(o=t.tracesSampleRate,r=!0);let i=Rr(o);if(i===void 0)return $&&w.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 $&&w.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];let a=n<i;return a||$&&w.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[a,i,r]}var _f="__SENTRY_SUPPRESS_TRACING__";function nn(t,e){let n=Vs();if(n.startSpan)return n.startSpan(t,e);let r=V0(t),{forceTransaction:o,parentSpan:i,scope:a}=t,s=a?.clone();return De(s,()=>PA(i)(()=>{let c=it(),d=Y0(c,i),u=z(),f=t.onlyIfParent&&!d?j0(c,u):q0({parentSpan:d,spanArguments:r,forceTransaction:o,scope:c});return(!zA(f)||!d)&&Zn(c,f),yf(()=>e(f),()=>{let{status:m}=rt(f);f.isRecording()&&(!m||m==="ok")&&f.setStatus({code:2,message:"internal_error"})},()=>{f.end()})}))}function qn(t,e){let n=Vs();if(n.startSpanManual)return n.startSpanManual(t,e);let r=V0(t),{forceTransaction:o,parentSpan:i,scope:a}=t,s=a?.clone();return De(s,()=>PA(i)(()=>{let c=it(),d=Y0(c,i),p=t.onlyIfParent&&!d?j0(c,z()):q0({parentSpan:d,spanArguments:r,forceTransaction:o,scope:c});return(!zA(p)||!d)&&Zn(c,p),yf(()=>e(p,()=>p.end()),()=>{let{status:f}=rt(p);p.isRecording()&&(!f||f==="ok")&&p.setStatus({code:2,message:"internal_error"})})}))}function Ae(t){let e=Vs();if(e.startInactiveSpan)return e.startInactiveSpan(t);let n=V0(t),{forceTransaction:r,parentSpan:o}=t;return(t.scope?a=>De(t.scope,a):o!==void 0?a=>Jr(o,a):a=>a())(()=>{let a=it(),s=Y0(a,o),l=z();return t.onlyIfParent&&!s?j0(a,l):q0({parentSpan:s,spanArguments:n,forceTransaction:r,scope:a})})}var zg=(t,e)=>{let n=Jn(),r=Xr(n);if(r.continueTrace)return r.continueTrace(t,e);let{sentryTrace:o,baggage:i}=t,a=z(),s=xc(i);return a&&!P0(a,s?.org_id)?Sf(e):De(l=>{let c=sf(o,i);return l.setPropagationContext(c),Zn(l,void 0),e()})};function Jr(t,e){let n=Vs();return n.withActiveSpan?n.withActiveSpan(t,e):De(r=>(Zn(r,t||void 0),e(r)))}function Nc(t){let e=Vs();return e.suppressTracing?e.suppressTracing(t):De(n=>{n.setSDKProcessingMetadata({[_f]:!0});let r=t();return n.setSDKProcessingMetadata({[_f]:void 0}),r})}function vf(t=it()){let e=Vs();return e.isTracingSuppressed?e.isTracingSuppressed(t):t.getScopeData().sdkProcessingMetadata[_f]===!0}function Sf(t){let e=Vs();return e.startNewTrace?e.startNewTrace(t):De(n=>(n.setPropagationContext({traceId:Cn(),sampleRand:ar()}),$&&w.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),Jr(null,t)))}function j0(t,e){e?.recordDroppedEvent("no_parent_span","span");let n=new ur({traceId:t.getPropagationContext().traceId});return Na(n,t,Pt()),n}function q0({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){let o=Pt();if(!Le()){let s={...o.getPropagationContext(),...r.getPropagationContext()},l=t?t.spanContext().traceId:s.traceId,c=new ur({traceId:l});return t&&!n&&Ic(t,c),Na(c,r,o),c}let i=z();if(HB(i,e)){vf(r)||i?.recordDroppedEvent("ignored","span");let s=new ur({dropReason:"ignored",traceId:t?.spanContext().traceId??r.getPropagationContext().traceId});return Na(s,r,o),s}let a;if(t&&!n)a=FB(t,r,e,o),Ic(t,a);else if(t){let s=je(t),{traceId:l,spanId:c}=t.spanContext(),d=Tn(t);a=BA({traceId:l,parentSpanId:c,...e},r,o,d),G0(a,s)}else{let{traceId:s,dsc:l,parentSpanId:c,sampled:d}={...o.getPropagationContext(),...r.getPropagationContext()};a=BA({traceId:s,parentSpanId:c,...e},r,o,d),l&&G0(a,l)}return CA(a),a}function V0(t){let n={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){let r={...n};return r.startTimestamp=cr(t.startTime),delete r.startTime,r}return n}function Vs(){let t=Jn();return Xr(t)}function BA(t,e,n,r){let o=z(),i=o?.getOptions()||{},{name:a=""}=t,s={spanAttributes:{...t.attributes},spanName:a,parentSampled:r};o?.emit("beforeSampling",s,{decision:!1});let l=s.parentSampled??r,c=s.spanAttributes,d=e.getPropagationContext(),u=vf(e),[p,f,m]=u?[!1]:UA(i,{name:a,parentSampled:l,attributes:c,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:Rr(d.dsc?.sample_rate)},d.sampleRand),_=new Ma({...t,attributes:{[Ot]:"custom",[ni]:f!==void 0&&m?f:void 0,...c},sampled:p});return!p&&o&&!u&&($&&w.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),o.recordDroppedEvent("sample_rate",qe(o)?"span":"transaction")),Na(_,e,n),o&&o.emit("spanStart",_),_}function FB(t,e,n,r){let{spanId:o,traceId:i}=t.spanContext(),a=vf(e),s=a?!1:Tn(t),l=s?new Ma({...n,parentSpanId:o,traceId:i,sampled:s}):new ur({traceId:i});Ic(t,l),Na(l,e,r);let c=z();return c&&(qe(c)&&ai(l)&&(ai(t)&&t.dropReason?(l.dropReason=t.dropReason,c.recordDroppedEvent(t.dropReason,"span")):a||(l.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span"))),c.emit("spanStart",l),n.endTimestamp&&(c.emit("spanEnd",l),c.emit("afterSpanEnd",l))),l}function Y0(t,e){if(e)return e;if(e===null)return;let n=Uo(t);if(!n)return;let r=z();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Bt(n):n}function PA(t){return t!==void 0?e=>Jr(t,e):e=>e()}function HB(t,e){let n=t?.getOptions().ignoreSpans;return!t||!qe(t)||!n?.length?!1:Ui({description:e.name||"",op:e.attributes?.[ht]||e.op,attributes:e.attributes},n)}function zA(t){return ai(t)&&t.dropReason==="ignored"}var Cc={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},GB="heartbeatFailed",$B="idleTimeout",jB="finalTimeout",qB="externalFinish";function Fg(t,e={}){let n=new Map,r=!1,o,i=qB,a=!e.disableAutoFinish,s=[],{idleTimeout:l=Cc.idleTimeout,finalTimeout:c=Cc.finalTimeout,childSpanTimeout:d=Cc.childSpanTimeout,beforeSpanEnd:u,trimIdleSpanEndTimestamp:p=!0}=e,f=z(),m=it();if(!f||!Le()){let k=new ur({traceId:m.getPropagationContext().traceId});return Na(k,m,Pt()),k}let _=Dt(),v=VB(t);v.end=new Proxy(v.end,{apply(k,L,F){if(u&&u(v),ai(L))return;let[U,...D]=F,N=U||Mt(),B=cr(N),Y=ii(v).filter(H=>H!==v),st=rt(v);if(!Y.length||!p)return C(B),Reflect.apply(k,L,[B,...D]);let ot=f.getOptions().ignoreSpans,lt=Y?.reduce((H,gt)=>{let J=rt(gt);return!J.timestamp||ot&&Ui({description:J.description,op:J.op,attributes:J.data},ot)?H:H?Math.max(H,J.timestamp):J.timestamp},void 0),X=st.start_timestamp,ct=Math.min(X?X+c/1e3:1/0,Math.max(X||-1/0,Math.min(B,lt||1/0)));return C(ct),Reflect.apply(k,L,[ct,...D])}});function h(){o&&(clearTimeout(o),o=void 0)}function y(k){h(),o=setTimeout(()=>{!r&&n.size===0&&a&&(i=$B,v.end(k))},l)}function S(k){o=setTimeout(()=>{!r&&a&&(i=GB,v.end(k))},d)}function E(k){h(),n.set(k,!0);let L=Mt();S(L+d/1e3)}function R(k){if(n.has(k)&&n.delete(k),n.size===0){let L=Mt();y(L+l/1e3)}}function C(k){r=!0,n.clear(),s.forEach(Y=>Y()),Zn(m,_);let L=rt(v),{start_timestamp:F}=L;if(!F)return;L.data[Li]||v.setAttribute(Li,i);let D=L.status;(!D||D==="unknown")&&v.setStatus({code:1}),w.log(`[Tracing] Idle span "${L.op}" finished`);let N=ii(v).filter(Y=>Y!==v),B=0;N.forEach(Y=>{Y.isRecording()&&(Y.setStatus({code:2,message:"cancelled"}),Y.end(k),$&&w.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Y,void 0,2)));let st=rt(Y),{timestamp:ot=0,start_timestamp:lt=0}=st,X=lt<=k,ct=(c+l)/1e3,H=ot-lt<=ct;if($){let gt=JSON.stringify(Y,void 0,2);X?H||w.log("[Tracing] Discarding span since it finished after idle span final timeout",gt):w.log("[Tracing] Discarding span since it happened after idle span was finished",gt)}(!H||!X)&&(SA(v,Y),B++)}),B>0&&v.setAttribute("sentry.idle_span_discarded_spans",B)}return s.push(f.on("spanStart",k=>{if(r||k===v||rt(k).timestamp||k instanceof Ma&&k.isStandaloneSpan())return;ii(v).includes(k)&&E(k.spanContext().spanId)})),s.push(f.on("spanEnd",k=>{r||R(k.spanContext().spanId)})),s.push(f.on("idleSpanEnableAutoFinish",k=>{k===v&&(a=!0,y(),n.size&&S())})),e.disableAutoFinish||y(),setTimeout(()=>{r||(v.setStatus({code:2,message:"deadline_exceeded"}),i=jB,v.end())},c),v}function VB(t){let e=Ae(t);return Zn(it(),e),$&&w.log("[Tracing] Started span is an idle span"),e}var YB=["addListener","on","once","prependListener","prependOnceListener","addEventListener"],WB=["removeListener","off","removeEventListener"],FA=Symbol("SentryScopeBoundListeners"),Mc;function KB(t){return Mc!==void 0&&(t===Mc||t.listener===Mc)}function W0(t,e=it()){let n=t;if(Hg(n))return t;K0(n);for(let r of YB)typeof n[r]=="function"&&(n[r]=JB(n,n[r],e));for(let r of WB)typeof n[r]=="function"&&(n[r]=QB(n,n[r]));return typeof n.removeAllListeners=="function"&&(n.removeAllListeners=ZB(n,n.removeAllListeners)),t}function XB(t,e){return function(...n){return De(e,()=>t.apply(this,n))}}function HA(t){return typeof t=="function"}function JB(t,e,n){return function(...r){let o=r[0],i=r[1],a=r.slice(2);if(!HA(i)||KB(i))return e.apply(this,r);let s=Hg(t)||K0(t),l=s.get(o);l||(l=new WeakMap,s.set(o,l));let c=l.get(i);c||(c=XB(i,n),l.set(i,c));let d=Mc;Mc=c;try{return e.call(this,o,c,...a)}finally{Mc=d}}}function QB(t,e){return function(...n){let r=n[0],o=n[1],i=n.slice(2),a=HA(o)?Hg(t)?.get(r)?.get(o):void 0;return a?e.call(this,r,a,...i):e.apply(this,n)}}function ZB(t,e){return function(...n){let r=Hg(t);if(r)if(n.length===0)K0(t);else{let o=n[0];r.delete(o)}return e.apply(this,n)}}function K0(t){let e=new Map;return t[FA]=e,e}function Hg(t){return t[FA]}function $A(t,e){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=e;t4(t,e),r&&r4(t,r),o4(t,n),e4(t,o),n4(t,i)}function GA(t,e){let{extra:n,tags:r,attributes:o,user:i,contexts:a,level:s,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:d,eventProcessors:u,attachments:p,propagationContext:f,transactionName:m,span:_}=e;Ef(t,"extra",n),Ef(t,"tags",r),Ef(t,"attributes",o),Ef(t,"user",i),Ef(t,"contexts",a),t.sdkProcessingMetadata=Ra(t.sdkProcessingMetadata,l,2),s&&(t.level=s),m&&(t.transactionName=m),_&&(t.span=_),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),d.length&&(t.fingerprint=[...t.fingerprint,...d]),u.length&&(t.eventProcessors=[...t.eventProcessors,...u]),p.length&&(t.attachments=[...t.attachments,...p]),t.propagationContext={...t.propagationContext,...f}}function Ef(t,e,n){t[e]=Ra(t[e],n,1)}function si(t,e){let n=lr().getScopeData();return t&&GA(n,t.getScopeData()),e&&GA(n,e.getScopeData()),n}function t4(t,e){let{extra:n,tags:r,user:o,contexts:i,level:a,transactionName:s}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(o).length&&(t.user={...o,...t.user}),Object.keys(i).length&&(t.contexts={...i,...t.contexts}),a&&(t.level=a),s&&t.type!=="transaction"&&(t.transaction=s)}function e4(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function n4(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function r4(t,e){t.contexts={trace:Ac(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:je(e),...t.sdkProcessingMetadata};let n=Bt(e),r=rt(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function o4(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}function jA(t){let e={},{response:n,profile:r,cloud_resource:o,culture:i,state:a}=t;if(n&&(n.status_code!=null&&(e["http.response.status_code"]=n.status_code),n.body_size!=null&&(e["http.response.body.size"]=n.body_size)),r&&(r.profile_id&&(e["sentry.profile_id"]=r.profile_id),r.profiler_id&&(e["sentry.profiler_id"]=r.profiler_id)),o)for(let[c,d]of Object.entries(o))d!=null&&(e[c]=d);i&&(i.locale&&(e["culture.locale"]=i.locale),i.timezone&&(e["culture.timezone"]=i.timezone)),a?.state&&typeof a.state.type=="string"&&(e["state.type"]=a.state.type);let s=t.angular;if(s){let c=s.version;(typeof c=="string"||typeof c=="number")&&(e["angular.version"]=c)}let l=t.react;if(l){let c=l.version;(typeof c=="string"||typeof c=="number")&&(e["react.version"]=c)}return e}function Gg(t,e){let n=Ca(t),r=Gs(t),o=Ca(r),{isolationScope:i,scope:a}=oi(t),s=si(i,a);s4(n,o,e,s);let l=t.kind;e.emit("preprocessSpan",n,{spanKind:l}),n.is_segment&&(i4(n,s),a4(n,e),e.emit("processSegmentSpan",n)),e.emit("processSpan",n);let{beforeSendSpan:c}=e.getOptions(),d=c&&Pi(c)?l4(n,c):n,u=d.attributes?.[Ot];return u&&Nr(d,{"sentry.span.source":u}),{...Ng(d),_segmentSpan:r}}function i4(t,e){let n=jA(e.contexts);Nr(t,n)}function Nr(t,e){let n=t.attributes??(t.attributes={});Object.entries(e).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}function a4(t,e){let n=e.getIntegrationNames();n.length&&Nr(t,{[hg]:n})}function s4(t,e,n,r){let o=n.getSdkMetadata(),{release:i,environment:a}=n.getOptions();Nr(t,{[ug]:i,[dg]:a||zo,[fg]:e.name,[pg]:e.span_id,[mg]:o?.sdk?.name,[gg]:o?.sdk?.version,[bg]:r.user?.id,[yg]:r.user?.email,[_g]:r.user?.ip_address,[vg]:r.user?.username,...r.attributes})}function l4(t,e){let n=e(t);return n||($s(),t)}var X0=0,qA=1,VA=2;function li(t){return new Tf(e=>{e(t)})}function Ys(t){return new Tf((e,n)=>{n(t)})}var Tf=class t{constructor(e){this._state=X0,this._handlers=[],this._runExecutor(e)}then(e,n){return new t((r,o)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(a){o(a)}},i=>{if(!n)o(i);else try{r(n(i))}catch(a){o(a)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let o,i;return this.then(a=>{i=!1,o=a,e&&e()},a=>{i=!0,o=a,e&&e()}).then(()=>{if(i){r(o);return}n(o)})})}_executeHandlers(){if(this._state===X0)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===qA&&n[1](this._value),this._state===VA&&n[2](this._value),n[0]=!0)})}_runExecutor(e){let n=(i,a)=>{if(this._state===X0){if(Nn(a)){a.then(r,o);return}this._state=i,this._value=a,this._executeHandlers()}},r=i=>{n(qA,i)},o=i=>{n(VA,i)};try{e(r,o)}catch(i){o(i)}}};function YA(t,e,n,r=0){try{let o=J0(e,n,t,r);return Nn(o)?o:li(o)}catch(o){return Ys(o)}}function J0(t,e,n,r){let o=n[r];if(!t||!o)return t;let i=o({...t},e);return $&&i===null&&w.log(`Event processor "${o.id||"?"}" dropped event`),Nn(i)?i.then(a=>J0(a,e,n,r+1)):J0(i,e,n,r+1)}var Ws,WA,KA,Oa;function $g(t){let e=nt._sentryDebugIds,n=nt._debugIds;if(!e&&!n)return{};let r=e?Object.keys(e):[],o=n?Object.keys(n):[];if(Oa&&r.length===WA&&o.length===KA)return Oa;WA=r.length,KA=o.length,Oa={},Ws||(Ws={});let i=(a,s)=>{for(let l of a){let c=s[l],d=Ws?.[l];if(d&&Oa&&c)Oa[d[0]]=c,Ws&&(Ws[l]=[d[0],c]);else if(c){let u=t(l);for(let p=u.length-1;p>=0;p--){let m=u[p]?.filename;if(m&&Oa&&Ws){Oa[m]=c,Ws[l]=[m,c];break}}}}};return e&&i(r,e),n&&i(o,n),Oa}function Q0(t,e){let n=$g(t);if(!n)return[];let r=[];for(let o of e){let i=F1(o);i&&n[i]&&r.push({type:"sourcemap",code_file:o,debug_id:n[i]})}return r}function wf(t,e,n,r,o,i){let{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=t,l={...e,event_id:e.event_id||n.event_id||ae(),timestamp:e.timestamp||sr()},c=n.integrations||t.integrations.map(h=>h.name);c4(l,t),f4(l,c),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&u4(l,t.stackParser);let d=m4(r,n.captureContext);n.mechanism&&En(l,n.mechanism);let u=o?o.getEventProcessors():[],p=si(i,d),f=[...n.attachments||[],...p.attachments];f.length&&(n.attachments=f),$A(l,p);let m=[...u,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?li(l):YA(m,l,n)).then(h=>(h&&d4(h),typeof a=="number"&&a>0?p4(h,a,s):h))}function c4(t,e){let{environment:n,release:r,dist:o,maxValueLength:i}=e;t.environment=t.environment||n||zo,!t.release&&r&&(t.release=r),!t.dist&&o&&(t.dist=o);let a=t.request;a?.url&&i&&(a.url=Do(a.url,i)),i&&t.exception?.values?.forEach(s=>{s.value&&(s.value=Do(s.value,i))})}function u4(t,e){let n=$g(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function d4(t){let e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.entries(e).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function f4(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function p4(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:ue(o.data,e,n)}}))},...t.user&&{user:ue(t.user,e,n)},...t.contexts&&{contexts:ue(t.contexts,e,n)},...t.extra&&{extra:ue(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=ue(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>({...o,...o.data&&{data:ue(o.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=ue(t.contexts.flags,3,n)),r}function m4(t,e){if(!e)return t;let n=t?t.clone():new $n;return n.update(e),n}function XA(t){if(t)return g4(t)?{captureContext:t}:b4(t)?{captureContext:t}:t}function g4(t){return t instanceof $n||typeof t=="function"}var h4=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function b4(t){return Object.keys(t).some(e=>h4.includes(e))}function Et(t,e){return it().captureException(t,XA(e))}function Da(t,e){let n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return it().captureMessage(t,n,r)}function Qr(t,e){return it().captureEvent(t,e)}function La(t,e){Pt().setContext(t,e)}function jg(t){Pt().setExtras(t)}function qg(t,e){Pt().setExtra(t,e)}function Vg(t){Pt().setTags(t)}function Oc(t,e){Pt().setTag(t,e)}function Yg(t){Pt().setAttributes(t)}function Wg(t,e){Pt().setAttribute(t,e)}function Kg(t){Pt().setUser(t)}function Xg(t){Pt().setConversationId(t)}function Dc(){return Pt().lastEventId()}async function Jg(t){let e=z();return e?e.flush(t):($&&w.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Qg(t){let e=z();return e?e.close(t):($&&w.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function Zg(){return!!z()}function Lc(){let t=z();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function Uc(t){Pt().addEventProcessor(t)}function Ks(t){let e=Pt(),{user:n}=si(e,it()),{userAgent:r}=nt.navigator||{},o=J1({user:n,...r&&{userAgent:r},...t}),i=e.getSession();return i?.status==="ok"&&Oi(i,{status:"exited"}),Bc(),e.setSession(o),o}function Bc(){let t=Pt(),n=it().getSession()||t.getSession();n&&Q1(n),JA(),t.setSession()}function JA(){let t=Pt(),e=z(),n=t.getSession();n&&e&&e.captureSession(n)}function Ua(t=!1){if(t){Bc();return}JA()}function Ba(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}var QA="7";function ZA(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function y4(t){return`${ZA(t)}${t.projectId}/envelope/`}function _4(t,e){let n={sentry_version:QA};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function xf(t,e,n){return e||`${y4(t)}?${_4(t,n)}`}function Z0(t,e){let n=af(t);if(!n)return"";let r=`${ZA(n)}embed/error-page/`,o=`dsn=${en(n)}`;for(let i in e)if(i!=="dsn"&&i!=="onClose")if(i==="user"){let a=e.user;if(!a)continue;a.name&&(o+=`&name=${encodeURIComponent(a.name)}`),a.email&&(o+=`&email=${encodeURIComponent(a.email)}`)}else o+=`&${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`;return`${r}?${o}`}var th=[];function v4(t){let e={};return t.forEach(n=>{let{name:r}=n,o=e[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function eh(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){let o=n(e);r=Array.isArray(o)?o:[o]}else r=e;return v4(r)}function tk(t,e){let n={};return e.forEach(r=>{r?.beforeSetup&&r.beforeSetup(t)}),e.forEach(r=>{r&&ev(t,r,n)}),n}function tv(t,e){for(let n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function ev(t,e,n){if(n[e.name]){$&&w.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!th.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),th.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,i)=>r(o,i,t))}if(typeof e.processEvent=="function"){let r=e.processEvent.bind(e),o=Object.assign((i,a)=>r(i,a,t),{id:e.name});t.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=e[r];typeof o=="function"&&t.on(r,i=>o.call(e,i,t))}),$&&w.log(`Integration installed: ${e.name}`)}function Xs(t){let e=z();if(!e){$&&w.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`);return}e.addIntegration(t)}var S4="sentry.timestamp.sequence",nv=0,rv;function nh(t){let e=Math.floor(t*1e3);rv!==void 0&&e!==rv&&(nv=0);let n=nv;return nv++,rv=e,{key:S4,value:{value:n,type:"integer"}}}function rh(t,e){return e?De(e,()=>{let n=Dt(),r=n?Ac(n):Ec(e);return[n?je(n):Bi(t,e),r]}):[void 0,void 0]}var ek={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function ov(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function iv(){return"npm"}function nk(){return!ov()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Vn(){return typeof window<"u"&&(!nk()||E4())}function E4(){return nt.process?.type==="renderer"}function T4(t,e){let n=e?"auto":"never";return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function rk(t,e,n,r,o){let i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=en(r)),Ue(i,[T4(t,o)])}var w4=100;function ci(t,e,n,r=!0){n&&(!t[e]||r)&&(t[e]=n)}function ok(t,e){let n=sv(),r=ik(t);r===void 0?n.set(t,[e]):r.length>=w4?(Js(t,r),n.set(t,[e])):n.set(t,[...r,e])}function Pa(t,e=it(),n=ok){let r=e?.getClient()??z();if(!r){$&&w.warn("No client available to capture log.");return}let{release:o,environment:i,enableLogs:a=!1,beforeSendLog:s}=r.getOptions();if(!a){$&&w.warn("logging option not enabled, log will not be captured.");return}let[,l]=rh(r,e),c={...t.attributes},{user:{id:d,email:u,username:p},attributes:f={}}=si(Pt(),e);ci(c,"user.id",d,!1),ci(c,"user.email",u,!1),ci(c,"user.name",p,!1),ci(c,"sentry.release",o),ci(c,"sentry.environment",i);let{name:m,version:_}=r.getSdkMetadata()?.sdk??{};ci(c,"sentry.sdk.name",m),ci(c,"sentry.sdk.version",_);let v=r.getIntegrationByName("Replay"),h=v?.getReplayId(!0);ci(c,"sentry.replay_id",h),h&&v?.getRecordingMode()==="buffer"&&ci(c,"sentry._internal.replay_is_buffering",!0);let y=t.message;if(ei(y)){let{__sentry_template_string__:B,__sentry_template_values__:Y=[]}=y;Y?.length&&(c["sentry.message.template"]=B),Y.forEach((st,ot)=>{c[`sentry.message.parameter.${ot}`]=st})}let S=Uo(e);ci(c,"sentry.trace.parent_span_id",S?.spanContext().spanId);let E={...t,attributes:c};r.emit("beforeCaptureLog",E);let R=s?pn(()=>s(E)):E;if(!R){r.recordDroppedEvent("before_send","log_item",1),$&&w.warn("beforeSendLog returned null, log will not be captured.");return}let{level:C,message:k,attributes:L={},severityNumber:F}=R,U=Mt(),D=nh(U),N={timestamp:U,level:C,body:av(String(k)),trace_id:l?.trace_id,severity_number:F??ek[C],attributes:x4({...Di(f),...Di(L,!0),[D.key]:D.value})};n(r,N),r.emit("afterCaptureLog",R)}function Js(t,e){let n=e??ik(t)??[];if(n.length===0)return;let r=t.getOptions(),o=rk(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);sv().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(o)}function ik(t){return sv().get(t)}function sv(){return Mo("clientToLogBufferMap",()=>new WeakMap)}function x4(t){let e={};for(let[n,r]of Object.entries(t)){let o=av(n);r.type==="string"?e[o]={...r,value:av(r.value)}:e[o]=r}return e}function av(t){let e=Object(t),n=e.isWellFormed,r=e.toWellFormed;return typeof n=="function"&&typeof r=="function"?n.call(t)?t:r.call(t):t}function A4(t,e){let n=e?"auto":"never";return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function ak(t,e,n,r,o){let i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=en(r)),Ue(i,[A4(t,o)])}var k4=1e3;function Fi(t,e,n,r=!0){n&&(r||!(e in t))&&(t[e]=n)}function sk(t,e){let n=cv(),r=lk(t);r===void 0?n.set(t,[e]):r.length>=k4?(Pc(t,r),n.set(t,[e])):n.set(t,[...r,e])}function I4(t,e,n){let{release:r,environment:o}=e.getOptions(),i={...t.attributes};Fi(i,"user.id",n.id,!1),Fi(i,"user.email",n.email,!1),Fi(i,"user.name",n.username,!1),Fi(i,"sentry.release",r),Fi(i,"sentry.environment",o);let{name:a,version:s}=e.getSdkMetadata()?.sdk??{};Fi(i,"sentry.sdk.name",a),Fi(i,"sentry.sdk.version",s);let l=e.getIntegrationByName("Replay"),c=l?.getReplayId(!0);return Fi(i,"sentry.replay_id",c),c&&l?.getRecordingMode()==="buffer"&&Fi(i,"sentry._internal.replay_is_buffering",!0),{...t,attributes:i}}function R4(t,e,n,r){let[,o]=rh(e,n),i=Uo(n),a=i?i.spanContext().traceId:o?.trace_id,s=i?i.spanContext().spanId:void 0,l=Mt(),c=nh(l);return{timestamp:l,trace_id:a??"",span_id:s,name:t.name,type:t.type,unit:t.unit,value:t.value,attributes:{...Di(r),...Di(t.attributes,"skip-undefined"),[c.key]:c.value}}}function lv(t,e){let n=e?.scope??it(),r=e?.captureSerializedMetric??sk,o=n?.getClient()??z();if(!o){$&&w.warn("No client available to capture metric.");return}let{_experiments:i,enableMetrics:a,beforeSendMetric:s}=o.getOptions();if(!(a??i?.enableMetrics??!0)){$&&w.warn("metrics option not enabled, metric will not be captured.");return}let{user:c,attributes:d}=si(Pt(),n),u=I4(t,o,c);o.emit("processMetric",u);let p=s||i?.beforeSendMetric,f=p?p(u):u;if(!f){$&&w.log("`beforeSendMetric` returned `null`, will not send metric.");return}let m=R4(f,o,n,d);$&&w.log("[Metric]",m),r(o,m),o.emit("afterCaptureMetric",f)}function Pc(t,e){let n=e??lk(t)??[];if(n.length===0)return;let r=t.getOptions(),o=ak(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);cv().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(o)}function lk(t){return cv().get(t)}function cv(){return Mo("clientToMetricBufferMap",()=>new WeakMap)}function ck(t){let e={trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,name:t.description||"",start_timestamp:t.start_timestamp,end_timestamp:t.timestamp||t.start_timestamp,status:!t.status||t.status==="ok"||t.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...t.data},links:t.links};return Ng(e)}function uk(t,e){if(t.type!=="transaction"||!t.spans?.length||!t.sdkProcessingMetadata?.hasGenAiSpans||e.getOptions().streamGenAiSpans===!1||qe(e))return;let n=[],r=[];for(let i of t.spans)i.op?.startsWith("gen_ai.")?n.push(ck(i)):r.push(i);if(n.length===0)return;t.spans=r;let o=e.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}var zc=Symbol.for("SentryBufferFullError");function Qs(t=100){let e=new Set;function n(){return e.size<t}function r(a){e.delete(a)}function o(a){if(!n())return Ys(zc);let s=a();return e.add(s),s.then(()=>r(s),()=>r(s)),s}function i(a){if(!e.size)return li(!0);let s=Promise.allSettled(Array.from(e)).then(()=>!0);if(!a)return s;let l=[s,new Promise(c=>Ba(setTimeout(()=>c(!1),a)))];return Promise.race(l)}return{get $(){return Array.from(e)},add:o,drain:i}}var dk=60*1e3;function oh(t,e=Hn()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?dk:r-e}function fk(t,e){return t[e]||t.all||0}function Af(t,e,n=Hn()){return fk(t,e)>n}function kf(t,{statusCode:e,headers:n},r=Hn()){let o={...t},i=n?.["x-sentry-rate-limits"],a=n?.["retry-after"];if(i)for(let s of i.trim().split(",")){let[l,c,,,d]=s.split(":",5),u=parseInt(l,10),p=(isNaN(u)?60:u)*1e3;if(!c)o.all=r+p;else for(let f of c.split(";"))f==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[f]=r+p):o[f]=r+p}else a?o.all=r+oh(a,r):e===429&&(o.all=r+60*1e3);return o}var uv=64;function If(t,e,n=Qs(t.bufferSize||uv)){let r={},o=a=>n.drain(a);function i(a){let s=[];if(dr(a,(u,p)=>{let f=hf(p);Af(r,f)?t.recordDroppedEvent("ratelimit_backoff",f):s.push(u)}),s.length===0)return Promise.resolve({});let l=Ue(a[0],s),c=u=>{if(js(l,["client_report"])){$&&w.warn(`Dropping client report. Will not send outcomes (reason: ${u}).`);return}dr(l,(p,f)=>{t.recordDroppedEvent(u,hf(f))})},d=()=>e({body:zi(l)}).then(u=>u.statusCode===413?($&&w.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),u):($&&u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&w.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),r=kf(r,u),u),u=>{throw c("network_error"),$&&w.error("Encountered error running transport request:",u),u});return n.add(d).then(u=>u,u=>{if(u===zc)return $&&w.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw u})}return{send:i,flush:o}}function pk(t,e,n){let r=[{type:"client_report"},{timestamp:n||sr(),discarded_events:t}];return Ue(e?{dsn:e}:{},[r])}function ih(t){let e=[];t.message&&e.push(t.message);try{let n=t.exception.values[t.exception.values.length-1];n?.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function mk(t){let{trace_id:e,parent_span_id:n,span_id:r,status:o,origin:i,data:a,op:s}=t.contexts?.trace??{};return{data:a??{},description:t.transaction,op:s,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:o,timestamp:t.timestamp,trace_id:e??"",origin:i,profile_id:a?.[Fs],exclusive_time:a?.[jn],measurements:t.measurements,is_segment:!0}}function gk(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[Fs]:t.profile_id},...t.exclusive_time&&{[jn]:t.exclusive_time}}}},measurements:t.measurements}}var Zs="[Filtered]",Rf=["forwarded","-ip","remote-","via","-user"],dv=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],hk=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function bk(t){return t===!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:7}:{userInfo:!1,cookies:{deny:Rf},httpHeaders:{request:{deny:Rf},response:{deny:Rf}},httpBodies:[],queryParams:{deny:Rf},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:7}}var N4={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};function yk(t){let e=t.dataCollection!=null?N4:bk(t.sendDefaultPii),n=t.dataCollection??{};return{userInfo:n.userInfo??e.userInfo,cookies:n.cookies??e.cookies,httpHeaders:{request:n.httpHeaders?.request??e.httpHeaders.request,response:n.httpHeaders?.response??e.httpHeaders.response},httpBodies:n.httpBodies??e.httpBodies,queryParams:n.queryParams??e.queryParams,genAI:{inputs:n.genAI?.inputs??e.genAI.inputs,outputs:n.genAI?.outputs??e.genAI.outputs},stackFrameVariables:n.stackFrameVariables??e.stackFrameVariables,frameContextLines:n.frameContextLines??e.frameContextLines}}var _k="Not capturing exception because it's already been captured.",vk="Discarded session because of missing or non-string release",Ak=Symbol.for("SentryInternalError"),kk=Symbol.for("SentryDoNotSendEventError"),C4=5e3;function ah(t){return{message:t,[Ak]:!0}}function fv(t){return{message:t,[kk]:!0}}function Sk(t){return!!t&&typeof t=="object"&&Ak in t}function Ek(t){return!!t&&typeof t=="object"&&kk in t}function Tk(t,e,n,r,o){let i=0,a,s=!1;t.on(n,()=>{i=0,clearTimeout(a),s=!1}),t.on(e,l=>{if(i+=r(l),i>=8e5)o(t);else if(!s){let c=t.getOptions()._flushInterval??C4;c>0&&(s=!0,a=Ba(setTimeout(()=>{o(t)},c)))}}),t.on("flush",()=>{o(t)})}var Nf=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Qs(e.transportOptions?.bufferSize??uv),this._dataCollection=yk(e),e.dsn?this._dsn=af(e.dsn):$&&w.warn("No DSN provided, client will not send events."),this._dsn){let r=xf(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Tk(this,"afterCaptureLog","flushLogs",L4,Js),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Tk(this,"afterCaptureMetric","flushMetrics",D4,Pc)}captureException(e,n,r){let o=ae();if(nf(e))return $&&w.log(_k),o;let i={event_id:o,...n};return this._process(()=>this.eventFromException(e,i).then(a=>this._captureEvent(a,i,r)).then(a=>a),"error"),i.event_id}captureMessage(e,n,r,o){let i={event_id:ae(),...r},a=ei(e)?e:String(e),s=Ze(e),l=s?this.eventFromMessage(a,n,i):this.eventFromException(e,i);return this._process(()=>l.then(c=>this._captureEvent(c,i,o)),s?"unknown":"error"),i.event_id}captureEvent(e,n,r){let o=ae();if(n?.originalException&&nf(n.originalException))return $&&w.log(_k),o;let i={event_id:o,...n},a=e.sdkProcessingMetadata||{},s=a.capturedSpanScope,l=a.capturedSpanIsolationScope,c=wk(e.type);return this._process(()=>this._captureEvent(e,i,s||r,l),c),i.event_id}captureSession(e){this.sendSession(e),Oi(e,{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(e){let n=this._transport;if(this.emit("flush"),!n)return!0;let r=await this._isClientDoneProcessing(e),o=await n.flush(e);return r&&o}async close(e){Js(this);let n=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){let n=this._integrations[e.name];!n&&e.beforeSetup&&e.beforeSetup(this),ev(this,e,this._integrations),n||tv(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=uk(e,this),o=RA(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=gf(o,Pg(i));r&&(o=gf(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",e,i))}sendSession(e){let{release:n,environment:r=zo}=this._options;if("aggregates"in e){let i=e.attrs||{};if(!i.release&&!n){$&&w.warn(vk);return}i.release=i.release||n,i.environment=i.environment||r,e.attrs=i}else{if(!e.release&&!n){$&&w.warn(vk);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);let o=IA(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){let o=`${e}:${n}`;$&&w.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(e,n){let r=this._hooks[e]=this._hooks[e]||new Set,o=(...i)=>n(...i);return r.add(o),()=>{r.delete(o)}}emit(e,...n){let r=this._hooks[e];r&&r.forEach(o=>o(...n))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(n){return $&&w.error("Error while sending envelope:",n),{}}return $&&w.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=tk(this,e),tv(this,e)}_updateSessionFromEvent(e,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 a=e.status==="ok";(a&&e.errors===0||a&&r)&&(Oi(e,{...r&&{status:"crashed"},errors:e.errors||Number(o||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let n=0;for(;!e||n<e;){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(e,n,r,o){let i=this.getOptions(),a=this.getIntegrationNames();return!n.integrations&&a.length&&(n.integrations=a),this.emit("preprocessEvent",e,n),e.type||o.setLastEventId(e.event_id||n.event_id),wf(i,e,n,r,this,o).then(s=>{if(s===null)return s;this.emit("postprocessEvent",s,n),s.contexts={trace:{...s.contexts?.trace,...Ec(r)},...s.contexts};let l=Bi(this,r);return s.sdkProcessingMetadata={dynamicSamplingContext:l,...s.sdkProcessingMetadata},s})}_captureEvent(e,n={},r=it(),o=Pt()){return $&&pv(e)&&w.log(`Captured error event \`${ih(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,o).then(i=>i.event_id,i=>{$&&(Ek(i)?w.log(i.message):Sk(i)?w.warn(i.message):w.warn(i))})}_processEvent(e,n,r,o){let i=this.getOptions(),{sampleRate:a}=i,s=Ik(e),l=pv(e),d=`before send for type \`${e.type||"error"}\``,u=typeof a>"u"?void 0:Rr(a);if(l&&typeof u=="number"&&ar()>u)return this.recordDroppedEvent("sample_rate","error"),Ys(fv(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let p=wk(e.type);return this._prepareEvent(e,n,r,o).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",p),fv("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return f;let _=O4(this,i,f,n);return M4(_,d)}).then(f=>{if(f===null){if(this.recordDroppedEvent("before_send",p),s){let h=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",h)}throw fv(`${d} returned \`null\`, will not send event.`)}let m=r.getSession()||o.getSession();if(l&&m&&this._updateSessionFromEvent(m,f),s){let v=f.sdkProcessingMetadata?.spanCountBeforeProcessing||0,h=f.spans?f.spans.length:0,y=v-h;y>0&&this.recordDroppedEvent("before_send","span",y)}let _=f.transaction_info;if(s&&_&&f.transaction!==e.transaction){let v="custom";f.transaction_info={..._,source:v}}return this.sendEvent(f,n),f}).then(null,f=>{throw Ek(f)||Sk(f)?f:(this.captureException(f,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:f}),ah(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
18
|
+
Reason: ${f}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===zc&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[o,i]=n.split(":");return{reason:o,category:i,quantity:r}})}_flushOutcomes(){$&&w.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){$&&w.log("No outcomes to send");return}if(!this._dsn){$&&w.log("No dsn provided, will not send outcomes");return}$&&w.log("Sending outcomes:",e);let n=pk(e,this._options.tunnel&&en(this._dsn));this.sendEnvelope(n)}};function wk(t){return t==="replay_event"?"replay":t||"error"}function M4(t,e){let n=`${e} must return \`null\` or a valid event.`;if(Nn(t))return t.then(r=>{if(!he(r)&&r!==null)throw ah(n);return r},r=>{throw ah(`${e} rejected with ${r}`)});if(!he(t)&&t!==null)throw ah(n);return t}function O4(t,e,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:a}=e,s=!Pi(e.beforeSendSpan)&&e.beforeSendSpan,l=n;if(pv(l)&&o)return o(l,r);if(Ik(l)){if(s||a){let c=mk(l);if(a?.length&&Ui({description:c.description,op:c.op,attributes:c.data},a))return null;if(s){let d=s(c);d?l=Ra(n,gk(d)):$s()}if(l.spans){let d=[],u=l.spans;for(let f of u){if(a?.length&&Ui({description:f.description,op:f.op,attributes:f.data},a)){wA(u,f);continue}if(s){let m=s(f);m?d.push(m):($s(),d.push(f))}else d.push(f)}let p=l.spans.length-d.length;p&&t.recordDroppedEvent("before_send","span",p),l.spans=d}}if(i){if(l.spans){let c=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return i(l,r)}}return l}function pv(t){return t.type===void 0}function Ik(t){return t.type==="transaction"}function D4(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+Rk(t.attributes)}function L4(t){let e=0;return t.message&&(e+=t.message.length*2),e+Rk(t.attributes)}function Rk(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*xk(n[0]):Ze(n)?e+=xk(n):e+=100}),e}function xk(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function mv(t,e){e.debug===!0&&($?w.enable():pn(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),it().update(e.initialScope);let r=new t(e);return sh(r),r.init(),r}function sh(t){it().setClient(t)}var gv=100,hv=5e3,U4=36e5;function bv(t){function e(...n){$&&w.log("[Offline]:",...n)}return n=>{let r=t(n);if(!n.createStore)throw new Error("No `createStore` function was provided");let o=n.createStore(n),i=hv,a;function s(u,p,f){return js(u,["client_report"])?!1:n.shouldStore?n.shouldStore(u,p,f):!0}function l(u){a&&clearTimeout(a),a=Ba(setTimeout(async()=>{a=void 0;let p=await o.shift();p&&(e("Attempting to send previously queued event"),p[0].sent_at=new Date(Hn()).toISOString(),d(p,!0).catch(f=>{e("Failed to retry sending",f)}))},u))}function c(){a||(l(i),i=Math.min(i*2,U4))}async function d(u,p=!1){if(!p&&js(u,["replay_event","replay_recording"]))return await o.push(u),l(gv),{};try{if(n.shouldSend&&await n.shouldSend(u)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");let f=await r.send(u),m=gv;if(f){if(f.headers?.["retry-after"])m=oh(f.headers["retry-after"]);else if(f.headers?.["x-sentry-rate-limits"])m=6e4;else if((f.statusCode||0)>=400)return f}return l(m),i=hv,f}catch(f){if(await s(u,f,i))return p?await o.unshift(u):await o.push(u),c(),e("Error sending. Event queued.",f),{};throw f}}return n.flushAtStartup&&c(),{send:d,flush:u=>(u===void 0&&(i=hv,l(gv)),r.flush(u))}}}var Fc="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function Nk(t,e){let n;return dr(t,(r,o)=>(e.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function B4(t,e){return n=>{let r=t(n);return{...r,send:async o=>{let i=Nk(o,["event","transaction","profile","replay_event"]);return i&&(i.release=e),r.send(o)}}}}function P4(t,e){return Ue(e?{...t[0],dsn:e}:t[0],t[1])}function yv(t,e){return n=>{let r=t(n),o=new Map,i=e||(c=>{let d=c.getEvent();return d?.extra?.[Fc]&&Array.isArray(d.extra[Fc])?d.extra[Fc]:[]});function a(c,d){let u=d?`${c}:${d}`:c,p=o.get(u);if(!p){let f=Ag(c);if(!f)return;let m=xf(f,n.tunnel);p=d?B4(t,d)({...n,url:m}):t({...n,url:m}),o.set(u,p)}return[c,p]}async function s(c){function d(m){let _=m?.length?m:["event"];return Nk(c,_)}let u=i({envelope:c,getEvent:d}).map(m=>typeof m=="string"?a(m,void 0):a(m.dsn,m.release)).filter(m=>!!m),p=u.length?u:[["",r]];return(await Promise.all(p.map(([m,_])=>_.send(P4(c,m)))))[0]}async function l(c){let d=[...o.values(),r];return(await Promise.all(d.map(p=>p.flush(c)))).every(p=>p)}return{send:s,flush:l}}}function _v(t,e){return e.some(n=>t.includes(n))}function za(t,e,n){if(e===!1)return{};let r=n!=null?[...dv,...n]:dv,o={};if(e===!0){for(let a of Object.keys(t))o[a]=_v(a.toLowerCase(),r)?Zs:t[a];return o}if("deny"in e){let a=e.deny.map(s=>s.toLowerCase());for(let s of Object.keys(t)){let l=s.toLowerCase(),c=_v(l,r)||a.some(d=>l.includes(d));o[s]=c?Zs:t[s]}return o}let i=e.allow.map(a=>a.toLowerCase());for(let a of Object.keys(t)){let s=a.toLowerCase();if(_v(s,r))o[a]=Zs;else{let l=i.some(c=>s.includes(c));o[a]=l?t[a]:Zs}}return o}function Ck(t){let e={},n=0;for(;n<t.length;){let r=t.indexOf("=",n);if(r===-1)break;let o=t.indexOf(";",n);if(o===-1)o=t.length;else if(o<r){n=t.lastIndexOf(";",r-1)+1;continue}let i=t.slice(n,r).trim();if(e[i]===void 0){let a=t.slice(r+1,o).trim();a.charCodeAt(0)===34&&(a=a.slice(1,-1));try{e[i]=a.indexOf("%")!==-1?decodeURIComponent(a):a}catch{e[i]=a}}n=o+1}return e}function Cf(t,e){if(e===!1)return{};try{let n=Ck(t);return Object.keys(n).length===0?{}:za(n,e,hk)}catch{return Zs}}var z4="thismessage:/";function tl(t){return"isRelative"in t}function ui(t,e){let n=t.indexOf("://")<=0&&t.indexOf("//")!==0,r=e??(n?z4:void 0);try{if("canParse"in URL&&!URL.canParse(t,r))return;let o=new URL(t,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function Hc(t){if(tl(t))return t.pathname;let e=new URL(t);return e.search="",e.hash="",["80","443"].includes(e.port)&&(e.port=""),e.password&&(e.password="%filtered%"),e.username&&(e.username="%filtered%"),e.toString()}function Zr(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Gc(t){return t.split(/[?#]/,1)[0]}function Yn(t,e=!0){if(t.startsWith("data:")){let n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=t.includes(";base64,"),i=t.indexOf(","),a="";if(e&&i!==-1){let s=t.slice(i+1);a=s.length>10?`${s.slice(0,10)}... [truncated]`:s}return`data:${r}${o?",base64":""}${a?`,${a}`:""}`}return t}function $c(t,e){let n=e?.getDsn(),r=e?.getOptions().tunnel;return H4(t,n)||F4(t,r)}function F4(t,e){return e?Mk(t)===Mk(e):!1}function H4(t,e){let n=ui(t);return!n||tl(n)||!e?!1:G4(n.hostname,e.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function G4(t,e){return t===e||e.length>0&&t.endsWith(`.${e}`)}function Mk(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function lh(t,...e){let n=new String(String.raw(t,...e));return n.__sentry_template_string__=t.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=e,n}var vv=lh;function Sv(t){"aggregates"in t?t.attrs?.ip_address===void 0&&(t.attrs={...t.attrs,ip_address:"{{auto}}"}):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function Mf(t,e,n=[e],r="npm"){let o=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${e}`,o.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:ir})),o.version=ir)}function el(t={}){let e=t.client||z();if(!Lc()||!e)return{};let n=Jn(),r=Xr(n);if(r.getTraceData)return r.getTraceData(t);let o=t.scope||it(),i=t.span||Dt(),a=ai(i)&&!Le(e.getOptions());if(!i&&lg())return{};let s=i&&!a?kc(i):$4(o),l=i?je(i):Bi(e,o),c=xg(l);if(!Ig.test(s))return w.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let u={"sentry-trace":s,baggage:c};return t.propagateTraceparent&&(u.traceparent=i&&!a?bA(i):j4(o)),u}function $4(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return lf(e,r,n)}function j4(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return cf(e,r,n)}function Ev(t,e,n){let r,o,i,a=n?.maxWait?Math.max(n.maxWait,e):0,s=n?.setTimeoutImpl||setTimeout;function l(){return c(),r=t(),r}function c(){o!==void 0&&clearTimeout(o),i!==void 0&&clearTimeout(i),o=i=void 0}function d(){return o!==void 0||i!==void 0?l():r}function u(){return o&&clearTimeout(o),o=s(l,e),a&&i===void 0&&(i=s(l,a)),r}return u.cancel=c,u.flush=d,u}var q4=100;function wn(t,e){let n=z(),r=Pt();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=q4}=n.getOptions();if(i<=0)return;let s={timestamp:sr(),...t},l=o?pn(()=>o(s,e)):s;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,e),r.addBreadcrumb(l,i))}var Ok,V4="FunctionToString",Dk=new WeakMap,Y4=(()=>({name:V4,setupOnce(){Ok=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=Aa(this),n=Dk.has(z())&&e!==void 0?e:this;return Ok.apply(n,t)}}catch{}},setup(t){Dk.set(t,!0)}})),Of=Y4;var W4=[/^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$/],K4="EventFilters",uh=(t={})=>{let e;return{name:K4,setup(n){let r=n.getOptions();e=Lk(t,r)},processEvent(n,r,o){if(!e){let i=o.getOptions();e=Lk(t,i)}return X4(n,e)?null:n}}},Df=((t={})=>({...uh(t),name:"InboundFilters"}));function Lk(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:W4],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function X4(t,e){if(t.type){if(t.type==="transaction"&&Q4(t,e.ignoreTransactions))return $&&w.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
19
19
|
Event: ${Lo(t)}`),!0}else{if(J4(t,e.ignoreErrors))return $&&w.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
20
20
|
Event: ${Lo(t)}`),!0;if(nP(t))return $&&w.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
21
21
|
Event: ${Lo(t)}`),!0;if(Z4(t,e.denyUrls))return $&&w.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
22
22
|
Event: ${Lo(t)}.
|
|
23
23
|
Url: ${ch(t)}`),!0;if(!tP(t,e.allowUrls))return $&&w.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
24
24
|
Event: ${Lo(t)}.
|
|
25
|
-
Url: ${ch(t)}`),!0}return!1}function J4(t,e){return e?.length?ih(t).some(n=>tn(n,e)):!1}function Q4(t,e){if(!e?.length)return!1;let n=t.transaction;return n?tn(n,e):!1}function Z4(t,e){if(!e?.length)return!1;let n=ch(t);return n?tn(n,e):!1}function tP(t,e){if(!e?.length)return!0;let n=ch(t);return n?tn(n,e):!0}function eP(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function ch(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?eP(n):null}catch{return $&&w.error(`Cannot extract url for event ${Lo(t)}`),null}}function nP(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function wv(t,e,n,r,o,i){if(!o.exception?.values||!i||!Oo(i.originalException,Error))return;let a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=Tv(t,e,r,i.originalException,n,o.exception.values,a,0))}function Tv(t,e,n,r,o,i,a,s){if(i.length>=n+1)return i;let l=[...i];if(Oo(r[o],Error)){Uk(a,s,r);let c=t(e,r[o]),d=l.length;Bk(c,o,d,s),l=Tv(t,e,n,r[o],o,[c,...l],c,d)}return Pk(r)&&r.errors.forEach((c,d)=>{if(Oo(c,Error)){Uk(a,s,r);let u=t(e,c),p=l.length;Bk(u,`errors[${d}]`,p,s),l=Tv(t,e,n,c,o,[u,...l],u,p)}}),l}function Pk(t){return Array.isArray(t.errors)}function Uk(t,e,n){t.mechanism={handled:!0,type:"auto.core.linked_errors",...Pk(n)&&{is_exception_group:!0},...t.mechanism,exception_id:e}}function Bk(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function rP(t){return mn(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function dh(t){return rP(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}var Fk=new Map,zk=new Set;function oP(t){if(tt._sentryModuleMetadata)for(let e of Object.keys(tt._sentryModuleMetadata)){let n=tt._sentryModuleMetadata[e];if(zk.has(e))continue;zk.add(e);let r=t(e);for(let o of r.reverse())if(o.filename){Fk.set(o.filename,n);break}}}function iP(t,e){return oP(t),Fk.get(e)}function fh(t,e){e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(r=>{if(!r.filename||r.module_metadata)return;let o=iP(t,r.filename);o&&(r.module_metadata=o)})})}function ph(t){t.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(n=>{delete n.module_metadata})})}var xv=()=>({name:"ModuleMetadata",setup(t){t.on("beforeEnvelope",e=>{dr(e,(n,r)=>{if(r==="event"){let o=Array.isArray(n)?n[1]:void 0;o&&(ph(o),n[1]=o)}})}),t.on("applyFrameMetadata",e=>{if(e.type)return;let n=t.getOptions().stackParser;fh(n,e)})}});var Hk=new Set([]);function nl(t){let e="console",n=zn(e,t);return Fn(e,aP),n}function aP(){"console"in tt&&wa.forEach(function(t){t in tt.console&&be(tt.console,t,function(e){return Ls[t]=e,function(...n){let r=n[0],o=Ls[t],i=Hk.size&&typeof r=="string"&&tn(r,Hk);i||Qe("console",{args:n,level:t}),(!i||$&&w.isEnabled())&&o?.apply(tt.console,n)}})})}function Hi(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var sP="CaptureConsole",lP=((t={})=>{let e=t.levels||wa,n=t.handled??!0;return{name:sP,setup(r){"console"in tt&&nl(({args:o,level:i})=>{P()!==r||!e.includes(i)||cP(o,i,n)})}}}),Av=lP;function cP(t,e,n){let r=Hi(e),o=new Error,i={level:Hi(e),extra:{arguments:t}};Oe(a=>{if(a.addEventProcessor(c=>(c.logger="console",En(c,{handled:n,type:"auto.core.capture_console"}),c)),e==="assert"){if(!t[0]){let c=`Assertion failed: ${ka(t.slice(1)," ")||"console.assert"}`;a.setExtra("arguments",t.slice(1)),a.captureMessage(c,r,{captureContext:i,syntheticException:o})}return}let s=t.find(c=>c instanceof Error);if(s){Et(s,i);return}let l=ka(t," ");a.captureMessage(l,r,{captureContext:i,syntheticException:o})})}var uP="Dedupe",dP=(()=>{let t;return{name:uP,processEvent(e){if(e.type)return e;try{if(fP(e,t))return $&&w.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}}),Lf=dP;function fP(t,e){return e?!!(pP(t,e)||mP(t,e)):!1}function pP(t,e){let n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!jk(t,e)||!$k(t,e))}function mP(t,e){let n=Gk(e),r=Gk(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!jk(t,e)||!$k(t,e))}function $k(t,e){let n=Us(t),r=Us(e);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],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function jk(t,e){let n=t.fingerprint,r=e.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 Gk(t){return t.exception?.values?.[0]}var gP="ExtraErrorData",hP=((t={})=>{let{depth:e=3,captureErrorCause:n=!0}=t;return{name:gP,processEvent(r,o,i){let{maxValueLength:a}=i.getOptions();return bP(r,o,e,n,a)}}}),kv=hP;function bP(t,e={},n,r,o){if(!e.originalException||!mn(e.originalException))return t;let i=e.originalException.name||e.originalException.constructor.name,a=qk(e.originalException,r,o);if(a){let s={...t.contexts},l=ue(a,n);return he(l)&&(A0(l),s[i]=l),{...t,contexts:s}}return t}function qk(t,e,n){try{let r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],o={};for(let i of Object.keys(t)){if(r.indexOf(i)!==-1)continue;let a=t[i];o[i]=mn(a)||typeof a=="string"?n?Do(`${a}`,n):`${a}`:a}if(e&&t.cause!==void 0)if(mn(t.cause)){let i=t.cause.name||t.cause.constructor.name;o.cause={[i]:qk(t.cause,!1,n)}}else o.cause=t.cause;if(typeof t.toJSON=="function"){let i=t.toJSON();for(let a of Object.keys(i)){let s=i[a];o[a]=mn(s)?s.toString():s}}return o}catch(r){$&&w.error("Unable to extract extra data from the Error object:",r)}return null}function yP(t,e){let n=0;for(let r=t.length-1;r>=0;r--){let o=t[r];o==="."?t.splice(r,1):o===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var _P=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function vP(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=_P.exec(e);return n?n.slice(1):[]}function Vk(...t){let e="",n=!1;for(let r=t.length-1;r>=-1&&!n;r--){let o=r>=0?t[r]:"/";o&&(e=`${o}/${e}`,n=o.charAt(0)==="/")}return e=yP(e.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+e||"."}function Yk(t){let e=0;for(;e<t.length&&t[e]==="";e++);let n=t.length-1;for(;n>=0&&t[n]==="";n--);return e>n?[]:t.slice(e,n-e+1)}function Wk(t,e){t=Vk(t).slice(1),e=Vk(e).slice(1);let n=Yk(t.split("/")),r=Yk(e.split("/")),o=Math.min(n.length,r.length),i=o;for(let s=0;s<o;s++)if(n[s]!==r[s]){i=s;break}let a=[];for(let s=i;s<n.length;s++)a.push("..");return a=a.concat(r.slice(i)),a.join("/")}function Kk(t,e){let n=vP(t)[2]||"";return e&&n.slice(e.length*-1)===e&&(n=n.slice(0,n.length-e.length)),n}var SP="RewriteFrames",Iv=(t={})=>{let e=t.root,n=t.prefix||"app:///",r="window"in tt&&!!tt.window,o=t.iteratee||EP({isBrowser:r,root:e,prefix:n});function i(s){try{return{...s,exception:{...s.exception,values:s.exception.values.map(l=>({...l,...l.stacktrace&&{stacktrace:a(l.stacktrace)}}))}}}catch{return s}}function a(s){return{...s,frames:s?.frames?.map(l=>o(l))}}return{name:SP,processEvent(s){let l=s;return s.exception&&Array.isArray(s.exception.values)&&(l=i(l)),l}}};function EP({isBrowser:t,root:e,prefix:n}){return r=>{if(!r.filename)return r;let o=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),i=/^\//.test(r.filename);if(t){if(e){let a=r.filename;a.indexOf(e)===0&&(r.filename=a.replace(e,n))}}else if(o||i){let a=o?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,s=e?Wk(e,a):Kk(a);r.filename=`${n}${s}`}return r}}var TP=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],wP=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],xP={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},Jk=["select","insert","upsert","update","delete"];function mh(t){try{t.__SENTRY_INSTRUMENTED__=!0}catch{}}function gh(t){try{return t.__SENTRY_INSTRUMENTED__}catch{return!1}}function Qk(t,e){if(Object.keys(e).length>0)return e;if(Array.isArray(t)&&t.length>0)return t}function AP(t,e){return Qk(t,e)!==void 0}function kP(t,e={}){switch(t){case"GET":return"select";case"POST":return e.Prefer?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function IP(t,e){if(e===""||e==="*")return"select(*)";if(t==="select")return`select(${e})`;if(t==="or"||t.endsWith(".or"))return`${t}${e}`;let[n,...r]=e.split("."),o;return n?.startsWith("fts")?o="textSearch":n?.startsWith("plfts")?o="textSearch[plain]":n?.startsWith("phfts")?o="textSearch[phrase]":n?.startsWith("wfts")?o="textSearch[websearch]":o=n&&xP[n]||"filter",`${o}(${t}, ${r.join(".")})`}function Xk(t,e=!1){return new Proxy(t,{apply(n,r,o){return nn({name:`auth ${e?"(admin) ":""}${t.name}`,attributes:{[at]:"auto.db.supabase",[ht]:"db","db.system":"postgresql","db.operation":`auth.${e?"admin.":""}${t.name}`}},i=>Reflect.apply(n,r,o).then(a=>(a&&typeof a=="object"&&"error"in a&&a.error?(i.setStatus({code:2}),Et(a.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):i.setStatus({code:1}),i.end(),a)).catch(a=>{throw i.setStatus({code:2}),i.end(),Et(a,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),a}).then(...o))}})}function RP(t){let e=t.auth;if(!(!e||gh(t.auth))){for(let n of TP){let r=e[n];r&&typeof t.auth[n]=="function"&&(t.auth[n]=Xk(r))}for(let n of wP){let r=e.admin[n];r&&typeof t.auth.admin[n]=="function"&&(t.auth.admin[n]=Xk(r,!0))}mh(t.auth)}}function NP(t,e){gh(t.prototype.from)||(t.prototype.from=new Proxy(t.prototype.from,{apply(n,r,o){let i=Reflect.apply(n,r,o),a=i.constructor;return MP(a,e),i}}),mh(t.prototype.from))}function CP(t,e){gh(t.prototype.then)||(t.prototype.then=new Proxy(t.prototype.then,{apply(n,r,o){let i=Jk,a=r,s=kP(a.method,a.headers);if(!i.includes(s)||!a?.url?.pathname||typeof a.url.pathname!="string")return Reflect.apply(n,r,o);let l=a.url.pathname.split("/"),c=l.length>0?l[l.length-1]:"",d=[];for(let[E,R]of a.url.searchParams.entries())d.push(IP(E,R));let u=Object.create(null);if(he(a.body))for(let[E,R]of Object.entries(a.body))u[E]=R;let p=P(),f=e.sendOperationData??p?.getDataCollectionOptions().userInfo===!0,m=Qk(a.body,u),_=s==="select"?"":`${s}${AP(a.body,u)?"(...) ":""}`,v=f?d.join(" "):d.length>0?"[redacted]":"",h=[_.trimEnd(),v].filter(Boolean).join(" "),y=h?`${h} from(${c})`:`from(${c})`,S={"db.table":c,"db.schema":a.schema,"db.url":a.url.origin,"db.sdk":a.headers["X-Client-Info"],"db.system":"postgresql","db.operation":s,[at]:"auto.db.supabase",[ht]:"db"};return d.length&&f&&(S["db.query"]=d),m!==void 0&&f&&(S["db.body"]=m),nn({name:y,attributes:S},E=>Reflect.apply(n,r,[]).then(R=>{if(E&&(R&&typeof R=="object"&&"status"in R&&ri(E,R.status||500),E.end()),R?.error){let L=new Error(R.error.message);R.error.code&&(L.code=R.error.code),R.error.details&&(L.details=R.error.details);let z={};d.length&&f&&(z.query=d),m!==void 0&&f&&(z.body=m),Et(L,U=>(U.addEventProcessor(D=>(En(D,{handled:!1,type:"auto.db.supabase.postgres"}),D)),U.setContext("supabase",z),U))}let C={type:"supabase",category:`db.${s}`,message:y},I={};return d.length&&f&&(I.query=d),m!==void 0&&f&&(I.body=m),Object.keys(I).length&&(C.data=I),wn(C),R},R=>{throw E&&(ri(E,500),E.end()),R}).then(...o))}}),mh(t.prototype.then))}function MP(t,e){for(let n of Jk)gh(t.prototype[n])||(t.prototype[n]=new Proxy(t.prototype[n],{apply(r,o,i){let a=Reflect.apply(r,o,i),s=a.constructor;return $&&w.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),CP(s,e),a}}),mh(t.prototype[n]))}var hh=(t,e={})=>{if(!t){$&&w.warn("Supabase integration was not installed because no Supabase client was provided.");return}let n=t.constructor===Function?t:t.constructor;NP(n,e),RP(t)},OP="Supabase",DP=((t,e)=>({setupOnce(){hh(t,e)},name:OP})),Rv=t=>DP(t.supabaseClient,{sendOperationData:t.sendOperationData});var LP=10,UP="ZodErrors";function BP(t){return mn(t)&&t.name==="ZodError"&&Array.isArray(t.issues)}function PP(t){return{...t,path:"path"in t&&Array.isArray(t.path)?t.path.join("."):void 0,keys:"keys"in t?JSON.stringify(t.keys):void 0,unionErrors:"unionErrors"in t?JSON.stringify(t.unionErrors):void 0}}function zP(t){return t.map(e=>typeof e=="number"?"<array>":e).join(".")}function FP(t){let e=new Set;for(let r of t.issues){let o=zP(r.path);o.length>0&&e.add(o)}let n=Array.from(e);if(n.length===0){let r="variable";if(t.issues.length>0){let o=t.issues[0];o!==void 0&&"expected"in o&&typeof o.expected=="string"&&(r=o.expected)}return`Failed to validate ${r}`}return`Failed to validate keys: ${Do(n.join(", "),100)}`}function HP(t,e=!1,n,r){if(!n.exception?.values||!r.originalException||!BP(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(e?r.originalException.issues:r.originalException.issues.slice(0,t)).map(PP);return e&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:i})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:FP(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":i.slice(0,t)}}}catch(o){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:o instanceof Error?`${o.name}: ${o.message}
|
|
26
|
-
${o.stack}`:"unknown"}}}}}var GP=((t={})=>{let e=t.limit??LP;return{name:UP,processEvent(n,r){return HP(e,t.saveZodIssuesAsAttachment,n,r)}}}),Nv=GP;var Cv=t=>({name:"ThirdPartyErrorsFilter",setup(e){e.on("beforeEnvelope",n=>{dr(n,(r,o)=>{if(o==="event"){let i=Array.isArray(r)?r[1]:void 0;i&&(ph(i),r[1]=i)}})}),e.on("applyFrameMetadata",n=>{if(n.type)return;let r=e.getOptions().stackParser;fh(r,n)})},preprocessEvent(e){t.ignoreSentryInternalFrames&&(tt._sentryWrappedDepth??0)>0&&(e.sdkProcessingMetadata={...e.sdkProcessingMetadata,insideSentryWrapped:!0})},processEvent(e){let n=t.ignoreSentryInternalFrames?e.sdkProcessingMetadata?.insideSentryWrapped===!0&&e.exception?.values?.length===1:!1,r=jP(e,t.ignoreSentryInternalFrames,n);if(r){let o=t.behaviour==="drop-error-if-contains-third-party-frames"||t.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(r[o](a=>!a.some(s=>t.filterKeys.includes(s)))){if(t.behaviour==="drop-error-if-contains-third-party-frames"||t.behaviour==="drop-error-if-exclusively-contains-third-party-frames")return null;e.tags={...e.tags,third_party_code:!0}}}return e}});function $P(t,e,n){if(e!==0)return!1;if(n&&qP(t)||t.function==="sentryWrapped")return!0;if(!t.context_line||!t.filename||!t.filename.includes("sentry")||!t.filename.includes("helpers")||!t.context_line.includes(YP))return!1;if(t.pre_context){let r=t.pre_context.length;for(let o=0;o<r;o++)if(t.pre_context[o]?.includes(VP))return!0}return!1}function jP(t,e,n){let r=Us(t);if(r)return r.filter((o,i)=>!o.filename||o.lineno==null&&o.colno==null&&o.instruction_addr==null?!1:!e||!$P(o,i,!!n)).map(o=>o.module_metadata?Object.keys(o.module_metadata).filter(i=>i.startsWith(Zk)).map(i=>i.slice(Zk.length)):[])}function qP(t){return!t.context_line&&!t.pre_context&&!!t.function&&t.function.length<=2}var Zk="_sentryBundlerPluginAppKey:",VP="Attempt to invoke user-land function",YP="fn.apply(this, wrappedArguments)";var tI=100,eI=10,bh="flag.evaluation.";function Cr(t){if(t.type)return t;let n=rt().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(t.contexts===void 0&&(t.contexts={}),t.contexts.flags={values:[...r]}),t}function fr(t,e,n=tI){let r=rt().getScopeData().contexts;r.flags||(r.flags={values:[]});let o=r.flags.values;WP(o,t,e,n)}function WP(t,e,n,r){if(typeof n!="boolean")return;if(t.length>r){$&&w.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let o=t.findIndex(i=>i.flag===e);o!==-1&&t.splice(o,1),t.length===r&&t.shift(),t.push({flag:e,result:n})}function pr(t,e,n=eI){if(typeof e!="boolean")return;let r=Dt();if(!r)return;let o=et(r).data;if(`${bh}${t}`in o){r.setAttribute(`${bh}${t}`,e);return}Object.keys(o).filter(a=>a.startsWith(bh)).length<n&&r.setAttribute(`${bh}${t}`,e)}var Mv=()=>({name:"FeatureFlags",processEvent(t,e,n){return Cr(t)},addFeatureFlag(t,e){fr(t,e),pr(t,e)}});var Ov=({growthbookClass:t})=>({name:"GrowthBook",setupOnce(){let e=t.prototype;typeof e.isOn=="function"&&be(e,"isOn",nI),typeof e.getFeatureValue=="function"&&be(e,"getFeatureValue",nI)},processEvent(e,n,r){return Cr(e)}});function nI(t){return function(...e){let n=e[0],r=t.apply(this,e);return typeof n=="string"&&typeof r=="boolean"&&(fr(n,r),pr(n,r)),r}}var KP="ConversationId",XP=(()=>({name:KP,setup(t){t.on("spanStart",e=>{let n=rt().getScopeData(),r=Pt().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:a,description:s}=et(e);if(!i?.startsWith("gen_ai.")&&!a["ai.operationId"]&&!s?.startsWith("ai."))return;e.setAttribute(Tg,o)}})}})),Dv=XP;function Lv(t,e,n,r,o){if(!t.fetchData)return;let{method:i,url:a}=t.fetchData,s=De()&&e(a);if(t.endTimestamp){let m=t.fetchData.__span;if(!m)return;let _=r[m];_&&(s&&(QP(_,t),JP(_,t,o)),delete r[m]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},d=P(),p=!!Dt()||!!d&&je(d),f=s&&p?Ae(e8(a,i,l)):new ur;if(s&&!p&&d?.recordDroppedEvent("no_parent_span","span"),t.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(t.fetchData.url)){let m=t.args[0],_={...t.args[1]||{}},v=oI(m,_,De()&&p?f:void 0,c);v&&(t.args[1]=_,_.headers=v)}if(d){let m={input:t.args,response:t.response,startTimestamp:t.startTimestamp,endTimestamp:t.endTimestamp};d.emit("beforeOutgoingRequestSpan",f,m)}return f}function JP(t,e,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(t,{headers:e.response?.headers,error:e.error})}function oI(t,e,n,r){let o=el({span:n,propagateTraceparent:r}),i=o["sentry-trace"],a=o.baggage,s=o.traceparent;if(!i)return;let l=e.headers||(Qd(t)?t.headers:void 0);if(l)if(ZP(l)){let c=new Headers(l);if(c.get("sentry-trace")||c.set("sentry-trace",i),r&&s&&!c.get("traceparent")&&c.set("traceparent",s),a){let d=c.get("baggage");d?yh(d)||c.set("baggage",`${d},${a}`):c.set("baggage",a)}return c}else if(t8(l)){let c=[...l];c.find(u=>u[0]==="sentry-trace")||c.push(["sentry-trace",i]),r&&s&&!c.find(u=>u[0]==="traceparent")&&c.push(["traceparent",s]);let d=l.find(u=>u[0]==="baggage"&&typeof u[1]=="string"&&yh(u[1]));return a&&!d&&c.push(["baggage",a]),c}else{let c="sentry-trace"in l?l["sentry-trace"]:void 0,d="traceparent"in l?l.traceparent:void 0,u="baggage"in l?l.baggage:void 0,p=u?Array.isArray(u)?[...u]:[u]:[],f=u&&(Array.isArray(u)?u.find(_=>yh(_)):yh(u));a&&!f&&p.push(a);let m=Object.assign({},l,{"sentry-trace":c??i,baggage:p.length>0?p.join(","):void 0});return r&&s&&!d&&(m.traceparent=s),m}else return{...o}}function QP(t,e){if(e.response){ri(t,e.response.status);let n=e.response?.headers?.get("content-length");if(n){let r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:2,message:"internal_error"});t.end()}function yh(t){return typeof t!="string"?!1:t.split(",").some(e=>e.trim().startsWith(of))}function ZP(t){return typeof Headers<"u"&&Oo(t,Headers)}function t8(t){return Array.isArray(t)?t.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string"):!1}function e8(t,e,n){if(t.startsWith("data:")){let i=Yn(t);return{name:`${e} ${i}`,attributes:rI(t,void 0,e,n)}}let r=ui(t),o=r?Hc(r):t;return{name:`${e} ${o}`,attributes:rI(t,r,e,n)}}function rI(t,e,n,r){let o={url:Yn(t),type:"fetch","http.method":n,[at]:r,[ht]:"http.client"};return e&&(tl(e)||(o["http.url"]=Yn(e.href),o["server.address"]=e.host),e.search&&(o["http.query"]=e.search),e.hash&&(o["http.fragment"]=e.hash)),o}function jc(t,e={},n=rt()){let{message:r,name:o,email:i,url:a,source:s,associatedEventId:l,tags:c}=t,d={contexts:{feedback:{contact_email:i,name:o,message:r,url:a,source:s,associated_event_id:l}},type:"feedback",level:"info",tags:c},u=n?.getClient()||P();return u&&u.emit("beforeSendFeedback",d,e),n.captureEvent(d,e)}var _h={};_0(_h,{debug:()=>r8,error:()=>a8,fatal:()=>s8,fmt:()=>vv,info:()=>o8,trace:()=>n8,warn:()=>i8});function qc(t,e,n,r,o){Pa({level:t,message:e,attributes:n,severityNumber:o},r)}function n8(t,e,{scope:n}={}){qc("trace",t,e,n)}function r8(t,e,{scope:n}={}){qc("debug",t,e,n)}function o8(t,e,{scope:n}={}){qc("info",t,e,n)}function i8(t,e,{scope:n}={}){qc("warn",t,e,n)}function a8(t,e,{scope:n}={}){qc("error",t,e,n)}function s8(t,e,{scope:n}={}){qc("fatal",t,e,n)}function Vc(t,e,n){return"util"in tt&&typeof tt.util.format=="function"?tt.util.format(...t):l8(t,e,n)}function l8(t,e,n){return t.map(r=>Ze(r)?String(r):JSON.stringify(ue(r,e,n))).join(" ")}function vh(t){return/%[sdifocO]/.test(t)}function Sh(t,e){let n={},r=new Array(e.length).fill("{}").join(" ");return n["sentry.message.template"]=`${t} ${r}`,e.forEach((o,i)=>{n[`sentry.message.parameter.${i}`]=o}),n}var c8="ConsoleLogs",iI={[at]:"auto.log.console"},u8=((t={})=>{let e=t.levels||wa;return{name:c8,setup(n){let{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){$&&w.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let a=nl(({args:s,level:l})=>{if(P()!==n||!e.includes(l))return;let c=s[0],d=s.slice(1);if(l==="assert"){if(!c){let f=d.length>0?`Assertion failed: ${Vc(d,o,i)}`:"Assertion failed";Pa({level:"error",message:f,attributes:iI})}return}let u=l==="log",p={...iI};if(he(c)){Object.assign(p,ue(c,o,i));let f=typeof s[1]=="string"?2:1;s.slice(f).forEach((_,v)=>{p[`sentry.message.parameter.${v}`]=ue(_,o,i)})}else if(d.length>0&&typeof c=="string"&&!vh(c)){let m=Sh(c,d);for(let[_,v]of Object.entries(m))p[_]=_.startsWith("sentry.message.parameter.")?ue(v,o,i):v}Pa({level:u?"info":l,message:Vc(s,o,i),severityNumber:u?10:void 0,attributes:p})});n.registerCleanup(a)}}}),Uv=u8;var Fa={};_0(Fa,{count:()=>d8,distribution:()=>p8,gauge:()=>f8});function Bv(t,e,n,r){lv({type:t,name:e,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function d8(t,e=1,n){Bv("counter",t,e,n)}function f8(t,e,n){Bv("gauge",t,e,n)}function p8(t,e,n){Bv("distribution",t,e,n)}var m8=["trace","debug","info","warn","error","fatal"];function Pv(t={}){let e=new Set(t.levels??m8),n=t.client;return{log(r){let{type:o,level:i,message:a,args:s,tag:l,date:c,...d}=r,u=n||P();if(!u)return;let p=b8(o,i);if(!e.has(p))return;let{normalizeDepth:f=3,normalizeMaxBreadth:m=1e3}=u.getOptions(),_={};for(let[h,y]of Object.entries(d))_[h]=ue(y,f,m);_["sentry.origin"]="auto.log.consola",l&&(_["consola.tag"]=l),o&&(_["consola.type"]=o),i!=null&&typeof i=="number"&&(_["consola.level"]=i);let v=_8(y8(s,f,m),f,m);v?.attributes&&Object.assign(_,v.attributes),Pa({level:p,message:v?.message||a||s&&Vc(s,f,m)||"",attributes:_})}}}var g8={silent:"trace",fatal:"fatal",error:"error",warn:"warn",log:"info",info:"info",success:"info",fail:"error",ready:"info",start:"info",box:"info",debug:"debug",trace:"trace",verbose:"debug",critical:"fatal",notice:"info"},h8={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function b8(t,e){if(t==="verbose")return"debug";if(t==="silent")return"trace";if(t){let n=g8[t];if(n)return n}if(typeof e=="number"){let n=h8[e];if(n)return n}return"info"}function y8(t,e,n){if(!t?.length)return{message:""};let r=Vc(t,e,n),o=t[0];if(he(o)){let i=typeof t[1]=="string"?2:1,a=t.slice(i);return{message:r,attributes:o,messageParameters:a}}else{let i=t.slice(1),a=i.length>0&&typeof o=="string"&&!vh(o);return{message:r,messageTemplate:a?o:void 0,messageParameters:a?i:void 0}}}function _8(t,e,n){let{message:r,attributes:o,messageTemplate:i,messageParameters:a}=t,s={};if(i&&a){let l=Sh(i,a);for(let[c,d]of Object.entries(l))s[c]=c.startsWith("sentry.message.parameter.")?ue(d,e,n):d}else a&&a.length>0&&a.forEach((l,c)=>{s[`sentry.message.parameter.${c}`]=ue(l,e,n)});return{message:r,attributes:{...ue(o,e,n),...s}}}var aI="gen_ai.prompt",di="gen_ai.system",ke="gen_ai.request.model",Yc="gen_ai.request.stream",Ha="gen_ai.request.temperature",Wc="gen_ai.request.max_tokens",Ga="gen_ai.request.frequency_penalty",Kc="gen_ai.request.presence_penalty",$a="gen_ai.request.top_p",Eh="gen_ai.request.top_k",Th="gen_ai.request.encoding_format",wh="gen_ai.request.dimensions",fi="gen_ai.response.finish_reasons",to="gen_ai.response.model",ja="gen_ai.response.id",sI="gen_ai.response.stop_reason",eo="gen_ai.usage.input_tokens",no="gen_ai.usage.output_tokens",Mr="gen_ai.usage.total_tokens",hn="gen_ai.operation.name",ro="sentry.sdk_meta.gen_ai.input.messages.original_length",Ho="gen_ai.input.messages";var pi="gen_ai.system_instructions",Wn="gen_ai.response.text",mi="gen_ai.request.available_tools",lI="gen_ai.response.streaming",mr="gen_ai.response.tool_calls",rl="gen_ai.agent.name",cI="gen_ai.pipeline.name",Uf="gen_ai.conversation.id",uI="gen_ai.usage.cache_creation_input_tokens",dI="gen_ai.usage.cache_read_input_tokens";var fI="gen_ai.invoke_agent",Xc="gen_ai.embeddings.input",zv="gen_ai.embeddings",Fv="gen_ai.execute_tool",xh="gen_ai.tool.name",pI="gen_ai.tool.call.id",mI="gen_ai.tool.type",Ah="gen_ai.tool.input",kh="gen_ai.tool.output",gI="gen_ai.tool.description";function qa(t){return!t||typeof t!="object"?!1:S8(t)||bI(t)||v8(t)||yI(t)||_I(t)||E8(t)||T8(t)||w8(t)||x8(t)||A8(t)||k8(t)||I8(t)}function v8(t){return"image_url"in t?typeof t.image_url=="string"?t.image_url.startsWith("data:"):hI(t):!1}function hI(t){return"image_url"in t&&!!t.image_url&&typeof t.image_url=="object"&&"url"in t.image_url&&typeof t.image_url.url=="string"&&t.image_url.url.startsWith("data:")}function S8(t){return"type"in t&&typeof t.type=="string"&&"source"in t&&qa(t.source)}function bI(t){return"inlineData"in t&&!!t.inlineData&&typeof t.inlineData=="object"&&"data"in t.inlineData&&typeof t.inlineData.data=="string"}function yI(t){return"type"in t&&t.type==="input_audio"&&"input_audio"in t&&!!t.input_audio&&typeof t.input_audio=="object"&&"data"in t.input_audio&&typeof t.input_audio.data=="string"}function _I(t){return"type"in t&&t.type==="file"&&"file"in t&&!!t.file&&typeof t.file=="object"&&"file_data"in t.file&&typeof t.file.file_data=="string"}function E8(t){return"media_type"in t&&typeof t.media_type=="string"&&"data"in t}function T8(t){return"type"in t&&t.type==="file"&&"mediaType"in t&&typeof t.mediaType=="string"&&"data"in t&&typeof t.data=="string"&&!t.data.startsWith("http://")&&!t.data.startsWith("https://")}function w8(t){return"type"in t&&t.type==="image"&&"image"in t&&typeof t.image=="string"&&!t.image.startsWith("http://")&&!t.image.startsWith("https://")}function x8(t){return"type"in t&&(t.type==="blob"||t.type==="base64")}function A8(t){return"b64_json"in t}function k8(t){return"type"in t&&"result"in t&&t.type==="image_generation"}function I8(t){return"uri"in t&&typeof t.uri=="string"&&t.uri.startsWith("data:")}var Bf="[Blob substitute]",R8=["image_url","data","content","b64_json","result","uri","image"];function ol(t){let e={...t};qa(e.source)&&(e.source=ol(e.source)),bI(t)&&(e.inlineData={...t.inlineData,data:Bf}),hI(t)&&(e.image_url={...t.image_url,url:Bf}),yI(t)&&(e.input_audio={...t.input_audio,data:Bf}),_I(t)&&(e.file={...t.file,file_data:Bf});for(let n of R8)typeof e[n]=="string"&&(e[n]=Bf);return e}var SI=2e4,Ih=t=>new TextEncoder().encode(t).length,Gv=t=>Ih(JSON.stringify(t));function Rh(t,e){if(Ih(t)<=e)return t;let n=0,r=t.length,o="";for(;n<=r;){let i=Math.floor((n+r)/2),a=t.slice(0,i);Ih(a)<=e?(o=a,n=i+1):r=i-1}return o}function N8(t){return typeof t=="string"?t:"text"in t&&typeof t.text=="string"?t.text:""}function vI(t,e){return typeof t=="string"?e:{...t,text:e}}function C8(t){return t!==null&&typeof t=="object"&&"content"in t&&typeof t.content=="string"}function EI(t){return t!==null&&typeof t=="object"&&"content"in t&&Array.isArray(t.content)}function TI(t){return t!==null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)&&t.parts.length>0}function M8(t,e){let n={...t,content:""},r=Gv(n),o=e-r;if(o<=0)return[];let i=Rh(t.content,o);return[{...t,content:i}]}function O8(t){return"parts"in t&&Array.isArray(t.parts)?{key:"parts",items:t.parts}:"content"in t&&Array.isArray(t.content)?{key:"content",items:t.content}:{key:null,items:[]}}function D8(t,e){let{key:n,items:r}=O8(t);if(n===null||r.length===0)return[];let o=r.map(l=>vI(l,"")),i=Gv({...t,[n]:o}),a=e-i;if(a<=0)return[];let s=[];for(let l of r){let c=N8(l),d=Ih(c);if(d<=a)s.push(l),a-=d;else if(s.length===0){let u=Rh(c,a);u&&s.push(vI(l,u));break}else break}return s.length<=0?[]:[{...t,[n]:s}]}function L8(t,e){if(!t)return[];if(typeof t=="string"){let n=Rh(t,e);return n?[n]:[]}return typeof t!="object"?[]:C8(t)?M8(t,e):EI(t)||TI(t)?D8(t,e):[]}function Hv(t){return t.map(n=>{let r;return n&&typeof n=="object"&&(EI(n)?r={...n,content:Hv(n.content)}:"content"in n&&qa(n.content)&&(r={...n,content:ol(n.content)}),TI(n)&&(r={...r??n,parts:Hv(n.parts)}),qa(r)?r=ol(r):qa(n)&&(r=ol(n))),r??n})}function U8(t,e){if(!Array.isArray(t)||t.length===0)return t;let n=e-2,r=t[t.length-1],o=Hv([r]),i=o[0];return Gv(i)<=n?o:L8(i,n)}function wI(t){return U8(t,SI)}function xI(t){return Rh(t,SI)}function Or(t){let e=P()?.getDataCollectionOptions().genAI;return{...t,recordInputs:t?.recordInputs??e?.inputs??!1,recordOutputs:t?.recordOutputs??e?.outputs??!1}}function gr(t){if(t!==void 0)return t;let e=P();return e?!je(e)&&e.getOptions().streamGenAiSpans===!1:!0}function Jc(t,e){return t?`${t}.${e}`:e}function AI(t,e,n,r,o){if(e!==void 0&&t.setAttributes({[eo]:e}),n!==void 0&&t.setAttributes({[no]:n}),e!==void 0||n!==void 0||r!==void 0||o!==void 0){let i=(e??0)+(n??0)+(r??0)+(o??0);t.setAttributes({[Mr]:i})}}function il(t,e,n){if(!t.isRecording())return;let r={[lI]:!0};e.responseId&&(r[ja]=e.responseId),e.responseModel&&(r[to]=e.responseModel),e.promptTokens!==void 0&&(r[eo]=e.promptTokens),e.completionTokens!==void 0&&(r[no]=e.completionTokens),e.totalTokens!==void 0?r[Mr]=e.totalTokens:(e.promptTokens!==void 0||e.completionTokens!==void 0||e.cacheCreationInputTokens!==void 0||e.cacheReadInputTokens!==void 0)&&(r[Mr]=(e.promptTokens??0)+(e.completionTokens??0)+(e.cacheCreationInputTokens??0)+(e.cacheReadInputTokens??0)),e.finishReasons.length&&(r[fi]=JSON.stringify(e.finishReasons)),n&&e.responseTexts.length&&(r[Wn]=e.responseTexts.join("")),n&&e.toolCalls.length&&(r[mr]=JSON.stringify(e.toolCalls)),t.setAttributes(r),t.end()}function Go(t){return typeof t=="string"?t:JSON.stringify(t)}function $o(t){if(typeof t=="string")return xI(t);if(Array.isArray(t)){let e=wI(t);return JSON.stringify(e)}return JSON.stringify(t)}function gi(t){if(!Array.isArray(t))return{systemInstructions:void 0,filteredMessages:t};let e=t.findIndex(a=>a&&typeof a=="object"&&"role"in a&&a.role==="system");if(e===-1)return{systemInstructions:void 0,filteredMessages:t};let n=t[e],r=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!r)return{systemInstructions:void 0,filteredMessages:t};let o=JSON.stringify([{type:"text",content:r}]),i=[...t.slice(0,e),...t.slice(e+1)];return{systemInstructions:o,filteredMessages:i}}async function B8(t,e,n){let r=t.catch(a=>{throw Et(a,{mechanism:{handled:!1,type:n}}),a}),o=await e,i=await r;return i&&typeof i=="object"&&"data"in i?{...i,data:o}:o}function Qc(t,e,n){return Nn(t)?new Proxy(t,{get(r,o){let a=o in Promise.prototype||o===Symbol.toStringTag?e:r,s=Reflect.get(a,o);return o==="withResponse"&&typeof s=="function"?function(){let c=s.call(r);return B8(c,e,n)}:typeof s=="function"?s.bind(a):s}}):e}var kI={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},P8=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],II=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...P8];function RI(t){return t!==null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.startsWith("response.")}function NI(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion.chunk"}function CI(t,e,n){if(!e||typeof e!="object")return;let r=e,o={};if(typeof r.id=="string"&&(o[ja]=r.id),typeof r.model=="string"&&(o[to]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[Uf]=r.id),r.usage&&typeof r.usage=="object"){let i=r.usage,a=i.prompt_tokens??i.input_tokens;typeof a=="number"&&(o[eo]=a);let s=i.completion_tokens??i.output_tokens;typeof s=="number"&&(o[no]=s),typeof i.total_tokens=="number"&&(o[Mr]=i.total_tokens)}if(Array.isArray(r.choices)){let i=r.choices,a=i.map(s=>s.finish_reason).filter(s=>typeof s=="string");if(a.length>0&&(o[fi]=JSON.stringify(a)),n){let s=i.map(c=>c.message?.content||"");o[Wn]=JSON.stringify(s);let l=i.map(c=>c.message?.tool_calls).filter(c=>Array.isArray(c)&&c.length>0).flat();l.length>0&&(o[mr]=JSON.stringify(l))}}if(typeof r.status=="string"&&(o[fi]||(o[fi]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!o[Wn]&&(o[Wn]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!o[mr])){let i=r.output.filter(a=>a?.type==="function_call");i.length>0&&(o[mr]=JSON.stringify(i))}t.setAttributes(o)}function z8(t){if("conversation"in t&&typeof t.conversation=="string")return t.conversation;if("previous_response_id"in t&&typeof t.previous_response_id=="string")return t.previous_response_id}function MI(t){let e={[ke]:t.model??"unknown"};"temperature"in t&&(e[Ha]=t.temperature),"top_p"in t&&(e[$a]=t.top_p),"frequency_penalty"in t&&(e[Ga]=t.frequency_penalty),"presence_penalty"in t&&(e[Kc]=t.presence_penalty),"stream"in t&&(e[Yc]=t.stream),"encoding_format"in t&&(e[Th]=t.encoding_format),"dimensions"in t&&(e[wh]=t.dimensions);let n=z8(t);return n&&(e[Uf]=n),e}function F8(t,e){for(let n of t){let r=n.index;if(!(r===void 0||!n.function))if(!(r in e.chatCompletionToolCalls))e.chatCompletionToolCalls[r]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}};else{let o=e.chatCompletionToolCalls[r];n.function.arguments&&o?.function&&(o.function.arguments+=n.function.arguments)}}}function H8(t,e,n){e.responseId=t.id??e.responseId,e.responseModel=t.model??e.responseModel,t.usage&&(e.promptTokens=t.usage.prompt_tokens,e.completionTokens=t.usage.completion_tokens,e.totalTokens=t.usage.total_tokens);for(let r of t.choices??[])n&&(r.delta?.content&&e.responseTexts.push(r.delta.content),r.delta?.tool_calls&&F8(r.delta.tool_calls,e)),r.finish_reason&&e.finishReasons.push(r.finish_reason)}function G8(t,e,n,r){if(!(t&&typeof t=="object")){e.eventTypes.push("unknown:non-object");return}if(t instanceof Error){r.setStatus({code:2,message:"internal_error"}),Et(t,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in t))return;let o=t;if(!II.includes(o.type)){e.eventTypes.push(o.type);return}if(n&&(o.type==="response.output_item.done"&&"item"in o&&e.responsesApiToolCalls.push(o.item),o.type==="response.output_text.delta"&&"delta"in o&&o.delta)){e.responseTexts.push(o.delta);return}if("response"in o){let{response:i}=o;e.responseId=i.id??e.responseId,e.responseModel=i.model??e.responseModel,i.usage&&(e.promptTokens=i.usage.input_tokens,e.completionTokens=i.usage.output_tokens,e.totalTokens=i.usage.total_tokens),i.status&&e.finishReasons.push(i.status),n&&i.output_text&&e.responseTexts.push(i.output_text)}}async function*OI(t,e,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let o of t)NI(o)?H8(o,r,n):RI(o)&&G8(o,r,n,e),yield o}finally{let o=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];il(e,{...r,toolCalls:o},n)}}function $8(t){let e=Array.isArray(t.tools)?t.tools:[],r=t.web_search_options&&typeof t.web_search_options=="object"?[{type:"web_search_options",...t.web_search_options}]:[],o=[...e,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(i){$&&w.error("Failed to serialize OpenAI tools:",i);return}}function j8(t,e){let n={[di]:"openai",[hn]:e,[at]:"auto.ai.openai"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let r=t[0],o=$8(r);o&&(n[mi]=o),Object.assign(n,MI(r))}else n[ke]="unknown";return n}function DI(t,e,n,r){if(n==="embeddings"&&"input"in e){let s=e.input;if(s==null||typeof s=="string"&&s.length===0||Array.isArray(s)&&s.length===0)return;t.setAttribute(Xc,typeof s=="string"?s:JSON.stringify(s));return}let o="input"in e?e.input:"messages"in e?e.messages:void 0;if(!o||Array.isArray(o)&&o.length===0)return;let{systemInstructions:i,filteredMessages:a}=gi(o);i&&t.setAttribute(pi,i),t.setAttribute(Ho,r?$o(a):Go(a)),Array.isArray(a)?t.setAttribute(ro,a.length):t.setAttribute(ro,1)}function q8(t,e,n,r,o){return function(...a){let s=n.operation||"unknown",l=j8(a,s),c=l[ke]||"unknown",d=a[0],u=d&&typeof d=="object"&&d.stream===!0,p={name:`${s} ${c}`,op:`gen_ai.${s}`,attributes:l};if(u){let _,v=qn(p,h=>(_=t.apply(r,a),o.recordInputs&&d&&DI(h,d,s,gr(o.enableTruncation)),(async()=>{try{let y=await _;return OI(y,h,o.recordOutputs??!1)}catch(y){throw h.setStatus({code:2,message:"internal_error"}),Et(y,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:e}}}),h.end(),y}})()));return Qc(_,v,"auto.ai.openai")}let f,m=nn(p,_=>(f=t.apply(r,a),o.recordInputs&&d&&DI(_,d,s,gr(o.enableTruncation)),f.then(v=>(CI(_,v,o.recordOutputs),v),v=>{throw Et(v,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:e}}}),v})));return Qc(f,m,"auto.ai.openai")}}function LI(t,e="",n){return new Proxy(t,{get(r,o){let i=r[o],a=Jc(e,String(o)),s=kI[a];return typeof i=="function"&&s?q8(i,a,s,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?LI(i,a,n):i}})}function $v(t,e){return LI(t,"",Or(e))}var UI={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}};function BI(t,e,n){if(Array.isArray(e)&&e.length===0)return;let{systemInstructions:r,filteredMessages:o}=gi(e);r&&t.setAttributes({[pi]:r});let i=Array.isArray(o)?o.length:1;t.setAttributes({[Ho]:n?$o(o):Go(o),[ro]:i})}var V8={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function jv(t){return t&&V8[t]||"internal_error"}function PI(t,e){e.error&&(t.setStatus({code:2,message:jv(e.error.type)}),Et(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function zI(t){let{system:e,messages:n,input:r}=t,o=typeof e=="string"?[{role:"system",content:t.system}]:[],i=Array.isArray(r)?r:r!=null?[r]:void 0,a=Array.isArray(n)?n:n!=null?[n]:[],s=i??a;return[...o,...s]}function Y8(t,e){return"type"in t&&typeof t.type=="string"&&t.type==="error"?(e.setStatus({code:2,message:jv(t.error?.type)}),Et(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function W8(t,e){if(t.type==="message_delta"&&t.usage&&"output_tokens"in t.usage&&typeof t.usage.output_tokens=="number"&&(e.completionTokens=t.usage.output_tokens),t.message){let n=t.message;n.id&&(e.responseId=n.id),n.model&&(e.responseModel=n.model),n.stop_reason&&e.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens=="number"&&(e.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(e.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(e.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function K8(t,e){t.type!=="content_block_start"||typeof t.index!="number"||!t.content_block||(t.content_block.type==="tool_use"||t.content_block.type==="server_tool_use")&&(e.activeToolBlocks[t.index]={id:t.content_block.id,name:t.content_block.name,inputJsonParts:[]})}function X8(t,e,n){if(!(t.type!=="content_block_delta"||!t.delta)){if(typeof t.index=="number"&&"partial_json"in t.delta&&typeof t.delta.partial_json=="string"){let r=e.activeToolBlocks[t.index];r&&r.inputJsonParts.push(t.delta.partial_json)}n&&typeof t.delta.text=="string"&&e.responseTexts.push(t.delta.text)}}function J8(t,e){if(t.type!=="content_block_stop"||typeof t.index!="number")return;let n=e.activeToolBlocks[t.index];if(!n)return;let r=n.inputJsonParts.join(""),o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}e.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete e.activeToolBlocks[t.index]}function FI(t,e,n,r){!(t&&typeof t=="object")||Y8(t,r)||(W8(t,e),K8(t,e),X8(t,e,n),J8(t,e))}async function*HI(t,e,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let o of t)FI(o,r,n,e),yield o}finally{il(e,r,n)}}function GI(t,e,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return t.on("streamEvent",o=>{FI(o,r,n,e)}),t.on("message",()=>{il(e,r,n)}),t.on("error",o=>{Et(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end())}),t}function Q8(t,e,n){let r={[di]:"anthropic",[hn]:n,[at]:"auto.ai.anthropic"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let o=t[0];o.tools&&Array.isArray(o.tools)&&(r[mi]=JSON.stringify(o.tools)),r[ke]=o.model??"unknown","temperature"in o&&(r[Ha]=o.temperature),"top_p"in o&&(r[$a]=o.top_p),"stream"in o&&(r[Yc]=o.stream),"top_k"in o&&(r[Eh]=o.top_k),"frequency_penalty"in o&&(r[Ga]=o.frequency_penalty),"max_tokens"in o&&(r[Wc]=o.max_tokens)}else e==="models.retrieve"||e==="models.get"?r[ke]=t[0]:r[ke]="unknown";return r}function qv(t,e,n){let r=zI(e);BI(t,r,n),"prompt"in e&&t.setAttributes({[aI]:JSON.stringify(e.prompt)})}function Z8(t,e){if("content"in e&&Array.isArray(e.content)){t.setAttributes({[Wn]:e.content.map(r=>r.text).filter(r=>!!r).join("")});let n=[];for(let r of e.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&t.setAttributes({[mr]:JSON.stringify(n)})}"completion"in e&&t.setAttributes({[Wn]:e.completion}),"input_tokens"in e&&t.setAttributes({[Wn]:JSON.stringify(e.input_tokens)})}function tz(t,e){"id"in e&&"model"in e&&(t.setAttributes({[ja]:e.id,[to]:e.model}),"usage"in e&&e.usage&&AI(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.cache_creation_input_tokens,e.usage.cache_read_input_tokens))}function ez(t,e,n){if(!(!e||typeof e!="object")){if("type"in e&&e.type==="error"){PI(t,e);return}n&&Z8(t,e),tz(t,e)}}function $I(t,e,n){throw Et(t,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end()),t}function nz(t,e,n,r,o,i,a,s,l,c,d){let u=o[ke]??"unknown",p={name:`${i} ${u}`,op:`gen_ai.${i}`,attributes:o};if(c&&!d){let f,m=qn(p,_=>(f=t.apply(n,r),l.recordInputs&&s&&qv(_,s,gr(l.enableTruncation)),(async()=>{try{let v=await f;return HI(v,_,l.recordOutputs??!1)}catch(v){return $I(v,_,a)}})()));return Qc(f,m,"auto.ai.anthropic")}else return qn(p,f=>{try{l.recordInputs&&s&&qv(f,s,gr(l.enableTruncation));let m=e.apply(n,r);return GI(m,f,l.recordOutputs??!1)}catch(m){return $I(m,f,a)}})}function rz(t,e,n,r,o){return new Proxy(t,{apply(i,a,s){let l=n.operation||"unknown",c=Q8(s,e,l),d=c[ke]??"unknown",u=typeof s[0]=="object"?s[0]:void 0,p=!!u?.stream,f=n.streaming===!0;if(p||f)return nz(t,i,r,s,c,l,e,u,o,p,f);let m,_=nn({name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:c},v=>(m=i.apply(r,s),o.recordInputs&&u&&qv(v,u,gr(o.enableTruncation)),m.then(h=>(ez(v,h,o.recordOutputs),h),h=>{throw Et(h,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:e}}}),h})));return Qc(m,_,"auto.ai.anthropic")}})}function jI(t,e="",n){return new Proxy(t,{get(r,o){let i=r[o],a=Jc(e,String(o)),s=UI[a];return typeof i=="function"&&s?rz(i,a,s,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?jI(i,a,n):i}})}function Vv(t,e){return jI(t,"",Or(e))}var qI={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{proxyResultPath:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},VI="google_genai";function oz(t,e){let n=t?.promptFeedback;if(n?.blockReason){let r=n.blockReasonMessage??n.blockReason;return e.setStatus({code:2,message:"internal_error"}),Et(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function iz(t,e){typeof t.responseId=="string"&&(e.responseId=t.responseId),typeof t.modelVersion=="string"&&(e.responseModel=t.modelVersion);let n=t.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(e.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(e.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(e.totalTokens=n.totalTokenCount))}function az(t,e,n){Array.isArray(t.functionCalls)&&e.toolCalls.push(...t.functionCalls);for(let r of t.candidates??[]){r?.finishReason&&!e.finishReasons.includes(r.finishReason)&&e.finishReasons.push(r.finishReason);for(let o of r?.content?.parts??[])n&&o.text&&e.responseTexts.push(o.text),o.functionCall&&e.toolCalls.push({type:"function",id:o.functionCall.id,name:o.functionCall.name,arguments:o.functionCall.args})}}function sz(t,e,n,r){!t||oz(t,r)||(iz(t,e),az(t,e,n))}async function*YI(t,e,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let o of t)sz(o,r,n,e),yield o}finally{il(e,r,n)}}function Zc(t,e="user"){return typeof t=="string"?[{role:e,content:t}]:Array.isArray(t)?t.flatMap(n=>Zc(n,e)):typeof t!="object"||!t?[]:"role"in t&&typeof t.role=="string"?[t]:"parts"in t?[{...t,role:e}]:[{role:e,content:t}]}function WI(t,e){if("model"in t&&typeof t.model=="string")return t.model;if(e&&typeof e=="object"){let n=e;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function lz(t){let e={};return"temperature"in t&&typeof t.temperature=="number"&&(e[Ha]=t.temperature),"topP"in t&&typeof t.topP=="number"&&(e[$a]=t.topP),"topK"in t&&typeof t.topK=="number"&&(e[Eh]=t.topK),"maxOutputTokens"in t&&typeof t.maxOutputTokens=="number"&&(e[Wc]=t.maxOutputTokens),"frequencyPenalty"in t&&typeof t.frequencyPenalty=="number"&&(e[Ga]=t.frequencyPenalty),"presencePenalty"in t&&typeof t.presencePenalty=="number"&&(e[Kc]=t.presencePenalty),e}function cz(t,e,n){let r={[di]:VI,[hn]:t,[at]:"auto.ai.google_genai"};if(e){if(r[ke]=WI(e,n),"config"in e&&typeof e.config=="object"&&e.config){let o=e.config;if(Object.assign(r,lz(o)),"tools"in o&&Array.isArray(o.tools)){let i=o.tools.flatMap(a=>a.functionDeclarations);r[mi]=JSON.stringify(i)}}}else r[ke]=WI({},n);return r}function KI(t,e,n,r){if(n){let i=e.contents;i!=null&&t.setAttribute(Xc,typeof i=="string"?i:JSON.stringify(i));return}let o=[];if("config"in e&&e.config&&typeof e.config=="object"&&"systemInstruction"in e.config&&e.config.systemInstruction&&o.push(...Zc(e.config.systemInstruction,"system")),"history"in e&&o.push(...Zc(e.history,"user")),"contents"in e&&o.push(...Zc(e.contents,"user")),"message"in e&&o.push(...Zc(e.message,"user")),Array.isArray(o)&&o.length){let{systemInstructions:i,filteredMessages:a}=gi(o);i&&t.setAttribute(pi,i);let s=Array.isArray(a)?a.length:0;t.setAttributes({[ro]:s,[Ho]:r?$o(a):Go(a)})}}function uz(t,e,n){if(!(!e||typeof e!="object")){if(e.modelVersion&&t.setAttribute(to,e.modelVersion),e.usageMetadata&&typeof e.usageMetadata=="object"){let r=e.usageMetadata;typeof r.promptTokenCount=="number"&&t.setAttributes({[eo]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&t.setAttributes({[no]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&t.setAttributes({[Mr]:r.totalTokenCount})}if(n&&Array.isArray(e.candidates)&&e.candidates.length>0){let r=e.candidates.map(o=>o.content?.parts&&Array.isArray(o.content.parts)?o.content.parts.map(i=>typeof i.text=="string"?i.text:"").filter(i=>i.length>0).join(""):"").filter(o=>o.length>0);r.length>0&&t.setAttributes({[Wn]:r.join("")})}if(n&&e.functionCalls){let r=e.functionCalls;Array.isArray(r)&&r.length>0&&t.setAttributes({[mr]:JSON.stringify(r)})}}}function dz(t,e,n,r,o){let i=n.operation==="embeddings";return new Proxy(t,{apply(a,s,l){let c=n.operation||"unknown",d=l[0],u=cz(c,d,r),p=u[ke]??"unknown";return n.streaming?qn({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:u},async f=>{try{o.recordInputs&&d&&KI(f,d,i,gr(o.enableTruncation));let m=await a.apply(r,l);return YI(m,f,!!o.recordOutputs)}catch(m){throw f.setStatus({code:2,message:"internal_error"}),Et(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}}),f.end(),m}}):nn({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:u},f=>(o.recordInputs&&d&&KI(f,d,i,gr(o.enableTruncation)),yf(()=>a.apply(r,l),m=>{Et(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}})},()=>{},m=>{i||uz(f,m,o.recordOutputs)})))}})}function Yv(t,e="",n){return new Proxy(t,{get:(r,o,i)=>{let a=Reflect.get(r,o,i),s=Jc(e,String(o)),l=qI[s];if(typeof a=="function"&&l){let c=l.operation?dz(a,s,l,r,n):a.bind(r);return l.proxyResultPath?function(...d){let u=c(...d);return u&&typeof u=="object"?Yv(u,l.proxyResultPath,n):u}:c}return typeof a=="function"?a.bind(r):a&&typeof a=="object"?Yv(a,s,n):a}})}function Wv(t,e){return Yv(t,"",Or(e))}var Gi="auto.ai.langchain",XI={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var oo=(t,e,n)=>{n!=null&&(t[e]=n)},Dr=(t,e,n)=>{let r=Number(n);Number.isNaN(r)||(t[e]=r)};function al(t){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function tu(t){if(Array.isArray(t))try{let e=t.map(n=>n&&typeof n=="object"&&qa(n)?ol(n):n);return JSON.stringify(e)}catch{return String(t)}return al(t)}function Pf(t){let e=t.toLowerCase();return XI[e]??e}function JI(t){return t.includes("System")?"system":t.includes("Human")?"user":t.includes("AI")||t.includes("Assistant")?"assistant":t.includes("Function")?"function":t.includes("Tool")?"tool":"user"}function Kv(t){if(!(!t||Array.isArray(t)))return t.invocation_params}function zf(t){return t.map(e=>{let n=e._getType;if(typeof n=="function"){let o=n.call(e);return{role:Pf(o),content:tu(e.content)}}if(e.lc===1&&e.kwargs){let o=e.id,i=Array.isArray(o)&&o.length>0?o[o.length-1]:"",a=typeof i=="string"?JI(i):"user";return{role:Pf(a),content:tu(e.kwargs?.content)}}if(e.type){let o=String(e.type).toLowerCase();return{role:Pf(o),content:tu(e.content)}}if(e.role)return{role:Pf(String(e.role)),content:tu(e.content)};let r=e.constructor?.name;return r&&r!=="Object"?{role:Pf(JI(r)),content:tu(e.content)}:{role:"user",content:tu(e.content)}})}function fz(t,e,n){let r={},o="kwargs"in t?t.kwargs:void 0,i=e?.temperature??n?.ls_temperature??o?.temperature;Dr(r,Ha,i);let a=e?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Dr(r,Wc,a);let s=e?.top_p??o?.top_p;Dr(r,$a,s);let l=e?.frequency_penalty;Dr(r,Ga,l);let c=e?.presence_penalty;return Dr(r,Kc,c),e&&"stream"in e&&oo(r,Yc,!!e.stream),r}function ZI(t,e,n,r,o){return{[di]:al(t??"langchain"),[hn]:"chat",[ke]:al(e),[at]:Gi,...fz(n,r,o)}}function tR(t,e,n,r,o,i){let a=i?.ls_provider,s=o?.model??i?.ls_model_name??"unknown",l=ZI(a,s,t,o,i);if(n&&Array.isArray(e)&&e.length>0){oo(l,ro,e.length);let c=e.map(d=>({role:"user",content:d}));oo(l,Ho,r?$o(c):Go(c))}return l}function eR(t,e,n,r,o,i){let a=i?.ls_provider??t.id?.[2],s=o?.model??i?.ls_model_name??"unknown",l=ZI(a,s,t,o,i);if(n&&Array.isArray(e)&&e.length>0){let c=zf(e.flat()),{systemInstructions:d,filteredMessages:u}=gi(c);d&&oo(l,pi,d);let p=Array.isArray(u)?u.length:0;oo(l,ro,p),oo(l,Ho,r?$o(u):Go(u))}return l}function pz(t,e){let n=[],r=t.flat();for(let o of r){let a=o.message?.tool_calls;if(Array.isArray(a)&&a.length>0)n.push(...a);else{let s=o.message?.content;if(Array.isArray(s))for(let l of s){let c=l;c.type==="tool_use"&&n.push(c)}}}n.length>0&&oo(e,mr,al(n))}function mz(t,e){if(!t)return;let n=t.tokenUsage,r=t.usage;if(n)Dr(e,eo,n.promptTokens),Dr(e,no,n.completionTokens),Dr(e,Mr,n.totalTokens);else if(r){Dr(e,eo,r.input_tokens),Dr(e,no,r.output_tokens);let o=Number(r.input_tokens),i=Number(r.output_tokens),a=(Number.isNaN(o)?0:o)+(Number.isNaN(i)?0:i);a>0&&Dr(e,Mr,a),r.cache_creation_input_tokens!==void 0&&Dr(e,uI,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Dr(e,dI,r.cache_read_input_tokens)}}function nR(t,e){if(!t)return;let n={};if(Array.isArray(t.generations)){let c=t.generations.flat().map(d=>d.generationInfo?.finish_reason?d.generationInfo.finish_reason:d.generation_info?.finish_reason?d.generation_info.finish_reason:null).filter(d=>typeof d=="string");if(c.length>0&&oo(n,fi,al(c)),pz(t.generations,n),e){let d=t.generations.flat().map(u=>u.text??u.message?.content).filter(u=>typeof u=="string");d.length>0&&oo(n,Wn,al(d))}}mz(t.llmOutput,n);let r=t.llmOutput,i=t.generations?.[0]?.[0]?.message,a=r?.model_name??r?.model??i?.response_metadata?.model_name;a&&oo(n,to,a);let s=r?.id??i?.id;s&&oo(n,ja,s);let l=r?.stop_reason??i?.response_metadata?.finish_reason;return l&&oo(n,sI,al(l)),n}function Nh(t){let e={},n=t?.lc_agent_name;return typeof n=="string"&&(e[rl]=n),e}function rR(t){let e=t?.invocation_params?.tools??t?.options?.tools;if(!Array.isArray(e)||e.length===0)return;let n=e.map(r=>{let o=r.function;return{type:"function",name:r.name??o?.name??"",description:r.description??o?.description}});return JSON.stringify(n)}function gz(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.addHandler=="function"&&typeof e.copy=="function"}function hz(t){return typeof t=="object"&&t?.name==="SentryCallbackHandler"}function QI(t){return t.some(hz)}function oR(t,e){if(!t)return[e];if(gz(t)){if(QI(t.handlers??[]))return t;let r=t.copy();return r.addHandler(e,!0),r}let n=Array.isArray(t)?t:[t];return QI(n)?t:[...n,e]}function eu(t={}){let{recordInputs:e,recordOutputs:n}=Or(t),r=gr(t.enableTruncation),o=new Map,i=s=>{let l=o.get(s);l?.isRecording()&&(l.end(),o.delete(s))},a={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(s,l,c,d,u,p,f,m){let _=Kv(p),v=tR(s,l,e,r,_,f),h=v[ke],y=v[hn];qn({name:`${y} ${h}`,op:"gen_ai.chat",attributes:{...Nh(f),...v,[ht]:"gen_ai.chat"}},S=>(o.set(c,S),S))},handleChatModelStart(s,l,c,d,u,p,f,m){let _=Kv(p),v=eR(s,l,e,r,_,f),h=rR(u);h&&(v[mi]=h);let y=v[ke],S=v[hn];qn({name:`${S} ${y}`,op:"gen_ai.chat",attributes:{...Nh(f),...v,[ht]:"gen_ai.chat"}},E=>(o.set(c,E),E))},handleLLMEnd(s,l,c,d,u){let p=o.get(l);if(p?.isRecording()){let f=nR(s,n);f&&p.setAttributes(f),i(l)}},handleLLMError(s,l){let c=o.get(l);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),i(l)),Et(s,{mechanism:{handled:!1,type:`${Gi}.llm_error_handler`}})},handleChainStart(s,l,c,d,u,p,f,m){if(p?.__sentry_langgraph__)return;let _=m||s.name||"unknown_chain",v={[at]:"auto.ai.langchain","langchain.chain.name":_};e&&(v["langchain.chain.inputs"]=JSON.stringify(l)),qn({name:`chain ${_}`,op:"gen_ai.invoke_agent",attributes:{...v,[ht]:"gen_ai.invoke_agent"}},h=>(o.set(c,h),h))},handleChainEnd(s,l){let c=o.get(l);c?.isRecording()&&(n&&c.setAttributes({"langchain.chain.outputs":JSON.stringify(s)}),i(l))},handleChainError(s,l){let c=o.get(l);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),i(l)),Et(s,{mechanism:{handled:!1,type:`${Gi}.chain_error_handler`}})},handleToolStart(s,l,c,d,u,p,f){if(p?.__sentry_langgraph__)return;let m=f||s.name||"unknown_tool",_={...Nh(p),[at]:Gi,[hn]:"execute_tool",[xh]:m};e&&(_[Ah]=l),qn({name:`execute_tool ${m}`,op:"gen_ai.execute_tool",attributes:{..._,[ht]:"gen_ai.execute_tool"}},v=>(o.set(c,v),v))},handleToolEnd(s,l){let c=o.get(l);if(c?.isRecording()){if(n){let d=s,u=d&&typeof d=="object"&&"content"in d?d.content:s;c.setAttributes({[kh]:typeof u=="string"?u:JSON.stringify(u)})}i(l)}},handleToolError(s,l){let c=o.get(l);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),i(l)),Et(s,{mechanism:{handled:!1,type:`${Gi}.tool_error_handler`}})},copy(){return a},toJSON(){return{lc:1,type:"not_implemented",id:a.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:a.lc_id}}};return a}var Ff="auto.ai.langgraph";function iR(t){let e=t[0];if(typeof e!="object"||!e||!("llm"in e)||!e.llm||typeof e.llm!="object")return null;let n=e.llm;return typeof n.modelName!="string"&&typeof n.model!="string"?null:n}function aR(t){let e=t[0];return typeof e=="object"&&e&&"name"in e&&typeof e.name=="string"?e.name:null}function sR(t,e,n){let r="__sentry_tool_wrapped__";for(let o of t){if(!o||typeof o!="object")continue;let i=o,a=i.invoke;if(typeof a!="function"||Object.prototype.hasOwnProperty.call(i,r))continue;let s=typeof i.name=="string"?i.name:"unknown_tool",l=typeof i.description=="string"?i.description:void 0,c=new Proxy(a,{apply(d,u,p){let f={[at]:Ff,[ht]:Fv,[hn]:"execute_tool",[xh]:s,[mI]:"function"},_=p[1]?.metadata?.lc_agent_name??n;typeof _=="string"&&(f[rl]=_),l&&(f[gI]=l);let v=p[0];if(typeof v=="object"&&v&&("id"in v&&typeof v.id=="string"&&(f[pI]=v.id),e.recordInputs)){let h="args"in v&&typeof v.args=="object"?v.args:v;try{f[Ah]=JSON.stringify(h)}catch{}}return nn({op:Fv,name:`execute_tool ${s}`,attributes:f},async h=>{try{let y=await Reflect.apply(d,u,p);if(e.recordOutputs)try{let S=y,E=S&&typeof S=="object"&&"content"in S?S.content:y;h.setAttribute(kh,typeof E=="string"?E:JSON.stringify(E))}catch{}return y}catch(y){throw h.setStatus({code:2,message:"internal_error"}),Et(y,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),y}})}});i.invoke=c,Object.defineProperty(i,r,{value:!0,enumerable:!1})}return t}function bz(t){if(!t||t.length===0)return null;let e=[];for(let n of t)if(n&&typeof n=="object"){let r=n.tool_calls;r&&Array.isArray(r)&&e.push(...r)}return e.length>0?e:null}function yz(t){let e=t,n=0,r=0,o=0;if(e.usage_metadata&&typeof e.usage_metadata=="object"){let i=e.usage_metadata;return typeof i.input_tokens=="number"&&(n=i.input_tokens),typeof i.output_tokens=="number"&&(r=i.output_tokens),typeof i.total_tokens=="number"&&(o=i.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(e.response_metadata&&typeof e.response_metadata=="object"){let i=e.response_metadata;if(i.tokenUsage&&typeof i.tokenUsage=="object"){let a=i.tokenUsage;typeof a.promptTokens=="number"&&(n=a.promptTokens),typeof a.completionTokens=="number"&&(r=a.completionTokens),typeof a.totalTokens=="number"&&(o=a.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function _z(t,e){let n=e;if(n.response_metadata&&typeof n.response_metadata=="object"){let r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&t.setAttribute(to,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&t.setAttribute(fi,[r.finish_reason])}}function lR(t){if(!t.builder?.nodes?.tools?.runnable?.tools)return null;let e=t.builder?.nodes?.tools?.runnable?.tools;return!e||!Array.isArray(e)||e.length===0?null:e.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function cR(t,e,n){let o=n?.messages;if(!o||!Array.isArray(o))return;let i=e?.length??0,a=o.length>i?o.slice(i):[];if(a.length===0)return;let s=bz(a);s&&t.setAttribute(mr,JSON.stringify(s));let l=zf(a);t.setAttribute(Wn,JSON.stringify(l));let c=0,d=0,u=0;for(let p of a){let f=yz(p);c+=f.inputTokens,d+=f.outputTokens,u+=f.totalTokens,_z(t,p)}c>0&&t.setAttribute(eo,c),d>0&&t.setAttribute(no,d),u>0&&t.setAttribute(Mr,u)}var Xv=!1,Ch="__sentry_patched__";function uR(t,e){if(Object.prototype.hasOwnProperty.call(t,Ch))return t;let n=eu(e),r=new Proxy(t,{apply(o,i,a){return Xv?Reflect.apply(o,i,a):nn({op:"gen_ai.create_agent",name:"create_agent",attributes:{[at]:Ff,[ht]:"gen_ai.create_agent",[hn]:"create_agent"}},s=>{try{let l=Reflect.apply(o,i,a),c=a.length>0?a[0]:{};c?.name&&typeof c.name=="string"&&(s.setAttribute(rl,c.name),s.updateName(`create_agent ${c.name}`));let d=l.invoke;return d&&typeof d=="function"&&(l.invoke=dR(d.bind(l),l,c,e,void 0,n)),l}catch(l){throw s.setStatus({code:2,message:"internal_error"}),Et(l,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),l}})}});return Object.defineProperty(r,Ch,{value:!0,enumerable:!1}),r}function dR(t,e,n,r,o,i){return new Proxy(t,{apply(a,s,l){let c=o?.modelName??o?.model;return nn({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[at]:Ff,[ht]:fI,[hn]:"invoke_agent"}},async d=>{try{let u=n?.name;u&&typeof u=="string"&&(d.setAttribute(cI,u),d.setAttribute(rl,u),d.updateName(`invoke_agent ${u}`)),c&&d.setAttribute(ke,c);let m=(l.length>1?l[1]:void 0)?.configurable?.thread_id;if(m&&typeof m=="string"&&d.setAttribute(Uf,m),i){let E=l[1]??{};l[1]=E;let R=E.metadata??{};E.metadata={...R,__sentry_langgraph__:!0,...typeof u=="string"?{lc_agent_name:u}:{}},E.callbacks=oR(E.callbacks,i)}let _=lR(e);_&&d.setAttribute(mi,JSON.stringify(_));let v=r.recordInputs,h=r.recordOutputs,y=l.length>0?l[0]?.messages??[]:[];if(y&&v){let E=zf(y),{systemInstructions:R,filteredMessages:C}=gi(E);R&&d.setAttribute(pi,R);let I=gr(r.enableTruncation),L=Array.isArray(C)?C.length:0;d.setAttributes({[Ho]:I?$o(C):Go(C),[ro]:L})}let S=await Reflect.apply(a,s,l);return h&&cR(d,y??null,S),S}catch(u){throw d.setStatus({code:2,message:"internal_error"}),Et(u,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),u}})}})}function Jv(t,e){if(Object.prototype.hasOwnProperty.call(t,Ch))return t;let n=Or(e),r=eu(n),o=new Proxy(t,{apply(i,a,s){let l=iR(s),c=aR(s),d=s[0];d&&Array.isArray(d.tools)&&d.tools.length>0&&sR(d.tools,n,c??void 0),Xv=!0;let u;try{u=Reflect.apply(i,a,s)}finally{Xv=!1}let p=u.invoke;if(p&&typeof p=="function"){let f={};c&&(f.name=c),u.invoke=dR(p.bind(u),u,f,n,l,r)}return u}});return Object.defineProperty(o,Ch,{value:!0,enumerable:!1}),o}function Qv(t,e){return t.compile=uR(t.compile,Or(e)),t}function fR(t,e,n){let r=n.getOptions(),o=n.getDsn(),i=r.tunnel,a=Fo(r._metadata),s={sent_at:new Date(Hn()).toISOString(),...vz(e)&&{trace:e},...a&&{sdk:a},...!!i&&o&&{dsn:en(o)}},l=n.getDataCollectionOptions().userInfo?"auto":"never",c=[{type:"span",item_count:t.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:l,infer_user_agent:l}},items:t}];return Le(s,[c])}function vz(t){return!!t.trace_id&&!!t.public_key}function pR(t){let e=156;if(e+=t.name.length*2,e+=U0(t.attributes),t.links&&t.links.length>0){let r=t.links[0]?.attributes,o=100+(r?U0(r):0);e+=o*t.links.length}return e}var mR=1e3,Sz=5e6,Hf=class{constructor(e,n){this._traceBuckets=new Map,this._client=e;let{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:i}=n??{};this._maxSpanLimit=r&&r>0&&r<=mR?r:mR,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=i&&i>0?i:Sz,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(a=>{clearTimeout(a.timeout)}),this._traceBuckets.clear()})}add(e){let n=e.trace_id,r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:Ba(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(e),r.size+=pR(e),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&($&&w.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((e,n)=>{this.flush(n)}))}flush(e){let n=this._traceBuckets.get(e);if(!n)return;if(!n.spans.size){this._removeTrace(e);return}let r=Array.from(n.spans),o=r[0]?._segmentSpan;if(!o){$&&w.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(e);return}let i=$e(o),a=r.map(l=>{let{_segmentSpan:c,...d}=l;return d}),s=fR(a,i,this._client);$&&w.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(s).then(null,l=>{$&&w.error("Error while sending streamed span envelope:",l)}),this._removeTrace(e)}_removeTrace(e){let n=this._traceBuckets.get(e);n&&clearTimeout(n.timeout),this._traceBuckets.delete(e)}};function Mh(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var nu=tt;function Oh(){return"history"in nu&&!!nu.history}function Ez(){if(!("fetch"in nu))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ru(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function ou(){if(typeof EdgeRuntime=="string")return!0;if(!Ez())return!1;if(ru(nu.fetch))return!0;let t=!1,e=nu.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow?.fetch&&(t=ru(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){$&&w.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function Dh(){return"ReportingObserver"in nu}function hi(t,e){let n="fetch",r=zn(n,t);return Fn(n,()=>hR(void 0,e)),r}function Uh(t){let e="fetch-body-resolved",n=zn(e,t);return Fn(e,()=>hR(wz)),n}function hR(t,e=!1){e&&!ou()||be(tt,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:a}=xz(r),s={args:r,fetchData:{method:i,url:a},startTimestamp:Mt()*1e3,virtualError:o,headers:Az(r)};return t||Qe("fetch",{...s}),n.apply(tt,r).then(async l=>(t?t(l):Qe("fetch",{...s,endTimestamp:Mt()*1e3,response:l}),l),l=>{Qe("fetch",{...s,endTimestamp:Mt()*1e3,error:l}),mn(l)&&l.stack===void 0&&(l.stack=o.stack,Gt(l,"framesToPop",1));let d=P()?.getOptions().enhanceFetchErrorMessages??"always";if(d!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{let f=new URL(s.fetchData.url).host;d==="always"?l.message=`${l.message} (${f})`:Gt(l,"__sentry_fetch_url_host__",f)}catch{}throw l})}})}async function Tz(t,e){if(t?.body){let n=t.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),i=!0;for(;i;){let a;try{a=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:s}=await r.read();clearTimeout(a),s&&(e(),i=!1)}catch{i=!1}finally{clearTimeout(a)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function wz(t){let e;try{e=t.clone()}catch{return}Tz(e,()=>{Qe("fetch-body-resolved",{endTimestamp:Mt()*1e3,response:t})})}function Lh(t,e){return!!t&&typeof t=="object"&&!!t[e]}function gR(t){return typeof t=="string"?t:t?Lh(t,"url")?t.url:t.toString?t.toString():"":""}function xz(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:gR(n),method:Lh(r,"method")?String(r.method).toUpperCase():Qd(n)&&Lh(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:gR(e),method:Lh(e,"method")?String(e.method).toUpperCase():"GET"}}function Az(t){let[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Qd(e))return new Headers(e.headers)}catch{}}var bR=tt;function Kn(){try{return bR.document.location.href}catch{return""}}function Va(t,e=5){if(!bR.HTMLElement)return null;let n=t;for(let r=0;r<e;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}function kz(t){let e=t.constructor?.name??"";return e.includes("OpenAI")?"openai":e.includes("Google")?"google_genai":e.includes("Mistral")?"mistralai":e.includes("Vertex")?"google_vertexai":e.includes("Bedrock")?"aws_bedrock":e.includes("Ollama")?"ollama":e.includes("Cloudflare")?"cloudflare":e.includes("Cohere")?"cohere":"langchain"}function Iz(t){let e=t??{},n={[at]:Gi,[ht]:zv,[hn]:"embeddings",[ke]:e.model??"unknown"};return n[di]=kz(e),"dimensions"in e&&(n[wh]=e.dimensions),"encodingFormat"in e&&(n[Th]=e.encodingFormat),n}function yR(t,e={}){let{recordInputs:n}=Or(e);return new Proxy(t,{apply(r,o,i){let a=Iz(o),s=a[ke]||"unknown";if(n){let l=i[0];l!=null&&(a[Xc]=typeof l=="string"?l:JSON.stringify(l))}return nn({name:`embeddings ${s}`,op:zv,attributes:a},()=>Reflect.apply(r,o,i).then(void 0,l=>{throw Et(l,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),l}))}})}function Zv(t,e){let n=t;return typeof n.embedQuery=="function"&&(n.embedQuery=yR(n.embedQuery,e)),typeof n.embedDocuments=="function"&&(n.embedDocuments=yR(n.embedDocuments,e)),t}var jo=tt,ye=jo.document,Gf=jo.navigator,BR="Report a Bug",Jz="Cancel",Qz="Send Bug Report",Zz="Confirm",tF="Report a Bug",eF="your.email@example.org",nF="Email",rF="What's the bug? What did you expect?",oF="Description",iF="Your Name",aF="Name",sF="Thank you for your report!",lF="(required)",cF="Add a screenshot",uF="Remove screenshot",dF="Highlight",fF="Hide",pF="Remove",PR="Unable to submit feedback with empty message",zR="No client setup, cannot send feedback.",FR="Unable to determine if Feedback was correctly sent.",HR="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",GR="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",mF="widget",gF="api",hF=5e3,bF={ERROR_EMPTY_MESSAGE:PR,ERROR_NO_CLIENT:zR,ERROR_TIMEOUT:FR,ERROR_FORBIDDEN:HR,ERROR_GENERIC:GR};function Fh(t,e){return e?.[t]??bF[t]}function _R(t,e){return new Error(Fh(t,e))}var cS=(t,e={includeReplay:!0})=>{let n=e.errorMessages;if(!t.message)throw _R("ERROR_EMPTY_MESSAGE",n);let r=P();if(!r)throw _R("ERROR_NO_CLIENT",n);t.tags&&Object.keys(t.tags).length&&rt().setTags(t.tags);let o=jc({source:gF,url:Kn(),...t},e);return new Promise((i,a)=>{let s=setTimeout(()=>{l(),a(Fh("ERROR_TIMEOUT",n))},3e4),l=r.on("afterSendEvent",(c,d)=>{if(c.event_id===o)return clearTimeout(s),l(),d?.statusCode&&d.statusCode>=200&&d.statusCode<300?i(o):d?.statusCode===403?a(Fh("ERROR_FORBIDDEN",n)):a(Fh("ERROR_GENERIC",n))})})},Hh=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function yF(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(Gf.userAgent)||/Macintosh/i.test(Gf.userAgent)&&Gf.maxTouchPoints&&Gf.maxTouchPoints>1||!isSecureContext)}function Bh(t,e){return{...t,...e,tags:{...t.tags,...e.tags},onFormOpen:()=>{e.onFormOpen?.(),t.onFormOpen?.()},onFormClose:()=>{e.onFormClose?.(),t.onFormClose?.()},onSubmitSuccess:(n,r)=>{e.onSubmitSuccess?.(n,r),t.onSubmitSuccess?.(n,r)},onSubmitError:n=>{e.onSubmitError?.(n),t.onSubmitError?.(n)},onFormSubmitted:()=>{e.onFormSubmitted?.(),t.onFormSubmitted?.()},themeDark:{...t.themeDark,...e.themeDark},themeLight:{...t.themeLight,...e.themeLight}}}function _F(t){let e=ye.createElement("style");return e.textContent=`
|
|
25
|
+
Url: ${ch(t)}`),!0}return!1}function J4(t,e){return e?.length?ih(t).some(n=>tn(n,e)):!1}function Q4(t,e){if(!e?.length)return!1;let n=t.transaction;return n?tn(n,e):!1}function Z4(t,e){if(!e?.length)return!1;let n=ch(t);return n?tn(n,e):!1}function tP(t,e){if(!e?.length)return!0;let n=ch(t);return n?tn(n,e):!0}function eP(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function ch(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?eP(n):null}catch{return $&&w.error(`Cannot extract url for event ${Lo(t)}`),null}}function nP(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function wv(t,e,n,r,o,i){if(!o.exception?.values||!i||!Oo(i.originalException,Error))return;let a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=Tv(t,e,r,i.originalException,n,o.exception.values,a,0))}function Tv(t,e,n,r,o,i,a,s){if(i.length>=n+1)return i;let l=[...i];if(Oo(r[o],Error)){Uk(a,s,r);let c=t(e,r[o]),d=l.length;Bk(c,o,d,s),l=Tv(t,e,n,r[o],o,[c,...l],c,d)}return Pk(r)&&r.errors.forEach((c,d)=>{if(Oo(c,Error)){Uk(a,s,r);let u=t(e,c),p=l.length;Bk(u,`errors[${d}]`,p,s),l=Tv(t,e,n,c,o,[u,...l],u,p)}}),l}function Pk(t){return Array.isArray(t.errors)}function Uk(t,e,n){t.mechanism={handled:!0,type:"auto.core.linked_errors",...Pk(n)&&{is_exception_group:!0},...t.mechanism,exception_id:e}}function Bk(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function rP(t){return mn(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function dh(t){return rP(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}var Fk=new Map,zk=new Set;function oP(t){if(nt._sentryModuleMetadata)for(let e of Object.keys(nt._sentryModuleMetadata)){let n=nt._sentryModuleMetadata[e];if(zk.has(e))continue;zk.add(e);let r=t(e);for(let o of r.reverse())if(o.filename){Fk.set(o.filename,n);break}}}function iP(t,e){return oP(t),Fk.get(e)}function fh(t,e){e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(r=>{if(!r.filename||r.module_metadata)return;let o=iP(t,r.filename);o&&(r.module_metadata=o)})})}function ph(t){t.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(n=>{delete n.module_metadata})})}var xv=()=>({name:"ModuleMetadata",setup(t){t.on("beforeEnvelope",e=>{dr(e,(n,r)=>{if(r==="event"){let o=Array.isArray(n)?n[1]:void 0;o&&(ph(o),n[1]=o)}})}),t.on("applyFrameMetadata",e=>{if(e.type)return;let n=t.getOptions().stackParser;fh(n,e)})}});var Hk=new Set([]);function nl(t){let e="console",n=zn(e,t);return Fn(e,aP),n}function aP(){"console"in nt&&wa.forEach(function(t){t in nt.console&&be(nt.console,t,function(e){return Ls[t]=e,function(...n){let r=n[0],o=Ls[t],i=Hk.size&&typeof r=="string"&&tn(r,Hk);i||Qe("console",{args:n,level:t}),(!i||$&&w.isEnabled())&&o?.apply(nt.console,n)}})})}function Hi(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var sP="CaptureConsole",lP=((t={})=>{let e=t.levels||wa,n=t.handled??!0;return{name:sP,setup(r){"console"in nt&&nl(({args:o,level:i})=>{z()!==r||!e.includes(i)||cP(o,i,n)})}}}),Av=lP;function cP(t,e,n){let r=Hi(e),o=new Error,i={level:Hi(e),extra:{arguments:t}};De(a=>{if(a.addEventProcessor(c=>(c.logger="console",En(c,{handled:n,type:"auto.core.capture_console"}),c)),e==="assert"){if(!t[0]){let c=`Assertion failed: ${ka(t.slice(1)," ")||"console.assert"}`;a.setExtra("arguments",t.slice(1)),a.captureMessage(c,r,{captureContext:i,syntheticException:o})}return}let s=t.find(c=>c instanceof Error);if(s){Et(s,i);return}let l=ka(t," ");a.captureMessage(l,r,{captureContext:i,syntheticException:o})})}var uP="Dedupe",dP=(()=>{let t;return{name:uP,processEvent(e){if(e.type)return e;try{if(fP(e,t))return $&&w.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}}),Lf=dP;function fP(t,e){return e?!!(pP(t,e)||mP(t,e)):!1}function pP(t,e){let n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!jk(t,e)||!$k(t,e))}function mP(t,e){let n=Gk(e),r=Gk(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!jk(t,e)||!$k(t,e))}function $k(t,e){let n=Us(t),r=Us(e);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],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function jk(t,e){let n=t.fingerprint,r=e.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 Gk(t){return t.exception?.values?.[0]}var gP="ExtraErrorData",hP=((t={})=>{let{depth:e=3,captureErrorCause:n=!0}=t;return{name:gP,processEvent(r,o,i){let{maxValueLength:a}=i.getOptions();return bP(r,o,e,n,a)}}}),kv=hP;function bP(t,e={},n,r,o){if(!e.originalException||!mn(e.originalException))return t;let i=e.originalException.name||e.originalException.constructor.name,a=qk(e.originalException,r,o);if(a){let s={...t.contexts},l=ue(a,n);return he(l)&&(A0(l),s[i]=l),{...t,contexts:s}}return t}function qk(t,e,n){try{let r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],o={};for(let i of Object.keys(t)){if(r.indexOf(i)!==-1)continue;let a=t[i];o[i]=mn(a)||typeof a=="string"?n?Do(`${a}`,n):`${a}`:a}if(e&&t.cause!==void 0)if(mn(t.cause)){let i=t.cause.name||t.cause.constructor.name;o.cause={[i]:qk(t.cause,!1,n)}}else o.cause=t.cause;if(typeof t.toJSON=="function"){let i=t.toJSON();for(let a of Object.keys(i)){let s=i[a];o[a]=mn(s)?s.toString():s}}return o}catch(r){$&&w.error("Unable to extract extra data from the Error object:",r)}return null}function yP(t,e){let n=0;for(let r=t.length-1;r>=0;r--){let o=t[r];o==="."?t.splice(r,1):o===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var _P=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function vP(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=_P.exec(e);return n?n.slice(1):[]}function Vk(...t){let e="",n=!1;for(let r=t.length-1;r>=-1&&!n;r--){let o=r>=0?t[r]:"/";o&&(e=`${o}/${e}`,n=o.charAt(0)==="/")}return e=yP(e.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+e||"."}function Yk(t){let e=0;for(;e<t.length&&t[e]==="";e++);let n=t.length-1;for(;n>=0&&t[n]==="";n--);return e>n?[]:t.slice(e,n-e+1)}function Wk(t,e){t=Vk(t).slice(1),e=Vk(e).slice(1);let n=Yk(t.split("/")),r=Yk(e.split("/")),o=Math.min(n.length,r.length),i=o;for(let s=0;s<o;s++)if(n[s]!==r[s]){i=s;break}let a=[];for(let s=i;s<n.length;s++)a.push("..");return a=a.concat(r.slice(i)),a.join("/")}function Kk(t,e){let n=vP(t)[2]||"";return e&&n.slice(e.length*-1)===e&&(n=n.slice(0,n.length-e.length)),n}var SP="RewriteFrames",Iv=(t={})=>{let e=t.root,n=t.prefix||"app:///",r="window"in nt&&!!nt.window,o=t.iteratee||EP({isBrowser:r,root:e,prefix:n});function i(s){try{return{...s,exception:{...s.exception,values:s.exception.values.map(l=>({...l,...l.stacktrace&&{stacktrace:a(l.stacktrace)}}))}}}catch{return s}}function a(s){return{...s,frames:s?.frames?.map(l=>o(l))}}return{name:SP,processEvent(s){let l=s;return s.exception&&Array.isArray(s.exception.values)&&(l=i(l)),l}}};function EP({isBrowser:t,root:e,prefix:n}){return r=>{if(!r.filename)return r;let o=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),i=/^\//.test(r.filename);if(t){if(e){let a=r.filename;a.indexOf(e)===0&&(r.filename=a.replace(e,n))}}else if(o||i){let a=o?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,s=e?Wk(e,a):Kk(a);r.filename=`${n}${s}`}return r}}var TP=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],wP=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],xP={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},Jk=["select","insert","upsert","update","delete"];function mh(t){try{t.__SENTRY_INSTRUMENTED__=!0}catch{}}function gh(t){try{return t.__SENTRY_INSTRUMENTED__}catch{return!1}}function Qk(t,e){if(Object.keys(e).length>0)return e;if(Array.isArray(t)&&t.length>0)return t}function AP(t,e){return Qk(t,e)!==void 0}function kP(t,e={}){switch(t){case"GET":return"select";case"POST":return e.Prefer?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function IP(t,e){if(e===""||e==="*")return"select(*)";if(t==="select")return`select(${e})`;if(t==="or"||t.endsWith(".or"))return`${t}${e}`;let[n,...r]=e.split("."),o;return n?.startsWith("fts")?o="textSearch":n?.startsWith("plfts")?o="textSearch[plain]":n?.startsWith("phfts")?o="textSearch[phrase]":n?.startsWith("wfts")?o="textSearch[websearch]":o=n&&xP[n]||"filter",`${o}(${t}, ${r.join(".")})`}function Xk(t,e=!1){return new Proxy(t,{apply(n,r,o){return nn({name:`auth ${e?"(admin) ":""}${t.name}`,attributes:{[at]:"auto.db.supabase",[ht]:"db","db.system":"postgresql","db.operation":`auth.${e?"admin.":""}${t.name}`}},i=>Reflect.apply(n,r,o).then(a=>(a&&typeof a=="object"&&"error"in a&&a.error?(i.setStatus({code:2}),Et(a.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):i.setStatus({code:1}),i.end(),a)).catch(a=>{throw i.setStatus({code:2}),i.end(),Et(a,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),a}).then(...o))}})}function RP(t){let e=t.auth;if(!(!e||gh(t.auth))){for(let n of TP){let r=e[n];r&&typeof t.auth[n]=="function"&&(t.auth[n]=Xk(r))}for(let n of wP){let r=e.admin[n];r&&typeof t.auth.admin[n]=="function"&&(t.auth.admin[n]=Xk(r,!0))}mh(t.auth)}}function NP(t,e){gh(t.prototype.from)||(t.prototype.from=new Proxy(t.prototype.from,{apply(n,r,o){let i=Reflect.apply(n,r,o),a=i.constructor;return MP(a,e),i}}),mh(t.prototype.from))}function CP(t,e){gh(t.prototype.then)||(t.prototype.then=new Proxy(t.prototype.then,{apply(n,r,o){let i=Jk,a=r,s=kP(a.method,a.headers);if(!i.includes(s)||!a?.url?.pathname||typeof a.url.pathname!="string")return Reflect.apply(n,r,o);let l=a.url.pathname.split("/"),c=l.length>0?l[l.length-1]:"",d=[];for(let[E,R]of a.url.searchParams.entries())d.push(IP(E,R));let u=Object.create(null);if(he(a.body))for(let[E,R]of Object.entries(a.body))u[E]=R;let p=z(),f=e.sendOperationData??p?.getDataCollectionOptions().userInfo===!0,m=Qk(a.body,u),_=s==="select"?"":`${s}${AP(a.body,u)?"(...) ":""}`,v=f?d.join(" "):d.length>0?"[redacted]":"",h=[_.trimEnd(),v].filter(Boolean).join(" "),y=h?`${h} from(${c})`:`from(${c})`,S={"db.table":c,"db.schema":a.schema,"db.url":a.url.origin,"db.sdk":a.headers["X-Client-Info"],"db.system":"postgresql","db.operation":s,[at]:"auto.db.supabase",[ht]:"db"};return d.length&&f&&(S["db.query"]=d),m!==void 0&&f&&(S["db.body"]=m),nn({name:y,attributes:S},E=>Reflect.apply(n,r,[]).then(R=>{if(E&&(R&&typeof R=="object"&&"status"in R&&ri(E,R.status||500),E.end()),R?.error){let L=new Error(R.error.message);R.error.code&&(L.code=R.error.code),R.error.details&&(L.details=R.error.details);let F={};d.length&&f&&(F.query=d),m!==void 0&&f&&(F.body=m),Et(L,U=>(U.addEventProcessor(D=>(En(D,{handled:!1,type:"auto.db.supabase.postgres"}),D)),U.setContext("supabase",F),U))}let C={type:"supabase",category:`db.${s}`,message:y},k={};return d.length&&f&&(k.query=d),m!==void 0&&f&&(k.body=m),Object.keys(k).length&&(C.data=k),wn(C),R},R=>{throw E&&(ri(E,500),E.end()),R}).then(...o))}}),mh(t.prototype.then))}function MP(t,e){for(let n of Jk)gh(t.prototype[n])||(t.prototype[n]=new Proxy(t.prototype[n],{apply(r,o,i){let a=Reflect.apply(r,o,i),s=a.constructor;return $&&w.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),CP(s,e),a}}),mh(t.prototype[n]))}var hh=(t,e={})=>{if(!t){$&&w.warn("Supabase integration was not installed because no Supabase client was provided.");return}let n=t.constructor===Function?t:t.constructor;NP(n,e),RP(t)},OP="Supabase",DP=((t,e)=>({setupOnce(){hh(t,e)},name:OP})),Rv=t=>DP(t.supabaseClient,{sendOperationData:t.sendOperationData});var LP=10,UP="ZodErrors";function BP(t){return mn(t)&&t.name==="ZodError"&&Array.isArray(t.issues)}function PP(t){return{...t,path:"path"in t&&Array.isArray(t.path)?t.path.join("."):void 0,keys:"keys"in t?JSON.stringify(t.keys):void 0,unionErrors:"unionErrors"in t?JSON.stringify(t.unionErrors):void 0}}function zP(t){return t.map(e=>typeof e=="number"?"<array>":e).join(".")}function FP(t){let e=new Set;for(let r of t.issues){let o=zP(r.path);o.length>0&&e.add(o)}let n=Array.from(e);if(n.length===0){let r="variable";if(t.issues.length>0){let o=t.issues[0];o!==void 0&&"expected"in o&&typeof o.expected=="string"&&(r=o.expected)}return`Failed to validate ${r}`}return`Failed to validate keys: ${Do(n.join(", "),100)}`}function HP(t,e=!1,n,r){if(!n.exception?.values||!r.originalException||!BP(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(e?r.originalException.issues:r.originalException.issues.slice(0,t)).map(PP);return e&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:i})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:FP(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":i.slice(0,t)}}}catch(o){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:o instanceof Error?`${o.name}: ${o.message}
|
|
26
|
+
${o.stack}`:"unknown"}}}}}var GP=((t={})=>{let e=t.limit??LP;return{name:UP,processEvent(n,r){return HP(e,t.saveZodIssuesAsAttachment,n,r)}}}),Nv=GP;var Cv=t=>({name:"ThirdPartyErrorsFilter",setup(e){e.on("beforeEnvelope",n=>{dr(n,(r,o)=>{if(o==="event"){let i=Array.isArray(r)?r[1]:void 0;i&&(ph(i),r[1]=i)}})}),e.on("applyFrameMetadata",n=>{if(n.type)return;let r=e.getOptions().stackParser;fh(r,n)})},preprocessEvent(e){t.ignoreSentryInternalFrames&&(nt._sentryWrappedDepth??0)>0&&(e.sdkProcessingMetadata={...e.sdkProcessingMetadata,insideSentryWrapped:!0})},processEvent(e){let n=t.ignoreSentryInternalFrames?e.sdkProcessingMetadata?.insideSentryWrapped===!0&&e.exception?.values?.length===1:!1,r=jP(e,t.ignoreSentryInternalFrames,n);if(r){let o=t.behaviour==="drop-error-if-contains-third-party-frames"||t.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(r[o](a=>!a.some(s=>t.filterKeys.includes(s)))){if(t.behaviour==="drop-error-if-contains-third-party-frames"||t.behaviour==="drop-error-if-exclusively-contains-third-party-frames")return null;e.tags={...e.tags,third_party_code:!0}}}return e}});function $P(t,e,n){if(e!==0)return!1;if(n&&qP(t)||t.function==="sentryWrapped")return!0;if(!t.context_line||!t.filename||!t.filename.includes("sentry")||!t.filename.includes("helpers")||!t.context_line.includes(YP))return!1;if(t.pre_context){let r=t.pre_context.length;for(let o=0;o<r;o++)if(t.pre_context[o]?.includes(VP))return!0}return!1}function jP(t,e,n){let r=Us(t);if(r)return r.filter((o,i)=>!o.filename||o.lineno==null&&o.colno==null&&o.instruction_addr==null?!1:!e||!$P(o,i,!!n)).map(o=>o.module_metadata?Object.keys(o.module_metadata).filter(i=>i.startsWith(Zk)).map(i=>i.slice(Zk.length)):[])}function qP(t){return!t.context_line&&!t.pre_context&&!!t.function&&t.function.length<=2}var Zk="_sentryBundlerPluginAppKey:",VP="Attempt to invoke user-land function",YP="fn.apply(this, wrappedArguments)";var tI=100,eI=10,bh="flag.evaluation.";function Cr(t){if(t.type)return t;let n=it().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(t.contexts===void 0&&(t.contexts={}),t.contexts.flags={values:[...r]}),t}function fr(t,e,n=tI){let r=it().getScopeData().contexts;r.flags||(r.flags={values:[]});let o=r.flags.values;WP(o,t,e,n)}function WP(t,e,n,r){if(typeof n!="boolean")return;if(t.length>r){$&&w.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let o=t.findIndex(i=>i.flag===e);o!==-1&&t.splice(o,1),t.length===r&&t.shift(),t.push({flag:e,result:n})}function pr(t,e,n=eI){if(typeof e!="boolean")return;let r=Dt();if(!r)return;let o=rt(r).data;if(`${bh}${t}`in o){r.setAttribute(`${bh}${t}`,e);return}Object.keys(o).filter(a=>a.startsWith(bh)).length<n&&r.setAttribute(`${bh}${t}`,e)}var Mv=()=>({name:"FeatureFlags",processEvent(t,e,n){return Cr(t)},addFeatureFlag(t,e){fr(t,e),pr(t,e)}});var Ov=({growthbookClass:t})=>({name:"GrowthBook",setupOnce(){let e=t.prototype;typeof e.isOn=="function"&&be(e,"isOn",nI),typeof e.getFeatureValue=="function"&&be(e,"getFeatureValue",nI)},processEvent(e,n,r){return Cr(e)}});function nI(t){return function(...e){let n=e[0],r=t.apply(this,e);return typeof n=="string"&&typeof r=="boolean"&&(fr(n,r),pr(n,r)),r}}var KP="ConversationId",XP=(()=>({name:KP,setup(t){t.on("spanStart",e=>{let n=it().getScopeData(),r=Pt().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:a,description:s}=rt(e);if(!i?.startsWith("gen_ai.")&&!a["ai.operationId"]&&!s?.startsWith("ai."))return;e.setAttribute(Tg,o)}})}})),Dv=XP;function Lv(t,e,n,r,o){if(!t.fetchData)return;let{method:i,url:a}=t.fetchData,s=Le()&&e(a);if(t.endTimestamp){let m=t.fetchData.__span;if(!m)return;let _=r[m];_&&(s&&(QP(_,t),JP(_,t,o)),delete r[m]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},d=z(),p=!!Dt()||!!d&&qe(d),f=s&&p?Ae(e8(a,i,l)):new ur;if(s&&!p&&d?.recordDroppedEvent("no_parent_span","span"),t.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(t.fetchData.url)){let m=t.args[0],_={...t.args[1]||{}},v=oI(m,_,Le()&&p?f:void 0,c);v&&(t.args[1]=_,_.headers=v)}if(d){let m={input:t.args,response:t.response,startTimestamp:t.startTimestamp,endTimestamp:t.endTimestamp};d.emit("beforeOutgoingRequestSpan",f,m)}return f}function JP(t,e,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(t,{headers:e.response?.headers,error:e.error})}function oI(t,e,n,r){let o=el({span:n,propagateTraceparent:r}),i=o["sentry-trace"],a=o.baggage,s=o.traceparent;if(!i)return;let l=e.headers||(Qd(t)?t.headers:void 0);if(l)if(ZP(l)){let c=new Headers(l);if(c.get("sentry-trace")||c.set("sentry-trace",i),r&&s&&!c.get("traceparent")&&c.set("traceparent",s),a){let d=c.get("baggage");d?yh(d)||c.set("baggage",`${d},${a}`):c.set("baggage",a)}return c}else if(t8(l)){let c=[...l];c.find(u=>u[0]==="sentry-trace")||c.push(["sentry-trace",i]),r&&s&&!c.find(u=>u[0]==="traceparent")&&c.push(["traceparent",s]);let d=l.find(u=>u[0]==="baggage"&&typeof u[1]=="string"&&yh(u[1]));return a&&!d&&c.push(["baggage",a]),c}else{let c="sentry-trace"in l?l["sentry-trace"]:void 0,d="traceparent"in l?l.traceparent:void 0,u="baggage"in l?l.baggage:void 0,p=u?Array.isArray(u)?[...u]:[u]:[],f=u&&(Array.isArray(u)?u.find(_=>yh(_)):yh(u));a&&!f&&p.push(a);let m=Object.assign({},l,{"sentry-trace":c??i,baggage:p.length>0?p.join(","):void 0});return r&&s&&!d&&(m.traceparent=s),m}else return{...o}}function QP(t,e){if(e.response){ri(t,e.response.status);let n=e.response?.headers?.get("content-length");if(n){let r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:2,message:"internal_error"});t.end()}function yh(t){return typeof t!="string"?!1:t.split(",").some(e=>e.trim().startsWith(of))}function ZP(t){return typeof Headers<"u"&&Oo(t,Headers)}function t8(t){return Array.isArray(t)?t.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string"):!1}function e8(t,e,n){if(t.startsWith("data:")){let i=Yn(t);return{name:`${e} ${i}`,attributes:rI(t,void 0,e,n)}}let r=ui(t),o=r?Hc(r):t;return{name:`${e} ${o}`,attributes:rI(t,r,e,n)}}function rI(t,e,n,r){let o={url:Yn(t),type:"fetch","http.method":n,[at]:r,[ht]:"http.client"};return e&&(tl(e)||(o["http.url"]=Yn(e.href),o["server.address"]=e.host),e.search&&(o["http.query"]=e.search),e.hash&&(o["http.fragment"]=e.hash)),o}function jc(t,e={},n=it()){let{message:r,name:o,email:i,url:a,source:s,associatedEventId:l,tags:c}=t,d={contexts:{feedback:{contact_email:i,name:o,message:r,url:a,source:s,associated_event_id:l}},type:"feedback",level:"info",tags:c},u=n?.getClient()||z();return u&&u.emit("beforeSendFeedback",d,e),n.captureEvent(d,e)}var _h={};_0(_h,{debug:()=>r8,error:()=>a8,fatal:()=>s8,fmt:()=>vv,info:()=>o8,trace:()=>n8,warn:()=>i8});function qc(t,e,n,r,o){Pa({level:t,message:e,attributes:n,severityNumber:o},r)}function n8(t,e,{scope:n}={}){qc("trace",t,e,n)}function r8(t,e,{scope:n}={}){qc("debug",t,e,n)}function o8(t,e,{scope:n}={}){qc("info",t,e,n)}function i8(t,e,{scope:n}={}){qc("warn",t,e,n)}function a8(t,e,{scope:n}={}){qc("error",t,e,n)}function s8(t,e,{scope:n}={}){qc("fatal",t,e,n)}function Vc(t,e,n){return"util"in nt&&typeof nt.util.format=="function"?nt.util.format(...t):l8(t,e,n)}function l8(t,e,n){return t.map(r=>Ze(r)?String(r):JSON.stringify(ue(r,e,n))).join(" ")}function vh(t){return/%[sdifocO]/.test(t)}function Sh(t,e){let n={},r=new Array(e.length).fill("{}").join(" ");return n["sentry.message.template"]=`${t} ${r}`,e.forEach((o,i)=>{n[`sentry.message.parameter.${i}`]=o}),n}var c8="ConsoleLogs",iI={[at]:"auto.log.console"},u8=((t={})=>{let e=t.levels||wa;return{name:c8,setup(n){let{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){$&&w.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let a=nl(({args:s,level:l})=>{if(z()!==n||!e.includes(l))return;let c=s[0],d=s.slice(1);if(l==="assert"){if(!c){let f=d.length>0?`Assertion failed: ${Vc(d,o,i)}`:"Assertion failed";Pa({level:"error",message:f,attributes:iI})}return}let u=l==="log",p={...iI};if(he(c)){Object.assign(p,ue(c,o,i));let f=typeof s[1]=="string"?2:1;s.slice(f).forEach((_,v)=>{p[`sentry.message.parameter.${v}`]=ue(_,o,i)})}else if(d.length>0&&typeof c=="string"&&!vh(c)){let m=Sh(c,d);for(let[_,v]of Object.entries(m))p[_]=_.startsWith("sentry.message.parameter.")?ue(v,o,i):v}Pa({level:u?"info":l,message:Vc(s,o,i),severityNumber:u?10:void 0,attributes:p})});n.registerCleanup(a)}}}),Uv=u8;var Fa={};_0(Fa,{count:()=>d8,distribution:()=>p8,gauge:()=>f8});function Bv(t,e,n,r){lv({type:t,name:e,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function d8(t,e=1,n){Bv("counter",t,e,n)}function f8(t,e,n){Bv("gauge",t,e,n)}function p8(t,e,n){Bv("distribution",t,e,n)}var m8=["trace","debug","info","warn","error","fatal"];function Pv(t={}){let e=new Set(t.levels??m8),n=t.client;return{log(r){let{type:o,level:i,message:a,args:s,tag:l,date:c,...d}=r,u=n||z();if(!u)return;let p=b8(o,i);if(!e.has(p))return;let{normalizeDepth:f=3,normalizeMaxBreadth:m=1e3}=u.getOptions(),_={};for(let[h,y]of Object.entries(d))_[h]=ue(y,f,m);_["sentry.origin"]="auto.log.consola",l&&(_["consola.tag"]=l),o&&(_["consola.type"]=o),i!=null&&typeof i=="number"&&(_["consola.level"]=i);let v=_8(y8(s,f,m),f,m);v?.attributes&&Object.assign(_,v.attributes),Pa({level:p,message:v?.message||a||s&&Vc(s,f,m)||"",attributes:_})}}}var g8={silent:"trace",fatal:"fatal",error:"error",warn:"warn",log:"info",info:"info",success:"info",fail:"error",ready:"info",start:"info",box:"info",debug:"debug",trace:"trace",verbose:"debug",critical:"fatal",notice:"info"},h8={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function b8(t,e){if(t==="verbose")return"debug";if(t==="silent")return"trace";if(t){let n=g8[t];if(n)return n}if(typeof e=="number"){let n=h8[e];if(n)return n}return"info"}function y8(t,e,n){if(!t?.length)return{message:""};let r=Vc(t,e,n),o=t[0];if(he(o)){let i=typeof t[1]=="string"?2:1,a=t.slice(i);return{message:r,attributes:o,messageParameters:a}}else{let i=t.slice(1),a=i.length>0&&typeof o=="string"&&!vh(o);return{message:r,messageTemplate:a?o:void 0,messageParameters:a?i:void 0}}}function _8(t,e,n){let{message:r,attributes:o,messageTemplate:i,messageParameters:a}=t,s={};if(i&&a){let l=Sh(i,a);for(let[c,d]of Object.entries(l))s[c]=c.startsWith("sentry.message.parameter.")?ue(d,e,n):d}else a&&a.length>0&&a.forEach((l,c)=>{s[`sentry.message.parameter.${c}`]=ue(l,e,n)});return{message:r,attributes:{...ue(o,e,n),...s}}}var aI="gen_ai.prompt",di="gen_ai.system",ke="gen_ai.request.model",Yc="gen_ai.request.stream",Ha="gen_ai.request.temperature",Wc="gen_ai.request.max_tokens",Ga="gen_ai.request.frequency_penalty",Kc="gen_ai.request.presence_penalty",$a="gen_ai.request.top_p",Eh="gen_ai.request.top_k",Th="gen_ai.request.encoding_format",wh="gen_ai.request.dimensions",fi="gen_ai.response.finish_reasons",to="gen_ai.response.model",ja="gen_ai.response.id",sI="gen_ai.response.stop_reason",eo="gen_ai.usage.input_tokens",no="gen_ai.usage.output_tokens",Mr="gen_ai.usage.total_tokens",hn="gen_ai.operation.name",ro="sentry.sdk_meta.gen_ai.input.messages.original_length",Ho="gen_ai.input.messages";var pi="gen_ai.system_instructions",Wn="gen_ai.response.text",mi="gen_ai.request.available_tools",lI="gen_ai.response.streaming",mr="gen_ai.response.tool_calls",rl="gen_ai.agent.name",cI="gen_ai.pipeline.name",Uf="gen_ai.conversation.id",uI="gen_ai.usage.cache_creation_input_tokens",dI="gen_ai.usage.cache_read_input_tokens";var fI="gen_ai.invoke_agent",Xc="gen_ai.embeddings.input",zv="gen_ai.embeddings",Fv="gen_ai.execute_tool",xh="gen_ai.tool.name",pI="gen_ai.tool.call.id",mI="gen_ai.tool.type",Ah="gen_ai.tool.input",kh="gen_ai.tool.output",gI="gen_ai.tool.description";function qa(t){return!t||typeof t!="object"?!1:S8(t)||bI(t)||v8(t)||yI(t)||_I(t)||E8(t)||T8(t)||w8(t)||x8(t)||A8(t)||k8(t)||I8(t)}function v8(t){return"image_url"in t?typeof t.image_url=="string"?t.image_url.startsWith("data:"):hI(t):!1}function hI(t){return"image_url"in t&&!!t.image_url&&typeof t.image_url=="object"&&"url"in t.image_url&&typeof t.image_url.url=="string"&&t.image_url.url.startsWith("data:")}function S8(t){return"type"in t&&typeof t.type=="string"&&"source"in t&&qa(t.source)}function bI(t){return"inlineData"in t&&!!t.inlineData&&typeof t.inlineData=="object"&&"data"in t.inlineData&&typeof t.inlineData.data=="string"}function yI(t){return"type"in t&&t.type==="input_audio"&&"input_audio"in t&&!!t.input_audio&&typeof t.input_audio=="object"&&"data"in t.input_audio&&typeof t.input_audio.data=="string"}function _I(t){return"type"in t&&t.type==="file"&&"file"in t&&!!t.file&&typeof t.file=="object"&&"file_data"in t.file&&typeof t.file.file_data=="string"}function E8(t){return"media_type"in t&&typeof t.media_type=="string"&&"data"in t}function T8(t){return"type"in t&&t.type==="file"&&"mediaType"in t&&typeof t.mediaType=="string"&&"data"in t&&typeof t.data=="string"&&!t.data.startsWith("http://")&&!t.data.startsWith("https://")}function w8(t){return"type"in t&&t.type==="image"&&"image"in t&&typeof t.image=="string"&&!t.image.startsWith("http://")&&!t.image.startsWith("https://")}function x8(t){return"type"in t&&(t.type==="blob"||t.type==="base64")}function A8(t){return"b64_json"in t}function k8(t){return"type"in t&&"result"in t&&t.type==="image_generation"}function I8(t){return"uri"in t&&typeof t.uri=="string"&&t.uri.startsWith("data:")}var Bf="[Blob substitute]",R8=["image_url","data","content","b64_json","result","uri","image"];function ol(t){let e={...t};qa(e.source)&&(e.source=ol(e.source)),bI(t)&&(e.inlineData={...t.inlineData,data:Bf}),hI(t)&&(e.image_url={...t.image_url,url:Bf}),yI(t)&&(e.input_audio={...t.input_audio,data:Bf}),_I(t)&&(e.file={...t.file,file_data:Bf});for(let n of R8)typeof e[n]=="string"&&(e[n]=Bf);return e}var SI=2e4,Ih=t=>new TextEncoder().encode(t).length,Gv=t=>Ih(JSON.stringify(t));function Rh(t,e){if(Ih(t)<=e)return t;let n=0,r=t.length,o="";for(;n<=r;){let i=Math.floor((n+r)/2),a=t.slice(0,i);Ih(a)<=e?(o=a,n=i+1):r=i-1}return o}function N8(t){return typeof t=="string"?t:"text"in t&&typeof t.text=="string"?t.text:""}function vI(t,e){return typeof t=="string"?e:{...t,text:e}}function C8(t){return t!==null&&typeof t=="object"&&"content"in t&&typeof t.content=="string"}function EI(t){return t!==null&&typeof t=="object"&&"content"in t&&Array.isArray(t.content)}function TI(t){return t!==null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)&&t.parts.length>0}function M8(t,e){let n={...t,content:""},r=Gv(n),o=e-r;if(o<=0)return[];let i=Rh(t.content,o);return[{...t,content:i}]}function O8(t){return"parts"in t&&Array.isArray(t.parts)?{key:"parts",items:t.parts}:"content"in t&&Array.isArray(t.content)?{key:"content",items:t.content}:{key:null,items:[]}}function D8(t,e){let{key:n,items:r}=O8(t);if(n===null||r.length===0)return[];let o=r.map(l=>vI(l,"")),i=Gv({...t,[n]:o}),a=e-i;if(a<=0)return[];let s=[];for(let l of r){let c=N8(l),d=Ih(c);if(d<=a)s.push(l),a-=d;else if(s.length===0){let u=Rh(c,a);u&&s.push(vI(l,u));break}else break}return s.length<=0?[]:[{...t,[n]:s}]}function L8(t,e){if(!t)return[];if(typeof t=="string"){let n=Rh(t,e);return n?[n]:[]}return typeof t!="object"?[]:C8(t)?M8(t,e):EI(t)||TI(t)?D8(t,e):[]}function Hv(t){return t.map(n=>{let r;return n&&typeof n=="object"&&(EI(n)?r={...n,content:Hv(n.content)}:"content"in n&&qa(n.content)&&(r={...n,content:ol(n.content)}),TI(n)&&(r={...r??n,parts:Hv(n.parts)}),qa(r)?r=ol(r):qa(n)&&(r=ol(n))),r??n})}function U8(t,e){if(!Array.isArray(t)||t.length===0)return t;let n=e-2,r=t[t.length-1],o=Hv([r]),i=o[0];return Gv(i)<=n?o:L8(i,n)}function wI(t){return U8(t,SI)}function xI(t){return Rh(t,SI)}function Or(t){let e=z()?.getDataCollectionOptions().genAI;return{...t,recordInputs:t?.recordInputs??e?.inputs??!1,recordOutputs:t?.recordOutputs??e?.outputs??!1}}function gr(t){if(t!==void 0)return t;let e=z();return e?!qe(e)&&e.getOptions().streamGenAiSpans===!1:!0}function Jc(t,e){return t?`${t}.${e}`:e}function AI(t,e,n,r,o){if(e!==void 0&&t.setAttributes({[eo]:e}),n!==void 0&&t.setAttributes({[no]:n}),e!==void 0||n!==void 0||r!==void 0||o!==void 0){let i=(e??0)+(n??0)+(r??0)+(o??0);t.setAttributes({[Mr]:i})}}function il(t,e,n){if(!t.isRecording())return;let r={[lI]:!0};e.responseId&&(r[ja]=e.responseId),e.responseModel&&(r[to]=e.responseModel),e.promptTokens!==void 0&&(r[eo]=e.promptTokens),e.completionTokens!==void 0&&(r[no]=e.completionTokens),e.totalTokens!==void 0?r[Mr]=e.totalTokens:(e.promptTokens!==void 0||e.completionTokens!==void 0||e.cacheCreationInputTokens!==void 0||e.cacheReadInputTokens!==void 0)&&(r[Mr]=(e.promptTokens??0)+(e.completionTokens??0)+(e.cacheCreationInputTokens??0)+(e.cacheReadInputTokens??0)),e.finishReasons.length&&(r[fi]=JSON.stringify(e.finishReasons)),n&&e.responseTexts.length&&(r[Wn]=e.responseTexts.join("")),n&&e.toolCalls.length&&(r[mr]=JSON.stringify(e.toolCalls)),t.setAttributes(r),t.end()}function Go(t){return typeof t=="string"?t:JSON.stringify(t)}function $o(t){if(typeof t=="string")return xI(t);if(Array.isArray(t)){let e=wI(t);return JSON.stringify(e)}return JSON.stringify(t)}function gi(t){if(!Array.isArray(t))return{systemInstructions:void 0,filteredMessages:t};let e=t.findIndex(a=>a&&typeof a=="object"&&"role"in a&&a.role==="system");if(e===-1)return{systemInstructions:void 0,filteredMessages:t};let n=t[e],r=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!r)return{systemInstructions:void 0,filteredMessages:t};let o=JSON.stringify([{type:"text",content:r}]),i=[...t.slice(0,e),...t.slice(e+1)];return{systemInstructions:o,filteredMessages:i}}async function B8(t,e,n){let r=t.catch(a=>{throw Et(a,{mechanism:{handled:!1,type:n}}),a}),o=await e,i=await r;return i&&typeof i=="object"&&"data"in i?{...i,data:o}:o}function Qc(t,e,n){return Nn(t)?new Proxy(t,{get(r,o){let a=o in Promise.prototype||o===Symbol.toStringTag?e:r,s=Reflect.get(a,o);return o==="withResponse"&&typeof s=="function"?function(){let c=s.call(r);return B8(c,e,n)}:typeof s=="function"?s.bind(a):s}}):e}var kI={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},P8=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],II=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...P8];function RI(t){return t!==null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.startsWith("response.")}function NI(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion.chunk"}function CI(t,e,n){if(!e||typeof e!="object")return;let r=e,o={};if(typeof r.id=="string"&&(o[ja]=r.id),typeof r.model=="string"&&(o[to]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[Uf]=r.id),r.usage&&typeof r.usage=="object"){let i=r.usage,a=i.prompt_tokens??i.input_tokens;typeof a=="number"&&(o[eo]=a);let s=i.completion_tokens??i.output_tokens;typeof s=="number"&&(o[no]=s),typeof i.total_tokens=="number"&&(o[Mr]=i.total_tokens)}if(Array.isArray(r.choices)){let i=r.choices,a=i.map(s=>s.finish_reason).filter(s=>typeof s=="string");if(a.length>0&&(o[fi]=JSON.stringify(a)),n){let s=i.map(c=>c.message?.content||"");o[Wn]=JSON.stringify(s);let l=i.map(c=>c.message?.tool_calls).filter(c=>Array.isArray(c)&&c.length>0).flat();l.length>0&&(o[mr]=JSON.stringify(l))}}if(typeof r.status=="string"&&(o[fi]||(o[fi]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!o[Wn]&&(o[Wn]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!o[mr])){let i=r.output.filter(a=>a?.type==="function_call");i.length>0&&(o[mr]=JSON.stringify(i))}t.setAttributes(o)}function z8(t){if("conversation"in t&&typeof t.conversation=="string")return t.conversation;if("previous_response_id"in t&&typeof t.previous_response_id=="string")return t.previous_response_id}function MI(t){let e={[ke]:t.model??"unknown"};"temperature"in t&&(e[Ha]=t.temperature),"top_p"in t&&(e[$a]=t.top_p),"frequency_penalty"in t&&(e[Ga]=t.frequency_penalty),"presence_penalty"in t&&(e[Kc]=t.presence_penalty),"stream"in t&&(e[Yc]=t.stream),"encoding_format"in t&&(e[Th]=t.encoding_format),"dimensions"in t&&(e[wh]=t.dimensions);let n=z8(t);return n&&(e[Uf]=n),e}function F8(t,e){for(let n of t){let r=n.index;if(!(r===void 0||!n.function))if(!(r in e.chatCompletionToolCalls))e.chatCompletionToolCalls[r]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}};else{let o=e.chatCompletionToolCalls[r];n.function.arguments&&o?.function&&(o.function.arguments+=n.function.arguments)}}}function H8(t,e,n){e.responseId=t.id??e.responseId,e.responseModel=t.model??e.responseModel,t.usage&&(e.promptTokens=t.usage.prompt_tokens,e.completionTokens=t.usage.completion_tokens,e.totalTokens=t.usage.total_tokens);for(let r of t.choices??[])n&&(r.delta?.content&&e.responseTexts.push(r.delta.content),r.delta?.tool_calls&&F8(r.delta.tool_calls,e)),r.finish_reason&&e.finishReasons.push(r.finish_reason)}function G8(t,e,n,r){if(!(t&&typeof t=="object")){e.eventTypes.push("unknown:non-object");return}if(t instanceof Error){r.setStatus({code:2,message:"internal_error"}),Et(t,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in t))return;let o=t;if(!II.includes(o.type)){e.eventTypes.push(o.type);return}if(n&&(o.type==="response.output_item.done"&&"item"in o&&e.responsesApiToolCalls.push(o.item),o.type==="response.output_text.delta"&&"delta"in o&&o.delta)){e.responseTexts.push(o.delta);return}if("response"in o){let{response:i}=o;e.responseId=i.id??e.responseId,e.responseModel=i.model??e.responseModel,i.usage&&(e.promptTokens=i.usage.input_tokens,e.completionTokens=i.usage.output_tokens,e.totalTokens=i.usage.total_tokens),i.status&&e.finishReasons.push(i.status),n&&i.output_text&&e.responseTexts.push(i.output_text)}}async function*OI(t,e,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let o of t)NI(o)?H8(o,r,n):RI(o)&&G8(o,r,n,e),yield o}finally{let o=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];il(e,{...r,toolCalls:o},n)}}function $8(t){let e=Array.isArray(t.tools)?t.tools:[],r=t.web_search_options&&typeof t.web_search_options=="object"?[{type:"web_search_options",...t.web_search_options}]:[],o=[...e,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(i){$&&w.error("Failed to serialize OpenAI tools:",i);return}}function j8(t,e){let n={[di]:"openai",[hn]:e,[at]:"auto.ai.openai"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let r=t[0],o=$8(r);o&&(n[mi]=o),Object.assign(n,MI(r))}else n[ke]="unknown";return n}function DI(t,e,n,r){if(n==="embeddings"&&"input"in e){let s=e.input;if(s==null||typeof s=="string"&&s.length===0||Array.isArray(s)&&s.length===0)return;t.setAttribute(Xc,typeof s=="string"?s:JSON.stringify(s));return}let o="input"in e?e.input:"messages"in e?e.messages:void 0;if(!o||Array.isArray(o)&&o.length===0)return;let{systemInstructions:i,filteredMessages:a}=gi(o);i&&t.setAttribute(pi,i),t.setAttribute(Ho,r?$o(a):Go(a)),Array.isArray(a)?t.setAttribute(ro,a.length):t.setAttribute(ro,1)}function q8(t,e,n,r,o){return function(...a){let s=n.operation||"unknown",l=j8(a,s),c=l[ke]||"unknown",d=a[0],u=d&&typeof d=="object"&&d.stream===!0,p={name:`${s} ${c}`,op:`gen_ai.${s}`,attributes:l};if(u){let _,v=qn(p,h=>(_=t.apply(r,a),o.recordInputs&&d&&DI(h,d,s,gr(o.enableTruncation)),(async()=>{try{let y=await _;return OI(y,h,o.recordOutputs??!1)}catch(y){throw h.setStatus({code:2,message:"internal_error"}),Et(y,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:e}}}),h.end(),y}})()));return Qc(_,v,"auto.ai.openai")}let f,m=nn(p,_=>(f=t.apply(r,a),o.recordInputs&&d&&DI(_,d,s,gr(o.enableTruncation)),f.then(v=>(CI(_,v,o.recordOutputs),v),v=>{throw Et(v,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:e}}}),v})));return Qc(f,m,"auto.ai.openai")}}function LI(t,e="",n){return new Proxy(t,{get(r,o){let i=r[o],a=Jc(e,String(o)),s=kI[a];return typeof i=="function"&&s?q8(i,a,s,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?LI(i,a,n):i}})}function $v(t,e){return LI(t,"",Or(e))}var UI={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}};function BI(t,e,n){if(Array.isArray(e)&&e.length===0)return;let{systemInstructions:r,filteredMessages:o}=gi(e);r&&t.setAttributes({[pi]:r});let i=Array.isArray(o)?o.length:1;t.setAttributes({[Ho]:n?$o(o):Go(o),[ro]:i})}var V8={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function jv(t){return t&&V8[t]||"internal_error"}function PI(t,e){e.error&&(t.setStatus({code:2,message:jv(e.error.type)}),Et(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function zI(t){let{system:e,messages:n,input:r}=t,o=typeof e=="string"?[{role:"system",content:t.system}]:[],i=Array.isArray(r)?r:r!=null?[r]:void 0,a=Array.isArray(n)?n:n!=null?[n]:[],s=i??a;return[...o,...s]}function Y8(t,e){return"type"in t&&typeof t.type=="string"&&t.type==="error"?(e.setStatus({code:2,message:jv(t.error?.type)}),Et(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function W8(t,e){if(t.type==="message_delta"&&t.usage&&"output_tokens"in t.usage&&typeof t.usage.output_tokens=="number"&&(e.completionTokens=t.usage.output_tokens),t.message){let n=t.message;n.id&&(e.responseId=n.id),n.model&&(e.responseModel=n.model),n.stop_reason&&e.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens=="number"&&(e.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(e.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(e.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function K8(t,e){t.type!=="content_block_start"||typeof t.index!="number"||!t.content_block||(t.content_block.type==="tool_use"||t.content_block.type==="server_tool_use")&&(e.activeToolBlocks[t.index]={id:t.content_block.id,name:t.content_block.name,inputJsonParts:[]})}function X8(t,e,n){if(!(t.type!=="content_block_delta"||!t.delta)){if(typeof t.index=="number"&&"partial_json"in t.delta&&typeof t.delta.partial_json=="string"){let r=e.activeToolBlocks[t.index];r&&r.inputJsonParts.push(t.delta.partial_json)}n&&typeof t.delta.text=="string"&&e.responseTexts.push(t.delta.text)}}function J8(t,e){if(t.type!=="content_block_stop"||typeof t.index!="number")return;let n=e.activeToolBlocks[t.index];if(!n)return;let r=n.inputJsonParts.join(""),o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}e.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete e.activeToolBlocks[t.index]}function FI(t,e,n,r){!(t&&typeof t=="object")||Y8(t,r)||(W8(t,e),K8(t,e),X8(t,e,n),J8(t,e))}async function*HI(t,e,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let o of t)FI(o,r,n,e),yield o}finally{il(e,r,n)}}function GI(t,e,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return t.on("streamEvent",o=>{FI(o,r,n,e)}),t.on("message",()=>{il(e,r,n)}),t.on("error",o=>{Et(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end())}),t}function Q8(t,e,n){let r={[di]:"anthropic",[hn]:n,[at]:"auto.ai.anthropic"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let o=t[0];o.tools&&Array.isArray(o.tools)&&(r[mi]=JSON.stringify(o.tools)),r[ke]=o.model??"unknown","temperature"in o&&(r[Ha]=o.temperature),"top_p"in o&&(r[$a]=o.top_p),"stream"in o&&(r[Yc]=o.stream),"top_k"in o&&(r[Eh]=o.top_k),"frequency_penalty"in o&&(r[Ga]=o.frequency_penalty),"max_tokens"in o&&(r[Wc]=o.max_tokens)}else e==="models.retrieve"||e==="models.get"?r[ke]=t[0]:r[ke]="unknown";return r}function qv(t,e,n){let r=zI(e);BI(t,r,n),"prompt"in e&&t.setAttributes({[aI]:JSON.stringify(e.prompt)})}function Z8(t,e){if("content"in e&&Array.isArray(e.content)){t.setAttributes({[Wn]:e.content.map(r=>r.text).filter(r=>!!r).join("")});let n=[];for(let r of e.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&t.setAttributes({[mr]:JSON.stringify(n)})}"completion"in e&&t.setAttributes({[Wn]:e.completion}),"input_tokens"in e&&t.setAttributes({[Wn]:JSON.stringify(e.input_tokens)})}function tz(t,e){"id"in e&&"model"in e&&(t.setAttributes({[ja]:e.id,[to]:e.model}),"usage"in e&&e.usage&&AI(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.cache_creation_input_tokens,e.usage.cache_read_input_tokens))}function ez(t,e,n){if(!(!e||typeof e!="object")){if("type"in e&&e.type==="error"){PI(t,e);return}n&&Z8(t,e),tz(t,e)}}function $I(t,e,n){throw Et(t,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end()),t}function nz(t,e,n,r,o,i,a,s,l,c,d){let u=o[ke]??"unknown",p={name:`${i} ${u}`,op:`gen_ai.${i}`,attributes:o};if(c&&!d){let f,m=qn(p,_=>(f=t.apply(n,r),l.recordInputs&&s&&qv(_,s,gr(l.enableTruncation)),(async()=>{try{let v=await f;return HI(v,_,l.recordOutputs??!1)}catch(v){return $I(v,_,a)}})()));return Qc(f,m,"auto.ai.anthropic")}else return qn(p,f=>{try{l.recordInputs&&s&&qv(f,s,gr(l.enableTruncation));let m=e.apply(n,r);return GI(m,f,l.recordOutputs??!1)}catch(m){return $I(m,f,a)}})}function rz(t,e,n,r,o){return new Proxy(t,{apply(i,a,s){let l=n.operation||"unknown",c=Q8(s,e,l),d=c[ke]??"unknown",u=typeof s[0]=="object"?s[0]:void 0,p=!!u?.stream,f=n.streaming===!0;if(p||f)return nz(t,i,r,s,c,l,e,u,o,p,f);let m,_=nn({name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:c},v=>(m=i.apply(r,s),o.recordInputs&&u&&qv(v,u,gr(o.enableTruncation)),m.then(h=>(ez(v,h,o.recordOutputs),h),h=>{throw Et(h,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:e}}}),h})));return Qc(m,_,"auto.ai.anthropic")}})}function jI(t,e="",n){return new Proxy(t,{get(r,o){let i=r[o],a=Jc(e,String(o)),s=UI[a];return typeof i=="function"&&s?rz(i,a,s,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?jI(i,a,n):i}})}function Vv(t,e){return jI(t,"",Or(e))}var qI={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{proxyResultPath:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},VI="google_genai";function oz(t,e){let n=t?.promptFeedback;if(n?.blockReason){let r=n.blockReasonMessage??n.blockReason;return e.setStatus({code:2,message:"internal_error"}),Et(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function iz(t,e){typeof t.responseId=="string"&&(e.responseId=t.responseId),typeof t.modelVersion=="string"&&(e.responseModel=t.modelVersion);let n=t.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(e.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(e.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(e.totalTokens=n.totalTokenCount))}function az(t,e,n){Array.isArray(t.functionCalls)&&e.toolCalls.push(...t.functionCalls);for(let r of t.candidates??[]){r?.finishReason&&!e.finishReasons.includes(r.finishReason)&&e.finishReasons.push(r.finishReason);for(let o of r?.content?.parts??[])n&&o.text&&e.responseTexts.push(o.text),o.functionCall&&e.toolCalls.push({type:"function",id:o.functionCall.id,name:o.functionCall.name,arguments:o.functionCall.args})}}function sz(t,e,n,r){!t||oz(t,r)||(iz(t,e),az(t,e,n))}async function*YI(t,e,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let o of t)sz(o,r,n,e),yield o}finally{il(e,r,n)}}function Zc(t,e="user"){return typeof t=="string"?[{role:e,content:t}]:Array.isArray(t)?t.flatMap(n=>Zc(n,e)):typeof t!="object"||!t?[]:"role"in t&&typeof t.role=="string"?[t]:"parts"in t?[{...t,role:e}]:[{role:e,content:t}]}function WI(t,e){if("model"in t&&typeof t.model=="string")return t.model;if(e&&typeof e=="object"){let n=e;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function lz(t){let e={};return"temperature"in t&&typeof t.temperature=="number"&&(e[Ha]=t.temperature),"topP"in t&&typeof t.topP=="number"&&(e[$a]=t.topP),"topK"in t&&typeof t.topK=="number"&&(e[Eh]=t.topK),"maxOutputTokens"in t&&typeof t.maxOutputTokens=="number"&&(e[Wc]=t.maxOutputTokens),"frequencyPenalty"in t&&typeof t.frequencyPenalty=="number"&&(e[Ga]=t.frequencyPenalty),"presencePenalty"in t&&typeof t.presencePenalty=="number"&&(e[Kc]=t.presencePenalty),e}function cz(t,e,n){let r={[di]:VI,[hn]:t,[at]:"auto.ai.google_genai"};if(e){if(r[ke]=WI(e,n),"config"in e&&typeof e.config=="object"&&e.config){let o=e.config;if(Object.assign(r,lz(o)),"tools"in o&&Array.isArray(o.tools)){let i=o.tools.flatMap(a=>a.functionDeclarations);r[mi]=JSON.stringify(i)}}}else r[ke]=WI({},n);return r}function KI(t,e,n,r){if(n){let i=e.contents;i!=null&&t.setAttribute(Xc,typeof i=="string"?i:JSON.stringify(i));return}let o=[];if("config"in e&&e.config&&typeof e.config=="object"&&"systemInstruction"in e.config&&e.config.systemInstruction&&o.push(...Zc(e.config.systemInstruction,"system")),"history"in e&&o.push(...Zc(e.history,"user")),"contents"in e&&o.push(...Zc(e.contents,"user")),"message"in e&&o.push(...Zc(e.message,"user")),Array.isArray(o)&&o.length){let{systemInstructions:i,filteredMessages:a}=gi(o);i&&t.setAttribute(pi,i);let s=Array.isArray(a)?a.length:0;t.setAttributes({[ro]:s,[Ho]:r?$o(a):Go(a)})}}function uz(t,e,n){if(!(!e||typeof e!="object")){if(e.modelVersion&&t.setAttribute(to,e.modelVersion),e.usageMetadata&&typeof e.usageMetadata=="object"){let r=e.usageMetadata;typeof r.promptTokenCount=="number"&&t.setAttributes({[eo]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&t.setAttributes({[no]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&t.setAttributes({[Mr]:r.totalTokenCount})}if(n&&Array.isArray(e.candidates)&&e.candidates.length>0){let r=e.candidates.map(o=>o.content?.parts&&Array.isArray(o.content.parts)?o.content.parts.map(i=>typeof i.text=="string"?i.text:"").filter(i=>i.length>0).join(""):"").filter(o=>o.length>0);r.length>0&&t.setAttributes({[Wn]:r.join("")})}if(n&&e.functionCalls){let r=e.functionCalls;Array.isArray(r)&&r.length>0&&t.setAttributes({[mr]:JSON.stringify(r)})}}}function dz(t,e,n,r,o){let i=n.operation==="embeddings";return new Proxy(t,{apply(a,s,l){let c=n.operation||"unknown",d=l[0],u=cz(c,d,r),p=u[ke]??"unknown";return n.streaming?qn({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:u},async f=>{try{o.recordInputs&&d&&KI(f,d,i,gr(o.enableTruncation));let m=await a.apply(r,l);return YI(m,f,!!o.recordOutputs)}catch(m){throw f.setStatus({code:2,message:"internal_error"}),Et(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}}),f.end(),m}}):nn({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:u},f=>(o.recordInputs&&d&&KI(f,d,i,gr(o.enableTruncation)),yf(()=>a.apply(r,l),m=>{Et(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}})},()=>{},m=>{i||uz(f,m,o.recordOutputs)})))}})}function Yv(t,e="",n){return new Proxy(t,{get:(r,o,i)=>{let a=Reflect.get(r,o,i),s=Jc(e,String(o)),l=qI[s];if(typeof a=="function"&&l){let c=l.operation?dz(a,s,l,r,n):a.bind(r);return l.proxyResultPath?function(...d){let u=c(...d);return u&&typeof u=="object"?Yv(u,l.proxyResultPath,n):u}:c}return typeof a=="function"?a.bind(r):a&&typeof a=="object"?Yv(a,s,n):a}})}function Wv(t,e){return Yv(t,"",Or(e))}var Gi="auto.ai.langchain",XI={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var oo=(t,e,n)=>{n!=null&&(t[e]=n)},Dr=(t,e,n)=>{let r=Number(n);Number.isNaN(r)||(t[e]=r)};function al(t){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function tu(t){if(Array.isArray(t))try{let e=t.map(n=>n&&typeof n=="object"&&qa(n)?ol(n):n);return JSON.stringify(e)}catch{return String(t)}return al(t)}function Pf(t){let e=t.toLowerCase();return XI[e]??e}function JI(t){return t.includes("System")?"system":t.includes("Human")?"user":t.includes("AI")||t.includes("Assistant")?"assistant":t.includes("Function")?"function":t.includes("Tool")?"tool":"user"}function Kv(t){if(!(!t||Array.isArray(t)))return t.invocation_params}function zf(t){return t.map(e=>{let n=e._getType;if(typeof n=="function"){let o=n.call(e);return{role:Pf(o),content:tu(e.content)}}if(e.lc===1&&e.kwargs){let o=e.id,i=Array.isArray(o)&&o.length>0?o[o.length-1]:"",a=typeof i=="string"?JI(i):"user";return{role:Pf(a),content:tu(e.kwargs?.content)}}if(e.type){let o=String(e.type).toLowerCase();return{role:Pf(o),content:tu(e.content)}}if(e.role)return{role:Pf(String(e.role)),content:tu(e.content)};let r=e.constructor?.name;return r&&r!=="Object"?{role:Pf(JI(r)),content:tu(e.content)}:{role:"user",content:tu(e.content)}})}function fz(t,e,n){let r={},o="kwargs"in t?t.kwargs:void 0,i=e?.temperature??n?.ls_temperature??o?.temperature;Dr(r,Ha,i);let a=e?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Dr(r,Wc,a);let s=e?.top_p??o?.top_p;Dr(r,$a,s);let l=e?.frequency_penalty;Dr(r,Ga,l);let c=e?.presence_penalty;return Dr(r,Kc,c),e&&"stream"in e&&oo(r,Yc,!!e.stream),r}function ZI(t,e,n,r,o){return{[di]:al(t??"langchain"),[hn]:"chat",[ke]:al(e),[at]:Gi,...fz(n,r,o)}}function tR(t,e,n,r,o,i){let a=i?.ls_provider,s=o?.model??i?.ls_model_name??"unknown",l=ZI(a,s,t,o,i);if(n&&Array.isArray(e)&&e.length>0){oo(l,ro,e.length);let c=e.map(d=>({role:"user",content:d}));oo(l,Ho,r?$o(c):Go(c))}return l}function eR(t,e,n,r,o,i){let a=i?.ls_provider??t.id?.[2],s=o?.model??i?.ls_model_name??"unknown",l=ZI(a,s,t,o,i);if(n&&Array.isArray(e)&&e.length>0){let c=zf(e.flat()),{systemInstructions:d,filteredMessages:u}=gi(c);d&&oo(l,pi,d);let p=Array.isArray(u)?u.length:0;oo(l,ro,p),oo(l,Ho,r?$o(u):Go(u))}return l}function pz(t,e){let n=[],r=t.flat();for(let o of r){let a=o.message?.tool_calls;if(Array.isArray(a)&&a.length>0)n.push(...a);else{let s=o.message?.content;if(Array.isArray(s))for(let l of s){let c=l;c.type==="tool_use"&&n.push(c)}}}n.length>0&&oo(e,mr,al(n))}function mz(t,e){if(!t)return;let n=t.tokenUsage,r=t.usage;if(n)Dr(e,eo,n.promptTokens),Dr(e,no,n.completionTokens),Dr(e,Mr,n.totalTokens);else if(r){Dr(e,eo,r.input_tokens),Dr(e,no,r.output_tokens);let o=Number(r.input_tokens),i=Number(r.output_tokens),a=(Number.isNaN(o)?0:o)+(Number.isNaN(i)?0:i);a>0&&Dr(e,Mr,a),r.cache_creation_input_tokens!==void 0&&Dr(e,uI,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Dr(e,dI,r.cache_read_input_tokens)}}function nR(t,e){if(!t)return;let n={};if(Array.isArray(t.generations)){let c=t.generations.flat().map(d=>d.generationInfo?.finish_reason?d.generationInfo.finish_reason:d.generation_info?.finish_reason?d.generation_info.finish_reason:null).filter(d=>typeof d=="string");if(c.length>0&&oo(n,fi,al(c)),pz(t.generations,n),e){let d=t.generations.flat().map(u=>u.text??u.message?.content).filter(u=>typeof u=="string");d.length>0&&oo(n,Wn,al(d))}}mz(t.llmOutput,n);let r=t.llmOutput,i=t.generations?.[0]?.[0]?.message,a=r?.model_name??r?.model??i?.response_metadata?.model_name;a&&oo(n,to,a);let s=r?.id??i?.id;s&&oo(n,ja,s);let l=r?.stop_reason??i?.response_metadata?.finish_reason;return l&&oo(n,sI,al(l)),n}function Nh(t){let e={},n=t?.lc_agent_name;return typeof n=="string"&&(e[rl]=n),e}function rR(t){let e=t?.invocation_params?.tools??t?.options?.tools;if(!Array.isArray(e)||e.length===0)return;let n=e.map(r=>{let o=r.function;return{type:"function",name:r.name??o?.name??"",description:r.description??o?.description}});return JSON.stringify(n)}function gz(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.addHandler=="function"&&typeof e.copy=="function"}function hz(t){return typeof t=="object"&&t?.name==="SentryCallbackHandler"}function QI(t){return t.some(hz)}function oR(t,e){if(!t)return[e];if(gz(t)){if(QI(t.handlers??[]))return t;let r=t.copy();return r.addHandler(e,!0),r}let n=Array.isArray(t)?t:[t];return QI(n)?t:[...n,e]}function eu(t={}){let{recordInputs:e,recordOutputs:n}=Or(t),r=gr(t.enableTruncation),o=new Map,i=s=>{let l=o.get(s);l?.isRecording()&&(l.end(),o.delete(s))},a={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(s,l,c,d,u,p,f,m){let _=Kv(p),v=tR(s,l,e,r,_,f),h=v[ke],y=v[hn];qn({name:`${y} ${h}`,op:"gen_ai.chat",attributes:{...Nh(f),...v,[ht]:"gen_ai.chat"}},S=>(o.set(c,S),S))},handleChatModelStart(s,l,c,d,u,p,f,m){let _=Kv(p),v=eR(s,l,e,r,_,f),h=rR(u);h&&(v[mi]=h);let y=v[ke],S=v[hn];qn({name:`${S} ${y}`,op:"gen_ai.chat",attributes:{...Nh(f),...v,[ht]:"gen_ai.chat"}},E=>(o.set(c,E),E))},handleLLMEnd(s,l,c,d,u){let p=o.get(l);if(p?.isRecording()){let f=nR(s,n);f&&p.setAttributes(f),i(l)}},handleLLMError(s,l){let c=o.get(l);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),i(l)),Et(s,{mechanism:{handled:!1,type:`${Gi}.llm_error_handler`}})},handleChainStart(s,l,c,d,u,p,f,m){if(p?.__sentry_langgraph__)return;let _=m||s.name||"unknown_chain",v={[at]:"auto.ai.langchain","langchain.chain.name":_};e&&(v["langchain.chain.inputs"]=JSON.stringify(l)),qn({name:`chain ${_}`,op:"gen_ai.invoke_agent",attributes:{...v,[ht]:"gen_ai.invoke_agent"}},h=>(o.set(c,h),h))},handleChainEnd(s,l){let c=o.get(l);c?.isRecording()&&(n&&c.setAttributes({"langchain.chain.outputs":JSON.stringify(s)}),i(l))},handleChainError(s,l){let c=o.get(l);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),i(l)),Et(s,{mechanism:{handled:!1,type:`${Gi}.chain_error_handler`}})},handleToolStart(s,l,c,d,u,p,f){if(p?.__sentry_langgraph__)return;let m=f||s.name||"unknown_tool",_={...Nh(p),[at]:Gi,[hn]:"execute_tool",[xh]:m};e&&(_[Ah]=l),qn({name:`execute_tool ${m}`,op:"gen_ai.execute_tool",attributes:{..._,[ht]:"gen_ai.execute_tool"}},v=>(o.set(c,v),v))},handleToolEnd(s,l){let c=o.get(l);if(c?.isRecording()){if(n){let d=s,u=d&&typeof d=="object"&&"content"in d?d.content:s;c.setAttributes({[kh]:typeof u=="string"?u:JSON.stringify(u)})}i(l)}},handleToolError(s,l){let c=o.get(l);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),i(l)),Et(s,{mechanism:{handled:!1,type:`${Gi}.tool_error_handler`}})},copy(){return a},toJSON(){return{lc:1,type:"not_implemented",id:a.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:a.lc_id}}};return a}var Ff="auto.ai.langgraph";function iR(t){let e=t[0];if(typeof e!="object"||!e||!("llm"in e)||!e.llm||typeof e.llm!="object")return null;let n=e.llm;return typeof n.modelName!="string"&&typeof n.model!="string"?null:n}function aR(t){let e=t[0];return typeof e=="object"&&e&&"name"in e&&typeof e.name=="string"?e.name:null}function sR(t,e,n){let r="__sentry_tool_wrapped__";for(let o of t){if(!o||typeof o!="object")continue;let i=o,a=i.invoke;if(typeof a!="function"||Object.prototype.hasOwnProperty.call(i,r))continue;let s=typeof i.name=="string"?i.name:"unknown_tool",l=typeof i.description=="string"?i.description:void 0,c=new Proxy(a,{apply(d,u,p){let f={[at]:Ff,[ht]:Fv,[hn]:"execute_tool",[xh]:s,[mI]:"function"},_=p[1]?.metadata?.lc_agent_name??n;typeof _=="string"&&(f[rl]=_),l&&(f[gI]=l);let v=p[0];if(typeof v=="object"&&v&&("id"in v&&typeof v.id=="string"&&(f[pI]=v.id),e.recordInputs)){let h="args"in v&&typeof v.args=="object"?v.args:v;try{f[Ah]=JSON.stringify(h)}catch{}}return nn({op:Fv,name:`execute_tool ${s}`,attributes:f},async h=>{try{let y=await Reflect.apply(d,u,p);if(e.recordOutputs)try{let S=y,E=S&&typeof S=="object"&&"content"in S?S.content:y;h.setAttribute(kh,typeof E=="string"?E:JSON.stringify(E))}catch{}return y}catch(y){throw h.setStatus({code:2,message:"internal_error"}),Et(y,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),y}})}});i.invoke=c,Object.defineProperty(i,r,{value:!0,enumerable:!1})}return t}function bz(t){if(!t||t.length===0)return null;let e=[];for(let n of t)if(n&&typeof n=="object"){let r=n.tool_calls;r&&Array.isArray(r)&&e.push(...r)}return e.length>0?e:null}function yz(t){let e=t,n=0,r=0,o=0;if(e.usage_metadata&&typeof e.usage_metadata=="object"){let i=e.usage_metadata;return typeof i.input_tokens=="number"&&(n=i.input_tokens),typeof i.output_tokens=="number"&&(r=i.output_tokens),typeof i.total_tokens=="number"&&(o=i.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(e.response_metadata&&typeof e.response_metadata=="object"){let i=e.response_metadata;if(i.tokenUsage&&typeof i.tokenUsage=="object"){let a=i.tokenUsage;typeof a.promptTokens=="number"&&(n=a.promptTokens),typeof a.completionTokens=="number"&&(r=a.completionTokens),typeof a.totalTokens=="number"&&(o=a.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function _z(t,e){let n=e;if(n.response_metadata&&typeof n.response_metadata=="object"){let r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&t.setAttribute(to,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&t.setAttribute(fi,[r.finish_reason])}}function lR(t){if(!t.builder?.nodes?.tools?.runnable?.tools)return null;let e=t.builder?.nodes?.tools?.runnable?.tools;return!e||!Array.isArray(e)||e.length===0?null:e.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function cR(t,e,n){let o=n?.messages;if(!o||!Array.isArray(o))return;let i=e?.length??0,a=o.length>i?o.slice(i):[];if(a.length===0)return;let s=bz(a);s&&t.setAttribute(mr,JSON.stringify(s));let l=zf(a);t.setAttribute(Wn,JSON.stringify(l));let c=0,d=0,u=0;for(let p of a){let f=yz(p);c+=f.inputTokens,d+=f.outputTokens,u+=f.totalTokens,_z(t,p)}c>0&&t.setAttribute(eo,c),d>0&&t.setAttribute(no,d),u>0&&t.setAttribute(Mr,u)}var Xv=!1,Ch="__sentry_patched__";function uR(t,e){if(Object.prototype.hasOwnProperty.call(t,Ch))return t;let n=eu(e),r=new Proxy(t,{apply(o,i,a){return Xv?Reflect.apply(o,i,a):nn({op:"gen_ai.create_agent",name:"create_agent",attributes:{[at]:Ff,[ht]:"gen_ai.create_agent",[hn]:"create_agent"}},s=>{try{let l=Reflect.apply(o,i,a),c=a.length>0?a[0]:{};c?.name&&typeof c.name=="string"&&(s.setAttribute(rl,c.name),s.updateName(`create_agent ${c.name}`));let d=l.invoke;return d&&typeof d=="function"&&(l.invoke=dR(d.bind(l),l,c,e,void 0,n)),l}catch(l){throw s.setStatus({code:2,message:"internal_error"}),Et(l,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),l}})}});return Object.defineProperty(r,Ch,{value:!0,enumerable:!1}),r}function dR(t,e,n,r,o,i){return new Proxy(t,{apply(a,s,l){let c=o?.modelName??o?.model;return nn({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[at]:Ff,[ht]:fI,[hn]:"invoke_agent"}},async d=>{try{let u=n?.name;u&&typeof u=="string"&&(d.setAttribute(cI,u),d.setAttribute(rl,u),d.updateName(`invoke_agent ${u}`)),c&&d.setAttribute(ke,c);let m=(l.length>1?l[1]:void 0)?.configurable?.thread_id;if(m&&typeof m=="string"&&d.setAttribute(Uf,m),i){let E=l[1]??{};l[1]=E;let R=E.metadata??{};E.metadata={...R,__sentry_langgraph__:!0,...typeof u=="string"?{lc_agent_name:u}:{}},E.callbacks=oR(E.callbacks,i)}let _=lR(e);_&&d.setAttribute(mi,JSON.stringify(_));let v=r.recordInputs,h=r.recordOutputs,y=l.length>0?l[0]?.messages??[]:[];if(y&&v){let E=zf(y),{systemInstructions:R,filteredMessages:C}=gi(E);R&&d.setAttribute(pi,R);let k=gr(r.enableTruncation),L=Array.isArray(C)?C.length:0;d.setAttributes({[Ho]:k?$o(C):Go(C),[ro]:L})}let S=await Reflect.apply(a,s,l);return h&&cR(d,y??null,S),S}catch(u){throw d.setStatus({code:2,message:"internal_error"}),Et(u,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),u}})}})}function Jv(t,e){if(Object.prototype.hasOwnProperty.call(t,Ch))return t;let n=Or(e),r=eu(n),o=new Proxy(t,{apply(i,a,s){let l=iR(s),c=aR(s),d=s[0];d&&Array.isArray(d.tools)&&d.tools.length>0&&sR(d.tools,n,c??void 0),Xv=!0;let u;try{u=Reflect.apply(i,a,s)}finally{Xv=!1}let p=u.invoke;if(p&&typeof p=="function"){let f={};c&&(f.name=c),u.invoke=dR(p.bind(u),u,f,n,l,r)}return u}});return Object.defineProperty(o,Ch,{value:!0,enumerable:!1}),o}function Qv(t,e){return t.compile=uR(t.compile,Or(e)),t}function fR(t,e,n){let r=n.getOptions(),o=n.getDsn(),i=r.tunnel,a=Fo(r._metadata),s={sent_at:new Date(Hn()).toISOString(),...vz(e)&&{trace:e},...a&&{sdk:a},...!!i&&o&&{dsn:en(o)}},l=n.getDataCollectionOptions().userInfo?"auto":"never",c=[{type:"span",item_count:t.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:l,infer_user_agent:l}},items:t}];return Ue(s,[c])}function vz(t){return!!t.trace_id&&!!t.public_key}function pR(t){let e=156;if(e+=t.name.length*2,e+=U0(t.attributes),t.links&&t.links.length>0){let r=t.links[0]?.attributes,o=100+(r?U0(r):0);e+=o*t.links.length}return e}var mR=1e3,Sz=5e6,Hf=class{constructor(e,n){this._traceBuckets=new Map,this._client=e;let{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:i}=n??{};this._maxSpanLimit=r&&r>0&&r<=mR?r:mR,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=i&&i>0?i:Sz,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(a=>{clearTimeout(a.timeout)}),this._traceBuckets.clear()})}add(e){let n=e.trace_id,r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:Ba(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(e),r.size+=pR(e),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&($&&w.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((e,n)=>{this.flush(n)}))}flush(e){let n=this._traceBuckets.get(e);if(!n)return;if(!n.spans.size){this._removeTrace(e);return}let r=Array.from(n.spans),o=r[0]?._segmentSpan;if(!o){$&&w.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(e);return}let i=je(o),a=r.map(l=>{let{_segmentSpan:c,...d}=l;return d}),s=fR(a,i,this._client);$&&w.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(s).then(null,l=>{$&&w.error("Error while sending streamed span envelope:",l)}),this._removeTrace(e)}_removeTrace(e){let n=this._traceBuckets.get(e);n&&clearTimeout(n.timeout),this._traceBuckets.delete(e)}};function Mh(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var nu=nt;function Oh(){return"history"in nu&&!!nu.history}function Ez(){if(!("fetch"in nu))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ru(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function ou(){if(typeof EdgeRuntime=="string")return!0;if(!Ez())return!1;if(ru(nu.fetch))return!0;let t=!1,e=nu.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow?.fetch&&(t=ru(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){$&&w.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function Dh(){return"ReportingObserver"in nu}function hi(t,e){let n="fetch",r=zn(n,t);return Fn(n,()=>hR(void 0,e)),r}function Uh(t){let e="fetch-body-resolved",n=zn(e,t);return Fn(e,()=>hR(wz)),n}function hR(t,e=!1){e&&!ou()||be(nt,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:a}=xz(r),s={args:r,fetchData:{method:i,url:a},startTimestamp:Mt()*1e3,virtualError:o,headers:Az(r)};return t||Qe("fetch",{...s}),n.apply(nt,r).then(async l=>(t?t(l):Qe("fetch",{...s,endTimestamp:Mt()*1e3,response:l}),l),l=>{Qe("fetch",{...s,endTimestamp:Mt()*1e3,error:l}),mn(l)&&l.stack===void 0&&(l.stack=o.stack,Gt(l,"framesToPop",1));let d=z()?.getOptions().enhanceFetchErrorMessages??"always";if(d!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{let f=new URL(s.fetchData.url).host;d==="always"?l.message=`${l.message} (${f})`:Gt(l,"__sentry_fetch_url_host__",f)}catch{}throw l})}})}async function Tz(t,e){if(t?.body){let n=t.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),i=!0;for(;i;){let a;try{a=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:s}=await r.read();clearTimeout(a),s&&(e(),i=!1)}catch{i=!1}finally{clearTimeout(a)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function wz(t){let e;try{e=t.clone()}catch{return}Tz(e,()=>{Qe("fetch-body-resolved",{endTimestamp:Mt()*1e3,response:t})})}function Lh(t,e){return!!t&&typeof t=="object"&&!!t[e]}function gR(t){return typeof t=="string"?t:t?Lh(t,"url")?t.url:t.toString?t.toString():"":""}function xz(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:gR(n),method:Lh(r,"method")?String(r.method).toUpperCase():Qd(n)&&Lh(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:gR(e),method:Lh(e,"method")?String(e.method).toUpperCase():"GET"}}function Az(t){let[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Qd(e))return new Headers(e.headers)}catch{}}var bR=nt;function Kn(){try{return bR.document.location.href}catch{return""}}function Va(t,e=5){if(!bR.HTMLElement)return null;let n=t;for(let r=0;r<e;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}function kz(t){let e=t.constructor?.name??"";return e.includes("OpenAI")?"openai":e.includes("Google")?"google_genai":e.includes("Mistral")?"mistralai":e.includes("Vertex")?"google_vertexai":e.includes("Bedrock")?"aws_bedrock":e.includes("Ollama")?"ollama":e.includes("Cloudflare")?"cloudflare":e.includes("Cohere")?"cohere":"langchain"}function Iz(t){let e=t??{},n={[at]:Gi,[ht]:zv,[hn]:"embeddings",[ke]:e.model??"unknown"};return n[di]=kz(e),"dimensions"in e&&(n[wh]=e.dimensions),"encodingFormat"in e&&(n[Th]=e.encodingFormat),n}function yR(t,e={}){let{recordInputs:n}=Or(e);return new Proxy(t,{apply(r,o,i){let a=Iz(o),s=a[ke]||"unknown";if(n){let l=i[0];l!=null&&(a[Xc]=typeof l=="string"?l:JSON.stringify(l))}return nn({name:`embeddings ${s}`,op:zv,attributes:a},()=>Reflect.apply(r,o,i).then(void 0,l=>{throw Et(l,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),l}))}})}function Zv(t,e){let n=t;return typeof n.embedQuery=="function"&&(n.embedQuery=yR(n.embedQuery,e)),typeof n.embedDocuments=="function"&&(n.embedDocuments=yR(n.embedDocuments,e)),t}var jo=nt,ye=jo.document,Gf=jo.navigator,BR="Report a Bug",Jz="Cancel",Qz="Send Bug Report",Zz="Confirm",tF="Report a Bug",eF="your.email@example.org",nF="Email",rF="What's the bug? What did you expect?",oF="Description",iF="Your Name",aF="Name",sF="Thank you for your report!",lF="(required)",cF="Add a screenshot",uF="Remove screenshot",dF="Highlight",fF="Hide",pF="Remove",PR="Unable to submit feedback with empty message",zR="No client setup, cannot send feedback.",FR="Unable to determine if Feedback was correctly sent.",HR="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",GR="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",mF="widget",gF="api",hF=5e3,bF={ERROR_EMPTY_MESSAGE:PR,ERROR_NO_CLIENT:zR,ERROR_TIMEOUT:FR,ERROR_FORBIDDEN:HR,ERROR_GENERIC:GR};function Fh(t,e){return e?.[t]??bF[t]}function _R(t,e){return new Error(Fh(t,e))}var cS=(t,e={includeReplay:!0})=>{let n=e.errorMessages;if(!t.message)throw _R("ERROR_EMPTY_MESSAGE",n);let r=z();if(!r)throw _R("ERROR_NO_CLIENT",n);t.tags&&Object.keys(t.tags).length&&it().setTags(t.tags);let o=jc({source:gF,url:Kn(),...t},e);return new Promise((i,a)=>{let s=setTimeout(()=>{l(),a(Fh("ERROR_TIMEOUT",n))},3e4),l=r.on("afterSendEvent",(c,d)=>{if(c.event_id===o)return clearTimeout(s),l(),d?.statusCode&&d.statusCode>=200&&d.statusCode<300?i(o):d?.statusCode===403?a(Fh("ERROR_FORBIDDEN",n)):a(Fh("ERROR_GENERIC",n))})})},Hh=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function yF(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(Gf.userAgent)||/Macintosh/i.test(Gf.userAgent)&&Gf.maxTouchPoints&&Gf.maxTouchPoints>1||!isSecureContext)}function Bh(t,e){return{...t,...e,tags:{...t.tags,...e.tags},onFormOpen:()=>{e.onFormOpen?.(),t.onFormOpen?.()},onFormClose:()=>{e.onFormClose?.(),t.onFormClose?.()},onSubmitSuccess:(n,r)=>{e.onSubmitSuccess?.(n,r),t.onSubmitSuccess?.(n,r)},onSubmitError:n=>{e.onSubmitError?.(n),t.onSubmitError?.(n)},onFormSubmitted:()=>{e.onFormSubmitted?.(),t.onFormSubmitted?.()},themeDark:{...t.themeDark,...e.themeDark},themeLight:{...t.themeLight,...e.themeLight}}}function _F(t){let e=ye.createElement("style");return e.textContent=`
|
|
27
27
|
.widget__actor {
|
|
28
28
|
position: fixed;
|
|
29
29
|
z-index: var(--z-index);
|
|
@@ -111,7 +111,7 @@ ${t==="system"?`
|
|
|
111
111
|
${SR({...vR,...e})}
|
|
112
112
|
}
|
|
113
113
|
}`:""}
|
|
114
|
-
`,r&&o.setAttribute("nonce",r),o}var Yh=({lazyLoadIntegration:t,getModalIntegration:e,getScreenshotIntegration:n})=>(({id:o="sentry-feedback",autoInject:i=!0,showBranding:a=!0,isEmailRequired:s=!1,isNameRequired:l=!1,showEmail:c=!0,showName:d=!0,enableScreenshot:u=!0,useSentryUser:p={email:"email",name:"username"},tags:f,styleNonce:m,scriptNonce:_,colorScheme:v="system",themeLight:h={},themeDark:y={},addScreenshotButtonLabel:S=cF,cancelButtonLabel:E=Jz,confirmButtonLabel:R=Zz,emailLabel:C=nF,emailPlaceholder:I=eF,formTitle:L=tF,isRequiredLabel:z=lF,messageLabel:U=oF,messagePlaceholder:D=rF,nameLabel:N=aF,namePlaceholder:B=iF,removeScreenshotButtonLabel:V=uF,submitButtonLabel:st=Qz,successMessageText:nt=sF,triggerLabel:lt=BR,triggerAriaLabel:X="",highlightToolText:ct=dF,hideToolText:F=fF,removeHighlightText:gt=pF,errorEmptyMessageText:J=PR,errorNoClientText:dt=zR,errorTimeoutText:Xt=FR,errorForbiddenText:Ce=HR,errorGenericText:_n=GR,onFormOpen:Pn,onFormClose:Z,onSubmitSuccess:Vt,onSubmitError:Ut,onFormSubmitted:ft}={})=>{let te={id:o,autoInject:i,showBranding:a,isEmailRequired:s,isNameRequired:l,showEmail:c,showName:d,enableScreenshot:u,useSentryUser:p,tags:f,styleNonce:m,scriptNonce:_,colorScheme:v,themeDark:y,themeLight:h,triggerLabel:lt,triggerAriaLabel:X,cancelButtonLabel:E,submitButtonLabel:st,confirmButtonLabel:R,formTitle:L,emailLabel:C,emailPlaceholder:I,messageLabel:U,messagePlaceholder:D,nameLabel:N,namePlaceholder:B,successMessageText:nt,isRequiredLabel:z,addScreenshotButtonLabel:S,removeScreenshotButtonLabel:V,highlightToolText:ct,hideToolText:F,removeHighlightText:gt,errorEmptyMessageText:J,errorNoClientText:dt,errorTimeoutText:Xt,errorForbiddenText:Ce,errorGenericText:_n,onFormClose:Z,onFormOpen:Pn,onSubmitError:Ut,onSubmitSuccess:Vt,onFormSubmitted:ft},mt=null,oe=null,Qt=[],cn=ut=>{if(!mt){let Ft=ye.createElement("div");Ft.id=String(ut.id),ye.body.appendChild(Ft),mt=Ft.attachShadow({mode:"open"}),oe=ER(ut),mt.appendChild(oe)}return mt},un=async ut=>{let Ft=ut.enableScreenshot&&yF(),yt,kt;try{yt=(e?e():await t("feedbackModalIntegration",_))(),Xs(yt)}catch{throw Hh&&w.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{let Ht=Ft?n?n():await t("feedbackScreenshotIntegration",_):void 0;Ht&&(kt=Ht(),Xs(kt))}catch{Hh&&w.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}let bt={ERROR_EMPTY_MESSAGE:ut.errorEmptyMessageText,ERROR_NO_CLIENT:ut.errorNoClientText,ERROR_TIMEOUT:ut.errorTimeoutText,ERROR_FORBIDDEN:ut.errorForbiddenText,ERROR_GENERIC:ut.errorGenericText},K=(Ht,fn)=>cS(Ht,{includeReplay:!0,...fn,errorMessages:bt}),vt=yt.createDialog({options:{...ut,onFormClose:()=>{vt?.close(),ut.onFormClose?.()},onFormSubmitted:()=>{vt?.close(),ut.onFormSubmitted?.()}},screenshotIntegration:kt,sendFeedback:K,shadow:cn(ut)});return vt},He=(ut,Ft={})=>{let yt=Bh(te,Ft),kt=typeof ut=="string"?ye.querySelector(ut):typeof ut.addEventListener=="function"?ut:null;if(!kt)throw Hh&&w.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let bt=null,K=async()=>{bt||(bt=await un({...yt,onFormSubmitted:()=>{bt?.removeFromDom(),yt.onFormSubmitted?.()}})),bt.appendToDom(),bt.open()};kt.addEventListener("click",K);let vt=()=>{Qt=Qt.filter(Ht=>Ht!==vt),bt?.removeFromDom(),bt=null,kt.removeEventListener("click",K)};return Qt.push(vt),vt},dn=(ut={})=>{let Ft=Bh(te,ut),yt=cn(Ft),kt=EF({triggerLabel:Ft.triggerLabel,triggerAriaLabel:Ft.triggerAriaLabel,shadow:yt,styleNonce:m});return He(kt.el,{...Ft,onFormOpen(){kt.hide()},onFormClose(){kt.show()},onFormSubmitted(){kt.show()}}),kt};return{name:"Feedback",setupOnce(){!Vn()||!te.autoInject||(ye.readyState==="loading"?ye.addEventListener("DOMContentLoaded",()=>dn().appendToDom()):dn().appendToDom())},attachTo:He,createWidget(ut={}){let Ft=dn(Bh(te,ut));return Ft.appendToDom(),Ft},async createForm(ut={}){return un(Bh(te,ut))},setTheme(ut){if(te.colorScheme=ut,mt){let Ft=ER(te);oe?mt.replaceChild(Ft,oe):mt.prepend(Ft),oe=Ft}},remove(){mt&&(mt.parentElement?.remove(),mt=null,oe=null),Qt.forEach(ut=>ut()),Qt=[]}}});function jR(){return P()?.getIntegrationByName("Feedback")}var Wh,ve,qR,sl,TR,VR,iS,$f={},uS=[],wF=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dS=Array.isArray;function Wa(t,e){for(var n in e)t[n]=e[n];return t}function YR(t){var e=t.parentNode;e&&e.removeChild(t)}function qt(t,e,n){var r,o,i,a={};for(i in e)i=="key"?r=e[i]:i=="ref"?o=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?Wh.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)a[i]===void 0&&(a[i]=t.defaultProps[i]);return Gh(t,a,r,o,null)}function Gh(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++qR,__i:-1,__u:0};return o==null&&ve.vnode!=null&&ve.vnode(i),i}function jf(t){return t.children}function $h(t,e){this.props=t,this.context=e}function su(t,e){if(e==null)return t.__?su(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?su(t):null}function xF(t,e,n){var r,o=t.__v,i=o.__e,a=t.__P;if(a)return(r=Wa({},o)).__v=o.__v+1,ve.vnode&&ve.vnode(r),fS(a,r,o,t.__n,a.ownerSVGElement!==void 0,32&o.__u?[i]:null,e,i??su(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&WR(r),r}function WR(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return WR(t)}}function wR(t){(!t.__d&&(t.__d=!0)&&sl.push(t)&&!Vh.__r++||TR!==ve.debounceRendering)&&((TR=ve.debounceRendering)||VR)(Vh)}function Vh(){var t,e,n,r=[],o=[];for(sl.sort(iS);t=sl.shift();)t.__d&&(n=sl.length,e=xF(t,r,o)||e,n===0||sl.length>n?(aS(r,e,o),o.length=r.length=0,e=void 0,sl.sort(iS)):e&&ve.__c&&ve.__c(e,uS));e&&aS(r,e,o),Vh.__r=0}function KR(t,e,n,r,o,i,a,s,l,c,d){var u,p,f,m,_,v=r&&r.__k||uS,h=e.length;for(n.__d=l,AF(n,e,v),l=n.__d,u=0;u<h;u++)(f=n.__k[u])!=null&&typeof f!="boolean"&&typeof f!="function"&&(p=f.__i===-1?$f:v[f.__i]||$f,f.__i=u,fS(t,f,p,o,i,a,s,l,c,d),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&pS(p.ref,null,f),d.push(f.ref,f.__c||m,f)),_==null&&m!=null&&(_=m),65536&f.__u||p.__k===f.__k?l=XR(f,l,t):typeof f.type=="function"&&f.__d!==void 0?l=f.__d:m&&(l=m.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=l,n.__e=_}function AF(t,e,n){var r,o,i,a,s,l=e.length,c=n.length,d=c,u=0;for(t.__k=[],r=0;r<l;r++)(o=t.__k[r]=(o=e[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Gh(null,o,null,null,o):dS(o)?Gh(jf,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Gh(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=t,o.__b=t.__b+1,s=kF(o,n,a=r+u,d),o.__i=s,i=null,s!==-1&&(d--,(i=n[s])&&(i.__u|=131072)),i==null||i.__v===null?(s==-1&&u--,typeof o.type!="function"&&(o.__u|=65536)):s!==a&&(s===a+1?u++:s>a?d>l-a?u+=s-a:u--:u=s<a&&s==a-1?s-a:0,s!==r+u&&(o.__u|=65536))):(i=n[r])&&i.key==null&&i.__e&&(i.__e==t.__d&&(t.__d=su(i)),sS(i,i,!1),n[r]=null,d--);if(d)for(r=0;r<c;r++)(i=n[r])!=null&&(131072&i.__u)==0&&(i.__e==t.__d&&(t.__d=su(i)),sS(i,i))}function XR(t,e,n){var r,o;if(typeof t.type=="function"){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=XR(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function kF(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,l=e[n];if(l===null||l&&o==l.key&&i===l.type)return n;if(r>(l!=null&&(131072&l.__u)==0?1:0))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&(131072&l.__u)==0&&o==l.key&&i===l.type)return a;a--}if(s<e.length){if((l=e[s])&&(131072&l.__u)==0&&o==l.key&&i===l.type)return s;s++}}return-1}function xR(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||wF.test(e)?n:n+"px"}function Ph(t,e,n,r,o){var i;t:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||xR(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||xR(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=Date.now(),t.addEventListener(e,i?kR:AR,i)):t.removeEventListener(e,i?kR:AR,i);else{if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in t)try{t[e]=n??"";break t}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,n))}}function AR(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(ve.event?ve.event(t):t)}}function kR(t){if(this.l)return this.l[t.type+!0](ve.event?ve.event(t):t)}function fS(t,e,n,r,o,i,a,s,l,c){var d,u,p,f,m,_,v,h,y,S,E,R,C,I,L,z=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(d=ve.__b)&&d(e);t:if(typeof z=="function")try{if(h=e.props,y=(d=z.contextType)&&r[d.__c],S=d?y?y.props.value:d.__:r,n.__c?v=(u=e.__c=n.__c).__=u.__E:("prototype"in z&&z.prototype.render?e.__c=u=new z(h,S):(e.__c=u=new $h(h,S),u.constructor=z,u.render=RF),y&&y.sub(u),u.props=h,u.state||(u.state={}),u.context=S,u.__n=r,p=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),z.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Wa({},u.__s)),Wa(u.__s,z.getDerivedStateFromProps(h,u.__s))),f=u.props,m=u.state,u.__v=e,p)z.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(z.getDerivedStateFromProps==null&&h!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(h,S),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(h,u.__s,S)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(u.props=h,u.state=u.__s,u.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(U){U&&(U.__=e)}),E=0;E<u._sb.length;E++)u.__h.push(u._sb[E]);u._sb=[],u.__h.length&&a.push(u);break t}u.componentWillUpdate!=null&&u.componentWillUpdate(h,u.__s,S),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,m,_)})}if(u.context=S,u.props=h,u.__P=t,u.__e=!1,R=ve.__r,C=0,"prototype"in z&&z.prototype.render){for(u.state=u.__s,u.__d=!1,R&&R(e),d=u.render(u.props,u.state,u.context),I=0;I<u._sb.length;I++)u.__h.push(u._sb[I]);u._sb=[]}else do u.__d=!1,R&&R(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++C<25);u.state=u.__s,u.getChildContext!=null&&(r=Wa(Wa({},r),u.getChildContext())),p||u.getSnapshotBeforeUpdate==null||(_=u.getSnapshotBeforeUpdate(f,m)),KR(t,dS(L=d!=null&&d.type===jf&&d.key==null?d.props.children:d)?L:[L],e,n,r,o,i,a,s,l,c),u.base=e.__e,e.__u&=-161,u.__h.length&&a.push(u),v&&(u.__E=u.__=null)}catch(U){e.__v=null,l||i!=null?(e.__e=s,e.__u|=l?160:32,i[i.indexOf(s)]=null):(e.__e=n.__e,e.__k=n.__k),ve.__e(U,e,n)}else i==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=IF(n.__e,e,n,r,o,i,a,l,c);(d=ve.diffed)&&d(e)}function aS(t,e,n){for(var r=0;r<n.length;r++)pS(n[r],n[++r],n[++r]);ve.__c&&ve.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(i){i.call(o)})}catch(i){ve.__e(i,o.__v)}})}function IF(t,e,n,r,o,i,a,s,l){var c,d,u,p,f,m,_,v=n.props,h=e.props,y=e.type;if(y==="svg"&&(o=!0),i!=null){for(c=0;c<i.length;c++)if((f=i[c])&&"setAttribute"in f==!!y&&(y?f.localName===y:f.nodeType===3)){t=f,i[c]=null;break}}if(t==null){if(y===null)return document.createTextNode(h);t=o?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,h.is&&h),i=null,s=!1}if(y===null)v===h||s&&t.data===h||(t.data=h);else{if(i=i&&Wh.call(t.childNodes),v=n.props||$f,!s&&i!=null)for(v={},c=0;c<t.attributes.length;c++)v[(f=t.attributes[c]).name]=f.value;for(c in v)f=v[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=f:c==="key"||c in h||Ph(t,c,null,f,o));for(c in h)f=h[c],c=="children"?p=f:c=="dangerouslySetInnerHTML"?d=f:c=="value"?m=f:c=="checked"?_=f:c==="key"||s&&typeof f!="function"||v[c]===f||Ph(t,c,f,v[c],o);if(d)s||u&&(d.__html===u.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(u&&(t.innerHTML=""),KR(t,dS(p)?p:[p],e,n,r,o&&y!=="foreignObject",i,a,i?i[0]:n.__k&&su(n,0),s,l),i!=null)for(c=i.length;c--;)i[c]!=null&&YR(i[c]);s||(c="value",m!==void 0&&(m!==t[c]||y==="progress"&&!m||y==="option"&&m!==v[c])&&Ph(t,c,m,v[c],!1),c="checked",_!==void 0&&_!==t[c]&&Ph(t,c,_,v[c],!1))}return t}function pS(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){ve.__e(r,n)}}function sS(t,e,n){var r,o;if(ve.unmount&&ve.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||pS(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){ve.__e(i,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&sS(r[o],e,n||typeof t.type!="function");n||t.__e==null||YR(t.__e),t.__=t.__e=t.__d=void 0}function RF(t,e,n){return this.constructor(t,n)}function NF(t,e,n){var r,o,i,a;ve.__&&ve.__(t,e),o=(r=!1)?null:e.__k,i=[],a=[],fS(e,t=e.__k=qt(jf,null,[t]),o||$f,$f,e.ownerSVGElement!==void 0,o?null:e.firstChild?Wh.call(e.childNodes):null,i,o?o.__e:e.firstChild,r,a),t.__d=void 0,aS(i,t,a)}Wh=uS.slice,ve={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(s){t=s}throw t}},qR=0,$h.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Wa({},this.state),typeof t=="function"&&(t=t(Wa({},n),this.props)),t&&Wa(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),wR(this))},$h.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),wR(this))},$h.prototype.render=jf,sl=[],VR=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,iS=function(t,e){return t.__v.__b-e.__v.__b},Vh.__r=0;var $i,_e,tS,IR,lu=0,JR=[],jh=[],Ge=ve,RR=Ge.__b,NR=Ge.__r,CR=Ge.diffed,MR=Ge.__c,OR=Ge.unmount,DR=Ge.__;function cl(t,e){Ge.__h&&Ge.__h(_e,t,lu||e),lu=0;var n=_e.__H||(_e.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:jh}),n.__[t]}function ll(t){return lu=1,QR(tN,t)}function QR(t,e,n){var r=cl($i++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):tN(void 0,e),function(s){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,s);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=_e,!_e.u)){var o=function(s,l,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!i||i.call(this,s,l,c);var u=!1;return d.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(u=!0)}}),!(!u&&r.__c.props===s)&&(!i||i.call(this,s,l,c))};_e.u=!0;var i=_e.shouldComponentUpdate,a=_e.componentWillUpdate;_e.componentWillUpdate=function(s,l,c){if(this.__e){var d=i;i=void 0,o(s,l,c),i=d}a&&a.call(this,s,l,c)},_e.shouldComponentUpdate=o}return r.__N||r.__}function CF(t,e){var n=cl($i++,3);!Ge.__s&&mS(n.__H,e)&&(n.__=t,n.i=e,_e.__H.__h.push(n))}function ZR(t,e){var n=cl($i++,4);!Ge.__s&&mS(n.__H,e)&&(n.__=t,n.i=e,_e.__h.push(n))}function MF(t){return lu=5,qf(function(){return{current:t}},[])}function OF(t,e,n){lu=6,ZR(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},n==null?n:n.concat(t))}function qf(t,e){var n=cl($i++,7);return mS(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function au(t,e){return lu=8,qf(function(){return t},e)}function DF(t){var e=_e.context[t.__c],n=cl($i++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(_e)),e.props.value):t.__}function LF(t,e){Ge.useDebugValue&&Ge.useDebugValue(e?e(t):t)}function UF(t){var e=cl($i++,10),n=ll();return e.__=t,_e.componentDidCatch||(_e.componentDidCatch=function(r,o){e.__&&e.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function BF(){var t=cl($i++,11);if(!t.__){for(var e=_e.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function PF(){for(var t;t=JR.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(qh),t.__H.__h.forEach(lS),t.__H.__h=[]}catch(e){t.__H.__h=[],Ge.__e(e,t.__v)}}Ge.__b=function(t){_e=null,RR&&RR(t)},Ge.__=function(t,e){e.__k&&e.__k.__m&&(t.__m=e.__k.__m),DR&&DR(t,e)},Ge.__r=function(t){NR&&NR(t),$i=0;var e=(_e=t.__c).__H;e&&(tS===_e?(e.__h=[],_e.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=jh,n.__N=n.i=void 0})):(e.__h.forEach(qh),e.__h.forEach(lS),e.__h=[],$i=0)),tS=_e},Ge.diffed=function(t){CR&&CR(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(JR.push(e)!==1&&IR===Ge.requestAnimationFrame||((IR=Ge.requestAnimationFrame)||zF)(PF)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==jh&&(n.__=n.__V),n.i=void 0,n.__V=jh})),tS=_e=null},Ge.__c=function(t,e){e.some(function(n){try{n.__h.forEach(qh),n.__h=n.__h.filter(function(r){return!r.__||lS(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],Ge.__e(r,n.__v)}}),MR&&MR(t,e)},Ge.unmount=function(t){OR&&OR(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{qh(r)}catch(o){e=o}}),n.__H=void 0,e&&Ge.__e(e,n.__v))};var LR=typeof requestAnimationFrame=="function";function zF(t){var e,n=function(){clearTimeout(r),LR&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);LR&&(e=requestAnimationFrame(n))}function qh(t){var e=_e,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),_e=e}function lS(t){var e=_e;t.__c=t.__(),_e=e}function mS(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function tN(t,e){return typeof e=="function"?e(t):e}var FF=Object.defineProperty({__proto__:null,useCallback:au,useContext:DF,useDebugValue:LF,useEffect:CF,useErrorBoundary:UF,useId:BF,useImperativeHandle:OF,useLayoutEffect:ZR,useMemo:qf,useReducer:QR,useRef:MF,useState:ll},Symbol.toStringTag,{value:"Module"}),HF="http://www.w3.org/2000/svg";function GF(){let t=r=>ye.createElementNS(HF,r),e=Lr(t("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Lr(t("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return e.appendChild(n),e}function $F({options:t}){let e=qf(()=>({__html:GF().outerHTML}),[]);return qt("h2",{class:"dialog__header"},qt("span",{class:"dialog__title"},t.formTitle),t.showBranding?qt("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:e}):null)}function jF(t,e){let n=[];return e.isNameRequired&&!t.name&&n.push(e.nameLabel),e.isEmailRequired&&!t.email&&n.push(e.emailLabel),t.message||n.push(e.messageLabel),n}function eS(t,e){let n=t.get(e);return typeof n=="string"?n.trim():""}function qF({options:t,defaultEmail:e,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:i,onSubmitError:a,showEmail:s,showName:l,screenshotInput:c}){let{tags:d,addScreenshotButtonLabel:u,removeScreenshotButtonLabel:p,cancelButtonLabel:f,emailLabel:m,emailPlaceholder:_,isEmailRequired:v,isNameRequired:h,messageLabel:y,messagePlaceholder:S,nameLabel:E,namePlaceholder:R,submitButtonLabel:C,isRequiredLabel:I}=t,[L,z]=ll(!1),[U,D]=ll(null),[N,B]=ll(!1),V=c?.input,[st,nt]=ll(null),lt=au(F=>{nt(F),B(!1)},[]),X=au(F=>{let gt=jF(F,{emailLabel:m,isEmailRequired:v,isNameRequired:h,messageLabel:y,nameLabel:E});return gt.length>0?D(`Please enter in the following required fields: ${gt.join(", ")}`):D(null),gt.length===0},[m,v,h,y,E]),ct=au(async F=>{z(!0);try{if(F.preventDefault(),!(F.target instanceof HTMLFormElement))return;let gt=new FormData(F.target),J=await(c&&N?c.value():void 0),dt={name:eS(gt,"name"),email:eS(gt,"email"),message:eS(gt,"message"),attachments:J?[J]:void 0};if(!X(dt))return;try{let Xt=await o({name:dt.name,email:dt.email,message:dt.message,source:mF,tags:d},{attachments:dt.attachments});i(dt,Xt)}catch(Xt){Hh&&w.error(Xt);let Ce=Xt instanceof Error?Xt:new Error(String(Xt));D(Ce.message),a(Ce)}}finally{z(!1)}},[c&&N,i,a]);return qt("form",{class:"form",onSubmit:ct},V&&N?qt(V,{onError:lt}):null,qt("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:L},qt("div",{class:"form__top"},U?qt("div",{class:"form__error-container"},U):null,l?qt("label",{for:"name",class:"form__label"},qt(nS,{label:E,isRequiredLabel:I,isRequired:h}),qt("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:R,required:h,type:"text"})):qt("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),s?qt("label",{for:"email",class:"form__label"},qt(nS,{label:m,isRequiredLabel:I,isRequired:v}),qt("input",{class:"form__input",defaultValue:e,id:"email",name:"email",placeholder:_,required:v,type:"email"})):qt("input",{"aria-hidden":!0,value:e,name:"email",type:"hidden"}),qt("label",{for:"message",class:"form__label"},qt(nS,{label:y,isRequiredLabel:I,isRequired:!0}),qt("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:S,required:!0,rows:5})),V?qt("label",{for:"screenshot",class:"form__label"},qt("button",{class:"btn btn--default",disabled:L,type:"button",onClick:()=>{nt(null),B(F=>!F)}},N?p:u),st?qt("div",{class:"form__error-container"},st.message):null):null),qt("div",{class:"btn-group"},qt("button",{class:"btn btn--primary",disabled:L,type:"submit"},C),qt("button",{class:"btn btn--default",disabled:L,type:"button",onClick:r},f))))}function nS({label:t,isRequired:e,isRequiredLabel:n}){return qt("span",{class:"form__label__text"},t,e&&qt("span",{class:"form__label__text--required"},n))}var zh=16,UR=17,VF="http://www.w3.org/2000/svg";function YF(){let t=l=>jo.document.createElementNS(VF,l),e=Lr(t("svg"),{width:`${zh}`,height:`${UR}`,viewBox:`0 0 ${zh} ${UR}`,fill:"inherit"}),n=Lr(t("g"),{clipPath:"url(#clip0_57_156)"}),r=Lr(t("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),o=Lr(t("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});e.appendChild(n).append(o,r);let i=t("defs"),a=Lr(t("clipPath"),{id:"clip0_57_156"}),s=Lr(t("rect"),{width:`${zh}`,height:`${zh}`,fill:"white",transform:"translate(0 0.5)"});return a.appendChild(s),i.appendChild(a),e.appendChild(i).appendChild(a).appendChild(s),e}function WF({open:t,onFormSubmitted:e,...n}){let r=n.options,o=qf(()=>({__html:YF().outerHTML}),[]),[i,a]=ll(null),s=au(()=>{i&&(clearTimeout(i),a(null)),e()},[i]),l=au((c,d)=>{n.onSubmitSuccess(c,d),a(setTimeout(()=>{e(),a(null)},hF))},[e]);return qt(jf,null,i?qt("div",{class:"success__position",onClick:s},qt("div",{class:"success__content"},r.successMessageText,qt("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):qt("dialog",{class:"dialog",onClick:r.onFormClose,open:t},qt("div",{class:"dialog__position"},qt("div",{class:"dialog__content",onClick:c=>{c.stopPropagation()}},qt($F,{options:r}),qt(qF,{...n,onSubmitSuccess:l})))))}var KF=`
|
|
114
|
+
`,r&&o.setAttribute("nonce",r),o}var Yh=({lazyLoadIntegration:t,getModalIntegration:e,getScreenshotIntegration:n})=>(({id:o="sentry-feedback",autoInject:i=!0,showBranding:a=!0,isEmailRequired:s=!1,isNameRequired:l=!1,showEmail:c=!0,showName:d=!0,enableScreenshot:u=!0,useSentryUser:p={email:"email",name:"username"},tags:f,styleNonce:m,scriptNonce:_,colorScheme:v="system",themeLight:h={},themeDark:y={},addScreenshotButtonLabel:S=cF,cancelButtonLabel:E=Jz,confirmButtonLabel:R=Zz,emailLabel:C=nF,emailPlaceholder:k=eF,formTitle:L=tF,isRequiredLabel:F=lF,messageLabel:U=oF,messagePlaceholder:D=rF,nameLabel:N=aF,namePlaceholder:B=iF,removeScreenshotButtonLabel:Y=uF,submitButtonLabel:st=Qz,successMessageText:ot=sF,triggerLabel:lt=BR,triggerAriaLabel:X="",highlightToolText:ct=dF,hideToolText:H=fF,removeHighlightText:gt=pF,errorEmptyMessageText:J=PR,errorNoClientText:dt=zR,errorTimeoutText:Xt=FR,errorForbiddenText:Ce=HR,errorGenericText:_n=GR,onFormOpen:Pn,onFormClose:tt,onSubmitSuccess:Vt,onSubmitError:Ut,onFormSubmitted:ft}={})=>{let ee={id:o,autoInject:i,showBranding:a,isEmailRequired:s,isNameRequired:l,showEmail:c,showName:d,enableScreenshot:u,useSentryUser:p,tags:f,styleNonce:m,scriptNonce:_,colorScheme:v,themeDark:y,themeLight:h,triggerLabel:lt,triggerAriaLabel:X,cancelButtonLabel:E,submitButtonLabel:st,confirmButtonLabel:R,formTitle:L,emailLabel:C,emailPlaceholder:k,messageLabel:U,messagePlaceholder:D,nameLabel:N,namePlaceholder:B,successMessageText:ot,isRequiredLabel:F,addScreenshotButtonLabel:S,removeScreenshotButtonLabel:Y,highlightToolText:ct,hideToolText:H,removeHighlightText:gt,errorEmptyMessageText:J,errorNoClientText:dt,errorTimeoutText:Xt,errorForbiddenText:Ce,errorGenericText:_n,onFormClose:tt,onFormOpen:Pn,onSubmitError:Ut,onSubmitSuccess:Vt,onFormSubmitted:ft},mt=null,ie=null,Qt=[],cn=ut=>{if(!mt){let Ft=ye.createElement("div");Ft.id=String(ut.id),ye.body.appendChild(Ft),mt=Ft.attachShadow({mode:"open"}),ie=ER(ut),mt.appendChild(ie)}return mt},un=async ut=>{let Ft=ut.enableScreenshot&&yF(),yt,kt;try{yt=(e?e():await t("feedbackModalIntegration",_))(),Xs(yt)}catch{throw Hh&&w.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{let Ht=Ft?n?n():await t("feedbackScreenshotIntegration",_):void 0;Ht&&(kt=Ht(),Xs(kt))}catch{Hh&&w.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}let bt={ERROR_EMPTY_MESSAGE:ut.errorEmptyMessageText,ERROR_NO_CLIENT:ut.errorNoClientText,ERROR_TIMEOUT:ut.errorTimeoutText,ERROR_FORBIDDEN:ut.errorForbiddenText,ERROR_GENERIC:ut.errorGenericText},K=(Ht,fn)=>cS(Ht,{includeReplay:!0,...fn,errorMessages:bt}),vt=yt.createDialog({options:{...ut,onFormClose:()=>{vt?.close(),ut.onFormClose?.()},onFormSubmitted:()=>{vt?.close(),ut.onFormSubmitted?.()}},screenshotIntegration:kt,sendFeedback:K,shadow:cn(ut)});return vt},Ge=(ut,Ft={})=>{let yt=Bh(ee,Ft),kt=typeof ut=="string"?ye.querySelector(ut):typeof ut.addEventListener=="function"?ut:null;if(!kt)throw Hh&&w.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let bt=null,K=async()=>{bt||(bt=await un({...yt,onFormSubmitted:()=>{bt?.removeFromDom(),yt.onFormSubmitted?.()}})),bt.appendToDom(),bt.open()};kt.addEventListener("click",K);let vt=()=>{Qt=Qt.filter(Ht=>Ht!==vt),bt?.removeFromDom(),bt=null,kt.removeEventListener("click",K)};return Qt.push(vt),vt},dn=(ut={})=>{let Ft=Bh(ee,ut),yt=cn(Ft),kt=EF({triggerLabel:Ft.triggerLabel,triggerAriaLabel:Ft.triggerAriaLabel,shadow:yt,styleNonce:m});return Ge(kt.el,{...Ft,onFormOpen(){kt.hide()},onFormClose(){kt.show()},onFormSubmitted(){kt.show()}}),kt};return{name:"Feedback",setupOnce(){!Vn()||!ee.autoInject||(ye.readyState==="loading"?ye.addEventListener("DOMContentLoaded",()=>dn().appendToDom()):dn().appendToDom())},attachTo:Ge,createWidget(ut={}){let Ft=dn(Bh(ee,ut));return Ft.appendToDom(),Ft},async createForm(ut={}){return un(Bh(ee,ut))},setTheme(ut){if(ee.colorScheme=ut,mt){let Ft=ER(ee);ie?mt.replaceChild(Ft,ie):mt.prepend(Ft),ie=Ft}},remove(){mt&&(mt.parentElement?.remove(),mt=null,ie=null),Qt.forEach(ut=>ut()),Qt=[]}}});function jR(){return z()?.getIntegrationByName("Feedback")}var Wh,ve,qR,sl,TR,VR,iS,$f={},uS=[],wF=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dS=Array.isArray;function Wa(t,e){for(var n in e)t[n]=e[n];return t}function YR(t){var e=t.parentNode;e&&e.removeChild(t)}function qt(t,e,n){var r,o,i,a={};for(i in e)i=="key"?r=e[i]:i=="ref"?o=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?Wh.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)a[i]===void 0&&(a[i]=t.defaultProps[i]);return Gh(t,a,r,o,null)}function Gh(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++qR,__i:-1,__u:0};return o==null&&ve.vnode!=null&&ve.vnode(i),i}function jf(t){return t.children}function $h(t,e){this.props=t,this.context=e}function su(t,e){if(e==null)return t.__?su(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?su(t):null}function xF(t,e,n){var r,o=t.__v,i=o.__e,a=t.__P;if(a)return(r=Wa({},o)).__v=o.__v+1,ve.vnode&&ve.vnode(r),fS(a,r,o,t.__n,a.ownerSVGElement!==void 0,32&o.__u?[i]:null,e,i??su(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&WR(r),r}function WR(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return WR(t)}}function wR(t){(!t.__d&&(t.__d=!0)&&sl.push(t)&&!Vh.__r++||TR!==ve.debounceRendering)&&((TR=ve.debounceRendering)||VR)(Vh)}function Vh(){var t,e,n,r=[],o=[];for(sl.sort(iS);t=sl.shift();)t.__d&&(n=sl.length,e=xF(t,r,o)||e,n===0||sl.length>n?(aS(r,e,o),o.length=r.length=0,e=void 0,sl.sort(iS)):e&&ve.__c&&ve.__c(e,uS));e&&aS(r,e,o),Vh.__r=0}function KR(t,e,n,r,o,i,a,s,l,c,d){var u,p,f,m,_,v=r&&r.__k||uS,h=e.length;for(n.__d=l,AF(n,e,v),l=n.__d,u=0;u<h;u++)(f=n.__k[u])!=null&&typeof f!="boolean"&&typeof f!="function"&&(p=f.__i===-1?$f:v[f.__i]||$f,f.__i=u,fS(t,f,p,o,i,a,s,l,c,d),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&pS(p.ref,null,f),d.push(f.ref,f.__c||m,f)),_==null&&m!=null&&(_=m),65536&f.__u||p.__k===f.__k?l=XR(f,l,t):typeof f.type=="function"&&f.__d!==void 0?l=f.__d:m&&(l=m.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=l,n.__e=_}function AF(t,e,n){var r,o,i,a,s,l=e.length,c=n.length,d=c,u=0;for(t.__k=[],r=0;r<l;r++)(o=t.__k[r]=(o=e[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Gh(null,o,null,null,o):dS(o)?Gh(jf,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Gh(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=t,o.__b=t.__b+1,s=kF(o,n,a=r+u,d),o.__i=s,i=null,s!==-1&&(d--,(i=n[s])&&(i.__u|=131072)),i==null||i.__v===null?(s==-1&&u--,typeof o.type!="function"&&(o.__u|=65536)):s!==a&&(s===a+1?u++:s>a?d>l-a?u+=s-a:u--:u=s<a&&s==a-1?s-a:0,s!==r+u&&(o.__u|=65536))):(i=n[r])&&i.key==null&&i.__e&&(i.__e==t.__d&&(t.__d=su(i)),sS(i,i,!1),n[r]=null,d--);if(d)for(r=0;r<c;r++)(i=n[r])!=null&&(131072&i.__u)==0&&(i.__e==t.__d&&(t.__d=su(i)),sS(i,i))}function XR(t,e,n){var r,o;if(typeof t.type=="function"){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=XR(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function kF(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,l=e[n];if(l===null||l&&o==l.key&&i===l.type)return n;if(r>(l!=null&&(131072&l.__u)==0?1:0))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&(131072&l.__u)==0&&o==l.key&&i===l.type)return a;a--}if(s<e.length){if((l=e[s])&&(131072&l.__u)==0&&o==l.key&&i===l.type)return s;s++}}return-1}function xR(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||wF.test(e)?n:n+"px"}function Ph(t,e,n,r,o){var i;t:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||xR(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||xR(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=Date.now(),t.addEventListener(e,i?kR:AR,i)):t.removeEventListener(e,i?kR:AR,i);else{if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in t)try{t[e]=n??"";break t}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,n))}}function AR(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(ve.event?ve.event(t):t)}}function kR(t){if(this.l)return this.l[t.type+!0](ve.event?ve.event(t):t)}function fS(t,e,n,r,o,i,a,s,l,c){var d,u,p,f,m,_,v,h,y,S,E,R,C,k,L,F=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(d=ve.__b)&&d(e);t:if(typeof F=="function")try{if(h=e.props,y=(d=F.contextType)&&r[d.__c],S=d?y?y.props.value:d.__:r,n.__c?v=(u=e.__c=n.__c).__=u.__E:("prototype"in F&&F.prototype.render?e.__c=u=new F(h,S):(e.__c=u=new $h(h,S),u.constructor=F,u.render=RF),y&&y.sub(u),u.props=h,u.state||(u.state={}),u.context=S,u.__n=r,p=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),F.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Wa({},u.__s)),Wa(u.__s,F.getDerivedStateFromProps(h,u.__s))),f=u.props,m=u.state,u.__v=e,p)F.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(F.getDerivedStateFromProps==null&&h!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(h,S),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(h,u.__s,S)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(u.props=h,u.state=u.__s,u.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(U){U&&(U.__=e)}),E=0;E<u._sb.length;E++)u.__h.push(u._sb[E]);u._sb=[],u.__h.length&&a.push(u);break t}u.componentWillUpdate!=null&&u.componentWillUpdate(h,u.__s,S),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,m,_)})}if(u.context=S,u.props=h,u.__P=t,u.__e=!1,R=ve.__r,C=0,"prototype"in F&&F.prototype.render){for(u.state=u.__s,u.__d=!1,R&&R(e),d=u.render(u.props,u.state,u.context),k=0;k<u._sb.length;k++)u.__h.push(u._sb[k]);u._sb=[]}else do u.__d=!1,R&&R(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++C<25);u.state=u.__s,u.getChildContext!=null&&(r=Wa(Wa({},r),u.getChildContext())),p||u.getSnapshotBeforeUpdate==null||(_=u.getSnapshotBeforeUpdate(f,m)),KR(t,dS(L=d!=null&&d.type===jf&&d.key==null?d.props.children:d)?L:[L],e,n,r,o,i,a,s,l,c),u.base=e.__e,e.__u&=-161,u.__h.length&&a.push(u),v&&(u.__E=u.__=null)}catch(U){e.__v=null,l||i!=null?(e.__e=s,e.__u|=l?160:32,i[i.indexOf(s)]=null):(e.__e=n.__e,e.__k=n.__k),ve.__e(U,e,n)}else i==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=IF(n.__e,e,n,r,o,i,a,l,c);(d=ve.diffed)&&d(e)}function aS(t,e,n){for(var r=0;r<n.length;r++)pS(n[r],n[++r],n[++r]);ve.__c&&ve.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(i){i.call(o)})}catch(i){ve.__e(i,o.__v)}})}function IF(t,e,n,r,o,i,a,s,l){var c,d,u,p,f,m,_,v=n.props,h=e.props,y=e.type;if(y==="svg"&&(o=!0),i!=null){for(c=0;c<i.length;c++)if((f=i[c])&&"setAttribute"in f==!!y&&(y?f.localName===y:f.nodeType===3)){t=f,i[c]=null;break}}if(t==null){if(y===null)return document.createTextNode(h);t=o?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,h.is&&h),i=null,s=!1}if(y===null)v===h||s&&t.data===h||(t.data=h);else{if(i=i&&Wh.call(t.childNodes),v=n.props||$f,!s&&i!=null)for(v={},c=0;c<t.attributes.length;c++)v[(f=t.attributes[c]).name]=f.value;for(c in v)f=v[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=f:c==="key"||c in h||Ph(t,c,null,f,o));for(c in h)f=h[c],c=="children"?p=f:c=="dangerouslySetInnerHTML"?d=f:c=="value"?m=f:c=="checked"?_=f:c==="key"||s&&typeof f!="function"||v[c]===f||Ph(t,c,f,v[c],o);if(d)s||u&&(d.__html===u.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(u&&(t.innerHTML=""),KR(t,dS(p)?p:[p],e,n,r,o&&y!=="foreignObject",i,a,i?i[0]:n.__k&&su(n,0),s,l),i!=null)for(c=i.length;c--;)i[c]!=null&&YR(i[c]);s||(c="value",m!==void 0&&(m!==t[c]||y==="progress"&&!m||y==="option"&&m!==v[c])&&Ph(t,c,m,v[c],!1),c="checked",_!==void 0&&_!==t[c]&&Ph(t,c,_,v[c],!1))}return t}function pS(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){ve.__e(r,n)}}function sS(t,e,n){var r,o;if(ve.unmount&&ve.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||pS(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){ve.__e(i,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&sS(r[o],e,n||typeof t.type!="function");n||t.__e==null||YR(t.__e),t.__=t.__e=t.__d=void 0}function RF(t,e,n){return this.constructor(t,n)}function NF(t,e,n){var r,o,i,a;ve.__&&ve.__(t,e),o=(r=!1)?null:e.__k,i=[],a=[],fS(e,t=e.__k=qt(jf,null,[t]),o||$f,$f,e.ownerSVGElement!==void 0,o?null:e.firstChild?Wh.call(e.childNodes):null,i,o?o.__e:e.firstChild,r,a),t.__d=void 0,aS(i,t,a)}Wh=uS.slice,ve={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(s){t=s}throw t}},qR=0,$h.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Wa({},this.state),typeof t=="function"&&(t=t(Wa({},n),this.props)),t&&Wa(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),wR(this))},$h.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),wR(this))},$h.prototype.render=jf,sl=[],VR=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,iS=function(t,e){return t.__v.__b-e.__v.__b},Vh.__r=0;var $i,_e,tS,IR,lu=0,JR=[],jh=[],$e=ve,RR=$e.__b,NR=$e.__r,CR=$e.diffed,MR=$e.__c,OR=$e.unmount,DR=$e.__;function cl(t,e){$e.__h&&$e.__h(_e,t,lu||e),lu=0;var n=_e.__H||(_e.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:jh}),n.__[t]}function ll(t){return lu=1,QR(tN,t)}function QR(t,e,n){var r=cl($i++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):tN(void 0,e),function(s){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,s);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=_e,!_e.u)){var o=function(s,l,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!i||i.call(this,s,l,c);var u=!1;return d.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(u=!0)}}),!(!u&&r.__c.props===s)&&(!i||i.call(this,s,l,c))};_e.u=!0;var i=_e.shouldComponentUpdate,a=_e.componentWillUpdate;_e.componentWillUpdate=function(s,l,c){if(this.__e){var d=i;i=void 0,o(s,l,c),i=d}a&&a.call(this,s,l,c)},_e.shouldComponentUpdate=o}return r.__N||r.__}function CF(t,e){var n=cl($i++,3);!$e.__s&&mS(n.__H,e)&&(n.__=t,n.i=e,_e.__H.__h.push(n))}function ZR(t,e){var n=cl($i++,4);!$e.__s&&mS(n.__H,e)&&(n.__=t,n.i=e,_e.__h.push(n))}function MF(t){return lu=5,qf(function(){return{current:t}},[])}function OF(t,e,n){lu=6,ZR(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},n==null?n:n.concat(t))}function qf(t,e){var n=cl($i++,7);return mS(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function au(t,e){return lu=8,qf(function(){return t},e)}function DF(t){var e=_e.context[t.__c],n=cl($i++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(_e)),e.props.value):t.__}function LF(t,e){$e.useDebugValue&&$e.useDebugValue(e?e(t):t)}function UF(t){var e=cl($i++,10),n=ll();return e.__=t,_e.componentDidCatch||(_e.componentDidCatch=function(r,o){e.__&&e.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function BF(){var t=cl($i++,11);if(!t.__){for(var e=_e.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function PF(){for(var t;t=JR.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(qh),t.__H.__h.forEach(lS),t.__H.__h=[]}catch(e){t.__H.__h=[],$e.__e(e,t.__v)}}$e.__b=function(t){_e=null,RR&&RR(t)},$e.__=function(t,e){e.__k&&e.__k.__m&&(t.__m=e.__k.__m),DR&&DR(t,e)},$e.__r=function(t){NR&&NR(t),$i=0;var e=(_e=t.__c).__H;e&&(tS===_e?(e.__h=[],_e.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=jh,n.__N=n.i=void 0})):(e.__h.forEach(qh),e.__h.forEach(lS),e.__h=[],$i=0)),tS=_e},$e.diffed=function(t){CR&&CR(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(JR.push(e)!==1&&IR===$e.requestAnimationFrame||((IR=$e.requestAnimationFrame)||zF)(PF)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==jh&&(n.__=n.__V),n.i=void 0,n.__V=jh})),tS=_e=null},$e.__c=function(t,e){e.some(function(n){try{n.__h.forEach(qh),n.__h=n.__h.filter(function(r){return!r.__||lS(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],$e.__e(r,n.__v)}}),MR&&MR(t,e)},$e.unmount=function(t){OR&&OR(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{qh(r)}catch(o){e=o}}),n.__H=void 0,e&&$e.__e(e,n.__v))};var LR=typeof requestAnimationFrame=="function";function zF(t){var e,n=function(){clearTimeout(r),LR&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);LR&&(e=requestAnimationFrame(n))}function qh(t){var e=_e,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),_e=e}function lS(t){var e=_e;t.__c=t.__(),_e=e}function mS(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function tN(t,e){return typeof e=="function"?e(t):e}var FF=Object.defineProperty({__proto__:null,useCallback:au,useContext:DF,useDebugValue:LF,useEffect:CF,useErrorBoundary:UF,useId:BF,useImperativeHandle:OF,useLayoutEffect:ZR,useMemo:qf,useReducer:QR,useRef:MF,useState:ll},Symbol.toStringTag,{value:"Module"}),HF="http://www.w3.org/2000/svg";function GF(){let t=r=>ye.createElementNS(HF,r),e=Lr(t("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Lr(t("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return e.appendChild(n),e}function $F({options:t}){let e=qf(()=>({__html:GF().outerHTML}),[]);return qt("h2",{class:"dialog__header"},qt("span",{class:"dialog__title"},t.formTitle),t.showBranding?qt("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:e}):null)}function jF(t,e){let n=[];return e.isNameRequired&&!t.name&&n.push(e.nameLabel),e.isEmailRequired&&!t.email&&n.push(e.emailLabel),t.message||n.push(e.messageLabel),n}function eS(t,e){let n=t.get(e);return typeof n=="string"?n.trim():""}function qF({options:t,defaultEmail:e,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:i,onSubmitError:a,showEmail:s,showName:l,screenshotInput:c}){let{tags:d,addScreenshotButtonLabel:u,removeScreenshotButtonLabel:p,cancelButtonLabel:f,emailLabel:m,emailPlaceholder:_,isEmailRequired:v,isNameRequired:h,messageLabel:y,messagePlaceholder:S,nameLabel:E,namePlaceholder:R,submitButtonLabel:C,isRequiredLabel:k}=t,[L,F]=ll(!1),[U,D]=ll(null),[N,B]=ll(!1),Y=c?.input,[st,ot]=ll(null),lt=au(H=>{ot(H),B(!1)},[]),X=au(H=>{let gt=jF(H,{emailLabel:m,isEmailRequired:v,isNameRequired:h,messageLabel:y,nameLabel:E});return gt.length>0?D(`Please enter in the following required fields: ${gt.join(", ")}`):D(null),gt.length===0},[m,v,h,y,E]),ct=au(async H=>{F(!0);try{if(H.preventDefault(),!(H.target instanceof HTMLFormElement))return;let gt=new FormData(H.target),J=await(c&&N?c.value():void 0),dt={name:eS(gt,"name"),email:eS(gt,"email"),message:eS(gt,"message"),attachments:J?[J]:void 0};if(!X(dt))return;try{let Xt=await o({name:dt.name,email:dt.email,message:dt.message,source:mF,tags:d},{attachments:dt.attachments});i(dt,Xt)}catch(Xt){Hh&&w.error(Xt);let Ce=Xt instanceof Error?Xt:new Error(String(Xt));D(Ce.message),a(Ce)}}finally{F(!1)}},[c&&N,i,a]);return qt("form",{class:"form",onSubmit:ct},Y&&N?qt(Y,{onError:lt}):null,qt("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:L},qt("div",{class:"form__top"},U?qt("div",{class:"form__error-container"},U):null,l?qt("label",{for:"name",class:"form__label"},qt(nS,{label:E,isRequiredLabel:k,isRequired:h}),qt("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:R,required:h,type:"text"})):qt("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),s?qt("label",{for:"email",class:"form__label"},qt(nS,{label:m,isRequiredLabel:k,isRequired:v}),qt("input",{class:"form__input",defaultValue:e,id:"email",name:"email",placeholder:_,required:v,type:"email"})):qt("input",{"aria-hidden":!0,value:e,name:"email",type:"hidden"}),qt("label",{for:"message",class:"form__label"},qt(nS,{label:y,isRequiredLabel:k,isRequired:!0}),qt("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:S,required:!0,rows:5})),Y?qt("label",{for:"screenshot",class:"form__label"},qt("button",{class:"btn btn--default",disabled:L,type:"button",onClick:()=>{ot(null),B(H=>!H)}},N?p:u),st?qt("div",{class:"form__error-container"},st.message):null):null),qt("div",{class:"btn-group"},qt("button",{class:"btn btn--primary",disabled:L,type:"submit"},C),qt("button",{class:"btn btn--default",disabled:L,type:"button",onClick:r},f))))}function nS({label:t,isRequired:e,isRequiredLabel:n}){return qt("span",{class:"form__label__text"},t,e&&qt("span",{class:"form__label__text--required"},n))}var zh=16,UR=17,VF="http://www.w3.org/2000/svg";function YF(){let t=l=>jo.document.createElementNS(VF,l),e=Lr(t("svg"),{width:`${zh}`,height:`${UR}`,viewBox:`0 0 ${zh} ${UR}`,fill:"inherit"}),n=Lr(t("g"),{clipPath:"url(#clip0_57_156)"}),r=Lr(t("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),o=Lr(t("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});e.appendChild(n).append(o,r);let i=t("defs"),a=Lr(t("clipPath"),{id:"clip0_57_156"}),s=Lr(t("rect"),{width:`${zh}`,height:`${zh}`,fill:"white",transform:"translate(0 0.5)"});return a.appendChild(s),i.appendChild(a),e.appendChild(i).appendChild(a).appendChild(s),e}function WF({open:t,onFormSubmitted:e,...n}){let r=n.options,o=qf(()=>({__html:YF().outerHTML}),[]),[i,a]=ll(null),s=au(()=>{i&&(clearTimeout(i),a(null)),e()},[i]),l=au((c,d)=>{n.onSubmitSuccess(c,d),a(setTimeout(()=>{e(),a(null)},hF))},[e]);return qt(jf,null,i?qt("div",{class:"success__position",onClick:s},qt("div",{class:"success__content"},r.successMessageText,qt("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):qt("dialog",{class:"dialog",onClick:r.onFormClose,open:t},qt("div",{class:"dialog__position"},qt("div",{class:"dialog__content",onClick:c=>{c.stopPropagation()}},qt($F,{options:r}),qt(qF,{...n,onSubmitSuccess:l})))))}var KF=`
|
|
115
115
|
.dialog {
|
|
116
116
|
position: fixed;
|
|
117
117
|
z-index: var(--z-index);
|
|
@@ -401,7 +401,7 @@ ${XF}
|
|
|
401
401
|
${JF}
|
|
402
402
|
${QF}
|
|
403
403
|
${ZF}
|
|
404
|
-
`,t&&e.setAttribute("nonce",t),e}function eH(){let t=
|
|
404
|
+
`,t&&e.setAttribute("nonce",t),e}function eH(){let t=it().getUser(),e=Pt().getUser(),n=lr().getUser();return t&&Object.keys(t).length?t:e&&Object.keys(e).length?e:n}var eN=(()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:t,screenshotIntegration:e,sendFeedback:n,shadow:r})=>{let o=r,i=t.useSentryUser,a=eH(),s=ye.createElement("div"),l=tH(t.styleNonce),c="",d={get el(){return s},appendToDom(){!o.contains(l)&&!o.contains(s)&&(o.appendChild(l),o.appendChild(s))},removeFromDom(){s.remove(),l.remove(),ye.body.style.overflow=c},open(){p(!0),t.onFormOpen?.(),z()?.emit("openFeedbackWidget"),c=ye.body.style.overflow,ye.body.style.overflow="hidden"},close(){p(!1),ye.body.style.overflow=c}},u=e?.createInput({h:qt,hooks:FF,dialog:d,options:t}),p=f=>{NF(qt(WF,{options:t,screenshotInput:u,showName:t.showName||t.isNameRequired,showEmail:t.showEmail||t.isEmailRequired,defaultName:String(i&&a?.[i.name]||""),defaultEmail:String(i&&a?.[i.email]||""),onFormClose:()=>{p(!1),t.onFormClose?.()},onSubmit:n,onSubmitSuccess:(m,_)=>{p(!1),t.onSubmitSuccess?.(m,_)},onSubmitError:m=>{t.onSubmitError?.(m)},onFormSubmitted:()=>{t.onFormSubmitted?.()},open:f}),s)};return d}}));function nH({h:t}){return function(){return t("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},t("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),t("path",{strokeWidth:"1.5",d:"M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z"}),t("path",{strokeWidth:"1.5",d:"M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z"}),t("path",{strokeWidth:"1.5",d:"M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z"}))}}function rH(t){let e=ye.createElement("style"),n="#1A141F",r="#302735";return e.textContent=`
|
|
405
405
|
.editor {
|
|
406
406
|
display: flex;
|
|
407
407
|
flex-grow: 1;
|
|
@@ -493,18 +493,18 @@ ${ZF}
|
|
|
493
493
|
.editor__rect:hover button {
|
|
494
494
|
opacity: 1;
|
|
495
495
|
}
|
|
496
|
-
`,t&&e.setAttribute("nonce",t),e}function oH({h:t}){return function({action:n,setAction:r,options:o}){return t("div",{class:"editor__tool-container"},t("div",{class:"editor__tool-bar"},t("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},o.highlightToolText),t("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},o.hideToolText)))}}function iH({hooks:t}){function e(){let[n,r]=t.useState(jo.devicePixelRatio??1);return t.useEffect(()=>{let o=()=>{r(jo.devicePixelRatio)},i=matchMedia(`(resolution: ${jo.devicePixelRatio}dppx)`);return i.addEventListener("change",o),()=>{i.removeEventListener("change",o)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:i,onError:a}){let s=e();t.useEffect(()=>{(async()=>{r();let c=await Gf.mediaDevices.getDisplayMedia({video:{width:jo.innerWidth*s,height:jo.innerHeight*s},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=ye.createElement("video");await new Promise((u,p)=>{d.srcObject=c,d.onloadedmetadata=()=>{o(d,s),c.getTracks().forEach(f=>f.stop()),u()},d.play().catch(p)}),i()})().catch(a)},[])}}function aH(t,e,n){switch(t.type){case"highlight":{e.shadowColor="rgba(0, 0, 0, 0.7)",e.shadowBlur=50,e.fillStyle=n,e.fillRect(t.x-1,t.y-1,t.w+2,t.h+2),e.clearRect(t.x,t.y,t.w,t.h);break}case"hide":e.fillStyle="rgb(0, 0, 0)",e.fillRect(t.x,t.y,t.w,t.h);break}}function Ya(t,e,n){if(!t)return;let r=t.getContext("2d",e);r&&n(t,r)}function rS(t,e){Ya(t,{alpha:!0},(n,r)=>{r.drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height)})}function oS(t,e,n){Ya(t,{alpha:!0},(r,o)=>{n.length&&(o.fillStyle="rgba(0, 0, 0, 0.25)",o.fillRect(0,0,r.width,r.height)),n.forEach(i=>{aH(i,o,e)})})}function sH({h:t,hooks:e,outputBuffer:n,dialog:r,options:o}){let i=iH({hooks:e}),a=oH({h:t}),s=nH({h:t}),l={__html:rH(o.styleNonce).innerText},c=r.el.style,d=({screenshot:u})=>{let[p,f]=e.useState("highlight"),[m,_]=e.useState([]),v=e.useRef(null),h=e.useRef(null),y=e.useRef(null),S=e.useRef(null),[E,R]=e.useState(1),C=e.useMemo(()=>{let N=ye.getElementById(o.id);if(!N)return"white";let B=getComputedStyle(N);return B.getPropertyValue("--button-primary-background")||B.getPropertyValue("--accent-background")},[o.id]);e.useLayoutEffect(()=>{let N=()=>{let B=v.current;B&&(Ya(u.canvas,{alpha:!1},V=>{let st=Math.min(B.clientWidth/V.width,B.clientHeight/V.height);R(st)}),(B.clientHeight===0||B.clientWidth===0)&&setTimeout(N,0))};return N(),jo.addEventListener("resize",N),()=>{jo.removeEventListener("resize",N)}},[u]);let I=e.useCallback((N,B)=>{Ya(N,{alpha:!0},(V,st)=>{st.scale(B,B),V.width=u.canvas.width,V.height=u.canvas.height})},[u]);e.useEffect(()=>{I(h.current,u.dpi),rS(h.current,u.canvas)},[u]),e.useEffect(()=>{I(y.current,u.dpi),Ya(y.current,{alpha:!0},(N,B)=>{B.clearRect(0,0,N.width,N.height)}),oS(y.current,C,m)},[m,C]),e.useEffect(()=>{I(n,u.dpi),rS(n,u.canvas),Ya(ye.createElement("canvas"),{alpha:!0},(N,B)=>{B.scale(u.dpi,u.dpi),N.width=u.canvas.width,N.height=u.canvas.height,oS(N,C,m),rS(n,N)})},[m,u,C]);let L=N=>{if(!p||!S.current)return;let B=S.current.getBoundingClientRect(),V={type:p,x:N.offsetX/E,y:N.offsetY/E},st=(X,ct)=>{let F=(ct.clientX-B.x)/E,gt=(ct.clientY-B.y)/E;return{type:X.type,x:Math.min(X.x,F),y:Math.min(X.y,gt),w:Math.abs(F-X.x),h:Math.abs(gt-X.y)}},nt=X=>{Ya(y.current,{alpha:!0},(ct,F)=>{F.clearRect(0,0,ct.width,ct.height)}),oS(y.current,C,[...m,st(V,X)])},lt=X=>{let ct=st(V,X);ct.w*E>=1&&ct.h*E>=1&&_(F=>[...F,ct]),ye.removeEventListener("mousemove",nt),ye.removeEventListener("mouseup",lt)};ye.addEventListener("mousemove",nt),ye.addEventListener("mouseup",lt)},z=e.useCallback(N=>B=>{B.preventDefault(),B.stopPropagation(),_(V=>{let st=[...V];return st.splice(N,1),st})},[]),U={width:`${u.canvas.width*E}px`,height:`${u.canvas.height*E}px`},D=N=>{N.stopPropagation()};return t("div",{class:"editor"},t("style",{nonce:o.styleNonce,dangerouslySetInnerHTML:l}),t("div",{class:"editor__image-container"},t("div",{class:"editor__canvas-container",ref:v},t("canvas",{ref:h,id:"background",style:U}),t("canvas",{ref:y,id:"foreground",style:U}),t("div",{ref:S,onMouseDown:L,style:U},m.map((N,B)=>t("div",{key:B,class:"editor__rect",style:{top:`${N.y*E}px`,left:`${N.x*E}px`,width:`${N.w*E}px`,height:`${N.h*E}px`}},t("button",{"aria-label":o.removeHighlightText,onClick:z(B),onMouseDown:D,onMouseUp:D,type:"button"},t(s,null))))))),t(a,{options:o,action:p,setAction:f}))};return function({onError:p}){let[f,m]=e.useState();return i({onBeforeScreenshot:e.useCallback(()=>{c.display="none"},[]),onScreenshot:e.useCallback((_,v)=>{Ya(ye.createElement("canvas"),{alpha:!1},(h,y)=>{y.scale(v,v),h.width=_.videoWidth,h.height=_.videoHeight,y.drawImage(_,0,0,h.width,h.height),m({canvas:h,dpi:v})}),n.width=_.videoWidth,n.height=_.videoHeight},[]),onAfterScreenshot:e.useCallback(()=>{c.display="block"},[]),onError:e.useCallback(_=>{c.display="block",p(_)},[])}),f?t(d,{screenshot:f}):t("div",null)}}var nN=(()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:t,hooks:e,dialog:n,options:r})=>{let o=ye.createElement("canvas");return{input:sH({h:t,hooks:e,outputBuffer:o,dialog:n,options:r}),value:async()=>{let i=await new Promise(a=>{o.toBlob(a,"image/png")});if(i)return{data:new Uint8Array(await i.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}));var q=tt,gS=0;function hS(){return gS>0}function lH(){gS++,setTimeout(()=>{gS--})}function ul(t,e={}){function n(o){return typeof o=="function"}if(!n(t))return t;try{if(Object.prototype.hasOwnProperty.call(t,"__sentry_wrapped__")){let i=t.__sentry_wrapped__;return typeof i=="function"?i:t}if(Aa(t))return t}catch{return t}let r=function(...o){tt._sentryWrappedDepth=(tt._sentryWrappedDepth||0)+1;try{let i=o.map(a=>ul(a,e));return t.apply(this,i)}catch(i){throw lH(),Oe(a=>{a.addEventProcessor(s=>(e.mechanism&&(Ps(s,void 0,void 0),En(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),Et(i)}),i}finally{tt._sentryWrappedDepth=(tt._sentryWrappedDepth||0)-1}};try{for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch{}Zd(r,t),Gt(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function cu(){let t=Kn(),{referrer:e}=q.document||{},{userAgent:n}=q.navigator||{},r={...e&&{Referer:e},...n&&{"User-Agent":n}};return{url:t,headers:r}}var cH=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],uH={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function dH(t){return uH[t]||t.replace("Integration","").toLowerCase()}var rN=q;async function Kh(t,e){let n=cH.includes(t)?dH(t):void 0,r=rN.Sentry=rN.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${t}`);let o=r[t];if(typeof o=="function"&&!("_isShim"in o))return o;let i=fH(n),a=q.document.createElement("script");a.src=i,a.crossOrigin="anonymous",a.referrerPolicy="strict-origin",e&&a.setAttribute("nonce",e);let s=new Promise((u,p)=>{a.addEventListener("load",()=>u()),a.addEventListener("error",p)}),l=q.document.currentScript,c=q.document.body||q.document.head||l?.parentElement;if(c)c.appendChild(a);else throw new Error(`Could not find parent element to insert lazy-loaded ${t} script`);try{await s}catch{throw new Error(`Error when loading integration: ${t}`)}let d=r[t];if(typeof d!="function")throw new Error(`Could not load integration: ${t}`);return d}function fH(t){let n=P()?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${ir}/${t}.min.js`,n).toString()}var oN=Yh({lazyLoadIntegration:Kh});var bS=Yh({getModalIntegration:()=>eN,getScreenshotIntegration:()=>nN});function uu(t,e){let n=Xh(t,e),r={type:bH(e),value:yH(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function pH(t,e,n,r){let i=P()?.getOptions().normalizeDepth,a=SH(e),s={__serialized__:ef(e,i)};if(a)return{exception:{values:[uu(t,a)]},extra:s};let l={exception:{values:[{type:xa(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:_H(e,{isUnhandledRejection:r})}]},extra:s};if(n){let c=Xh(t,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function yS(t,e){return{exception:{values:[uu(t,e)]}}}function Xh(t,e){let n=e.stacktrace||e.stack||"",r=gH(e),o=hH(e);try{return t(n,r,o)}catch{}return[]}var mH=/Minified React error #\d+;/i;function gH(t){return t&&mH.test(t.message)?1:0}function hH(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function iN(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function bH(t){let e=t?.name;return!e&&iN(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function yH(t){let e=t?.message;return iN(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?dh(e.error):dh(t):"No error message"}function Jh(t,e,n,r){let o=n?.syntheticException||void 0,i=du(t,e,o,r);return En(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),li(i)}function Qh(t,e,n="info",r,o){let i=r?.syntheticException||void 0,a=_S(t,e,i,o);return a.level=n,r?.event_id&&(a.event_id=r.event_id),li(a)}function du(t,e,n,r,o){let i;if(bc(e)&&e.error)return yS(t,e.error);if(Jd(e)||eg(e)){let a=e;if("stack"in e){i=yS(t,e);let s=i.exception?.values?.[0];if(r&&n&&s&&!s.stacktrace){let l=Xh(t,n);l.length&&(s.stacktrace={frames:l},En(i,{synthetic:!0}))}}else{let s=a.name||(Jd(a)?"DOMError":"DOMException"),l=a.message?`${s}: ${a.message}`:s;i=_S(t,l,n,r),Ps(i,l)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return mn(e)?yS(t,e):he(e)||xa(e)?(i=pH(t,e,n,o),En(i,{synthetic:!0}),i):(i=_S(t,e,n,r),Ps(i,`${e}`,void 0),En(i,{synthetic:!0}),i)}function _S(t,e,n,r){let o={};if(r&&n){let i=Xh(t,n);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]}),En(o,{synthetic:!0})}if(ei(e)){let{__sentry_template_string__:i,__sentry_template_values__:a}=e;return o.logentry={message:i,params:a},o}return o.message=e,o}function _H(t,{isUnhandledRejection:e}){let n=rg(t),r=e?"promise rejection":"exception";return bc(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:xa(t)?`Event \`${vH(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function vH(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function SH(t){return Object.values(t).find(e=>e instanceof Error)}var fu=class extends Nf{constructor(e){let n=EH(e),r=q.SENTRY_SDK_SOURCE||iv();Mf(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:a,_experiments:s,enableMetrics:l}=this._options,c=l??s?.enableMetrics??!0;q.document&&(i||a||c)&&q.document.addEventListener("visibilitychange",()=>{q.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),a&&Js(this),c&&Pc(this))}),o&&this.on("beforeSendSession",Sv)}eventFromException(e,n){return Jh(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Qh(this._options.stackParser,e,n,r,this._options.attachStacktrace)}_prepareEvent(e,n,r,o){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r,o)}};function EH(t){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:q.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...t}}var xn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var pt=tt;var TH=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",bi=(t,e,n,r)=>{let o,i;return a=>{e.value>=0&&(a||r)&&(i=e.value-(o??0),(i||o===void 0)&&(o=e.value,e.delta=i,e.rating=TH(e.value,n),t(e)))}};var ji=(t=!0)=>{let e=pt.performance?.getEntriesByType?.("navigation")[0];if(!t||e&&e.responseStart>0&&e.responseStart<performance.now())return e};var ao=()=>ji()?.activationStart??0;function so(t,e,n){pt.document&&pt.addEventListener(t,e,n)}function dl(t,e,n){pt.document&&pt.removeEventListener(t,e,n)}var pu=-1,aN=new Set,wH=()=>pt.document?.visibilityState==="hidden"&&!pt.document?.prerendering?0:1/0,Zh=t=>{if(xH(t)&&pu>-1){if(t.type==="visibilitychange"||t.type==="pagehide")for(let e of aN)e();isFinite(pu)||(pu=t.type==="visibilitychange"?t.timeStamp:0,dl("prerenderingchange",Zh,!0))}},yi=()=>{if(pt.document&&pu<0){let t=ao();pu=(pt.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>t)[0]?.startTime)??wH(),so("visibilitychange",Zh,!0),so("pagehide",Zh,!0),so("prerenderingchange",Zh,!0)}return{get firstHiddenTime(){return pu},onHidden(t){aN.add(t)}}};function xH(t){return t.type==="pagehide"||pt.document?.visibilityState==="hidden"}var sN=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var _i=(t,e=-1)=>{let n=ji(),r="navigate";return n&&(pt.document?.prerendering||ao()>0?r="prerender":pt.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:sN(),navigationType:r}};var vS=new WeakMap;function mu(t,e){try{return vS.get(t)||vS.set(t,new e),vS.get(t)}catch{return new e}}var tb=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}};var lo=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{e(o.getEntries())})});return r.observe({type:t,buffered:!0,...n}),r}}catch{}};var gu=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Ka=t=>{pt.document?.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()};var AH=[1800,3e3],lN=(t,e={})=>{Ka(()=>{let n=yi(),r=_i("FCP"),o,a=lo("paint",s=>{for(let l of s)l.name==="first-contentful-paint"&&(a.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-ao(),0),r.entries.push(l),o(!0)))});a&&(o=bi(t,r,AH,e.reportAllChanges))})};var kH=[.1,.25],cN=(t,e={})=>{lN(gu(()=>{let n=_i("CLS",0),r,o=yi(),i=mu(e,tb),a=l=>{for(let c of l)i._processEntry(c);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},s=lo("layout-shift",a);s&&(r=bi(t,n,kH,e.reportAllChanges),o.onHidden(()=>{a(s.takeRecords()),r(!0)}),pt?.setTimeout?.(r))}))};var uN=0,SS=1/0,eb=0,IH=t=>{t.forEach(e=>{e.interactionId&&(SS=Math.min(SS,e.interactionId),eb=Math.max(eb,e.interactionId),uN=eb?(eb-SS)/7+1:0)})},ES,TS=()=>ES?uN:performance.interactionCount||0,dN=()=>{"interactionCount"in performance||ES||(ES=lo("event",IH,{type:"event",buffered:!0,durationThreshold:0}))};var wS=10,fN=0,RH=()=>TS()-fN,nb=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){fN=TS(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(RH()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType==="first-input"))return;let n=this._longestInteractionList.at(-1),r=this._longestInteractionMap.get(e.interactionId);if(r||this._longestInteractionList.length<wS||e.duration>n._latency){if(r?e.duration>r._latency?(r.entries=[e],r._latency=e.duration):e.duration===r._latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,i)=>i._latency-o._latency),this._longestInteractionList.length>wS){let o=this._longestInteractionList.splice(wS);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var fl=t=>{let e=pt.requestIdleCallback||pt.setTimeout;pt.document?.visibilityState==="hidden"?t():(t=gu(t),so("visibilitychange",t,{once:!0,capture:!0}),so("pagehide",t,{once:!0,capture:!0}),e(()=>{t(),dl("visibilitychange",t,{capture:!0}),dl("pagehide",t,{capture:!0})}))};var NH=[200,500],CH=40,pN=(t,e={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=yi();Ka(()=>{dN();let r=_i("INP"),o,i=mu(e,nb),a=l=>{fl(()=>{for(let d of l)i._processEntry(d);let c=i._estimateP98LongestInteraction();c&&c._latency!==r.value&&(r.value=c._latency,r.entries=c.entries,o())})},s=lo("event",a,{durationThreshold:e.durationThreshold??CH});o=bi(t,r,NH,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{a(s.takeRecords()),o(!0)}))})};var rb=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}};var MH=[2500,4e3],mN=(t,e={})=>{Ka(()=>{let n=yi(),r=_i("LCP"),o,i=mu(e,rb),a=l=>{e.reportAllChanges||(l=l.slice(-1));for(let c of l)i._processEntry(c),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-ao(),0),r.entries=[c],o())},s=lo("largest-contentful-paint",a);if(s){o=bi(t,r,MH,e.reportAllChanges);let l=gu(()=>{a(s.takeRecords()),s.disconnect(),o(!0)}),c=d=>{d.isTrusted&&(fl(l),dl(d.type,c,{capture:!0}))};for(let d of["keydown","click","visibilitychange"])so(d,c,{capture:!0})}})};var OH=[800,1800],xS=t=>{pt.document?.prerendering?Ka(()=>xS(t)):pt.document?.readyState!=="complete"?addEventListener("load",()=>xS(t),!0):setTimeout(t)},gN=(t,e={})=>{let n=_i("TTFB"),r=bi(t,n,OH,e.reportAllChanges);xS(()=>{let o=ji();o&&(n.value=Math.max(o.responseStart-ao(),0),n.entries=[o],r(!0))})};var Vf={},ob={},hN,bN,yN,_N;function qi(t,e=!1){return ib("cls",t,DH,hN,e)}function Vi(t,e=!1){return ib("lcp",t,LH,bN,e)}function AS(t){return ib("ttfb",t,UH,yN)}function pl(t){return ib("inp",t,BH,_N)}function hr(t,e){return vN(t,e),ob[t]||(PH(t),ob[t]=!0),SN(t,e)}function Yf(t,e){let n=Vf[t];if(n?.length)for(let r of n)try{r(e)}catch(o){xn&&w.error(`Error while triggering instrumentation handler.
|
|
496
|
+
`,t&&e.setAttribute("nonce",t),e}function oH({h:t}){return function({action:n,setAction:r,options:o}){return t("div",{class:"editor__tool-container"},t("div",{class:"editor__tool-bar"},t("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},o.highlightToolText),t("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},o.hideToolText)))}}function iH({hooks:t}){function e(){let[n,r]=t.useState(jo.devicePixelRatio??1);return t.useEffect(()=>{let o=()=>{r(jo.devicePixelRatio)},i=matchMedia(`(resolution: ${jo.devicePixelRatio}dppx)`);return i.addEventListener("change",o),()=>{i.removeEventListener("change",o)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:i,onError:a}){let s=e();t.useEffect(()=>{(async()=>{r();let c=await Gf.mediaDevices.getDisplayMedia({video:{width:jo.innerWidth*s,height:jo.innerHeight*s},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=ye.createElement("video");await new Promise((u,p)=>{d.srcObject=c,d.onloadedmetadata=()=>{o(d,s),c.getTracks().forEach(f=>f.stop()),u()},d.play().catch(p)}),i()})().catch(a)},[])}}function aH(t,e,n){switch(t.type){case"highlight":{e.shadowColor="rgba(0, 0, 0, 0.7)",e.shadowBlur=50,e.fillStyle=n,e.fillRect(t.x-1,t.y-1,t.w+2,t.h+2),e.clearRect(t.x,t.y,t.w,t.h);break}case"hide":e.fillStyle="rgb(0, 0, 0)",e.fillRect(t.x,t.y,t.w,t.h);break}}function Ya(t,e,n){if(!t)return;let r=t.getContext("2d",e);r&&n(t,r)}function rS(t,e){Ya(t,{alpha:!0},(n,r)=>{r.drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height)})}function oS(t,e,n){Ya(t,{alpha:!0},(r,o)=>{n.length&&(o.fillStyle="rgba(0, 0, 0, 0.25)",o.fillRect(0,0,r.width,r.height)),n.forEach(i=>{aH(i,o,e)})})}function sH({h:t,hooks:e,outputBuffer:n,dialog:r,options:o}){let i=iH({hooks:e}),a=oH({h:t}),s=nH({h:t}),l={__html:rH(o.styleNonce).innerText},c=r.el.style,d=({screenshot:u})=>{let[p,f]=e.useState("highlight"),[m,_]=e.useState([]),v=e.useRef(null),h=e.useRef(null),y=e.useRef(null),S=e.useRef(null),[E,R]=e.useState(1),C=e.useMemo(()=>{let N=ye.getElementById(o.id);if(!N)return"white";let B=getComputedStyle(N);return B.getPropertyValue("--button-primary-background")||B.getPropertyValue("--accent-background")},[o.id]);e.useLayoutEffect(()=>{let N=()=>{let B=v.current;B&&(Ya(u.canvas,{alpha:!1},Y=>{let st=Math.min(B.clientWidth/Y.width,B.clientHeight/Y.height);R(st)}),(B.clientHeight===0||B.clientWidth===0)&&setTimeout(N,0))};return N(),jo.addEventListener("resize",N),()=>{jo.removeEventListener("resize",N)}},[u]);let k=e.useCallback((N,B)=>{Ya(N,{alpha:!0},(Y,st)=>{st.scale(B,B),Y.width=u.canvas.width,Y.height=u.canvas.height})},[u]);e.useEffect(()=>{k(h.current,u.dpi),rS(h.current,u.canvas)},[u]),e.useEffect(()=>{k(y.current,u.dpi),Ya(y.current,{alpha:!0},(N,B)=>{B.clearRect(0,0,N.width,N.height)}),oS(y.current,C,m)},[m,C]),e.useEffect(()=>{k(n,u.dpi),rS(n,u.canvas),Ya(ye.createElement("canvas"),{alpha:!0},(N,B)=>{B.scale(u.dpi,u.dpi),N.width=u.canvas.width,N.height=u.canvas.height,oS(N,C,m),rS(n,N)})},[m,u,C]);let L=N=>{if(!p||!S.current)return;let B=S.current.getBoundingClientRect(),Y={type:p,x:N.offsetX/E,y:N.offsetY/E},st=(X,ct)=>{let H=(ct.clientX-B.x)/E,gt=(ct.clientY-B.y)/E;return{type:X.type,x:Math.min(X.x,H),y:Math.min(X.y,gt),w:Math.abs(H-X.x),h:Math.abs(gt-X.y)}},ot=X=>{Ya(y.current,{alpha:!0},(ct,H)=>{H.clearRect(0,0,ct.width,ct.height)}),oS(y.current,C,[...m,st(Y,X)])},lt=X=>{let ct=st(Y,X);ct.w*E>=1&&ct.h*E>=1&&_(H=>[...H,ct]),ye.removeEventListener("mousemove",ot),ye.removeEventListener("mouseup",lt)};ye.addEventListener("mousemove",ot),ye.addEventListener("mouseup",lt)},F=e.useCallback(N=>B=>{B.preventDefault(),B.stopPropagation(),_(Y=>{let st=[...Y];return st.splice(N,1),st})},[]),U={width:`${u.canvas.width*E}px`,height:`${u.canvas.height*E}px`},D=N=>{N.stopPropagation()};return t("div",{class:"editor"},t("style",{nonce:o.styleNonce,dangerouslySetInnerHTML:l}),t("div",{class:"editor__image-container"},t("div",{class:"editor__canvas-container",ref:v},t("canvas",{ref:h,id:"background",style:U}),t("canvas",{ref:y,id:"foreground",style:U}),t("div",{ref:S,onMouseDown:L,style:U},m.map((N,B)=>t("div",{key:B,class:"editor__rect",style:{top:`${N.y*E}px`,left:`${N.x*E}px`,width:`${N.w*E}px`,height:`${N.h*E}px`}},t("button",{"aria-label":o.removeHighlightText,onClick:F(B),onMouseDown:D,onMouseUp:D,type:"button"},t(s,null))))))),t(a,{options:o,action:p,setAction:f}))};return function({onError:p}){let[f,m]=e.useState();return i({onBeforeScreenshot:e.useCallback(()=>{c.display="none"},[]),onScreenshot:e.useCallback((_,v)=>{Ya(ye.createElement("canvas"),{alpha:!1},(h,y)=>{y.scale(v,v),h.width=_.videoWidth,h.height=_.videoHeight,y.drawImage(_,0,0,h.width,h.height),m({canvas:h,dpi:v})}),n.width=_.videoWidth,n.height=_.videoHeight},[]),onAfterScreenshot:e.useCallback(()=>{c.display="block"},[]),onError:e.useCallback(_=>{c.display="block",p(_)},[])}),f?t(d,{screenshot:f}):t("div",null)}}var nN=(()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:t,hooks:e,dialog:n,options:r})=>{let o=ye.createElement("canvas");return{input:sH({h:t,hooks:e,outputBuffer:o,dialog:n,options:r}),value:async()=>{let i=await new Promise(a=>{o.toBlob(a,"image/png")});if(i)return{data:new Uint8Array(await i.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}));var V=nt,gS=0;function hS(){return gS>0}function lH(){gS++,setTimeout(()=>{gS--})}function ul(t,e={}){function n(o){return typeof o=="function"}if(!n(t))return t;try{if(Object.prototype.hasOwnProperty.call(t,"__sentry_wrapped__")){let i=t.__sentry_wrapped__;return typeof i=="function"?i:t}if(Aa(t))return t}catch{return t}let r=function(...o){nt._sentryWrappedDepth=(nt._sentryWrappedDepth||0)+1;try{let i=o.map(a=>ul(a,e));return t.apply(this,i)}catch(i){throw lH(),De(a=>{a.addEventProcessor(s=>(e.mechanism&&(Ps(s,void 0,void 0),En(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),Et(i)}),i}finally{nt._sentryWrappedDepth=(nt._sentryWrappedDepth||0)-1}};try{for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch{}Zd(r,t),Gt(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function cu(){let t=Kn(),{referrer:e}=V.document||{},{userAgent:n}=V.navigator||{},r={...e&&{Referer:e},...n&&{"User-Agent":n}};return{url:t,headers:r}}var cH=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],uH={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function dH(t){return uH[t]||t.replace("Integration","").toLowerCase()}var rN=V;async function Kh(t,e){let n=cH.includes(t)?dH(t):void 0,r=rN.Sentry=rN.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${t}`);let o=r[t];if(typeof o=="function"&&!("_isShim"in o))return o;let i=fH(n),a=V.document.createElement("script");a.src=i,a.crossOrigin="anonymous",a.referrerPolicy="strict-origin",e&&a.setAttribute("nonce",e);let s=new Promise((u,p)=>{a.addEventListener("load",()=>u()),a.addEventListener("error",p)}),l=V.document.currentScript,c=V.document.body||V.document.head||l?.parentElement;if(c)c.appendChild(a);else throw new Error(`Could not find parent element to insert lazy-loaded ${t} script`);try{await s}catch{throw new Error(`Error when loading integration: ${t}`)}let d=r[t];if(typeof d!="function")throw new Error(`Could not load integration: ${t}`);return d}function fH(t){let n=z()?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${ir}/${t}.min.js`,n).toString()}var oN=Yh({lazyLoadIntegration:Kh});var bS=Yh({getModalIntegration:()=>eN,getScreenshotIntegration:()=>nN});function uu(t,e){let n=Xh(t,e),r={type:bH(e),value:yH(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function pH(t,e,n,r){let i=z()?.getOptions().normalizeDepth,a=SH(e),s={__serialized__:ef(e,i)};if(a)return{exception:{values:[uu(t,a)]},extra:s};let l={exception:{values:[{type:xa(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:_H(e,{isUnhandledRejection:r})}]},extra:s};if(n){let c=Xh(t,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function yS(t,e){return{exception:{values:[uu(t,e)]}}}function Xh(t,e){let n=e.stacktrace||e.stack||"",r=gH(e),o=hH(e);try{return t(n,r,o)}catch{}return[]}var mH=/Minified React error #\d+;/i;function gH(t){return t&&mH.test(t.message)?1:0}function hH(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function iN(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function bH(t){let e=t?.name;return!e&&iN(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function yH(t){let e=t?.message;return iN(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?dh(e.error):dh(t):"No error message"}function Jh(t,e,n,r){let o=n?.syntheticException||void 0,i=du(t,e,o,r);return En(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),li(i)}function Qh(t,e,n="info",r,o){let i=r?.syntheticException||void 0,a=_S(t,e,i,o);return a.level=n,r?.event_id&&(a.event_id=r.event_id),li(a)}function du(t,e,n,r,o){let i;if(bc(e)&&e.error)return yS(t,e.error);if(Jd(e)||eg(e)){let a=e;if("stack"in e){i=yS(t,e);let s=i.exception?.values?.[0];if(r&&n&&s&&!s.stacktrace){let l=Xh(t,n);l.length&&(s.stacktrace={frames:l},En(i,{synthetic:!0}))}}else{let s=a.name||(Jd(a)?"DOMError":"DOMException"),l=a.message?`${s}: ${a.message}`:s;i=_S(t,l,n,r),Ps(i,l)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return mn(e)?yS(t,e):he(e)||xa(e)?(i=pH(t,e,n,o),En(i,{synthetic:!0}),i):(i=_S(t,e,n,r),Ps(i,`${e}`,void 0),En(i,{synthetic:!0}),i)}function _S(t,e,n,r){let o={};if(r&&n){let i=Xh(t,n);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]}),En(o,{synthetic:!0})}if(ei(e)){let{__sentry_template_string__:i,__sentry_template_values__:a}=e;return o.logentry={message:i,params:a},o}return o.message=e,o}function _H(t,{isUnhandledRejection:e}){let n=rg(t),r=e?"promise rejection":"exception";return bc(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:xa(t)?`Event \`${vH(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function vH(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function SH(t){return Object.values(t).find(e=>e instanceof Error)}var fu=class extends Nf{constructor(e){let n=EH(e),r=V.SENTRY_SDK_SOURCE||iv();Mf(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:a,_experiments:s,enableMetrics:l}=this._options,c=l??s?.enableMetrics??!0;V.document&&(i||a||c)&&V.document.addEventListener("visibilitychange",()=>{V.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),a&&Js(this),c&&Pc(this))}),o&&this.on("beforeSendSession",Sv)}eventFromException(e,n){return Jh(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Qh(this._options.stackParser,e,n,r,this._options.attachStacktrace)}_prepareEvent(e,n,r,o){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r,o)}};function EH(t){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:V.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...t}}var xn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var pt=nt;var TH=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",bi=(t,e,n,r)=>{let o,i;return a=>{e.value>=0&&(a||r)&&(i=e.value-(o??0),(i||o===void 0)&&(o=e.value,e.delta=i,e.rating=TH(e.value,n),t(e)))}};var ji=(t=!0)=>{let e=pt.performance?.getEntriesByType?.("navigation")[0];if(!t||e&&e.responseStart>0&&e.responseStart<performance.now())return e};var ao=()=>ji()?.activationStart??0;function so(t,e,n){pt.document&&pt.addEventListener(t,e,n)}function dl(t,e,n){pt.document&&pt.removeEventListener(t,e,n)}var pu=-1,aN=new Set,wH=()=>pt.document?.visibilityState==="hidden"&&!pt.document?.prerendering?0:1/0,Zh=t=>{if(xH(t)&&pu>-1){if(t.type==="visibilitychange"||t.type==="pagehide")for(let e of aN)e();isFinite(pu)||(pu=t.type==="visibilitychange"?t.timeStamp:0,dl("prerenderingchange",Zh,!0))}},yi=()=>{if(pt.document&&pu<0){let t=ao();pu=(pt.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>t)[0]?.startTime)??wH(),so("visibilitychange",Zh,!0),so("pagehide",Zh,!0),so("prerenderingchange",Zh,!0)}return{get firstHiddenTime(){return pu},onHidden(t){aN.add(t)}}};function xH(t){return t.type==="pagehide"||pt.document?.visibilityState==="hidden"}var sN=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var _i=(t,e=-1)=>{let n=ji(),r="navigate";return n&&(pt.document?.prerendering||ao()>0?r="prerender":pt.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:sN(),navigationType:r}};var vS=new WeakMap;function mu(t,e){try{return vS.get(t)||vS.set(t,new e),vS.get(t)}catch{return new e}}var tb=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}};var lo=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{e(o.getEntries())})});return r.observe({type:t,buffered:!0,...n}),r}}catch{}};var gu=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Ka=t=>{pt.document?.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()};var AH=[1800,3e3],lN=(t,e={})=>{Ka(()=>{let n=yi(),r=_i("FCP"),o,a=lo("paint",s=>{for(let l of s)l.name==="first-contentful-paint"&&(a.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-ao(),0),r.entries.push(l),o(!0)))});a&&(o=bi(t,r,AH,e.reportAllChanges))})};var kH=[.1,.25],cN=(t,e={})=>{lN(gu(()=>{let n=_i("CLS",0),r,o=yi(),i=mu(e,tb),a=l=>{for(let c of l)i._processEntry(c);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},s=lo("layout-shift",a);s&&(r=bi(t,n,kH,e.reportAllChanges),o.onHidden(()=>{a(s.takeRecords()),r(!0)}),pt?.setTimeout?.(r))}))};var uN=0,SS=1/0,eb=0,IH=t=>{t.forEach(e=>{e.interactionId&&(SS=Math.min(SS,e.interactionId),eb=Math.max(eb,e.interactionId),uN=eb?(eb-SS)/7+1:0)})},ES,TS=()=>ES?uN:performance.interactionCount||0,dN=()=>{"interactionCount"in performance||ES||(ES=lo("event",IH,{type:"event",buffered:!0,durationThreshold:0}))};var wS=10,fN=0,RH=()=>TS()-fN,nb=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){fN=TS(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(RH()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType==="first-input"))return;let n=this._longestInteractionList.at(-1),r=this._longestInteractionMap.get(e.interactionId);if(r||this._longestInteractionList.length<wS||e.duration>n._latency){if(r?e.duration>r._latency?(r.entries=[e],r._latency=e.duration):e.duration===r._latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,i)=>i._latency-o._latency),this._longestInteractionList.length>wS){let o=this._longestInteractionList.splice(wS);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var fl=t=>{let e=pt.requestIdleCallback||pt.setTimeout;pt.document?.visibilityState==="hidden"?t():(t=gu(t),so("visibilitychange",t,{once:!0,capture:!0}),so("pagehide",t,{once:!0,capture:!0}),e(()=>{t(),dl("visibilitychange",t,{capture:!0}),dl("pagehide",t,{capture:!0})}))};var NH=[200,500],CH=40,pN=(t,e={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=yi();Ka(()=>{dN();let r=_i("INP"),o,i=mu(e,nb),a=l=>{fl(()=>{for(let d of l)i._processEntry(d);let c=i._estimateP98LongestInteraction();c&&c._latency!==r.value&&(r.value=c._latency,r.entries=c.entries,o())})},s=lo("event",a,{durationThreshold:e.durationThreshold??CH});o=bi(t,r,NH,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{a(s.takeRecords()),o(!0)}))})};var rb=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}};var MH=[2500,4e3],mN=(t,e={})=>{Ka(()=>{let n=yi(),r=_i("LCP"),o,i=mu(e,rb),a=l=>{e.reportAllChanges||(l=l.slice(-1));for(let c of l)i._processEntry(c),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-ao(),0),r.entries=[c],o())},s=lo("largest-contentful-paint",a);if(s){o=bi(t,r,MH,e.reportAllChanges);let l=gu(()=>{a(s.takeRecords()),s.disconnect(),o(!0)}),c=d=>{d.isTrusted&&(fl(l),dl(d.type,c,{capture:!0}))};for(let d of["keydown","click","visibilitychange"])so(d,c,{capture:!0})}})};var OH=[800,1800],xS=t=>{pt.document?.prerendering?Ka(()=>xS(t)):pt.document?.readyState!=="complete"?addEventListener("load",()=>xS(t),!0):setTimeout(t)},gN=(t,e={})=>{let n=_i("TTFB"),r=bi(t,n,OH,e.reportAllChanges);xS(()=>{let o=ji();o&&(n.value=Math.max(o.responseStart-ao(),0),n.entries=[o],r(!0))})};var Vf={},ob={},hN,bN,yN,_N;function qi(t,e=!1){return ib("cls",t,DH,hN,e)}function Vi(t,e=!1){return ib("lcp",t,LH,bN,e)}function AS(t){return ib("ttfb",t,UH,yN)}function pl(t){return ib("inp",t,BH,_N)}function hr(t,e){return vN(t,e),ob[t]||(PH(t),ob[t]=!0),SN(t,e)}function Yf(t,e){let n=Vf[t];if(n?.length)for(let r of n)try{r(e)}catch(o){xn&&w.error(`Error while triggering instrumentation handler.
|
|
497
497
|
Type: ${t}
|
|
498
498
|
Name: ${Qn(r)}
|
|
499
|
-
Error:`,o)}}function DH(){return cN(t=>{Yf("cls",{metric:t}),hN=t},{reportAllChanges:!0})}function LH(){return mN(t=>{Yf("lcp",{metric:t}),bN=t},{reportAllChanges:!0})}function UH(){return gN(t=>{Yf("ttfb",{metric:t}),yN=t})}function BH(){return pN(t=>{Yf("inp",{metric:t}),_N=t})}function ib(t,e,n,r,o=!1){vN(t,e);let i;return ob[t]||(i=n(),ob[t]=!0),r&&e({metric:r}),SN(t,e,o?i:void 0)}function PH(t){let e={};t==="event"&&(e.durationThreshold=0),lo(t,n=>{Yf(t,{entries:n})},e)}function vN(t,e){Vf[t]=Vf[t]||[],Vf[t].push(e)}function SN(t,e,n){return()=>{n&&n();let r=Vf[t];if(!r)return;let o=r.indexOf(e);o!==-1&&r.splice(o,1)}}function EN(t){return"duration"in t}var zH=80,ml={};try{typeof Node<"u"&&(ml.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element<"u"&&(ml.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,ml.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,ml.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,ml.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<"u"&&(ml.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function Xa(t,e,n){let r=ml[e];if(r)try{return r.call(t,n)}catch{}let o=t[e];return typeof o=="function"?o.call(t,n):o}function pe(t,e={}){if(!t)return"<unknown>";try{let n=t,r=5,o=[],i=0,a=0,s=" > ",l=s.length,c,d=Array.isArray(e)?e:e.keyAttrs,u=!Array.isArray(e)&&e.maxStringLength||zH;for(;n&&i++<r&&(c=FH(n,d),!(c==="html"||i>1&&a+o.length*l+c.length>=u));)o.push(c),a+=c.length,n=Xa(n,"parentNode");return o.reverse().join(s)}catch{return"<unknown>"}}function FH(t,e){let n=[],r=Xa(t,"tagName");if(!r)return"";if(typeof HTMLElement<"u"&&t instanceof HTMLElement){let i=Xa(t,"dataset");if(i){if(i.sentryComponent)return i.sentryComponent;if(i.sentryElement)return i.sentryElement}}n.push(r.toLowerCase());let o=e?.length?e.filter(i=>Xa(t,"getAttribute",i)).map(i=>[i,Xa(t,"getAttribute",i)]):null;if(o?.length)o.forEach(i=>{n.push(`[${i[0]}="${i[1]}"]`)});else{let i=Xa(t,"id");i&&n.push(`#${i}`);let a=Xa(t,"className");if(a&&gn(a)){let s=a.split(/\s+/);for(let l of s)n.push(`.${l}`)}}for(let i of["aria-label","type","name","title","alt"]){let a=Xa(t,"getAttribute",i);a&&n.push(`[${i}="${a}"]`)}return n.join("")}var TN=t=>{let e=n=>{(n.type==="pagehide"||pt.document?.visibilityState==="hidden")&&t(n)};so("visibilitychange",e,{capture:!0,once:!0}),so("pagehide",e,{capture:!0,once:!0})};function ab(t){return typeof t=="number"&&isFinite(t)}function Yi(t,e,n,{...r}){let o=et(t).start_timestamp;return o&&o>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),Jr(t,()=>{let i=Ae({startTime:e,...r});return i&&i.end(n),i})}function hu(t){let e=P();if(!e)return;let{name:n,transaction:r,attributes:o,startTime:i}=t,{release:a,environment:s}=e.getOptions(),{userInfo:l}=e.getDataCollectionOptions(),d=e.getIntegrationByName("Replay")?.getReplayId(),u=rt(),p=u.getUser(),f=p!==void 0?p.email||p.id||p.ip_address:void 0,m;try{m=u.getScopeData().contexts.profile.profile_id}catch{}let _={release:a,environment:s,user:f||void 0,profile_id:m||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":pt.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return Ae({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function co(){return pt.addEventListener&&pt.performance}function se(t){return t/1e3}function wN(t){let e="unknown",n="unknown",r="";for(let o of t){if(o==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(o))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=o}return r===t&&(e=r),{name:e,version:n}}function gl(t){try{return PerformanceObserver.supportedEntryTypes.includes(t)}catch{return!1}}function hl(t,e){let n,r=!1;function o(s){!r&&n&&e(s,n.spanContext().spanId,n),r=!0}TN(()=>{o("pagehide")});let i=t.on("beforeStartNavigationSpan",(s,l)=>{l?.isRedirect||(o("navigation"),i(),a())}),a=t.on("afterStartPageLoadSpan",s=>{n=s,a()})}function xN(t){let e=0,n;if(!gl("layout-shift"))return;let r=qi(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(e=o.value,n=i)},!0);hl(t,(o,i)=>{HH(e,n,i,o),r()})}function HH(t,e,n,r){xn&&w.log(`Sending CLS span (${t})`);let o=e?se((ne()||0)+e.startTime):Mt(),i=rt().getScopeData().transactionName,a=e?pe(e.sources[0]?.node):"Layout shift",s={[at]:"auto.http.browser.cls",[ht]:"ui.webvital.cls",[jn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e?.sources&&e.sources.forEach((c,d)=>{s[`cls.source.${d+1}`]=pe(c.node)});let l=hu({name:a,transaction:i,attributes:s,startTime:o});l&&(l.addEvent("cls",{[Bo]:"",[Po]:t}),l.end(o))}var GH=6e4;function bl(t){return t!=null&&t>0&&t<=GH}function AN(t){let e=0,n;if(!gl("largest-contentful-paint"))return;let r=Vi(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!bl(o.value)||(e=o.value,n=i)},!0);hl(t,(o,i)=>{$H(e,n,i,o),r()})}function $H(t,e,n,r){if(!bl(t))return;xn&&w.log(`Sending LCP span (${t})`);let o=se((ne()||0)+(e?.startTime||0)),i=rt().getScopeData().transactionName,a=e?pe(e.element):"Largest contentful paint",s={[at]:"auto.http.browser.lcp",[ht]:"ui.webvital.lcp",[jn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e&&(e.element&&(s["lcp.element"]=pe(e.element)),e.id&&(s["lcp.id"]=e.id),e.url&&(s["lcp.url"]=e.url),e.loadTime!=null&&(s["lcp.loadTime"]=e.loadTime),e.renderTime!=null&&(s["lcp.renderTime"]=e.renderTime),e.size!=null&&(s["lcp.size"]=e.size));let l=hu({name:a,transaction:i,attributes:s,startTime:o});l&&(l.addEvent("lcp",{[Bo]:"millisecond",[Po]:t}),l.end(o))}function uo(t){return t&&((ne()||performance.timeOrigin)+t)/1e3}function Wf(t){let e={};if(t.nextHopProtocol!=null){let{name:n,version:r}=wN(t.nextHopProtocol);e["network.protocol.version"]=r,e["network.protocol.name"]=n}return ne()||co()?.timeOrigin?jH({...e,"http.request.redirect_start":uo(t.redirectStart),"http.request.redirect_end":uo(t.redirectEnd),"http.request.worker_start":uo(t.workerStart),"http.request.fetch_start":uo(t.fetchStart),"http.request.domain_lookup_start":uo(t.domainLookupStart),"http.request.domain_lookup_end":uo(t.domainLookupEnd),"http.request.connect_start":uo(t.connectStart),"http.request.secure_connection_start":uo(t.secureConnectionStart),"http.request.connection_end":uo(t.connectEnd),"http.request.request_start":uo(t.requestStart),"http.request.response_start":uo(t.responseStart),"http.request.response_end":uo(t.responseEnd),"http.request.time_to_first_byte":t.responseStart!=null?t.responseStart/1e3:void 0}):e}function jH(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!=null))}var qH=2147483647,kN=0,yr={},br,lb;function kS({recordClsStandaloneSpans:t,recordLcpStandaloneSpans:e,client:n}){let r=co();if(r&&ne()){r.mark&&pt.performance.mark("sentry-tracing-init");let o=e?AN(n):e===!1?YH():void 0,i=t?xN(n):t===!1?VH():void 0,a=WH(),s=KH();return()=>{a(),s(),o?.(),i?.()}}return()=>{}}function IS(){hr("longtask",({entries:t})=>{let e=Dt();if(!e)return;let{op:n,start_timestamp:r}=et(e);for(let o of t){let i=se(ne()+o.startTime),a=se(o.duration);n==="navigation"&&r&&i<r||Yi(e,i,i+a,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[at]:"auto.ui.browser.metrics"}})}})}function RS(){new PerformanceObserver(e=>{let n=Dt();if(n)for(let r of e.getEntries()){if(!r.scripts[0])continue;let o=se(ne()+r.startTime),{start_timestamp:i,op:a}=et(n);if(a==="navigation"&&i&&o<i)continue;let s=se(r.duration),l={[at]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:d,invokerType:u,sourceURL:p,sourceFunctionName:f,sourceCharPosition:m}=c;l["browser.script.invoker"]=d,l["browser.script.invoker_type"]=u,p&&(l["code.filepath"]=p),f&&(l["code.function"]=f),m!==-1&&(l["browser.script.source_char_position"]=m),Yi(n,o,o+s,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function NS(){hr("event",({entries:t})=>{let e=Dt();if(e){for(let n of t)if(n.name==="click"){let r=se(ne()+n.startTime),o=se(n.duration),i={name:pe(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[at]:"auto.ui.browser.metrics"}},a=Va(n.target);a&&(i.attributes["ui.component_name"]=a),Yi(e,r,r+o,i)}}})}function VH(){return qi(({metric:t})=>{let e=t.entries[t.entries.length-1];e&&(yr.cls={value:t.value,unit:""},lb=e)},!0)}function YH(){return Vi(({metric:t})=>{let e=t.entries[t.entries.length-1];!e||!bl(t.value)||(yr.lcp={value:t.value,unit:"millisecond"},br=e)},!0)}function WH(){return AS(({metric:t})=>{t.entries[t.entries.length-1]&&(yr.ttfb={value:t.value,unit:"millisecond"})})}function KH(){return hr("paint",({entries:t})=>{let e=yi();for(let n of t){let r=n.startTime<e.firstHiddenTime;n.name==="first-paint"&&r&&(yr.fp={value:n.startTime,unit:"millisecond"}),n.name==="first-contentful-paint"&&r&&(yr.fcp={value:n.startTime,unit:"millisecond"})}})}function CS(t,e){let n=co(),r=ne();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:a}=e,s=se(r),l=n.getEntries(),{op:c,start_timestamp:d}=et(t);l.slice(kN).forEach(u=>{let p=se(u.startTime),f=se(Math.max(0,u.duration));if(!(c==="navigation"&&d&&s+p<d))switch(u.entryType){case"navigation":{ZH(t,u,s);break}case"mark":case"paint":case"measure":{JH(t,u,p,f,s,i);break}case"resource":{n7(t,u,u.name,p,f,s,a);break}}}),kN=Math.max(l.length-1,0),r7(t,o)}function MS(t,e){let n=ne();if(!co()?.getEntries||!n){IN();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:o,recordLcpOnPageloadSpan:i}=e,a=se(n);if(et(t).op==="pageload"){if(a7(yr),r){let s=(l,c,d)=>{let u=d??`browser.web_vital.${l}.value`;t.setAttribute(u,c),xn&&w.log("Setting web vital attribute",{[u]:c},"on pageload span")};["ttfb","fp","fcp"].forEach(l=>{yr[l]&&s(l,yr[l].value)}),yr["ttfb.requestTime"]&&s("ttfb.requestTime",yr["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else o||delete yr.cls,i||delete yr.lcp,Object.entries(yr).forEach(([s,l])=>{qs(s,l.value,l.unit,t)}),o7(t,e);t.setAttribute(r?"browser.performance.time_origin":"performance.timeOrigin",a),t.setAttribute(r?"browser.performance.navigation.activation_start":"performance.activationStart",ao())}IN()}function IN(){br=void 0,lb=void 0,yr={}}function XH(t){if(t?.entryType==="measure")try{return t.detail.devtools.track==="Components \u269B"}catch{return}}function JH(t,e,n,r,o,i){if(XH(e)||["mark","measure"].includes(e.entryType)&&tn(e.name,i))return;let a=ji(!1),s=se(a?a.requestStart:0),l=o+Math.max(n,s),c=o+n,d=c+r,u={[at]:"auto.resource.browser.metrics"};l!==c&&(u["sentry.browser.measure_happened_before_request"]=!0,u["sentry.browser.measure_start_time"]=l),QH(u,e),l<=d&&Yi(t,l,d,{name:e.name,op:e.entryType,attributes:u})}function QH(t,e){try{let n=e.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&Ze(o))t[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{t[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(Ze(n)){t["sentry.browser.measure.detail"]=n;return}try{t["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function ZH(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{sb(t,e,r,n)}),sb(t,e,"secureConnection",n,"TLS/SSL"),sb(t,e,"fetch",n,"cache"),sb(t,e,"domainLookup",n,"DNS"),e7(t,e,n)}function sb(t,e,n,r,o=n){let i=t7(n),a=e[i],s=e[`${n}Start`];!s||!a||Yi(t,r+se(s),r+se(a),{op:`browser.${o}`,name:e.name,attributes:{[at]:"auto.ui.browser.metrics",...n==="redirect"&&e.redirectCount!=null?{"http.redirect_count":e.redirectCount}:{}}})}function t7(t){return t==="secureConnection"?"connectEnd":t==="fetch"?"domainLookupStart":`${t}End`}function e7(t,e,n){let r=n+se(e.requestStart),o=n+se(e.responseEnd),i=n+se(e.responseStart);e.responseEnd&&(Yi(t,r,o,{op:"browser.request",name:e.name,attributes:{[at]:"auto.ui.browser.metrics"}}),Yi(t,i,o,{op:"browser.response",name:e.name,attributes:{[at]:"auto.ui.browser.metrics"}}))}function n7(t,e,n,r,o,i,a){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;let s=e.initiatorType?`resource.${e.initiatorType}`:"resource.other";if(a?.includes(s))return;let l={[at]:"auto.resource.browser.metrics"},c=Zr(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(pt.location.origin),l[wc]=n,i7(e,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 d={...l,...Wf(e)},u=i+r,p=u+o;Yi(t,u,p,{name:n.replace(pt.location.origin,""),op:s,attributes:d})}function r7(t,e){let n=pt.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&t.setAttribute(e?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&t.setAttribute(e?"network.connection.type":"connectionType",r.type),ab(r.rtt)&&(e?t.setAttribute("network.connection.rtt",r.rtt):et(t).op==="pageload"&&qs("connection.rtt",r.rtt,"millisecond"))),ab(n.deviceMemory)&&(e?t.setAttribute("device.memory.estimated_capacity",n.deviceMemory):t.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),ab(n.hardwareConcurrency)&&(e?t.setAttribute("device.processor_count",n.hardwareConcurrency):t.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function o7(t,e){br&&e.recordLcpOnPageloadSpan&&(br.element&&t.setAttribute("lcp.element",pe(br.element)),br.id&&t.setAttribute("lcp.id",br.id),br.url&&t.setAttribute("lcp.url",br.url.trim().slice(0,200)),br.loadTime!=null&&t.setAttribute("lcp.loadTime",br.loadTime),br.renderTime!=null&&t.setAttribute("lcp.renderTime",br.renderTime),t.setAttribute("lcp.size",br.size)),lb?.sources&&e.recordClsOnPageloadSpan&&lb.sources.forEach((n,r)=>t.setAttribute(`cls.source.${r+1}`,pe(n.node)))}function i7(t,e,n){n.forEach(([r,o])=>{let i=t[r];i!=null&&(typeof i=="number"&&i<qH||typeof i=="string")&&(e[o]=i)})}function a7(t){let e=ji(!1);if(!e)return;let{responseStart:n,requestStart:r}=e;r<=n&&(t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var s7="ElementTiming",l7=(()=>({name:s7,setup(){!co()||!ne()||hr("element",({entries:e})=>{for(let n of e){let r=n;if(!r.identifier)continue;let o=r.identifier,i=r.name,a=r.renderTime,s=r.loadTime,l={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":o};i&&(l["ui.element.paint_type"]=i),r.id&&(l["ui.element.id"]=r.id),r.element&&(l["ui.element.type"]=r.element.tagName.toLowerCase()),r.url&&(l["ui.element.url"]=r.url),r.naturalWidth&&(l["ui.element.width"]=r.naturalWidth),r.naturalHeight&&(l["ui.element.height"]=r.naturalHeight),a>0&&Fa.distribution("ui.element.render_time",a,{unit:"millisecond",attributes:l}),s>0&&Fa.distribution("ui.element.load_time",s,{unit:"millisecond",attributes:l})}})}})),OS=l7;var DS=[],Kf=new Map,bu=new Map,LS=60;function US(){if(co()&&ne()){let e=c7();return()=>{e()}}return()=>{}}var yu={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 c7(){return pl(u7)}var u7=({metric:t})=>{if(t.value==null)return;let e=se(t.value);if(e>LS)return;let n=t.entries.find(m=>m.duration===t.value&&yu[m.name]);if(!n)return;let{interactionId:r}=n,o=yu[n.name],i=se(ne()+n.startTime),a=Dt(),s=a?Bt(a):void 0,l=r!=null?Kf.get(r):void 0,c=l?.span||s,d=c?et(c).description:rt().getScopeData().transactionName,u=l?.elementName||pe(n.target),p={[at]:"auto.http.browser.inp",[ht]:`ui.interaction.${o}`,[jn]:n.duration},f=hu({name:u,transaction:d,attributes:p,startTime:i});f&&(f.addEvent("inp",{[Bo]:"millisecond",[Po]:t.value}),f.end(i+e))};function RN(t){return t!=null?Kf.get(t):void 0}function BS(){let t=Object.keys(yu);Vn()&&t.forEach(o=>{pt.addEventListener(o,e,{capture:!0,passive:!0})});function e(o){let i=o.target;if(!i)return;let a=pe(i),s=Math.round(o.timeStamp);if(bu.set(s,a),bu.size>50){let l=bu.keys().next().value;l!==void 0&&bu.delete(l)}}function n(o){let i=Math.round(o.startTime),a=bu.get(i);if(!a)for(let s=-5;s<=5;s++){let l=bu.get(i+s);if(l){a=l;break}}return a||"<unknown>"}let r=({entries:o})=>{let i=Dt(),a=i&&Bt(i);o.forEach(s=>{if(!EN(s))return;let l=s.interactionId;if(l==null||Kf.has(l))return;let c=s.target?pe(s.target):n(s);if(DS.length>10){let d=DS.shift();Kf.delete(d)}DS.push(l),Kf.set(l,{span:a,elementName:c})})};hr("event",r),hr("first-input",r)}function PS(t){let{name:e,op:n,origin:r,metricName:o,value:i,attributes:a,parentSpan:s,reportEvent:l,startTime:c,endTime:d}=t,u=rt().getScopeData().transactionName,p={[at]:r,[ht]:n,[jn]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":u,"user_agent.original":pt.navigator?.userAgent,...a};s&&Ca(s).attributes?.[ht]==="pageload"&&(p["sentry.pageload.span_id"]=s.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let f=Ae({name:e,attributes:p,startTime:c,parentSpan:s});f&&f.end(d??c)}function zS(t){let e=0,n;if(!gl("largest-contentful-paint"))return;let r=Vi(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!bl(o.value)||(e=o.value,n=i)},!0);hl(t,(o,i,a)=>{d7(e,n,a,o),r()})}function d7(t,e,n,r){if(!bl(t))return;xn&&w.log(`Sending LCP span (${t})`);let o=ne()||0,i=se(o),a=se(o+(e?.startTime||0)),s=e?pe(e.element):"Largest contentful paint",l={};e?.element&&(l["browser.web_vital.lcp.element"]=pe(e.element)),e?.id&&(l["browser.web_vital.lcp.id"]=e.id),e?.url&&(l["browser.web_vital.lcp.url"]=e.url),e?.loadTime!=null&&(l["browser.web_vital.lcp.load_time"]=e.loadTime),e?.renderTime!=null&&(l["browser.web_vital.lcp.render_time"]=e.renderTime),e?.size!=null&&(l["browser.web_vital.lcp.size"]=e.size),PS({name:s,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:t,attributes:l,parentSpan:n,reportEvent:r,startTime:i,endTime:a})}function FS(t){let e=0,n;if(!gl("layout-shift"))return;let r=qi(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(e=o.value,n=i)},!0);hl(t,(o,i,a)=>{f7(e,n,a,o),r()})}function f7(t,e,n,r){xn&&w.log(`Sending CLS span (${t})`);let o=e?se((ne()||0)+e.startTime):Mt(),i=e?pe(e.sources[0]?.node):"Layout shift",a={};e?.sources&&e.sources.forEach((s,l)=>{a[`browser.web_vital.cls.source.${l+1}`]=pe(s.node)}),PS({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:t,attributes:a,parentSpan:n,reportEvent:r,startTime:o})}function HS(){if(!co()||!ne())return;pl(({metric:n})=>{if(n.value==null||se(n.value)>LS)return;let o=n.entries.find(i=>i.duration===n.value&&yu[i.name]);o&&p7(n.value,o)})}function p7(t,e){xn&&w.log(`Sending INP span (${t})`);let n=se(ne()+e.startTime),r=se(t),o=yu[e.name],i=RN(e.interactionId),a=Dt(),s=a?Bt(a):void 0,l=i?.span||s,c=l?Ca(l).name:rt().getScopeData().transactionName,d=i?.elementName||pe(e.target);PS({name:d,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:t,attributes:{[jn]:e.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var m7=1e3,NN,GS,$S;function Xf(t){zn("dom",t),Fn("dom",g7)}function g7(){if(!pt.document)return;let t=Qe.bind(null,"dom"),e=CN(t,!0);pt.document.addEventListener("click",e,!1),pt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let o=pt[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(be(o,"addEventListener",function(i){return function(a,s,l){if(a==="click"||a=="keypress")try{let c=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=c[a]=c[a]||{refCount:0};if(!d.handler){let u=CN(t);d.handler=u,i.call(this,a,u,l)}d.refCount++}catch{}return i.call(this,a,s,l)}}),be(o,"removeEventListener",function(i){return function(a,s,l){if(a==="click"||a=="keypress")try{let c=this.__sentry_instrumentation_handlers__||{},d=c[a];d&&(d.refCount--,d.refCount<=0&&(i.call(this,a,d.handler,l),d.handler=void 0,delete c[a]),Object.keys(c).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,a,s,l)}}))})}function h7(t){if(t.type!==GS)return!1;try{if(!t.target||t.target._sentryId!==$S)return!1}catch{}return!0}function b7(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function CN(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;let r=y7(n);if(b7(n.type,r))return;Gt(n,"_sentryCaptured",!0),r&&!r._sentryId&&Gt(r,"_sentryId",ae());let o=n.type==="keypress"?"input":n.type;h7(n)||(t({event:n,name:o,global:e}),GS=n.type,$S=r?r._sentryId:void 0),clearTimeout(NN),NN=pt.setTimeout(()=>{$S=void 0,GS=void 0},m7)}}function y7(t){try{return t.target}catch{return null}}var cb;function Wi(t){let e="history";zn(e,t),Fn(e,_7)}function _7(){if(pt.addEventListener("popstate",()=>{let e=pt.location.href,n=cb;if(cb=e,n===e)return;Qe("history",{from:n,to:e})}),!Oh())return;function t(e){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=cb,i=v7(String(r));if(cb=i,o===i)return e.apply(this,n);Qe("history",{from:o,to:i})}return e.apply(this,n)}}be(pt.history,"pushState",t),be(pt.history,"replaceState",t)}function v7(t){try{return new URL(t,pt.location.origin).toString()}catch{return t}}var ub={};function _u(t){let e=ub[t];if(e)return e;let n=pt[t];if(ru(n))return ub[t]=n.bind(pt);let r=pt.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?.[t]&&(n=i[t]),r.head.removeChild(o)}catch(o){xn&&w.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return n&&(ub[t]=n.bind(pt))}function jS(t){ub[t]=void 0}function yl(...t){return _u("setTimeout")(...t)}var tr="__sentry_xhr_v3__";function _l(t){zn("xhr",t),Fn("xhr",S7)}function S7(){if(!pt.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){let o=new Error,i=Mt()*1e3,a=gn(r[0])?r[0].toUpperCase():void 0,s=E7(r[1]);if(!a||!s)return e.apply(n,r);n[tr]={method:a,url:s,request_headers:{}},a==="POST"&&s.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let l=()=>{let c=n[tr];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}let d={endTimestamp:Mt()*1e3,startTimestamp:i,xhr:n,virtualError:o};Qe("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,d,u){return l(),c.apply(d,u)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,d,u){let[p,f]=u,m=d[tr];return m&&gn(p)&&gn(f)&&(m.request_headers[p.toLowerCase()]=f),c.apply(d,u)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){let o=n[tr];if(!o)return e.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:Mt()*1e3,xhr:n};return Qe("xhr",i),e.apply(n,r)}})}function E7(t){if(gn(t))return t;try{return t.toString()}catch{}}var T7=Symbol.for("sentry__originalRequestBody");function db(t){return new URLSearchParams(t).toString()}function vl(t,e=w){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[db(t)];if(!t)return[void 0]}catch(n){return xn&&e.error(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return xn&&e.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function vu(t=[]){if(t.length>=2&&t[1]&&typeof t[1]=="object"&&"body"in t[1])return t[1].body;if(t.length>=1&&t[0]instanceof Request){let n=t[0][T7];return n!==void 0?n:void 0}}function Jf(t){let e;try{e=t.getAllResponseHeaders()}catch(n){return xn&&w.error(n,"Failed to get xhr response headers",t),{}}return e?e.split(`\r
|
|
500
|
-
`).reduce((n,r)=>{let[o,i]=r.split(": ");return i&&(n[o.toLowerCase()]=i),n},{}):{}}function qS(t){if(typeof Element>"u")return!1;try{return t instanceof Element}catch{return!1}}var w7=40;function Su(t,e=_u("fetch")){let n=0,r=0;async function o(i){let a=i.body.length;n+=a,r++;let s={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{let l=await e(t.url,s);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 jS("fetch"),l}finally{n-=a,r--}}return If(t,o,Qs(t.bufferSize||w7))}var W=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function x7(){let t=P();if(!t){W&&w.warn("No Sentry client available, profiling is not started");return}if(!t.getIntegrationByName("BrowserProfiling")){W&&w.warn("BrowserProfiling integration is not available");return}t.emit("startUIProfiler")}function A7(){let t=P();if(!t){W&&w.warn("No Sentry client available, profiling is not started");return}if(!t.getIntegrationByName("BrowserProfiling")){W&&w.warn("ProfilingIntegration is not available");return}t.emit("stopUIProfiler")}var MN={startProfiler:x7,stopProfiler:A7};var k7=10,I7=20,R7=30,N7=40,C7=50;function Eu(t,e,n,r){let o={filename:t,function:e==="<anonymous>"?"?":e,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}var M7=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,O7=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,D7=/\((\S*)(?::(\d+))(?::(\d+))\)/,L7=/at (.+?) ?\(data:(.+?),/,U7=t=>{let e=t.match(L7);if(e)return{filename:`<data:${e[2]}>`,function:e[1]};let n=M7.exec(t);if(n){let[,o,i,a]=n;return Eu(o,"?",+i,+a)}let r=O7.exec(t);if(r){if(r[2]?.indexOf("eval")===0){let s=D7.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[i,a]=UN(r[1]||"?",r[2]);return Eu(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},VS=[R7,U7],B7=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,P7=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,z7=t=>{let e=B7.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=P7.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],o=e[1]||"?";return[o,r]=UN(o,r),Eu(r,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},YS=[C7,z7],F7=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,H7=t=>{let e=F7.exec(t);return e?Eu(e[2],e[1]||"?",+e[3],e[4]?+e[4]:void 0):void 0},ON=[N7,H7],G7=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,$7=t=>{let e=G7.exec(t);return e?Eu(e[2],e[3]||"?",+e[1]):void 0},DN=[k7,$7],j7=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,q7=t=>{let e=j7.exec(t);return e?Eu(e[5],e[3]||e[4]||"?",+e[1],+e[2]):void 0},LN=[I7,q7],WS=[VS,YS],fb=Yd(...WS),UN=(t,e)=>{let n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};function BN(t,{metadata:e,tunnel:n,dsn:r}){let o={event_id:t.event_id,sent_at:new Date().toISOString(),...e?.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:en(r)}},i=V7(t);return Le(o,[i])}function V7(t){return[{type:"user_report"},t]}var pb=1024,Y7="Breadcrumbs",W7=((t={})=>{let e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:Y7,setup(n){e.console&&nl(J7(n)),e.dom&&Xf(X7(n,e.dom)),e.xhr&&_l(Q7(n)),e.fetch&&hi(Z7(n)),e.history&&Wi(t9(n)),e.sentry&&n.on("beforeSendEvent",K7(n))}}}),mb=W7;function K7(t){return function(n){P()===t&&wn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Lo(n)},{event:n})}}function X7(t,e){return function(r){if(P()!==t)return;let o,i,a=typeof e=="object"?e.serializeAttribute:void 0,s=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;s&&s>pb&&(W&&w.warn(`\`dom.maxStringLength\` cannot exceed ${pb}, but a value of ${s} was configured. Sentry will use ${pb} instead.`),s=pb),typeof a=="string"&&(a=[a]);try{let c=r.event,d=e9(c)?c.target:c;o=pe(d,{keyAttrs:a,maxStringLength:s}),i=Va(d)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${r.name}`,message:o};i&&(l.data={"ui.component_name":i}),wn(l,{event:r.event,name:r.name,global:r.global})}}function J7(t){return function(n){if(P()!==t)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:Hi(n.level),message:ka(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${ka(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;wn(r,{input:n.args,level:n.level})}}function Q7(t){return function(n){if(P()!==t)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[tr];if(!r||!o||!i)return;let{method:a,url:s,status_code:l,body:c}=i,d={method:a,url:s,status_code:l},u={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},p={category:"xhr",data:d,type:"http",level:Mh(l)};t.emit("beforeOutgoingRequestBreadcrumb",p,u),wn(p,u)}}function Z7(t){return function(n){if(P()!==t)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},a={category:"fetch",data:n.fetchData,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",a,i),wn(a,i)}else{let i=n.response,a={...n.fetchData,status_code:i?.status},s={input:n.args,response:i,startTimestamp:r,endTimestamp:o},l={category:"fetch",data:a,type:"http",level:Mh(a.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",l,s),wn(l,s)}}}function t9(t){return function(n){if(P()!==t)return;let r=n.from,o=n.to,i=Zr(q.location.href),a=r?Zr(r):void 0,s=Zr(o);a?.path||(a=i),i.protocol===s.protocol&&i.host===s.host&&(o=s.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),wn({category:"navigation",data:{from:r,to:o}})}}function e9(t){return!!t&&!!t.target}var n9="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(","),r9="BrowserApiErrors",o9=((t={})=>{let e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...t};return{name:r9,setupOnce(){e.setTimeout&&be(q,"setTimeout",PN),e.setInterval&&be(q,"setInterval",PN),e.requestAnimationFrame&&be(q,"requestAnimationFrame",i9),e.XMLHttpRequest&&"XMLHttpRequest"in q&&be(XMLHttpRequest.prototype,"send",a9);let n=e.eventTarget;n&&(Array.isArray(n)?n:n9).forEach(o=>s9(o,e))}}}),gb=o9;function PN(t){return function(...e){let n=e[0];return e[0]=ul(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Qn(t)}`}}),t.apply(this,e)}}function i9(t){return function(e){return t.apply(this,[ul(e,{mechanism:{data:{handler:Qn(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function a9(t){return function(...e){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&be(n,o,function(i){let a={mechanism:{data:{handler:Qn(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},s=Aa(i);return s&&(a.mechanism.data.handler=Qn(s)),ul(i,a)})}),t.apply(this,e)}}function s9(t,e){let r=q[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(be(r,"addEventListener",function(o){return function(i,a,s){try{l9(a)&&(a.handleEvent=ul(a.handleEvent,{mechanism:{data:{handler:Qn(a),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return e.unregisterOriginalCallbacks&&c9(this,i,a),o.apply(this,[i,ul(a,{mechanism:{data:{handler:Qn(a),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),s])}}),be(r,"removeEventListener",function(o){return function(i,a,s){try{if(Object.prototype.hasOwnProperty.call(a,"__sentry_wrapped__")){let l=a.__sentry_wrapped__;l&&o.call(this,i,l,s)}}catch{}return o.call(this,i,a,s)}}))}function l9(t){return typeof t.handleEvent=="function"}function c9(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}var hb=(t={})=>{let e=t.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof q.document>"u"){W&&w.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Ks({ignoreDuration:!0});let n=!1;fl(()=>{n||(Ua(),n=!0)});let r=Pt(),o=r.getUser();r.addScopeListener(i=>{let a=i.getUser();(o?.id!==a?.id||o?.ip_address!==a?.ip_address)&&(o=a,n&&Ua())}),e==="route"&&Wi(({from:i,to:a})=>{i!==a&&(Ks({ignoreDuration:!0}),Ua(),n=!0)})}}};var u9="CultureContext",d9=(()=>({name:u9,preprocessEvent(t){let e=zN();e&&(t.contexts={...t.contexts,culture:{...e,...t.contexts?.culture}})},processSegmentSpan(t){let e=zN();e&&Nr(t,{"culture.locale":e.locale,"culture.timezone":e.timezone,"culture.calendar":e.calendar})}})),bb=d9;function zN(){try{let t=q.Intl;if(!t)return;let e=t.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone,calendar:e.calendar}}catch{return}}var f9="GlobalHandlers",p9=((t={})=>{let e={onerror:!0,onunhandledrejection:!0,...t};return{name:f9,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(m9(n),FN("onerror")),e.onunhandledrejection&&(g9(n),FN("onunhandledrejection"))}}}),yb=p9;function m9(t){Kd(e=>{let{stackParser:n,attachStacktrace:r}=HN();if(P()!==t||hS())return;let{msg:o,url:i,line:a,column:s,error:l}=e,c=h9(du(n,l||o,void 0,r,!1),i,a,s);c.level="error",Qr(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function g9(t){Xd(e=>{let{stackParser:n,attachStacktrace:r}=HN();if(P()!==t||hS())return;let o=KS(e),i=Ze(o)?XS(o):du(n,o,void 0,r,!0);i.level="error",Qr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function KS(t){if(Ze(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function XS(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function h9(t,e,n,r){let o=t.exception=t.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[];return l.length===0&&l.push({colno:r,lineno:n,filename:b9(e)??Kn(),function:"?",in_app:!0}),t}function FN(t){W&&w.log(`Global Handler attached: ${t}`)}function HN(){return P()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function b9(t){if(!(!gn(t)||t.length===0))return t.startsWith("data:")?`<${Yn(t,!1)}>`:t}var _b=()=>({name:"HttpContext",preprocessEvent(t){if(!q.navigator&&!q.location&&!q.document)return;let e=cu(),n={...e.headers,...t.request?.headers};t.request={...e,...t.request,headers:n}},processSegmentSpan(t){let e=t.attributes?.[ht];if(!q.navigator&&!q.location&&!q.document)return;let n=cu();Nr(t,{"url.full":e!=="http.client"?n.url:void 0,"http.request.header.user_agent":n.headers["User-Agent"],"http.request.header.referer":n.headers.Referer})}});var y9="cause",_9=5,v9="LinkedErrors",S9=((t={})=>{let e=t.limit||_9,n=t.key||y9;return{name:v9,preprocessEvent(r,o,i){let a=i.getOptions();wv(uu,a.stackParser,n,e,r,o)}}}),vb=S9;var E9=/^HTML(\w*)Element$/;function Tu(t){if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(qS(t)){let e=T9(t);if(E9.test(e))return`[HTMLElement: ${pe(t)}]`}}function T9(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function GN(){return w9()?(W&&pn(()=>{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 w9(){if(typeof q.window>"u")return!1;let t=q;if(t.nw||!(t.chrome||t.browser)?.runtime?.id)return!1;let n=Kn();return!(q===q.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function JS(t){return[Df(),Of(),Dv(),gb(),mb(),yb(),vb(),Lf(),_b(),bb(),hb()]}function QS(t={}){let e=!t.skipBrowserExtensionCheck&&GN(),n=t.defaultIntegrations==null?JS():t.defaultIntegrations,r={...t,enabled:e?!1:t.enabled,stackParser:tg(t.stackParser||fb),integrations:eh({integrations:t.integrations,defaultIntegrations:n}),transport:t.transport||Su};return _c(Tu),mv(fu,r)}function $N(){}function jN(t){t()}function Qf(t={}){let e=q.document,n=e?.head||e?.body;if(!n){W&&w.error("[showReportDialog] Global document not defined");return}let r=rt(),i=P()?.getDsn();if(!i){W&&w.error("[showReportDialog] DSN not configured");return}let a={...t,user:{...r.getUser(),...t.user},eventId:t.eventId||Dc()},s=q.document.createElement("script");s.async=!0,s.crossOrigin="anonymous",s.src=Z0(i,a);let{onLoad:l,onClose:c}=a;if(l&&(s.onload=l),c){let d=u=>{if(u.data==="__sentry_reportdialog_closed__")try{c()}finally{q.removeEventListener("message",d)}};q.addEventListener("message",d)}n.appendChild(s)}var x9=tt,A9="ReportingObserver",qN=new WeakMap,k9=((t={})=>{let e=t.types||["crash","deprecation","intervention"];function n(r){if(qN.has(P()))for(let o of r)Oe(i=>{i.setExtra("url",o.url);let a=`ReportingObserver [${o.type}]`,s="No details available";if(o.body){let l={};for(let c in o.body)l[c]=o.body[c];if(i.setExtra("body",l),o.type==="crash"){let c=o.body;s=[c.crashId||"",c.reason||""].join(" ").trim()||s}else s=o.body.message||s}Da(`${a}: ${s}`)})}return{name:A9,setupOnce(){if(!Dh())return;new x9.ReportingObserver(n,{buffered:!0,types:e}).observe()},setup(r){qN.set(r,!0)}}}),VN=k9;var I9="HttpClient",R9=((t={})=>{let e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...t};return{name:I9,setup(n){U9(n,e),B9(n,e)}}}),WN=R9;function N9(t,e,n,r,o){if(KN(t,n.status,n.url)){let i=P9(e,r),a,s,l,c,d=JN();if(d.requestHeaders!==!1&&(a=za(YN(i.headers),d.requestHeaders)),d.responseHeaders!==!1&&(s=za(YN(n.headers),d.responseHeaders)),d.cookies!==!1){let p=i.headers.get("Cookie")||void 0;if(p){let m=Cf(p,d.cookies);typeof m=="object"&&(l=m)}let f=n.headers.get("Set-Cookie")||void 0;if(f){let m=Cf(f,d.cookies);typeof m=="object"&&(c=m)}}let u=XN({url:i.url,method:i.method,status:n.status,requestHeaders:a,responseHeaders:s,requestCookies:l,responseCookies:c,error:o,type:"fetch"});Qr(u)}}function C9(t,e,n,r,o){if(KN(t,e.status,e.responseURL)){let i,a,s,l=JN();if(l.cookies!==!1)try{let d=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;if(d){let u=Cf(d,l.cookies);typeof u=="object"&&(a=u)}}catch{}if(l.responseHeaders!==!1)try{s=za(O9(e),l.responseHeaders)}catch{}l.requestHeaders!==!1&&(i=za(r,l.requestHeaders));let c=XN({url:e.responseURL,method:n,status:e.status,requestHeaders:i,responseHeaders:s,responseCookies:a,error:o,type:"xhr"});Qr(c)}}function M9(t){if(t){let e=t["Content-Length"]||t["content-length"];if(e)return parseInt(e,10)}}function YN(t){let e={};return t.forEach((n,r)=>{e[r]=n}),e}function O9(t){let e=t.getAllResponseHeaders();return e?e.split(`\r
|
|
501
|
-
`).reduce((n,r)=>{let[o,i]=r.split(": ");return o&&i&&(n[o]=i),n},{}):{}}function D9(t,e){return t.some(n=>typeof n=="string"?e.includes(n):n.test(e))}function L9(t,e){return t.some(n=>typeof n=="number"?n===e:e>=n[0]&&e<=n[1])}function U9(t,e){ou()&&hi(n=>{if(
|
|
502
|
-
`),"</html>"];return o.forEach(s=>{let l=s.stacktrace;l?.frames&&(l.frames=l.frames.map(c=>$9(c,a,r,e)))}),t}function $9(t,e,n,r){return t.filename!==n||!t.lineno||!e.length||og(e,t,r),t}var j9="GraphQLClient",q9=(t=>({name:j9,setup(e){V9(e,t),Y9(e,t)}}));function V9(t,e){t.on("beforeOutgoingRequestSpan",(n,r)=>{let i=et(n).data||{};if(!(i[ht]==="http.client"))return;let l=i[wc]||i["http.url"]||i.url,c=i[Sg]||i["http.method"];if(!gn(l)||!gn(c))return;let{endpoints:d}=e,u=tn(l,d),p=tC(r);if(u&&p){let f=eC(p);if(f){let m=ZN(f);n.updateName(`${c} ${l} (${m})`),Eb(f)&&n.setAttribute("graphql.document",f.query),Tb(f)&&(n.setAttribute("graphql.persisted_query.hash.sha256",f.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",f.extensions.persistedQuery.version))}}})}function Y9(t,e){t.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{let{category:o,type:i,data:a}=n;if(i==="http"&&(o==="fetch"||o==="xhr")){let d=a?.url,{endpoints:u}=e,p=tn(d,u),f=tC(r);if(p&&a&&f){let m=eC(f);if(!a.graphql&&m){let _=ZN(m);a["graphql.operation"]=_,Eb(m)&&(a["graphql.document"]=m.query),Tb(m)&&(a["graphql.persisted_query.hash.sha256"]=m.extensions.persistedQuery.sha256Hash,a["graphql.persisted_query.version"]=m.extensions.persistedQuery.version)}}}})}function ZN(t){if(Tb(t))return`persisted ${t.operationName}`;if(Eb(t)){let{query:e,operationName:n}=t,{operationName:r=n,operationType:o}=W9(e);return r?`${o} ${r}`:`${o}`}return"unknown"}function tC(t){let e="xhr"in t,n;if(e){let r=t.xhr[tr];n=r&&vl(r.body)[0]}else{let r=vu(t.input);n=vl(r)[0]}return n}function W9(t){let e=/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/,n=/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/,r=t.match(e);if(r)return{operationType:r[1],operationName:r[2]};let o=t.match(n);return o?{operationType:o[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function Sb(t){return typeof t=="object"&&t!==null}function Eb(t){return Sb(t)&&typeof t.query=="string"}function Tb(t){return Sb(t)&&typeof t.operationName=="string"&&Sb(t.extensions)&&Sb(t.extensions.persistedQuery)&&typeof t.extensions.persistedQuery.sha256Hash=="string"&&typeof t.extensions.persistedQuery.version=="number"}function eC(t){try{let e=JSON.parse(t);return Eb(e)||Tb(e)?e:void 0}catch{return}}var nC=q9;var rC=(t={})=>{let e=["script"];function n(r,o,i=0){if(!r)return;let a="shadowRoot"in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(let s of a){if(!(s instanceof HTMLElement))continue;let l=Va(s,1)||void 0,c=s.tagName.toLowerCase();if(e.includes(c))continue;let d=t.onElement?.({element:s,componentName:l,tagName:c,depth:i})||{};if(d==="skip")continue;if(d==="children"){n(s,o,i+1);continue}let{x:u,y:p,width:f,height:m}=s.getBoundingClientRect(),_={identifier:s.id||void 0,type:l||c,visible:!0,alpha:1,height:m,width:f,x:u,y:p,...d},v=[];_.children=v,n(s,_.children,i+1),o.push(_)}}return{name:"ViewHierarchy",processEvent:(r,o)=>{if(r.type!==void 0||t.shouldAttach?.(r,o)===!1)return r;let i={rendering_system:"DOM",positioning:"absolute",windows:[]};n(t.rootElement?.()||q.document.body,i.windows);let a={filename:"view-hierarchy.json",attachmentType:"event.view_hierarchy",contentType:"application/json",data:JSON.stringify(i)};return o.attachments=o.attachments||[],o.attachments.push(a),r}}};var we=tt,RE="sentryReplaySession",K9="replay_event",NE="Unable to send Replay",X9=3e5,J9=9e5,Q9=5e3,Z9=5500,tG=6e4,eG=5e3,nG=3,oC=15e4,wb=5e3,rG=3e3,oG=300,CE=2e7,iG=4999,aG=5e4,iC=36e5,sG=Object.defineProperty,lG=(t,e,n)=>e in t?sG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,aC=(t,e,n)=>lG(t,typeof e!="symbol"?e+"":e,n),rn=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(rn||{});function cG(t){return t.nodeType===t.ELEMENT_NODE}function ep(t){return t?.host?.shadowRoot===t}function np(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function uG(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function dG(t){let{cssText:e}=t;if(e.split('"').length<3)return e;let n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function Rb(t){try{let e=t.rules||t.cssRules;return e?uG(Array.from(e,NC).join("")):null}catch{return null}}function fG(t){let e="";for(let n=0;n<t.style.length;n++){let r=t.style,o=r[n],i=r.getPropertyPriority(o);e+=`${o}:${r.getPropertyValue(o)}${i?" !important":""};`}return`${t.selectorText} { ${e} }`}function NC(t){let e;if(mG(t))try{e=Rb(t.styleSheet)||dG(t)}catch{}else if(gG(t)){let n=t.cssText,r=t.selectorText.includes(":"),o=typeof t.style.all=="string"&&t.style.all;if(o&&(n=fG(t)),r&&(n=pG(n)),r||o)return n}return e||t.cssText}function pG(t){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function mG(t){return"styleSheet"in t}function gG(t){return"selectorText"in t}var Nb=class{constructor(){aC(this,"idNodeMap",new Map),aC(this,"nodeMetaMap",new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){let r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){let r=this.getNode(e);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function hG(){return new Nb}function jb({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function op({isMasked:t,element:e,value:n,maskInputFn:r}){let o=n||"";return t?(r&&(o=r(o,e)),"*".repeat(o.length)):o}function Cu(t){return t.toLowerCase()}function iE(t){return t.toUpperCase()}var sC="__rrweb_original__";function bG(t){let e=t.getContext("2d");if(!e)return!0;let n=50;for(let r=0;r<t.width;r+=n)for(let o=0;o<t.height;o+=n){let i=e.getImageData,a=sC in i?i[sC]:i;if(new Uint32Array(a.call(e,r,o,Math.min(n,t.width-r),Math.min(n,t.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function ME(t){let e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Cu(e):null}function Cb(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}function CC(t,e){let n;try{n=new URL(t,e??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}var lC={};function MC(t){let e=lC[t];if(e)return e;let n=window.document,r=window[t];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[t]&&(r=i[t]),n.head.removeChild(o)}catch{}return lC[t]=r.bind(window)}function aE(...t){return MC("setTimeout")(...t)}function OC(...t){return MC("clearTimeout")(...t)}function DC(t){try{return t.contentDocument}catch{}}function yG(t){try{return t.contentWindow}catch{}}var _G=1,vG=new RegExp("[^a-z0-9-_:]"),ip=-2;function OE(){return _G++}function SG(t){if(t instanceof HTMLFormElement)return"form";let e=Cu(t.tagName);return vG.test(e)?"div":e}function EG(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var wu,cC,TG=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,wG=/^(?:[a-z+]+:)?\/\//i,xG=/^www\..*/i,AG=/^(data:)([^,]*),(.*)/i;function kG(t,e){if(!t||e.size===0)return t;try{let n=t.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 a=o.slice(0,i).trim();e.has(a)||r.push(o)}return r.join("; ")+(r.length>0&&t.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),t}}function Mb(t,e){return(t||"").replace(TG,(n,r,o,i,a,s)=>{let l=o||a||s,c=r||i||"";if(!l)return n;if(wG.test(l)||xG.test(l))return`url(${c}${l}${c})`;if(AG.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${EG(e)+l}${c})`;let d=e.split("/"),u=l.split("/");d.pop();for(let p of u)p!=="."&&(p===".."?d.pop():d.push(p));return`url(${c}${d.join("/")}${c})`})}var IG=/^[^ \t\n\r\u000c]+/,RG=/^[, \t\n\r\u000c]+/;function NG(t,e){if(e.trim()==="")return e;let n=0;function r(i){let a,s=i.exec(e.substring(n));return s?(a=s[0],n+=a.length,a):""}let o=[];for(;r(RG),!(n>=e.length);){let i=r(IG);if(i.slice(-1)===",")i=ku(t,i.substring(0,i.length-1)),o.push(i);else{let a="";i=ku(t,i);let s=!1;for(;;){let l=e.charAt(n);if(l===""){o.push((i+a).trim());break}else if(s)l===")"&&(s=!1);else if(l===","){n+=1,o.push((i+a).trim());break}else l==="("&&(s=!0);a+=l,n+=1}}}return o.join(", ")}var uC=new WeakMap;function ku(t,e){return!e||e.trim()===""?e:qb(t,e)}function CG(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function qb(t,e){let n=uC.get(t);if(n||(n=t.createElement("a"),uC.set(t,n)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return n.setAttribute("href",e),n.href}function LC(t,e,n,r,o,i,a){if(!r)return r;if(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#"))return ku(t,r);if(n==="xlink:href"&&r[0]!=="#")return ku(t,r);if(n==="background"&&(e==="table"||e==="td"||e==="th"))return ku(t,r);if(n==="srcset")return NG(t,r);if(n==="style"){let s=Mb(r,qb(t));return a&&a.size>0&&(s=kG(s,a)),s}else if(e==="object"&&n==="data")return ku(t,r);return typeof i=="function"?i(n,r,o):r}function UC(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function MG(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let o=t.classList.length;o--;){let i=t.classList[o];if(e.test(i))return!0}if(n)return t.matches(n)}catch{}return!1}function OG(t,e){for(let n=t.classList.length;n--;){let r=t.classList[n];if(e.test(r))return!0}return!1}function Sl(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:Sl(t.parentNode,e,n,r+1)}function Iu(t,e){return n=>{let r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(OG(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Mu(t,e,n,r,o,i){try{let a=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(a===null)return!1;if(a.tagName==="INPUT"){let c=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let s=-1,l=-1;if(i){if(l=Sl(a,Iu(r,o)),l<0)return!0;s=Sl(a,Iu(e,n),l>=0?l:1/0)}else{if(s=Sl(a,Iu(e,n)),s<0)return!1;l=Sl(a,Iu(r,o),s>=0?s:1/0)}return s>=0?l>=0?s<=l:!0:l>=0?!1:!!i}catch{}return!!i}function DG(t,e,n){let r=yG(t);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let s=aE(()=>{o||(e(),o=!0)},n);t.addEventListener("load",()=>{OC(s),o=!0,e()});return}let a="about:blank";if(r.location.href!==a||t.src===a||t.src==="")return aE(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function LG(t,e,n){let r=!1,o;try{o=t.sheet}catch{o=null}if(o)return;let i=aE(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{OC(i),r=!0,e()})}function UG(t,e){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:p,inlineStylesheet:f,maskInputOptions:m={},maskTextFn:_,maskInputFn:v,dataURLOptions:h={},inlineImages:y,recordCanvas:S,keepIframeSrcFn:E,newlyAddedElement:R=!1,ignoreCSSAttributes:C}=e,I=BG(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:rn.Document,childNodes:[],compatMode:t.compatMode}:{type:rn.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:rn.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:I};case t.ELEMENT_NODE:return zG(t,{doc:n,blockClass:o,blockSelector:i,unblockSelector:a,inlineStylesheet:f,maskAttributeFn:l,maskInputOptions:m,maskInputFn:v,dataURLOptions:h,inlineImages:y,recordCanvas:S,keepIframeSrcFn:E,newlyAddedElement:R,rootId:I,maskTextClass:c,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:p,ignoreCSSAttributes:C});case t.TEXT_NODE:return PG(t,{doc:n,maskAllText:s,maskTextClass:c,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:p,maskTextFn:_,maskInputOptions:m,maskInputFn:v,rootId:I});case t.CDATA_SECTION_NODE:return{type:rn.CDATA,textContent:"",rootId:I};case t.COMMENT_NODE:return{type:rn.Comment,textContent:t.textContent||"",rootId:I};default:return!1}}function BG(t,e){if(!e.hasNode(t))return;let n=e.getId(t);return n===1?void 0:n}function PG(t,e){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:a,maskTextFn:s,maskInputOptions:l,maskInputFn:c,rootId:d}=e,u=t.parentNode&&t.parentNode.tagName,p=t.textContent,f=u==="STYLE"?!0:void 0,m=u==="SCRIPT"?!0:void 0,_=u==="TEXTAREA"?!0:void 0;if(f&&p){try{t.nextSibling||t.previousSibling||t.parentNode.sheet?.cssRules&&(p=Rb(t.parentNode.sheet))}catch(h){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${h}`,t)}p=Mb(p,qb(e.doc))}m&&(p="SCRIPT_PLACEHOLDER");let v=Mu(t,r,i,o,a,n);if(!f&&!m&&!_&&p&&v&&(p=s?s(p,t.parentElement):p.replace(/[\S]/g,"*")),_&&p&&(l.textarea||v)&&(p=c?c(p,t.parentNode):p.replace(/[\S]/g,"*")),u==="OPTION"&&p){let h=jb({type:null,tagName:u,maskInputOptions:l});p=op({isMasked:Mu(t,r,i,o,a,h),element:t,value:p,maskInputFn:c})}return{type:rn.Text,textContent:p||"",isStyle:f,rootId:d}}function zG(t,e){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:a,maskInputOptions:s={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:u,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,rootId:_,maskTextClass:v,unmaskTextClass:h,maskTextSelector:y,unmaskTextSelector:S,ignoreCSSAttributes:E}=e,R=MG(t,r,o,i),C=SG(t),I={},L=t.attributes.length;for(let U=0;U<L;U++){let D=t.attributes[U];D.name&&!UC(C,D.name,D.value)&&(I[D.name]=LC(n,C,Cu(D.name),D.value,t,l,E))}if(C==="link"&&a){let U=Array.from(n.styleSheets).find(N=>N.href===t.href),D=null;U&&(D=Rb(U)),D&&(I.rel=null,I.href=null,I.crossorigin=null,I._cssText=Mb(D,U.href))}if(C==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){let U=Rb(t.sheet);U&&(I._cssText=Mb(U,qb(n)))}if(C==="input"||C==="textarea"||C==="select"||C==="option"){let U=t,D=ME(U),N=Cb(U,iE(C),D),B=U.checked;if(D!=="submit"&&D!=="button"&&N){let V=Mu(U,v,y,h,S,jb({type:D,tagName:iE(C),maskInputOptions:s}));I.value=op({isMasked:V,element:U,value:N,maskInputFn:c})}B&&(I.checked=B)}if(C==="option"&&(t.selected&&!s.select?I.selected=!0:delete I.selected),C==="canvas"&&p){if(t.__context==="2d")bG(t)||(I.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){let U=t.toDataURL(d.type,d.quality),D=n.createElement("canvas");D.width=t.width,D.height=t.height;let N=D.toDataURL(d.type,d.quality);U!==N&&(I.rr_dataURL=U)}}if(C==="img"&&u){wu||(wu=n.createElement("canvas"),cC=wu.getContext("2d"));let U=t,D=U.currentSrc||U.getAttribute("src")||"<unknown-src>",N=U.crossOrigin,B=()=>{U.removeEventListener("load",B);try{wu.width=U.naturalWidth,wu.height=U.naturalHeight,cC.drawImage(U,0,0),I.rr_dataURL=wu.toDataURL(d.type,d.quality)}catch(V){if(U.crossOrigin!=="anonymous"){U.crossOrigin="anonymous",U.complete&&U.naturalWidth!==0?B():U.addEventListener("load",B);return}else console.warn(`Cannot inline img src=${D}! Error: ${V}`)}U.crossOrigin==="anonymous"&&(N?I.crossOrigin=N:U.removeAttribute("crossorigin"))};U.complete&&U.naturalWidth!==0?B():U.addEventListener("load",B)}if((C==="audio"||C==="video")&&(I.rr_mediaState=t.paused?"paused":"played",I.rr_mediaCurrentTime=t.currentTime),m||(t.scrollLeft&&(I.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(I.rr_scrollTop=t.scrollTop)),R){let{width:U,height:D}=t.getBoundingClientRect();I={class:I.class,rr_width:`${U}px`,rr_height:`${D}px`}}C==="iframe"&&!f(I.src)&&(!R&&!DC(t)&&(I.rr_src=I.src),delete I.src);let z;try{customElements.get(C)&&(z=!0)}catch{}return{type:rn.Element,tagName:C,attributes:I,childNodes:[],isSVG:CG(t)||void 0,needBlock:R,rootId:_,isCustom:z}}function Te(t){return t==null?"":t.toLowerCase()}function FG(t,e){if(e.comment&&t.type===rn.Comment)return!0;if(t.type===rn.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&CC(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(Te(t.attributes.name).match(/^msapplication-tile(image|color)$/)||Te(t.attributes.name)==="application-name"||Te(t.attributes.rel)==="icon"||Te(t.attributes.rel)==="apple-touch-icon"||Te(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&Te(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Te(t.attributes.property).match(/^(og|twitter|fb):/)||Te(t.attributes.name).match(/^(og|twitter):/)||Te(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(Te(t.attributes.name)==="robots"||Te(t.attributes.name)==="googlebot"||Te(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(Te(t.attributes.name)==="author"||Te(t.attributes.name)==="generator"||Te(t.attributes.name)==="framework"||Te(t.attributes.name)==="publisher"||Te(t.attributes.name)==="progid"||Te(t.attributes.property).match(/^article:/)||Te(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(Te(t.attributes.name)==="google-site-verification"||Te(t.attributes.name)==="yandex-verification"||Te(t.attributes.name)==="csrf-token"||Te(t.attributes.name)==="p:domain_verify"||Te(t.attributes.name)==="verify-v1"||Te(t.attributes.name)==="verification"||Te(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ru(t,e){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:p=!1,inlineStylesheet:f=!0,maskInputOptions:m={},maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y,dataURLOptions:S={},inlineImages:E=!1,recordCanvas:R=!1,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:L=5e3,onBlockedImageLoad:z,onStylesheetLoad:U,stylesheetLoadTimeout:D=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:B=!1,ignoreCSSAttributes:V}=e,{preserveWhiteSpace:st=!0}=e,nt=UG(t,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:s,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,dataURLOptions:S,inlineImages:E,recordCanvas:R,keepIframeSrcFn:N,newlyAddedElement:B,ignoreCSSAttributes:V});if(!nt)return console.warn(t,"not serialized"),null;let lt;r.hasNode(t)?lt=r.getId(t):FG(nt,y)||!st&&nt.type===rn.Text&&!nt.isStyle&&!nt.textContent.trim().length?lt=ip:lt=OE();let X=Object.assign(nt,{id:lt});if(r.add(t,X),lt===ip)return null;C&&C(t);let ct=!p;if(X.type===rn.Element){ct=ct&&!X.needBlock;let F=t.shadowRoot;F&&np(F)&&(X.isShadowHost=!0)}if((X.type===rn.Document||X.type===rn.Element)&&ct){y.headWhitespace&&X.type===rn.Element&&X.tagName==="head"&&(st=!1);let F={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:s,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:p,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:st,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:L,onBlockedImageLoad:z,onStylesheetLoad:U,stylesheetLoadTimeout:D,keepIframeSrcFn:N,ignoreCSSAttributes:V},gt=t.childNodes?Array.from(t.childNodes):[];for(let J of gt){let dt=Ru(J,F);dt&&X.childNodes.push(dt)}if(cG(t)&&t.shadowRoot)for(let J of Array.from(t.shadowRoot.childNodes)){let dt=Ru(J,F);dt&&(np(t.shadowRoot)&&(dt.isShadow=!0),X.childNodes.push(dt))}}if(t.parentNode&&ep(t.parentNode)&&np(t.parentNode)&&(X.isShadow=!0),X.type===rn.Element&&X.tagName==="iframe"&&!X.needBlock&&DG(t,()=>{let F=DC(t);if(F&&I){let gt=Ru(F,{doc:F,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:st,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:L,onStylesheetLoad:U,stylesheetLoadTimeout:D,keepIframeSrcFn:N,ignoreCSSAttributes:V});gt&&I(t,gt)}},L),X.type===rn.Element&&X.tagName==="img"&&!t.complete&&X.needBlock){let F=t,gt=()=>{if(F.isConnected&&!F.complete&&z)try{let J=F.getBoundingClientRect();J.width>0&&J.height>0&&z(F,X,J)}catch{}F.removeEventListener("load",gt)};F.isConnected&&F.addEventListener("load",gt)}return X.type===rn.Element&&X.tagName==="link"&&typeof X.attributes.rel=="string"&&(X.attributes.rel==="stylesheet"||X.attributes.rel==="preload"&&typeof X.attributes.href=="string"&&CC(X.attributes.href)==="css")&&LG(t,()=>{if(U){let F=Ru(t,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:st,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:L,onStylesheetLoad:U,stylesheetLoadTimeout:D,keepIframeSrcFn:N,ignoreCSSAttributes:V});F&&U(t,F)}},D),X.type===rn.Element&&delete X.needBlock,X}function HG(t,e){let{mirror:n=new Nb,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:i=null,maskAllText:a=!1,maskTextClass:s="rr-mask",unmaskTextClass:l=null,maskTextSelector:c=null,unmaskTextSelector:d=null,inlineStylesheet:u=!0,inlineImages:p=!1,recordCanvas:f=!1,maskAllInputs:m=!1,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOM:y=!1,dataURLOptions:S,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:C,iframeLoadTimeout:I,onBlockedImageLoad:L,onStylesheetLoad:z,stylesheetLoadTimeout:U,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:N=new Set([])}=e||{};return Ru(t,{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:a,maskTextClass:s,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:u,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:y==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:y===!1?{}:y,dataURLOptions:S,inlineImages:p,recordCanvas:f,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:C,iframeLoadTimeout:I,onBlockedImageLoad:L,onStylesheetLoad:z,stylesheetLoadTimeout:U,keepIframeSrcFn:D,newlyAddedElement:!1,ignoreCSSAttributes:N})}function nr(t,e,n=document){let r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}var xu=`Please stop import mirror directly. Instead of that,\r
|
|
499
|
+
Error:`,o)}}function DH(){return cN(t=>{Yf("cls",{metric:t}),hN=t},{reportAllChanges:!0})}function LH(){return mN(t=>{Yf("lcp",{metric:t}),bN=t},{reportAllChanges:!0})}function UH(){return gN(t=>{Yf("ttfb",{metric:t}),yN=t})}function BH(){return pN(t=>{Yf("inp",{metric:t}),_N=t})}function ib(t,e,n,r,o=!1){vN(t,e);let i;return ob[t]||(i=n(),ob[t]=!0),r&&e({metric:r}),SN(t,e,o?i:void 0)}function PH(t){let e={};t==="event"&&(e.durationThreshold=0),lo(t,n=>{Yf(t,{entries:n})},e)}function vN(t,e){Vf[t]=Vf[t]||[],Vf[t].push(e)}function SN(t,e,n){return()=>{n&&n();let r=Vf[t];if(!r)return;let o=r.indexOf(e);o!==-1&&r.splice(o,1)}}function EN(t){return"duration"in t}var zH=80,ml={};try{typeof Node<"u"&&(ml.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element<"u"&&(ml.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,ml.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,ml.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,ml.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<"u"&&(ml.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function Xa(t,e,n){let r=ml[e];if(r)try{return r.call(t,n)}catch{}let o=t[e];return typeof o=="function"?o.call(t,n):o}function pe(t,e={}){if(!t)return"<unknown>";try{let n=t,r=5,o=[],i=0,a=0,s=" > ",l=s.length,c,d=Array.isArray(e)?e:e.keyAttrs,u=!Array.isArray(e)&&e.maxStringLength||zH;for(;n&&i++<r&&(c=FH(n,d),!(c==="html"||i>1&&a+o.length*l+c.length>=u));)o.push(c),a+=c.length,n=Xa(n,"parentNode");return o.reverse().join(s)}catch{return"<unknown>"}}function FH(t,e){let n=[],r=Xa(t,"tagName");if(!r)return"";if(typeof HTMLElement<"u"&&t instanceof HTMLElement){let i=Xa(t,"dataset");if(i){if(i.sentryComponent)return i.sentryComponent;if(i.sentryElement)return i.sentryElement}}n.push(r.toLowerCase());let o=e?.length?e.filter(i=>Xa(t,"getAttribute",i)).map(i=>[i,Xa(t,"getAttribute",i)]):null;if(o?.length)o.forEach(i=>{n.push(`[${i[0]}="${i[1]}"]`)});else{let i=Xa(t,"id");i&&n.push(`#${i}`);let a=Xa(t,"className");if(a&&gn(a)){let s=a.split(/\s+/);for(let l of s)n.push(`.${l}`)}}for(let i of["aria-label","type","name","title","alt"]){let a=Xa(t,"getAttribute",i);a&&n.push(`[${i}="${a}"]`)}return n.join("")}var TN=t=>{let e=n=>{(n.type==="pagehide"||pt.document?.visibilityState==="hidden")&&t(n)};so("visibilitychange",e,{capture:!0,once:!0}),so("pagehide",e,{capture:!0,once:!0})};function ab(t){return typeof t=="number"&&isFinite(t)}function Yi(t,e,n,{...r}){let o=rt(t).start_timestamp;return o&&o>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),Jr(t,()=>{let i=Ae({startTime:e,...r});return i&&i.end(n),i})}function hu(t){let e=z();if(!e)return;let{name:n,transaction:r,attributes:o,startTime:i}=t,{release:a,environment:s}=e.getOptions(),{userInfo:l}=e.getDataCollectionOptions(),d=e.getIntegrationByName("Replay")?.getReplayId(),u=it(),p=u.getUser(),f=p!==void 0?p.email||p.id||p.ip_address:void 0,m;try{m=u.getScopeData().contexts.profile.profile_id}catch{}let _={release:a,environment:s,user:f||void 0,profile_id:m||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":pt.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return Ae({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function co(){return pt.addEventListener&&pt.performance}function se(t){return t/1e3}function wN(t){let e="unknown",n="unknown",r="";for(let o of t){if(o==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(o))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=o}return r===t&&(e=r),{name:e,version:n}}function gl(t){try{return PerformanceObserver.supportedEntryTypes.includes(t)}catch{return!1}}function hl(t,e){let n,r=!1;function o(s){!r&&n&&e(s,n.spanContext().spanId,n),r=!0}TN(()=>{o("pagehide")});let i=t.on("beforeStartNavigationSpan",(s,l)=>{l?.isRedirect||(o("navigation"),i(),a())}),a=t.on("afterStartPageLoadSpan",s=>{n=s,a()})}function xN(t){let e=0,n;if(!gl("layout-shift"))return;let r=qi(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(e=o.value,n=i)},!0);hl(t,(o,i)=>{HH(e,n,i,o),r()})}function HH(t,e,n,r){xn&&w.log(`Sending CLS span (${t})`);let o=e?se((re()||0)+e.startTime):Mt(),i=it().getScopeData().transactionName,a=e?pe(e.sources[0]?.node):"Layout shift",s={[at]:"auto.http.browser.cls",[ht]:"ui.webvital.cls",[jn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e?.sources&&e.sources.forEach((c,d)=>{s[`cls.source.${d+1}`]=pe(c.node)});let l=hu({name:a,transaction:i,attributes:s,startTime:o});l&&(l.addEvent("cls",{[Bo]:"",[Po]:t}),l.end(o))}var GH=6e4;function bl(t){return t!=null&&t>0&&t<=GH}function AN(t){let e=0,n;if(!gl("largest-contentful-paint"))return;let r=Vi(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!bl(o.value)||(e=o.value,n=i)},!0);hl(t,(o,i)=>{$H(e,n,i,o),r()})}function $H(t,e,n,r){if(!bl(t))return;xn&&w.log(`Sending LCP span (${t})`);let o=se((re()||0)+(e?.startTime||0)),i=it().getScopeData().transactionName,a=e?pe(e.element):"Largest contentful paint",s={[at]:"auto.http.browser.lcp",[ht]:"ui.webvital.lcp",[jn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e&&(e.element&&(s["lcp.element"]=pe(e.element)),e.id&&(s["lcp.id"]=e.id),e.url&&(s["lcp.url"]=e.url),e.loadTime!=null&&(s["lcp.loadTime"]=e.loadTime),e.renderTime!=null&&(s["lcp.renderTime"]=e.renderTime),e.size!=null&&(s["lcp.size"]=e.size));let l=hu({name:a,transaction:i,attributes:s,startTime:o});l&&(l.addEvent("lcp",{[Bo]:"millisecond",[Po]:t}),l.end(o))}function uo(t){return t&&((re()||performance.timeOrigin)+t)/1e3}function Wf(t){let e={};if(t.nextHopProtocol!=null){let{name:n,version:r}=wN(t.nextHopProtocol);e["network.protocol.version"]=r,e["network.protocol.name"]=n}return re()||co()?.timeOrigin?jH({...e,"http.request.redirect_start":uo(t.redirectStart),"http.request.redirect_end":uo(t.redirectEnd),"http.request.worker_start":uo(t.workerStart),"http.request.fetch_start":uo(t.fetchStart),"http.request.domain_lookup_start":uo(t.domainLookupStart),"http.request.domain_lookup_end":uo(t.domainLookupEnd),"http.request.connect_start":uo(t.connectStart),"http.request.secure_connection_start":uo(t.secureConnectionStart),"http.request.connection_end":uo(t.connectEnd),"http.request.request_start":uo(t.requestStart),"http.request.response_start":uo(t.responseStart),"http.request.response_end":uo(t.responseEnd),"http.request.time_to_first_byte":t.responseStart!=null?t.responseStart/1e3:void 0}):e}function jH(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!=null))}var qH=2147483647,kN=0,yr={},br,lb;function kS({recordClsStandaloneSpans:t,recordLcpStandaloneSpans:e,client:n}){let r=co();if(r&&re()){r.mark&&pt.performance.mark("sentry-tracing-init");let o=e?AN(n):e===!1?YH():void 0,i=t?xN(n):t===!1?VH():void 0,a=WH(),s=KH();return()=>{a(),s(),o?.(),i?.()}}return()=>{}}function IS(){hr("longtask",({entries:t})=>{let e=Dt();if(!e)return;let{op:n,start_timestamp:r}=rt(e);for(let o of t){let i=se(re()+o.startTime),a=se(o.duration);n==="navigation"&&r&&i<r||Yi(e,i,i+a,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[at]:"auto.ui.browser.metrics"}})}})}function RS(){new PerformanceObserver(e=>{let n=Dt();if(n)for(let r of e.getEntries()){if(!r.scripts[0])continue;let o=se(re()+r.startTime),{start_timestamp:i,op:a}=rt(n);if(a==="navigation"&&i&&o<i)continue;let s=se(r.duration),l={[at]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:d,invokerType:u,sourceURL:p,sourceFunctionName:f,sourceCharPosition:m}=c;l["browser.script.invoker"]=d,l["browser.script.invoker_type"]=u,p&&(l["code.filepath"]=p),f&&(l["code.function"]=f),m!==-1&&(l["browser.script.source_char_position"]=m),Yi(n,o,o+s,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function NS(){hr("event",({entries:t})=>{let e=Dt();if(e){for(let n of t)if(n.name==="click"){let r=se(re()+n.startTime),o=se(n.duration),i={name:pe(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[at]:"auto.ui.browser.metrics"}},a=Va(n.target);a&&(i.attributes["ui.component_name"]=a),Yi(e,r,r+o,i)}}})}function VH(){return qi(({metric:t})=>{let e=t.entries[t.entries.length-1];e&&(yr.cls={value:t.value,unit:""},lb=e)},!0)}function YH(){return Vi(({metric:t})=>{let e=t.entries[t.entries.length-1];!e||!bl(t.value)||(yr.lcp={value:t.value,unit:"millisecond"},br=e)},!0)}function WH(){return AS(({metric:t})=>{t.entries[t.entries.length-1]&&(yr.ttfb={value:t.value,unit:"millisecond"})})}function KH(){return hr("paint",({entries:t})=>{let e=yi();for(let n of t){let r=n.startTime<e.firstHiddenTime;n.name==="first-paint"&&r&&(yr.fp={value:n.startTime,unit:"millisecond"}),n.name==="first-contentful-paint"&&r&&(yr.fcp={value:n.startTime,unit:"millisecond"})}})}function CS(t,e){let n=co(),r=re();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:a}=e,s=se(r),l=n.getEntries(),{op:c,start_timestamp:d}=rt(t);l.slice(kN).forEach(u=>{let p=se(u.startTime),f=se(Math.max(0,u.duration));if(!(c==="navigation"&&d&&s+p<d))switch(u.entryType){case"navigation":{ZH(t,u,s);break}case"mark":case"paint":case"measure":{JH(t,u,p,f,s,i);break}case"resource":{n7(t,u,u.name,p,f,s,a);break}}}),kN=Math.max(l.length-1,0),r7(t,o)}function MS(t,e){let n=re();if(!co()?.getEntries||!n){IN();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:o,recordLcpOnPageloadSpan:i}=e,a=se(n);if(rt(t).op==="pageload"){if(a7(yr),r){let s=(l,c,d)=>{let u=d??`browser.web_vital.${l}.value`;t.setAttribute(u,c),xn&&w.log("Setting web vital attribute",{[u]:c},"on pageload span")};["ttfb","fp","fcp"].forEach(l=>{yr[l]&&s(l,yr[l].value)}),yr["ttfb.requestTime"]&&s("ttfb.requestTime",yr["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else o||delete yr.cls,i||delete yr.lcp,Object.entries(yr).forEach(([s,l])=>{qs(s,l.value,l.unit,t)}),o7(t,e);t.setAttribute(r?"browser.performance.time_origin":"performance.timeOrigin",a),t.setAttribute(r?"browser.performance.navigation.activation_start":"performance.activationStart",ao())}IN()}function IN(){br=void 0,lb=void 0,yr={}}function XH(t){if(t?.entryType==="measure")try{return t.detail.devtools.track==="Components \u269B"}catch{return}}function JH(t,e,n,r,o,i){if(XH(e)||["mark","measure"].includes(e.entryType)&&tn(e.name,i))return;let a=ji(!1),s=se(a?a.requestStart:0),l=o+Math.max(n,s),c=o+n,d=c+r,u={[at]:"auto.resource.browser.metrics"};l!==c&&(u["sentry.browser.measure_happened_before_request"]=!0,u["sentry.browser.measure_start_time"]=l),QH(u,e),l<=d&&Yi(t,l,d,{name:e.name,op:e.entryType,attributes:u})}function QH(t,e){try{let n=e.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&Ze(o))t[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{t[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(Ze(n)){t["sentry.browser.measure.detail"]=n;return}try{t["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function ZH(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{sb(t,e,r,n)}),sb(t,e,"secureConnection",n,"TLS/SSL"),sb(t,e,"fetch",n,"cache"),sb(t,e,"domainLookup",n,"DNS"),e7(t,e,n)}function sb(t,e,n,r,o=n){let i=t7(n),a=e[i],s=e[`${n}Start`];!s||!a||Yi(t,r+se(s),r+se(a),{op:`browser.${o}`,name:e.name,attributes:{[at]:"auto.ui.browser.metrics",...n==="redirect"&&e.redirectCount!=null?{"http.redirect_count":e.redirectCount}:{}}})}function t7(t){return t==="secureConnection"?"connectEnd":t==="fetch"?"domainLookupStart":`${t}End`}function e7(t,e,n){let r=n+se(e.requestStart),o=n+se(e.responseEnd),i=n+se(e.responseStart);e.responseEnd&&(Yi(t,r,o,{op:"browser.request",name:e.name,attributes:{[at]:"auto.ui.browser.metrics"}}),Yi(t,i,o,{op:"browser.response",name:e.name,attributes:{[at]:"auto.ui.browser.metrics"}}))}function n7(t,e,n,r,o,i,a){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;let s=e.initiatorType?`resource.${e.initiatorType}`:"resource.other";if(a?.includes(s))return;let l={[at]:"auto.resource.browser.metrics"},c=Zr(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(pt.location.origin),l[wc]=n,i7(e,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 d={...l,...Wf(e)},u=i+r,p=u+o;Yi(t,u,p,{name:n.replace(pt.location.origin,""),op:s,attributes:d})}function r7(t,e){let n=pt.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&t.setAttribute(e?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&t.setAttribute(e?"network.connection.type":"connectionType",r.type),ab(r.rtt)&&(e?t.setAttribute("network.connection.rtt",r.rtt):rt(t).op==="pageload"&&qs("connection.rtt",r.rtt,"millisecond"))),ab(n.deviceMemory)&&(e?t.setAttribute("device.memory.estimated_capacity",n.deviceMemory):t.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),ab(n.hardwareConcurrency)&&(e?t.setAttribute("device.processor_count",n.hardwareConcurrency):t.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function o7(t,e){br&&e.recordLcpOnPageloadSpan&&(br.element&&t.setAttribute("lcp.element",pe(br.element)),br.id&&t.setAttribute("lcp.id",br.id),br.url&&t.setAttribute("lcp.url",br.url.trim().slice(0,200)),br.loadTime!=null&&t.setAttribute("lcp.loadTime",br.loadTime),br.renderTime!=null&&t.setAttribute("lcp.renderTime",br.renderTime),t.setAttribute("lcp.size",br.size)),lb?.sources&&e.recordClsOnPageloadSpan&&lb.sources.forEach((n,r)=>t.setAttribute(`cls.source.${r+1}`,pe(n.node)))}function i7(t,e,n){n.forEach(([r,o])=>{let i=t[r];i!=null&&(typeof i=="number"&&i<qH||typeof i=="string")&&(e[o]=i)})}function a7(t){let e=ji(!1);if(!e)return;let{responseStart:n,requestStart:r}=e;r<=n&&(t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var s7="ElementTiming",l7=(()=>({name:s7,setup(){!co()||!re()||hr("element",({entries:e})=>{for(let n of e){let r=n;if(!r.identifier)continue;let o=r.identifier,i=r.name,a=r.renderTime,s=r.loadTime,l={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":o};i&&(l["ui.element.paint_type"]=i),r.id&&(l["ui.element.id"]=r.id),r.element&&(l["ui.element.type"]=r.element.tagName.toLowerCase()),r.url&&(l["ui.element.url"]=r.url),r.naturalWidth&&(l["ui.element.width"]=r.naturalWidth),r.naturalHeight&&(l["ui.element.height"]=r.naturalHeight),a>0&&Fa.distribution("ui.element.render_time",a,{unit:"millisecond",attributes:l}),s>0&&Fa.distribution("ui.element.load_time",s,{unit:"millisecond",attributes:l})}})}})),OS=l7;var DS=[],Kf=new Map,bu=new Map,LS=60;function US(){if(co()&&re()){let e=c7();return()=>{e()}}return()=>{}}var yu={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 c7(){return pl(u7)}var u7=({metric:t})=>{if(t.value==null)return;let e=se(t.value);if(e>LS)return;let n=t.entries.find(m=>m.duration===t.value&&yu[m.name]);if(!n)return;let{interactionId:r}=n,o=yu[n.name],i=se(re()+n.startTime),a=Dt(),s=a?Bt(a):void 0,l=r!=null?Kf.get(r):void 0,c=l?.span||s,d=c?rt(c).description:it().getScopeData().transactionName,u=l?.elementName||pe(n.target),p={[at]:"auto.http.browser.inp",[ht]:`ui.interaction.${o}`,[jn]:n.duration},f=hu({name:u,transaction:d,attributes:p,startTime:i});f&&(f.addEvent("inp",{[Bo]:"millisecond",[Po]:t.value}),f.end(i+e))};function RN(t){return t!=null?Kf.get(t):void 0}function BS(){let t=Object.keys(yu);Vn()&&t.forEach(o=>{pt.addEventListener(o,e,{capture:!0,passive:!0})});function e(o){let i=o.target;if(!i)return;let a=pe(i),s=Math.round(o.timeStamp);if(bu.set(s,a),bu.size>50){let l=bu.keys().next().value;l!==void 0&&bu.delete(l)}}function n(o){let i=Math.round(o.startTime),a=bu.get(i);if(!a)for(let s=-5;s<=5;s++){let l=bu.get(i+s);if(l){a=l;break}}return a||"<unknown>"}let r=({entries:o})=>{let i=Dt(),a=i&&Bt(i);o.forEach(s=>{if(!EN(s))return;let l=s.interactionId;if(l==null||Kf.has(l))return;let c=s.target?pe(s.target):n(s);if(DS.length>10){let d=DS.shift();Kf.delete(d)}DS.push(l),Kf.set(l,{span:a,elementName:c})})};hr("event",r),hr("first-input",r)}function PS(t){let{name:e,op:n,origin:r,metricName:o,value:i,attributes:a,parentSpan:s,reportEvent:l,startTime:c,endTime:d}=t,u=it().getScopeData().transactionName,p={[at]:r,[ht]:n,[jn]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":u,"user_agent.original":pt.navigator?.userAgent,...a};s&&Ca(s).attributes?.[ht]==="pageload"&&(p["sentry.pageload.span_id"]=s.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let f=Ae({name:e,attributes:p,startTime:c,parentSpan:s});f&&f.end(d??c)}function zS(t){let e=0,n;if(!gl("largest-contentful-paint"))return;let r=Vi(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!bl(o.value)||(e=o.value,n=i)},!0);hl(t,(o,i,a)=>{d7(e,n,a,o),r()})}function d7(t,e,n,r){if(!bl(t))return;xn&&w.log(`Sending LCP span (${t})`);let o=re()||0,i=se(o),a=se(o+(e?.startTime||0)),s=e?pe(e.element):"Largest contentful paint",l={};e?.element&&(l["browser.web_vital.lcp.element"]=pe(e.element)),e?.id&&(l["browser.web_vital.lcp.id"]=e.id),e?.url&&(l["browser.web_vital.lcp.url"]=e.url),e?.loadTime!=null&&(l["browser.web_vital.lcp.load_time"]=e.loadTime),e?.renderTime!=null&&(l["browser.web_vital.lcp.render_time"]=e.renderTime),e?.size!=null&&(l["browser.web_vital.lcp.size"]=e.size),PS({name:s,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:t,attributes:l,parentSpan:n,reportEvent:r,startTime:i,endTime:a})}function FS(t){let e=0,n;if(!gl("layout-shift"))return;let r=qi(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(e=o.value,n=i)},!0);hl(t,(o,i,a)=>{f7(e,n,a,o),r()})}function f7(t,e,n,r){xn&&w.log(`Sending CLS span (${t})`);let o=e?se((re()||0)+e.startTime):Mt(),i=e?pe(e.sources[0]?.node):"Layout shift",a={};e?.sources&&e.sources.forEach((s,l)=>{a[`browser.web_vital.cls.source.${l+1}`]=pe(s.node)}),PS({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:t,attributes:a,parentSpan:n,reportEvent:r,startTime:o})}function HS(){if(!co()||!re())return;pl(({metric:n})=>{if(n.value==null||se(n.value)>LS)return;let o=n.entries.find(i=>i.duration===n.value&&yu[i.name]);o&&p7(n.value,o)})}function p7(t,e){xn&&w.log(`Sending INP span (${t})`);let n=se(re()+e.startTime),r=se(t),o=yu[e.name],i=RN(e.interactionId),a=Dt(),s=a?Bt(a):void 0,l=i?.span||s,c=l?Ca(l).name:it().getScopeData().transactionName,d=i?.elementName||pe(e.target);PS({name:d,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:t,attributes:{[jn]:e.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var m7=1e3,NN,GS,$S;function Xf(t){zn("dom",t),Fn("dom",g7)}function g7(){if(!pt.document)return;let t=Qe.bind(null,"dom"),e=CN(t,!0);pt.document.addEventListener("click",e,!1),pt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let o=pt[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(be(o,"addEventListener",function(i){return function(a,s,l){if(a==="click"||a=="keypress")try{let c=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=c[a]=c[a]||{refCount:0};if(!d.handler){let u=CN(t);d.handler=u,i.call(this,a,u,l)}d.refCount++}catch{}return i.call(this,a,s,l)}}),be(o,"removeEventListener",function(i){return function(a,s,l){if(a==="click"||a=="keypress")try{let c=this.__sentry_instrumentation_handlers__||{},d=c[a];d&&(d.refCount--,d.refCount<=0&&(i.call(this,a,d.handler,l),d.handler=void 0,delete c[a]),Object.keys(c).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,a,s,l)}}))})}function h7(t){if(t.type!==GS)return!1;try{if(!t.target||t.target._sentryId!==$S)return!1}catch{}return!0}function b7(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function CN(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;let r=y7(n);if(b7(n.type,r))return;Gt(n,"_sentryCaptured",!0),r&&!r._sentryId&&Gt(r,"_sentryId",ae());let o=n.type==="keypress"?"input":n.type;h7(n)||(t({event:n,name:o,global:e}),GS=n.type,$S=r?r._sentryId:void 0),clearTimeout(NN),NN=pt.setTimeout(()=>{$S=void 0,GS=void 0},m7)}}function y7(t){try{return t.target}catch{return null}}var cb;function Wi(t){let e="history";zn(e,t),Fn(e,_7)}function _7(){if(pt.addEventListener("popstate",()=>{let e=pt.location.href,n=cb;if(cb=e,n===e)return;Qe("history",{from:n,to:e})}),!Oh())return;function t(e){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=cb,i=v7(String(r));if(cb=i,o===i)return e.apply(this,n);Qe("history",{from:o,to:i})}return e.apply(this,n)}}be(pt.history,"pushState",t),be(pt.history,"replaceState",t)}function v7(t){try{return new URL(t,pt.location.origin).toString()}catch{return t}}var ub={};function _u(t){let e=ub[t];if(e)return e;let n=pt[t];if(ru(n))return ub[t]=n.bind(pt);let r=pt.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?.[t]&&(n=i[t]),r.head.removeChild(o)}catch(o){xn&&w.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return n&&(ub[t]=n.bind(pt))}function jS(t){ub[t]=void 0}function yl(...t){return _u("setTimeout")(...t)}var tr="__sentry_xhr_v3__";function _l(t){zn("xhr",t),Fn("xhr",S7)}function S7(){if(!pt.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){let o=new Error,i=Mt()*1e3,a=gn(r[0])?r[0].toUpperCase():void 0,s=E7(r[1]);if(!a||!s)return e.apply(n,r);n[tr]={method:a,url:s,request_headers:{}},a==="POST"&&s.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let l=()=>{let c=n[tr];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}let d={endTimestamp:Mt()*1e3,startTimestamp:i,xhr:n,virtualError:o};Qe("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,d,u){return l(),c.apply(d,u)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,d,u){let[p,f]=u,m=d[tr];return m&&gn(p)&&gn(f)&&(m.request_headers[p.toLowerCase()]=f),c.apply(d,u)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){let o=n[tr];if(!o)return e.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:Mt()*1e3,xhr:n};return Qe("xhr",i),e.apply(n,r)}})}function E7(t){if(gn(t))return t;try{return t.toString()}catch{}}var T7=Symbol.for("sentry__originalRequestBody");function db(t){return new URLSearchParams(t).toString()}function vl(t,e=w){try{if(typeof t=="string")return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[db(t)];if(!t)return[void 0]}catch(n){return xn&&e.error(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return xn&&e.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function vu(t=[]){if(t.length>=2&&t[1]&&typeof t[1]=="object"&&"body"in t[1])return t[1].body;if(t.length>=1&&t[0]instanceof Request){let n=t[0][T7];return n!==void 0?n:void 0}}function Jf(t){let e;try{e=t.getAllResponseHeaders()}catch(n){return xn&&w.error(n,"Failed to get xhr response headers",t),{}}return e?e.split(`\r
|
|
500
|
+
`).reduce((n,r)=>{let[o,i]=r.split(": ");return i&&(n[o.toLowerCase()]=i),n},{}):{}}function qS(t){if(typeof Element>"u")return!1;try{return t instanceof Element}catch{return!1}}var w7=40;function Su(t,e=_u("fetch")){let n=0,r=0;async function o(i){let a=i.body.length;n+=a,r++;let s={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{let l=await e(t.url,s);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 jS("fetch"),l}finally{n-=a,r--}}return If(t,o,Qs(t.bufferSize||w7))}var W=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function x7(){let t=z();if(!t){W&&w.warn("No Sentry client available, profiling is not started");return}if(!t.getIntegrationByName("BrowserProfiling")){W&&w.warn("BrowserProfiling integration is not available");return}t.emit("startUIProfiler")}function A7(){let t=z();if(!t){W&&w.warn("No Sentry client available, profiling is not started");return}if(!t.getIntegrationByName("BrowserProfiling")){W&&w.warn("ProfilingIntegration is not available");return}t.emit("stopUIProfiler")}var MN={startProfiler:x7,stopProfiler:A7};var k7=10,I7=20,R7=30,N7=40,C7=50;function Eu(t,e,n,r){let o={filename:t,function:e==="<anonymous>"?"?":e,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}var M7=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,O7=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,D7=/\((\S*)(?::(\d+))(?::(\d+))\)/,L7=/at (.+?) ?\(data:(.+?),/,U7=t=>{let e=t.match(L7);if(e)return{filename:`<data:${e[2]}>`,function:e[1]};let n=M7.exec(t);if(n){let[,o,i,a]=n;return Eu(o,"?",+i,+a)}let r=O7.exec(t);if(r){if(r[2]?.indexOf("eval")===0){let s=D7.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[i,a]=UN(r[1]||"?",r[2]);return Eu(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},VS=[R7,U7],B7=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,P7=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,z7=t=>{let e=B7.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=P7.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],o=e[1]||"?";return[o,r]=UN(o,r),Eu(r,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},YS=[C7,z7],F7=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,H7=t=>{let e=F7.exec(t);return e?Eu(e[2],e[1]||"?",+e[3],e[4]?+e[4]:void 0):void 0},ON=[N7,H7],G7=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,$7=t=>{let e=G7.exec(t);return e?Eu(e[2],e[3]||"?",+e[1]):void 0},DN=[k7,$7],j7=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,q7=t=>{let e=j7.exec(t);return e?Eu(e[5],e[3]||e[4]||"?",+e[1],+e[2]):void 0},LN=[I7,q7],WS=[VS,YS],fb=Yd(...WS),UN=(t,e)=>{let n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};function BN(t,{metadata:e,tunnel:n,dsn:r}){let o={event_id:t.event_id,sent_at:new Date().toISOString(),...e?.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:en(r)}},i=V7(t);return Ue(o,[i])}function V7(t){return[{type:"user_report"},t]}var pb=1024,Y7="Breadcrumbs",W7=((t={})=>{let e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:Y7,setup(n){e.console&&nl(J7(n)),e.dom&&Xf(X7(n,e.dom)),e.xhr&&_l(Q7(n)),e.fetch&&hi(Z7(n)),e.history&&Wi(t9(n)),e.sentry&&n.on("beforeSendEvent",K7(n))}}}),mb=W7;function K7(t){return function(n){z()===t&&wn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Lo(n)},{event:n})}}function X7(t,e){return function(r){if(z()!==t)return;let o,i,a=typeof e=="object"?e.serializeAttribute:void 0,s=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;s&&s>pb&&(W&&w.warn(`\`dom.maxStringLength\` cannot exceed ${pb}, but a value of ${s} was configured. Sentry will use ${pb} instead.`),s=pb),typeof a=="string"&&(a=[a]);try{let c=r.event,d=e9(c)?c.target:c;o=pe(d,{keyAttrs:a,maxStringLength:s}),i=Va(d)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${r.name}`,message:o};i&&(l.data={"ui.component_name":i}),wn(l,{event:r.event,name:r.name,global:r.global})}}function J7(t){return function(n){if(z()!==t)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:Hi(n.level),message:ka(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${ka(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;wn(r,{input:n.args,level:n.level})}}function Q7(t){return function(n){if(z()!==t)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[tr];if(!r||!o||!i)return;let{method:a,url:s,status_code:l,body:c}=i,d={method:a,url:s,status_code:l},u={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},p={category:"xhr",data:d,type:"http",level:Mh(l)};t.emit("beforeOutgoingRequestBreadcrumb",p,u),wn(p,u)}}function Z7(t){return function(n){if(z()!==t)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},a={category:"fetch",data:n.fetchData,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",a,i),wn(a,i)}else{let i=n.response,a={...n.fetchData,status_code:i?.status},s={input:n.args,response:i,startTimestamp:r,endTimestamp:o},l={category:"fetch",data:a,type:"http",level:Mh(a.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",l,s),wn(l,s)}}}function t9(t){return function(n){if(z()!==t)return;let r=n.from,o=n.to,i=Zr(V.location.href),a=r?Zr(r):void 0,s=Zr(o);a?.path||(a=i),i.protocol===s.protocol&&i.host===s.host&&(o=s.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),wn({category:"navigation",data:{from:r,to:o}})}}function e9(t){return!!t&&!!t.target}var n9="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(","),r9="BrowserApiErrors",o9=((t={})=>{let e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...t};return{name:r9,setupOnce(){e.setTimeout&&be(V,"setTimeout",PN),e.setInterval&&be(V,"setInterval",PN),e.requestAnimationFrame&&be(V,"requestAnimationFrame",i9),e.XMLHttpRequest&&"XMLHttpRequest"in V&&be(XMLHttpRequest.prototype,"send",a9);let n=e.eventTarget;n&&(Array.isArray(n)?n:n9).forEach(o=>s9(o,e))}}}),gb=o9;function PN(t){return function(...e){let n=e[0];return e[0]=ul(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Qn(t)}`}}),t.apply(this,e)}}function i9(t){return function(e){return t.apply(this,[ul(e,{mechanism:{data:{handler:Qn(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function a9(t){return function(...e){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&be(n,o,function(i){let a={mechanism:{data:{handler:Qn(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},s=Aa(i);return s&&(a.mechanism.data.handler=Qn(s)),ul(i,a)})}),t.apply(this,e)}}function s9(t,e){let r=V[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(be(r,"addEventListener",function(o){return function(i,a,s){try{l9(a)&&(a.handleEvent=ul(a.handleEvent,{mechanism:{data:{handler:Qn(a),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return e.unregisterOriginalCallbacks&&c9(this,i,a),o.apply(this,[i,ul(a,{mechanism:{data:{handler:Qn(a),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),s])}}),be(r,"removeEventListener",function(o){return function(i,a,s){try{if(Object.prototype.hasOwnProperty.call(a,"__sentry_wrapped__")){let l=a.__sentry_wrapped__;l&&o.call(this,i,l,s)}}catch{}return o.call(this,i,a,s)}}))}function l9(t){return typeof t.handleEvent=="function"}function c9(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}var hb=(t={})=>{let e=t.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof V.document>"u"){W&&w.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Ks({ignoreDuration:!0});let n=!1;fl(()=>{n||(Ua(),n=!0)});let r=Pt(),o=r.getUser();r.addScopeListener(i=>{let a=i.getUser();(o?.id!==a?.id||o?.ip_address!==a?.ip_address)&&(o=a,n&&Ua())}),e==="route"&&Wi(({from:i,to:a})=>{i!==a&&(Ks({ignoreDuration:!0}),Ua(),n=!0)})}}};var u9="CultureContext",d9=(()=>({name:u9,preprocessEvent(t){let e=zN();e&&(t.contexts={...t.contexts,culture:{...e,...t.contexts?.culture}})},processSegmentSpan(t){let e=zN();e&&Nr(t,{"culture.locale":e.locale,"culture.timezone":e.timezone,"culture.calendar":e.calendar})}})),bb=d9;function zN(){try{let t=V.Intl;if(!t)return;let e=t.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone,calendar:e.calendar}}catch{return}}var f9="GlobalHandlers",p9=((t={})=>{let e={onerror:!0,onunhandledrejection:!0,...t};return{name:f9,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(m9(n),FN("onerror")),e.onunhandledrejection&&(g9(n),FN("onunhandledrejection"))}}}),yb=p9;function m9(t){Kd(e=>{let{stackParser:n,attachStacktrace:r}=HN();if(z()!==t||hS())return;let{msg:o,url:i,line:a,column:s,error:l}=e,c=h9(du(n,l||o,void 0,r,!1),i,a,s);c.level="error",Qr(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function g9(t){Xd(e=>{let{stackParser:n,attachStacktrace:r}=HN();if(z()!==t||hS())return;let o=KS(e),i=Ze(o)?XS(o):du(n,o,void 0,r,!0);i.level="error",Qr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function KS(t){if(Ze(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function XS(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function h9(t,e,n,r){let o=t.exception=t.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[];return l.length===0&&l.push({colno:r,lineno:n,filename:b9(e)??Kn(),function:"?",in_app:!0}),t}function FN(t){W&&w.log(`Global Handler attached: ${t}`)}function HN(){return z()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function b9(t){if(!(!gn(t)||t.length===0))return t.startsWith("data:")?`<${Yn(t,!1)}>`:t}var _b=()=>({name:"HttpContext",preprocessEvent(t){if(!V.navigator&&!V.location&&!V.document)return;let e=cu(),n={...e.headers,...t.request?.headers};t.request={...e,...t.request,headers:n}},processSegmentSpan(t){let e=t.attributes?.[ht];if(!V.navigator&&!V.location&&!V.document)return;let n=cu();Nr(t,{"url.full":e!=="http.client"?n.url:void 0,"http.request.header.user_agent":n.headers["User-Agent"],"http.request.header.referer":n.headers.Referer})}});var y9="cause",_9=5,v9="LinkedErrors",S9=((t={})=>{let e=t.limit||_9,n=t.key||y9;return{name:v9,preprocessEvent(r,o,i){let a=i.getOptions();wv(uu,a.stackParser,n,e,r,o)}}}),vb=S9;var E9=/^HTML(\w*)Element$/;function Tu(t){if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(qS(t)){let e=T9(t);if(E9.test(e))return`[HTMLElement: ${pe(t)}]`}}function T9(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function GN(){return w9()?(W&&pn(()=>{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 w9(){if(typeof V.window>"u")return!1;let t=V;if(t.nw||!(t.chrome||t.browser)?.runtime?.id)return!1;let n=Kn();return!(V===V.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function JS(t){return[Df(),Of(),Dv(),gb(),mb(),yb(),vb(),Lf(),_b(),bb(),hb()]}function QS(t={}){let e=!t.skipBrowserExtensionCheck&&GN(),n=t.defaultIntegrations==null?JS():t.defaultIntegrations,r={...t,enabled:e?!1:t.enabled,stackParser:tg(t.stackParser||fb),integrations:eh({integrations:t.integrations,defaultIntegrations:n}),transport:t.transport||Su};return _c(Tu),mv(fu,r)}function $N(){}function jN(t){t()}function Qf(t={}){let e=V.document,n=e?.head||e?.body;if(!n){W&&w.error("[showReportDialog] Global document not defined");return}let r=it(),i=z()?.getDsn();if(!i){W&&w.error("[showReportDialog] DSN not configured");return}let a={...t,user:{...r.getUser(),...t.user},eventId:t.eventId||Dc()},s=V.document.createElement("script");s.async=!0,s.crossOrigin="anonymous",s.src=Z0(i,a);let{onLoad:l,onClose:c}=a;if(l&&(s.onload=l),c){let d=u=>{if(u.data==="__sentry_reportdialog_closed__")try{c()}finally{V.removeEventListener("message",d)}};V.addEventListener("message",d)}n.appendChild(s)}var x9=nt,A9="ReportingObserver",qN=new WeakMap,k9=((t={})=>{let e=t.types||["crash","deprecation","intervention"];function n(r){if(qN.has(z()))for(let o of r)De(i=>{i.setExtra("url",o.url);let a=`ReportingObserver [${o.type}]`,s="No details available";if(o.body){let l={};for(let c in o.body)l[c]=o.body[c];if(i.setExtra("body",l),o.type==="crash"){let c=o.body;s=[c.crashId||"",c.reason||""].join(" ").trim()||s}else s=o.body.message||s}Da(`${a}: ${s}`)})}return{name:A9,setupOnce(){if(!Dh())return;new x9.ReportingObserver(n,{buffered:!0,types:e}).observe()},setup(r){qN.set(r,!0)}}}),VN=k9;var I9="HttpClient",R9=((t={})=>{let e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...t};return{name:I9,setup(n){U9(n,e),B9(n,e)}}}),WN=R9;function N9(t,e,n,r,o){if(KN(t,n.status,n.url)){let i=P9(e,r),a,s,l,c,d=JN();if(d.requestHeaders!==!1&&(a=za(YN(i.headers),d.requestHeaders)),d.responseHeaders!==!1&&(s=za(YN(n.headers),d.responseHeaders)),d.cookies!==!1){let p=i.headers.get("Cookie")||void 0;if(p){let m=Cf(p,d.cookies);typeof m=="object"&&(l=m)}let f=n.headers.get("Set-Cookie")||void 0;if(f){let m=Cf(f,d.cookies);typeof m=="object"&&(c=m)}}let u=XN({url:i.url,method:i.method,status:n.status,requestHeaders:a,responseHeaders:s,requestCookies:l,responseCookies:c,error:o,type:"fetch"});Qr(u)}}function C9(t,e,n,r,o){if(KN(t,e.status,e.responseURL)){let i,a,s,l=JN();if(l.cookies!==!1)try{let d=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;if(d){let u=Cf(d,l.cookies);typeof u=="object"&&(a=u)}}catch{}if(l.responseHeaders!==!1)try{s=za(O9(e),l.responseHeaders)}catch{}l.requestHeaders!==!1&&(i=za(r,l.requestHeaders));let c=XN({url:e.responseURL,method:n,status:e.status,requestHeaders:i,responseHeaders:s,responseCookies:a,error:o,type:"xhr"});Qr(c)}}function M9(t){if(t){let e=t["Content-Length"]||t["content-length"];if(e)return parseInt(e,10)}}function YN(t){let e={};return t.forEach((n,r)=>{e[r]=n}),e}function O9(t){let e=t.getAllResponseHeaders();return e?e.split(`\r
|
|
501
|
+
`).reduce((n,r)=>{let[o,i]=r.split(": ");return o&&i&&(n[o]=i),n},{}):{}}function D9(t,e){return t.some(n=>typeof n=="string"?e.includes(n):n.test(e))}function L9(t,e){return t.some(n=>typeof n=="number"?n===e:e>=n[0]&&e<=n[1])}function U9(t,e){ou()&&hi(n=>{if(z()!==t)return;let{response:r,args:o,error:i,virtualError:a}=n,[s,l]=o;r&&N9(e,s,r,l,i||a)},!1)}function B9(t,e){"XMLHttpRequest"in nt&&_l(n=>{if(z()!==t)return;let{error:r,virtualError:o}=n,i=n.xhr,a=i[tr];if(!a)return;let{method:s,request_headers:l}=a;try{C9(e,i,s,l,r||o)}catch(c){W&&w.warn("Error while extracting response event form XHR response",c)}})}function KN(t,e,n){return L9(t.failedRequestStatusCodes,e)&&D9(t.failedRequestTargets,n)&&!$c(n,z())}function XN(t){let e=z(),n=e&&t.error&&t.error instanceof Error?t.error.stack:void 0,r=n&&e?e.getOptions().stackParser(n,0,1):void 0,o=`HTTP Client Error with status code: ${t.status}`,i={message:o,exception:{values:[{type:"Error",value:o,stacktrace:r?{frames:r}:void 0}]},request:{url:t.url,method:t.method,headers:t.requestHeaders,cookies:t.requestCookies},contexts:{response:{status_code:t.status,headers:t.responseHeaders,cookies:t.responseCookies,body_size:M9(t.responseHeaders)}}};return En(i,{type:`auto.http.client.${t.type}`,handled:!1}),i}function P9(t,e){return!e&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,e)}function JN(){let t=z();if(!t)return{cookies:!1,requestHeaders:!1,responseHeaders:!1};let e=t.getOptions();if(e.dataCollection==null){let o=!!e.sendDefaultPii;return{cookies:o,requestHeaders:o,responseHeaders:o}}let{cookies:n,httpHeaders:r}=t.getDataCollectionOptions();return{cookies:n,requestHeaders:r.request,responseHeaders:r.response}}var ZS=nt,z9=7,F9="ContextLines",H9=((t={})=>({name:F9,processEvent(e,n,r){let o=t.frameContextLines??r?.getDataCollectionOptions().frameContextLines??z9;return G9(e,o)}})),QN=H9;function G9(t,e){let n=ZS.document,r=ZS.location&&Gc(ZS.location.href);if(!n||!r)return t;let o=t.exception?.values;if(!o?.length)return t;let i=n.documentElement.innerHTML;if(!i)return t;let a=["<!DOCTYPE html>","<html>",...i.split(`
|
|
502
|
+
`),"</html>"];return o.forEach(s=>{let l=s.stacktrace;l?.frames&&(l.frames=l.frames.map(c=>$9(c,a,r,e)))}),t}function $9(t,e,n,r){return t.filename!==n||!t.lineno||!e.length||og(e,t,r),t}var j9="GraphQLClient",q9=(t=>({name:j9,setup(e){V9(e,t),Y9(e,t)}}));function V9(t,e){t.on("beforeOutgoingRequestSpan",(n,r)=>{let i=rt(n).data||{};if(!(i[ht]==="http.client"))return;let l=i[wc]||i["http.url"]||i.url,c=i[Sg]||i["http.method"];if(!gn(l)||!gn(c))return;let{endpoints:d}=e,u=tn(l,d),p=tC(r);if(u&&p){let f=eC(p);if(f){let m=ZN(f);n.updateName(`${c} ${l} (${m})`),Eb(f)&&n.setAttribute("graphql.document",f.query),Tb(f)&&(n.setAttribute("graphql.persisted_query.hash.sha256",f.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",f.extensions.persistedQuery.version))}}})}function Y9(t,e){t.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{let{category:o,type:i,data:a}=n;if(i==="http"&&(o==="fetch"||o==="xhr")){let d=a?.url,{endpoints:u}=e,p=tn(d,u),f=tC(r);if(p&&a&&f){let m=eC(f);if(!a.graphql&&m){let _=ZN(m);a["graphql.operation"]=_,Eb(m)&&(a["graphql.document"]=m.query),Tb(m)&&(a["graphql.persisted_query.hash.sha256"]=m.extensions.persistedQuery.sha256Hash,a["graphql.persisted_query.version"]=m.extensions.persistedQuery.version)}}}})}function ZN(t){if(Tb(t))return`persisted ${t.operationName}`;if(Eb(t)){let{query:e,operationName:n}=t,{operationName:r=n,operationType:o}=W9(e);return r?`${o} ${r}`:`${o}`}return"unknown"}function tC(t){let e="xhr"in t,n;if(e){let r=t.xhr[tr];n=r&&vl(r.body)[0]}else{let r=vu(t.input);n=vl(r)[0]}return n}function W9(t){let e=/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/,n=/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/,r=t.match(e);if(r)return{operationType:r[1],operationName:r[2]};let o=t.match(n);return o?{operationType:o[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function Sb(t){return typeof t=="object"&&t!==null}function Eb(t){return Sb(t)&&typeof t.query=="string"}function Tb(t){return Sb(t)&&typeof t.operationName=="string"&&Sb(t.extensions)&&Sb(t.extensions.persistedQuery)&&typeof t.extensions.persistedQuery.sha256Hash=="string"&&typeof t.extensions.persistedQuery.version=="number"}function eC(t){try{let e=JSON.parse(t);return Eb(e)||Tb(e)?e:void 0}catch{return}}var nC=q9;var rC=(t={})=>{let e=["script"];function n(r,o,i=0){if(!r)return;let a="shadowRoot"in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(let s of a){if(!(s instanceof HTMLElement))continue;let l=Va(s,1)||void 0,c=s.tagName.toLowerCase();if(e.includes(c))continue;let d=t.onElement?.({element:s,componentName:l,tagName:c,depth:i})||{};if(d==="skip")continue;if(d==="children"){n(s,o,i+1);continue}let{x:u,y:p,width:f,height:m}=s.getBoundingClientRect(),_={identifier:s.id||void 0,type:l||c,visible:!0,alpha:1,height:m,width:f,x:u,y:p,...d},v=[];_.children=v,n(s,_.children,i+1),o.push(_)}}return{name:"ViewHierarchy",processEvent:(r,o)=>{if(r.type!==void 0||t.shouldAttach?.(r,o)===!1)return r;let i={rendering_system:"DOM",positioning:"absolute",windows:[]};n(t.rootElement?.()||V.document.body,i.windows);let a={filename:"view-hierarchy.json",attachmentType:"event.view_hierarchy",contentType:"application/json",data:JSON.stringify(i)};return o.attachments=o.attachments||[],o.attachments.push(a),r}}};var we=nt,RE="sentryReplaySession",K9="replay_event",NE="Unable to send Replay",X9=3e5,J9=9e5,Q9=5e3,Z9=5500,tG=6e4,eG=5e3,nG=3,oC=15e4,wb=5e3,rG=3e3,oG=300,CE=2e7,iG=4999,aG=5e4,iC=36e5,sG=Object.defineProperty,lG=(t,e,n)=>e in t?sG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,aC=(t,e,n)=>lG(t,typeof e!="symbol"?e+"":e,n),rn=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(rn||{});function cG(t){return t.nodeType===t.ELEMENT_NODE}function ep(t){return t?.host?.shadowRoot===t}function np(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function uG(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function dG(t){let{cssText:e}=t;if(e.split('"').length<3)return e;let n=["@import",`url(${JSON.stringify(t.href)})`];return t.layerName===""?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}function Rb(t){try{let e=t.rules||t.cssRules;return e?uG(Array.from(e,NC).join("")):null}catch{return null}}function fG(t){let e="";for(let n=0;n<t.style.length;n++){let r=t.style,o=r[n],i=r.getPropertyPriority(o);e+=`${o}:${r.getPropertyValue(o)}${i?" !important":""};`}return`${t.selectorText} { ${e} }`}function NC(t){let e;if(mG(t))try{e=Rb(t.styleSheet)||dG(t)}catch{}else if(gG(t)){let n=t.cssText,r=t.selectorText.includes(":"),o=typeof t.style.all=="string"&&t.style.all;if(o&&(n=fG(t)),r&&(n=pG(n)),r||o)return n}return e||t.cssText}function pG(t){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function mG(t){return"styleSheet"in t}function gG(t){return"selectorText"in t}var Nb=class{constructor(){aC(this,"idNodeMap",new Map),aC(this,"nodeMetaMap",new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){let r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){let r=this.getNode(e);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function hG(){return new Nb}function jb({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function op({isMasked:t,element:e,value:n,maskInputFn:r}){let o=n||"";return t?(r&&(o=r(o,e)),"*".repeat(o.length)):o}function Cu(t){return t.toLowerCase()}function iE(t){return t.toUpperCase()}var sC="__rrweb_original__";function bG(t){let e=t.getContext("2d");if(!e)return!0;let n=50;for(let r=0;r<t.width;r+=n)for(let o=0;o<t.height;o+=n){let i=e.getImageData,a=sC in i?i[sC]:i;if(new Uint32Array(a.call(e,r,o,Math.min(n,t.width-r),Math.min(n,t.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function ME(t){let e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Cu(e):null}function Cb(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}function CC(t,e){let n;try{n=new URL(t,e??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}var lC={};function MC(t){let e=lC[t];if(e)return e;let n=window.document,r=window[t];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[t]&&(r=i[t]),n.head.removeChild(o)}catch{}return lC[t]=r.bind(window)}function aE(...t){return MC("setTimeout")(...t)}function OC(...t){return MC("clearTimeout")(...t)}function DC(t){try{return t.contentDocument}catch{}}function yG(t){try{return t.contentWindow}catch{}}var _G=1,vG=new RegExp("[^a-z0-9-_:]"),ip=-2;function OE(){return _G++}function SG(t){if(t instanceof HTMLFormElement)return"form";let e=Cu(t.tagName);return vG.test(e)?"div":e}function EG(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var wu,cC,TG=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,wG=/^(?:[a-z+]+:)?\/\//i,xG=/^www\..*/i,AG=/^(data:)([^,]*),(.*)/i;function kG(t,e){if(!t||e.size===0)return t;try{let n=t.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 a=o.slice(0,i).trim();e.has(a)||r.push(o)}return r.join("; ")+(r.length>0&&t.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),t}}function Mb(t,e){return(t||"").replace(TG,(n,r,o,i,a,s)=>{let l=o||a||s,c=r||i||"";if(!l)return n;if(wG.test(l)||xG.test(l))return`url(${c}${l}${c})`;if(AG.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${EG(e)+l}${c})`;let d=e.split("/"),u=l.split("/");d.pop();for(let p of u)p!=="."&&(p===".."?d.pop():d.push(p));return`url(${c}${d.join("/")}${c})`})}var IG=/^[^ \t\n\r\u000c]+/,RG=/^[, \t\n\r\u000c]+/;function NG(t,e){if(e.trim()==="")return e;let n=0;function r(i){let a,s=i.exec(e.substring(n));return s?(a=s[0],n+=a.length,a):""}let o=[];for(;r(RG),!(n>=e.length);){let i=r(IG);if(i.slice(-1)===",")i=ku(t,i.substring(0,i.length-1)),o.push(i);else{let a="";i=ku(t,i);let s=!1;for(;;){let l=e.charAt(n);if(l===""){o.push((i+a).trim());break}else if(s)l===")"&&(s=!1);else if(l===","){n+=1,o.push((i+a).trim());break}else l==="("&&(s=!0);a+=l,n+=1}}}return o.join(", ")}var uC=new WeakMap;function ku(t,e){return!e||e.trim()===""?e:qb(t,e)}function CG(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function qb(t,e){let n=uC.get(t);if(n||(n=t.createElement("a"),uC.set(t,n)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return n.setAttribute("href",e),n.href}function LC(t,e,n,r,o,i,a){if(!r)return r;if(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#"))return ku(t,r);if(n==="xlink:href"&&r[0]!=="#")return ku(t,r);if(n==="background"&&(e==="table"||e==="td"||e==="th"))return ku(t,r);if(n==="srcset")return NG(t,r);if(n==="style"){let s=Mb(r,qb(t));return a&&a.size>0&&(s=kG(s,a)),s}else if(e==="object"&&n==="data")return ku(t,r);return typeof i=="function"?i(n,r,o):r}function UC(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function MG(t,e,n,r){try{if(r&&t.matches(r))return!1;if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(let o=t.classList.length;o--;){let i=t.classList[o];if(e.test(i))return!0}if(n)return t.matches(n)}catch{}return!1}function OG(t,e){for(let n=t.classList.length;n--;){let r=t.classList[n];if(e.test(r))return!0}return!1}function Sl(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:Sl(t.parentNode,e,n,r+1)}function Iu(t,e){return n=>{let r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(OG(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Mu(t,e,n,r,o,i){try{let a=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(a===null)return!1;if(a.tagName==="INPUT"){let c=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let s=-1,l=-1;if(i){if(l=Sl(a,Iu(r,o)),l<0)return!0;s=Sl(a,Iu(e,n),l>=0?l:1/0)}else{if(s=Sl(a,Iu(e,n)),s<0)return!1;l=Sl(a,Iu(r,o),s>=0?s:1/0)}return s>=0?l>=0?s<=l:!0:l>=0?!1:!!i}catch{}return!!i}function DG(t,e,n){let r=yG(t);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let s=aE(()=>{o||(e(),o=!0)},n);t.addEventListener("load",()=>{OC(s),o=!0,e()});return}let a="about:blank";if(r.location.href!==a||t.src===a||t.src==="")return aE(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function LG(t,e,n){let r=!1,o;try{o=t.sheet}catch{o=null}if(o)return;let i=aE(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{OC(i),r=!0,e()})}function UG(t,e){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:p,inlineStylesheet:f,maskInputOptions:m={},maskTextFn:_,maskInputFn:v,dataURLOptions:h={},inlineImages:y,recordCanvas:S,keepIframeSrcFn:E,newlyAddedElement:R=!1,ignoreCSSAttributes:C}=e,k=BG(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:rn.Document,childNodes:[],compatMode:t.compatMode}:{type:rn.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:rn.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return zG(t,{doc:n,blockClass:o,blockSelector:i,unblockSelector:a,inlineStylesheet:f,maskAttributeFn:l,maskInputOptions:m,maskInputFn:v,dataURLOptions:h,inlineImages:y,recordCanvas:S,keepIframeSrcFn:E,newlyAddedElement:R,rootId:k,maskTextClass:c,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:p,ignoreCSSAttributes:C});case t.TEXT_NODE:return PG(t,{doc:n,maskAllText:s,maskTextClass:c,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:p,maskTextFn:_,maskInputOptions:m,maskInputFn:v,rootId:k});case t.CDATA_SECTION_NODE:return{type:rn.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:rn.Comment,textContent:t.textContent||"",rootId:k};default:return!1}}function BG(t,e){if(!e.hasNode(t))return;let n=e.getId(t);return n===1?void 0:n}function PG(t,e){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:a,maskTextFn:s,maskInputOptions:l,maskInputFn:c,rootId:d}=e,u=t.parentNode&&t.parentNode.tagName,p=t.textContent,f=u==="STYLE"?!0:void 0,m=u==="SCRIPT"?!0:void 0,_=u==="TEXTAREA"?!0:void 0;if(f&&p){try{t.nextSibling||t.previousSibling||t.parentNode.sheet?.cssRules&&(p=Rb(t.parentNode.sheet))}catch(h){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${h}`,t)}p=Mb(p,qb(e.doc))}m&&(p="SCRIPT_PLACEHOLDER");let v=Mu(t,r,i,o,a,n);if(!f&&!m&&!_&&p&&v&&(p=s?s(p,t.parentElement):p.replace(/[\S]/g,"*")),_&&p&&(l.textarea||v)&&(p=c?c(p,t.parentNode):p.replace(/[\S]/g,"*")),u==="OPTION"&&p){let h=jb({type:null,tagName:u,maskInputOptions:l});p=op({isMasked:Mu(t,r,i,o,a,h),element:t,value:p,maskInputFn:c})}return{type:rn.Text,textContent:p||"",isStyle:f,rootId:d}}function zG(t,e){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:a,maskInputOptions:s={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:u,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,rootId:_,maskTextClass:v,unmaskTextClass:h,maskTextSelector:y,unmaskTextSelector:S,ignoreCSSAttributes:E}=e,R=MG(t,r,o,i),C=SG(t),k={},L=t.attributes.length;for(let U=0;U<L;U++){let D=t.attributes[U];D.name&&!UC(C,D.name,D.value)&&(k[D.name]=LC(n,C,Cu(D.name),D.value,t,l,E))}if(C==="link"&&a){let U=Array.from(n.styleSheets).find(N=>N.href===t.href),D=null;U&&(D=Rb(U)),D&&(k.rel=null,k.href=null,k.crossorigin=null,k._cssText=Mb(D,U.href))}if(C==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){let U=Rb(t.sheet);U&&(k._cssText=Mb(U,qb(n)))}if(C==="input"||C==="textarea"||C==="select"||C==="option"){let U=t,D=ME(U),N=Cb(U,iE(C),D),B=U.checked;if(D!=="submit"&&D!=="button"&&N){let Y=Mu(U,v,y,h,S,jb({type:D,tagName:iE(C),maskInputOptions:s}));k.value=op({isMasked:Y,element:U,value:N,maskInputFn:c})}B&&(k.checked=B)}if(C==="option"&&(t.selected&&!s.select?k.selected=!0:delete k.selected),C==="canvas"&&p){if(t.__context==="2d")bG(t)||(k.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){let U=t.toDataURL(d.type,d.quality),D=n.createElement("canvas");D.width=t.width,D.height=t.height;let N=D.toDataURL(d.type,d.quality);U!==N&&(k.rr_dataURL=U)}}if(C==="img"&&u){wu||(wu=n.createElement("canvas"),cC=wu.getContext("2d"));let U=t,D=U.currentSrc||U.getAttribute("src")||"<unknown-src>",N=U.crossOrigin,B=()=>{U.removeEventListener("load",B);try{wu.width=U.naturalWidth,wu.height=U.naturalHeight,cC.drawImage(U,0,0),k.rr_dataURL=wu.toDataURL(d.type,d.quality)}catch(Y){if(U.crossOrigin!=="anonymous"){U.crossOrigin="anonymous",U.complete&&U.naturalWidth!==0?B():U.addEventListener("load",B);return}else console.warn(`Cannot inline img src=${D}! Error: ${Y}`)}U.crossOrigin==="anonymous"&&(N?k.crossOrigin=N:U.removeAttribute("crossorigin"))};U.complete&&U.naturalWidth!==0?B():U.addEventListener("load",B)}if((C==="audio"||C==="video")&&(k.rr_mediaState=t.paused?"paused":"played",k.rr_mediaCurrentTime=t.currentTime),m||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),R){let{width:U,height:D}=t.getBoundingClientRect();k={class:k.class,rr_width:`${U}px`,rr_height:`${D}px`}}C==="iframe"&&!f(k.src)&&(!R&&!DC(t)&&(k.rr_src=k.src),delete k.src);let F;try{customElements.get(C)&&(F=!0)}catch{}return{type:rn.Element,tagName:C,attributes:k,childNodes:[],isSVG:CG(t)||void 0,needBlock:R,rootId:_,isCustom:F}}function Te(t){return t==null?"":t.toLowerCase()}function FG(t,e){if(e.comment&&t.type===rn.Comment)return!0;if(t.type===rn.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&CC(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(Te(t.attributes.name).match(/^msapplication-tile(image|color)$/)||Te(t.attributes.name)==="application-name"||Te(t.attributes.rel)==="icon"||Te(t.attributes.rel)==="apple-touch-icon"||Te(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&Te(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Te(t.attributes.property).match(/^(og|twitter|fb):/)||Te(t.attributes.name).match(/^(og|twitter):/)||Te(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(Te(t.attributes.name)==="robots"||Te(t.attributes.name)==="googlebot"||Te(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(Te(t.attributes.name)==="author"||Te(t.attributes.name)==="generator"||Te(t.attributes.name)==="framework"||Te(t.attributes.name)==="publisher"||Te(t.attributes.name)==="progid"||Te(t.attributes.property).match(/^article:/)||Te(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(Te(t.attributes.name)==="google-site-verification"||Te(t.attributes.name)==="yandex-verification"||Te(t.attributes.name)==="csrf-token"||Te(t.attributes.name)==="p:domain_verify"||Te(t.attributes.name)==="verify-v1"||Te(t.attributes.name)==="verification"||Te(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ru(t,e){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:p=!1,inlineStylesheet:f=!0,maskInputOptions:m={},maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y,dataURLOptions:S={},inlineImages:E=!1,recordCanvas:R=!1,onSerialize:C,onIframeLoad:k,iframeLoadTimeout:L=5e3,onBlockedImageLoad:F,onStylesheetLoad:U,stylesheetLoadTimeout:D=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:B=!1,ignoreCSSAttributes:Y}=e,{preserveWhiteSpace:st=!0}=e,ot=UG(t,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:s,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,dataURLOptions:S,inlineImages:E,recordCanvas:R,keepIframeSrcFn:N,newlyAddedElement:B,ignoreCSSAttributes:Y});if(!ot)return console.warn(t,"not serialized"),null;let lt;r.hasNode(t)?lt=r.getId(t):FG(ot,y)||!st&&ot.type===rn.Text&&!ot.isStyle&&!ot.textContent.trim().length?lt=ip:lt=OE();let X=Object.assign(ot,{id:lt});if(r.add(t,X),lt===ip)return null;C&&C(t);let ct=!p;if(X.type===rn.Element){ct=ct&&!X.needBlock;let H=t.shadowRoot;H&&np(H)&&(X.isShadowHost=!0)}if((X.type===rn.Document||X.type===rn.Element)&&ct){y.headWhitespace&&X.type===rn.Element&&X.tagName==="head"&&(st=!1);let H={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:s,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:p,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:st,onSerialize:C,onIframeLoad:k,iframeLoadTimeout:L,onBlockedImageLoad:F,onStylesheetLoad:U,stylesheetLoadTimeout:D,keepIframeSrcFn:N,ignoreCSSAttributes:Y},gt=t.childNodes?Array.from(t.childNodes):[];for(let J of gt){let dt=Ru(J,H);dt&&X.childNodes.push(dt)}if(cG(t)&&t.shadowRoot)for(let J of Array.from(t.shadowRoot.childNodes)){let dt=Ru(J,H);dt&&(np(t.shadowRoot)&&(dt.isShadow=!0),X.childNodes.push(dt))}}if(t.parentNode&&ep(t.parentNode)&&np(t.parentNode)&&(X.isShadow=!0),X.type===rn.Element&&X.tagName==="iframe"&&!X.needBlock&&DG(t,()=>{let H=DC(t);if(H&&k){let gt=Ru(H,{doc:H,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:st,onSerialize:C,onIframeLoad:k,iframeLoadTimeout:L,onStylesheetLoad:U,stylesheetLoadTimeout:D,keepIframeSrcFn:N,ignoreCSSAttributes:Y});gt&&k(t,gt)}},L),X.type===rn.Element&&X.tagName==="img"&&!t.complete&&X.needBlock){let H=t,gt=()=>{if(H.isConnected&&!H.complete&&F)try{let J=H.getBoundingClientRect();J.width>0&&J.height>0&&F(H,X,J)}catch{}H.removeEventListener("load",gt)};H.isConnected&&H.addEventListener("load",gt)}return X.type===rn.Element&&X.tagName==="link"&&typeof X.attributes.rel=="string"&&(X.attributes.rel==="stylesheet"||X.attributes.rel==="preload"&&typeof X.attributes.href=="string"&&CC(X.attributes.href)==="css")&&LG(t,()=>{if(U){let H=Ru(t,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:st,onSerialize:C,onIframeLoad:k,iframeLoadTimeout:L,onStylesheetLoad:U,stylesheetLoadTimeout:D,keepIframeSrcFn:N,ignoreCSSAttributes:Y});H&&U(t,H)}},D),X.type===rn.Element&&delete X.needBlock,X}function HG(t,e){let{mirror:n=new Nb,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:i=null,maskAllText:a=!1,maskTextClass:s="rr-mask",unmaskTextClass:l=null,maskTextSelector:c=null,unmaskTextSelector:d=null,inlineStylesheet:u=!0,inlineImages:p=!1,recordCanvas:f=!1,maskAllInputs:m=!1,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOM:y=!1,dataURLOptions:S,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:C,iframeLoadTimeout:k,onBlockedImageLoad:L,onStylesheetLoad:F,stylesheetLoadTimeout:U,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:N=new Set([])}=e||{};return Ru(t,{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:a,maskTextClass:s,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:u,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:y==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:y===!1?{}:y,dataURLOptions:S,inlineImages:p,recordCanvas:f,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:C,iframeLoadTimeout:k,onBlockedImageLoad:L,onStylesheetLoad:F,stylesheetLoadTimeout:U,keepIframeSrcFn:D,newlyAddedElement:!1,ignoreCSSAttributes:N})}function nr(t,e,n=document){let r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}var xu=`Please stop import mirror directly. Instead of that,\r
|
|
503
503
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
504
|
-
or you can use record.mirror to access the mirror instance during recording.`,dC={map:{},getId(){return console.error(xu),-1},getNode(){return console.error(xu),null},removeNodeFromMap(){console.error(xu)},has(){return console.error(xu),!1},reset(){console.error(xu)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(dC=new Proxy(dC,{get(t,e,n){return e==="map"&&console.error(xu),Reflect.get(t,e,n)}}));function ap(t,e,n={}){let r=null,o=0;return function(...i){let a=Date.now();!o&&n.leading===!1&&(o=a);let s=e-(a-o),l=this;s<=0||s>e?(r&&(YG(r),r=null),o=a,t.apply(l,i)):!r&&n.trailing!==!1&&(r=Vb(()=>{o=n.leading===!1?0:Date.now(),r=null,t.apply(l,i)},s))}}function BC(t,e,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(a){Vb(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>BC(t,e,i||{},!0)}function DE(t,e,n){try{if(!(e in t))return()=>{};let r=t[e],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=o,()=>{t[e]=r}}catch{return()=>{}}}var Ob=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ob=()=>new Date().getTime());function PC(t){let e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:e?.documentElement.scrollLeft||e?.body?.parentElement?.scrollLeft||e?.body?.scrollLeft||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:e?.documentElement.scrollTop||e?.body?.parentElement?.scrollTop||e?.body?.scrollTop||0}}function zC(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function FC(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function HC(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function Ur(t,e,n,r,o){if(!t)return!1;let i=HC(t);if(!i)return!1;let a=Iu(e,n);if(!o){let c=r&&i.matches(r);return a(i)&&!c}let s=Sl(i,a),l=-1;return s<0?!1:(r&&(l=Sl(i,Iu(null,r))),s>-1&&l<0?!0:s<l)}function GG(t,e){return e.getId(t)!==-1}function tE(t,e){return e.getId(t)===ip}function GC(t,e){if(ep(t))return!1;let n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?GC(t.parentNode,e):!0:!0}function sE(t){return!!t.changedTouches}function $G(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function $C(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function jC(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function lE(t){return!!t?.shadowRoot}var cE=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function qC(t){let e=null;return t.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function jG(t){let e=t,n;for(;n=qC(e);)e=n;return e}function qG(t){let e=t.ownerDocument;if(!e)return!1;let n=jG(t);return e.contains(n)}function VC(t){let e=t.ownerDocument;return e?e.contains(t)||qG(t):!1}var fC={};function LE(t){let e=fC[t];if(e)return e;let n=window.document,r=window[t];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[t]&&(r=i[t]),n.head.removeChild(o)}catch{}return fC[t]=r.bind(window)}function VG(...t){return LE("requestAnimationFrame")(...t)}function Vb(...t){return LE("setTimeout")(...t)}function YG(...t){return LE("clearTimeout")(...t)}var $t=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))($t||{}),Rt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Rt||{}),er=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(er||{}),Ki=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Ki||{}),Au=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Au||{}),rp;function WG(t){rp=t}function KG(){rp=void 0}var ee=t=>rp?((...n)=>{try{return t(...n)}catch(r){if(rp&&rp(r)===!0)return()=>{};throw r}}):t,pC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",XG=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Zf=0;Zf<pC.length;Zf++)XG[pC.charCodeAt(Zf)]=Zf;var Zf,Db=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function UE(t){try{return t.contentDocument}catch{}}function sp(t){try{return t.contentWindow}catch{}}var uE=class{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{let n=new CSSStyleSheet;n.replaceSync(`x { ${e} }`);let r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch{return null}}parseWithDetachedElement(e){let n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",e),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function mC(t){return"__ln"in t}var dE=class{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=n?.next||null;return n}addNode(e){let n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&mC(e.previousSibling)){let r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&mC(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.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(e){let n=e.__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),e.__ln&&delete e.__ln,this.length--)}},gC=(t,e)=>`${t}@${e}`,fE=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=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],n=new Set,r=new dE,o=l=>{let c=l,d=ip;for(;d===ip;)c=c&&c.nextSibling,d=c&&this.mirror.getId(c);return d},i=l=>{if(!l.parentNode||!VC(l))return;let c=ep(l.parentNode)?this.mirror.getId(qC(l)):this.mirror.getId(l.parentNode),d=o(l);if(c===-1||d===-1)return r.addNode(l);let u=Ru(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=>{$C(p,this.mirror)&&!Ur(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),jC(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),lE(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,f)=>{if(Ur(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,f);let m=sp(p);m&&this.canvasManager.addWindow(m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,f)=>{this.stylesheetManager.attachLinkElement(p,f)},onBlockedImageLoad:(p,f,{width:m,height:_})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:f.id,attributes:{style:{width:`${m}px`,height:`${_}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});u&&(e.push({parentId:c,nextId:d,node:u}),n.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)hC(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(let l of this.addedSet)!bC(this.droppedSet,l)&&!hC(this.removes,l,this.mirror)||bC(this.movedSet,l)?i(l):this.droppedSet.add(l);let a=null;for(;r.length;){let l=null;if(a){let c=this.mirror.getId(a.value.parentNode),d=o(a.value);c!==-1&&d!==-1&&(l=a)}if(!l){let c=r.tail;for(;c;){let d=c;if(c=c.previous,d){let u=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(u!==-1){l=d;break}else{let f=d.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=f.parentNode.host;if(this.mirror.getId(m)!==-1){l=d;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),i(l.value)}let s={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 d=JSON.stringify(l.styleDiff),u=JSON.stringify(l._unchangedStyles);d.length<c.style.length&&(d+u).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:e};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.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(s))},this.processMutation=e=>{if(!tE(e.target,this.mirror))switch(e.type){case"characterData":{let n=e.target.textContent;!Ur(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Mu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,HC(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{let n=e.target,r=e.attributeName,o=e.target.getAttribute(r);if(r==="value"){let a=ME(n),s=n.tagName;o=Cb(n,s,a);let l=jb({maskInputOptions:this.maskInputOptions,tagName:s,type:a}),c=Mu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=op({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(Ur(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===e.oldValue)return;let i=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!UE(n))r="rr_src";else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!UC(n.tagName,r)&&(i.attributes[r]=LC(this.doc,Cu(n.tagName),Cu(r),o,n,this.maskAttributeFn),r==="style")){let a=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(let s of Array.from(n.style)){let l=n.style.getPropertyValue(s),c=n.style.getPropertyPriority(s);l!==(a?.getPropertyValue(s)||"")||c!==(a?.getPropertyPriority(s)||"")?c===""?i.styleDiff[s]=l:i.styleDiff[s]=[l,c]:i._unchangedStyles[s]=[l,c]}if(a)for(let s of Array.from(a))n.style.getPropertyValue(s)===""&&(i.styleDiff[s]=!1)}break}case"childList":{if(Ur(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=ep(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Ur(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||tE(n,this.mirror)||!GG(n,this.mirror)||(this.addedSet.has(n)?(pE(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||GC(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[gC(r,o)]?pE(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:ep(e.target)&&np(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(tE(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[gC(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ur(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(r=>this.genAdds(r)),lE(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(n=>{this[n]=e[n]}),this.styleDeclarationParser=new uE(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 pE(t,e){t.delete(e),e.childNodes?.forEach(n=>pE(t,n))}function hC(t,e,n){return t.length===0?!1:JG(t,e,n)}function JG(t,e,n){let r=e.parentNode;for(;r;){let o=n.getId(r);if(t.some(i=>i.id===o))return!0;r=r.parentNode}return!1}function bC(t,e){return t.size===0?!1:YC(t,e)}function YC(t,e){let{parentNode:n}=e;return n?t.has(n)?!0:YC(t,n):!1}var Nu=[];function fp(t){try{if("composedPath"in t){let e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function WC(t,e){let n=new fE;Nu.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver,o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);let i=new r(ee(a=>{t.onMutation&&t.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function QG({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};let o=typeof e.mousemove=="number"?e.mousemove:50,i=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,a=[],s,l=ap(ee(u=>{let p=Date.now()-s;t(a.map(f=>(f.timeOffset-=p,f)),u),a=[],s=null}),i),c=ee(ap(ee(u=>{let p=fp(u),{clientX:f,clientY:m}=sE(u)?u.changedTouches[0]:u;s||(s=Ob()),a.push({x:f,y:m,id:r.getId(p),timeOffset:Ob()-s}),l(typeof DragEvent<"u"&&u instanceof DragEvent?Rt.Drag:u instanceof MouseEvent?Rt.MouseMove:Rt.TouchMove)}),o,{trailing:!1})),d=[nr("mousemove",c,n),nr("touchmove",c,n),nr("drag",c,n)];return ee(()=>{d.forEach(u=>u())})}function ZG({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};let s=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,l=[],c=null,d=u=>p=>{let f=fp(p);if(Ur(f,r,o,i,!0))return;let m=null,_=u;if("pointerType"in p){switch(p.pointerType){case"mouse":m=Ki.Mouse;break;case"touch":m=Ki.Touch;break;case"pen":m=Ki.Pen;break}m===Ki.Touch?er[u]===er.MouseDown?_="TouchStart":er[u]===er.MouseUp&&(_="TouchEnd"):Ki.Pen}else sE(p)&&(m=Ki.Touch);m!==null?(c=m,(_.startsWith("Touch")&&m===Ki.Touch||_.startsWith("Mouse")&&m===Ki.Mouse)&&(m=null)):er[u]===er.Click&&(m=c,c=null);let v=sE(p)?p.changedTouches[0]:p;if(!v)return;let h=n.getId(f),{clientX:y,clientY:S}=v;ee(t)({type:er[_],id:h,x:y,y:S,...m!==null&&{pointerType:m}})};return Object.keys(er).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&s[u]!==!1).forEach(u=>{let p=Cu(u),f=d(u);if(window.PointerEvent)switch(er[u]){case er.MouseDown:case er.MouseUp:p=p.replace("mouse","pointer");break;case er.TouchStart:case er.TouchEnd:return}l.push(nr(p,f,e))}),ee(()=>{l.forEach(u=>u())})}function KC({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:a}){let s=ee(ap(ee(l=>{let c=fp(l);if(!c||Ur(c,r,o,i,!0))return;let d=n.getId(c);if(c===e&&e.defaultView){let u=PC(e.defaultView);t({id:d,x:u.left,y:u.top})}else t({id:d,x:c.scrollLeft,y:c.scrollTop})}),a.scroll||100));return nr("scroll",s,e)}function t$({viewportResizeCb:t},{win:e}){let n=-1,r=-1,o=ee(ap(ee(()=>{let i=zC(),a=FC();(n!==i||r!==a)&&(t({width:Number(a),height:Number(i)}),n=i,r=a)}),200));return nr("resize",o,e)}var e$=["INPUT","TEXTAREA","SELECT"],yC=new WeakMap;function n$({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:a,ignoreSelector:s,maskInputOptions:l,maskInputFn:c,sampling:d,userTriggeredOnInput:u,maskTextClass:p,unmaskTextClass:f,maskTextSelector:m,unmaskTextSelector:_}){function v(I){let L=fp(I),z=I.isTrusted,U=L&&iE(L.tagName);if(U==="OPTION"&&(L=L.parentElement),!L||!U||e$.indexOf(U)<0||Ur(L,r,o,i,!0))return;let D=L;if(D.classList.contains(a)||s&&D.matches(s))return;let N=ME(L),B=Cb(D,U,N),V=!1,st=jb({maskInputOptions:l,tagName:U,type:N}),nt=Mu(L,p,m,f,_,st);(N==="radio"||N==="checkbox")&&(V=L.checked),B=op({isMasked:nt,element:L,value:B,maskInputFn:c}),h(L,u?{text:B,isChecked:V,userTriggered:z}:{text:B,isChecked:V});let lt=L.name;N==="radio"&<&&V&&e.querySelectorAll(`input[type="radio"][name="${lt}"]`).forEach(X=>{if(X!==L){let ct=op({isMasked:nt,element:X,value:Cb(X,U,N),maskInputFn:c});h(X,u?{text:ct,isChecked:!V,userTriggered:!1}:{text:ct,isChecked:!V})}})}function h(I,L){let z=yC.get(I);if(!z||z.text!==L.text||z.isChecked!==L.isChecked){yC.set(I,L);let U=n.getId(I);ee(t)({...L,id:U})}}let S=(d.input==="last"?["change"]:["input","change"]).map(I=>nr(I,ee(v),e)),E=e.defaultView;if(!E)return()=>{S.forEach(I=>I())};let R=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),C=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return R&&R.set&&S.push(...C.map(I=>BC(I[0],I[1],{set(){ee(v)({target:this,isTrusted:!1})}},!1,E))),ee(()=>{S.forEach(I=>I())})}function Lb(t){let e=[];function n(r,o){if(xb("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||xb("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||xb("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||xb("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let a=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(a)}else if(r.parentStyleSheet){let a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(a)}return o}return n(t,e)}function Ja(t,e,n){let r,o;return t?(t.ownerNode?r=e.getId(t.ownerNode):o=n.getId(t),{styleId:o,id:r}):{}}function r$({styleSheetRuleCb:t,mirror:e,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:ee((d,u,p)=>{let[f,m]=p,{id:_,styleId:v}=Ja(u,e,n.styleMirror);return(_&&_!==-1||v&&v!==-1)&&t({id:_,styleId:v,adds:[{rule:f,index:m}]}),d.apply(u,p)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:ee((d,u,p)=>{let[f]=p,{id:m,styleId:_}=Ja(u,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,removes:[{index:f}]}),d.apply(u,p)})});let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:ee((d,u,p)=>{let[f]=p,{id:m,styleId:_}=Ja(u,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,replace:f}),d.apply(u,p)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:ee((d,u,p)=>{let[f]=p,{id:m,styleId:_}=Ja(u,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,replaceSync:f}),d.apply(u,p)})}));let l={};Ab("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Ab("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Ab("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Ab("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(l).forEach(([d,u])=>{c[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=new Proxy(c[d].insertRule,{apply:ee((p,f,m)=>{let[_,v]=m,{id:h,styleId:y}=Ja(f.parentStyleSheet,e,n.styleMirror);return(h&&h!==-1||y&&y!==-1)&&t({id:h,styleId:y,adds:[{rule:_,index:[...Lb(f),v||0]}]}),p.apply(f,m)})}),u.prototype.deleteRule=new Proxy(c[d].deleteRule,{apply:ee((p,f,m)=>{let[_]=m,{id:v,styleId:h}=Ja(f.parentStyleSheet,e,n.styleMirror);return(v&&v!==-1||h&&h!==-1)&&t({id:v,styleId:h,removes:[{index:[...Lb(f),_]}]}),p.apply(f,m)})})}),ee(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(l).forEach(([d,u])=>{u.prototype.insertRule=c[d].insertRule,u.prototype.deleteRule=c[d].deleteRule})})}function XC({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.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(a){let s=i.set?.call(this,a);if(r!==null&&r!==-1)try{e.adoptStyleSheets(a,r)}catch{}return s}}),ee(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function o$({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:ee((s,l,c)=>{let[d,u,p]=c;if(n.has(d))return i.apply(l,[d,u,p]);let{id:f,styleId:m}=Ja(l.parentRule?.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&t({id:f,styleId:m,set:{property:d,value:u,priority:p},index:Lb(l.parentRule)}),s.apply(l,c)})});let a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:ee((s,l,c)=>{let[d]=c;if(n.has(d))return a.apply(l,[d]);let{id:u,styleId:p}=Ja(l.parentRule?.parentStyleSheet,e,r.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,remove:{property:d},index:Lb(l.parentRule)}),s.apply(l,c)})}),ee(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a})}function i$({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:a}){let s=ee(c=>ap(ee(d=>{let u=fp(d);if(!u||Ur(u,e,n,r,!0))return;let{currentTime:p,volume:f,muted:m,playbackRate:_}=u;t({type:c,id:o.getId(u),currentTime:p,volume:f,muted:m,playbackRate:_})}),i.media||500)),l=[nr("play",s(Au.Play),a),nr("pause",s(Au.Pause),a),nr("seeked",s(Au.Seeked),a),nr("volumechange",s(Au.VolumeChange),a),nr("ratechange",s(Au.RateChange),a)];return ee(()=>{l.forEach(c=>c())})}function a$({fontCb:t,doc:e}){let n=e.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,d){let u=new i(l,c,d);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:d,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};let a=DE(e.fonts,"add",function(s){return function(l){return Vb(ee(()=>{let c=o.get(l);c&&(t(c),o.delete(l))}),0),s.apply(this,[l])}});return r.push(()=>{n.FontFace=i}),r.push(a),ee(()=>{r.forEach(s=>s())})}function s$(t){let{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:a}=t,s=!0,l=ee(()=>{let c=e.getSelection();if(!c||s&&c?.isCollapsed)return;s=c.isCollapsed||!1;let d=[],u=c.rangeCount||0;for(let p=0;p<u;p++){let f=c.getRangeAt(p),{startContainer:m,startOffset:_,endContainer:v,endOffset:h}=f;Ur(m,r,o,i,!0)||Ur(v,r,o,i,!0)||d.push({start:n.getId(m),startOffset:_,end:n.getId(v),endOffset:h})}a({ranges:d})});return l(),nr("selectionchange",l)}function l$({doc:t,customElementCb:e}){let n=t.defaultView;return!n||!n.customElements?()=>{}:DE(n.customElements,"define",function(o){return function(i,a,s){try{e({define:{name:i}})}catch{}return o.apply(this,[i,a,s])}})}function c$(t,e={}){let n=t.doc.defaultView;if(!n)return()=>{};let r;t.recordDOM&&(r=WC(t,t.doc));let o=QG(t),i=ZG(t),a=KC(t),s=t$(t,{win:n}),l=n$(t),c=i$(t),d=()=>{},u=()=>{},p=()=>{},f=()=>{};t.recordDOM&&(d=r$(t,{win:n}),u=XC(t,t.doc),p=o$(t,{win:n}),t.collectFonts&&(f=a$(t)));let m=s$(t),_=l$(t),v=[];for(let h of t.plugins)v.push(h.observer(h.callback,n,h.options));return ee(()=>{Nu.forEach(h=>h.reset()),r?.disconnect(),o(),i(),a(),s(),l(),c(),d(),u(),p(),f(),m(),_(),v.forEach(h=>h())})}function xb(t){return typeof window[t]<"u"}function Ab(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var lp=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,o){let i=r||this.getIdToRemoteIdMap(e),a=o||this.getRemoteIdToIdMap(e),s=i.get(n);return s||(s=this.generateIdFn(),i.set(n,s),a.set(s,n)),s}getIds(e,n){let r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return n.map(i=>this.getId(e,i,r,o))}getRemoteId(e,n,r){let o=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(e,n){let r=this.getRemoteIdToIdMap(e);return n.map(o=>this.getRemoteId(e,o,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}},mE=class{constructor(){this.crossOriginIframeMirror=new lp(OE),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},gE=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new lp(OE),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new lp(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);let n=sp(e);n&&this.crossOriginIframeMap.set(n,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&sp(e)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(e);let r=UE(e);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(e){let n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;let o=this.crossOriginIframeMap.get(e.source);if(!o)return;let i=this.transformCrossOriginEvent(o,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case $t.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);let r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:$t.IncrementalSnapshot,data:{source:Rt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $t.Meta:case $t.Load:case $t.DomContentLoaded:return!1;case $t.Plugin:return n;case $t.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case $t.IncrementalSnapshot:switch(n.data.source){case Rt.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);let o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Rt.Drag:case Rt.TouchMove:case Rt.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Rt.ViewportResize:return!1;case Rt.MediaInteraction:case Rt.MouseInteraction:case Rt.Scroll:case Rt.CanvasMutation:case Rt.Input:return this.replaceIds(n.data,e,["id"]),n;case Rt.StyleSheetRule:case Rt.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case Rt.Font:return n;case Rt.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case Rt.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,e,["styleId"])}),n}}return!1}replace(e,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=e.getIds(r,n[i]):n[i]=e.getId(r,n[i]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==rn.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},hE=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},bE=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!np(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let r=WC({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(KC({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),Vb(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(XC({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){let n=UE(e),r=sp(e);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(e,n){let r=this;this.restoreHandlers.push(DE(e.prototype,"attachShadow",function(o){return function(i){let a=o.call(this,i);return this.shadowRoot&&VC(this)&&r.addShadowRoot(this.shadowRoot,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},yE=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new cE,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of e){let a;this.styleMirror.has(i)?a=this.styleMirror.getId(i):(a=this.styleMirror.add(i),o.push({styleId:a,rules:Array.from(i.rules||CSSRule,(s,l)=>({rule:NC(s),index:l}))})),r.styleIds.push(a)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},_E=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,n){let r=this.nodeMap.get(e);return r&&Array.from(r).some(o=>o!==n)}add(e,n){this.active||(this.active=!0,VG(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}},qe,Ub;try{if(Array.from([1],t=>t*2)[0]!==2){let t=document.createElement("iframe");document.body.appendChild(t),Array.from=t.contentWindow?.Array.from||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var qo=hG();function Vo(t={}){let{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,unblockSelector:a=null,ignoreClass:s="rr-ignore",ignoreSelector:l=null,maskAllText:c=!1,maskTextClass:d="rr-mask",unmaskTextClass:u=null,maskTextSelector:p=null,unmaskTextSelector:f=null,inlineStylesheet:m=!0,maskAllInputs:_,maskInputOptions:v,slimDOMOptions:h,maskAttributeFn:y,maskInputFn:S,maskTextFn:E,maxCanvasSize:R=null,packFn:C,sampling:I={},dataURLOptions:L={},mousemoveWait:z,recordDOM:U=!0,recordCanvas:D=!1,recordCrossOriginIframes:N=!1,recordAfter:B=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:V=!1,collectFonts:st=!1,inlineImages:nt=!1,plugins:lt,keepIframeSrcFn:X=()=>!1,ignoreCSSAttributes:ct=new Set([]),errorHandler:F,onMutation:gt,getCanvasManager:J}=t;WG(F);let dt=N?window.parent===window:!0,Xt=!1;if(!dt)try{window.parent.document&&(Xt=!1)}catch{Xt=!0}if(dt&&!e)throw new Error("emit function is required");if(!dt&&!Xt)return()=>{};z!==void 0&&I.mousemove===void 0&&(I.mousemove=z),qo.reset();let Ce=_===!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}:v!==void 0?v:{},_n=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};$G();let Pn,Z=0,Vt=ut=>{for(let Ft of lt||[])Ft.eventProcessor&&(ut=Ft.eventProcessor(ut));return C&&!Xt&&(ut=C(ut)),ut};qe=(ut,Ft)=>{let yt=ut;if(yt.timestamp=Ob(),Nu[0]?.isFrozen()&&yt.type!==$t.FullSnapshot&&!(yt.type===$t.IncrementalSnapshot&&yt.data.source===Rt.Mutation)&&Nu.forEach(kt=>kt.unfreeze()),dt)e?.(Vt(yt),Ft);else if(Xt){let kt={type:"rrweb",event:Vt(yt),origin:window.location.origin,isCheckout:Ft};window.parent.postMessage(kt,"*")}if(yt.type===$t.FullSnapshot)Pn=yt,Z=0;else if(yt.type===$t.IncrementalSnapshot){if(yt.data.source===Rt.Mutation&&yt.data.isAttachIframe)return;Z++;let kt=r&&Z>=r,bt=n&&Pn&&yt.timestamp-Pn.timestamp>n;(kt||bt)&&dn(!0)}};let Ut=ut=>{qe({type:$t.IncrementalSnapshot,data:{source:Rt.Mutation,...ut}})},ft=ut=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.Scroll,...ut}}),te=ut=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.CanvasMutation,...ut}}),mt=ut=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.AdoptedStyleSheet,...ut}}),oe=new yE({mutationCb:Ut,adoptedStyleSheetCb:mt}),Qt=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new mE:new gE({mirror:qo,mutationCb:Ut,stylesheetManager:oe,recordCrossOriginIframes:N,wrappedEmit:qe});for(let ut of lt||[])ut.getMirror&&ut.getMirror({nodeMirror:qo,crossOriginIframeMirror:Qt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Qt.crossOriginIframeStyleMirror});let cn=new _E,un=d$(J,{mirror:qo,win:window,mutationCb:ut=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.CanvasMutation,...ut}}),recordCanvas:D,blockClass:o,blockSelector:i,unblockSelector:a,maxCanvasSize:R,sampling:I.canvas,dataURLOptions:L,errorHandler:F}),He=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new hE:new bE({mutationCb:Ut,scrollCb:ft,bypassOptions:{onMutation:gt,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskInputOptions:Ce,dataURLOptions:L,maskAttributeFn:y,maskTextFn:E,maskInputFn:S,recordCanvas:D,inlineImages:nt,sampling:I,slimDOMOptions:_n,iframeManager:Qt,stylesheetManager:oe,canvasManager:un,keepIframeSrcFn:X,processedNodeManager:cn,ignoreCSSAttributes:ct},mirror:qo}),dn=(ut=!1)=>{if(!U)return;qe({type:$t.Meta,data:{href:window.location.href,width:FC(),height:zC()}},ut),oe.reset(),He.init(),Nu.forEach(yt=>yt.lock());let Ft=HG(document,{mirror:qo,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskAllInputs:Ce,maskAttributeFn:y,maskInputFn:S,maskTextFn:E,slimDOM:_n,dataURLOptions:L,recordCanvas:D,inlineImages:nt,onSerialize:yt=>{$C(yt,qo)&&Qt.addIframe(yt),jC(yt,qo)&&oe.trackLinkElement(yt),lE(yt)&&He.addShadowRoot(yt.shadowRoot,document)},onIframeLoad:(yt,kt)=>{Qt.attachIframe(yt,kt);let bt=sp(yt);bt&&un.addWindow(bt),He.observeAttachShadow(yt)},onStylesheetLoad:(yt,kt)=>{oe.attachLinkElement(yt,kt)},onBlockedImageLoad:(yt,kt,{width:bt,height:K})=>{Ut({adds:[],removes:[],texts:[],attributes:[{id:kt.id,attributes:{style:{width:`${bt}px`,height:`${K}px`}}}]})},keepIframeSrcFn:X,ignoreCSSAttributes:ct});if(!Ft)return console.warn("Failed to snapshot the document");qe({type:$t.FullSnapshot,data:{node:Ft,initialOffset:PC(window)}}),Nu.forEach(yt=>yt.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&oe.adoptStyleSheets(document.adoptedStyleSheets,qo.getId(document))};Ub=dn;try{let ut=[],Ft=kt=>ee(c$)({onMutation:gt,mutationCb:Ut,mousemoveCb:(bt,K)=>qe({type:$t.IncrementalSnapshot,data:{source:K,positions:bt}}),mouseInteractionCb:bt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.MouseInteraction,...bt}}),scrollCb:ft,viewportResizeCb:bt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.ViewportResize,...bt}}),inputCb:bt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.Input,...bt}}),mediaInteractionCb:bt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.MediaInteraction,...bt}}),styleSheetRuleCb:bt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.StyleSheetRule,...bt}}),styleDeclarationCb:bt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.StyleDeclaration,...bt}}),canvasMutationCb:te,fontCb:bt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.Font,...bt}}),selectionCb:bt=>{qe({type:$t.IncrementalSnapshot,data:{source:Rt.Selection,...bt}})},customElementCb:bt=>{qe({type:$t.IncrementalSnapshot,data:{source:Rt.CustomElement,...bt}})},blockClass:o,ignoreClass:s,ignoreSelector:l,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,maskInputOptions:Ce,inlineStylesheet:m,sampling:I,recordDOM:U,recordCanvas:D,inlineImages:nt,userTriggeredOnInput:V,collectFonts:st,doc:kt,maskAttributeFn:y,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:X,blockSelector:i,unblockSelector:a,slimDOMOptions:_n,dataURLOptions:L,mirror:qo,iframeManager:Qt,stylesheetManager:oe,shadowDomManager:He,processedNodeManager:cn,canvasManager:un,ignoreCSSAttributes:ct,plugins:lt?.filter(bt=>bt.observer)?.map(bt=>({observer:bt.observer,options:bt.options,callback:K=>qe({type:$t.Plugin,data:{plugin:bt.name,payload:K}})}))||[]},{});Qt.addLoadListener(kt=>{try{ut.push(Ft(kt.contentDocument))}catch(bt){console.warn(bt)}});let yt=()=>{dn(),ut.push(Ft(document))};return document.readyState==="interactive"||document.readyState==="complete"?yt():(ut.push(nr("DOMContentLoaded",()=>{qe({type:$t.DomContentLoaded,data:{}}),B==="DOMContentLoaded"&&yt()})),ut.push(nr("load",()=>{qe({type:$t.Load,data:{}}),B==="load"&&yt()},window))),()=>{ut.forEach(kt=>kt()),cn.destroy(),Ub=void 0,KG()}}catch(ut){console.warn(ut)}}function u$(t){if(!Ub)throw new Error("please take full snapshot after start recording");Ub(t)}Vo.mirror=qo;Vo.takeFullSnapshot=u$;function d$(t,e){try{return t?t(e):new Db}catch{return console.warn("Unable to initialize CanvasManager"),new Db}}var _C;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(_C||(_C={}));var f$=3,p$=5;function BE(t){return t>9999999999?t:t*1e3}function eE(t){return t>9999999999?t/1e3:t}function pp(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:$t.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:ue(e,10,1e3)}}),e.category==="console")))}var m$="button,a";function JC(t){return t.closest(m$)||t}function QC(t){let e=ZC(t);return!e||!(e instanceof Element)?e:JC(e)}function ZC(t){return g$(t)?t.target:t}function g$(t){return typeof t=="object"&&!!t&&"target"in t}var Qa;function h$(t){return Qa||(Qa=[],b$()),Qa.push(t),()=>{let e=Qa?Qa.indexOf(t):-1;e>-1&&Qa.splice(e,1)}}function b$(){be(we,"open",function(t){return function(...e){if(Qa)try{Qa.forEach(n=>n())}catch{}return t.apply(we,e)}})}var y$=new Set([Rt.Mutation,Rt.StyleSheetRule,Rt.StyleDeclaration,Rt.AdoptedStyleSheet,Rt.CanvasMutation,Rt.Selection,Rt.MediaInteraction]);function _$(t,e,n){t.handleClick(e,n)}var vE=class{constructor(e,n,r=pp){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=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){let e=h$(()=>{this._lastMutation=vC()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(S$(n,this._ignoreSelector)||!E$(e))return;let r={timestamp:eE(e.timestamp),clickBreadcrumb:e,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(e=Date.now()){this._lastMutation=eE(e)}registerScroll(e=Date.now()){this._lastScroll=eE(e)}registerClick(e){let n=JC(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){let e=[],n=vC();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&&e.push(r)});for(let r of e){let o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,o=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!r&&!o,{clickCount:a,clickBreadcrumb:s}=e;if(i){let l=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,c=l<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.slowClickDetected",data:{...s.data,url:we.location.href,route:n.getCurrentRoute(),timeAfterClickMs:l,endReason:c,clickCount:a||1}};this._addBreadcrumbEvent(n,d);return}if(a>1){let l={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.multiClick",data:{...s.data,url:we.location.href,route:n.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=yl(()=>this._checkClicks(),1e3)}},v$=["A","BUTTON","INPUT"];function S$(t,e){return!!(!v$.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function E$(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function vC(){return Date.now()/1e3}function T$(t,e){try{if(!w$(e))return;let{source:n}=e.data;if(y$.has(n)&&t.registerMutation(e.timestamp),n===Rt.Scroll&&t.registerScroll(e.timestamp),x$(e)){let{type:r,id:o}=e.data,i=Vo.mirror.getNode(o);i instanceof HTMLElement&&r===er.Click&&t.registerClick(i)}}catch{}}function w$(t){return t.type===f$}function x$(t){return t.data.source===Rt.MouseInteraction}function vi(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var Yb=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(Yb||{}),A$=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function k$(t){let e={};!t["data-sentry-component"]&&t["data-sentry-element"]&&(t["data-sentry-component"]=t["data-sentry-element"]);for(let n in t)if(A$.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}var I$=t=>e=>{if(!t.isEnabled())return;let n=R$(e);if(!n)return;let r=e.name==="click",o=r?e.event:void 0;r&&t.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&_$(t.clickDetector,n,QC(e.event)),pp(t,n)};function t2(t,e){let n=Vo.mirror.getId(t),r=n&&Vo.mirror.getNode(n),o=r&&Vo.mirror.getMeta(r),i=o&&C$(o)?o:null;return{message:e,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(a=>a.type===Yb.Text&&a.textContent).filter(Boolean).map(a=>a.trim()).join(""),attributes:k$(i.attributes)}}:{}}}function R$(t){let{target:e,message:n}=N$(t);return vi({category:`ui.${t.name}`,...t2(e,n)})}function N$(t){let e=t.name==="click",n,r=null;try{r=e?QC(t.event):ZC(t.event),n=pe(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function C$(t){return t.type===Yb.Element}function M$(t,e){if(!t.isEnabled())return;t.updateUserActivity();let n=O$(e);n&&pp(t,n)}function O$(t){let{metaKey:e,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:a}=t;if(!a||D$(a)||!i)return null;let s=e||r||o,l=i.length===1;if(!s&&l)return null;let c=pe(a,{maxStringLength:200})||"<unknown>",d=t2(a,c);return vi({category:"ui.keyDown",message:c,data:{...d.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function D$(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}var L$={resource:F$,paint:P$,navigation:z$};function nE(t,e){return({metric:n})=>void e.replayPerformanceEntries.push(t(n))}function U$(t){return t.map(B$).filter(Boolean)}function B$(t){let e=L$[t.entryType];return e?e(t):null}function Ou(t){return((ne()||we.performance.timeOrigin)+t)/1e3}function P$(t){let{duration:e,entryType:n,name:r,startTime:o}=t,i=Ou(o);return{type:n,name:r,start:i,end:i+e,data:void 0}}function z$(t){let{entryType:e,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:a,domContentLoadedEventStart:s,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:d,loadEventEnd:u,redirectCount:p,startTime:f,transferSize:m,type:_}=t;return o===0?null:{type:`${e}.${_}`,start:Ou(f),end:Ou(i),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:a,duration:o,domInteractive:c,domContentLoadedEventStart:s,domContentLoadedEventEnd:l,loadEventStart:d,loadEventEnd:u,domComplete:i,redirectCount:p}}}function F$(t){let{entryType:e,initiatorType:n,name:r,responseEnd:o,startTime:i,decodedBodySize:a,encodedBodySize:s,responseStatus:l,transferSize:c}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:Ou(i),end:Ou(o),name:r,data:{size:c,statusCode:l,decodedBodySize:a,encodedBodySize:s}}}function H$(t){let e=t.entries[t.entries.length-1],n=e?.element?[e.element]:void 0;return PE(t,"largest-contentful-paint",n)}function G$(t){return t.sources!==void 0}function $$(t){let e=[],n=[];for(let r of t.entries)if(G$(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let a=Vo.mirror.getId(i.node);a&&o.push(a)}e.push({value:r.value,nodeIds:o.length?o:void 0})}return PE(t,"cumulative-layout-shift",n,e)}function j$(t){let e=t.entries[t.entries.length-1],n=e?.target?[e.target]:void 0;return PE(t,"interaction-to-next-paint",n)}function PE(t,e,n,r){let o=t.value,i=t.rating,a=Ou(o);return{type:"web-vital",name:e,start:a,end:a,data:{value:o,size:o,rating:i,nodeIds:n?n.map(s=>Vo.mirror.getId(s)):void 0,attributions:r}}}function q$(t){function e(o){t.performanceEntries.includes(o)||t.performanceEntries.push(o)}function n({entries:o}){o.forEach(e)}let r=[];return["navigation","paint","resource"].forEach(o=>{r.push(hr(o,n))}),r.push(Vi(nE(H$,t)),qi(nE($$,t)),pl(nE(j$,t))),()=>{r.forEach(o=>o())}}var Tt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,V$='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 Y$(){let t=new Blob([V$]);return URL.createObjectURL(t)}var SC=["log","warn","error"],Ib="[Replay] ";function rE(t,e="info"){wn({category:"console",data:{logger:"replay"},level:e,message:`${Ib}${t}`},{level:e})}function W$(){let t=!1,e=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{t=!!r.captureExceptions,e=!!r.traceInternals}};return Tt?(SC.forEach(r=>{n[r]=(...o)=>{w[r](Ib,...o),e&&rE(o.join(""),Hi(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),w.error(Ib,r),t?Et(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):e&&rE(r,"error")},n.infoTick=(...r)=>{w.log(Ib,...r),e&&setTimeout(()=>rE(r[0]),0)}):SC.forEach(r=>{n[r]=()=>{}}),n}var wt=W$(),cp=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${CE}.`)}},Bb=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(e){let n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>CE)throw new cp;this.events.push(e)}finish(){return new Promise(e=>{let n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(let{timestamp:n}of this.events)(e===null||n<e)&&(e=n);return e===null?e:BE(e)}},SE=class{constructor(e){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){Tt&&wt.error("Error in compression worker: ",r.response),o.reject(new Error("Error in compression worker"));return}o.resolve(r.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():(Tt&&wt.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{Tt&&wt.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(){Tt&&wt.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(e=>e.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(e,n){let r=this._getAndIncrementId();return new Promise((o,i)=>{this._pending.set(r,{method:e,resolve:o,reject:i});try{this._worker.postMessage({id:r,method:e,arg:n})}catch(a){this._pending.delete(r),i(a)}})}_getAndIncrementId(){return this._id++}},EE=class{constructor(e){this._worker=new SE(e),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(e){let n=BE(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>CE?Promise.reject(new cp):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{Tt&&wt.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){let e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}},TE=class{constructor(e){this._fallback=new Bb,this._compression=new EE(e),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(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){Tt&&wt.exception(e,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(let i of e)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){Tt&&wt.exception(i,"Failed to add events when switching buffers.")}}};function K$({useCompression:t,workerUrl:e}){if(t&&window.Worker){let n=X$(e);if(n)return n}return Tt&&wt.log("Using simple buffer"),new Bb}function X$(t){try{let e=t||J$();if(!e)return;Tt&&wt.log(`Using compression worker${t?` from ${t}`:""}`);let n=new Worker(e);return new TE(n)}catch(e){Tt&&wt.exception(e,"Failed to create compression worker")}}function J$(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Y$():""}function zE(){try{return"sessionStorage"in we&&!!we.sessionStorage}catch{return!1}}function Q$(t){Z$(),t.session=void 0}function Z$(){if(zE())try{we.sessionStorage.removeItem(RE)}catch{}}function e2(t){return t===void 0?!1:Math.random()<t}function Wb(t){if(zE())try{we.sessionStorage.setItem(RE,JSON.stringify(t))}catch{}}function n2(t){let e=Date.now(),n=t.id||ae(),r=t.started||e,o=t.lastActivity||e,i=t.segmentId||0,a=t.sampled,s=t.previousSessionId,l=t.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:i,sampled:a,previousSessionId:s,dirty:l}}function tj(t,e){return e2(t)?"session":e?"buffer":!1}function EC({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){let o=tj(t,e),i=n2({sampled:o,previousSessionId:r});return n&&Wb(i),i}function ej(){if(!zE())return null;try{let t=we.sessionStorage.getItem(RE);if(!t)return null;let e=JSON.parse(t);return Tt&&wt.infoTick("Loading existing session"),n2(e)}catch{return null}}function wE(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function nj(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return wE(t.started,e,r)||wE(t.lastActivity,n,r)}function Pb(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!nj(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function oE({sessionIdleExpire:t,maxReplayDuration:e,previousSessionId:n},r){let o=r.stickySession&&ej();return o?Pb(o,{sessionIdleExpire:t,maxReplayDuration:e})?(Tt&&wt.infoTick("Session in sessionStorage is expired, creating new one..."),EC(r,{previousSessionId:o.id})):o:(Tt&&wt.infoTick("Creating new session"),EC(r,{previousSessionId:n}))}function rj(t){return t.type===$t.Custom}function FE(t,e,n){return o2(t,e)?(r2(t,e,n),!0):!1}function oj(t,e,n){return o2(t,e)?r2(t,e,n):Promise.resolve(null)}async function r2(t,e,n){let{eventBuffer:r}=t;if(!r||r.waitForCheckout&&!n)return null;let o=t.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let i=t.getOptions(),a=ij(e,i.beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(i){let a=i&&i instanceof cp,s=a?"eventBufferOverflow":"eventBufferError",l=P();if(l){let c=a?"buffer_overflow":"internal_sdk_error";l.recordDroppedEvent(c,"replay")}if(a&&o)return r.clear(),r.waitForCheckout=!0,null;t.handleException(i),await t.stop({reason:s})}}function o2(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;let n=BE(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(Tt&&wt.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function ij(t,e){try{if(typeof e=="function"&&rj(t))return e(t)}catch(n){return Tt&&wt.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return t}var aj=100;function i2(t,e){let n=t.getContext();n.traceIds.size<aj&&n.traceIds.add(e)}function sj(t){return e=>{if(!t.isEnabled()||!Tn(e))return;let n=e.spanContext().traceId;n&&i2(t,n)}}function HE(t){return!t.type}function xE(t){return t.type==="transaction"}function lj(t){return t.type==="replay_event"}function TC(t){return t.type==="feedback"}function cj(t){return(e,n)=>{if(!t.isEnabled()||!HE(e)&&!xE(e))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(xE(e)){uj(t,e);return}dj(t,e)}}}function uj(t,e){let n=e.contexts?.trace?.trace_id;n&&i2(t,n)}function dj(t,e){let n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!e.tags?.replayId)return;let{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||yl(async()=>{try{await t.sendBufferedReplayOrFlush()}catch(o){t.handleException(o)}})}function fj(t){return e=>{!t.isEnabled()||!HE(e)||pj(t,e)}}function pj(t,e){let n=e.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=vi({category:"replay.hydrate-error",data:{url:Kn()}});pp(t,r)}}function mj(t){let e=P();e&&e.on("beforeAddBreadcrumb",n=>gj(t,n))}function gj(t,e){if(!t.isEnabled()||!a2(e))return;let n=hj(e);n&&pp(t,n)}function hj(t){return!a2(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui.")?null:t.category==="console"?bj(t):vi(t)}function bj(t){let e=t.data?.arguments;if(!Array.isArray(e)||e.length===0)return vi(t);let n=!1,r=e.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>wb?(n=!0,`${o.slice(0,wb)}\u2026`):o;if(typeof o=="object")try{let i=ue(o,7);return JSON.stringify(i).length>wb?(n=!0,`${JSON.stringify(i,null,2).slice(0,wb)}\u2026`):i}catch{}return o});return vi({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function a2(t){return!!t.category}function yj(t,e){return t.type||!t.exception?.values?.length?!1:!!e.originalException?.__rrweb__}function zb(){let t=rt().getPropagationContext().dsc;t&&delete t.replay_id;let e=Dt();if(e){let n=$e(e);delete n.replay_id}}function wC(t){let e=rt().getPropagationContext().dsc;e&&(e.replay_id=t);let n=Dt();if(n){let r=$e(n);r.replay_id=t}}function _j(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:$t.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function vj(t,e){return t.recordingMode!=="buffer"||e.message===NE||!e.exception||e.type?!1:e2(t.getOptions().errorSampleRate)}function Sj(t){return Object.assign((e,n)=>{if(t.session&&Pb(t.session,{maxReplayDuration:t.getOptions().maxReplayDuration,sessionIdleExpire:t.timeouts.sessionIdleExpire})&&zb(),!t.isEnabled()||t.isPaused())return e;if(lj(e))return delete e.breadcrumbs,e;if(!HE(e)&&!xE(e)&&!TC(e))return e;if(!t.checkAndHandleExpiredSession())return zb(),e;if(TC(e))return t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),_j(t,e),e;if(yj(e,n)&&!t.getOptions()._experiments.captureExceptions)return Tt&&wt.log("Ignoring error from rrweb internals",e),null;let o=vj(t,e);if((o||t.recordingMode==="session")&&(e.tags={...e.tags,replayId:t.getSessionId()}),o&&t.recordingMode==="buffer"&&t.session?.sampled==="buffer"){let a=t.session;a.dirty=!0,t.getOptions().stickySession&&Wb(a)}return e},{id:"Replay"})}function Kb(t,e){return e.map(({type:n,start:r,end:o,name:i,data:a})=>{let s=t.throttledAddEvent({type:$t.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:o,data:a}}});return typeof s=="string"?Promise.resolve(null):s})}function Ej(t){let{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function Tj(t){return e=>{if(!t.isEnabled())return;let n=Ej(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(Kb(t,[n]),!1)))}}function wj(t,e){return Tt&&t.getOptions()._experiments.traceInternals?!1:$c(e,P())}function s2(t,e){t.isEnabled()&&e!==null&&(wj(t,e.name)||t.addUpdate(()=>(Kb(t,[e]),!0)))}function Xb(t){if(!t)return;let e=new TextEncoder;try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){let n=db(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function l2(t){if(!t)return;let e=parseInt(t,10);return isNaN(e)?void 0:e}function Fb(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};let n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function c2(t,e){if(!e)return null;let{startTimestamp:n,endTimestamp:r,url:o,method:i,statusCode:a,request:s,response:l}=e;return{type:t,start:n/1e3,end:r/1e3,name:o,data:{method:i,statusCode:a,request:s,response:l}}}function up(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function Za(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};let r={headers:t,size:e},{body:o,warnings:i}=xj(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function AE(t,e){return Object.entries(t).reduce((n,[r,o])=>{let i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=o),n},{})}function xj(t){if(!t||typeof t!="string")return{body:t};let e=t.length>oC,n=Aj(t);if(e){let r=t.slice(0,oC);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch{}return{body:t}}function Aj(t){let e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function Hb(t,e){let n=kj(t);return tn(n,e)}function kj(t,e=we.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(we.location.origin))return t;let n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;let r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function Ij(t,e,n){try{let r=await Nj(t,e,n),o=c2("resource.fetch",r);s2(n.replay,o)}catch(r){Tt&&wt.exception(r,"Failed to capture fetch breadcrumb")}}function Rj(t,e){let{input:n,response:r}=e,o=n?vu(n):void 0,i=Xb(o),a=r?l2(r.headers.get("content-length")):void 0;i!==void 0&&(t.data.request_body_size=i),a!==void 0&&(t.data.response_body_size=a)}async function Nj(t,e,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r}=e,{url:a,method:s,status_code:l=0,request_body_size:c,response_body_size:d}=t.data,u=Hb(a,n.networkDetailAllowUrls)&&!Hb(a,n.networkDetailDenyUrls),p=u?Cj(n,e.input,c):up(c),f=await Mj(u,n,e.response,d);return{startTimestamp:o,endTimestamp:i,url:a,method:s,statusCode:l,request:p,response:f}}function Cj({networkCaptureBodies:t,networkRequestHeaders:e},n,r){let o=n?Lj(n,e):{};if(!t)return Za(o,r,void 0);let i=vu(n),[a,s]=vl(i,wt),l=Za(o,r,a);return s?Fb(l,s):l}async function Mj(t,{networkCaptureBodies:e,networkResponseHeaders:n},r,o){if(!t&&o!==void 0)return up(o);let i=r?u2(r.headers,n):{};if(!r||!e&&o!==void 0)return Za(i,o,void 0);let[a,s]=await Dj(r),l=Oj(a,{networkCaptureBodies:e,responseBodySize:o,captureDetails:t,headers:i});return s?Fb(l,s):l}function Oj(t,{networkCaptureBodies:e,responseBodySize:n,captureDetails:r,headers:o}){try{let i=t?.length&&n===void 0?Xb(t):n;return r?e?Za(o,i,t):Za(o,i,void 0):up(i)}catch(i){return Tt&&wt.exception(i,"Failed to serialize response body"),Za(o,n,void 0)}}async function Dj(t){let e=Uj(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await Bj(e)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(Tt&&wt.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(Tt&&wt.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function u2(t,e){let n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function Lj(t,e){return t.length===1&&typeof t[0]!="string"?xC(t[0],e):t.length===2?xC(t[1],e):{}}function xC(t,e){if(!t)return{};let n=t.headers;return n?n instanceof Headers?u2(n,e):Array.isArray(n)?{}:AE(n,e):{}}function Uj(t){try{return t.clone()}catch(e){Tt&&wt.exception(e,"Failed to clone response body")}}function Bj(t){return new Promise((e,n)=>{let r=yl(()=>n(new Error("Timeout while trying to read response body")),500);Pj(t).then(o=>e(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function Pj(t){return await t.text()}async function zj(t,e,n){try{let r=Hj(t,e,n),o=c2("resource.xhr",r);s2(n.replay,o)}catch(r){Tt&&wt.exception(r,"Failed to capture xhr breadcrumb")}}function Fj(t,e){let{xhr:n,input:r}=e;if(!n)return;let o=Xb(r),i=n.getResponseHeader("content-length")?l2(n.getResponseHeader("content-length")):jj(n.response,n.responseType);o!==void 0&&(t.data.request_body_size=o),i!==void 0&&(t.data.response_body_size=i)}function Hj(t,e,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r,input:a,xhr:s}=e,{url:l,method:c,status_code:d=0,request_body_size:u,response_body_size:p}=t.data;if(!l)return null;if(!s||!Hb(l,n.networkDetailAllowUrls)||Hb(l,n.networkDetailDenyUrls)){let C=up(u),I=up(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:d,request:C,response:I}}let f=s[tr],m=f?AE(f.request_headers,n.networkRequestHeaders):{},_=AE(Jf(s),n.networkResponseHeaders),[v,h]=n.networkCaptureBodies?vl(a,wt):[void 0],[y,S]=n.networkCaptureBodies?Gj(s):[void 0],E=Za(m,u,v),R=Za(_,p,y);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:d,request:h?Fb(E,h):E,response:S?Fb(R,S):R}}function Gj(t){let e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return $j(t.response,t.responseType)}catch(n){e.push(n)}return Tt&&wt.warn("Failed to get xhr response body",...e),[void 0]}function $j(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&t&&typeof t=="object")return[JSON.stringify(t)];if(!t)return[void 0]}catch(n){return Tt&&wt.exception(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return Tt&&wt.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function jj(t,e){try{let n=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return Xb(n)}catch{return}}function qj(t){let e=P();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:a}=t.getOptions(),s={replay:t,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:a};e&&e.on("beforeAddBreadcrumb",(l,c)=>Vj(s,l,c))}catch{}}function Vj(t,e,n){if(e.data)try{Yj(e)&&Kj(n)&&(Fj(e,n),zj(e,n,t)),Wj(e)&&Xj(n)&&(Rj(e,n),Ij(e,n,t))}catch(r){Tt&&wt.exception(r,"Error when enriching network breadcrumb")}}function Yj(t){return t.category==="xhr"}function Wj(t){return t.category==="fetch"}function Kj(t){return t?.xhr}function Xj(t){return t?.input!==void 0}function Jj(t){let e=P();Xf(I$(t)),Wi(Tj(t)),mj(t),qj(t);let n=Sj(t);Uc(n),e&&(e.on("beforeSendEvent",fj(t)),e.on("afterSendEvent",cj(t)),e.on("createDsc",r=>{let o=t.getSessionId();o&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(r.replay_id=o)}),e.on("afterSegmentSpanEnd",sj(t)),e.on("spanStart",r=>{t.lastActiveSpan=r}),e.on("spanEnd",r=>{t.lastActiveSpan=r}),e.on("beforeSendFeedback",async(r,o)=>{let i=t.getSessionId();o?.includeReplay&&t.isEnabled()&&i&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await t.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),e.on("openFeedbackWidget",async()=>{await t.sendBufferedReplayOrFlush()}))}async function Qj(t){try{return Promise.all(Kb(t,[Zj(we.performance.memory)]))}catch{return[]}}function Zj(t){let{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function tq(t,e,n){return Ev(t,e,{...n,setTimeoutImpl:yl})}var kb=tt.navigator;function eq(){return/iPhone|iPad|iPod/i.test(kb?.userAgent??"")||/Macintosh/i.test(kb?.userAgent??"")&&kb?.maxTouchPoints&&kb?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function nq(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){Tt&&wt.warn("Received replay event after session expired.");return}let o=r||!e;e=!0,rq(n),t.clickDetector&&T$(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&o&&t.setInitialState(),!FE(t,n,o))return!0;if(!o)return!1;let i=t.session;if(iq(t,o),t.recordingMode==="buffer"&&i&&t.eventBuffer&&!i.dirty){let a=t.eventBuffer.getEarliestTimestamp();a&&(Tt&&wt.log(`Updating session start time to earliest event in buffer to ${new Date(a)}`),i.started=a,t.getOptions().stickySession&&Wb(i))}return i?.previousSessionId||t.recordingMode==="session"&&t.flush(),!0})}}function rq(t){let e=t.data;if(!(t.type!==$t.IncrementalSnapshot||!e||typeof e!="object"||!("source"in e)||e.source!==Rt.Mutation||!("attributes"in e)||!Array.isArray(e.attributes)))for(let n of e.attributes){let r=Vo.mirror.getNode(n.id),o=r&&Vo.mirror.getMeta(r);if(o?.type===Yb.Element)for(let[i,a]of Object.entries(n.attributes))a===null?delete o.attributes[i]:o.attributes[i]=a}}function oq(t){let e=t.getOptions();return{type:$t.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function iq(t,e){!e||t.session?.segmentId!==0||FE(t,oq(t),!1)}function aq(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function sq(t,e,n,r){return Le(Rc(t,Fo(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function lq({recordingData:t,headers:e}){let n,r=`${JSON.stringify(e)}
|
|
505
|
-
`;if(typeof t=="string")n=`${r}${t}`;else{let i=new TextEncoder().encode(r);n=new Uint8Array(i.length+t.length),n.set(i),n.set(t,i.length)}return n}async function cq({client:t,scope:e,replayId:n,event:r}){let o=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,i={event_id:n,integrations:o};t.emit("preprocessEvent",r,i);let a=await wf(t.getOptions(),r,i,e,t,Pt());if(!a)return null;t.emit("postprocessEvent",a,i),a.platform=a.platform||"javascript";let s=t.getSdkMetadata(),{name:l,version:c,settings:d}=s?.sdk||{};return a.sdk={...a.sdk,name:l||"sentry.javascript.unknown",version:c||"0.0.0",settings:d},a}async function uq({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:o,session:i}){let a=lq({recordingData:t,headers:{segment_id:n}}),{urls:s,errorIds:l,traceIds:c,initialTimestamp:d}=r,u=P(),p=rt(),f=u?.getTransport(),m=u?.getDsn();if(!u||!f||!m||!i.sampled)return Promise.resolve({});let _={type:K9,replay_start_timestamp:d/1e3,timestamp:o/1e3,error_ids:l,trace_ids:c,urls:s,replay_id:e,segment_id:n,replay_type:i.sampled},v=await cq({scope:p,client:u,replayId:e,event:_});if(!v)return u.recordDroppedEvent("event_processor","replay"),Tt&&wt.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete v.sdkProcessingMetadata;let h=sq(v,a,m,u.getOptions().tunnel),y;try{y=await f.send(h)}catch(E){let R=new Error(NE);try{R.cause=E}catch{}throw R}let S=kf({},y);if(Af(S,"replay"))throw new dp(S);if(typeof y.statusCode=="number"&&(y.statusCode<200||y.statusCode>=300))throw new Gb(y.statusCode);return y}var Gb=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},dp=class extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}},$b=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function d2(t,e={count:0,interval:eG}){let{recordingData:n,onError:r}=t;if(n.length)try{return await uq(t),!0}catch(o){if(o instanceof Gb||o instanceof dp)throw o;if(La("Replays",{_retryCount:e.count}),r&&r(o),e.count>=nG){let i=new Error(`${NE} - max retries exceeded`);try{i.cause=o}catch{}throw i}return e.interval*=++e.count,new Promise((i,a)=>{yl(async()=>{try{await d2(t,e),i(!0)}catch(s){a(s)}},e.interval)})}}var f2="__THROTTLED",dq="__SKIPPED";function fq(t,e,n){let r=new Map,o=s=>{let l=s-n;r.forEach((c,d)=>{d<l&&r.delete(d)})},i=()=>[...r.values()].reduce((s,l)=>s+l,0),a=!1;return(...s)=>{let l=Math.floor(Date.now()/1e3);if(o(l),i()>=e){let d=a;return a=!0,d?dq:f2}a=!1;let c=r.get(l)||0;return r.set(l,c+1),t(...s)}}var kE=class{constructor({options:e,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:X9,sessionIdleExpire:J9},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=e,this._debouncedFlush=tq(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=fq((a,s)=>oj(this,a,s),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(rG,r),timeout:r,scrollTimeout:oG,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new vE(this,i)),Tt){let a=e._experiments;wt.setConfig({captureExceptions:!!a.captureExceptions,traceInternals:!!a.traceInternals})}this._handleVisibilityChange=()=>{we.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let a=vi({category:"ui.blur"});this._doChangeToBackgroundTasks(a)},this._handleWindowFocus=()=>{let a=vi({category:"ui.focus"});this._doChangeToForegroundTasks(a)},this._handleKeyboardEvent=a=>{M$(this,a)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){Tt&&wt.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(e),!this.session){Tt&&wt.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",Tt&&wt.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){Tt&&wt.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){Tt&&wt.log("Buffering is in progress, call `flush()` to save the replay");return}Tt&&wt.infoTick("Starting replay in session mode"),this._updateUserActivity();let e=oE({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){Tt&&wt.log("Buffering is in progress, call `flush()` to save the replay");return}Tt&&wt.infoTick("Starting replay in buffer mode");let e=oE({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{let e=this._canvas;this._stopRecording=Vo({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:tG}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:nq(this),...eq(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";let r=n??"manual";P()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{Tt&&wt.log(`Stopping Replay triggered by ${r}`),zb(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Q$(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Tt&&wt.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Tt&&wt.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();Tt&&wt.log("Converting buffer to session"),await this.flushImmediate();let r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),wC(this.session.id)),this.startRecording())}addUpdate(e){let n=e();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(e){if(!(e&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&wE(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${we.location.pathname}${we.location.hash}${we.location.search}`,n=`${we.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){let r=this._throttledAddEvent(e,n);if(r===f2){let o=vi({category:"replay.throttled"});this.addUpdate(()=>!FE(this,{type:p$,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let e=this.lastActiveSpan||Dt(),n=e&&Bt(e),o=(n&&et(n).data||{})[Ot];if(!(!n||!o||!["route","custom"].includes(o)))return et(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=K$({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&P()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&wC(this.session.id)}_initializeSessionForSampling(e){let n=this._options.errorSampleRate>0,r=oE({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;let e=this.session;return Pb(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(e.id))}_addListeners(){try{we.document.addEventListener("visibilitychange",this._handleVisibilityChange),we.addEventListener("blur",this._handleWindowBlur),we.addEventListener("focus",this._handleWindowFocus),we.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Jj(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=q$(this)}_removeListeners(){try{we.document.removeEventListener("visibilitychange",this._handleVisibilityChange),we.removeEventListener("blur",this._handleWindowBlur),we.removeEventListener("focus",this._handleWindowFocus),we.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(!this.session)return;if(Pb(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){zb();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){Tt&&wt.log("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:$t.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=U$(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let n=this._context.initialTimestamp/1e3;e=e.filter(r=>r.start>=n)}return Promise.all(Kb(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:n}=this;if(!e||!n||this._requiresManualStart||e.segmentId)return;let r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){Tt&&wt.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await Qj(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new $b;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await d2({replayId:e,recordingData:i,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:a=>this.handleException(a)})}catch(n){this.handleException(n),this.stop({reason:"sendError"});let r=P();if(r){let o;n instanceof dp?o="ratelimit_backoff":n instanceof $b?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){Tt&&wt.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,a=o>this._options.maxReplayDuration+5e3;if(i||a){Tt&&wt.log(`Session duration (${Math.floor(o/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}let s=this.eventBuffer;s&&this.session.segmentId===0&&!s.hasCheckout&&Tt&&wt.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&&Wb(this.session)}_onMutationHandler(e){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&e.some(s=>{let l=aq(s.target),c=n.join(",");return l?.matches(c)}))return!1;let r=e.length,o=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,a=o&&r>o;if(r>i||a){let s=vi({category:"replay.mutations",data:{count:r,limit:a}});this._createCustomBreadcrumb(s)}return a?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function tp(t,e){return[...t,...e].join(",")}function pq({mask:t,unmask:e,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],a=tp(t,[".sentry-mask","[data-sentry-mask]"]),s=tp(e,[]);return{maskTextSelector:a,unmaskTextSelector:s,blockSelector:tp(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:tp(r,[]),ignoreSelector:tp(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function mq({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:o,value:i}){if(o.unmaskTextSelector&&t.matches(o.unmaskTextSelector))return i;let a=n.includes(e),s=r&&e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"");return a||s?i.replace(/[\S]/g,"*"):i}var AC='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',gq=["content-length","content-type","accept"],hq=Symbol.for("sentry__originalRequestBody"),kC=!1,IC=!1;function bq(){if(typeof Request>"u"||IC)return;let t=Request;try{let e=function(n,r){let o=new t(n,r);return r?.body!=null&&(o[hq]=r.body),o};e.prototype=t.prototype,tt.Request=e,IC=!0}catch{}}var Jb=(t=>new IE(t)),IE=class{constructor({flushMinDelay:e=Q9,flushMaxDelay:n=Z9,minReplayDuration:r=iG,maxReplayDuration:o=iC,stickySession:i=!0,useCompression:a=!0,workerUrl:s,_experiments:l={},maskAllText:c=!0,maskAllInputs:d=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:p=750,mutationLimit:f=1e4,slowClickTimeout:m=7e3,slowClickIgnoreSelectors:_=[],networkDetailAllowUrls:v=[],networkDetailDenyUrls:h=[],networkCaptureBodies:y=!0,networkRequestHeaders:S=[],networkResponseHeaders:E=[],mask:R=[],maskAttributes:C=["title","placeholder","aria-label"],unmask:I=[],block:L=[],unblock:z=[],ignore:U=[],maskFn:D,beforeAddRecordingEvent:N,beforeErrorSampling:B,onError:V,attachRawBodyFromRequest:st=!1}={}){this.name="Replay";let nt=pq({mask:R,unmask:I,block:L,unblock:z,ignore:U});if(this._recordingOptions={maskAllInputs:d,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:D,maskInputFn:D,maskAttributeFn:(lt,X,ct)=>mq({maskAttributes:C,maskAllText:c,privacyOptions:nt,key:lt,value:X,el:ct}),...nt,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:lt=>{try{lt.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!l.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,aG),maxReplayDuration:Math.min(o,iC),stickySession:i,useCompression:a,workerUrl:s,blockAllMedia:u,maskAllInputs:d,maskAllText:c,mutationBreadcrumbLimit:p,mutationLimit:f,slowClickTimeout:m,slowClickIgnoreSelectors:_,networkDetailAllowUrls:v,networkDetailDenyUrls:h,networkCaptureBodies:y,networkRequestHeaders:RC(S),networkResponseHeaders:RC(E),beforeAddRecordingEvent:N,beforeErrorSampling:B,onError:V,attachRawBodyFromRequest:st,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${AC}`:AC,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Vn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return kC}set _isInitialized(e){kC=e}afterAllSetup(e){!Vn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&bq(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(e){let n=this.getReplayId(!0);n&&(Nr(e,{"sentry.replay_id":n}),this.getRecordingMode()==="buffer"&&Nr(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let n=yq(this._initialOptions,e);this._replay=new kE({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let n=e.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function yq(t,e){let n=e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...t},o=Rr(n.replaysSessionSampleRate),i=Rr(n.replaysOnErrorSampleRate);return o==null&&i==null&&pn(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function RC(t){return[...gq,...t.map(e=>e.toLowerCase())]}function p2(){return P()?.getIntegrationByName("Replay")}var _q=Object.defineProperty,vq=(t,e,n)=>e in t?_q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,m2=(t,e,n)=>vq(t,typeof e!="symbol"?e+"":e,n),$E=class{constructor(){m2(this,"idNodeMap",new Map),m2(this,"nodeMetaMap",new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){let r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){let r=this.getNode(e);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Sq(){return new $E}function Eq(t,e){for(let n=t.classList.length;n--;){let r=t.classList[n];if(e.test(r))return!0}return!1}function jE(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:jE(t.parentNode,e,n,r+1)}function g2(t,e){return n=>{let r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(Eq(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}var Du=`Please stop import mirror directly. Instead of that,\r
|
|
504
|
+
or you can use record.mirror to access the mirror instance during recording.`,dC={map:{},getId(){return console.error(xu),-1},getNode(){return console.error(xu),null},removeNodeFromMap(){console.error(xu)},has(){return console.error(xu),!1},reset(){console.error(xu)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(dC=new Proxy(dC,{get(t,e,n){return e==="map"&&console.error(xu),Reflect.get(t,e,n)}}));function ap(t,e,n={}){let r=null,o=0;return function(...i){let a=Date.now();!o&&n.leading===!1&&(o=a);let s=e-(a-o),l=this;s<=0||s>e?(r&&(YG(r),r=null),o=a,t.apply(l,i)):!r&&n.trailing!==!1&&(r=Vb(()=>{o=n.leading===!1?0:Date.now(),r=null,t.apply(l,i)},s))}}function BC(t,e,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(a){Vb(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>BC(t,e,i||{},!0)}function DE(t,e,n){try{if(!(e in t))return()=>{};let r=t[e],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=o,()=>{t[e]=r}}catch{return()=>{}}}var Ob=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ob=()=>new Date().getTime());function PC(t){let e=t.document;return{left:e.scrollingElement?e.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:e?.documentElement.scrollLeft||e?.body?.parentElement?.scrollLeft||e?.body?.scrollLeft||0,top:e.scrollingElement?e.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:e?.documentElement.scrollTop||e?.body?.parentElement?.scrollTop||e?.body?.scrollTop||0}}function zC(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function FC(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function HC(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function Ur(t,e,n,r,o){if(!t)return!1;let i=HC(t);if(!i)return!1;let a=Iu(e,n);if(!o){let c=r&&i.matches(r);return a(i)&&!c}let s=Sl(i,a),l=-1;return s<0?!1:(r&&(l=Sl(i,Iu(null,r))),s>-1&&l<0?!0:s<l)}function GG(t,e){return e.getId(t)!==-1}function tE(t,e){return e.getId(t)===ip}function GC(t,e){if(ep(t))return!1;let n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?GC(t.parentNode,e):!0:!0}function sE(t){return!!t.changedTouches}function $G(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let n=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function $C(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function jC(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function lE(t){return!!t?.shadowRoot}var cE=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function qC(t){let e=null;return t.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function jG(t){let e=t,n;for(;n=qC(e);)e=n;return e}function qG(t){let e=t.ownerDocument;if(!e)return!1;let n=jG(t);return e.contains(n)}function VC(t){let e=t.ownerDocument;return e?e.contains(t)||qG(t):!1}var fC={};function LE(t){let e=fC[t];if(e)return e;let n=window.document,r=window[t];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[t]&&(r=i[t]),n.head.removeChild(o)}catch{}return fC[t]=r.bind(window)}function VG(...t){return LE("requestAnimationFrame")(...t)}function Vb(...t){return LE("setTimeout")(...t)}function YG(...t){return LE("clearTimeout")(...t)}var $t=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))($t||{}),Rt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Rt||{}),er=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(er||{}),Ki=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Ki||{}),Au=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Au||{}),rp;function WG(t){rp=t}function KG(){rp=void 0}var ne=t=>rp?((...n)=>{try{return t(...n)}catch(r){if(rp&&rp(r)===!0)return()=>{};throw r}}):t,pC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",XG=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Zf=0;Zf<pC.length;Zf++)XG[pC.charCodeAt(Zf)]=Zf;var Zf,Db=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function UE(t){try{return t.contentDocument}catch{}}function sp(t){try{return t.contentWindow}catch{}}var uE=class{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{let n=new CSSStyleSheet;n.replaceSync(`x { ${e} }`);let r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch{return null}}parseWithDetachedElement(e){let n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",e),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function mC(t){return"__ln"in t}var dE=class{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=n?.next||null;return n}addNode(e){let n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&mC(e.previousSibling)){let r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&mC(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.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(e){let n=e.__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),e.__ln&&delete e.__ln,this.length--)}},gC=(t,e)=>`${t}@${e}`,fE=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=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],n=new Set,r=new dE,o=l=>{let c=l,d=ip;for(;d===ip;)c=c&&c.nextSibling,d=c&&this.mirror.getId(c);return d},i=l=>{if(!l.parentNode||!VC(l))return;let c=ep(l.parentNode)?this.mirror.getId(qC(l)):this.mirror.getId(l.parentNode),d=o(l);if(c===-1||d===-1)return r.addNode(l);let u=Ru(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=>{$C(p,this.mirror)&&!Ur(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),jC(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),lE(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,f)=>{if(Ur(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,f);let m=sp(p);m&&this.canvasManager.addWindow(m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,f)=>{this.stylesheetManager.attachLinkElement(p,f)},onBlockedImageLoad:(p,f,{width:m,height:_})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:f.id,attributes:{style:{width:`${m}px`,height:`${_}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});u&&(e.push({parentId:c,nextId:d,node:u}),n.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)hC(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(let l of this.addedSet)!bC(this.droppedSet,l)&&!hC(this.removes,l,this.mirror)||bC(this.movedSet,l)?i(l):this.droppedSet.add(l);let a=null;for(;r.length;){let l=null;if(a){let c=this.mirror.getId(a.value.parentNode),d=o(a.value);c!==-1&&d!==-1&&(l=a)}if(!l){let c=r.tail;for(;c;){let d=c;if(c=c.previous,d){let u=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(u!==-1){l=d;break}else{let f=d.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=f.parentNode.host;if(this.mirror.getId(m)!==-1){l=d;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),i(l.value)}let s={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 d=JSON.stringify(l.styleDiff),u=JSON.stringify(l._unchangedStyles);d.length<c.style.length&&(d+u).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:e};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.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(s))},this.processMutation=e=>{if(!tE(e.target,this.mirror))switch(e.type){case"characterData":{let n=e.target.textContent;!Ur(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Mu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,HC(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{let n=e.target,r=e.attributeName,o=e.target.getAttribute(r);if(r==="value"){let a=ME(n),s=n.tagName;o=Cb(n,s,a);let l=jb({maskInputOptions:this.maskInputOptions,tagName:s,type:a}),c=Mu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=op({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(Ur(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===e.oldValue)return;let i=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!UE(n))r="rr_src";else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!UC(n.tagName,r)&&(i.attributes[r]=LC(this.doc,Cu(n.tagName),Cu(r),o,n,this.maskAttributeFn),r==="style")){let a=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(let s of Array.from(n.style)){let l=n.style.getPropertyValue(s),c=n.style.getPropertyPriority(s);l!==(a?.getPropertyValue(s)||"")||c!==(a?.getPropertyPriority(s)||"")?c===""?i.styleDiff[s]=l:i.styleDiff[s]=[l,c]:i._unchangedStyles[s]=[l,c]}if(a)for(let s of Array.from(a))n.style.getPropertyValue(s)===""&&(i.styleDiff[s]=!1)}break}case"childList":{if(Ur(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=ep(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Ur(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||tE(n,this.mirror)||!GG(n,this.mirror)||(this.addedSet.has(n)?(pE(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||GC(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[gC(r,o)]?pE(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:ep(e.target)&&np(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(tE(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[gC(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ur(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(r=>this.genAdds(r)),lE(e)&&e.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(n=>{this[n]=e[n]}),this.styleDeclarationParser=new uE(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 pE(t,e){t.delete(e),e.childNodes?.forEach(n=>pE(t,n))}function hC(t,e,n){return t.length===0?!1:JG(t,e,n)}function JG(t,e,n){let r=e.parentNode;for(;r;){let o=n.getId(r);if(t.some(i=>i.id===o))return!0;r=r.parentNode}return!1}function bC(t,e){return t.size===0?!1:YC(t,e)}function YC(t,e){let{parentNode:n}=e;return n?t.has(n)?!0:YC(t,n):!1}var Nu=[];function fp(t){try{if("composedPath"in t){let e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function WC(t,e){let n=new fE;Nu.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver,o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);let i=new r(ne(a=>{t.onMutation&&t.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function QG({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};let o=typeof e.mousemove=="number"?e.mousemove:50,i=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,a=[],s,l=ap(ne(u=>{let p=Date.now()-s;t(a.map(f=>(f.timeOffset-=p,f)),u),a=[],s=null}),i),c=ne(ap(ne(u=>{let p=fp(u),{clientX:f,clientY:m}=sE(u)?u.changedTouches[0]:u;s||(s=Ob()),a.push({x:f,y:m,id:r.getId(p),timeOffset:Ob()-s}),l(typeof DragEvent<"u"&&u instanceof DragEvent?Rt.Drag:u instanceof MouseEvent?Rt.MouseMove:Rt.TouchMove)}),o,{trailing:!1})),d=[nr("mousemove",c,n),nr("touchmove",c,n),nr("drag",c,n)];return ne(()=>{d.forEach(u=>u())})}function ZG({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};let s=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,l=[],c=null,d=u=>p=>{let f=fp(p);if(Ur(f,r,o,i,!0))return;let m=null,_=u;if("pointerType"in p){switch(p.pointerType){case"mouse":m=Ki.Mouse;break;case"touch":m=Ki.Touch;break;case"pen":m=Ki.Pen;break}m===Ki.Touch?er[u]===er.MouseDown?_="TouchStart":er[u]===er.MouseUp&&(_="TouchEnd"):Ki.Pen}else sE(p)&&(m=Ki.Touch);m!==null?(c=m,(_.startsWith("Touch")&&m===Ki.Touch||_.startsWith("Mouse")&&m===Ki.Mouse)&&(m=null)):er[u]===er.Click&&(m=c,c=null);let v=sE(p)?p.changedTouches[0]:p;if(!v)return;let h=n.getId(f),{clientX:y,clientY:S}=v;ne(t)({type:er[_],id:h,x:y,y:S,...m!==null&&{pointerType:m}})};return Object.keys(er).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&s[u]!==!1).forEach(u=>{let p=Cu(u),f=d(u);if(window.PointerEvent)switch(er[u]){case er.MouseDown:case er.MouseUp:p=p.replace("mouse","pointer");break;case er.TouchStart:case er.TouchEnd:return}l.push(nr(p,f,e))}),ne(()=>{l.forEach(u=>u())})}function KC({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:a}){let s=ne(ap(ne(l=>{let c=fp(l);if(!c||Ur(c,r,o,i,!0))return;let d=n.getId(c);if(c===e&&e.defaultView){let u=PC(e.defaultView);t({id:d,x:u.left,y:u.top})}else t({id:d,x:c.scrollLeft,y:c.scrollTop})}),a.scroll||100));return nr("scroll",s,e)}function t$({viewportResizeCb:t},{win:e}){let n=-1,r=-1,o=ne(ap(ne(()=>{let i=zC(),a=FC();(n!==i||r!==a)&&(t({width:Number(a),height:Number(i)}),n=i,r=a)}),200));return nr("resize",o,e)}var e$=["INPUT","TEXTAREA","SELECT"],yC=new WeakMap;function n$({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:a,ignoreSelector:s,maskInputOptions:l,maskInputFn:c,sampling:d,userTriggeredOnInput:u,maskTextClass:p,unmaskTextClass:f,maskTextSelector:m,unmaskTextSelector:_}){function v(k){let L=fp(k),F=k.isTrusted,U=L&&iE(L.tagName);if(U==="OPTION"&&(L=L.parentElement),!L||!U||e$.indexOf(U)<0||Ur(L,r,o,i,!0))return;let D=L;if(D.classList.contains(a)||s&&D.matches(s))return;let N=ME(L),B=Cb(D,U,N),Y=!1,st=jb({maskInputOptions:l,tagName:U,type:N}),ot=Mu(L,p,m,f,_,st);(N==="radio"||N==="checkbox")&&(Y=L.checked),B=op({isMasked:ot,element:L,value:B,maskInputFn:c}),h(L,u?{text:B,isChecked:Y,userTriggered:F}:{text:B,isChecked:Y});let lt=L.name;N==="radio"&<&&Y&&e.querySelectorAll(`input[type="radio"][name="${lt}"]`).forEach(X=>{if(X!==L){let ct=op({isMasked:ot,element:X,value:Cb(X,U,N),maskInputFn:c});h(X,u?{text:ct,isChecked:!Y,userTriggered:!1}:{text:ct,isChecked:!Y})}})}function h(k,L){let F=yC.get(k);if(!F||F.text!==L.text||F.isChecked!==L.isChecked){yC.set(k,L);let U=n.getId(k);ne(t)({...L,id:U})}}let S=(d.input==="last"?["change"]:["input","change"]).map(k=>nr(k,ne(v),e)),E=e.defaultView;if(!E)return()=>{S.forEach(k=>k())};let R=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),C=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return R&&R.set&&S.push(...C.map(k=>BC(k[0],k[1],{set(){ne(v)({target:this,isTrusted:!1})}},!1,E))),ne(()=>{S.forEach(k=>k())})}function Lb(t){let e=[];function n(r,o){if(xb("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||xb("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||xb("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||xb("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let a=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(a)}else if(r.parentStyleSheet){let a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(a)}return o}return n(t,e)}function Ja(t,e,n){let r,o;return t?(t.ownerNode?r=e.getId(t.ownerNode):o=n.getId(t),{styleId:o,id:r}):{}}function r$({styleSheetRuleCb:t,mirror:e,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:ne((d,u,p)=>{let[f,m]=p,{id:_,styleId:v}=Ja(u,e,n.styleMirror);return(_&&_!==-1||v&&v!==-1)&&t({id:_,styleId:v,adds:[{rule:f,index:m}]}),d.apply(u,p)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:ne((d,u,p)=>{let[f]=p,{id:m,styleId:_}=Ja(u,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,removes:[{index:f}]}),d.apply(u,p)})});let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:ne((d,u,p)=>{let[f]=p,{id:m,styleId:_}=Ja(u,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,replace:f}),d.apply(u,p)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:ne((d,u,p)=>{let[f]=p,{id:m,styleId:_}=Ja(u,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,replaceSync:f}),d.apply(u,p)})}));let l={};Ab("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Ab("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Ab("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Ab("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(l).forEach(([d,u])=>{c[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=new Proxy(c[d].insertRule,{apply:ne((p,f,m)=>{let[_,v]=m,{id:h,styleId:y}=Ja(f.parentStyleSheet,e,n.styleMirror);return(h&&h!==-1||y&&y!==-1)&&t({id:h,styleId:y,adds:[{rule:_,index:[...Lb(f),v||0]}]}),p.apply(f,m)})}),u.prototype.deleteRule=new Proxy(c[d].deleteRule,{apply:ne((p,f,m)=>{let[_]=m,{id:v,styleId:h}=Ja(f.parentStyleSheet,e,n.styleMirror);return(v&&v!==-1||h&&h!==-1)&&t({id:v,styleId:h,removes:[{index:[...Lb(f),_]}]}),p.apply(f,m)})})}),ne(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(l).forEach(([d,u])=>{u.prototype.insertRule=c[d].insertRule,u.prototype.deleteRule=c[d].deleteRule})})}function XC({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.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(a){let s=i.set?.call(this,a);if(r!==null&&r!==-1)try{e.adoptStyleSheets(a,r)}catch{}return s}}),ne(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function o$({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:ne((s,l,c)=>{let[d,u,p]=c;if(n.has(d))return i.apply(l,[d,u,p]);let{id:f,styleId:m}=Ja(l.parentRule?.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&t({id:f,styleId:m,set:{property:d,value:u,priority:p},index:Lb(l.parentRule)}),s.apply(l,c)})});let a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:ne((s,l,c)=>{let[d]=c;if(n.has(d))return a.apply(l,[d]);let{id:u,styleId:p}=Ja(l.parentRule?.parentStyleSheet,e,r.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,remove:{property:d},index:Lb(l.parentRule)}),s.apply(l,c)})}),ne(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a})}function i$({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:a}){let s=ne(c=>ap(ne(d=>{let u=fp(d);if(!u||Ur(u,e,n,r,!0))return;let{currentTime:p,volume:f,muted:m,playbackRate:_}=u;t({type:c,id:o.getId(u),currentTime:p,volume:f,muted:m,playbackRate:_})}),i.media||500)),l=[nr("play",s(Au.Play),a),nr("pause",s(Au.Pause),a),nr("seeked",s(Au.Seeked),a),nr("volumechange",s(Au.VolumeChange),a),nr("ratechange",s(Au.RateChange),a)];return ne(()=>{l.forEach(c=>c())})}function a$({fontCb:t,doc:e}){let n=e.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,d){let u=new i(l,c,d);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:d,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};let a=DE(e.fonts,"add",function(s){return function(l){return Vb(ne(()=>{let c=o.get(l);c&&(t(c),o.delete(l))}),0),s.apply(this,[l])}});return r.push(()=>{n.FontFace=i}),r.push(a),ne(()=>{r.forEach(s=>s())})}function s$(t){let{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:a}=t,s=!0,l=ne(()=>{let c=e.getSelection();if(!c||s&&c?.isCollapsed)return;s=c.isCollapsed||!1;let d=[],u=c.rangeCount||0;for(let p=0;p<u;p++){let f=c.getRangeAt(p),{startContainer:m,startOffset:_,endContainer:v,endOffset:h}=f;Ur(m,r,o,i,!0)||Ur(v,r,o,i,!0)||d.push({start:n.getId(m),startOffset:_,end:n.getId(v),endOffset:h})}a({ranges:d})});return l(),nr("selectionchange",l)}function l$({doc:t,customElementCb:e}){let n=t.defaultView;return!n||!n.customElements?()=>{}:DE(n.customElements,"define",function(o){return function(i,a,s){try{e({define:{name:i}})}catch{}return o.apply(this,[i,a,s])}})}function c$(t,e={}){let n=t.doc.defaultView;if(!n)return()=>{};let r;t.recordDOM&&(r=WC(t,t.doc));let o=QG(t),i=ZG(t),a=KC(t),s=t$(t,{win:n}),l=n$(t),c=i$(t),d=()=>{},u=()=>{},p=()=>{},f=()=>{};t.recordDOM&&(d=r$(t,{win:n}),u=XC(t,t.doc),p=o$(t,{win:n}),t.collectFonts&&(f=a$(t)));let m=s$(t),_=l$(t),v=[];for(let h of t.plugins)v.push(h.observer(h.callback,n,h.options));return ne(()=>{Nu.forEach(h=>h.reset()),r?.disconnect(),o(),i(),a(),s(),l(),c(),d(),u(),p(),f(),m(),_(),v.forEach(h=>h())})}function xb(t){return typeof window[t]<"u"}function Ab(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var lp=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,o){let i=r||this.getIdToRemoteIdMap(e),a=o||this.getRemoteIdToIdMap(e),s=i.get(n);return s||(s=this.generateIdFn(),i.set(n,s),a.set(s,n)),s}getIds(e,n){let r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return n.map(i=>this.getId(e,i,r,o))}getRemoteId(e,n,r){let o=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(e,n){let r=this.getRemoteIdToIdMap(e);return n.map(o=>this.getRemoteId(e,o,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}},mE=class{constructor(){this.crossOriginIframeMirror=new lp(OE),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},gE=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new lp(OE),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new lp(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);let n=sp(e);n&&this.crossOriginIframeMap.set(n,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&sp(e)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(e);let r=UE(e);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(e){let n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;let o=this.crossOriginIframeMap.get(e.source);if(!o)return;let i=this.transformCrossOriginEvent(o,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case $t.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);let r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:$t.IncrementalSnapshot,data:{source:Rt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $t.Meta:case $t.Load:case $t.DomContentLoaded:return!1;case $t.Plugin:return n;case $t.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case $t.IncrementalSnapshot:switch(n.data.source){case Rt.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);let o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Rt.Drag:case Rt.TouchMove:case Rt.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Rt.ViewportResize:return!1;case Rt.MediaInteraction:case Rt.MouseInteraction:case Rt.Scroll:case Rt.CanvasMutation:case Rt.Input:return this.replaceIds(n.data,e,["id"]),n;case Rt.StyleSheetRule:case Rt.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case Rt.Font:return n;case Rt.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case Rt.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,e,["styleId"])}),n}}return!1}replace(e,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=e.getIds(r,n[i]):n[i]=e.getId(r,n[i]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==rn.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},hE=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},bE=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!np(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let r=WC({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(KC({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),Vb(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(XC({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){let n=UE(e),r=sp(e);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(e,n){let r=this;this.restoreHandlers.push(DE(e.prototype,"attachShadow",function(o){return function(i){let a=o.call(this,i);return this.shadowRoot&&VC(this)&&r.addShadowRoot(this.shadowRoot,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},yE=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new cE,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of e){let a;this.styleMirror.has(i)?a=this.styleMirror.getId(i):(a=this.styleMirror.add(i),o.push({styleId:a,rules:Array.from(i.rules||CSSRule,(s,l)=>({rule:NC(s),index:l}))})),r.styleIds.push(a)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},_E=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,n){let r=this.nodeMap.get(e);return r&&Array.from(r).some(o=>o!==n)}add(e,n){this.active||(this.active=!0,VG(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}},Ve,Ub;try{if(Array.from([1],t=>t*2)[0]!==2){let t=document.createElement("iframe");document.body.appendChild(t),Array.from=t.contentWindow?.Array.from||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var qo=hG();function Vo(t={}){let{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,unblockSelector:a=null,ignoreClass:s="rr-ignore",ignoreSelector:l=null,maskAllText:c=!1,maskTextClass:d="rr-mask",unmaskTextClass:u=null,maskTextSelector:p=null,unmaskTextSelector:f=null,inlineStylesheet:m=!0,maskAllInputs:_,maskInputOptions:v,slimDOMOptions:h,maskAttributeFn:y,maskInputFn:S,maskTextFn:E,maxCanvasSize:R=null,packFn:C,sampling:k={},dataURLOptions:L={},mousemoveWait:F,recordDOM:U=!0,recordCanvas:D=!1,recordCrossOriginIframes:N=!1,recordAfter:B=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:Y=!1,collectFonts:st=!1,inlineImages:ot=!1,plugins:lt,keepIframeSrcFn:X=()=>!1,ignoreCSSAttributes:ct=new Set([]),errorHandler:H,onMutation:gt,getCanvasManager:J}=t;WG(H);let dt=N?window.parent===window:!0,Xt=!1;if(!dt)try{window.parent.document&&(Xt=!1)}catch{Xt=!0}if(dt&&!e)throw new Error("emit function is required");if(!dt&&!Xt)return()=>{};F!==void 0&&k.mousemove===void 0&&(k.mousemove=F),qo.reset();let Ce=_===!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}:v!==void 0?v:{},_n=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};$G();let Pn,tt=0,Vt=ut=>{for(let Ft of lt||[])Ft.eventProcessor&&(ut=Ft.eventProcessor(ut));return C&&!Xt&&(ut=C(ut)),ut};Ve=(ut,Ft)=>{let yt=ut;if(yt.timestamp=Ob(),Nu[0]?.isFrozen()&&yt.type!==$t.FullSnapshot&&!(yt.type===$t.IncrementalSnapshot&&yt.data.source===Rt.Mutation)&&Nu.forEach(kt=>kt.unfreeze()),dt)e?.(Vt(yt),Ft);else if(Xt){let kt={type:"rrweb",event:Vt(yt),origin:window.location.origin,isCheckout:Ft};window.parent.postMessage(kt,"*")}if(yt.type===$t.FullSnapshot)Pn=yt,tt=0;else if(yt.type===$t.IncrementalSnapshot){if(yt.data.source===Rt.Mutation&&yt.data.isAttachIframe)return;tt++;let kt=r&&tt>=r,bt=n&&Pn&&yt.timestamp-Pn.timestamp>n;(kt||bt)&&dn(!0)}};let Ut=ut=>{Ve({type:$t.IncrementalSnapshot,data:{source:Rt.Mutation,...ut}})},ft=ut=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.Scroll,...ut}}),ee=ut=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.CanvasMutation,...ut}}),mt=ut=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.AdoptedStyleSheet,...ut}}),ie=new yE({mutationCb:Ut,adoptedStyleSheetCb:mt}),Qt=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new mE:new gE({mirror:qo,mutationCb:Ut,stylesheetManager:ie,recordCrossOriginIframes:N,wrappedEmit:Ve});for(let ut of lt||[])ut.getMirror&&ut.getMirror({nodeMirror:qo,crossOriginIframeMirror:Qt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Qt.crossOriginIframeStyleMirror});let cn=new _E,un=d$(J,{mirror:qo,win:window,mutationCb:ut=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.CanvasMutation,...ut}}),recordCanvas:D,blockClass:o,blockSelector:i,unblockSelector:a,maxCanvasSize:R,sampling:k.canvas,dataURLOptions:L,errorHandler:H}),Ge=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new hE:new bE({mutationCb:Ut,scrollCb:ft,bypassOptions:{onMutation:gt,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskInputOptions:Ce,dataURLOptions:L,maskAttributeFn:y,maskTextFn:E,maskInputFn:S,recordCanvas:D,inlineImages:ot,sampling:k,slimDOMOptions:_n,iframeManager:Qt,stylesheetManager:ie,canvasManager:un,keepIframeSrcFn:X,processedNodeManager:cn,ignoreCSSAttributes:ct},mirror:qo}),dn=(ut=!1)=>{if(!U)return;Ve({type:$t.Meta,data:{href:window.location.href,width:FC(),height:zC()}},ut),ie.reset(),Ge.init(),Nu.forEach(yt=>yt.lock());let Ft=HG(document,{mirror:qo,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskAllInputs:Ce,maskAttributeFn:y,maskInputFn:S,maskTextFn:E,slimDOM:_n,dataURLOptions:L,recordCanvas:D,inlineImages:ot,onSerialize:yt=>{$C(yt,qo)&&Qt.addIframe(yt),jC(yt,qo)&&ie.trackLinkElement(yt),lE(yt)&&Ge.addShadowRoot(yt.shadowRoot,document)},onIframeLoad:(yt,kt)=>{Qt.attachIframe(yt,kt);let bt=sp(yt);bt&&un.addWindow(bt),Ge.observeAttachShadow(yt)},onStylesheetLoad:(yt,kt)=>{ie.attachLinkElement(yt,kt)},onBlockedImageLoad:(yt,kt,{width:bt,height:K})=>{Ut({adds:[],removes:[],texts:[],attributes:[{id:kt.id,attributes:{style:{width:`${bt}px`,height:`${K}px`}}}]})},keepIframeSrcFn:X,ignoreCSSAttributes:ct});if(!Ft)return console.warn("Failed to snapshot the document");Ve({type:$t.FullSnapshot,data:{node:Ft,initialOffset:PC(window)}}),Nu.forEach(yt=>yt.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,qo.getId(document))};Ub=dn;try{let ut=[],Ft=kt=>ne(c$)({onMutation:gt,mutationCb:Ut,mousemoveCb:(bt,K)=>Ve({type:$t.IncrementalSnapshot,data:{source:K,positions:bt}}),mouseInteractionCb:bt=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.MouseInteraction,...bt}}),scrollCb:ft,viewportResizeCb:bt=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.ViewportResize,...bt}}),inputCb:bt=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.Input,...bt}}),mediaInteractionCb:bt=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.MediaInteraction,...bt}}),styleSheetRuleCb:bt=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.StyleSheetRule,...bt}}),styleDeclarationCb:bt=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.StyleDeclaration,...bt}}),canvasMutationCb:ee,fontCb:bt=>Ve({type:$t.IncrementalSnapshot,data:{source:Rt.Font,...bt}}),selectionCb:bt=>{Ve({type:$t.IncrementalSnapshot,data:{source:Rt.Selection,...bt}})},customElementCb:bt=>{Ve({type:$t.IncrementalSnapshot,data:{source:Rt.CustomElement,...bt}})},blockClass:o,ignoreClass:s,ignoreSelector:l,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,maskInputOptions:Ce,inlineStylesheet:m,sampling:k,recordDOM:U,recordCanvas:D,inlineImages:ot,userTriggeredOnInput:Y,collectFonts:st,doc:kt,maskAttributeFn:y,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:X,blockSelector:i,unblockSelector:a,slimDOMOptions:_n,dataURLOptions:L,mirror:qo,iframeManager:Qt,stylesheetManager:ie,shadowDomManager:Ge,processedNodeManager:cn,canvasManager:un,ignoreCSSAttributes:ct,plugins:lt?.filter(bt=>bt.observer)?.map(bt=>({observer:bt.observer,options:bt.options,callback:K=>Ve({type:$t.Plugin,data:{plugin:bt.name,payload:K}})}))||[]},{});Qt.addLoadListener(kt=>{try{ut.push(Ft(kt.contentDocument))}catch(bt){console.warn(bt)}});let yt=()=>{dn(),ut.push(Ft(document))};return document.readyState==="interactive"||document.readyState==="complete"?yt():(ut.push(nr("DOMContentLoaded",()=>{Ve({type:$t.DomContentLoaded,data:{}}),B==="DOMContentLoaded"&&yt()})),ut.push(nr("load",()=>{Ve({type:$t.Load,data:{}}),B==="load"&&yt()},window))),()=>{ut.forEach(kt=>kt()),cn.destroy(),Ub=void 0,KG()}}catch(ut){console.warn(ut)}}function u$(t){if(!Ub)throw new Error("please take full snapshot after start recording");Ub(t)}Vo.mirror=qo;Vo.takeFullSnapshot=u$;function d$(t,e){try{return t?t(e):new Db}catch{return console.warn("Unable to initialize CanvasManager"),new Db}}var _C;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(_C||(_C={}));var f$=3,p$=5;function BE(t){return t>9999999999?t:t*1e3}function eE(t){return t>9999999999?t/1e3:t}function pp(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:$t.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:ue(e,10,1e3)}}),e.category==="console")))}var m$="button,a";function JC(t){return t.closest(m$)||t}function QC(t){let e=ZC(t);return!e||!(e instanceof Element)?e:JC(e)}function ZC(t){return g$(t)?t.target:t}function g$(t){return typeof t=="object"&&!!t&&"target"in t}var Qa;function h$(t){return Qa||(Qa=[],b$()),Qa.push(t),()=>{let e=Qa?Qa.indexOf(t):-1;e>-1&&Qa.splice(e,1)}}function b$(){be(we,"open",function(t){return function(...e){if(Qa)try{Qa.forEach(n=>n())}catch{}return t.apply(we,e)}})}var y$=new Set([Rt.Mutation,Rt.StyleSheetRule,Rt.StyleDeclaration,Rt.AdoptedStyleSheet,Rt.CanvasMutation,Rt.Selection,Rt.MediaInteraction]);function _$(t,e,n){t.handleClick(e,n)}var vE=class{constructor(e,n,r=pp){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=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){let e=h$(()=>{this._lastMutation=vC()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,n){if(S$(n,this._ignoreSelector)||!E$(e))return;let r={timestamp:eE(e.timestamp),clickBreadcrumb:e,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(e=Date.now()){this._lastMutation=eE(e)}registerScroll(e=Date.now()){this._lastScroll=eE(e)}registerClick(e){let n=JC(e);this._handleMultiClick(n)}_handleMultiClick(e){this._getClicks(e).forEach(n=>{n.clickCount++})}_getClicks(e){return this._clicks.filter(n=>n.node===e)}_checkClicks(){let e=[],n=vC();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&&e.push(r)});for(let r of e){let o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,o=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!r&&!o,{clickCount:a,clickBreadcrumb:s}=e;if(i){let l=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,c=l<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.slowClickDetected",data:{...s.data,url:we.location.href,route:n.getCurrentRoute(),timeAfterClickMs:l,endReason:c,clickCount:a||1}};this._addBreadcrumbEvent(n,d);return}if(a>1){let l={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.multiClick",data:{...s.data,url:we.location.href,route:n.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=yl(()=>this._checkClicks(),1e3)}},v$=["A","BUTTON","INPUT"];function S$(t,e){return!!(!v$.includes(t.tagName)||t.tagName==="INPUT"&&!["submit","button"].includes(t.getAttribute("type")||"")||t.tagName==="A"&&(t.hasAttribute("download")||t.hasAttribute("target")&&t.getAttribute("target")!=="_self")||e&&t.matches(e))}function E$(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function vC(){return Date.now()/1e3}function T$(t,e){try{if(!w$(e))return;let{source:n}=e.data;if(y$.has(n)&&t.registerMutation(e.timestamp),n===Rt.Scroll&&t.registerScroll(e.timestamp),x$(e)){let{type:r,id:o}=e.data,i=Vo.mirror.getNode(o);i instanceof HTMLElement&&r===er.Click&&t.registerClick(i)}}catch{}}function w$(t){return t.type===f$}function x$(t){return t.data.source===Rt.MouseInteraction}function vi(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var Yb=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(Yb||{}),A$=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function k$(t){let e={};!t["data-sentry-component"]&&t["data-sentry-element"]&&(t["data-sentry-component"]=t["data-sentry-element"]);for(let n in t)if(A$.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}var I$=t=>e=>{if(!t.isEnabled())return;let n=R$(e);if(!n)return;let r=e.name==="click",o=r?e.event:void 0;r&&t.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&_$(t.clickDetector,n,QC(e.event)),pp(t,n)};function t2(t,e){let n=Vo.mirror.getId(t),r=n&&Vo.mirror.getNode(n),o=r&&Vo.mirror.getMeta(r),i=o&&C$(o)?o:null;return{message:e,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(a=>a.type===Yb.Text&&a.textContent).filter(Boolean).map(a=>a.trim()).join(""),attributes:k$(i.attributes)}}:{}}}function R$(t){let{target:e,message:n}=N$(t);return vi({category:`ui.${t.name}`,...t2(e,n)})}function N$(t){let e=t.name==="click",n,r=null;try{r=e?QC(t.event):ZC(t.event),n=pe(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function C$(t){return t.type===Yb.Element}function M$(t,e){if(!t.isEnabled())return;t.updateUserActivity();let n=O$(e);n&&pp(t,n)}function O$(t){let{metaKey:e,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:a}=t;if(!a||D$(a)||!i)return null;let s=e||r||o,l=i.length===1;if(!s&&l)return null;let c=pe(a,{maxStringLength:200})||"<unknown>",d=t2(a,c);return vi({category:"ui.keyDown",message:c,data:{...d.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function D$(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}var L$={resource:F$,paint:P$,navigation:z$};function nE(t,e){return({metric:n})=>void e.replayPerformanceEntries.push(t(n))}function U$(t){return t.map(B$).filter(Boolean)}function B$(t){let e=L$[t.entryType];return e?e(t):null}function Ou(t){return((re()||we.performance.timeOrigin)+t)/1e3}function P$(t){let{duration:e,entryType:n,name:r,startTime:o}=t,i=Ou(o);return{type:n,name:r,start:i,end:i+e,data:void 0}}function z$(t){let{entryType:e,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:a,domContentLoadedEventStart:s,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:d,loadEventEnd:u,redirectCount:p,startTime:f,transferSize:m,type:_}=t;return o===0?null:{type:`${e}.${_}`,start:Ou(f),end:Ou(i),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:a,duration:o,domInteractive:c,domContentLoadedEventStart:s,domContentLoadedEventEnd:l,loadEventStart:d,loadEventEnd:u,domComplete:i,redirectCount:p}}}function F$(t){let{entryType:e,initiatorType:n,name:r,responseEnd:o,startTime:i,decodedBodySize:a,encodedBodySize:s,responseStatus:l,transferSize:c}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:Ou(i),end:Ou(o),name:r,data:{size:c,statusCode:l,decodedBodySize:a,encodedBodySize:s}}}function H$(t){let e=t.entries[t.entries.length-1],n=e?.element?[e.element]:void 0;return PE(t,"largest-contentful-paint",n)}function G$(t){return t.sources!==void 0}function $$(t){let e=[],n=[];for(let r of t.entries)if(G$(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let a=Vo.mirror.getId(i.node);a&&o.push(a)}e.push({value:r.value,nodeIds:o.length?o:void 0})}return PE(t,"cumulative-layout-shift",n,e)}function j$(t){let e=t.entries[t.entries.length-1],n=e?.target?[e.target]:void 0;return PE(t,"interaction-to-next-paint",n)}function PE(t,e,n,r){let o=t.value,i=t.rating,a=Ou(o);return{type:"web-vital",name:e,start:a,end:a,data:{value:o,size:o,rating:i,nodeIds:n?n.map(s=>Vo.mirror.getId(s)):void 0,attributions:r}}}function q$(t){function e(o){t.performanceEntries.includes(o)||t.performanceEntries.push(o)}function n({entries:o}){o.forEach(e)}let r=[];return["navigation","paint","resource"].forEach(o=>{r.push(hr(o,n))}),r.push(Vi(nE(H$,t)),qi(nE($$,t)),pl(nE(j$,t))),()=>{r.forEach(o=>o())}}var Tt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,V$='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 Y$(){let t=new Blob([V$]);return URL.createObjectURL(t)}var SC=["log","warn","error"],Ib="[Replay] ";function rE(t,e="info"){wn({category:"console",data:{logger:"replay"},level:e,message:`${Ib}${t}`},{level:e})}function W$(){let t=!1,e=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{t=!!r.captureExceptions,e=!!r.traceInternals}};return Tt?(SC.forEach(r=>{n[r]=(...o)=>{w[r](Ib,...o),e&&rE(o.join(""),Hi(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),w.error(Ib,r),t?Et(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):e&&rE(r,"error")},n.infoTick=(...r)=>{w.log(Ib,...r),e&&setTimeout(()=>rE(r[0]),0)}):SC.forEach(r=>{n[r]=()=>{}}),n}var wt=W$(),cp=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${CE}.`)}},Bb=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(e){let n=JSON.stringify(e).length;if(this._totalSize+=n,this._totalSize>CE)throw new cp;this.events.push(e)}finish(){return new Promise(e=>{let n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(let{timestamp:n}of this.events)(e===null||n<e)&&(e=n);return e===null?e:BE(e)}},SE=class{constructor(e){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){Tt&&wt.error("Error in compression worker: ",r.response),o.reject(new Error("Error in compression worker"));return}o.resolve(r.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():(Tt&&wt.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{Tt&&wt.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(){Tt&&wt.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(e=>e.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(e,n){let r=this._getAndIncrementId();return new Promise((o,i)=>{this._pending.set(r,{method:e,resolve:o,reject:i});try{this._worker.postMessage({id:r,method:e,arg:n})}catch(a){this._pending.delete(r),i(a)}})}_getAndIncrementId(){return this._id++}},EE=class{constructor(e){this._worker=new SE(e),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(e){let n=BE(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>CE?Promise.reject(new cp):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{Tt&&wt.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){let e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}},TE=class{constructor(e){this._fallback=new Bb,this._compression=new EE(e),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(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){Tt&&wt.exception(e,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(let i of e)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){Tt&&wt.exception(i,"Failed to add events when switching buffers.")}}};function K$({useCompression:t,workerUrl:e}){if(t&&window.Worker){let n=X$(e);if(n)return n}return Tt&&wt.log("Using simple buffer"),new Bb}function X$(t){try{let e=t||J$();if(!e)return;Tt&&wt.log(`Using compression worker${t?` from ${t}`:""}`);let n=new Worker(e);return new TE(n)}catch(e){Tt&&wt.exception(e,"Failed to create compression worker")}}function J$(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Y$():""}function zE(){try{return"sessionStorage"in we&&!!we.sessionStorage}catch{return!1}}function Q$(t){Z$(),t.session=void 0}function Z$(){if(zE())try{we.sessionStorage.removeItem(RE)}catch{}}function e2(t){return t===void 0?!1:Math.random()<t}function Wb(t){if(zE())try{we.sessionStorage.setItem(RE,JSON.stringify(t))}catch{}}function n2(t){let e=Date.now(),n=t.id||ae(),r=t.started||e,o=t.lastActivity||e,i=t.segmentId||0,a=t.sampled,s=t.previousSessionId,l=t.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:i,sampled:a,previousSessionId:s,dirty:l}}function tj(t,e){return e2(t)?"session":e?"buffer":!1}function EC({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){let o=tj(t,e),i=n2({sampled:o,previousSessionId:r});return n&&Wb(i),i}function ej(){if(!zE())return null;try{let t=we.sessionStorage.getItem(RE);if(!t)return null;let e=JSON.parse(t);return Tt&&wt.infoTick("Loading existing session"),n2(e)}catch{return null}}function wE(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function nj(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return wE(t.started,e,r)||wE(t.lastActivity,n,r)}function Pb(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!nj(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function oE({sessionIdleExpire:t,maxReplayDuration:e,previousSessionId:n},r){let o=r.stickySession&&ej();return o?Pb(o,{sessionIdleExpire:t,maxReplayDuration:e})?(Tt&&wt.infoTick("Session in sessionStorage is expired, creating new one..."),EC(r,{previousSessionId:o.id})):o:(Tt&&wt.infoTick("Creating new session"),EC(r,{previousSessionId:n}))}function rj(t){return t.type===$t.Custom}function FE(t,e,n){return o2(t,e)?(r2(t,e,n),!0):!1}function oj(t,e,n){return o2(t,e)?r2(t,e,n):Promise.resolve(null)}async function r2(t,e,n){let{eventBuffer:r}=t;if(!r||r.waitForCheckout&&!n)return null;let o=t.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let i=t.getOptions(),a=ij(e,i.beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(i){let a=i&&i instanceof cp,s=a?"eventBufferOverflow":"eventBufferError",l=z();if(l){let c=a?"buffer_overflow":"internal_sdk_error";l.recordDroppedEvent(c,"replay")}if(a&&o)return r.clear(),r.waitForCheckout=!0,null;t.handleException(i),await t.stop({reason:s})}}function o2(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;let n=BE(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(Tt&&wt.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function ij(t,e){try{if(typeof e=="function"&&rj(t))return e(t)}catch(n){return Tt&&wt.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return t}var aj=100;function i2(t,e){let n=t.getContext();n.traceIds.size<aj&&n.traceIds.add(e)}function sj(t){return e=>{if(!t.isEnabled()||!Tn(e))return;let n=e.spanContext().traceId;n&&i2(t,n)}}function HE(t){return!t.type}function xE(t){return t.type==="transaction"}function lj(t){return t.type==="replay_event"}function TC(t){return t.type==="feedback"}function cj(t){return(e,n)=>{if(!t.isEnabled()||!HE(e)&&!xE(e))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(xE(e)){uj(t,e);return}dj(t,e)}}}function uj(t,e){let n=e.contexts?.trace?.trace_id;n&&i2(t,n)}function dj(t,e){let n=t.getContext();if(e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id),t.recordingMode!=="buffer"||!e.tags?.replayId)return;let{beforeErrorSampling:r}=t.getOptions();typeof r=="function"&&!r(e)||yl(async()=>{try{await t.sendBufferedReplayOrFlush()}catch(o){t.handleException(o)}})}function fj(t){return e=>{!t.isEnabled()||!HE(e)||pj(t,e)}}function pj(t,e){let n=e.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=vi({category:"replay.hydrate-error",data:{url:Kn()}});pp(t,r)}}function mj(t){let e=z();e&&e.on("beforeAddBreadcrumb",n=>gj(t,n))}function gj(t,e){if(!t.isEnabled()||!a2(e))return;let n=hj(e);n&&pp(t,n)}function hj(t){return!a2(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui.")?null:t.category==="console"?bj(t):vi(t)}function bj(t){let e=t.data?.arguments;if(!Array.isArray(e)||e.length===0)return vi(t);let n=!1,r=e.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>wb?(n=!0,`${o.slice(0,wb)}\u2026`):o;if(typeof o=="object")try{let i=ue(o,7);return JSON.stringify(i).length>wb?(n=!0,`${JSON.stringify(i,null,2).slice(0,wb)}\u2026`):i}catch{}return o});return vi({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function a2(t){return!!t.category}function yj(t,e){return t.type||!t.exception?.values?.length?!1:!!e.originalException?.__rrweb__}function zb(){let t=it().getPropagationContext().dsc;t&&delete t.replay_id;let e=Dt();if(e){let n=je(e);delete n.replay_id}}function wC(t){let e=it().getPropagationContext().dsc;e&&(e.replay_id=t);let n=Dt();if(n){let r=je(n);r.replay_id=t}}function _j(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:$t.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function vj(t,e){return t.recordingMode!=="buffer"||e.message===NE||!e.exception||e.type?!1:e2(t.getOptions().errorSampleRate)}function Sj(t){return Object.assign((e,n)=>{if(t.session&&Pb(t.session,{maxReplayDuration:t.getOptions().maxReplayDuration,sessionIdleExpire:t.timeouts.sessionIdleExpire})&&zb(),!t.isEnabled()||t.isPaused())return e;if(lj(e))return delete e.breadcrumbs,e;if(!HE(e)&&!xE(e)&&!TC(e))return e;if(!t.checkAndHandleExpiredSession())return zb(),e;if(TC(e))return t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),_j(t,e),e;if(yj(e,n)&&!t.getOptions()._experiments.captureExceptions)return Tt&&wt.log("Ignoring error from rrweb internals",e),null;let o=vj(t,e);if((o||t.recordingMode==="session")&&(e.tags={...e.tags,replayId:t.getSessionId()}),o&&t.recordingMode==="buffer"&&t.session?.sampled==="buffer"){let a=t.session;a.dirty=!0,t.getOptions().stickySession&&Wb(a)}return e},{id:"Replay"})}function Kb(t,e){return e.map(({type:n,start:r,end:o,name:i,data:a})=>{let s=t.throttledAddEvent({type:$t.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:o,data:a}}});return typeof s=="string"?Promise.resolve(null):s})}function Ej(t){let{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}function Tj(t){return e=>{if(!t.isEnabled())return;let n=Ej(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(Kb(t,[n]),!1)))}}function wj(t,e){return Tt&&t.getOptions()._experiments.traceInternals?!1:$c(e,z())}function s2(t,e){t.isEnabled()&&e!==null&&(wj(t,e.name)||t.addUpdate(()=>(Kb(t,[e]),!0)))}function Xb(t){if(!t)return;let e=new TextEncoder;try{if(typeof t=="string")return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){let n=db(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function l2(t){if(!t)return;let e=parseInt(t,10);return isNaN(e)?void 0:e}function Fb(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};let n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function c2(t,e){if(!e)return null;let{startTimestamp:n,endTimestamp:r,url:o,method:i,statusCode:a,request:s,response:l}=e;return{type:t,start:n/1e3,end:r/1e3,name:o,data:{method:i,statusCode:a,request:s,response:l}}}function up(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function Za(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};let r={headers:t,size:e},{body:o,warnings:i}=xj(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function AE(t,e){return Object.entries(t).reduce((n,[r,o])=>{let i=r.toLowerCase();return e.includes(i)&&t[r]&&(n[i]=o),n},{})}function xj(t){if(!t||typeof t!="string")return{body:t};let e=t.length>oC,n=Aj(t);if(e){let r=t.slice(0,oC);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch{}return{body:t}}function Aj(t){let e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function Hb(t,e){let n=kj(t);return tn(n,e)}function kj(t,e=we.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(we.location.origin))return t;let n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;let r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function Ij(t,e,n){try{let r=await Nj(t,e,n),o=c2("resource.fetch",r);s2(n.replay,o)}catch(r){Tt&&wt.exception(r,"Failed to capture fetch breadcrumb")}}function Rj(t,e){let{input:n,response:r}=e,o=n?vu(n):void 0,i=Xb(o),a=r?l2(r.headers.get("content-length")):void 0;i!==void 0&&(t.data.request_body_size=i),a!==void 0&&(t.data.response_body_size=a)}async function Nj(t,e,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r}=e,{url:a,method:s,status_code:l=0,request_body_size:c,response_body_size:d}=t.data,u=Hb(a,n.networkDetailAllowUrls)&&!Hb(a,n.networkDetailDenyUrls),p=u?Cj(n,e.input,c):up(c),f=await Mj(u,n,e.response,d);return{startTimestamp:o,endTimestamp:i,url:a,method:s,statusCode:l,request:p,response:f}}function Cj({networkCaptureBodies:t,networkRequestHeaders:e},n,r){let o=n?Lj(n,e):{};if(!t)return Za(o,r,void 0);let i=vu(n),[a,s]=vl(i,wt),l=Za(o,r,a);return s?Fb(l,s):l}async function Mj(t,{networkCaptureBodies:e,networkResponseHeaders:n},r,o){if(!t&&o!==void 0)return up(o);let i=r?u2(r.headers,n):{};if(!r||!e&&o!==void 0)return Za(i,o,void 0);let[a,s]=await Dj(r),l=Oj(a,{networkCaptureBodies:e,responseBodySize:o,captureDetails:t,headers:i});return s?Fb(l,s):l}function Oj(t,{networkCaptureBodies:e,responseBodySize:n,captureDetails:r,headers:o}){try{let i=t?.length&&n===void 0?Xb(t):n;return r?e?Za(o,i,t):Za(o,i,void 0):up(i)}catch(i){return Tt&&wt.exception(i,"Failed to serialize response body"),Za(o,n,void 0)}}async function Dj(t){let e=Uj(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await Bj(e)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(Tt&&wt.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(Tt&&wt.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function u2(t,e){let n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function Lj(t,e){return t.length===1&&typeof t[0]!="string"?xC(t[0],e):t.length===2?xC(t[1],e):{}}function xC(t,e){if(!t)return{};let n=t.headers;return n?n instanceof Headers?u2(n,e):Array.isArray(n)?{}:AE(n,e):{}}function Uj(t){try{return t.clone()}catch(e){Tt&&wt.exception(e,"Failed to clone response body")}}function Bj(t){return new Promise((e,n)=>{let r=yl(()=>n(new Error("Timeout while trying to read response body")),500);Pj(t).then(o=>e(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function Pj(t){return await t.text()}async function zj(t,e,n){try{let r=Hj(t,e,n),o=c2("resource.xhr",r);s2(n.replay,o)}catch(r){Tt&&wt.exception(r,"Failed to capture xhr breadcrumb")}}function Fj(t,e){let{xhr:n,input:r}=e;if(!n)return;let o=Xb(r),i=n.getResponseHeader("content-length")?l2(n.getResponseHeader("content-length")):jj(n.response,n.responseType);o!==void 0&&(t.data.request_body_size=o),i!==void 0&&(t.data.response_body_size=i)}function Hj(t,e,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r,input:a,xhr:s}=e,{url:l,method:c,status_code:d=0,request_body_size:u,response_body_size:p}=t.data;if(!l)return null;if(!s||!Hb(l,n.networkDetailAllowUrls)||Hb(l,n.networkDetailDenyUrls)){let C=up(u),k=up(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:d,request:C,response:k}}let f=s[tr],m=f?AE(f.request_headers,n.networkRequestHeaders):{},_=AE(Jf(s),n.networkResponseHeaders),[v,h]=n.networkCaptureBodies?vl(a,wt):[void 0],[y,S]=n.networkCaptureBodies?Gj(s):[void 0],E=Za(m,u,v),R=Za(_,p,y);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:d,request:h?Fb(E,h):E,response:S?Fb(R,S):R}}function Gj(t){let e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return $j(t.response,t.responseType)}catch(n){e.push(n)}return Tt&&wt.warn("Failed to get xhr response body",...e),[void 0]}function $j(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&t&&typeof t=="object")return[JSON.stringify(t)];if(!t)return[void 0]}catch(n){return Tt&&wt.exception(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return Tt&&wt.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function jj(t,e){try{let n=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return Xb(n)}catch{return}}function qj(t){let e=z();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:a}=t.getOptions(),s={replay:t,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:a};e&&e.on("beforeAddBreadcrumb",(l,c)=>Vj(s,l,c))}catch{}}function Vj(t,e,n){if(e.data)try{Yj(e)&&Kj(n)&&(Fj(e,n),zj(e,n,t)),Wj(e)&&Xj(n)&&(Rj(e,n),Ij(e,n,t))}catch(r){Tt&&wt.exception(r,"Error when enriching network breadcrumb")}}function Yj(t){return t.category==="xhr"}function Wj(t){return t.category==="fetch"}function Kj(t){return t?.xhr}function Xj(t){return t?.input!==void 0}function Jj(t){let e=z();Xf(I$(t)),Wi(Tj(t)),mj(t),qj(t);let n=Sj(t);Uc(n),e&&(e.on("beforeSendEvent",fj(t)),e.on("afterSendEvent",cj(t)),e.on("createDsc",r=>{let o=t.getSessionId();o&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(r.replay_id=o)}),e.on("afterSegmentSpanEnd",sj(t)),e.on("spanStart",r=>{t.lastActiveSpan=r}),e.on("spanEnd",r=>{t.lastActiveSpan=r}),e.on("beforeSendFeedback",async(r,o)=>{let i=t.getSessionId();o?.includeReplay&&t.isEnabled()&&i&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await t.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),e.on("openFeedbackWidget",async()=>{await t.sendBufferedReplayOrFlush()}))}async function Qj(t){try{return Promise.all(Kb(t,[Zj(we.performance.memory)]))}catch{return[]}}function Zj(t){let{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function tq(t,e,n){return Ev(t,e,{...n,setTimeoutImpl:yl})}var kb=nt.navigator;function eq(){return/iPhone|iPad|iPod/i.test(kb?.userAgent??"")||/Macintosh/i.test(kb?.userAgent??"")&&kb?.maxTouchPoints&&kb?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function nq(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){Tt&&wt.warn("Received replay event after session expired.");return}let o=r||!e;e=!0,rq(n),t.clickDetector&&T$(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&o&&t.setInitialState(),!FE(t,n,o))return!0;if(!o)return!1;let i=t.session;if(iq(t,o),t.recordingMode==="buffer"&&i&&t.eventBuffer&&!i.dirty){let a=t.eventBuffer.getEarliestTimestamp();a&&(Tt&&wt.log(`Updating session start time to earliest event in buffer to ${new Date(a)}`),i.started=a,t.getOptions().stickySession&&Wb(i))}return i?.previousSessionId||t.recordingMode==="session"&&t.flush(),!0})}}function rq(t){let e=t.data;if(!(t.type!==$t.IncrementalSnapshot||!e||typeof e!="object"||!("source"in e)||e.source!==Rt.Mutation||!("attributes"in e)||!Array.isArray(e.attributes)))for(let n of e.attributes){let r=Vo.mirror.getNode(n.id),o=r&&Vo.mirror.getMeta(r);if(o?.type===Yb.Element)for(let[i,a]of Object.entries(n.attributes))a===null?delete o.attributes[i]:o.attributes[i]=a}}function oq(t){let e=t.getOptions();return{type:$t.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function iq(t,e){!e||t.session?.segmentId!==0||FE(t,oq(t),!1)}function aq(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function sq(t,e,n,r){return Ue(Rc(t,Fo(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function lq({recordingData:t,headers:e}){let n,r=`${JSON.stringify(e)}
|
|
505
|
+
`;if(typeof t=="string")n=`${r}${t}`;else{let i=new TextEncoder().encode(r);n=new Uint8Array(i.length+t.length),n.set(i),n.set(t,i.length)}return n}async function cq({client:t,scope:e,replayId:n,event:r}){let o=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,i={event_id:n,integrations:o};t.emit("preprocessEvent",r,i);let a=await wf(t.getOptions(),r,i,e,t,Pt());if(!a)return null;t.emit("postprocessEvent",a,i),a.platform=a.platform||"javascript";let s=t.getSdkMetadata(),{name:l,version:c,settings:d}=s?.sdk||{};return a.sdk={...a.sdk,name:l||"sentry.javascript.unknown",version:c||"0.0.0",settings:d},a}async function uq({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:o,session:i}){let a=lq({recordingData:t,headers:{segment_id:n}}),{urls:s,errorIds:l,traceIds:c,initialTimestamp:d}=r,u=z(),p=it(),f=u?.getTransport(),m=u?.getDsn();if(!u||!f||!m||!i.sampled)return Promise.resolve({});let _={type:K9,replay_start_timestamp:d/1e3,timestamp:o/1e3,error_ids:l,trace_ids:c,urls:s,replay_id:e,segment_id:n,replay_type:i.sampled},v=await cq({scope:p,client:u,replayId:e,event:_});if(!v)return u.recordDroppedEvent("event_processor","replay"),Tt&&wt.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete v.sdkProcessingMetadata;let h=sq(v,a,m,u.getOptions().tunnel),y;try{y=await f.send(h)}catch(E){let R=new Error(NE);try{R.cause=E}catch{}throw R}let S=kf({},y);if(Af(S,"replay"))throw new dp(S);if(typeof y.statusCode=="number"&&(y.statusCode<200||y.statusCode>=300))throw new Gb(y.statusCode);return y}var Gb=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},dp=class extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}},$b=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function d2(t,e={count:0,interval:eG}){let{recordingData:n,onError:r}=t;if(n.length)try{return await uq(t),!0}catch(o){if(o instanceof Gb||o instanceof dp)throw o;if(La("Replays",{_retryCount:e.count}),r&&r(o),e.count>=nG){let i=new Error(`${NE} - max retries exceeded`);try{i.cause=o}catch{}throw i}return e.interval*=++e.count,new Promise((i,a)=>{yl(async()=>{try{await d2(t,e),i(!0)}catch(s){a(s)}},e.interval)})}}var f2="__THROTTLED",dq="__SKIPPED";function fq(t,e,n){let r=new Map,o=s=>{let l=s-n;r.forEach((c,d)=>{d<l&&r.delete(d)})},i=()=>[...r.values()].reduce((s,l)=>s+l,0),a=!1;return(...s)=>{let l=Math.floor(Date.now()/1e3);if(o(l),i()>=e){let d=a;return a=!0,d?dq:f2}a=!1;let c=r.get(l)||0;return r.set(l,c+1),t(...s)}}var kE=class{constructor({options:e,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:X9,sessionIdleExpire:J9},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=e,this._debouncedFlush=tq(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=fq((a,s)=>oj(this,a,s),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(rG,r),timeout:r,scrollTimeout:oG,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new vE(this,i)),Tt){let a=e._experiments;wt.setConfig({captureExceptions:!!a.captureExceptions,traceInternals:!!a.traceInternals})}this._handleVisibilityChange=()=>{we.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let a=vi({category:"ui.blur"});this._doChangeToBackgroundTasks(a)},this._handleWindowFocus=()=>{let a=vi({category:"ui.focus"});this._doChangeToForegroundTasks(a)},this._handleKeyboardEvent=a=>{M$(this,a)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){Tt&&wt.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(e),!this.session){Tt&&wt.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",Tt&&wt.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){Tt&&wt.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){Tt&&wt.log("Buffering is in progress, call `flush()` to save the replay");return}Tt&&wt.infoTick("Starting replay in session mode"),this._updateUserActivity();let e=oE({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){Tt&&wt.log("Buffering is in progress, call `flush()` to save the replay");return}Tt&&wt.infoTick("Starting replay in buffer mode");let e=oE({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{let e=this._canvas;this._stopRecording=Vo({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:tG}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:nq(this),...eq(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";let r=n??"manual";z()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{Tt&&wt.log(`Stopping Replay triggered by ${r}`),zb(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Q$(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Tt&&wt.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Tt&&wt.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();Tt&&wt.log("Converting buffer to session"),await this.flushImmediate();let r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),wC(this.session.id)),this.startRecording())}addUpdate(e){let n=e();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(e){if(!(e&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&wE(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${we.location.pathname}${we.location.hash}${we.location.search}`,n=`${we.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){let r=this._throttledAddEvent(e,n);if(r===f2){let o=vi({category:"replay.throttled"});this.addUpdate(()=>!FE(this,{type:p$,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let e=this.lastActiveSpan||Dt(),n=e&&Bt(e),o=(n&&rt(n).data||{})[Ot];if(!(!n||!o||!["route","custom"].includes(o)))return rt(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=K$({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&z()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&wC(this.session.id)}_initializeSessionForSampling(e){let n=this._options.errorSampleRate>0,r=oE({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;let e=this.session;return Pb(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(e.id))}_addListeners(){try{we.document.addEventListener("visibilitychange",this._handleVisibilityChange),we.addEventListener("blur",this._handleWindowBlur),we.addEventListener("focus",this._handleWindowFocus),we.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Jj(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=q$(this)}_removeListeners(){try{we.document.removeEventListener("visibilitychange",this._handleVisibilityChange),we.removeEventListener("blur",this._handleWindowBlur),we.removeEventListener("focus",this._handleWindowFocus),we.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(!this.session)return;if(Pb(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){zb();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){Tt&&wt.log("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:$t.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=U$(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let n=this._context.initialTimestamp/1e3;e=e.filter(r=>r.start>=n)}return Promise.all(Kb(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:n}=this;if(!e||!n||this._requiresManualStart||e.segmentId)return;let r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){Tt&&wt.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await Qj(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new $b;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await d2({replayId:e,recordingData:i,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:a=>this.handleException(a)})}catch(n){this.handleException(n),this.stop({reason:"sendError"});let r=z();if(r){let o;n instanceof dp?o="ratelimit_backoff":n instanceof $b?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){Tt&&wt.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,a=o>this._options.maxReplayDuration+5e3;if(i||a){Tt&&wt.log(`Session duration (${Math.floor(o/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}let s=this.eventBuffer;s&&this.session.segmentId===0&&!s.hasCheckout&&Tt&&wt.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&&Wb(this.session)}_onMutationHandler(e){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&e.some(s=>{let l=aq(s.target),c=n.join(",");return l?.matches(c)}))return!1;let r=e.length,o=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,a=o&&r>o;if(r>i||a){let s=vi({category:"replay.mutations",data:{count:r,limit:a}});this._createCustomBreadcrumb(s)}return a?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function tp(t,e){return[...t,...e].join(",")}function pq({mask:t,unmask:e,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],a=tp(t,[".sentry-mask","[data-sentry-mask]"]),s=tp(e,[]);return{maskTextSelector:a,unmaskTextSelector:s,blockSelector:tp(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:tp(r,[]),ignoreSelector:tp(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function mq({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:o,value:i}){if(o.unmaskTextSelector&&t.matches(o.unmaskTextSelector))return i;let a=n.includes(e),s=r&&e==="value"&&t.tagName==="INPUT"&&["submit","button"].includes(t.getAttribute("type")||"");return a||s?i.replace(/[\S]/g,"*"):i}var AC='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',gq=["content-length","content-type","accept"],hq=Symbol.for("sentry__originalRequestBody"),kC=!1,IC=!1;function bq(){if(typeof Request>"u"||IC)return;let t=Request;try{let e=function(n,r){let o=new t(n,r);return r?.body!=null&&(o[hq]=r.body),o};e.prototype=t.prototype,nt.Request=e,IC=!0}catch{}}var Jb=(t=>new IE(t)),IE=class{constructor({flushMinDelay:e=Q9,flushMaxDelay:n=Z9,minReplayDuration:r=iG,maxReplayDuration:o=iC,stickySession:i=!0,useCompression:a=!0,workerUrl:s,_experiments:l={},maskAllText:c=!0,maskAllInputs:d=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:p=750,mutationLimit:f=1e4,slowClickTimeout:m=7e3,slowClickIgnoreSelectors:_=[],networkDetailAllowUrls:v=[],networkDetailDenyUrls:h=[],networkCaptureBodies:y=!0,networkRequestHeaders:S=[],networkResponseHeaders:E=[],mask:R=[],maskAttributes:C=["title","placeholder","aria-label"],unmask:k=[],block:L=[],unblock:F=[],ignore:U=[],maskFn:D,beforeAddRecordingEvent:N,beforeErrorSampling:B,onError:Y,attachRawBodyFromRequest:st=!1}={}){this.name="Replay";let ot=pq({mask:R,unmask:k,block:L,unblock:F,ignore:U});if(this._recordingOptions={maskAllInputs:d,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:D,maskInputFn:D,maskAttributeFn:(lt,X,ct)=>mq({maskAttributes:C,maskAllText:c,privacyOptions:ot,key:lt,value:X,el:ct}),...ot,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:lt=>{try{lt.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!l.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,aG),maxReplayDuration:Math.min(o,iC),stickySession:i,useCompression:a,workerUrl:s,blockAllMedia:u,maskAllInputs:d,maskAllText:c,mutationBreadcrumbLimit:p,mutationLimit:f,slowClickTimeout:m,slowClickIgnoreSelectors:_,networkDetailAllowUrls:v,networkDetailDenyUrls:h,networkCaptureBodies:y,networkRequestHeaders:RC(S),networkResponseHeaders:RC(E),beforeAddRecordingEvent:N,beforeErrorSampling:B,onError:Y,attachRawBodyFromRequest:st,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${AC}`:AC,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Vn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return kC}set _isInitialized(e){kC=e}afterAllSetup(e){!Vn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&bq(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(e){let n=this.getReplayId(!0);n&&(Nr(e,{"sentry.replay_id":n}),this.getRecordingMode()==="buffer"&&Nr(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let n=yq(this._initialOptions,e);this._replay=new kE({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let n=e.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function yq(t,e){let n=e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...t},o=Rr(n.replaysSessionSampleRate),i=Rr(n.replaysOnErrorSampleRate);return o==null&&i==null&&pn(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function RC(t){return[...gq,...t.map(e=>e.toLowerCase())]}function p2(){return z()?.getIntegrationByName("Replay")}var _q=Object.defineProperty,vq=(t,e,n)=>e in t?_q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,m2=(t,e,n)=>vq(t,typeof e!="symbol"?e+"":e,n),$E=class{constructor(){m2(this,"idNodeMap",new Map),m2(this,"nodeMetaMap",new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){let r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){let r=this.getNode(e);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Sq(){return new $E}function Eq(t,e){for(let n=t.classList.length;n--;){let r=t.classList[n];if(e.test(r))return!0}return!1}function jE(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:jE(t.parentNode,e,n,r+1)}function g2(t,e){return n=>{let r=n;if(r===null)return!1;try{if(t){if(typeof t=="string"){if(r.matches(`.${t}`))return!0}else if(Eq(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}var Du=`Please stop import mirror directly. Instead of that,\r
|
|
506
506
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
507
|
-
or you can use record.mirror to access the mirror instance during recording.`,h2={map:{},getId(){return console.error(Du),-1},getNode(){return console.error(Du),null},removeNodeFromMap(){console.error(Du)},has(){return console.error(Du),!1},reset(){console.error(Du)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(h2=new Proxy(h2,{get(t,e,n){return e==="map"&&console.error(Du),Reflect.get(t,e,n)}}));function VE(t,e,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(a){w2(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>VE(t,e,i||{},!0)}function YE(t,e,n){try{if(!(e in t))return()=>{};let r=t[e],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=o,()=>{t[e]=r}}catch{return()=>{}}}Date.now().toString();function Tq(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function ey(t,e,n,r,o){if(!t)return!1;let i=Tq(t);if(!i)return!1;let a=g2(e,n);if(!o){let c=r&&i.matches(r);return a(i)&&!c}let s=jE(i,a),l=-1;return s<0?!1:(r&&(l=jE(i,g2(null,r))),s>-1&&l<0?!0:s<l)}var b2={};function T2(t){let e=b2[t];if(e)return e;let n=window.document,r=window[t];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[t]&&(r=i[t]),n.head.removeChild(o)}catch{}return b2[t]=r.bind(window)}function El(...t){return T2("requestAnimationFrame")(...t)}function w2(...t){return T2("setTimeout")(...t)}var Uu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Uu||{}),Zb;function wq(t){Zb=t}var GE=t=>Zb?((...n)=>{try{return t(...n)}catch(r){if(Zb&&Zb(r)===!0)return()=>{};throw r}}):t,Lu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xq=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(mp=0;mp<Lu.length;mp++)xq[Lu.charCodeAt(mp)]=mp;var mp,Aq=function(t){var e=new Uint8Array(t),n,r=e.length,o="";for(n=0;n<r;n+=3)o+=Lu[e[n]>>2],o+=Lu[(e[n]&3)<<4|e[n+1]>>4],o+=Lu[(e[n+1]&15)<<2|e[n+2]>>6],o+=Lu[e[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},y2=new Map;function kq(t,e){let n=y2.get(t);return n||(n=new Map,y2.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}var x2=(t,e,n)=>{if(!t||!(k2(t,e)||typeof t=="object"))return;let r=t.constructor.name,o=kq(n,r),i=o.indexOf(t);return i===-1&&(i=o.length,o.push(t)),i};function ty(t,e,n){if(t instanceof Array)return t.map(r=>ty(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){let r=t.constructor.name,o=Aq(t);return{rr_type:r,base64:o}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[ty(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){let r=t.constructor.name,{src:o}=t;return{rr_type:r,src:o}}else if(t instanceof HTMLCanvasElement){let r="HTMLImageElement",o=t.toDataURL();return{rr_type:r,src:o}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[ty(t.data,e,n),t.width,t.height]};if(k2(t,e)||typeof t=="object"){let r=t.constructor.name,o=x2(t,e,n);return{rr_type:r,index:o}}}}return t}var A2=(t,e,n)=>t.map(r=>ty(r,e,n)),k2=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof e[o]=="function").find(o=>t instanceof e[o]);function Iq(t,e,n,r,o){let i=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let s of a)try{if(typeof e.CanvasRenderingContext2D.prototype[s]!="function")continue;let l=YE(e.CanvasRenderingContext2D.prototype,s,function(c){return function(...d){return ey(this.canvas,n,r,o,!0)||w2(()=>{let u=A2(d,e,this);t(this.canvas,{type:Uu["2D"],property:s,args:u})},0),c.apply(this,d)}});i.push(l)}catch{let l=VE(e.CanvasRenderingContext2D.prototype,s,{set(c){t(this.canvas,{type:Uu["2D"],property:s,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(s=>s())}}function Rq(t){return t==="experimental-webgl"?"webgl":t}function _2(t,e,n,r,o){let i=[];try{let a=YE(t.HTMLCanvasElement.prototype,"getContext",function(s){return function(l,...c){if(!ey(this,e,n,r,!0)){let d=Rq(l);if("__context"in this||(this.__context=d),o&&["webgl","webgl2"].includes(d))if(c[0]&&typeof c[0]=="object"){let u=c[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[l,...c])}});i.push(a)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(a=>a())}}function v2(t,e,n,r,o,i,a,s){let l=[],c=Object.getOwnPropertyNames(t);for(let d of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof t[d]!="function")continue;let u=YE(t,d,function(p){return function(...f){let m=p.apply(this,f);if(x2(m,s,this),"tagName"in this.canvas&&!ey(this.canvas,r,o,i,!0)){let _=A2(f,s,this),v={type:e,property:d,args:_};n(this.canvas,v)}return m}});l.push(u)}catch{let u=VE(t,d,{set(p){n(this.canvas,{type:e,property:d,args:[p],setter:!0})}});l.push(u)}return l}function Nq(t,e,n,r,o,i){let a=[];return a.push(...v2(e.WebGLRenderingContext.prototype,Uu.WebGL,t,n,r,o,i,e)),typeof e.WebGL2RenderingContext<"u"&&a.push(...v2(e.WebGL2RenderingContext.prototype,Uu.WebGL2,t,n,r,o,i,e)),()=>{a.forEach(s=>s())}}var Cq='for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};';function Mq(){let t=new Blob([Cq]);return URL.createObjectURL(t)}var qE=class{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(s,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(l)};let{enableManualSnapshot:n,sampling:r="all",win:o,recordCanvas:i,errorHandler:a}=e;e.sampling=r,this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,a&&wq(a),(i&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&GE(()=>{i&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof r=="number"&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(e){let{sampling:n="all",blockClass:r,blockSelector:o,unblockSelector:i,recordCanvas:a,enableManualSnapshot:s}=this.options;if(!this.windowsSet.has(e)){if(s){this.windowsSet.add(e),this.windows.push(new WeakRef(e));return}GE(()=>{if(a&&n==="all"&&this.initCanvasMutationObserver(e,r,o,i),a&&typeof n=="number"){let l=_2(e,r,o,i,!0);this.restoreHandlers.push(()=>{l()})}})(),this.windowsSet.add(e),this.windows.push(new WeakRef(e))}}addShadowRoot(e){this.shadowDoms.add(new WeakRef(e))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(e,n){if(n?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,e);return}El(r=>this.takeSnapshot(r,!0,e))}initFPSWorker(){let e=new Worker(Mq());return e.onmessage=n=>{let r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;let{base64:i,type:a,width:s,height:l}=r;this.mutationCb({id:o,type:Uu["2D"],commands:[{property:"clearRect",args:[0,0,s,l]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:a}]},0,0,s,l]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;let n=r=>{this.takeSnapshot(r,!1),e=El(n)};e=El(n),this.restoreHandlers.push(()=>{e&&cancelAnimationFrame(e)})}initCanvasMutationObserver(e,n,r,o){let i=_2(e,n,r,o,!1),a=Iq(this.processMutation.bind(this),e,n,r,o),s=Nq(this.processMutation.bind(this),e,n,r,o,this.mirror);this.restoreHandlers.push(()=>{i(),a(),s()})}getCanvasElements(e,n,r){let o=[],i=a=>{a.querySelectorAll("canvas").forEach(s=>{ey(s,e,n,r,!0)||o.push(s)})};for(let a of this.windows){let s=a.deref(),l;try{l=s&&s.document}catch{}l&&i(l)}for(let a of this.shadowDoms){let s=a.deref();s&&i(s)}return o}takeSnapshot(e,n,r){let{sampling:o,blockClass:i,blockSelector:a,unblockSelector:s,dataURLOptions:l,maxCanvasSize:c}=this.options,u=1e3/(o==="all"?2:o||2);return this.lastSnapshotTime&&e-this.lastSnapshotTime<u?!1:(this.lastSnapshotTime=e,(r?[r]:this.getCanvasElements(i,a,s)).forEach(m=>{let _=this.mirror.getId(m);if(!(!this.mirror.hasNode(m)||!m.width||!m.height||this.snapshotInProgressMap.get(_))){if(this.snapshotInProgressMap.set(_,!0),!n&&["webgl","webgl2"].includes(m.__context)){let v=m.getContext(m.__context);v?.getContextAttributes()?.preserveDrawingBuffer===!1&&v.clear(v.COLOR_BUFFER_BIT)}createImageBitmap(m).then(v=>{this.worker?.postMessage({id:_,bitmap:v,width:m.width,height:m.height,dataURLOptions:l,maxCanvasSize:c},[v])}).catch(v=>{GE(()=>{throw this.snapshotInProgressMap.delete(_),v})()})}}),!0)}startPendingCanvasMutationFlusher(){El(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=n=>{this.rafStamps.latestId=n,El(e)};El(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),El(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;let o=r.map(a=>{let{type:s,...l}=a;return l}),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(e)}};try{if(Array.from([1],t=>t*2)[0]!==2){let t=document.createElement("iframe");document.body.appendChild(t),Array.from=t.contentWindow?.Array.from||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}Sq();var S2;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(S2||(S2={}));var E2={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},Oq="ReplayCanvas",Qb=1280,Dq=((t={})=>{let[e,n]=t.maxCanvasSize||[],r={quality:t.quality||"medium",enableManualSnapshot:t.enableManualSnapshot,maxCanvasSize:[e?Math.min(e,Qb):Qb,n?Math.min(n,Qb):Qb]},o,i,a=new Promise(s=>i=s);return{name:Oq,getOptions(){let{quality:s,enableManualSnapshot:l,maxCanvasSize:c}=r;return{enableManualSnapshot:l,recordCanvas:!0,getCanvasManager:d=>{let u=new qE({...d,enableManualSnapshot:l,maxCanvasSize:c,errorHandler:p=>{try{typeof p=="object"&&(p.__rrweb__=!0)}catch{}}});return o=u,i(u),u},...E2[s]||E2.medium}},async snapshot(s,l){(o||await a).snapshot(s,l)}}}),I2=Dq;function R2(t){return t.split(",").some(e=>e.trim().startsWith("sentry-"))}function WE(t){try{return new URL(t,q.location.origin).href}catch{return}}function N2(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function KE(t){try{return new Headers(t)}catch{return}}var gp={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function ny(t,e){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:s,onRequestSpanEnd:l}={...gp,...e},c=typeof o=="function"?o:f=>!0,d=f=>Uq(f,a),u={},p=t.getOptions().propagateTraceparent;n&&hi(f=>{let m=Lv(f,c,d,u,{propagateTraceparent:p,onRequestSpanEnd:l});if(m){let _=WE(f.fetchData.url),v=_?Zr(_).host:void 0,h=_?Yn(_):void 0;m.setAttributes({"http.url":h,"url.full":h,"server.address":v}),i&&C2(m,t),s?.(m,{headers:f.headers})}}),r&&_l(f=>{let m=Bq(f,c,d,u,p,l);m&&(i&&C2(m,t),s?.(m,{headers:KE(f.xhr.__sentry_xhr_v3__?.request_headers)}))})}var Lq=300;function C2(t,e){let{url:n}=et(t).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(je(e)){let i=t.end.bind(t);t.end=a=>{let s=a??Mt(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(s),clearTimeout(d))};r=c;let d=setTimeout(c,Lq)}}let o=hr("resource",({entries:i})=>{i.forEach(a=>{N2(a)&&a.name.endsWith(n)&&(t.setAttributes(Wf(a)),r())})})}function Uq(t,e){let n=Kn();if(n){let r,o;try{r=new URL(t,n),o=new URL(n).origin}catch{return!1}let i=r.origin===o;return e?tn(r.toString(),e)||i&&tn(r.pathname,e):i}else{let r=!!t.match(/^\/(?!\/)/);return e?tn(t,e):r}}function Bq(t,e,n,r,o,i){let a=t.xhr,s=a?.[tr];if(!a||a.__sentry_own_request__||!s)return;let{url:l,method:c}=s,d=De()&&e(l);if(t.endTimestamp){let S=a.__sentry_xhr_span_id__;if(!S)return;let E=r[S];E&&(d&&s.status_code!==void 0&&(ri(E,s.status_code),E.end(),i?.(E,{headers:KE(Jf(a)),error:t.error})),delete r[S]);return}let u=WE(l),p=u?Zr(u):Zr(l),f=u?Yn(u):void 0,m=Yn(Gc(l)),_=P(),h=!!Dt()||!!_&&je(_),y=d&&h?Ae({name:`${c} ${m}`,attributes:{url:Yn(l),type:"xhr","http.method":c,"http.url":f,"url.full":f,"server.address":p?.host,[at]:"auto.http.browser",[ht]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new ur;return d&&!h&&_?.recordDroppedEvent("no_parent_span","span"),a.__sentry_xhr_span_id__=y.spanContext().spanId,r[a.__sentry_xhr_span_id__]=y,n(l)&&Pq(a,De()&&h?y:void 0,o),_&&_.emit("beforeOutgoingRequestSpan",y,t),y}function Pq(t,e,n){let{"sentry-trace":r,baggage:o,traceparent:i}=el({span:e,propagateTraceparent:n});r&&zq(t,r,o,i)}function zq(t,e,n,r){let o=t.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!t.setRequestHeader))try{if(t.setRequestHeader("sentry-trace",e),r&&!o?.traceparent&&t.setRequestHeader("traceparent",r),n){let i=o?.baggage;(!i||!R2(i))&&t.setRequestHeader("baggage",n)}}catch{}}var M2=new WeakMap,O2=new WeakMap,Fq=9e4,Hq=["text/event-stream","application/x-ndjson","application/stream+json"],ry=()=>({name:"FetchStreamPerformance",setup(){Uh(t=>{if(t.response){let e=M2.get(t.response);if(e&&t.endTimestamp){e.end(t.endTimestamp);let n=O2.get(t.response);n&&clearTimeout(n)}}}),hi(t=>{if(t.endTimestamp&&t.response){let e=t.response.headers?.get("content-type")||"";if(t.response.headers?.get("content-length")||!Hq.some(l=>e.startsWith(l)))return;let n=t.fetchData?.url||"",r=t.fetchData?.method||"GET",o=ui(n),i=n.startsWith("data:")?Yn(n):o?Hc(o):n,a=Ae({name:`${r} ${i}`,startTime:t.endTimestamp,attributes:{url:Yn(n),"http.method":r,type:"fetch",[ht]:"http.client.stream",[at]:"auto.http.browser.stream"}});M2.set(t.response,a);let s=setTimeout(()=>{a.isRecording()&&a.end()},Fq);O2.set(t.response,s)}})}});var XE="WebVitals",oy=(t={})=>{let e=new Set(t.ignore??[]);return{name:XE,setup(n){let r=je(n),{enableStandaloneClsSpans:o,enableStandaloneLcpSpans:i}=t._experiments??{},a=r||e.has("cls")?void 0:o||!1,s=r||e.has("lcp")?void 0:i||!1,l=kS({recordClsStandaloneSpans:a,recordLcpStandaloneSpans:s,client:n}),c=new WeakSet;n.on("afterStartPageLoadSpan",d=>{c.add(d)}),n.on("spanEnd",d=>{c.delete(d)&&(l(),MS(d,{recordClsOnPageloadSpan:a===!1,recordLcpOnPageloadSpan:s===!1,spanStreamingEnabled:r}))}),r?(e.has("lcp")||zS(n),e.has("cls")||FS(n),e.has("inp")||HS()):e.has("inp")||US()},afterAllSetup(){e.has("inp")||BS()}}};function D2(){q.document?q.document.addEventListener("visibilitychange",()=>{let t=Dt();if(!t)return;let e=Bt(t);if(q.document.hidden&&e){let n="cancelled",{op:r,status:o}=et(e);W&&w.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||e.setStatus({code:2,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):W&&w.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Gq=3600,L2="sentry_previous_trace",$q="sentry.previous_trace";function U2(t,{linkPreviousTrace:e,consistentTraceSampling:n}){let r=e==="session-storage",o=r?Vq():void 0;t.on("spanStart",a=>{if(Bt(a)!==a)return;let s=rt().getPropagationContext();o=jq(o,a,s),r&&qq(o)});let i=!0;n&&t.on("beforeSampling",a=>{if(!o)return;let s=rt(),l=s.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}s.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(JE(o.spanContext))},sampleRand:o.sampleRand}),a.parentSampled=JE(o.spanContext),a.parentSampleRate=o.sampleRate,a.spanAttributes={...a.spanAttributes,[Tc]:o.sampleRate}})}function jq(t,e,n){let r=et(e);function o(){try{let s=Number(r.data?.[ni]??n.dsc?.sample_rate);return Number.isNaN(s)?0:s}catch{return 0}}let i={spanContext:e.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!t)return i;let a=t.spanContext;return a.traceId===r.trace_id?t:(Date.now()/1e3-t.startTimestamp<=Gq&&(W&&w.log(`Adding previous_trace \`${JSON.stringify(a)}\` link to span \`${JSON.stringify({op:r.op,...e.spanContext()})}\``),e.addLink({context:a,attributes:{[Eg]:"previous_trace"}}),e.setAttribute($q,`${a.traceId}-${a.spanId}-${JE(a)?1:0}`)),i)}function qq(t){try{q.sessionStorage.setItem(L2,JSON.stringify(t))}catch(e){W&&w.warn("Could not store previous trace in sessionStorage",e)}}function Vq(){try{let t=q.sessionStorage?.getItem(L2);return JSON.parse(t)}catch{return}}function JE(t){return t.traceFlags===1}var Yq="BrowserTracing",Wq=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function QE(){let t=q.navigator;return t?.userAgent?Wq.test(t.userAgent):!1}var Kq={...Cc,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...gp},Br=((t={})=>{"enableElementTiming"in t&&pn(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let e={name:void 0,source:void 0},n=q.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:a,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:d,finalTimeout:u,childSpanTimeout:p,markBackgroundSpan:f,traceFetch:m,traceXHR:_,trackFetchStreamPerformance:v,shouldCreateSpanForRequest:h,enableHTTPTimings:y,ignoreResourceSpans:S,ignorePerformanceApiSpans:E,instrumentPageLoad:R,instrumentNavigation:C,detectRedirects:I,linkPreviousTrace:L,consistentTraceSampling:z,enableReportPageLoaded:U,onRequestSpanStart:D,onRequestSpanEnd:N}={...Kq,...t},B=QE(),V,st;function nt(lt,X,ct=!0){let F=X.op==="pageload",gt=X.name,J=c?c(X):X,dt=J.attributes||{};if(gt!==J.name&&(dt[Ot]="custom",J.attributes=dt),!ct){let _n=sr();Ae({...J,startTime:_n}).end(_n);return}e.name=J.name,e.source=dt[Ot];let Xt=Fg(J,{idleTimeout:d,finalTimeout:u,childSpanTimeout:p,disableAutoFinish:F,beforeSpanEnd:_n=>{CS(_n,{ignoreResourceSpans:S,ignorePerformanceApiSpans:E,spanStreamingEnabled:je(lt)}),z2(lt,void 0);let Pn=rt(),Z=Pn.getPropagationContext();Pn.setPropagationContext({...Z,traceId:Xt.spanContext().traceId,sampled:Tn(Xt),dsc:$e(_n)}),F&&(st=void 0)},trimIdleSpanEndTimestamp:!U});F&&U&&(st=Xt),z2(lt,Xt);function Ce(){n&&["interactive","complete"].includes(n.readyState)&&(lt.emit("idleSpanEnableAutoFinish",Xt),n.removeEventListener("readystatechange",Ce))}F&&!U&&n&&(n.addEventListener("readystatechange",Ce),Ce())}return{name:Yq,setup(lt){if(B){W&&w.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(mf(),i&&tt.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?RS():o&&IS(),a&&NS(),I&&n){let ct=()=>{V=Mt()};addEventListener("click",ct,{capture:!0}),addEventListener("keydown",ct,{capture:!0,passive:!0})}function X(){let ct=hp(lt);ct&&!et(ct).timestamp&&(W&&w.log(`[Tracing] Finishing current active span with op: ${et(ct).op}`),ct.setAttribute(Li,"cancelled"),ct.end())}lt.on("startNavigationSpan",(ct,F)=>{if(P()!==lt)return;if(F?.isRedirect){W&&w.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),nt(lt,{op:"navigation.redirect",...ct},!1);return}V=void 0,X(),Pt().setPropagationContext({traceId:Cn(),sampleRand:Math.random(),propagationSpanId:De()?void 0:Gn()});let gt=rt();gt.setPropagationContext({traceId:Cn(),sampleRand:Math.random(),propagationSpanId:De()?void 0:Gn()}),gt.setSDKProcessingMetadata({normalizedRequest:void 0}),nt(lt,{op:"navigation",...ct,parentSpan:null,forceTransaction:!0})}),lt.on("startPageLoadSpan",(ct,F={})=>{if(P()!==lt)return;X();let gt=F.sentryTrace||B2("sentry-trace")||P2("sentry-trace"),J=F.baggage||B2("baggage")||P2("baggage"),dt=sf(gt,J),Xt=rt();Xt.setPropagationContext(dt),De()||(Xt.getPropagationContext().propagationSpanId=Gn()),Xt.setSDKProcessingMetadata({normalizedRequest:cu()}),nt(lt,{op:"pageload",...ct})}),lt.on("endPageloadSpan",()=>{U&&st&&(st.setAttribute(Li,"reportPageLoaded"),st.end())})},afterAllSetup(lt){if(B)return;lt.addIntegration&&!lt.getIntegrationByName?.(XE)&<.addIntegration(oy({ignore:r?[]:["inp"],_experiments:{enableStandaloneClsSpans:s,enableStandaloneLcpSpans:l}}));let X=Kn();if(L!=="off"&&U2(lt,{linkPreviousTrace:L,consistentTraceSampling:z}),q.location){if(R){let ct=ne();Yo(lt,{name:q.location.pathname,startTime:ct?ct/1e3:void 0,attributes:{[Ot]:"url",[at]:"auto.pageload.browser"}})}C&&Wi(({to:ct,from:F})=>{if(F===void 0&&X?.indexOf(ct)!==-1){X=void 0;return}X=void 0;let gt=ui(ct),J=hp(lt),dt=J&&I&&Jq(J,V);Wo(lt,{name:gt?.pathname||q.location.pathname,attributes:{[Ot]:"url",[at]:"auto.navigation.browser"}},{url:ct,isRedirect:dt})})}f&&D2(),a&&Xq(lt,d,u,p,e),ny(lt,{traceFetch:m,traceXHR:_,tracePropagationTargets:lt.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:h,enableHTTPTimings:y,onRequestSpanStart:D,onRequestSpanEnd:N}),v&<.addIntegration(ry())}}});function Yo(t,e,n){t.emit("startPageLoadSpan",e,n),rt().setTransactionName(e.name);let r=hp(t);return r&&t.emit("afterStartPageLoadSpan",r),r}function Wo(t,e,n){let{url:r,isRedirect:o}=n||{};t.emit("beforeStartNavigationSpan",e,{isRedirect:o}),t.emit("startNavigationSpan",e,{isRedirect:o});let i=rt();return i.setTransactionName(e.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...cu(),url:r}}),hp(t)}function B2(t){return q.document?.querySelector(`meta[name=${t}]`)?.getAttribute("content")||void 0}function P2(t){return q.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===t)?.description}function Xq(t,e,n,r,o){let i=q.document,a,s=()=>{let l="ui.action.click",c=hp(t);if(c){let d=et(c).op;if(["navigation","pageload"].includes(d)){W&&w.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(a&&(a.setAttribute(Li,"interactionInterrupted"),a.end(),a=void 0),!o.name){W&&w.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}a=Fg({name:o.name,op:l,attributes:{[Ot]:o.source||"url"}},{idleTimeout:e,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",s,{capture:!0})}var H2="_sentry_idleSpan";function hp(t){return t[H2]}function z2(t,e){Gt(t,H2,e)}var F2=1.5;function Jq(t,e){let n=et(t),r=sr(),o=n.start_timestamp;return!(r-o>F2||e&&r-e<=F2)}function G2(t=P()){t?.emit("endPageloadSpan")}function $2(t){let e=Dt();if(e===t)return;let n=rt();t.end=new Proxy(t.end,{apply(r,o,i){return Zn(n,e),Reflect.apply(r,o,i)}}),Zn(n,t)}var j2=()=>({name:"SpanStreaming",beforeSetup(t){let e=t.getOptions();e.traceLifecycle||(W&&w.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),e.traceLifecycle="stream")},setup(t){let e="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=t.getOptions();if(!je(t)){r.traceLifecycle="static",W&&w.warn(`${e} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!Pi(o)){r.traceLifecycle="static",W&&w.warn(`${e} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let i=new Hf(t);t.on("afterSpanEnd",a=>{Tn(a)&&i.add(Gg(a,t))}),t.on("afterSegmentSpanEnd",a=>{let s=a.spanContext().traceId;setTimeout(()=>{i.flush(s)},500)})}});function Bu(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Qq(t,e){let n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);let r=Bu(n);return o=>r.then(i=>o(i.transaction(e,"readwrite").objectStore(e)))}function ZE(t){return Bu(t.getAllKeys())}function Zq(t,e,n){return t(r=>ZE(r).then(o=>{if(!(o.length>=n))return r.put(e,Math.max(...o,0)+1),Bu(r.transaction)}))}function tV(t,e,n){return t(r=>ZE(r).then(o=>{if(!(o.length>=n))return r.put(e,Math.min(...o,0)-1),Bu(r.transaction)}))}function eV(t){return t(e=>ZE(e).then(n=>{let r=n[0];if(r!=null)return Bu(e.get(r)).then(o=>(e.delete(r),Bu(e.transaction).then(()=>o)))}))}function nV(t){let e;function n(){return e==null&&(e=Qq(t.dbName||"sentry-offline",t.storeName||"queue")),e}return{push:async r=>{try{let o=zi(r);await Zq(n(),o,t.maxQueueSize||30)}catch{}},unshift:async r=>{try{let o=zi(r);await tV(n(),o,t.maxQueueSize||30)}catch{}},shift:async()=>{try{let r=await eV(n());if(r)return Ug(r)}catch{}}}}function rV(t){return e=>{let n=t({...e,createStore:nV});return q.addEventListener("online",async r=>{await n.flush()}),n}}function q2(t=Su){return rV(bv(t))}var V2=1e6,oV="window"in tt&&tt.window===tt&&typeof importScripts>"u",wl=String(0),eT=oV?"main":"worker",iy=q.navigator,W2="",K2="",X2="",tT=iy?.userAgent||"",J2="",iV=iy?.language||iy?.languages?.[0]||"";function aV(t){return typeof t=="object"&&t!==null&&"getHighEntropyValues"in t}var Y2=iy?.userAgentData;aV(Y2)&&Y2.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(t=>{if(W2=t.platform||"",X2=t.architecture||"",J2=t.model||"",K2=t.platformVersion||"",t.fullVersionList?.length){let e=t.fullVersionList[t.fullVersionList.length-1];tT=`${e.brand} ${e.version}`}}).catch(t=>{});function sV(t){return!("thread_metadata"in t)}function lV(t){return sV(t)?fV(t):t}function cV(t){let e=t.contexts?.trace?.trace_id;return typeof e=="string"&&e.length!==32&&W&&w.log(`[Profiling] Invalid traceId: ${e} on profiled event`),typeof e!="string"?"":e}function uV(t,e,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let o=cV(r),i=lV(n),a=e||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:Mt()*1e3),s=typeof r.timestamp=="number"?r.timestamp*1e3:Mt()*1e3;return{event_id:t,timestamp:new Date(a).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||zo,runtime:{name:"javascript",version:q.navigator.userAgent},os:{name:W2,version:K2,build_number:tT},device:{locale:iV,model:J2,manufacturer:tT,architecture:X2,is_emulator:!1},debug_meta:{images:nM(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||ae(),trace_id:o,active_thread_id:wl,relative_start_ns:"0",relative_end_ns:((s-a)*1e6).toFixed(0)}]}}function Q2(t,e,n){if(t==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${t} instead.`);let r=dV(t),o=e.getOptions(),i=e.getSdkMetadata?.()?.sdk;return{chunk_id:ae(),client_sdk:{name:i?.name??"sentry.javascript.browser",version:i?.version??"0.0.0"},profiler_id:n||ae(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:nM(t.resources)},profile:r}}function Z2(t){try{if(!t||typeof t!="object")return{reason:"chunk is not an object"};let e=r=>typeof r=="string"&&/^[a-f0-9]{32}$/.test(r);if(!e(t.profiler_id))return{reason:"missing or invalid profiler_id"};if(!e(t.chunk_id))return{reason:"missing or invalid chunk_id"};if(!t.client_sdk)return{reason:"missing client_sdk metadata"};let n=t.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:"profile has no frames"}:!Array.isArray(n.stacks)||!n.stacks.length?{reason:"profile has no stacks"}:!Array.isArray(n.samples)||!n.samples.length?{reason:"profile has no samples"}:{valid:!0}:{reason:"missing profile data"}}catch(e){return{reason:`unknown validation error: ${e}`}}}function dV(t){let e=[];for(let s=0;s<t.frames.length;s++){let l=t.frames[s];l&&(e[s]={function:l.name,abs_path:typeof l.resourceId=="number"?t.resources[l.resourceId]:void 0,lineno:l.line,colno:l.column})}let n=[];for(let s=0;s<t.stacks.length;s++){let l=t.stacks[s];if(!l)continue;let c=[],d=l;for(;d;)c.push(d.frameId),d=d.parentId===void 0?void 0:t.stacks[d.parentId];n[s]=c}let r=ne(),o=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,i=o-(r||o),a=[];for(let s=0;s<t.samples.length;s++){let l=t.samples[s];if(!l)continue;let c=(o+(l.timestamp-i))/1e3;a[s]={stack_id:l.stackId??0,thread_id:wl,timestamp:c}}return{frames:e,stacks:n,samples:a,thread_metadata:{[wl]:{name:eT}}}}function ay(t){return et(t).op==="pageload"}function fV(t){let e,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[wl]:{name:eT}}},o=t.samples[0];if(!o)return r;let i=o.timestamp,a=ne(),s=typeof performance.timeOrigin=="number"?performance.timeOrigin:a||0,l=s-(a||s);return t.samples.forEach((c,d)=>{if(c.stackId===void 0){e===void 0&&(e=n,r.stacks[e]=[],n++),r.samples[d]={elapsed_since_start_ns:((c.timestamp+l-i)*V2).toFixed(0),stack_id:e,thread_id:wl};return}let u=t.stacks[c.stackId],p=[];for(;u;){p.push(u.frameId);let m=t.frames[u.frameId];m&&r.frames[u.frameId]===void 0&&(r.frames[u.frameId]={function:m.name,abs_path:typeof m.resourceId=="number"?t.resources[m.resourceId]:void 0,lineno:m.line,colno:m.column}),u=u.parentId===void 0?void 0:t.stacks[u.parentId]}let f={elapsed_since_start_ns:((c.timestamp+l-i)*V2).toFixed(0),stack_id:n,thread_id:wl};r.stacks[n]=p,r.samples[d]=f,n++}),r}function tM(t,e){if(!e.length)return t;for(let n of e)t[1].push([{type:"profile"},n]);return t}function eM(t){let e=[];return dr(t,(n,r)=>{if(r==="transaction")for(let o=1;o<n.length;o++)n[o]?.contexts?.profile?.profile_id&&e.push(n[o])}),e}function nM(t){let r=P()?.getOptions()?.stackParser;return r?Q0(r,t):[]}function rM(t){return typeof t!="number"&&typeof t!="boolean"||typeof t=="number"&&isNaN(t)?(W&&w.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t===!0||t===!1?!0:t<0||t>1?(W&&w.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function pV(t){return t.samples.length<2?(W&&w.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):t.frames.length?!0:(W&&w.log("[Profiling] Discarding profile because it contains no frames"),!1)}var nT=!1,rT=3e4;function mV(t){return typeof t=="function"}function sy(){let t=q.Profiler;if(!mV(t)){W&&w.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}let e=10,n=Math.floor(rT/e);try{return new t({sampleInterval:e,maxBufferSize:n})}catch{W&&(w.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),w.log("[Profiling] Disabling profiling for current user session.")),nT=!0}}function oT(t){if(nT)return W&&w.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!t.isRecording())return W&&w.log("[Profiling] Discarding profile because root span was not sampled."),!1;let n=P()?.getOptions();if(!n)return W&&w.log("[Profiling] Profiling disabled, no options found."),!1;let r=n.profilesSampleRate;return rM(r)?r?(r===!0?!0:Math.random()<r)?!0:(W&&w.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(W&&w.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(W&&w.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function oM(t){if(nT)return W&&w.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if(t.profileLifecycle!=="trace"&&t.profileLifecycle!=="manual")return W&&w.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let e=t.profileSessionSampleRate;return rM(e)?e?Math.random()<=e:(W&&w.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(W&&w.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function bp(t){return typeof t.profilesSampleRate<"u"}function iM(t,e,n,r){return pV(n)?uV(t,e,n,r):null}var Tl=new Map;function aM(){return Tl.size}function sM(t){let e=Tl.get(t);return e&&Tl.delete(t),e}function lM(t,e){if(Tl.set(t,e),Tl.size>30){let n=Tl.keys().next().value;n!==void 0&&Tl.delete(n)}}var ly=new WeakSet;function xl(t){t.setAttribute("thread.id",wl),t.setAttribute("thread.name",eT)}function iT(t){let e;ay(t)&&(e=Mt()*1e3);let n=sy();if(!n)return;W&&w.log(`[Profiling] started profiling span: ${et(t).description}`);let r=ae(),o=null;rt().setContext("profile",{profile_id:r,start_timestamp:e}),ly.add(t),xl(t);async function i(){if(t&&n){if(o){W&&w.log("[Profiling] profile for:",et(t).description,"already exists, returning early");return}return n.stop().then(c=>{if(a&&(q.clearTimeout(a),a=void 0),W&&w.log(`[Profiling] stopped profiling of span: ${et(t).description}`),!c){W&&w.log(`[Profiling] profiler returned null profile for: ${et(t).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=c,lM(r,c)}).catch(c=>{W&&w.log("[Profiling] error while stopping profiler:",c)})}}let a=q.setTimeout(()=>{W&&w.log("[Profiling] max profile duration elapsed, stopping profiling for:",et(t).description),i()},rT),s=t.end.bind(t);function l(){return t?(i().then(()=>{s()},()=>{s()}),t):s()}t.end=l}var gV=6e4,hV=3e5,cy=class{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(e){let n=e.getOptions().profileLifecycle,r=oM(e.getOptions());W&&w.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||W&&w.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=ae(),this._client=e,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(e),e.on("spanStart",o=>{this._isRunning&&xl(o)})}start(){if(this._lifecycleMode==="trace"){W&&w.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){W&&w.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){W&&w.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){W&&w.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){W&&w.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(e){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;let n=e.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);let r=this._activeRootSpanIds.size;r===1&&(W&&w.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling()),this._isRunning&&xl(e)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,W&&w.log("[Profiling] Started profiling with profiler ID:",this._profilerId),lr().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){W&&w.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(e=>{W&&w.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)}),this._lifecycleMode==="manual"&&lr().setContext("profile",{}))}_setupTraceLifecycleListeners(e){e.on("spanStart",n=>{if(!this._sessionSampled){W&&w.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==Bt(n))return;if(!n.isRecording()){W&&w.log("[Profiling] Discarding profile because root span was not sampled.");return}let r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);let o=this._activeRootSpanIds.size;o===1&&(W&&w.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${o}).`),this._beginProfiling())}),e.on("spanEnd",n=>{if(!this._sessionSampled)return;let r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);let o=this._activeRootSpanIds.size;W&&w.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${o}).`),o===0&&(this._collectCurrentChunk().catch(i=>{W&&w.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,lr().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(e=>clearTimeout(e)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(e){this._activeRootSpanIds.add(e);let n=setTimeout(()=>this._onRootSpanTimeout(e),hV);this._rootSpanTimeouts.set(e,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let e=sy();if(!e){W&&w.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=e}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{W&&w.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",e)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},gV))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(W&&w.log(`[Profiling] Reached 5-minute timeout for root span ${e}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(e),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){let e=this._profiler;if(this._profiler=void 0,!!e)try{let n=await e.stop(),r=Q2(n,this._client,this._profilerId),o=Z2(r);if("reason"in o){W&&w.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),W&&w.log("[Profiling] Collected browser profile chunk.")}catch(n){W&&w.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(e){let n=this._client,r=Fo(n.getSdkMetadata?.()),o=n.getDsn(),i=n.getOptions().tunnel,a=Le({event_id:ae(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&o&&{dsn:en(o)}},[[{type:"profile_chunk",platform:"javascript"},e]]);n.sendEnvelope(a).then(null,s=>{W&&w.error("Error while sending profile chunk envelope:",s)})}};var bV="BrowserProfiling",yV=(()=>({name:bV,setup(t){let e=t.getOptions(),n=new cy;if(!bp(e)&&!e.profileLifecycle&&(e.profileLifecycle="manual"),bp(e)&&!e.profilesSampleRate){W&&w.log("[Profiling] Profiling disabled, no profiling options found.");return}let r=Dt(),o=r&&Bt(r);if(bp(e)&&e.profileSessionSampleRate!==void 0&&W&&w.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),bp(e))o&&ay(o)&&oT(o)&&iT(o),t.on("spanStart",i=>{let a=Bt(i);i===a?oT(i)&&iT(i):ly.has(a)&&xl(i)}),t.on("beforeEnvelope",i=>{if(!aM())return;let a=eM(i);if(!a.length)return;let s=[];for(let l of a){let c=l?.contexts,d=c?.profile?.profile_id,u=c?.profile?.start_timestamp;if(typeof d!="string"){W&&w.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!d){W&&w.log("[Profiling] cannot find profile for a span without a profile context");continue}c?.profile&&delete c.profile;let p=sM(d);if(!p){W&&w.log(`[Profiling] Could not retrieve profile for span: ${d}`);continue}let f=iM(d,u,p,l);f&&s.push(f)}tM(i,s)});else{let i=e.profileLifecycle;if(t.on("startUIProfiler",()=>n.start()),t.on("stopUIProfiler",()=>n.stop()),i==="manual")n.initialize(t);else if(i==="trace"){if(!De(e)){W&&w.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(t),o&&n.notifyRootSpanActive(o),q.setTimeout(()=>{let a=Dt(),s=a&&Bt(a);s&&n.notifyRootSpanActive(s)},0)}}}})),cM=yV;var _V="SpotlightBrowser",vV=[{op:"ui.interaction.click",name:"#sentry-spotlight"}],SV=((t={})=>{let e=t.sidecarUrl||"http://localhost:8969/stream";return{name:_V,setup:()=>{W&&w.log("Using Sidecar URL",e)},beforeSetup(n){let r=n.getOptions();r.ignoreSpans=[...r.ignoreSpans||[],...vV]},afterAllSetup:n=>{EV(n,e)}}});function EV(t,e){let n=_u("fetch"),r=0;t.on("beforeEnvelope",o=>{if(r>3){w.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(e,{method:"POST",body:zi(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,w.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}var uM=SV;var dM=()=>({name:"LaunchDarkly",processEvent(t,e,n){return Cr(t)}});function fM(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(t,e,n)=>{fr(t,e.value),pr(t,e.value)}}}var pM=()=>({name:"OpenFeature",processEvent(t,e,n){return Cr(t)}}),uy=class{after(e,n){fr(n.flagKey,n.value),pr(n.flagKey,n.value)}error(e,n,r){fr(e.flagKey,e.defaultValue),pr(e.flagKey,e.defaultValue)}};var mM=({featureFlagClientClass:t})=>({name:"Unleash",setupOnce(){let e=t.prototype;be(e,"isEnabled",TV)},processEvent(e,n,r){return Cr(e)}});function TV(t){return function(...e){let n=e[0],r=t.apply(this,e);return typeof n=="string"&&typeof r=="boolean"?(fr(n,r),pr(n,r)):W&&w.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var gM=(({growthbookClass:t})=>Ov({growthbookClass:t}));var hM=({featureFlagClient:t})=>({name:"Statsig",setup(e){t.on("gate_evaluation",n=>{fr(n.gate.name,n.gate.value),pr(n.gate.name,n.gate.value)})},processEvent(e,n,r){return Cr(e)}});async function bM(){let t=P();if(!t)return"no-client-active";if(!t.getDsn())return"no-dsn-configured";let r=t.getOptions().tunnel||"https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";try{await Nc(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}var wV="WebWorker",_M=({worker:t})=>({name:wV,setupOnce:()=>{(Array.isArray(t)?t:[t]).forEach(e=>yM(e))},addWorker:e=>yM(e)});function yM(t){t.addEventListener("message",e=>{if(AV(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(W&&w.log("Sentry debugId web worker message received",e.data),q._sentryDebugIds={...e.data._sentryDebugIds,...q._sentryDebugIds}),e.data._sentryModuleMetadata&&(W&&w.log("Sentry module metadata web worker message received",e.data),q._sentryModuleMetadata={...e.data._sentryModuleMetadata,...q._sentryModuleMetadata}),e.data._sentryWasmImages){W&&w.log("Sentry WASM images web worker message received",e.data);let n=q._sentryWasmImages||[],r=e.data._sentryWasmImages.filter(o=>he(o)&&typeof o.code_file=="string"&&!n.some(i=>i.code_file===o.code_file));q._sentryWasmImages=[...n,...r]}e.data._sentryWorkerError&&(W&&w.log("Sentry worker rejection message received",e.data._sentryWorkerError),xV(e.data._sentryWorkerError))}})}function xV(t){let e=P();if(!e)return;let n=e.getOptions().stackParser,r=e.getOptions().attachStacktrace,o=t.reason,i=Ze(o)?XS(o):du(n,o,void 0,r,!0);i.level="error",t.filename&&(i.contexts={...i.contexts,worker:{filename:t.filename}}),Qr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),W&&w.log("Captured worker unhandled rejection",o)}function vM({self:t}){t.postMessage({_sentryMessage:!0,_sentryDebugIds:t._sentryDebugIds??void 0,_sentryModuleMetadata:t._sentryModuleMetadata??void 0}),t.addEventListener("unhandledrejection",e=>{let r={reason:KS(e),filename:t.location?.href};t.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),W&&w.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),W&&w.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function AV(t){if(!he(t)||t._sentryMessage!==!0)return!1;let e="_sentryDebugIds"in t,n="_sentryModuleMetadata"in t,r="_sentryWorkerError"in t,o="_sentryWasmImages"in t;return!(!e&&!n&&!r&&!o||e&&!(he(t._sentryDebugIds)||t._sentryDebugIds===void 0)||n&&!(he(t._sentryModuleMetadata)||t._sentryModuleMetadata===void 0)||r&&!he(t._sentryWorkerError)||o&&(!Array.isArray(t._sentryWasmImages)||!t._sentryWasmImages.every(i=>he(i)&&typeof i.code_file=="string")))}var EM=Kr(Ea(),1);function SM(t){return he(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function dy(t){let e={...t};Mf(e,"react"),La("react",{version:EM.version});let n=QS(e);return _c(kV),n}function kV(t){return SM(t)?"[SyntheticEvent]":Tu(t)}var TM=Kr(Ea(),1);function IV(t){let e=t.match(/^([^.]+)/);return e!==null&&parseInt(e[0])>=17}function RV(t,e){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(t,e)}function yp(t,{componentStack:e},n){if(IV(TM.version)&&mn(t)&&e){let r=new Error(t.message);r.name=`React ErrorBoundary ${t.name}`,r.stack=e,RV(t,r)}return Et(t,n)}function wM(t){return(e,n)=>{let r=!!t,o=yp(e,n,{mechanism:{handled:r,type:"auto.function.react.error_handler"}});r&&t(e,n,o)}}var Ji=Kr(Ea(),1);var aT="ui.react.render",xM="ui.react.update",sT="ui.react.mount";var NV={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},CV={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},MV={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},NM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},OV=Symbol.for("react.forward_ref"),CM=Symbol.for("react.memo");function DV(t){return typeof t=="object"&&t!==null&&t.$$typeof===CM}var lT={};lT[OV]=MV;lT[CM]=NM;function AM(t){if(DV(t))return NM;let e=t.$$typeof;return e&&lT[e]||NV}var LV=Object.defineProperty.bind(Object),UV=Object.getOwnPropertyNames.bind(Object),kM=Object.getOwnPropertySymbols?.bind(Object),IM=Object.getOwnPropertyDescriptor.bind(Object),BV=Object.getPrototypeOf.bind(Object),RM=Object.prototype;function Xi(t,e,n){if(typeof e!="string"){if(RM){let a=BV(e);a&&a!==RM&&Xi(t,a)}let r=UV(e);kM&&(r=r.concat(kM(e)));let o=AM(t),i=AM(e);for(let a of r)if(!CV[a]&&!i?.[a]&&!o?.[a]&&!IM(t,a)){let s=IM(e,a);if(s)try{LV(t,a,s)}catch{}}}return t}var PV="unknown",Pu=class extends Ji.Component{constructor(e){super(e);let{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=Ae({name:`<${n}>`,onlyIfParent:!0,op:sT,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":n}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:e,includeUpdates:n=!0}){if(n&&this._mountSpan&&e!==this.props.updateProps){let r=Object.keys(e).filter(o=>e[o]!==this.props.updateProps[o]);if(r.length>0){let o=Mt();this._updateSpan=Jr(this._mountSpan,()=>Ae({name:`<${this.props.name}>`,onlyIfParent:!0,op:xM,startTime:o,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":this.props.name,"ui.react.changed_props":r}}))}}return!0}componentDidUpdate(){this._updateSpan&&(this._updateSpan.end(),this._updateSpan=void 0)}componentWillUnmount(){let e=Mt(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){let o=et(this._mountSpan).timestamp;Jr(this._mountSpan,()=>{let i=Ae({onlyIfParent:!0,name:`<${n}>`,op:aT,startTime:o,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":n}});i&&i.end(e)})}}render(){return this.props.children}};Object.assign(Pu,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});function MM(t,e){let n=e?.name||t.displayName||t.name||PV,r=o=>Ji.createElement(Pu,{...e,name:n,updateProps:o},Ji.createElement(t,{...o}));return r.displayName=`profiler(${n})`,Xi(r,t),r}function OM(t,e={disabled:!1,hasRenderSpan:!0}){let[n]=Ji.useState(()=>{if(!e?.disabled)return Ae({name:`<${t}>`,onlyIfParent:!0,op:sT,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":t}})});Ji.useEffect(()=>(n&&n.end(),()=>{if(n&&e.hasRenderSpan){let r=et(n).timestamp,o=Mt(),i=Ae({name:`<${t}>`,onlyIfParent:!0,op:aT,startTime:r,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":t}});i&&i.end(o)}}),[])}var Si=Kr(Ea(),1);var Be=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var zV="unknown",cT={componentStack:null,error:null,eventId:null},_p=class extends Si.Component{constructor(e){super(e),this.state=cT,this._openFallbackReportDialog=!0;let n=P();n&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Qf({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:a,dialogOptions:s}=this.props;Oe(l=>{o&&o(l,e,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,d=yp(e,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(e,r,d),a&&(this._lastEventId=d,this._openFallbackReportDialog&&Qf({...s,eventId:d})),this.setState({error:e,componentStack:r,eventId:d})})}componentDidMount(){let{onMount:e}=this.props;e&&e()}componentWillUnmount(){let{error:e,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===cT?o(null,null,null):o(e,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){let{onReset:e}=this.props,{error:n,componentStack:r,eventId:o}=this.state;e&&e(n,r,o),this.setState(cT)}render(){let{fallback:e,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;let o=typeof e=="function"?Si.createElement(e,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):e;return Si.isValidElement(o)?o:(e&&Be&&w.warn("fallback did not produce a valid ReactElement"),null)}};function DM(t,e){let n=t.displayName||t.name||zV,r=Si.memo(o=>Si.createElement(_p,{...e},Si.createElement(t,{...o})));return r.displayName=`errorBoundary(${n})`,Xi(r,t),r}var FV="redux.action",HV="info",GV={attachReduxState:!0,actionTransformer:t=>t,stateTransformer:t=>t||null};function LM(t){let e={...GV,...t};return n=>(r,o)=>{e.attachReduxState&&lr().addEventProcessor((s,l)=>{try{s.type===void 0&&s.contexts.state.state.type==="redux"&&(l.attachments=[...l.attachments||[],{filename:"redux_state.json",data:JSON.stringify(s.contexts.state.state.value)}])}catch{}return s});function i(s){return(l,c)=>{let d=s(l,c),u=rt(),p=e.actionTransformer(c);typeof p<"u"&&p!==null&&wn({category:FV,data:p,type:HV});let f=e.stateTransformer(d);if(typeof f<"u"&&f!==null){let h=P()?.getOptions()?.normalizeDepth||3,y={state:{type:"redux",value:f}};k0(y,3+h),u.setContext("state",y)}else u.setContext("state",null);let{configureScopeWithState:m}=e;return typeof m=="function"&&m(u,d),d}}let a=n(i(r),o);return a.replaceReducer=new Proxy(a.replaceReducer,{apply:function(s,l,c){s.apply(l,[i(c[0])])}}),a}}function BM(t){let e=Br({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,match:o,instrumentPageLoad:i=!0,instrumentNavigation:a=!0}=t;return{...e,afterAllSetup(s){e.afterAllSetup(s),i&&q.location&&UM(r,q.location,o,(l,c="url")=>{Yo(s,{name:l,attributes:{[ht]:"pageload",[at]:"auto.pageload.react.reactrouter_v3",[Ot]:c}})}),a&&n.listen&&n.listen(l=>{(l.action==="PUSH"||l.action==="POP")&&UM(r,l,o,(c,d="url")=>{Wo(s,{name:c,attributes:{[ht]:"navigation",[at]:"auto.navigation.react.reactrouter_v3",[Ot]:d}})})})}}}function UM(t,e,n,r){let o=e.pathname;n({location:e,routes:t},(i,a,s)=>{if(i||!s)return r(o);let l=$V(s.routes||[]);return l.length===0||l==="/*"?r(o):(o=l,r(o,"route"))})}function $V(t){if(!Array.isArray(t)||t.length===0)return"";let e=t.filter(r=>!!r.path),n=-1;for(let r=e.length-1;r>=0;r--)if(e[r].path?.startsWith("/")){n=r;break}return e.slice(n).reduce((r,{path:o})=>{let i=r==="/"||r===""?o:`/${o}`;return`${r}${i}`},"")}function zM(t,e={}){let n=t,r=Br({...e,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:o=!0,instrumentNavigation:i=!0}=e;return{...r,afterAllSetup(a){r.afterAllSetup(a);let s=q.location;if(o&&s){let l=n.matchRoutes(s.pathname,n.options.parseSearch(s.search),{preload:!1,throwOnError:!1}),c=l[l.length-1],d=c?.routeId!=="__root__"?c:void 0;Yo(a,{name:d?d.routeId:s.pathname,attributes:{[ht]:"pageload",[at]:"auto.pageload.react.tanstack_router",[Ot]:d?"route":"url",...PM(d)}})}i&&n.subscribe("onBeforeNavigate",l=>{if(!l.fromLocation||l.toLocation.state===l.fromLocation.state)return;let c=n.matchRoutes(l.toLocation.pathname,l.toLocation.search,{preload:!1,throwOnError:!1}),d=c[c.length-1],u=d?.routeId!=="__root__"?d:void 0,p=q.location,f=Wo(a,{name:u?u.routeId:p.pathname,attributes:{[ht]:"navigation",[at]:"auto.navigation.react.tanstack_router",[Ot]:u?"route":"url"}}),m=n.subscribe("onResolved",_=>{if(m(),f){let v=n.matchRoutes(_.toLocation.pathname,_.toLocation.search,{preload:!1,throwOnError:!1}),h=v[v.length-1],y=h?.routeId!=="__root__"?h:void 0;y&&(f.updateName(y.routeId),f.setAttribute(Ot,"route"),f.setAttributes(PM(y)))}})})}}}function PM(t){if(!t)return{};let e={};return Object.entries(t.params).forEach(([n,r])=>{e[`url.path.params.${n}`]=r,e[`url.path.parameter.${n}`]=r,e[`params.${n}`]=r}),e}var FM=Kr(Ea(),1);function HM(t){let e=Br({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:o,instrumentPageLoad:i=!0,instrumentNavigation:a=!0}=t;return{...e,afterAllSetup(s){e.afterAllSetup(s),$M(s,i,a,n,"reactrouter_v4",r,o)}}}function GM(t){let e=Br({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:o,instrumentPageLoad:i=!0,instrumentNavigation:a=!0}=t;return{...e,afterAllSetup(s){e.afterAllSetup(s),$M(s,i,a,n,"reactrouter_v5",r,o)}}}function $M(t,e,n,r,o,i=[],a){function s(){if(r.location)return r.location.pathname;if(q.location)return q.location.pathname}function l(c){if(i.length===0||!a)return[c,"url"];let d=jM(i,c,a);for(let u of d)if(u.match.isExact)return[u.match.path,"route"];return[c,"url"]}if(e){let c=s();if(c){let[d,u]=l(c);Yo(t,{name:d,attributes:{[ht]:"pageload",[at]:`auto.pageload.react.${o}`,[Ot]:u}})}}n&&r.listen&&r.listen((c,d)=>{if(d&&(d==="PUSH"||d==="POP")){let[u,p]=l(c.pathname);Wo(t,{name:u,attributes:{[ht]:"navigation",[at]:`auto.navigation.react.${o}`,[Ot]:p}})}})}function jM(t,e,n,r=[]){return t.some(o=>{let i=o.path?n(e,o):r.length?r[r.length-1].match:jV(e);return i&&(r.push({route:o,match:i}),o.routes&&jM(o.routes,e,n,r)),!!i}),r}function jV(t){return{path:"/",url:"/",params:{},isExact:t==="/"}}function qM(t){let e=t.displayName||t.name,n=r=>{if(r?.computedMatch?.isExact){let o=r.computedMatch.path,i=qV();rt().setTransactionName(o),i&&(i.updateName(o),i.setAttribute(Ot,"route"))}return FM.createElement(t,{...r})};return n.displayName=`sentryRoute(${e})`,Xi(n,t),n}function qV(){let t=Dt(),e=t&&Bt(t);if(!e)return;let n=et(e).op;return n==="navigation"||n==="pageload"?e:void 0}var Ei=Kr(Ea(),1);function zu(t,e){if(!e||e==="/"||!t.toLowerCase().startsWith(e.toLowerCase()))return t;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?t:t.slice(n)||"/"}var VM=new WeakMap;function XM(t,e,n){if(!t||!e?.length)return null;let r=n?zu(t,n):t,o=VM.get(e);o||(o=JV(e),VM.set(e,o),Be&&w.log("[React Router] Sorted route manifest by specificity:",o.length,"patterns"));for(let i of o)if(VV(r,i))return Be&&w.log("[React Router] Matched pathname",r,"to pattern",i),i;return Be&&w.log("[React Router] No manifest match found for pathname:",r),null}function VV(t,e){if(e==="/")return t==="/"||t==="";let n=WM(t),r=WM(e);if(r.length>0&&r[r.length-1]==="*"){let i=r.slice(0,-1);if(n.length<i.length)return!1;for(let[a,s]of i.entries())if(!YM(n[a],s))return!1;return!0}if(n.length!==r.length)return!1;for(let[i,a]of r.entries())if(!YM(n[i],a))return!1;return!0}function YM(t,e){return t===void 0||e===void 0?!1:JM.test(e)?!0:t===e}function WM(t){return t.split("/").filter(Boolean)}var JM=/^:[\w-]+$/,YV=10,WV=3,KV=1,XV=-2;function KM(t){let e=t.split("/"),n=e.length;e.includes("*")&&(n+=XV);for(let r of e)r!=="*"&&(JM.test(r)?n+=WV:r===""?n+=KV:n+=YV);return n}function JV(t){return[...t].sort((e,n)=>{let r=KM(e);return KM(n)-r})}var uT,Al=!1,ts=[],QV=10;function eO(t,e){let n={};return ts.length>=QV&&(Be&&w.warn("[React Router] Navigation context stack overflow - removing oldest context"),ts.shift()),ts.push({token:n,targetPath:t,span:e}),n}function nO(t){ts[ts.length-1]?.token===t&&ts.pop()}function dT(){let t=ts.length;return t>0?ts[t-1]??null:null}function rO(t,e=!1){uT=t,Al=e}function ZV(t){return eY(t.route.path||"")}function tY(t){return t.params["*"]||""}function eY(t){return t[t.length-1]==="*"?t.slice(0,-1):t}function Fu(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function oO(t){return t.endsWith("*")}function Qi(t){return t.includes("/*")||t.endsWith("*")}function QM(t,e){return oO(t)&&!!e.route.children?.length||!1}function nY(t){return!!(!t.children&&t.element&&t.path?.endsWith("/*"))}function rY(t,e,n){let r=t&&t.length>0?t:Al?zu(e,n):e,o=r.slice(-2)==="/*"?r.slice(0,-2):r;return o.length>1&&o[o.length-1]==="/"&&(o=o.slice(0,-1)),[o,"route"]}function ZM(t){return t.split(/\\?\//).filter(e=>e.length>0&&e!==",").length}function fy(t){return t[0]==="/"?t:`/${t}`}function iO(t,e){let n=uT(t,e);if(!n||n.length===0)return"";for(let r of n)if(r.route.path&&r.route.path!=="*"){let o=ZV(r),i=zu(e.pathname,fy(r.pathnameBase));return e.pathname===i?Fu(i):Fu(Fu(o||"")+fy(iO(t.filter(a=>a!==r.route),{pathname:i})))}return""}function oY(t,e){let n=uT(e,t);if(n){for(let r of n)if(nY(r.route)&&tY(r))return!0}return!1}function tO(t,e){return Al?zu(t.pathname,e):t.pathname||""}function iY(t,e,n,r=""){if(!t||t.length===0)return[Al?zu(e.pathname,r):e.pathname,"url"];if(!n)return[tO(e,r),"url"];let o="";for(let i of n){let a=i.route;if(!a)continue;if(a.index)return rY(o,i.pathname,r);let s=a.path;if(!s||QM(s,i))continue;let l=s[0]==="/"||o[o.length-1]==="/"?s:`/${s}`;if(o=Fu(o)+fy(l),Fu(e.pathname)===Fu(r+i.pathname))return ZM(o)!==ZM(i.pathname)&&!oO(o)?[(Al?"":r)+l,"route"]:(QM(o,i)&&(o=o.slice(0,-1)),[(Al?"":r)+o,"route"])}return[tO(e,r),"url"]}function vp(t,e,n,r,o="",i,a){if(a&&i&&i.length>0){let d=XM(t.pathname,i,o);if(d)return[(Al?"":o)+d,"route"]}let s,l="url",c=oY(t,n);return c&&(s=fy(iO(n,t)),l="route"),(!c||!s)&&([s,l]=iY(e,t,r,o)),[s||t.pathname,l]}function fo(){let t=Dt(),e=t?Bt(t):void 0;if(!e)return;let n=et(e).op;return n==="navigation"||n==="pageload"?e:void 0}function aY(){let t=dT();if(t)return t.targetPath?{pathname:t.targetPath,search:"",hash:"",state:null,key:"default"}:null;if(typeof q<"u")try{let e=q.location;if(e)return{pathname:e.pathname,search:e.search||"",hash:e.hash||"",state:null,key:"default"}}catch{Be&&w.warn("[React Router] Could not access window.location")}return null}function sY(){let t=dT();return t?t.span:fo()}function lY(t,e,n,r){let o=new Proxy(t,{apply(i,a,s){let l=aY(),c=sY(),d=i.apply(a,s);return cY(d,e,n,r,l,c),d}});return Gt(o,"__sentry_proxied__",!0),o}function cY(t,e,n,r,o,i){Nn(t)?t.then(a=>{Array.isArray(a)&&r(a,e,o??void 0,i)}).catch(a=>{Be&&w.warn(`Error resolving async handler '${n}' for route`,e,a)}):Array.isArray(t)&&r(t,e,o??void 0,i)}function Sp(t,e){if(t.handle&&typeof t.handle=="object")for(let n of Object.keys(t.handle)){let r=t.handle[n];typeof r=="function"&&!r.__sentry_proxied__&&(t.handle[n]=lY(r,t,n,e))}if(Array.isArray(t.children))for(let n of t.children)Sp(n,e)}var Hu,es,ns,py,po,rs=!1,Il=3e3,Ep,hT="",lO=new WeakSet,cO=q?.document?Ei.useLayoutEffect:Ei.useEffect,kl=new WeakMap,An=new Set,my=new WeakMap,pT=new WeakMap;function uY(t){return q?.requestAnimationFrame?q.requestAnimationFrame(t):setTimeout(t,0)}function aO(t){q?.cancelAnimationFrame?q.cancelAnimationFrame(t):clearTimeout(t)}function uO(t){return`${t.pathname}${t.search||""}${t.hash||""}`}function sO(t){return t.includes(":")||t.includes("*")}function dY(t,e,n,r){if(!t)return{skip:!1,shouldUpdate:!1};if(t.locationKey===e&&(t.isPlaceholder||!r)){let i=!!t.routeName&&Qi(t.routeName),a=Qi(n),s=!!t.routeName&&sO(t.routeName),l=sO(n),c=i&&!a,d=!s&&l,u=n!==t.routeName&&n.length>(t.routeName?.length||0)&&!a;return{skip:!0,shouldUpdate:!!(t.routeName&&(c||d||u))}}return{skip:!1,shouldUpdate:!1}}function dO(t,e){let n=e.children||[],r=t.filter(o=>!n.some(i=>i===o||o.path&&i.path===o.path||o.id&&i.id===o.id));r.length>0&&(e.children=[...n,...r])}function fO(t,e){let n=my.get(t);n||(n=new Set,my.set(t,n)),n.add(e),e.finally(()=>{let r=my.get(t);r&&r.delete(e)})}function pO(t){let e=new Promise(n=>{pT.set(t,n)});fO(t,e)}function fY(t){let e=pT.get(t);e&&(e(),pT.delete(t),t.__sentry_may_have_lazy_routes__&&(t.__sentry_may_have_lazy_routes__=!1))}function bT(t,e,n=null,r){t.forEach(i=>{An.add(i),rs&&Sp(i,bT)}),e&&dO(t,e);let o=r??fo();if(o){let i=et(o);if(i.timestamp){Be&&w.warn("[React Router] Lazy handler resolved after span ended - skipping update");return}let a=i.op,s=n;if(!s&&!r&&typeof q<"u"){let l=q.location;l?.pathname&&(s={pathname:l.pathname})}s&&(a==="pageload"?wp({activeRootSpan:o,location:{pathname:s.pathname},routes:Array.from(An),allRoutes:Array.from(An)}):a==="navigation"&&mT(o,s,Array.from(An),!1,po))}}function mT(t,e,n,r=!1,o){let i=et(t),a=i.description,s=t?.__sentry_navigation_name_set__,l=a&&Qi(a);if((!s||r||l)&&!i.timestamp){let d=o(n,e),[u,p]=vp(e,n,n,d||[],hT,Ep,rs),f=i.data?.[Ot];u&&(!a||!s&&(f!=="route"||p==="route")||f!=="route"&&p==="route"||f==="route"&&p==="route"&&l)&&(t.updateName(u),t.setAttribute(Ot,p),!Qi(u)&&p==="route"&&Gt(t,"__sentry_navigation_name_set__",!0))}}function mO(t,e,n,r,o){let i=!1,a=!!o&&et(o).op==="pageload",s=!1,l=null,c=null;t.subscribe(d=>{if(!i){let p=fo();p&&et(p).op==="pageload"?a=!0:a&&(d.historyAction==="POP"&&!s?s=!0:i=!0)}if(d.historyAction==="PUSH"||d.historyAction==="POP"&&i){let p=uO(d.location),f=()=>{c!==p&&(c=p,l=null,yT({location:d.location,routes:e,navigationType:d.historyAction,version:n,basename:r,allRoutes:Array.from(An)}))};d.navigation.state!=="idle"?(c!==p&&(c=null),l!==null&&aO(l),l=uY(f)):(l!==null&&(aO(l),l=null),f())}})}function Gu(t,e){return!Hu||!es||!ns||!po?(Be&&w.warn(`reactRouter${e?`V${e}`:""}Instrumentation was unable to wrap the \`createRouter\` function because of one or more missing parameters.`),t):function(n,r){if(Tp(n),rs)for(let c of n)Sp(c,bT);let o=fo();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Gt(o,"__sentry_may_have_lazy_routes__",!0),pO(o));let a=gO(r,!1,o),s=t(n,a),l=r?.basename;return s.state.historyAction==="POP"&&o&&wp({activeRootSpan:o,location:s.state.location,routes:n,basename:l,allRoutes:Array.from(An)}),hT=l||"",mO(s,n,e,l,o),s}}function $u(t,e){return!Hu||!es||!ns||!po?(Be&&w.warn(`reactRouter${e?`V${e}`:""}Instrumentation was unable to wrap the \`createMemoryRouter\` function because of one or more missing parameters.`),t):function(n,r){if(Tp(n),rs)for(let v of n)Sp(v,bT);let o=fo();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Gt(o,"__sentry_may_have_lazy_routes__",!0),pO(o));let a=gO(r,!0,o),s=t(n,a),l=r?.basename,c,d=r?.initialEntries,u=r?.initialIndex,p=d?.length===1,f=u!==void 0&&d?.[u];c=p?d[0]:f?d[u]:void 0;let m=c?typeof c=="string"?{pathname:c}:c:s.state.location,_=fo();return s.state.historyAction==="POP"&&_&&wp({activeRootSpan:_,location:m,routes:n,basename:l,allRoutes:Array.from(An)}),hT=l||"",mO(s,n,e,l,_),s}}function ju(t,e){let n=Br({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:o,useNavigationType:i,createRoutesFromChildren:a,matchRoutes:s,stripBasename:l,enableAsyncRouteHandlers:c=!1,instrumentPageLoad:d=!0,instrumentNavigation:u=!0,lazyRouteTimeout:p,lazyRouteManifest:f}=t;return{...n,setup(m){n.setup(m);let _=t.finalTimeout??3e4,v=(t.idleTimeout??1e3)*3,h=p??v;h===1/0?(Il=_,Be&&w.log("[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:",_,"ms to prevent indefinite hangs")):Number.isNaN(h)?(Be&&w.warn("[React Router] lazyRouteTimeout must be a number, falling back to default:",v),Il=v):h<0?(Be&&w.warn("[React Router] lazyRouteTimeout must be non-negative or Infinity, got:",h,"falling back to:",v),Il=v):Il=h,Hu=r,es=o,ns=i,po=s,py=a,rs=c,Ep=f,rO(s,l||!1)},afterAllSetup(m){n.afterAllSetup(m);let _=q.location?.pathname;d&&_&&Yo(m,{name:_,attributes:{[Ot]:"url",[ht]:"pageload",[at]:`auto.pageload.react.reactrouter${e?`_v${e}`:""}`}}),u&&lO.add(m)}}}function qu(t,e){if(!Hu||!es||!ns||!po)return Be&&w.warn("reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters."),t;let n=r=>{let o=Ei.useRef(!0),{routes:i,locationArg:a}=r,s=t(i,a),l=es(),c=ns(),d=typeof a=="string"||a?.pathname?a:l;return cO(()=>{let u=typeof d=="string"?{pathname:d}:d;o.current?(Tp(i),wp({activeRootSpan:fo(),location:u,routes:i,allRoutes:Array.from(An)}),o.current=!1):yT({location:u,routes:i,navigationType:c,version:e,allRoutes:Array.from(An)})},[c,d]),s};return(r,o)=>Ei.createElement(n,{routes:r,locationArg:o})}function gO(t,e=!1,n){if(!t||!("patchRoutesOnNavigation"in t)||typeof t.patchRoutesOnNavigation!="function")return t||{};let r=t.patchRoutesOnNavigation;return{...t,patchRoutesOnNavigation:async o=>{let i=o?.path,a=fo()??n;if(!e){let l=o?.patch,c=o?.matches;l&&(o.patch=(d,u)=>{if(Tp(u),c&&c.length>0){let m=c[c.length-1]?.route;if(m){let _=Array.from(An).find(v=>{let h=v.id!==void 0&&v.id===d,y=v===m,S=v.path!==void 0&&m.path!==void 0&&v.path===m.path;return h||y||S});_&&dO(u,_)}}let p=a?et(a):void 0;return i&&a&&p&&!p.timestamp&&p.op==="navigation"&&mT(a,{pathname:i,search:"",hash:"",state:null,key:"default"},Array.from(An),!0,po),l(d,u)})}let s=(async()=>{let l=eO(i,a),c;try{c=await r(o)}finally{nO(l),a&&fY(a)}let d=a?et(a):void 0;if(a&&d&&!d.timestamp&&d.op==="navigation"){let u=i;u&&mT(a,{pathname:u,search:"",hash:"",state:null,key:"default"},Array.from(An),!1,po)}return c})();return a&&fO(a,s),s}}}function yT(t){let{location:e,routes:n,navigationType:r,version:o,matches:i,basename:a,allRoutes:s}=t,l=Array.isArray(i)?i:po(s||n,e,a),c=P();if(!c||!lO.has(c))return;let d=fo();if(!(d&&et(d).op==="pageload"&&r==="POP")&&(r==="PUSH"||r==="POP")&&l){let[u,p]=vp(e,s||n,s||n,l,a,Ep,rs),f=uO(e),m=kl.get(c),_=m&&!m.isPlaceholder?!!et(m.span).timestamp:!1,{skip:v,shouldUpdate:h}=dY(m,f,u,_);if(v){if(h&&m){let R=m.routeName;m.isPlaceholder?(m.routeName=u,Be&&w.log(`[Tracing] Updated placeholder navigation name from "${R}" to "${u}" (will apply to real span)`)):(m.span.updateName(u),m.span.setAttribute(Ot,p),Gt(m.span,"__sentry_navigation_name_set__",!0),m.routeName=u,Be&&w.log(`[Tracing] Updated navigation span name from "${R}" to "${u}"`))}else Be&&w.log(`[Tracing] Skipping duplicate navigation for location: ${f}`);return}let S={span:{end:()=>{}},routeName:u,pathname:e.pathname,locationKey:f,isPlaceholder:!0};kl.set(c,S);let E;try{E=Wo(c,{name:S.routeName,attributes:{[Ot]:p,[ht]:"navigation",[at]:`auto.navigation.react.reactrouter${o?`_v${o}`:""}`}})}catch(R){throw kl.delete(c),R}E?(kl.set(c,{span:E,routeName:S.routeName,pathname:e.pathname,locationKey:f}),gT(E,e,n,a,"navigation")):kl.delete(c)}}function Tp(t){t.forEach(e=>{hO(e).forEach(r=>{An.add(r)})})}function hO(t,e=new Set){return e.has(t)||(e.add(t),t.children&&!t.index&&t.children.forEach(n=>{hO(n,e).forEach(o=>{e.add(o)})})),e}function wp({activeRootSpan:t,location:e,routes:n,matches:r,basename:o,allRoutes:i}){let a=Array.isArray(r)?r:po(i||n,e,o);if(a){let[s,l]=vp(e,i||n,i||n,a,o,Ep,rs);rt().setTransactionName(s||"/"),t&&(t.updateName(s),t.setAttribute(Ot,l),gT(t,e,n,o,"pageload"))}else t&&gT(t,e,n,o,"pageload")}function pY(t,e,n,r,o=!1){return n?!!(!t&&o||t&&Qi(t)&&r==="route"&&!Qi(n)||e!=="route"&&r==="route"):!1}function fT(t,e,n,r,o,i,a,s){try{let l=e.data?.[Ot];if(l==="route"&&n&&!Qi(n))return;let c=Array.from(s),d=c.length>0?c:o,u=po(d,r,i);if(!u)return;let[p,f]=vp(r,d,d,u,i,Ep,rs),m=pY(n,l,p,f,!0),_=a==="pageload"||!e.timestamp;m&&_&&(t.updateName(p),t.setAttribute(Ot,f))}catch(l){Be&&w.warn(`Error updating span details before ending: ${l}`)}}function gT(t,e,n,r,o){let i=`__sentry_${o}_end_patched__`;if(t?.[i]||!t.end)return;let s=t.end.bind(t),l=!1;t.end=function(...d){if(l)return;l=!0;let u=d.length>0?d[0]:Date.now()/1e3,p=et(t),f=p.description,m=p.data?.[Ot],_=()=>{let E=P();if(E&&o==="navigation"){let R=kl.get(E);R&&R.span===t&&kl.delete(E)}},v=my.get(t),h=t.__sentry_may_have_lazy_routes__;if((v&&v.size>0||h)&&f&&(Qi(f)||m!=="route")){if(Il===0){fT(t,p,f,e,n,r,o,An),_(),s(u);return}let E=new Promise(C=>setTimeout(C,Il)),R;if(v&&v.size>0){let C=Promise.allSettled(v).then(()=>{});R=Il===1/0?C:Promise.race([C,E])}else R=E;R.then(()=>{let C=et(t);fT(t,C,C.description,e,n,r,o,An),_(),s(u)}).catch(()=>{_(),s(u)});return}fT(t,p,f,e,n,r,o,An),_(),s(u)},Gt(t,i,!0)}function Vu(t,e){if(!Hu||!es||!ns||!py||!po)return Be&&w.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.
|
|
507
|
+
or you can use record.mirror to access the mirror instance during recording.`,h2={map:{},getId(){return console.error(Du),-1},getNode(){return console.error(Du),null},removeNodeFromMap(){console.error(Du)},has(){return console.error(Du),!1},reset(){console.error(Du)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(h2=new Proxy(h2,{get(t,e,n){return e==="map"&&console.error(Du),Reflect.get(t,e,n)}}));function VE(t,e,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(a){w2(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>VE(t,e,i||{},!0)}function YE(t,e,n){try{if(!(e in t))return()=>{};let r=t[e],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=o,()=>{t[e]=r}}catch{return()=>{}}}Date.now().toString();function Tq(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function ey(t,e,n,r,o){if(!t)return!1;let i=Tq(t);if(!i)return!1;let a=g2(e,n);if(!o){let c=r&&i.matches(r);return a(i)&&!c}let s=jE(i,a),l=-1;return s<0?!1:(r&&(l=jE(i,g2(null,r))),s>-1&&l<0?!0:s<l)}var b2={};function T2(t){let e=b2[t];if(e)return e;let n=window.document,r=window[t];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[t]&&(r=i[t]),n.head.removeChild(o)}catch{}return b2[t]=r.bind(window)}function El(...t){return T2("requestAnimationFrame")(...t)}function w2(...t){return T2("setTimeout")(...t)}var Uu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Uu||{}),Zb;function wq(t){Zb=t}var GE=t=>Zb?((...n)=>{try{return t(...n)}catch(r){if(Zb&&Zb(r)===!0)return()=>{};throw r}}):t,Lu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xq=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(mp=0;mp<Lu.length;mp++)xq[Lu.charCodeAt(mp)]=mp;var mp,Aq=function(t){var e=new Uint8Array(t),n,r=e.length,o="";for(n=0;n<r;n+=3)o+=Lu[e[n]>>2],o+=Lu[(e[n]&3)<<4|e[n+1]>>4],o+=Lu[(e[n+1]&15)<<2|e[n+2]>>6],o+=Lu[e[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},y2=new Map;function kq(t,e){let n=y2.get(t);return n||(n=new Map,y2.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}var x2=(t,e,n)=>{if(!t||!(k2(t,e)||typeof t=="object"))return;let r=t.constructor.name,o=kq(n,r),i=o.indexOf(t);return i===-1&&(i=o.length,o.push(t)),i};function ty(t,e,n){if(t instanceof Array)return t.map(r=>ty(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){let r=t.constructor.name,o=Aq(t);return{rr_type:r,base64:o}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[ty(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){let r=t.constructor.name,{src:o}=t;return{rr_type:r,src:o}}else if(t instanceof HTMLCanvasElement){let r="HTMLImageElement",o=t.toDataURL();return{rr_type:r,src:o}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[ty(t.data,e,n),t.width,t.height]};if(k2(t,e)||typeof t=="object"){let r=t.constructor.name,o=x2(t,e,n);return{rr_type:r,index:o}}}}return t}var A2=(t,e,n)=>t.map(r=>ty(r,e,n)),k2=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof e[o]=="function").find(o=>t instanceof e[o]);function Iq(t,e,n,r,o){let i=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let s of a)try{if(typeof e.CanvasRenderingContext2D.prototype[s]!="function")continue;let l=YE(e.CanvasRenderingContext2D.prototype,s,function(c){return function(...d){return ey(this.canvas,n,r,o,!0)||w2(()=>{let u=A2(d,e,this);t(this.canvas,{type:Uu["2D"],property:s,args:u})},0),c.apply(this,d)}});i.push(l)}catch{let l=VE(e.CanvasRenderingContext2D.prototype,s,{set(c){t(this.canvas,{type:Uu["2D"],property:s,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(s=>s())}}function Rq(t){return t==="experimental-webgl"?"webgl":t}function _2(t,e,n,r,o){let i=[];try{let a=YE(t.HTMLCanvasElement.prototype,"getContext",function(s){return function(l,...c){if(!ey(this,e,n,r,!0)){let d=Rq(l);if("__context"in this||(this.__context=d),o&&["webgl","webgl2"].includes(d))if(c[0]&&typeof c[0]=="object"){let u=c[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[l,...c])}});i.push(a)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(a=>a())}}function v2(t,e,n,r,o,i,a,s){let l=[],c=Object.getOwnPropertyNames(t);for(let d of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof t[d]!="function")continue;let u=YE(t,d,function(p){return function(...f){let m=p.apply(this,f);if(x2(m,s,this),"tagName"in this.canvas&&!ey(this.canvas,r,o,i,!0)){let _=A2(f,s,this),v={type:e,property:d,args:_};n(this.canvas,v)}return m}});l.push(u)}catch{let u=VE(t,d,{set(p){n(this.canvas,{type:e,property:d,args:[p],setter:!0})}});l.push(u)}return l}function Nq(t,e,n,r,o,i){let a=[];return a.push(...v2(e.WebGLRenderingContext.prototype,Uu.WebGL,t,n,r,o,i,e)),typeof e.WebGL2RenderingContext<"u"&&a.push(...v2(e.WebGL2RenderingContext.prototype,Uu.WebGL2,t,n,r,o,i,e)),()=>{a.forEach(s=>s())}}var Cq='for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};';function Mq(){let t=new Blob([Cq]);return URL.createObjectURL(t)}var qE=class{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(s,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(l)};let{enableManualSnapshot:n,sampling:r="all",win:o,recordCanvas:i,errorHandler:a}=e;e.sampling=r,this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,a&&wq(a),(i&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&GE(()=>{i&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof r=="number"&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(e){let{sampling:n="all",blockClass:r,blockSelector:o,unblockSelector:i,recordCanvas:a,enableManualSnapshot:s}=this.options;if(!this.windowsSet.has(e)){if(s){this.windowsSet.add(e),this.windows.push(new WeakRef(e));return}GE(()=>{if(a&&n==="all"&&this.initCanvasMutationObserver(e,r,o,i),a&&typeof n=="number"){let l=_2(e,r,o,i,!0);this.restoreHandlers.push(()=>{l()})}})(),this.windowsSet.add(e),this.windows.push(new WeakRef(e))}}addShadowRoot(e){this.shadowDoms.add(new WeakRef(e))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(e,n){if(n?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,e);return}El(r=>this.takeSnapshot(r,!0,e))}initFPSWorker(){let e=new Worker(Mq());return e.onmessage=n=>{let r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;let{base64:i,type:a,width:s,height:l}=r;this.mutationCb({id:o,type:Uu["2D"],commands:[{property:"clearRect",args:[0,0,s,l]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:a}]},0,0,s,l]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;let n=r=>{this.takeSnapshot(r,!1),e=El(n)};e=El(n),this.restoreHandlers.push(()=>{e&&cancelAnimationFrame(e)})}initCanvasMutationObserver(e,n,r,o){let i=_2(e,n,r,o,!1),a=Iq(this.processMutation.bind(this),e,n,r,o),s=Nq(this.processMutation.bind(this),e,n,r,o,this.mirror);this.restoreHandlers.push(()=>{i(),a(),s()})}getCanvasElements(e,n,r){let o=[],i=a=>{a.querySelectorAll("canvas").forEach(s=>{ey(s,e,n,r,!0)||o.push(s)})};for(let a of this.windows){let s=a.deref(),l;try{l=s&&s.document}catch{}l&&i(l)}for(let a of this.shadowDoms){let s=a.deref();s&&i(s)}return o}takeSnapshot(e,n,r){let{sampling:o,blockClass:i,blockSelector:a,unblockSelector:s,dataURLOptions:l,maxCanvasSize:c}=this.options,u=1e3/(o==="all"?2:o||2);return this.lastSnapshotTime&&e-this.lastSnapshotTime<u?!1:(this.lastSnapshotTime=e,(r?[r]:this.getCanvasElements(i,a,s)).forEach(m=>{let _=this.mirror.getId(m);if(!(!this.mirror.hasNode(m)||!m.width||!m.height||this.snapshotInProgressMap.get(_))){if(this.snapshotInProgressMap.set(_,!0),!n&&["webgl","webgl2"].includes(m.__context)){let v=m.getContext(m.__context);v?.getContextAttributes()?.preserveDrawingBuffer===!1&&v.clear(v.COLOR_BUFFER_BIT)}createImageBitmap(m).then(v=>{this.worker?.postMessage({id:_,bitmap:v,width:m.width,height:m.height,dataURLOptions:l,maxCanvasSize:c},[v])}).catch(v=>{GE(()=>{throw this.snapshotInProgressMap.delete(_),v})()})}}),!0)}startPendingCanvasMutationFlusher(){El(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=n=>{this.rafStamps.latestId=n,El(e)};El(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{let r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),El(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;let o=r.map(a=>{let{type:s,...l}=a;return l}),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(e)}};try{if(Array.from([1],t=>t*2)[0]!==2){let t=document.createElement("iframe");document.body.appendChild(t),Array.from=t.contentWindow?.Array.from||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}Sq();var S2;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(S2||(S2={}));var E2={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},Oq="ReplayCanvas",Qb=1280,Dq=((t={})=>{let[e,n]=t.maxCanvasSize||[],r={quality:t.quality||"medium",enableManualSnapshot:t.enableManualSnapshot,maxCanvasSize:[e?Math.min(e,Qb):Qb,n?Math.min(n,Qb):Qb]},o,i,a=new Promise(s=>i=s);return{name:Oq,getOptions(){let{quality:s,enableManualSnapshot:l,maxCanvasSize:c}=r;return{enableManualSnapshot:l,recordCanvas:!0,getCanvasManager:d=>{let u=new qE({...d,enableManualSnapshot:l,maxCanvasSize:c,errorHandler:p=>{try{typeof p=="object"&&(p.__rrweb__=!0)}catch{}}});return o=u,i(u),u},...E2[s]||E2.medium}},async snapshot(s,l){(o||await a).snapshot(s,l)}}}),I2=Dq;function R2(t){return t.split(",").some(e=>e.trim().startsWith("sentry-"))}function WE(t){try{return new URL(t,V.location.origin).href}catch{return}}function N2(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function KE(t){try{return new Headers(t)}catch{return}}var gp={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function ny(t,e){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:s,onRequestSpanEnd:l}={...gp,...e},c=typeof o=="function"?o:f=>!0,d=f=>Uq(f,a),u={},p=t.getOptions().propagateTraceparent;n&&hi(f=>{let m=Lv(f,c,d,u,{propagateTraceparent:p,onRequestSpanEnd:l});if(m){let _=WE(f.fetchData.url),v=_?Zr(_).host:void 0,h=_?Yn(_):void 0;m.setAttributes({"http.url":h,"url.full":h,"server.address":v}),i&&C2(m,t),s?.(m,{headers:f.headers})}}),r&&_l(f=>{let m=Bq(f,c,d,u,p,l);m&&(i&&C2(m,t),s?.(m,{headers:KE(f.xhr.__sentry_xhr_v3__?.request_headers)}))})}var Lq=300;function C2(t,e){let{url:n}=rt(t).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(qe(e)){let i=t.end.bind(t);t.end=a=>{let s=a??Mt(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(s),clearTimeout(d))};r=c;let d=setTimeout(c,Lq)}}let o=hr("resource",({entries:i})=>{i.forEach(a=>{N2(a)&&a.name.endsWith(n)&&(t.setAttributes(Wf(a)),r())})})}function Uq(t,e){let n=Kn();if(n){let r,o;try{r=new URL(t,n),o=new URL(n).origin}catch{return!1}let i=r.origin===o;return e?tn(r.toString(),e)||i&&tn(r.pathname,e):i}else{let r=!!t.match(/^\/(?!\/)/);return e?tn(t,e):r}}function Bq(t,e,n,r,o,i){let a=t.xhr,s=a?.[tr];if(!a||a.__sentry_own_request__||!s)return;let{url:l,method:c}=s,d=Le()&&e(l);if(t.endTimestamp){let S=a.__sentry_xhr_span_id__;if(!S)return;let E=r[S];E&&(d&&s.status_code!==void 0&&(ri(E,s.status_code),E.end(),i?.(E,{headers:KE(Jf(a)),error:t.error})),delete r[S]);return}let u=WE(l),p=u?Zr(u):Zr(l),f=u?Yn(u):void 0,m=Yn(Gc(l)),_=z(),h=!!Dt()||!!_&&qe(_),y=d&&h?Ae({name:`${c} ${m}`,attributes:{url:Yn(l),type:"xhr","http.method":c,"http.url":f,"url.full":f,"server.address":p?.host,[at]:"auto.http.browser",[ht]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new ur;return d&&!h&&_?.recordDroppedEvent("no_parent_span","span"),a.__sentry_xhr_span_id__=y.spanContext().spanId,r[a.__sentry_xhr_span_id__]=y,n(l)&&Pq(a,Le()&&h?y:void 0,o),_&&_.emit("beforeOutgoingRequestSpan",y,t),y}function Pq(t,e,n){let{"sentry-trace":r,baggage:o,traceparent:i}=el({span:e,propagateTraceparent:n});r&&zq(t,r,o,i)}function zq(t,e,n,r){let o=t.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!t.setRequestHeader))try{if(t.setRequestHeader("sentry-trace",e),r&&!o?.traceparent&&t.setRequestHeader("traceparent",r),n){let i=o?.baggage;(!i||!R2(i))&&t.setRequestHeader("baggage",n)}}catch{}}var M2=new WeakMap,O2=new WeakMap,Fq=9e4,Hq=["text/event-stream","application/x-ndjson","application/stream+json"],ry=()=>({name:"FetchStreamPerformance",setup(){Uh(t=>{if(t.response){let e=M2.get(t.response);if(e&&t.endTimestamp){e.end(t.endTimestamp);let n=O2.get(t.response);n&&clearTimeout(n)}}}),hi(t=>{if(t.endTimestamp&&t.response){let e=t.response.headers?.get("content-type")||"";if(t.response.headers?.get("content-length")||!Hq.some(l=>e.startsWith(l)))return;let n=t.fetchData?.url||"",r=t.fetchData?.method||"GET",o=ui(n),i=n.startsWith("data:")?Yn(n):o?Hc(o):n,a=Ae({name:`${r} ${i}`,startTime:t.endTimestamp,attributes:{url:Yn(n),"http.method":r,type:"fetch",[ht]:"http.client.stream",[at]:"auto.http.browser.stream"}});M2.set(t.response,a);let s=setTimeout(()=>{a.isRecording()&&a.end()},Fq);O2.set(t.response,s)}})}});var XE="WebVitals",oy=(t={})=>{let e=new Set(t.ignore??[]);return{name:XE,setup(n){let r=qe(n),{enableStandaloneClsSpans:o,enableStandaloneLcpSpans:i}=t._experiments??{},a=r||e.has("cls")?void 0:o||!1,s=r||e.has("lcp")?void 0:i||!1,l=kS({recordClsStandaloneSpans:a,recordLcpStandaloneSpans:s,client:n}),c=new WeakSet;n.on("afterStartPageLoadSpan",d=>{c.add(d)}),n.on("spanEnd",d=>{c.delete(d)&&(l(),MS(d,{recordClsOnPageloadSpan:a===!1,recordLcpOnPageloadSpan:s===!1,spanStreamingEnabled:r}))}),r?(e.has("lcp")||zS(n),e.has("cls")||FS(n),e.has("inp")||HS()):e.has("inp")||US()},afterAllSetup(){e.has("inp")||BS()}}};function D2(){V.document?V.document.addEventListener("visibilitychange",()=>{let t=Dt();if(!t)return;let e=Bt(t);if(V.document.hidden&&e){let n="cancelled",{op:r,status:o}=rt(e);W&&w.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||e.setStatus({code:2,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):W&&w.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Gq=3600,L2="sentry_previous_trace",$q="sentry.previous_trace";function U2(t,{linkPreviousTrace:e,consistentTraceSampling:n}){let r=e==="session-storage",o=r?Vq():void 0;t.on("spanStart",a=>{if(Bt(a)!==a)return;let s=it().getPropagationContext();o=jq(o,a,s),r&&qq(o)});let i=!0;n&&t.on("beforeSampling",a=>{if(!o)return;let s=it(),l=s.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}s.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(JE(o.spanContext))},sampleRand:o.sampleRand}),a.parentSampled=JE(o.spanContext),a.parentSampleRate=o.sampleRate,a.spanAttributes={...a.spanAttributes,[Tc]:o.sampleRate}})}function jq(t,e,n){let r=rt(e);function o(){try{let s=Number(r.data?.[ni]??n.dsc?.sample_rate);return Number.isNaN(s)?0:s}catch{return 0}}let i={spanContext:e.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!t)return i;let a=t.spanContext;return a.traceId===r.trace_id?t:(Date.now()/1e3-t.startTimestamp<=Gq&&(W&&w.log(`Adding previous_trace \`${JSON.stringify(a)}\` link to span \`${JSON.stringify({op:r.op,...e.spanContext()})}\``),e.addLink({context:a,attributes:{[Eg]:"previous_trace"}}),e.setAttribute($q,`${a.traceId}-${a.spanId}-${JE(a)?1:0}`)),i)}function qq(t){try{V.sessionStorage.setItem(L2,JSON.stringify(t))}catch(e){W&&w.warn("Could not store previous trace in sessionStorage",e)}}function Vq(){try{let t=V.sessionStorage?.getItem(L2);return JSON.parse(t)}catch{return}}function JE(t){return t.traceFlags===1}var Yq="BrowserTracing",Wq=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function QE(){let t=V.navigator;return t?.userAgent?Wq.test(t.userAgent):!1}var Kq={...Cc,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...gp},Br=((t={})=>{"enableElementTiming"in t&&pn(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let e={name:void 0,source:void 0},n=V.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:a,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:d,finalTimeout:u,childSpanTimeout:p,markBackgroundSpan:f,traceFetch:m,traceXHR:_,trackFetchStreamPerformance:v,shouldCreateSpanForRequest:h,enableHTTPTimings:y,ignoreResourceSpans:S,ignorePerformanceApiSpans:E,instrumentPageLoad:R,instrumentNavigation:C,detectRedirects:k,linkPreviousTrace:L,consistentTraceSampling:F,enableReportPageLoaded:U,onRequestSpanStart:D,onRequestSpanEnd:N}={...Kq,...t},B=QE(),Y,st;function ot(lt,X,ct=!0){let H=X.op==="pageload",gt=X.name,J=c?c(X):X,dt=J.attributes||{};if(gt!==J.name&&(dt[Ot]="custom",J.attributes=dt),!ct){let _n=sr();Ae({...J,startTime:_n}).end(_n);return}e.name=J.name,e.source=dt[Ot];let Xt=Fg(J,{idleTimeout:d,finalTimeout:u,childSpanTimeout:p,disableAutoFinish:H,beforeSpanEnd:_n=>{CS(_n,{ignoreResourceSpans:S,ignorePerformanceApiSpans:E,spanStreamingEnabled:qe(lt)}),z2(lt,void 0);let Pn=it(),tt=Pn.getPropagationContext();Pn.setPropagationContext({...tt,traceId:Xt.spanContext().traceId,sampled:Tn(Xt),dsc:je(_n)}),H&&(st=void 0)},trimIdleSpanEndTimestamp:!U});H&&U&&(st=Xt),z2(lt,Xt);function Ce(){n&&["interactive","complete"].includes(n.readyState)&&(lt.emit("idleSpanEnableAutoFinish",Xt),n.removeEventListener("readystatechange",Ce))}H&&!U&&n&&(n.addEventListener("readystatechange",Ce),Ce())}return{name:Yq,setup(lt){if(B){W&&w.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(mf(),i&&nt.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?RS():o&&IS(),a&&NS(),k&&n){let ct=()=>{Y=Mt()};addEventListener("click",ct,{capture:!0}),addEventListener("keydown",ct,{capture:!0,passive:!0})}function X(){let ct=hp(lt);ct&&!rt(ct).timestamp&&(W&&w.log(`[Tracing] Finishing current active span with op: ${rt(ct).op}`),ct.setAttribute(Li,"cancelled"),ct.end())}lt.on("startNavigationSpan",(ct,H)=>{if(z()!==lt)return;if(H?.isRedirect){W&&w.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ot(lt,{op:"navigation.redirect",...ct},!1);return}Y=void 0,X(),Pt().setPropagationContext({traceId:Cn(),sampleRand:Math.random(),propagationSpanId:Le()?void 0:Gn()});let gt=it();gt.setPropagationContext({traceId:Cn(),sampleRand:Math.random(),propagationSpanId:Le()?void 0:Gn()}),gt.setSDKProcessingMetadata({normalizedRequest:void 0}),ot(lt,{op:"navigation",...ct,parentSpan:null,forceTransaction:!0})}),lt.on("startPageLoadSpan",(ct,H={})=>{if(z()!==lt)return;X();let gt=H.sentryTrace||B2("sentry-trace")||P2("sentry-trace"),J=H.baggage||B2("baggage")||P2("baggage"),dt=sf(gt,J),Xt=it();Xt.setPropagationContext(dt),Le()||(Xt.getPropagationContext().propagationSpanId=Gn()),Xt.setSDKProcessingMetadata({normalizedRequest:cu()}),ot(lt,{op:"pageload",...ct})}),lt.on("endPageloadSpan",()=>{U&&st&&(st.setAttribute(Li,"reportPageLoaded"),st.end())})},afterAllSetup(lt){if(B)return;lt.addIntegration&&!lt.getIntegrationByName?.(XE)&<.addIntegration(oy({ignore:r?[]:["inp"],_experiments:{enableStandaloneClsSpans:s,enableStandaloneLcpSpans:l}}));let X=Kn();if(L!=="off"&&U2(lt,{linkPreviousTrace:L,consistentTraceSampling:F}),V.location){if(R){let ct=re();Yo(lt,{name:V.location.pathname,startTime:ct?ct/1e3:void 0,attributes:{[Ot]:"url",[at]:"auto.pageload.browser"}})}C&&Wi(({to:ct,from:H})=>{if(H===void 0&&X?.indexOf(ct)!==-1){X=void 0;return}X=void 0;let gt=ui(ct),J=hp(lt),dt=J&&k&&Jq(J,Y);Wo(lt,{name:gt?.pathname||V.location.pathname,attributes:{[Ot]:"url",[at]:"auto.navigation.browser"}},{url:ct,isRedirect:dt})})}f&&D2(),a&&Xq(lt,d,u,p,e),ny(lt,{traceFetch:m,traceXHR:_,tracePropagationTargets:lt.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:h,enableHTTPTimings:y,onRequestSpanStart:D,onRequestSpanEnd:N}),v&<.addIntegration(ry())}}});function Yo(t,e,n){t.emit("startPageLoadSpan",e,n),it().setTransactionName(e.name);let r=hp(t);return r&&t.emit("afterStartPageLoadSpan",r),r}function Wo(t,e,n){let{url:r,isRedirect:o}=n||{};t.emit("beforeStartNavigationSpan",e,{isRedirect:o}),t.emit("startNavigationSpan",e,{isRedirect:o});let i=it();return i.setTransactionName(e.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...cu(),url:r}}),hp(t)}function B2(t){return V.document?.querySelector(`meta[name=${t}]`)?.getAttribute("content")||void 0}function P2(t){return V.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===t)?.description}function Xq(t,e,n,r,o){let i=V.document,a,s=()=>{let l="ui.action.click",c=hp(t);if(c){let d=rt(c).op;if(["navigation","pageload"].includes(d)){W&&w.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(a&&(a.setAttribute(Li,"interactionInterrupted"),a.end(),a=void 0),!o.name){W&&w.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}a=Fg({name:o.name,op:l,attributes:{[Ot]:o.source||"url"}},{idleTimeout:e,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",s,{capture:!0})}var H2="_sentry_idleSpan";function hp(t){return t[H2]}function z2(t,e){Gt(t,H2,e)}var F2=1.5;function Jq(t,e){let n=rt(t),r=sr(),o=n.start_timestamp;return!(r-o>F2||e&&r-e<=F2)}function G2(t=z()){t?.emit("endPageloadSpan")}function $2(t){let e=Dt();if(e===t)return;let n=it();t.end=new Proxy(t.end,{apply(r,o,i){return Zn(n,e),Reflect.apply(r,o,i)}}),Zn(n,t)}var j2=()=>({name:"SpanStreaming",beforeSetup(t){let e=t.getOptions();e.traceLifecycle||(W&&w.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),e.traceLifecycle="stream")},setup(t){let e="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=t.getOptions();if(!qe(t)){r.traceLifecycle="static",W&&w.warn(`${e} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!Pi(o)){r.traceLifecycle="static",W&&w.warn(`${e} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let i=new Hf(t);t.on("afterSpanEnd",a=>{Tn(a)&&i.add(Gg(a,t))}),t.on("afterSegmentSpanEnd",a=>{let s=a.spanContext().traceId;setTimeout(()=>{i.flush(s)},500)})}});function Bu(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Qq(t,e){let n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);let r=Bu(n);return o=>r.then(i=>o(i.transaction(e,"readwrite").objectStore(e)))}function ZE(t){return Bu(t.getAllKeys())}function Zq(t,e,n){return t(r=>ZE(r).then(o=>{if(!(o.length>=n))return r.put(e,Math.max(...o,0)+1),Bu(r.transaction)}))}function tV(t,e,n){return t(r=>ZE(r).then(o=>{if(!(o.length>=n))return r.put(e,Math.min(...o,0)-1),Bu(r.transaction)}))}function eV(t){return t(e=>ZE(e).then(n=>{let r=n[0];if(r!=null)return Bu(e.get(r)).then(o=>(e.delete(r),Bu(e.transaction).then(()=>o)))}))}function nV(t){let e;function n(){return e==null&&(e=Qq(t.dbName||"sentry-offline",t.storeName||"queue")),e}return{push:async r=>{try{let o=zi(r);await Zq(n(),o,t.maxQueueSize||30)}catch{}},unshift:async r=>{try{let o=zi(r);await tV(n(),o,t.maxQueueSize||30)}catch{}},shift:async()=>{try{let r=await eV(n());if(r)return Ug(r)}catch{}}}}function rV(t){return e=>{let n=t({...e,createStore:nV});return V.addEventListener("online",async r=>{await n.flush()}),n}}function q2(t=Su){return rV(bv(t))}var V2=1e6,oV="window"in nt&&nt.window===nt&&typeof importScripts>"u",wl=String(0),eT=oV?"main":"worker",iy=V.navigator,W2="",K2="",X2="",tT=iy?.userAgent||"",J2="",iV=iy?.language||iy?.languages?.[0]||"";function aV(t){return typeof t=="object"&&t!==null&&"getHighEntropyValues"in t}var Y2=iy?.userAgentData;aV(Y2)&&Y2.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(t=>{if(W2=t.platform||"",X2=t.architecture||"",J2=t.model||"",K2=t.platformVersion||"",t.fullVersionList?.length){let e=t.fullVersionList[t.fullVersionList.length-1];tT=`${e.brand} ${e.version}`}}).catch(t=>{});function sV(t){return!("thread_metadata"in t)}function lV(t){return sV(t)?fV(t):t}function cV(t){let e=t.contexts?.trace?.trace_id;return typeof e=="string"&&e.length!==32&&W&&w.log(`[Profiling] Invalid traceId: ${e} on profiled event`),typeof e!="string"?"":e}function uV(t,e,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let o=cV(r),i=lV(n),a=e||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:Mt()*1e3),s=typeof r.timestamp=="number"?r.timestamp*1e3:Mt()*1e3;return{event_id:t,timestamp:new Date(a).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||zo,runtime:{name:"javascript",version:V.navigator.userAgent},os:{name:W2,version:K2,build_number:tT},device:{locale:iV,model:J2,manufacturer:tT,architecture:X2,is_emulator:!1},debug_meta:{images:nM(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||ae(),trace_id:o,active_thread_id:wl,relative_start_ns:"0",relative_end_ns:((s-a)*1e6).toFixed(0)}]}}function Q2(t,e,n){if(t==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${t} instead.`);let r=dV(t),o=e.getOptions(),i=e.getSdkMetadata?.()?.sdk;return{chunk_id:ae(),client_sdk:{name:i?.name??"sentry.javascript.browser",version:i?.version??"0.0.0"},profiler_id:n||ae(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:nM(t.resources)},profile:r}}function Z2(t){try{if(!t||typeof t!="object")return{reason:"chunk is not an object"};let e=r=>typeof r=="string"&&/^[a-f0-9]{32}$/.test(r);if(!e(t.profiler_id))return{reason:"missing or invalid profiler_id"};if(!e(t.chunk_id))return{reason:"missing or invalid chunk_id"};if(!t.client_sdk)return{reason:"missing client_sdk metadata"};let n=t.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:"profile has no frames"}:!Array.isArray(n.stacks)||!n.stacks.length?{reason:"profile has no stacks"}:!Array.isArray(n.samples)||!n.samples.length?{reason:"profile has no samples"}:{valid:!0}:{reason:"missing profile data"}}catch(e){return{reason:`unknown validation error: ${e}`}}}function dV(t){let e=[];for(let s=0;s<t.frames.length;s++){let l=t.frames[s];l&&(e[s]={function:l.name,abs_path:typeof l.resourceId=="number"?t.resources[l.resourceId]:void 0,lineno:l.line,colno:l.column})}let n=[];for(let s=0;s<t.stacks.length;s++){let l=t.stacks[s];if(!l)continue;let c=[],d=l;for(;d;)c.push(d.frameId),d=d.parentId===void 0?void 0:t.stacks[d.parentId];n[s]=c}let r=re(),o=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,i=o-(r||o),a=[];for(let s=0;s<t.samples.length;s++){let l=t.samples[s];if(!l)continue;let c=(o+(l.timestamp-i))/1e3;a[s]={stack_id:l.stackId??0,thread_id:wl,timestamp:c}}return{frames:e,stacks:n,samples:a,thread_metadata:{[wl]:{name:eT}}}}function ay(t){return rt(t).op==="pageload"}function fV(t){let e,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[wl]:{name:eT}}},o=t.samples[0];if(!o)return r;let i=o.timestamp,a=re(),s=typeof performance.timeOrigin=="number"?performance.timeOrigin:a||0,l=s-(a||s);return t.samples.forEach((c,d)=>{if(c.stackId===void 0){e===void 0&&(e=n,r.stacks[e]=[],n++),r.samples[d]={elapsed_since_start_ns:((c.timestamp+l-i)*V2).toFixed(0),stack_id:e,thread_id:wl};return}let u=t.stacks[c.stackId],p=[];for(;u;){p.push(u.frameId);let m=t.frames[u.frameId];m&&r.frames[u.frameId]===void 0&&(r.frames[u.frameId]={function:m.name,abs_path:typeof m.resourceId=="number"?t.resources[m.resourceId]:void 0,lineno:m.line,colno:m.column}),u=u.parentId===void 0?void 0:t.stacks[u.parentId]}let f={elapsed_since_start_ns:((c.timestamp+l-i)*V2).toFixed(0),stack_id:n,thread_id:wl};r.stacks[n]=p,r.samples[d]=f,n++}),r}function tM(t,e){if(!e.length)return t;for(let n of e)t[1].push([{type:"profile"},n]);return t}function eM(t){let e=[];return dr(t,(n,r)=>{if(r==="transaction")for(let o=1;o<n.length;o++)n[o]?.contexts?.profile?.profile_id&&e.push(n[o])}),e}function nM(t){let r=z()?.getOptions()?.stackParser;return r?Q0(r,t):[]}function rM(t){return typeof t!="number"&&typeof t!="boolean"||typeof t=="number"&&isNaN(t)?(W&&w.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t===!0||t===!1?!0:t<0||t>1?(W&&w.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function pV(t){return t.samples.length<2?(W&&w.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):t.frames.length?!0:(W&&w.log("[Profiling] Discarding profile because it contains no frames"),!1)}var nT=!1,rT=3e4;function mV(t){return typeof t=="function"}function sy(){let t=V.Profiler;if(!mV(t)){W&&w.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}let e=10,n=Math.floor(rT/e);try{return new t({sampleInterval:e,maxBufferSize:n})}catch{W&&(w.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),w.log("[Profiling] Disabling profiling for current user session.")),nT=!0}}function oT(t){if(nT)return W&&w.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!t.isRecording())return W&&w.log("[Profiling] Discarding profile because root span was not sampled."),!1;let n=z()?.getOptions();if(!n)return W&&w.log("[Profiling] Profiling disabled, no options found."),!1;let r=n.profilesSampleRate;return rM(r)?r?(r===!0?!0:Math.random()<r)?!0:(W&&w.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(W&&w.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(W&&w.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function oM(t){if(nT)return W&&w.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if(t.profileLifecycle!=="trace"&&t.profileLifecycle!=="manual")return W&&w.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let e=t.profileSessionSampleRate;return rM(e)?e?Math.random()<=e:(W&&w.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(W&&w.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function bp(t){return typeof t.profilesSampleRate<"u"}function iM(t,e,n,r){return pV(n)?uV(t,e,n,r):null}var Tl=new Map;function aM(){return Tl.size}function sM(t){let e=Tl.get(t);return e&&Tl.delete(t),e}function lM(t,e){if(Tl.set(t,e),Tl.size>30){let n=Tl.keys().next().value;n!==void 0&&Tl.delete(n)}}var ly=new WeakSet;function xl(t){t.setAttribute("thread.id",wl),t.setAttribute("thread.name",eT)}function iT(t){let e;ay(t)&&(e=Mt()*1e3);let n=sy();if(!n)return;W&&w.log(`[Profiling] started profiling span: ${rt(t).description}`);let r=ae(),o=null;it().setContext("profile",{profile_id:r,start_timestamp:e}),ly.add(t),xl(t);async function i(){if(t&&n){if(o){W&&w.log("[Profiling] profile for:",rt(t).description,"already exists, returning early");return}return n.stop().then(c=>{if(a&&(V.clearTimeout(a),a=void 0),W&&w.log(`[Profiling] stopped profiling of span: ${rt(t).description}`),!c){W&&w.log(`[Profiling] profiler returned null profile for: ${rt(t).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=c,lM(r,c)}).catch(c=>{W&&w.log("[Profiling] error while stopping profiler:",c)})}}let a=V.setTimeout(()=>{W&&w.log("[Profiling] max profile duration elapsed, stopping profiling for:",rt(t).description),i()},rT),s=t.end.bind(t);function l(){return t?(i().then(()=>{s()},()=>{s()}),t):s()}t.end=l}var gV=6e4,hV=3e5,cy=class{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(e){let n=e.getOptions().profileLifecycle,r=oM(e.getOptions());W&&w.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||W&&w.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=ae(),this._client=e,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(e),e.on("spanStart",o=>{this._isRunning&&xl(o)})}start(){if(this._lifecycleMode==="trace"){W&&w.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){W&&w.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){W&&w.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){W&&w.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){W&&w.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(e){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;let n=e.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);let r=this._activeRootSpanIds.size;r===1&&(W&&w.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling()),this._isRunning&&xl(e)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,W&&w.log("[Profiling] Started profiling with profiler ID:",this._profilerId),lr().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){W&&w.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(e=>{W&&w.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)}),this._lifecycleMode==="manual"&&lr().setContext("profile",{}))}_setupTraceLifecycleListeners(e){e.on("spanStart",n=>{if(!this._sessionSampled){W&&w.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==Bt(n))return;if(!n.isRecording()){W&&w.log("[Profiling] Discarding profile because root span was not sampled.");return}let r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);let o=this._activeRootSpanIds.size;o===1&&(W&&w.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${o}).`),this._beginProfiling())}),e.on("spanEnd",n=>{if(!this._sessionSampled)return;let r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);let o=this._activeRootSpanIds.size;W&&w.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${o}).`),o===0&&(this._collectCurrentChunk().catch(i=>{W&&w.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,lr().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(e=>clearTimeout(e)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(e){this._activeRootSpanIds.add(e);let n=setTimeout(()=>this._onRootSpanTimeout(e),hV);this._rootSpanTimeouts.set(e,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let e=sy();if(!e){W&&w.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=e}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{W&&w.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",e)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},gV))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(W&&w.log(`[Profiling] Reached 5-minute timeout for root span ${e}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(e),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){let e=this._profiler;if(this._profiler=void 0,!!e)try{let n=await e.stop(),r=Q2(n,this._client,this._profilerId),o=Z2(r);if("reason"in o){W&&w.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),W&&w.log("[Profiling] Collected browser profile chunk.")}catch(n){W&&w.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(e){let n=this._client,r=Fo(n.getSdkMetadata?.()),o=n.getDsn(),i=n.getOptions().tunnel,a=Ue({event_id:ae(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&o&&{dsn:en(o)}},[[{type:"profile_chunk",platform:"javascript"},e]]);n.sendEnvelope(a).then(null,s=>{W&&w.error("Error while sending profile chunk envelope:",s)})}};var bV="BrowserProfiling",yV=(()=>({name:bV,setup(t){let e=t.getOptions(),n=new cy;if(!bp(e)&&!e.profileLifecycle&&(e.profileLifecycle="manual"),bp(e)&&!e.profilesSampleRate){W&&w.log("[Profiling] Profiling disabled, no profiling options found.");return}let r=Dt(),o=r&&Bt(r);if(bp(e)&&e.profileSessionSampleRate!==void 0&&W&&w.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),bp(e))o&&ay(o)&&oT(o)&&iT(o),t.on("spanStart",i=>{let a=Bt(i);i===a?oT(i)&&iT(i):ly.has(a)&&xl(i)}),t.on("beforeEnvelope",i=>{if(!aM())return;let a=eM(i);if(!a.length)return;let s=[];for(let l of a){let c=l?.contexts,d=c?.profile?.profile_id,u=c?.profile?.start_timestamp;if(typeof d!="string"){W&&w.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!d){W&&w.log("[Profiling] cannot find profile for a span without a profile context");continue}c?.profile&&delete c.profile;let p=sM(d);if(!p){W&&w.log(`[Profiling] Could not retrieve profile for span: ${d}`);continue}let f=iM(d,u,p,l);f&&s.push(f)}tM(i,s)});else{let i=e.profileLifecycle;if(t.on("startUIProfiler",()=>n.start()),t.on("stopUIProfiler",()=>n.stop()),i==="manual")n.initialize(t);else if(i==="trace"){if(!Le(e)){W&&w.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(t),o&&n.notifyRootSpanActive(o),V.setTimeout(()=>{let a=Dt(),s=a&&Bt(a);s&&n.notifyRootSpanActive(s)},0)}}}})),cM=yV;var _V="SpotlightBrowser",vV=[{op:"ui.interaction.click",name:"#sentry-spotlight"}],SV=((t={})=>{let e=t.sidecarUrl||"http://localhost:8969/stream";return{name:_V,setup:()=>{W&&w.log("Using Sidecar URL",e)},beforeSetup(n){let r=n.getOptions();r.ignoreSpans=[...r.ignoreSpans||[],...vV]},afterAllSetup:n=>{EV(n,e)}}});function EV(t,e){let n=_u("fetch"),r=0;t.on("beforeEnvelope",o=>{if(r>3){w.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(e,{method:"POST",body:zi(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,w.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}var uM=SV;var dM=()=>({name:"LaunchDarkly",processEvent(t,e,n){return Cr(t)}});function fM(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(t,e,n)=>{fr(t,e.value),pr(t,e.value)}}}var pM=()=>({name:"OpenFeature",processEvent(t,e,n){return Cr(t)}}),uy=class{after(e,n){fr(n.flagKey,n.value),pr(n.flagKey,n.value)}error(e,n,r){fr(e.flagKey,e.defaultValue),pr(e.flagKey,e.defaultValue)}};var mM=({featureFlagClientClass:t})=>({name:"Unleash",setupOnce(){let e=t.prototype;be(e,"isEnabled",TV)},processEvent(e,n,r){return Cr(e)}});function TV(t){return function(...e){let n=e[0],r=t.apply(this,e);return typeof n=="string"&&typeof r=="boolean"?(fr(n,r),pr(n,r)):W&&w.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var gM=(({growthbookClass:t})=>Ov({growthbookClass:t}));var hM=({featureFlagClient:t})=>({name:"Statsig",setup(e){t.on("gate_evaluation",n=>{fr(n.gate.name,n.gate.value),pr(n.gate.name,n.gate.value)})},processEvent(e,n,r){return Cr(e)}});async function bM(){let t=z();if(!t)return"no-client-active";if(!t.getDsn())return"no-dsn-configured";let r=t.getOptions().tunnel||"https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";try{await Nc(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}var wV="WebWorker",_M=({worker:t})=>({name:wV,setupOnce:()=>{(Array.isArray(t)?t:[t]).forEach(e=>yM(e))},addWorker:e=>yM(e)});function yM(t){t.addEventListener("message",e=>{if(AV(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(W&&w.log("Sentry debugId web worker message received",e.data),V._sentryDebugIds={...e.data._sentryDebugIds,...V._sentryDebugIds}),e.data._sentryModuleMetadata&&(W&&w.log("Sentry module metadata web worker message received",e.data),V._sentryModuleMetadata={...e.data._sentryModuleMetadata,...V._sentryModuleMetadata}),e.data._sentryWasmImages){W&&w.log("Sentry WASM images web worker message received",e.data);let n=V._sentryWasmImages||[],r=e.data._sentryWasmImages.filter(o=>he(o)&&typeof o.code_file=="string"&&!n.some(i=>i.code_file===o.code_file));V._sentryWasmImages=[...n,...r]}e.data._sentryWorkerError&&(W&&w.log("Sentry worker rejection message received",e.data._sentryWorkerError),xV(e.data._sentryWorkerError))}})}function xV(t){let e=z();if(!e)return;let n=e.getOptions().stackParser,r=e.getOptions().attachStacktrace,o=t.reason,i=Ze(o)?XS(o):du(n,o,void 0,r,!0);i.level="error",t.filename&&(i.contexts={...i.contexts,worker:{filename:t.filename}}),Qr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),W&&w.log("Captured worker unhandled rejection",o)}function vM({self:t}){t.postMessage({_sentryMessage:!0,_sentryDebugIds:t._sentryDebugIds??void 0,_sentryModuleMetadata:t._sentryModuleMetadata??void 0}),t.addEventListener("unhandledrejection",e=>{let r={reason:KS(e),filename:t.location?.href};t.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),W&&w.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),W&&w.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function AV(t){if(!he(t)||t._sentryMessage!==!0)return!1;let e="_sentryDebugIds"in t,n="_sentryModuleMetadata"in t,r="_sentryWorkerError"in t,o="_sentryWasmImages"in t;return!(!e&&!n&&!r&&!o||e&&!(he(t._sentryDebugIds)||t._sentryDebugIds===void 0)||n&&!(he(t._sentryModuleMetadata)||t._sentryModuleMetadata===void 0)||r&&!he(t._sentryWorkerError)||o&&(!Array.isArray(t._sentryWasmImages)||!t._sentryWasmImages.every(i=>he(i)&&typeof i.code_file=="string")))}var EM=Kr(Ea(),1);function SM(t){return he(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function dy(t){let e={...t};Mf(e,"react"),La("react",{version:EM.version});let n=QS(e);return _c(kV),n}function kV(t){return SM(t)?"[SyntheticEvent]":Tu(t)}var TM=Kr(Ea(),1);function IV(t){let e=t.match(/^([^.]+)/);return e!==null&&parseInt(e[0])>=17}function RV(t,e){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(t,e)}function yp(t,{componentStack:e},n){if(IV(TM.version)&&mn(t)&&e){let r=new Error(t.message);r.name=`React ErrorBoundary ${t.name}`,r.stack=e,RV(t,r)}return Et(t,n)}function wM(t){return(e,n)=>{let r=!!t,o=yp(e,n,{mechanism:{handled:r,type:"auto.function.react.error_handler"}});r&&t(e,n,o)}}var Ji=Kr(Ea(),1);var aT="ui.react.render",xM="ui.react.update",sT="ui.react.mount";var NV={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},CV={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},MV={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},NM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},OV=Symbol.for("react.forward_ref"),CM=Symbol.for("react.memo");function DV(t){return typeof t=="object"&&t!==null&&t.$$typeof===CM}var lT={};lT[OV]=MV;lT[CM]=NM;function AM(t){if(DV(t))return NM;let e=t.$$typeof;return e&&lT[e]||NV}var LV=Object.defineProperty.bind(Object),UV=Object.getOwnPropertyNames.bind(Object),kM=Object.getOwnPropertySymbols?.bind(Object),IM=Object.getOwnPropertyDescriptor.bind(Object),BV=Object.getPrototypeOf.bind(Object),RM=Object.prototype;function Xi(t,e,n){if(typeof e!="string"){if(RM){let a=BV(e);a&&a!==RM&&Xi(t,a)}let r=UV(e);kM&&(r=r.concat(kM(e)));let o=AM(t),i=AM(e);for(let a of r)if(!CV[a]&&!i?.[a]&&!o?.[a]&&!IM(t,a)){let s=IM(e,a);if(s)try{LV(t,a,s)}catch{}}}return t}var PV="unknown",Pu=class extends Ji.Component{constructor(e){super(e);let{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=Ae({name:`<${n}>`,onlyIfParent:!0,op:sT,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":n}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:e,includeUpdates:n=!0}){if(n&&this._mountSpan&&e!==this.props.updateProps){let r=Object.keys(e).filter(o=>e[o]!==this.props.updateProps[o]);if(r.length>0){let o=Mt();this._updateSpan=Jr(this._mountSpan,()=>Ae({name:`<${this.props.name}>`,onlyIfParent:!0,op:xM,startTime:o,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":this.props.name,"ui.react.changed_props":r}}))}}return!0}componentDidUpdate(){this._updateSpan&&(this._updateSpan.end(),this._updateSpan=void 0)}componentWillUnmount(){let e=Mt(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){let o=rt(this._mountSpan).timestamp;Jr(this._mountSpan,()=>{let i=Ae({onlyIfParent:!0,name:`<${n}>`,op:aT,startTime:o,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":n}});i&&i.end(e)})}}render(){return this.props.children}};Object.assign(Pu,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});function MM(t,e){let n=e?.name||t.displayName||t.name||PV,r=o=>Ji.createElement(Pu,{...e,name:n,updateProps:o},Ji.createElement(t,{...o}));return r.displayName=`profiler(${n})`,Xi(r,t),r}function OM(t,e={disabled:!1,hasRenderSpan:!0}){let[n]=Ji.useState(()=>{if(!e?.disabled)return Ae({name:`<${t}>`,onlyIfParent:!0,op:sT,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":t}})});Ji.useEffect(()=>(n&&n.end(),()=>{if(n&&e.hasRenderSpan){let r=rt(n).timestamp,o=Mt(),i=Ae({name:`<${t}>`,onlyIfParent:!0,op:aT,startTime:r,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":t}});i&&i.end(o)}}),[])}var Si=Kr(Ea(),1);var Pe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var zV="unknown",cT={componentStack:null,error:null,eventId:null},_p=class extends Si.Component{constructor(e){super(e),this.state=cT,this._openFallbackReportDialog=!0;let n=z();n&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Qf({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:a,dialogOptions:s}=this.props;De(l=>{o&&o(l,e,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,d=yp(e,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(e,r,d),a&&(this._lastEventId=d,this._openFallbackReportDialog&&Qf({...s,eventId:d})),this.setState({error:e,componentStack:r,eventId:d})})}componentDidMount(){let{onMount:e}=this.props;e&&e()}componentWillUnmount(){let{error:e,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===cT?o(null,null,null):o(e,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){let{onReset:e}=this.props,{error:n,componentStack:r,eventId:o}=this.state;e&&e(n,r,o),this.setState(cT)}render(){let{fallback:e,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;let o=typeof e=="function"?Si.createElement(e,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):e;return Si.isValidElement(o)?o:(e&&Pe&&w.warn("fallback did not produce a valid ReactElement"),null)}};function DM(t,e){let n=t.displayName||t.name||zV,r=Si.memo(o=>Si.createElement(_p,{...e},Si.createElement(t,{...o})));return r.displayName=`errorBoundary(${n})`,Xi(r,t),r}var FV="redux.action",HV="info",GV={attachReduxState:!0,actionTransformer:t=>t,stateTransformer:t=>t||null};function LM(t){let e={...GV,...t};return n=>(r,o)=>{e.attachReduxState&&lr().addEventProcessor((s,l)=>{try{s.type===void 0&&s.contexts.state.state.type==="redux"&&(l.attachments=[...l.attachments||[],{filename:"redux_state.json",data:JSON.stringify(s.contexts.state.state.value)}])}catch{}return s});function i(s){return(l,c)=>{let d=s(l,c),u=it(),p=e.actionTransformer(c);typeof p<"u"&&p!==null&&wn({category:FV,data:p,type:HV});let f=e.stateTransformer(d);if(typeof f<"u"&&f!==null){let h=z()?.getOptions()?.normalizeDepth||3,y={state:{type:"redux",value:f}};k0(y,3+h),u.setContext("state",y)}else u.setContext("state",null);let{configureScopeWithState:m}=e;return typeof m=="function"&&m(u,d),d}}let a=n(i(r),o);return a.replaceReducer=new Proxy(a.replaceReducer,{apply:function(s,l,c){s.apply(l,[i(c[0])])}}),a}}function BM(t){let e=Br({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,match:o,instrumentPageLoad:i=!0,instrumentNavigation:a=!0}=t;return{...e,afterAllSetup(s){e.afterAllSetup(s),i&&V.location&&UM(r,V.location,o,(l,c="url")=>{Yo(s,{name:l,attributes:{[ht]:"pageload",[at]:"auto.pageload.react.reactrouter_v3",[Ot]:c}})}),a&&n.listen&&n.listen(l=>{(l.action==="PUSH"||l.action==="POP")&&UM(r,l,o,(c,d="url")=>{Wo(s,{name:c,attributes:{[ht]:"navigation",[at]:"auto.navigation.react.reactrouter_v3",[Ot]:d}})})})}}}function UM(t,e,n,r){let o=e.pathname;n({location:e,routes:t},(i,a,s)=>{if(i||!s)return r(o);let l=$V(s.routes||[]);return l.length===0||l==="/*"?r(o):(o=l,r(o,"route"))})}function $V(t){if(!Array.isArray(t)||t.length===0)return"";let e=t.filter(r=>!!r.path),n=-1;for(let r=e.length-1;r>=0;r--)if(e[r].path?.startsWith("/")){n=r;break}return e.slice(n).reduce((r,{path:o})=>{let i=r==="/"||r===""?o:`/${o}`;return`${r}${i}`},"")}function zM(t,e={}){let n=t,r=Br({...e,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:o=!0,instrumentNavigation:i=!0}=e;return{...r,afterAllSetup(a){r.afterAllSetup(a);let s=V.location;if(o&&s){let l=n.matchRoutes(s.pathname,n.options.parseSearch(s.search),{preload:!1,throwOnError:!1}),c=l[l.length-1],d=c?.routeId!=="__root__"?c:void 0;Yo(a,{name:d?d.routeId:s.pathname,attributes:{[ht]:"pageload",[at]:"auto.pageload.react.tanstack_router",[Ot]:d?"route":"url",...PM(d)}})}i&&n.subscribe("onBeforeNavigate",l=>{if(!l.fromLocation||l.toLocation.state===l.fromLocation.state)return;let c=n.matchRoutes(l.toLocation.pathname,l.toLocation.search,{preload:!1,throwOnError:!1}),d=c[c.length-1],u=d?.routeId!=="__root__"?d:void 0,p=V.location,f=Wo(a,{name:u?u.routeId:p.pathname,attributes:{[ht]:"navigation",[at]:"auto.navigation.react.tanstack_router",[Ot]:u?"route":"url"}}),m=n.subscribe("onResolved",_=>{if(m(),f){let v=n.matchRoutes(_.toLocation.pathname,_.toLocation.search,{preload:!1,throwOnError:!1}),h=v[v.length-1],y=h?.routeId!=="__root__"?h:void 0;y&&(f.updateName(y.routeId),f.setAttribute(Ot,"route"),f.setAttributes(PM(y)))}})})}}}function PM(t){if(!t)return{};let e={};return Object.entries(t.params).forEach(([n,r])=>{e[`url.path.params.${n}`]=r,e[`url.path.parameter.${n}`]=r,e[`params.${n}`]=r}),e}var FM=Kr(Ea(),1);function HM(t){let e=Br({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:o,instrumentPageLoad:i=!0,instrumentNavigation:a=!0}=t;return{...e,afterAllSetup(s){e.afterAllSetup(s),$M(s,i,a,n,"reactrouter_v4",r,o)}}}function GM(t){let e=Br({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:o,instrumentPageLoad:i=!0,instrumentNavigation:a=!0}=t;return{...e,afterAllSetup(s){e.afterAllSetup(s),$M(s,i,a,n,"reactrouter_v5",r,o)}}}function $M(t,e,n,r,o,i=[],a){function s(){if(r.location)return r.location.pathname;if(V.location)return V.location.pathname}function l(c){if(i.length===0||!a)return[c,"url"];let d=jM(i,c,a);for(let u of d)if(u.match.isExact)return[u.match.path,"route"];return[c,"url"]}if(e){let c=s();if(c){let[d,u]=l(c);Yo(t,{name:d,attributes:{[ht]:"pageload",[at]:`auto.pageload.react.${o}`,[Ot]:u}})}}n&&r.listen&&r.listen((c,d)=>{if(d&&(d==="PUSH"||d==="POP")){let[u,p]=l(c.pathname);Wo(t,{name:u,attributes:{[ht]:"navigation",[at]:`auto.navigation.react.${o}`,[Ot]:p}})}})}function jM(t,e,n,r=[]){return t.some(o=>{let i=o.path?n(e,o):r.length?r[r.length-1].match:jV(e);return i&&(r.push({route:o,match:i}),o.routes&&jM(o.routes,e,n,r)),!!i}),r}function jV(t){return{path:"/",url:"/",params:{},isExact:t==="/"}}function qM(t){let e=t.displayName||t.name,n=r=>{if(r?.computedMatch?.isExact){let o=r.computedMatch.path,i=qV();it().setTransactionName(o),i&&(i.updateName(o),i.setAttribute(Ot,"route"))}return FM.createElement(t,{...r})};return n.displayName=`sentryRoute(${e})`,Xi(n,t),n}function qV(){let t=Dt(),e=t&&Bt(t);if(!e)return;let n=rt(e).op;return n==="navigation"||n==="pageload"?e:void 0}var Ei=Kr(Ea(),1);function zu(t,e){if(!e||e==="/"||!t.toLowerCase().startsWith(e.toLowerCase()))return t;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?t:t.slice(n)||"/"}var VM=new WeakMap;function XM(t,e,n){if(!t||!e?.length)return null;let r=n?zu(t,n):t,o=VM.get(e);o||(o=JV(e),VM.set(e,o),Pe&&w.log("[React Router] Sorted route manifest by specificity:",o.length,"patterns"));for(let i of o)if(VV(r,i))return Pe&&w.log("[React Router] Matched pathname",r,"to pattern",i),i;return Pe&&w.log("[React Router] No manifest match found for pathname:",r),null}function VV(t,e){if(e==="/")return t==="/"||t==="";let n=WM(t),r=WM(e);if(r.length>0&&r[r.length-1]==="*"){let i=r.slice(0,-1);if(n.length<i.length)return!1;for(let[a,s]of i.entries())if(!YM(n[a],s))return!1;return!0}if(n.length!==r.length)return!1;for(let[i,a]of r.entries())if(!YM(n[i],a))return!1;return!0}function YM(t,e){return t===void 0||e===void 0?!1:JM.test(e)?!0:t===e}function WM(t){return t.split("/").filter(Boolean)}var JM=/^:[\w-]+$/,YV=10,WV=3,KV=1,XV=-2;function KM(t){let e=t.split("/"),n=e.length;e.includes("*")&&(n+=XV);for(let r of e)r!=="*"&&(JM.test(r)?n+=WV:r===""?n+=KV:n+=YV);return n}function JV(t){return[...t].sort((e,n)=>{let r=KM(e);return KM(n)-r})}var uT,Al=!1,ts=[],QV=10;function eO(t,e){let n={};return ts.length>=QV&&(Pe&&w.warn("[React Router] Navigation context stack overflow - removing oldest context"),ts.shift()),ts.push({token:n,targetPath:t,span:e}),n}function nO(t){ts[ts.length-1]?.token===t&&ts.pop()}function dT(){let t=ts.length;return t>0?ts[t-1]??null:null}function rO(t,e=!1){uT=t,Al=e}function ZV(t){return eY(t.route.path||"")}function tY(t){return t.params["*"]||""}function eY(t){return t[t.length-1]==="*"?t.slice(0,-1):t}function Fu(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function oO(t){return t.endsWith("*")}function Qi(t){return t.includes("/*")||t.endsWith("*")}function QM(t,e){return oO(t)&&!!e.route.children?.length||!1}function nY(t){return!!(!t.children&&t.element&&t.path?.endsWith("/*"))}function rY(t,e,n){let r=t&&t.length>0?t:Al?zu(e,n):e,o=r.slice(-2)==="/*"?r.slice(0,-2):r;return o.length>1&&o[o.length-1]==="/"&&(o=o.slice(0,-1)),[o,"route"]}function ZM(t){return t.split(/\\?\//).filter(e=>e.length>0&&e!==",").length}function fy(t){return t[0]==="/"?t:`/${t}`}function iO(t,e){let n=uT(t,e);if(!n||n.length===0)return"";for(let r of n)if(r.route.path&&r.route.path!=="*"){let o=ZV(r),i=zu(e.pathname,fy(r.pathnameBase));return e.pathname===i?Fu(i):Fu(Fu(o||"")+fy(iO(t.filter(a=>a!==r.route),{pathname:i})))}return""}function oY(t,e){let n=uT(e,t);if(n){for(let r of n)if(nY(r.route)&&tY(r))return!0}return!1}function tO(t,e){return Al?zu(t.pathname,e):t.pathname||""}function iY(t,e,n,r=""){if(!t||t.length===0)return[Al?zu(e.pathname,r):e.pathname,"url"];if(!n)return[tO(e,r),"url"];let o="";for(let i of n){let a=i.route;if(!a)continue;if(a.index)return rY(o,i.pathname,r);let s=a.path;if(!s||QM(s,i))continue;let l=s[0]==="/"||o[o.length-1]==="/"?s:`/${s}`;if(o=Fu(o)+fy(l),Fu(e.pathname)===Fu(r+i.pathname))return ZM(o)!==ZM(i.pathname)&&!oO(o)?[(Al?"":r)+l,"route"]:(QM(o,i)&&(o=o.slice(0,-1)),[(Al?"":r)+o,"route"])}return[tO(e,r),"url"]}function vp(t,e,n,r,o="",i,a){if(a&&i&&i.length>0){let d=XM(t.pathname,i,o);if(d)return[(Al?"":o)+d,"route"]}let s,l="url",c=oY(t,n);return c&&(s=fy(iO(n,t)),l="route"),(!c||!s)&&([s,l]=iY(e,t,r,o)),[s||t.pathname,l]}function fo(){let t=Dt(),e=t?Bt(t):void 0;if(!e)return;let n=rt(e).op;return n==="navigation"||n==="pageload"?e:void 0}function aY(){let t=dT();if(t)return t.targetPath?{pathname:t.targetPath,search:"",hash:"",state:null,key:"default"}:null;if(typeof V<"u")try{let e=V.location;if(e)return{pathname:e.pathname,search:e.search||"",hash:e.hash||"",state:null,key:"default"}}catch{Pe&&w.warn("[React Router] Could not access window.location")}return null}function sY(){let t=dT();return t?t.span:fo()}function lY(t,e,n,r){let o=new Proxy(t,{apply(i,a,s){let l=aY(),c=sY(),d=i.apply(a,s);return cY(d,e,n,r,l,c),d}});return Gt(o,"__sentry_proxied__",!0),o}function cY(t,e,n,r,o,i){Nn(t)?t.then(a=>{Array.isArray(a)&&r(a,e,o??void 0,i)}).catch(a=>{Pe&&w.warn(`Error resolving async handler '${n}' for route`,e,a)}):Array.isArray(t)&&r(t,e,o??void 0,i)}function Sp(t,e){if(t.handle&&typeof t.handle=="object")for(let n of Object.keys(t.handle)){let r=t.handle[n];typeof r=="function"&&!r.__sentry_proxied__&&(t.handle[n]=lY(r,t,n,e))}if(Array.isArray(t.children))for(let n of t.children)Sp(n,e)}var Hu,es,ns,py,po,rs=!1,Il=3e3,Ep,hT="",lO=new WeakSet,cO=V?.document?Ei.useLayoutEffect:Ei.useEffect,kl=new WeakMap,An=new Set,my=new WeakMap,pT=new WeakMap;function uY(t){return V?.requestAnimationFrame?V.requestAnimationFrame(t):setTimeout(t,0)}function aO(t){V?.cancelAnimationFrame?V.cancelAnimationFrame(t):clearTimeout(t)}function uO(t){return`${t.pathname}${t.search||""}${t.hash||""}`}function sO(t){return t.includes(":")||t.includes("*")}function dY(t,e,n,r){if(!t)return{skip:!1,shouldUpdate:!1};if(t.locationKey===e&&(t.isPlaceholder||!r)){let i=!!t.routeName&&Qi(t.routeName),a=Qi(n),s=!!t.routeName&&sO(t.routeName),l=sO(n),c=i&&!a,d=!s&&l,u=n!==t.routeName&&n.length>(t.routeName?.length||0)&&!a;return{skip:!0,shouldUpdate:!!(t.routeName&&(c||d||u))}}return{skip:!1,shouldUpdate:!1}}function dO(t,e){let n=e.children||[],r=t.filter(o=>!n.some(i=>i===o||o.path&&i.path===o.path||o.id&&i.id===o.id));r.length>0&&(e.children=[...n,...r])}function fO(t,e){let n=my.get(t);n||(n=new Set,my.set(t,n)),n.add(e),e.finally(()=>{let r=my.get(t);r&&r.delete(e)})}function pO(t){let e=new Promise(n=>{pT.set(t,n)});fO(t,e)}function fY(t){let e=pT.get(t);e&&(e(),pT.delete(t),t.__sentry_may_have_lazy_routes__&&(t.__sentry_may_have_lazy_routes__=!1))}function bT(t,e,n=null,r){t.forEach(i=>{An.add(i),rs&&Sp(i,bT)}),e&&dO(t,e);let o=r??fo();if(o){let i=rt(o);if(i.timestamp){Pe&&w.warn("[React Router] Lazy handler resolved after span ended - skipping update");return}let a=i.op,s=n;if(!s&&!r&&typeof V<"u"){let l=V.location;l?.pathname&&(s={pathname:l.pathname})}s&&(a==="pageload"?wp({activeRootSpan:o,location:{pathname:s.pathname},routes:Array.from(An),allRoutes:Array.from(An)}):a==="navigation"&&mT(o,s,Array.from(An),!1,po))}}function mT(t,e,n,r=!1,o){let i=rt(t),a=i.description,s=t?.__sentry_navigation_name_set__,l=a&&Qi(a);if((!s||r||l)&&!i.timestamp){let d=o(n,e),[u,p]=vp(e,n,n,d||[],hT,Ep,rs),f=i.data?.[Ot];u&&(!a||!s&&(f!=="route"||p==="route")||f!=="route"&&p==="route"||f==="route"&&p==="route"&&l)&&(t.updateName(u),t.setAttribute(Ot,p),!Qi(u)&&p==="route"&&Gt(t,"__sentry_navigation_name_set__",!0))}}function mO(t,e,n,r,o){let i=!1,a=!!o&&rt(o).op==="pageload",s=!1,l=null,c=null;t.subscribe(d=>{if(!i){let p=fo();p&&rt(p).op==="pageload"?a=!0:a&&(d.historyAction==="POP"&&!s?s=!0:i=!0)}if(d.historyAction==="PUSH"||d.historyAction==="POP"&&i){let p=uO(d.location),f=()=>{c!==p&&(c=p,l=null,yT({location:d.location,routes:e,navigationType:d.historyAction,version:n,basename:r,allRoutes:Array.from(An)}))};d.navigation.state!=="idle"?(c!==p&&(c=null),l!==null&&aO(l),l=uY(f)):(l!==null&&(aO(l),l=null),f())}})}function Gu(t,e){return!Hu||!es||!ns||!po?(Pe&&w.warn(`reactRouter${e?`V${e}`:""}Instrumentation was unable to wrap the \`createRouter\` function because of one or more missing parameters.`),t):function(n,r){if(Tp(n),rs)for(let c of n)Sp(c,bT);let o=fo();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Gt(o,"__sentry_may_have_lazy_routes__",!0),pO(o));let a=gO(r,!1,o),s=t(n,a),l=r?.basename;return s.state.historyAction==="POP"&&o&&wp({activeRootSpan:o,location:s.state.location,routes:n,basename:l,allRoutes:Array.from(An)}),hT=l||"",mO(s,n,e,l,o),s}}function $u(t,e){return!Hu||!es||!ns||!po?(Pe&&w.warn(`reactRouter${e?`V${e}`:""}Instrumentation was unable to wrap the \`createMemoryRouter\` function because of one or more missing parameters.`),t):function(n,r){if(Tp(n),rs)for(let v of n)Sp(v,bT);let o=fo();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Gt(o,"__sentry_may_have_lazy_routes__",!0),pO(o));let a=gO(r,!0,o),s=t(n,a),l=r?.basename,c,d=r?.initialEntries,u=r?.initialIndex,p=d?.length===1,f=u!==void 0&&d?.[u];c=p?d[0]:f?d[u]:void 0;let m=c?typeof c=="string"?{pathname:c}:c:s.state.location,_=fo();return s.state.historyAction==="POP"&&_&&wp({activeRootSpan:_,location:m,routes:n,basename:l,allRoutes:Array.from(An)}),hT=l||"",mO(s,n,e,l,_),s}}function ju(t,e){let n=Br({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:o,useNavigationType:i,createRoutesFromChildren:a,matchRoutes:s,stripBasename:l,enableAsyncRouteHandlers:c=!1,instrumentPageLoad:d=!0,instrumentNavigation:u=!0,lazyRouteTimeout:p,lazyRouteManifest:f}=t;return{...n,setup(m){n.setup(m);let _=t.finalTimeout??3e4,v=(t.idleTimeout??1e3)*3,h=p??v;h===1/0?(Il=_,Pe&&w.log("[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:",_,"ms to prevent indefinite hangs")):Number.isNaN(h)?(Pe&&w.warn("[React Router] lazyRouteTimeout must be a number, falling back to default:",v),Il=v):h<0?(Pe&&w.warn("[React Router] lazyRouteTimeout must be non-negative or Infinity, got:",h,"falling back to:",v),Il=v):Il=h,Hu=r,es=o,ns=i,po=s,py=a,rs=c,Ep=f,rO(s,l||!1)},afterAllSetup(m){n.afterAllSetup(m);let _=V.location?.pathname;d&&_&&Yo(m,{name:_,attributes:{[Ot]:"url",[ht]:"pageload",[at]:`auto.pageload.react.reactrouter${e?`_v${e}`:""}`}}),u&&lO.add(m)}}}function qu(t,e){if(!Hu||!es||!ns||!po)return Pe&&w.warn("reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters."),t;let n=r=>{let o=Ei.useRef(!0),{routes:i,locationArg:a}=r,s=t(i,a),l=es(),c=ns(),d=typeof a=="string"||a?.pathname?a:l;return cO(()=>{let u=typeof d=="string"?{pathname:d}:d;o.current?(Tp(i),wp({activeRootSpan:fo(),location:u,routes:i,allRoutes:Array.from(An)}),o.current=!1):yT({location:u,routes:i,navigationType:c,version:e,allRoutes:Array.from(An)})},[c,d]),s};return(r,o)=>Ei.createElement(n,{routes:r,locationArg:o})}function gO(t,e=!1,n){if(!t||!("patchRoutesOnNavigation"in t)||typeof t.patchRoutesOnNavigation!="function")return t||{};let r=t.patchRoutesOnNavigation;return{...t,patchRoutesOnNavigation:async o=>{let i=o?.path,a=fo()??n;if(!e){let l=o?.patch,c=o?.matches;l&&(o.patch=(d,u)=>{if(Tp(u),c&&c.length>0){let m=c[c.length-1]?.route;if(m){let _=Array.from(An).find(v=>{let h=v.id!==void 0&&v.id===d,y=v===m,S=v.path!==void 0&&m.path!==void 0&&v.path===m.path;return h||y||S});_&&dO(u,_)}}let p=a?rt(a):void 0;return i&&a&&p&&!p.timestamp&&p.op==="navigation"&&mT(a,{pathname:i,search:"",hash:"",state:null,key:"default"},Array.from(An),!0,po),l(d,u)})}let s=(async()=>{let l=eO(i,a),c;try{c=await r(o)}finally{nO(l),a&&fY(a)}let d=a?rt(a):void 0;if(a&&d&&!d.timestamp&&d.op==="navigation"){let u=i;u&&mT(a,{pathname:u,search:"",hash:"",state:null,key:"default"},Array.from(An),!1,po)}return c})();return a&&fO(a,s),s}}}function yT(t){let{location:e,routes:n,navigationType:r,version:o,matches:i,basename:a,allRoutes:s}=t,l=Array.isArray(i)?i:po(s||n,e,a),c=z();if(!c||!lO.has(c))return;let d=fo();if(!(d&&rt(d).op==="pageload"&&r==="POP")&&(r==="PUSH"||r==="POP")&&l){let[u,p]=vp(e,s||n,s||n,l,a,Ep,rs),f=uO(e),m=kl.get(c),_=m&&!m.isPlaceholder?!!rt(m.span).timestamp:!1,{skip:v,shouldUpdate:h}=dY(m,f,u,_);if(v){if(h&&m){let R=m.routeName;m.isPlaceholder?(m.routeName=u,Pe&&w.log(`[Tracing] Updated placeholder navigation name from "${R}" to "${u}" (will apply to real span)`)):(m.span.updateName(u),m.span.setAttribute(Ot,p),Gt(m.span,"__sentry_navigation_name_set__",!0),m.routeName=u,Pe&&w.log(`[Tracing] Updated navigation span name from "${R}" to "${u}"`))}else Pe&&w.log(`[Tracing] Skipping duplicate navigation for location: ${f}`);return}let S={span:{end:()=>{}},routeName:u,pathname:e.pathname,locationKey:f,isPlaceholder:!0};kl.set(c,S);let E;try{E=Wo(c,{name:S.routeName,attributes:{[Ot]:p,[ht]:"navigation",[at]:`auto.navigation.react.reactrouter${o?`_v${o}`:""}`}})}catch(R){throw kl.delete(c),R}E?(kl.set(c,{span:E,routeName:S.routeName,pathname:e.pathname,locationKey:f}),gT(E,e,n,a,"navigation")):kl.delete(c)}}function Tp(t){t.forEach(e=>{hO(e).forEach(r=>{An.add(r)})})}function hO(t,e=new Set){return e.has(t)||(e.add(t),t.children&&!t.index&&t.children.forEach(n=>{hO(n,e).forEach(o=>{e.add(o)})})),e}function wp({activeRootSpan:t,location:e,routes:n,matches:r,basename:o,allRoutes:i}){let a=Array.isArray(r)?r:po(i||n,e,o);if(a){let[s,l]=vp(e,i||n,i||n,a,o,Ep,rs);it().setTransactionName(s||"/"),t&&(t.updateName(s),t.setAttribute(Ot,l),gT(t,e,n,o,"pageload"))}else t&&gT(t,e,n,o,"pageload")}function pY(t,e,n,r,o=!1){return n?!!(!t&&o||t&&Qi(t)&&r==="route"&&!Qi(n)||e!=="route"&&r==="route"):!1}function fT(t,e,n,r,o,i,a,s){try{let l=e.data?.[Ot];if(l==="route"&&n&&!Qi(n))return;let c=Array.from(s),d=c.length>0?c:o,u=po(d,r,i);if(!u)return;let[p,f]=vp(r,d,d,u,i,Ep,rs),m=pY(n,l,p,f,!0),_=a==="pageload"||!e.timestamp;m&&_&&(t.updateName(p),t.setAttribute(Ot,f))}catch(l){Pe&&w.warn(`Error updating span details before ending: ${l}`)}}function gT(t,e,n,r,o){let i=`__sentry_${o}_end_patched__`;if(t?.[i]||!t.end)return;let s=t.end.bind(t),l=!1;t.end=function(...d){if(l)return;l=!0;let u=d.length>0?d[0]:Date.now()/1e3,p=rt(t),f=p.description,m=p.data?.[Ot],_=()=>{let E=z();if(E&&o==="navigation"){let R=kl.get(E);R&&R.span===t&&kl.delete(E)}},v=my.get(t),h=t.__sentry_may_have_lazy_routes__;if((v&&v.size>0||h)&&f&&(Qi(f)||m!=="route")){if(Il===0){fT(t,p,f,e,n,r,o,An),_(),s(u);return}let E=new Promise(C=>setTimeout(C,Il)),R;if(v&&v.size>0){let C=Promise.allSettled(v).then(()=>{});R=Il===1/0?C:Promise.race([C,E])}else R=E;R.then(()=>{let C=rt(t);fT(t,C,C.description,e,n,r,o,An),_(),s(u)}).catch(()=>{_(),s(u)});return}fT(t,p,f,e,n,r,o,An),_(),s(u)},Gt(t,i,!0)}function Vu(t,e){if(!Hu||!es||!ns||!py||!po)return Pe&&w.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.
|
|
508
508
|
useEffect: ${Hu}. useLocation: ${es}. useNavigationType: ${ns}.
|
|
509
509
|
createRoutesFromChildren: ${py}. matchRoutes: ${po}.`),t;let n=r=>{let o=Ei.useRef(!0),i=es(),a=ns();return cO(()=>{let s=py(r.children);o.current?(Tp(s),wp({activeRootSpan:fo(),location:i,routes:s,allRoutes:Array.from(An)}),o.current=!1):yT({location:i,routes:s,navigationType:a,version:e,allRoutes:Array.from(An)})},[i,a]),Ei.createElement(t,{...r})};return Xi(n,t),n}function bO(t){return ju(t,"6")}function yO(t){return qu(t,"6")}function _O(t){return Gu(t,"6")}function vO(t){return $u(t,"6")}function SO(t){return Vu(t,"6")}function EO(t){return ju(t,"7")}function TO(t){return Vu(t,"7")}function wO(t){return Gu(t,"7")}function xO(t){return $u(t,"7")}function AO(t){return qu(t,"7")}function kO(t){return ju(t,"")}function IO(t){return Vu(t,"")}function RO(t){return Gu(t,"")}function NO(t){return $u(t,"")}function CO(t){return qu(t,"")}function _T(t,e){if(t==null||t==="")return e;let n=typeof t=="number"?t:Number(t);return Number.isFinite(n)&&n>=0&&n<=1?n:e}var Zi=typeof window<"u"?window.__vidfarmSentry:void 0,vT=Zi?.dsn?.trim()||"";if(vT&&typeof window<"u"&&!window.__vidfarmSentryInitialized){window.__vidfarmSentryInitialized=!0;let t=Zi?.environment?.trim()||"development",e=t==="production"?.1:1,n=t==="production"?.1:1,r=["localhost",window.location.origin,`${window.location.origin}/api`],o=Array.from(new Set([...r,...Zi?.tracePropagationTargets??[]].filter(Boolean)));dy({dsn:vT,environment:t,release:Zi?.release?.trim()||void 0,integrations:[Br(),Jb({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:_T(Zi?.tracesSampleRate,e),tracePropagationTargets:o,replaysSessionSampleRate:_T(Zi?.replaysSessionSampleRate,n),replaysOnErrorSampleRate:_T(Zi?.replaysOnErrorSampleRate,1),enableLogs:Zi?.enableLogs??!0,sendDefaultPii:Zi?.sendDefaultPii??!0}),Oc("vidfarm.bundle","hyperframes-editor")}function MO(){return!!vT&&typeof window<"u"&&window.__vidfarmSentryInitialized===!0}function ta(t,e){if(MO())try{Et(t,e?{extra:e}:void 0)}catch{}}function OO(t,e){if(MO())try{Da(t,e?{level:"error",extra:e}:{level:"error"})}catch{}}var n6=Kr(aU(),1);var FK="[vidfarm-demo]",sU=1e3;function HK(t){if(t!=="debug")return!0;if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("debug")||window.localStorage?.getItem("VIDFARM_DEMO_DEBUG")==="1"}catch{return!1}}function Zx(t,e,n){let r={event:e,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>sU&&window.__VIDFARM_DEBUG_LOGS__.splice(0,window.__VIDFARM_DEBUG_LOGS__.length-sU)),HK(t)&&console[t](FK,e,n??"")}function xt(t,e){Zx("debug",t,e)}function Ar(t,e){Zx("warn",t,e)}function xo(t,e){Zx("error",t,e);let n=e instanceof Error?e:e&&typeof e=="object"&&"error"in e&&e.error instanceof Error?e.error:null;n?ta(n,{event:t,detail:e}):OO(`vidfarm-demo:${t}`,{detail:e})}function lU(){typeof window>"u"||window.__VIDFARM_DEBUG_HOOKS__||(window.__VIDFARM_DEBUG_HOOKS__=!0,xt("boot.hooks-installed",{href:window.location.href,readyState:document.readyState,userAgent:navigator.userAgent}),window.addEventListener("error",t=>{let e=t.error instanceof Error?t.error:null;xo("window.error",{message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error:e?e.stack:t.error}),e&&ta(e,{source:"window.error"})}),window.addEventListener("unhandledrejection",t=>{let e=t.reason instanceof Error?t.reason:null;xo("window.unhandledrejection",{reason:e?e.stack:t.reason}),e&&ta(e,{source:"window.unhandledrejection"})}))}var A=Kr(Ea(),1);var g=Kr(Qm(),1),DU="rgba(60, 60, 60, 0.78)",GK="__VF_KENBURNS_V1__",$K=["zoom-in","zoom-out","pan-left","pan-right","pan-up","pan-down","zoom-in-left","zoom-in-right"],jK=`/*${GK}*/
|
|
510
510
|
@keyframes vf-kb-zoom-in { from { transform: translate(0%, 0%) scale(1); } to { transform: translate(0%, 0%) scale(calc(1 + var(--vf-kb-amount, 0.18))); } }
|
|
@@ -549,7 +549,7 @@ to myself`,y:35},{text:`4/10 when I told
|
|
|
549
549
|
them no`,y:34},{text:`3/10 when I followed
|
|
550
550
|
my heart`,y:34},{text:`2/10 when I spoke up
|
|
551
551
|
for myself`,y:43},{text:`1/10 when I chose
|
|
552
|
-
myself`,y:22}];return[...p1(t,e,r.map((o,i)=>`${10-i}/10 scene`)),{id:`${t.id}-audio`,label:"Original audio",kind:"audio",mode:"both",start:0,duration:t.duration,track:1,z:1,viralNote:"Continuous source audio across scene cuts.",src:t.media.src,playbackStart:0,volume:1,muted:!1},...r.map((o,i)=>({...n,id:`${t.id}-caption-${10-i}`,label:`${10-i}/10 caption`,text:o.text,start:e[i],duration:e[i+1]-e[i],y:o.y}))]}function lX(t){if(t.media.type!=="video")return[];let e=HU(t.media.src);return[{id:`${t.id}-video`,label:e,kind:"video",mode:"both",start:0,duration:t.duration,track:0,z:0,viralNote:"Editable source visual track.",src:t.media.src},{id:`${t.id}-audio`,label:"Original audio",kind:"audio",mode:"both",start:0,duration:t.duration,track:1,z:1,viralNote:"Editable source audio track.",src:t.media.src,volume:1,muted:!1}]}function m1(t){return t.id==="slides"?rX():t.id==="simple-video"?Lm.filter(e=>e.mode==="both"||e.mode==="publish"):t.id==="hard-video"?oX(t):t.id==="medium-easy-video"?aX(t):t.id==="medium-video-loop-split"?iX(t):t.id==="medium-video"?sX(t):lX(t)}function GU(t){return m1(t).reduce((e,n)=>Math.max(e,n.start+n.duration),t.duration)}function cX(t){let e=t.filter(n=>n.duration>0);for(let n=0;n<e.length;n+=1){let r=e[n];for(let o of e.slice(n+1))if(Fd(r,o))throw new Error(`Track collision: ${r.id} overlaps ${o.id} on track ${r.track}.`)}}function $U(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function
|
|
552
|
+
myself`,y:22}];return[...p1(t,e,r.map((o,i)=>`${10-i}/10 scene`)),{id:`${t.id}-audio`,label:"Original audio",kind:"audio",mode:"both",start:0,duration:t.duration,track:1,z:1,viralNote:"Continuous source audio across scene cuts.",src:t.media.src,playbackStart:0,volume:1,muted:!1},...r.map((o,i)=>({...n,id:`${t.id}-caption-${10-i}`,label:`${10-i}/10 caption`,text:o.text,start:e[i],duration:e[i+1]-e[i],y:o.y}))]}function lX(t){if(t.media.type!=="video")return[];let e=HU(t.media.src);return[{id:`${t.id}-video`,label:e,kind:"video",mode:"both",start:0,duration:t.duration,track:0,z:0,viralNote:"Editable source visual track.",src:t.media.src},{id:`${t.id}-audio`,label:"Original audio",kind:"audio",mode:"both",start:0,duration:t.duration,track:1,z:1,viralNote:"Editable source audio track.",src:t.media.src,volume:1,muted:!1}]}function m1(t){return t.id==="slides"?rX():t.id==="simple-video"?Lm.filter(e=>e.mode==="both"||e.mode==="publish"):t.id==="hard-video"?oX(t):t.id==="medium-easy-video"?aX(t):t.id==="medium-video-loop-split"?iX(t):t.id==="medium-video"?sX(t):lX(t)}function GU(t){return m1(t).reduce((e,n)=>Math.max(e,n.start+n.duration),t.duration)}function cX(t){let e=t.filter(n=>n.duration>0);for(let n=0;n<e.length;n+=1){let r=e[n];for(let o of e.slice(n+1))if(Fd(r,o))throw new Error(`Track collision: ${r.id} overlaps ${o.id} on track ${r.track}.`)}}function $U(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function He(t){return $U(String(t))}function Kt(t){return Number(t.toFixed(3)).toString()}function xm(t){let e=t.fontSize??18,n=t.fontFamily??"TikTok Sans",r=t.fontWeight??Os(n),o=["position:absolute",`left:${t.x??0}%`,`top:${t.y??0}%`,`width:${t.width??100}%`,`height:${t.height??100}%`,`z-index:${t.z}`,"opacity:1",`border-radius:${t.radius??0}px`,"overflow:hidden"];return(t.kind==="video"||t.kind==="image")&&o.push("object-fit:cover"),(t.kind==="text"||t.kind==="caption"||t.kind==="shape")&&o.push("display:flex","align-items:center","justify-content:center","padding:3px",`font-family:${Jl(n)}, 'TikTok Sans', Montserrat, Abel`,`font-weight:${r}`,"line-height:1.48","text-align:center","text-transform:none",`font-size:${e}px`,`color:${t.color??"#ffffff"}`,"background:transparent"),o.join(";")}function uX(t){let e=[`id="${He(t.id)}"`,`data-hf-id="${He(t.id)}"`,`data-layer-mode="${He(t.mode)}"`,`data-layer-kind="${He(t.kind)}"`,`data-viral-note="${He(t.viralNote)}"`,`data-start="${Kt(t.start)}"`,`data-duration="${Kt(t.duration)}"`,`data-track-index="${t.track}"`,`data-label="${He(t.label)}"`];return(t.kind==="text"||t.kind==="caption"||t.kind==="shape")&&e.push(`data-text-background-style="${He(t.textBackgroundStyle??"highlight-solid")}"`,`data-text-background-color="${He(t.background??"#000000")}"`,`data-font-family="${He(t.fontFamily??"TikTok Sans")}"`),t.customHtml&&e.push('data-layer-format="html"'),(t.kind==="video"||t.kind==="audio")&&t.playbackStart!==void 0&&e.push(`data-media-start="${Kt(t.playbackStart)}"`,`data-playback-start="${Kt(t.playbackStart)}"`),e.join(" ")}function dX(t){let e=uX(t);if(t.kind==="video")return t.playbackStart!==void 0?`<div ${e} data-vf-timeline-proxy="video" data-src="${He(t.src??"")}" style="${He(xm({...t,x:0,y:0,width:1,height:1}))};display:none;pointer-events:none;"></div>`:`<video ${e} src="${He(t.src??"")}" muted playsinline preload="auto" style="${He(xm(t))}"></video>`;if(t.kind==="audio")return`<audio ${e} src="${He(t.src??"")}" data-timeline-role="music" data-volume="${Kt(t.volume??1)}" ${t.muted?"muted":""} preload="metadata"></audio>`;if(t.kind==="image")return`<img ${e} src="${He(t.src??"")}" alt="" style="${He(xm(t))}" />`;if(t.customHtml)return`<div ${e} style="${He(xm(t))}">${t.customHtml}</div>`;let n=t.text??t.label,r=zU(t.textBackgroundStyle??"highlight-solid",t.color??"#ffffff",t.background??"#000000",t.fontFamily??"TikTok Sans",t.fontWeight??Os(t.fontFamily??"TikTok Sans")),o=FU(t.textBackgroundStyle??"highlight-solid");return`<div ${e} style="${He(xm(t))}"><span data-vf-text-lines="true" style="${He(o)}"><span data-vf-text-inline="true" style="${He(r)}">${$U(n)}</span></span></div>`}function fX(t,e){return t==="shape"&&e?"HTML":t}function pX(t,e){return t==="shape"&&e?"HTML":t.slice(0,3).toUpperCase()}function mX(t,e){if(t.media.type!=="video"||!e.some(o=>o.kind==="video"&&o.playbackStart!==void 0))return"";let r=["position:absolute","left:0%","top:0%","width:100%","height:100%","z-index:0","object-fit:cover","background:#050604"].join(";");return`<video data-vf-playback-source="true" src="${He(t.media.src)}" muted playsinline preload="auto" style="${He(r)}"></video>`}function jU(){return`<script>
|
|
553
553
|
(() => {
|
|
554
554
|
const root = document.querySelector("[data-composition-id]");
|
|
555
555
|
let duration = Number(root?.getAttribute("data-duration") || 0);
|
|
@@ -1051,6 +1051,30 @@ myself`,y:22}];return[...p1(t,e,r.map((o,i)=>`${10-i}/10 scene`)),{id:`${t.id}-a
|
|
|
1051
1051
|
}
|
|
1052
1052
|
|
|
1053
1053
|
let visualFrameDrag = null;
|
|
1054
|
+
// Notifying the parent editor of an in-flight frame drag re-renders its
|
|
1055
|
+
// whole tree; at raw pointermove rate (2-4x/frame on trackpads) the
|
|
1056
|
+
// re-render backlog saturates the shared main thread and the layer lags the
|
|
1057
|
+
// cursor. The node itself is moved directly every event (applyFrameToNode),
|
|
1058
|
+
// so we only need to coalesce the parent postMessage to one-per-frame.
|
|
1059
|
+
let pendingFrameDraftRaf = 0;
|
|
1060
|
+
|
|
1061
|
+
function flushFrameDraftMove() {
|
|
1062
|
+
pendingFrameDraftRaf = 0;
|
|
1063
|
+
if (visualFrameDrag && visualFrameDrag.moved) {
|
|
1064
|
+
postFrameDraft(visualFrameDrag.node, "move");
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
function scheduleFrameDraftMove() {
|
|
1069
|
+
if (pendingFrameDraftRaf) return;
|
|
1070
|
+
pendingFrameDraftRaf = requestAnimationFrame(flushFrameDraftMove);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
function cancelPendingFrameDraftMove() {
|
|
1074
|
+
if (!pendingFrameDraftRaf) return;
|
|
1075
|
+
cancelAnimationFrame(pendingFrameDraftRaf);
|
|
1076
|
+
pendingFrameDraftRaf = 0;
|
|
1077
|
+
}
|
|
1054
1078
|
|
|
1055
1079
|
function beginVisualFrameDrag(event) {
|
|
1056
1080
|
if (event.button !== 0) return;
|
|
@@ -1124,11 +1148,15 @@ myself`,y:22}];return[...p1(t,e,r.map((o,i)=>`${10-i}/10 scene`)),{id:`${t.id}-a
|
|
|
1124
1148
|
next.fontSize = Math.max(8, Math.min(180, (drag.frame.fontSize || 18) * scale));
|
|
1125
1149
|
}
|
|
1126
1150
|
applyFrameToNode(drag.node, next);
|
|
1127
|
-
|
|
1151
|
+
scheduleFrameDraftMove();
|
|
1128
1152
|
}
|
|
1129
1153
|
|
|
1130
1154
|
function endVisualFrameDrag() {
|
|
1131
1155
|
if (!visualFrameDrag) return;
|
|
1156
|
+
// Drop any coalesced "move" still queued for this frame; the "end"/"tap"
|
|
1157
|
+
// message below carries the final frame, so a late "move" after it would
|
|
1158
|
+
// only cause a redundant re-render (and race the commit).
|
|
1159
|
+
cancelPendingFrameDraftMove();
|
|
1132
1160
|
visualFrameDrag.node.style.cursor = "";
|
|
1133
1161
|
postFrameDraft(visualFrameDrag.node, visualFrameDrag.moved ? "end" : "tap");
|
|
1134
1162
|
visualFrameDrag = null;
|
|
@@ -1182,7 +1210,7 @@ ${e}`}function qU(t=Um[0]){let e=m1(t);cX(e);let n=GU(t),r=t.width,o=t.height;re
|
|
|
1182
1210
|
</style>
|
|
1183
1211
|
</head>
|
|
1184
1212
|
<body>
|
|
1185
|
-
<div data-composition-id="${
|
|
1213
|
+
<div data-composition-id="${He(t.id)}" data-source-video="${He(t.title)}" data-width="${r}" data-height="${o}" data-duration="${Kt(n)}">
|
|
1186
1214
|
${mX(t,e)}
|
|
1187
1215
|
${e.map(dX).join(`
|
|
1188
1216
|
`)}
|
|
@@ -1190,21 +1218,21 @@ ${e}`}function qU(t=Um[0]){let e=m1(t);cX(e);let n=GU(t),r=t.width,o=t.height;re
|
|
|
1190
1218
|
${jU()}
|
|
1191
1219
|
</body>
|
|
1192
1220
|
</html>`}function Nt(t){return t.key??t.id}function g1(t){return Array.from(new Set(t.filter(e=>!!e)))}function hX(t){let e=[];for(let n of g1([t.hfId,t.domId,t.id,t.key]))e.push(`[data-hf-id="${CSS.escape(n)}"]`),e.push(`#${CSS.escape(n)}`);return t.selector&&e.push(t.selector),e}function Z_(t){return`<!doctype html>
|
|
1193
|
-
${t.documentElement.outerHTML}`}function re(t){return!!(t&&typeof t=="object"&&t.nodeType===1&&"style"in t)}function t0(t,e){return re(t)&&t.tagName.toLowerCase()===e.toLowerCase()}function Zo(t,e,n){let r=new DOMParser().parseFromString(t,"text/html"),o=Bn(r,e);return re(o)?(n(o),Z_(r)):t}function km(t,e,n){try{let r=t?.contentDocument,o=r?Bn(r,e):null;return re(o)?(n(o),!0):!1}catch{return!1}}function n1(t,e){try{let n=t?.contentDocument;if(!n)return 0;let r=new DOMParser().parseFromString(e,"text/html"),o=new Map;for(let a of Array.from(n.querySelectorAll("[data-start]"))){if(!re(a))continue;let s=Ci(a);s&&o.set(s,a)}let i=0;for(let a of Array.from(r.querySelectorAll("[data-start]"))){if(!re(a))continue;let s=Ci(a),l=s?o.get(s):null;if(!l)continue;for(let d of["data-start","data-duration","data-track-index","data-media-start","data-playback-start"]){let u=a.getAttribute(d);u===null?l.removeAttribute(d):l.setAttribute(d,u)}let c=Number(a.getAttribute("data-track-index")??Number.NaN);Number.isFinite(c)&&!t0(l,"audio")&&(l.style.zIndex=String(c)),i+=1}return i}catch{return 0}}var mU=new WeakSet;function bX(t){return t.hasAttribute("data-vf-selection-ring")||t.hasAttribute("data-vf-frame-handle")}function gU(t){return t.hasAttribute("data-vf-playback-source")?"@playback-source":t.getAttribute("data-hf-id")||t.id||null}function VU(t,e){let n=t.style.visibility;for(let r of Array.from(t.attributes))r.name!=="data-vf-selected"&&(e.hasAttribute(r.name)||t.removeAttribute(r.name));for(let r of Array.from(e.attributes))t.getAttribute(r.name)!==r.value&&t.setAttribute(r.name,r.value);t.style.visibility!==n&&(t.style.visibility=n)}function yX(t,e){VU(t,e),t.innerHTML!==e.innerHTML&&(t.innerHTML=e.innerHTML)}function hU(t,e){try{let n=t?.contentDocument,r=n?.querySelector("[data-composition-id]");if(!n||!re(r))return!1;let i=new DOMParser().parseFromString(e,"text/html").querySelector("[data-composition-id]");if(!re(i))return!1;let a=r.querySelector("[data-vf-playback-source]"),s=i.querySelector("[data-vf-playback-source]");if(!!a!=!!s)return!1;VU(r,i);let l=new Set,c=new Map;for(let m of Array.from(r.children)){if(bX(m)){l.add(m);continue}let _=gU(m);_!==null&&re(m)&&!c.has(_)&&c.set(_,m)}let d=new Set,u=[];for(let m of Array.from(i.children)){if(!re(m))continue;let _=gU(m),v=_!==null?c.get(_):void 0;v&&!d.has(v)&&v.tagName===m.tagName?(d.add(v),yX(v,m),u.push(v)):u.push(n.importNode(m,!0))}let p=new Set(u);for(let m of Array.from(r.children))l.has(m)||p.has(m)||(m instanceof HTMLMediaElement&&m.pause(),m.remove());let f=r.firstElementChild;for(let m of u){for(;f&&l.has(f);)f=f.nextElementSibling;if(f===m){f=f.nextElementSibling;continue}r.insertBefore(m,f)}return!0}catch{return!1}}function bU(t,e){try{let n=t?.contentDocument;return n?(n.open(),n.write(e),n.close(),!0):!1}catch{return!1}}function Am(t,e){for(let n of e){let r=t.getAttribute(n);if(r!==null){let o=Number(r);if(Number.isFinite(o))return o}}}function yU(t){let e=e0(t),n=e.querySelector("[data-composition-id]"),r=[];for(let i of Array.from(e.querySelectorAll("[data-start]")))i===n||!re(i)||r.push(i);let o=n?Number(n.getAttribute("data-duration")||0):0;return{nodes:r,duration:o}}function _U(t){return g1([t.getAttribute("data-hf-id")??void 0,t.id||void 0])}function vU(t){return g1([t.key,t.hfId,t.domId,t.id])}function r1(t,e,n){let r=t.getState(),o=r.elements,i=yU(e),a=yU(n),s=new Set(i.nodes.flatMap(_U)),l=new Set,c=[];for(let u of a.nodes){let p=_U(u);if(p.length===0)continue;let f=Am(u,["data-start"])??0,m=Am(u,["data-duration"])??0,_=Am(u,["data-track-index"])??0,v=Am(u,["data-playback-start","data-media-start"]),h=Am(u,["data-volume"]),y=o.findIndex((S,E)=>!l.has(E)&&vU(S).some(R=>p.includes(R)));if(y>=0){l.add(y);let S=o[y],E=u.getAttribute("data-timeline-label")??u.getAttribute("data-label")??S.label??p[0],R=S.start===f&&S.duration===m&&S.track===_&&S.playbackStart===v&&S.volume===h&&S.label===E;c.push(R?S:{...S,start:f,duration:m,track:_,playbackStart:v,volume:h,label:E})}else{let S=p[0];c.push({id:S,key:S,hfId:u.getAttribute("data-hf-id")??void 0,domId:u.id||void 0,tag:u.tagName.toLowerCase(),label:u.getAttribute("data-timeline-label")??u.getAttribute("data-label")??S,start:f,duration:m,track:_,playbackStart:v,volume:h})}}o.forEach((u,p)=>{if(l.has(p))return;vU(u).some(m=>s.has(m))||c.push(u)});let d=c.length!==o.length||c.some((u,p)=>u!==o[p]);return d&&r.setElements(c),a.duration>0&&Math.abs(a.duration-r.duration)>.001&&r.setDuration?.(a.duration),d}function Ni(t,e){try{let a=function(){re(i)&&(i.style.display="none")};var n=a;let r=t?.contentDocument;if(!r)return!1;let o=r.querySelector("[data-composition-id]"),i=r.querySelector("[data-vf-selection-ring='true']");for(let l of Array.from(r.querySelectorAll("[data-vf-selected='true']")))l.removeAttribute("data-vf-selected");if(!e)return a(),!0;let s=Bn(r,e);return!s||t0(s,"audio")?(a(),!1):(!re(i)&&re(o)&&(i=r.createElement("div"),i.setAttribute("data-vf-selection-ring","true"),o.append(i)),re(i)&&HX(i,s,e),s.setAttribute("data-vf-selected","true"),!0)}catch{return!1}}function Ci(t){return t.getAttribute("data-hf-id")||t.id}function Ql(t){let e=Number(t.getAttribute("data-start")??0),n=Number(t.getAttribute("data-duration")??0),r=Number(t.getAttribute("data-track-index")??0);return{start:e,duration:n,track:r}}function Fd(t,e){if(t.track!==e.track)return!1;let n=t.start+t.duration,r=e.start+e.duration;return t.start<r-.001&&e.start<n-.001}function _X(t){let e=new Map;for(let n of t){let r=n.tag==="audio",o=e.get(n.track);e.set(n.track,(o===void 0||o)&&r)}return e}function o1(t){return Array.from(new Set(t.map(e=>e.track))).sort((e,n)=>n-e)}function SU(t,e,n){let r=new Set([Nt(e),e.hfId,e.domId,e.id].filter(o=>!!o));return t.filter(o=>![Nt(o),o.hfId,o.domId,o.id].some(a=>a&&r.has(a))).filter(o=>!n||J_(n,o)!=="track-placeholder").map(o=>({start:o.start,duration:o.duration,track:o.track}))}function Bm(t){return Number.isFinite(t.duration)&&t.duration>0}function i1(t,e){return Bm(t)?e.some(n=>Bm(n)&&Fd(t,n)):!1}function vX(t,e,n,r,o){if(!Number.isFinite(n)||n<=0)return Math.max(0,r);let a=t.filter(f=>f.track===e&&Bm(f)).map(f=>({start:f.start,end:f.start+f.duration})).sort((f,m)=>f.start-m.start),s=[];for(let f of a){let m=s[s.length-1];m&&f.start<=m.end+.001?m.end=Math.max(m.end,f.end):s.push({...f})}let l=Math.max(0,o-n),c=[],d=0;for(let f of s)f.start-d>=n-.001&&c.push({lo:d,hi:f.start-n}),d=Math.max(d,f.end);d<=l+.001&&c.push({lo:d,hi:l});let u=null,p=1/0;for(let f of c){let m=Math.min(f.hi,l);if(m<f.lo-.001)continue;let _=Lt(r,f.lo,Math.max(f.lo,m)),v=Math.abs(_-r);v<p-.001&&(u=_,p=v)}return u}function zm(t,e,n=new Set){if(!Number.isFinite(e.duration)||e.duration<=0)return e.track;let r=Array.from(t.querySelectorAll("[data-start]")).filter(a=>re(a)),o=new Set;for(let a of r){let s=Ci(a);if(s&&n.has(s))continue;let l=Ql(a);!Number.isFinite(l.duration)||l.duration<=0||Fd({...e},l)&&o.add(l.track)}let i=Math.max(0,Math.floor(e.track));for(let a=0;a<512&&o.has(i);a+=1)i+=1;return i}function Bn(t,e){let n=hX(e);for(let r of n){if(r===e.selector&&e.selectorIndex!==void 0){let i=t.querySelectorAll(r).item(e.selectorIndex);if(re(i))return i;continue}let o=t.querySelector(r);if(re(o))return o}return null}function EU(t,e){return Bn(t,e)?.getAttribute("data-vf-group")||null}function TU(t,e,n){return e?Array.from(t.querySelectorAll(`[data-vf-group="${CSS.escape(e)}"]`)).filter(r=>re(r)&&r.hasAttribute("data-start")):[n]}function SX(t,e,n){let r=new Set(e.map(Ci)),o=Array.from(t.querySelectorAll("[data-start]")).filter(a=>re(a));for(let a of e){let s=Ci(a),l=n.get(s);if(!(!s||!l))for(let c of o){let d=Ci(c);if(!(!d||r.has(d))&&Fd(l,Ql(c)))throw new Error("Track collision: only one clip can occupy a track at a time.")}}let i=Array.from(n.entries()).filter(([,a])=>a.duration>0);for(let a=0;a<i.length;a+=1){let[s,l]=i[a];for(let[c,d]of i.slice(a+1))if(Fd(l,d))throw new Error(`Track collision: ${s} overlaps ${c} on track ${l.track}.`)}}function EX(t){let e=Array.from(t.querySelectorAll("[data-start]")).filter(r=>{if(!re(r))return!1;let o=Number(r.getAttribute("data-duration")??0);return Number.isFinite(o)&&o>0});e.sort((r,o)=>{let i=Number(r.getAttribute("data-track-index")??0),a=Number(o.getAttribute("data-track-index")??0);if(i!==a)return i-a;let s=Number(r.getAttribute("data-start")??0),l=Number(o.getAttribute("data-start")??0);return s-l});let n=0;for(let r=0;r<e.length;r+=1){let o=e[r],i=Ql(o),a=!1;for(let d=0;d<r;d+=1)if(Fd(i,Ql(e[d]))){a=!0;break}if(!a)continue;let s=new Set,l=Ci(o);l&&s.add(l);let c=zm(t,i,s);c!==i.track&&(o.setAttribute("data-track-index",String(c)),o.style.zIndex&&(o.style.zIndex=String(c)),n+=1)}return n}function Ao(t,e){let n=new DOMParser().parseFromString(t,"text/html");e(n);let r=EX(n);return{html:Z_(n),resolvedCollisions:r}}function YU(t){if(!t)return null;let e=/<[^>]*data-composition-id[^>]*>/i.exec(t);if(!e)return null;let n=/\sdata-viral-dna\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(e[0]),r=n?.[1]??n?.[2];if(!r)return null;try{let o=r.replace(/"/g,'"').replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),i=JSON.parse(o);if(!i||typeof i!="object")return null;let a=d=>typeof d=="string"?d.trim():"",s=d=>Array.isArray(d)?d.map(u=>typeof u=="string"?u.trim():"").filter(u=>u.length>0):[],l=i,c={trendTagline:a(l.trend_tagline??l.trendTagline),hook:a(i.hook),retention:a(i.retention),payoff:a(i.payoff),preserve:s(i.preserve),avoid:s(i.avoid),promotions:s(l.promotions)};return!c.trendTagline&&!c.hook&&!c.retention&&!c.payoff&&c.preserve.length===0&&c.avoid.length===0&&c.promotions.length===0?null:c}catch{return null}}function TX(t){return!(!t||!t.includes("data-composition-id")||t.includes('data-vf-timeline-proxy="video"')||!t.includes("data-vf-playback-source")&&!/<video\b/i.test(t))}function Xl(t){if(!t||!t.includes("data-track-index"))return t;let e=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+[^\s"'>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'`=<>]+))?)*)\s*(\/?)>/g,n=/\s+([^\s"'>/=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s"'`=<>]+))?/g;return t.replace(e,(r,o,i,a)=>{let s=null,l='"',c=null,d=-1,u=-1;n.lastIndex=0;let p;for(;p=n.exec(i);){let m=p[1].toLowerCase(),_=p[2];if(_===void 0)continue;let v=_.startsWith('"')||_.startsWith("'"),h=v?_.slice(1,-1):_;if(m==="data-track-index"){let y=Number.parseInt(h,10);Number.isFinite(y)&&(s=y)}else m==="style"&&(l=v?_[0]:'"',c=h,d=p.index,u=p.index+p[0].length)}if(s===null)return r;let f=String(s);if(c!==null){let m;if(/(^|;)\s*z-index\s*:/i.test(c)){if(new RegExp(`(^|;)\\s*z-index\\s*:\\s*${f}\\s*(;|$)`,"i").test(c))return r;m=c.replace(/(^|;)\s*z-index\s*:\s*[^;]*/i,(v,h)=>`${h}z-index:${f}`)}else m=c.endsWith(";")||c.length===0?`${c}z-index:${f}`:`${c};z-index:${f}`;let _=`${i.slice(0,d)} style=${l}${m}${l}${i.slice(u)}`;return`<${o}${_}${a?"/":""}>`}return`<${o}${i} style="z-index:${f}"${a?"/":""}>`})}var wU=null,a1=null;function e0(t){if(wU===t&&a1)return a1;let e=new DOMParser().parseFromString(t,"text/html");return wU=t,a1=e,e}function n0(t,e){return Bn(e0(t),e)}function Qo(t,e,n){let r=t?.getPropertyValue(e)??"",o=Number.parseFloat(r);return Number.isFinite(o)?o:n}function xU(t,e){let n=n0(t,e),r=h1(e),o=n?.querySelector("[data-vf-text-inline]"),i=n?.getAttribute("data-text-background-style"),a=n?.getAttribute("data-text-background-color"),s=n?.style.background&&n.style.background!=="transparent"?n.style.background:"";return{text:n?.textContent?.trim()||r?.text||e.label||"",src:n?.getAttribute("src")||r?.src||"",fontFamily:K_(o?.style.fontFamily||n?.style.fontFamily),fontWeight:tX(o?.style.fontWeight||n?.style.fontWeight,Os(K_(o?.style.fontFamily||n?.style.fontFamily))),italic:n?.style.fontStyle==="italic",underline:(n?.style.textDecorationLine||n?.style.textDecoration||"").includes("underline"),color:o?.style.color||n?.style.color||r?.color||"#ffffff",background:a||o?.style.background||s||r?.background||"#000000",textBackgroundStyle:nX(i||r?.textBackgroundStyle),fontSize:Qo(n?.style,"font-size",r?.fontSize??18),radius:Qo(n?.style,"border-radius",r?.radius??0),x:Qo(n?.style,"left",r?.x??0),y:Qo(n?.style,"top",r?.y??0),width:Qo(n?.style,"width",r?.width??100),height:Qo(n?.style,"height",r?.height??100),volume:Number(n?.getAttribute("data-volume")??e.volume??r?.volume??1),muted:!!(n?.hasAttribute("muted")||r?.muted),objectFit:wX(n?.style.objectFit),objectPosition:xX(n?.style.objectPosition),kenBurns:n?.getAttribute("data-kenburns")||"none",slug:n?.getAttribute("data-hf-slug")??"",note:n?.getAttribute("data-hf-note")??""}}function r0(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,64)}function wX(t){let e=(t??"").trim().toLowerCase();return e==="contain"||e==="fill"||e==="none"||e==="scale-down"?e:"cover"}function xX(t){let e=(t??"").trim().toLowerCase().replace(/\s+/g," ");return["center","top","bottom","left","right","top left","top right","bottom left","bottom right"].includes(e)?e:"center"}function WU(t,e,n){let r=Bn(t,e);if(!r)return;let o=n.start??e.start,i=n.duration??e.duration,a=n.track??e.track;if(r.setAttribute("data-start",Kt(o)),r.setAttribute("data-duration",Kt(i)),r.setAttribute("data-end",Kt(o+i)),r.setAttribute("data-track-index",String(a)),n.playbackStart!==void 0){let s=Kt(n.playbackStart);r.setAttribute("data-media-start",s),r.setAttribute("data-playback-start",s)}}function KU(t,e,n){return Ao(t,r=>WU(r,e,n))}function s1(t,e){return Ao(t,n=>{for(let r of e)WU(n,r.element,r.updates)})}function h1(t){return Lm.find(e=>e.id===t.hfId||e.id===t.domId||e.id===t.id)}function J_(t,e){return n0(t,e)?.getAttribute("data-layer-kind")||null}function XU(t,e){return n0(t,e)?.getAttribute("data-layer-format")||null}function AU(t){return!Number.isFinite(t)||t<=0?1:Math.max(.05,Math.min(8,t))}function Cs(t){try{let e=t?.contentWindow;return e?.__player&&typeof e.__player.play=="function"?e.__player:null}catch{return null}}function $_(t){try{let e=Cs(t);return e?.refreshClips?.(),!!e?.refreshClips}catch{return!1}}function kU(t,e,n){try{t?.contentWindow?.postMessage({source:"hf-parent",type:"control",action:e,...n},"*")}catch{}}var AX=(0,A.memo)(function({disabled:e,speedDraft:n,onSpeedDraftChange:r,onCommitSpeed:o,onSeek:i,onTogglePlay:a,onUndo:s,onRedo:l,canUndo:c,canRedo:d,usePlayerStore:u}){let p=u(D=>D.isPlaying),f=u(D=>D.currentTime),m=u(D=>D.duration),_=u(D=>D.zoomMode),v=u(D=>D.manualZoomPercent),h=u(D=>D.setZoomMode),y=u(D=>D.setManualZoomPercent),S=m>0?m:Im,E=_==="fit"?100:v,[R,C]=(0,A.useState)(()=>Ms(f)),[I,L]=(0,A.useState)(!1);(0,A.useEffect)(()=>{I||C(Ms(f))},[f,I]);function z(D){h("manual"),y(Math.max(25,Math.min(400,D)))}function U(){let D=pU(R);if(D===null){C(Ms(f));return}i(Math.max(0,Math.min(S,D)))}return(0,g.jsxs)("div",{className:"direct-player-controls",children:[(0,g.jsx)("button",{className:"history-icon-button",type:"button","aria-label":"Undo",disabled:!c,onClick:s,children:(0,g.jsx)("span",{"aria-hidden":"true",children:"\u21B6"})}),(0,g.jsx)("button",{className:"play-icon-button",type:"button","aria-label":p?"Pause":"Play",disabled:e,onClick:a,children:(0,g.jsx)("span",{className:p?"pause-glyph":"play-glyph"})}),(0,g.jsx)("button",{className:"history-icon-button",type:"button","aria-label":"Redo",disabled:!d,onClick:l,children:(0,g.jsx)("span",{"aria-hidden":"true",children:"\u21B7"})}),(0,g.jsxs)("span",{className:"time-readout",children:[(0,g.jsx)("span",{className:"inline-time-input",children:(0,g.jsx)("input",{"aria-label":"Timeline position",type:"text",inputMode:"numeric",pattern:"\\\\d+:\\\\d{2}:\\\\d{2}",value:R,disabled:e,onFocus:()=>{L(!0),C(Ms(Math.min(f,S)))},onChange:D=>{let N=D.target.value;C(N);let B=pU(N);B!==null&&i(Math.max(0,Math.min(S,B)))},onBlur:()=>{L(!1),U()},onKeyDown:D=>{D.key==="Enter"&&D.currentTarget.blur(),D.key==="Escape"&&(C(Ms(f)),D.currentTarget.blur())}})}),(0,g.jsxs)("span",{children:["/ ",Ms(S)]})]}),(0,g.jsx)("input",{className:"preview-scrubber",type:"range",min:"0",max:S,step:"0.01",value:Math.min(f,S),disabled:e,onChange:D=>i(Number(D.target.value))}),(0,g.jsxs)("label",{className:"speed-input",children:[(0,g.jsx)("span",{children:"Speed"}),(0,g.jsxs)("span",{className:"suffix-number",children:[(0,g.jsx)("input",{type:"number",min:"0.05",max:"8",step:"0.05",value:n,disabled:e,onChange:D=>r(D.target.value),onBlur:D=>o(Number(D.target.value)),onKeyDown:D=>{D.key==="Enter"&&D.currentTarget.blur()}}),(0,g.jsx)("b",{children:"x"})]})]}),(0,g.jsxs)("label",{className:"zoom-input",children:[(0,g.jsx)("span",{children:"Zoom"}),(0,g.jsxs)("span",{className:"suffix-number",children:[(0,g.jsx)("input",{type:"number",min:"25",max:"400",step:"5",value:Math.round(E),disabled:e,onChange:D=>z(Number(D.target.value))}),(0,g.jsx)("b",{children:"%"})]})]})]})}),kX=(0,A.memo)(function({state:e,usePlayerStore:n,canGroup:r,canUngroup:o,onClose:i,onSeek:a,onSplit:s,onInsertLayer:l,onInsertText:c,onInsertMedia:d,onUploadMedia:u,onCopyTimestamp:p,onCopyCoordinates:f,onGroup:m,onUngroup:_,onDelete:v}){let h=n(N=>N.currentTime),y=(0,A.useRef)(null),S=220,E=e.element?362:258,R=Math.min(Math.max(8,e.x),Math.max(8,window.innerWidth-S-8)),C=Math.min(Math.max(8,e.y),Math.max(8,window.innerHeight-E-8)),I=e.element?.track??e.track,L=typeof I=="number",z=!!(e.element&&h>e.element.start&&h<e.element.start+e.element.duration),U=!!(e.element&&e.element.hfId!=="source-video");(0,A.useEffect)(()=>{function N(V){y.current?.contains(V.target)||i()}function B(V){V.key==="Escape"&&i()}return window.addEventListener("pointerdown",N),window.addEventListener("keydown",B),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",B)}},[i]);function D({children:N,disabled:B,danger:V,onClick:st}){return(0,g.jsx)("button",{type:"button",disabled:B,className:`timeline-menu-item ${V?"danger":""}`,onClick:()=>{B||(st(),i())},children:N})}return(0,g.jsx)("div",{ref:y,className:"timeline-context-menu",style:{left:R,top:C},onContextMenu:N=>N.preventDefault(),children:e.element?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"timeline-menu-title",children:[(0,g.jsx)("span",{children:e.element.label??e.element.id}),(0,g.jsx)("time",{children:X_(h)})]}),(0,g.jsx)(D,{disabled:!z,onClick:()=>e.element&&s(e.element,h),children:"Split at playhead"}),(0,g.jsx)(D,{disabled:!L,onClick:()=>L&&l(I,"above"),children:"New layer above"}),(0,g.jsx)(D,{disabled:!L,onClick:()=>L&&l(I,"below"),children:"New layer below"}),(0,g.jsx)(D,{onClick:()=>c({time:h,track:null}),children:"Insert Text"}),(0,g.jsx)(D,{onClick:()=>d({time:h,track:null}),children:"Insert Media"}),(0,g.jsx)(D,{onClick:()=>u({time:h,track:null}),children:"Upload Media\u2026"}),(0,g.jsx)(D,{onClick:()=>p(h),children:"Copy Timestamp"}),(0,g.jsx)(D,{onClick:()=>f({time:h,track:I??null}),children:"Copy Coordinates"}),r&&(0,g.jsx)(D,{onClick:m,children:"Group selected"}),o&&(0,g.jsx)(D,{onClick:_,children:"Ungroup"}),(0,g.jsx)(D,{disabled:!U,danger:!0,onClick:()=>e.element&&v(e.element),children:"Delete layer"})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(D,{onClick:()=>a(e.time),children:["Seek to ",X_(e.time)]}),(0,g.jsx)(D,{disabled:!L,onClick:()=>L&&l(I,"above"),children:"New layer above"}),(0,g.jsx)(D,{disabled:!L,onClick:()=>L&&l(I,"below"),children:"New layer below"}),(0,g.jsx)(D,{onClick:()=>c({time:e.time,track:null}),children:"Insert Text"}),(0,g.jsx)(D,{onClick:()=>d({time:e.time,track:null}),children:"Insert Media"}),(0,g.jsx)(D,{onClick:()=>u({time:e.time,track:null}),children:"Upload Media\u2026"}),(0,g.jsx)(D,{onClick:()=>p(e.time),children:"Copy Timestamp"}),(0,g.jsx)(D,{onClick:()=>f({time:e.time,track:I??null}),children:"Copy Coordinates"})]})})});function IX({state:t,onClose:e,onInsertText:n,onInsertMedia:r,onUploadMedia:o,onCopyTimestamp:i,onCopyCoordinates:a}){let s=(0,A.useRef)(null),l=220,c=174,d=Math.min(Math.max(8,t.x),Math.max(8,window.innerWidth-l-8)),u=Math.min(Math.max(8,t.y),Math.max(8,window.innerHeight-c-8));(0,A.useEffect)(()=>{function f(_){s.current?.contains(_.target)||e()}function m(_){_.key==="Escape"&&e()}return window.addEventListener("pointerdown",f),window.addEventListener("keydown",m),()=>{window.removeEventListener("pointerdown",f),window.removeEventListener("keydown",m)}},[e]);function p({children:f,onClick:m}){return(0,g.jsx)("button",{type:"button",className:"timeline-menu-item",onClick:()=>{m(),e()},children:f})}return(0,g.jsxs)("div",{ref:s,className:"timeline-context-menu preview-context-menu",style:{left:d,top:u},onContextMenu:f=>f.preventDefault(),children:[(0,g.jsx)(p,{onClick:()=>n({time:t.time,frame:t.frame}),children:"Insert Text"}),(0,g.jsx)(p,{onClick:()=>r({time:t.time,frame:t.frame}),children:"Insert Media"}),(0,g.jsx)(p,{onClick:()=>o({time:t.time,frame:t.frame}),children:"Upload Media\u2026"}),(0,g.jsx)(p,{onClick:()=>i(t.time),children:"Copy Timestamp"}),(0,g.jsx)(p,{onClick:()=>a(t.frame),children:"Copy Coordinates"})]})}function RX({state:t,onClose:e}){let n=KK(t),r=t.phase==="starting"||t.phase==="running",o=t.phase==="succeeded"?"Rendered":t.phase==="failed"?"Render failed":"Rendering...",i=t.status||(t.phase==="starting"?"STARTING":"RUNNING"),a=t.totalFrames?`${t.framesRendered??0} / ${t.totalFrames} frames`:`${t.framesRendered??0} frames`;return(0,g.jsx)("div",{className:"publish-modal-backdrop",role:"presentation",children:(0,g.jsxs)("section",{className:"publish-modal",role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:[(0,g.jsxs)("div",{className:"publish-modal-kicker",children:[(0,g.jsx)("span",{children:"Production AWS Lambda"}),!r&&(0,g.jsx)("button",{type:"button",className:"publish-modal-close","aria-label":"Close publish status",onClick:e,children:"x"})]}),(0,g.jsxs)("h2",{id:"publish-modal-title",children:[r&&(0,g.jsx)(Om,{label:"Rendering"}),o]}),(0,g.jsxs)("p",{className:"publish-modal-summary",children:["Rendering ",(0,g.jsx)("strong",{children:t.title})," on production infrastructure. The final output link will appear when the render succeeds."]}),r&&(0,g.jsx)("p",{className:"publish-modal-eta",children:"Estimated time: ~5 minutes. Feel free to open new tabs and keep working \u2014 this render continues in the background and the output link will appear here when it's ready."}),(0,g.jsx)("div",{className:"publish-progress-shell","aria-label":`Publish progress ${n}%`,children:(0,g.jsx)("span",{style:{width:`${n}%`}})}),(0,g.jsxs)("dl",{className:"publish-detail-grid",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Status"}),(0,g.jsx)("dd",{children:i})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Progress"}),(0,g.jsxs)("dd",{children:[n,"%"]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Frames"}),(0,g.jsx)("dd",{children:a})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Cost"}),(0,g.jsx)("dd",{children:t.cost||"$0.0000"})]}),t.renderId&&(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Render ID"}),(0,g.jsx)("dd",{children:t.renderId})]}),t.phase==="succeeded"&&t.outputS3Uri&&(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Output"}),(0,g.jsx)("dd",{children:t.outputS3Uri})]})]}),t.error||t.errors?.length?(0,g.jsxs)("div",{className:"publish-error-box",children:[(0,g.jsx)("strong",{children:t.error||t.errors?.[0]?.error||"Render failed"}),t.errors?.slice(0,2).map((s,l)=>(0,g.jsxs)("p",{children:[s.state?`${s.state}: `:"",s.cause||s.error]},`${s.state||"state"}-${l}`))]}):null,(0,g.jsx)("div",{className:"publish-modal-actions",children:t.outputUrl&&(0,g.jsx)("a",{href:t.outputUrl,target:"_blank",rel:"noreferrer",children:"Open output"})})]})})}function NX({action:t,composition:e=Um[0],onPublish:n,publishOptions:r=null,onPublishOption:o,publishDisabled:i=!1,publishLabel:a="Publish",templateId:s=null,forkId:l=null,publishVersion:c=null,originalUrl:d=null,songName:u=null,songUrl:p=null,onOpenShare:f,onOpenDecompose:m,onOpenHistory:_,decomposeDismissed:v=!1,decomposeBusy:h=!1,onResumeDecompose:y}){let S=e.viralDna,E=S.promotions??[],[R,C]=(0,A.useState)(!1),I=(0,A.useRef)(null),[L,z]=(0,A.useState)(!1),U=(0,A.useRef)(null),D=!!(r&&r.length>1&&o);(0,A.useEffect)(()=>{if(!L)return;let B=st=>{U.current&&(U.current.contains(st.target)||z(!1))},V=st=>{st.key==="Escape"&&z(!1)};return document.addEventListener("mousedown",B),document.addEventListener("keydown",V),()=>{document.removeEventListener("mousedown",B),document.removeEventListener("keydown",V)}},[L]),(0,A.useEffect)(()=>{if(!R)return;let B=st=>{I.current&&(I.current.contains(st.target)||C(!1))},V=st=>{st.key==="Escape"&&C(!1)};return document.addEventListener("mousedown",B),document.addEventListener("keydown",V),()=>{document.removeEventListener("mousedown",B),document.removeEventListener("keydown",V)}},[R]);let N=[{label:"New decompose\u2026",handler:m,disabled:!m},{label:"History\u2026",handler:_,disabled:!_||!l,hint:l?void 0:"Save first"}];return(0,g.jsxs)("section",{className:"dna-panel",children:[(0,g.jsxs)("div",{className:"panel-title",children:[(0,g.jsx)("span",{children:"Viral DNA"}),(0,g.jsxs)("div",{className:"panel-title-actions",children:[(0,g.jsx)(DX,{templateId:s,forkId:l,publishVersion:c,originalUrl:d,songName:u,songUrl:p,trendTagline:S.trendTagline??null}),(0,g.jsxs)("div",{className:"panel-menu-wrap",ref:I,children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button panel-menu-button","aria-haspopup":"menu","aria-expanded":R,"aria-label":"More actions",title:"More actions",onClick:()=>C(B=>!B),children:"\u22EF"}),R&&(0,g.jsx)("div",{className:"panel-menu-popover",role:"menu",children:N.map(B=>(0,g.jsx)("button",{type:"button",role:"menuitem",className:"panel-menu-item",disabled:B.disabled,title:B.hint,onClick:()=>{C(!1),B.handler?.()},children:B.label},B.label))})]}),(0,g.jsxs)("div",{className:"panel-menu-wrap",ref:U,children:[(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",disabled:i,"aria-busy":i?"true":void 0,"aria-haspopup":D?"menu":void 0,"aria-expanded":D?L:void 0,onClick:()=>{D?z(B=>!B):n?.()},children:[a==="Rendering"&&(0,g.jsx)(Om,{label:"Rendering"}),a]}),D&&L&&(0,g.jsx)("div",{className:"panel-menu-popover",role:"menu",children:r.map(B=>(0,g.jsx)("button",{type:"button",role:"menuitem",className:"panel-menu-item",title:B.hint,onClick:()=>{z(!1),o?.(B.key)},children:B.label},B.key))})]})]})]}),t,v&&y&&(0,g.jsxs)("article",{className:"decompose-cta",children:[(0,g.jsx)("strong",{children:"Not decomposed yet"}),(0,g.jsx)("p",{children:"Split this reference into editable scenes, captions, and viral DNA whenever you're ready. You can keep playing the preview and chatting with the AI in the meantime."}),(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",onClick:y,disabled:h,"aria-busy":h?"true":void 0,children:[h&&(0,g.jsx)(Om,{label:"Decomposing"}),h?"Decomposing\u2026":"Decompose"]})]}),(0,g.jsxs)("article",{className:"source-card",children:[(0,g.jsx)("h2",{children:"Reference"}),(0,g.jsx)("p",{children:e.title})]}),(0,g.jsxs)("article",{className:"dna-card",children:[(0,g.jsx)("strong",{children:"Hook"}),(0,g.jsx)("p",{children:S.hook})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Retention"}),(0,g.jsx)("p",{children:S.retention})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Payoff"}),(0,g.jsx)("p",{children:S.payoff})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Preserve"}),(0,g.jsx)("ul",{children:S.preserve.map(B=>(0,g.jsx)("li",{children:B},B))})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Avoid"}),(0,g.jsx)("ul",{children:S.avoid.map(B=>(0,g.jsx)("li",{children:B},B))})]}),E.length>0&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Reuse for promotions"}),(0,g.jsx)("p",{className:"dna-panel-hint",children:"Same viral tactic, different pitch. Ideas for what this format can promote without breaking the hook:"}),(0,g.jsx)("ul",{children:E.map(B=>(0,g.jsx)("li",{children:B},B))})]})]})}function CX({value:t,onChange:e}){let n=K_(t);return(0,g.jsxs)("div",{className:"font-select-wrap",children:[(0,g.jsx)("select",{"aria-label":"Caption font",value:n,style:{fontFamily:`${Jl(n)}, 'TikTok Sans'`,fontWeight:Os(n)},onChange:r=>e(K_(r.target.value)),children:LU.map(r=>(0,g.jsx)("option",{value:r,style:{fontFamily:`${Jl(r)}, 'TikTok Sans'`,fontWeight:Os(r)},children:eX(r)},r))}),(0,g.jsx)("span",{"aria-hidden":"true",children:"v"})]})}function MX({value:t,color:e,background:n,onChange:r}){return(0,g.jsx)("div",{className:"text-background-options",role:"radiogroup","aria-label":"Text background style",children:UU.map(o=>(0,g.jsxs)("button",{type:"button",role:"radio","aria-checked":t===o.id,className:`text-background-option ${t===o.id?"selected":""}`,onClick:()=>r(o.id),children:[(0,g.jsx)("span",{style:{color:e,width:o.id==="fullwidth"?"100%":void 0,background:o.id==="highlight-solid"?n:o.id==="highlight-translucent"?PU(n,.34):o.id==="fullwidth"?DU:"transparent",WebkitTextStroke:o.id==="outline"?`1px ${n}`:"0 transparent",textShadow:o.id==="outline"?`1px 0 ${n}, -1px 0 ${n}, 0 1px ${n}, 0 -1px ${n}`:"none"},children:"Aa"}),(0,g.jsx)("b",{children:o.label})]},o.id))})}function OX({value:t,onChange:e,onCommit:n}){let[r,o]=(0,A.useState)(!1);return(0,g.jsx)("div",{className:`text-draft-shell ${r?"active":""}`,children:(0,g.jsx)("textarea",{rows:3,value:t,onFocus:()=>o(!0),onBlur:()=>{o(!1),n()},onChange:i=>e(i.target.value),onKeyDown:i=>{(i.metaKey||i.ctrlKey)&&i.key==="Enter"&&(i.preventDefault(),n())}})})}function l1(t,e){return{...e,start:t.start,duration:t.duration,track:t.track}}function IU(t,e){return e?{...t,...e.updates}:t}function d1(t,e){let n=Bn(e0(t),e);return n?{...e,...Ql(n)}:e}function j_(t,e){return!t||!e?t===e:t.text===e.text&&t.src===e.src&&t.fontFamily===e.fontFamily&&t.fontWeight===e.fontWeight&&t.italic===e.italic&&t.underline===e.underline&&t.color===e.color&&t.background===e.background&&t.textBackgroundStyle===e.textBackgroundStyle&&t.fontSize===e.fontSize&&t.radius===e.radius&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height&&t.volume===e.volume&&t.muted===e.muted&&t.kenBurns===e.kenBurns&&t.start===e.start&&t.duration===e.duration&&t.track===e.track}function RU(t,e){if(!e)return{...t};let n={};for(let r of["text","src","fontFamily","fontWeight","italic","underline","color","background","textBackgroundStyle","fontSize","radius","x","y","width","height","volume","muted","kenBurns","start","duration","track"])t[r]!==e[r]&&(n[r]=t[r]);return n}function q_({value:t}){let[e,n]=(0,A.useState)("idle");(0,A.useEffect)(()=>{if(e==="idle")return;let o=window.setTimeout(()=>n("idle"),900);return()=>window.clearTimeout(o)},[e]);let r=()=>{if(!t||!navigator.clipboard){n("error");return}navigator.clipboard.writeText(t).then(()=>n("done")).catch(()=>n("error"))};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("code",{className:"publish-info-value",title:t?`Click to copy: ${t}`:"no value",onClick:r,children:t||"\u2014"}),(0,g.jsx)("button",{type:"button",className:`inspector-id-copy inspector-id-copy--${e}`,onClick:r,disabled:!t,"aria-label":"Copy value",title:"Copy",children:e==="done"?(0,g.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,g.jsx)("path",{d:"M20 6L9 17l-5-5"})}):(0,g.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,g.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),(0,g.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function DX({templateId:t,forkId:e,publishVersion:n,originalUrl:r,songName:o,songUrl:i,trendTagline:a}){let[s,l]=(0,A.useState)(!1),c=(0,A.useRef)(null);return(0,A.useEffect)(()=>{if(!s)return;let d=p=>{c.current&&!c.current.contains(p.target)&&l(!1)},u=p=>{p.key==="Escape"&&l(!1)};return window.addEventListener("mousedown",d),window.addEventListener("keydown",u),()=>{window.removeEventListener("mousedown",d),window.removeEventListener("keydown",u)}},[s]),(0,g.jsxs)("div",{className:"publish-info-wrap",ref:c,children:[(0,g.jsx)("button",{type:"button",className:"publish-info-trigger",onClick:()=>l(d=>!d),"aria-label":"Template info",title:"Template info",children:(0,g.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,g.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,g.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),s&&(0,g.jsxs)("div",{className:"publish-info-popover",role:"dialog",children:[a?(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"trend_tagline"}),(0,g.jsx)(q_,{value:a})]}):null,(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"template_id"}),(0,g.jsx)(q_,{value:t??""})]}),(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"fork_id"}),(0,g.jsx)(q_,{value:e??""})]}),(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"version"}),(0,g.jsx)(q_,{value:n!==null?String(n):""})]}),r?(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"original"}),(0,g.jsx)("a",{className:"publish-info-link",href:r,target:"_blank",rel:"noopener noreferrer",children:r})]}):null,o||i?(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"song"}),i?(0,g.jsx)("a",{className:"publish-info-link",href:i,target:"_blank",rel:"noopener noreferrer",children:o||i}):(0,g.jsx)("span",{children:o})]}):null]})]})}function LX({mode:t,busy:e,finished:n,error:r,scenesCreated:o,ghostcutStatus:i,ghostcutProgress:a,userPrompt:s,onUserPromptChange:l,onDecompose:c,onFinish:d,onCancel:u,onDismiss:p}){let f=!!p&&!n;return(0,g.jsx)("div",{className:"decompose-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"decompose-modal-title",children:(0,g.jsxs)("div",{className:"decompose-modal",children:[f&&(0,g.jsx)("button",{type:"button",className:"decompose-modal-close","aria-label":"Dismiss \u2014 decompose later",title:"Later",onClick:p,disabled:e,children:"\u2715"}),n?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h2",{id:"decompose-modal-title",children:"Decomposed \u2713"}),(0,g.jsxs)("p",{children:[o!==null?`Split the video into ${o} editable scene${o===1?"":"s"}.`:"Split the video into editable scenes."," Click Finish to load the timeline."]}),i==="pending"&&(0,g.jsxs)("p",{className:"decompose-modal-note",children:["Removing hardcoded subtitles\u2026",a!==null&&` (${Math.round(a)}%)`," This usually takes about 5 minutes. You can leave this tab open, work in another tab, or come back later \u2014 Finish will unlock automatically once the cleaned video is ready."]}),i==="done"&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Hardcoded subtitles removed \u2713 \u2014 click Finish to load the cleaned video."}),i==="failed"&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Subtitle removal failed; original video retained."}),(0,g.jsx)("div",{className:"decompose-modal-actions",children:(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",onClick:d,disabled:i==="pending","aria-busy":i==="pending",children:[i==="pending"&&(0,g.jsx)(Om,{label:"Removing subtitles"}),i==="pending"?"Removing subtitles\u2026":"Finish"]})})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h2",{id:"decompose-modal-title",children:t==="redo"?"Re-decompose this composition":"Decompose this composition"}),(0,g.jsx)("p",{children:t==="redo"?"Runs the AI decomposer again from the current source video. Your existing timeline edits on this working copy will be replaced \u2014 publish or snapshot first if you want to keep them.":"Smart-decompose splits the source video into scenes, extracts on-screen captions, and generates viral DNA using your saved AI provider key (Gemini \u2192 OpenAI \u2192 OpenRouter). Requires an AI provider key in Settings. If you're the first user to decompose this inspiration, your decomposition becomes the default template fork for everyone else."}),(0,g.jsxs)("label",{className:"decompose-modal-prompt",children:[(0,g.jsx)("span",{children:"Guidance for the AI (optional)"}),(0,g.jsx)("textarea",{className:"decompose-modal-textarea",placeholder:"e.g. Pay attention to the pinned comment as the hook; the payoff is the dance-floor reveal at ~00:08; keep captions in lowercase to match the original TikTok voice.",value:s,rows:4,maxLength:4e3,onChange:m=>l(m.target.value),disabled:e}),(0,g.jsx)("span",{className:"decompose-modal-hint",children:"Tell the model what to focus on: which beats matter, which captions are the hook, tone, preferred scene granularity, etc. Left blank uses the default extraction prompt."})]}),r&&(0,g.jsx)("p",{className:"decompose-modal-error",children:r}),(0,g.jsxs)("div",{className:"decompose-modal-actions",children:[f&&(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:p,disabled:e,children:"Later"}),u&&(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:u,disabled:e,children:"Cancel"}),(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",onClick:c,disabled:e,"aria-busy":e,children:[e&&(0,g.jsx)(Om,{label:"Decomposing"}),e?"Decomposing\u2026":t==="redo"?"Re-decompose":"Decompose"]})]})]})]})})}function UX({forkId:t,onClose:e}){let[n,r]=(0,A.useState)(null),[o,i]=(0,A.useState)(!1),[a,s]=(0,A.useState)(null),[l,c]=(0,A.useState)(!1);(0,A.useEffect)(()=>{let p=!0;return fetch(`/api/v1/compositions/${encodeURIComponent(t)}`).then(f=>f.ok?f.json():null).then(f=>{if(!p||!f)return;let m=f.visibility;r(m==="private"||m==="public"||m==="unlisted"?m:"private")}).catch(()=>p&&r("private")),()=>{p=!1}},[t]);let d=(0,A.useCallback)(async p=>{i(!0),s(null),c(!1);try{let f=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/visibility`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({visibility:p})}),m=await f.json().catch(()=>({}));if(!f.ok||m?.ok===!1)throw new Error(m?.error||`Save failed (${f.status})`);r(p),c(!0)}catch(f){s(f instanceof Error?f.message:String(f))}finally{i(!1)}},[t]),u=typeof window<"u"?`${window.location.origin}/editor/?fork=${encodeURIComponent(t)}`:"";return(0,g.jsx)("div",{className:"decompose-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"share-modal-title",children:(0,g.jsxs)("div",{className:"decompose-modal",children:[(0,g.jsx)("h2",{id:"share-modal-title",children:"Share this composition"}),(0,g.jsx)("p",{children:"Anyone with the link can view a public composition. Private compositions are only visible to you."}),n===null?(0,g.jsx)("p",{className:"decompose-modal-note",children:"Loading current visibility\u2026"}):(0,g.jsxs)("div",{className:"share-modal-choices",children:[(0,g.jsxs)("label",{className:`share-choice${n==="private"?" share-choice--active":""}`,children:[(0,g.jsx)("input",{type:"radio",name:"visibility",value:"private",checked:n==="private",disabled:o,onChange:()=>void d("private")}),(0,g.jsx)("span",{className:"share-choice-label",children:"Private"}),(0,g.jsx)("span",{className:"share-choice-hint",children:"Only you can view or edit."})]}),(0,g.jsxs)("label",{className:`share-choice${n==="public"?" share-choice--active":""}`,children:[(0,g.jsx)("input",{type:"radio",name:"visibility",value:"public",checked:n==="public",disabled:o,onChange:()=>void d("public")}),(0,g.jsx)("span",{className:"share-choice-label",children:"Public (view-only)"}),(0,g.jsx)("span",{className:"share-choice-hint",children:"Anyone with the link can view."})]})]}),n==="public"&&(0,g.jsxs)("div",{className:"share-modal-link",children:[(0,g.jsx)("input",{readOnly:!0,value:u,onFocus:p=>p.currentTarget.select()}),(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(u)},children:"Copy"})]}),n==="unlisted"&&(0,g.jsx)("p",{className:"decompose-modal-note",children:'Currently "unlisted" (legacy). Switch to Public or Private to update.'}),a&&(0,g.jsx)("p",{className:"decompose-modal-error",children:a}),l&&!a&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Saved \u2713"}),(0,g.jsx)("div",{className:"decompose-modal-actions",children:(0,g.jsx)("button",{type:"button",className:"panel-action-button primary",onClick:e,disabled:o,children:"Done"})})]})})}function BX({forkId:t,templateId:e,currentVersion:n,onClose:r,onReverted:o}){let[i,a]=(0,A.useState)(null),[s,l]=(0,A.useState)(null),[c,d]=(0,A.useState)(null);(0,A.useEffect)(()=>{let f=!0;return fetch(`/api/v1/compositions/${encodeURIComponent(t)}/versions?limit=100`).then(m=>m.ok?m.json():null).then(m=>{if(!f)return;if(!m){l("Could not load versions");return}let v=(Array.isArray(m.versions)?m.versions:[]).map(h=>({version:Number(h.version),createdAt:typeof h.created_at=="string"?h.created_at:null,message:typeof h.message=="string"?h.message:null,reason:typeof h.reason=="string"?h.reason:null})).filter(h=>Number.isFinite(h.version));v.sort((h,y)=>y.version-h.version),a(v)}).catch(m=>f&&l(m instanceof Error?m.message:String(m))),()=>{f=!1}},[t]);let u=()=>{if(typeof window>"u"||!e)return;let f=`/editor/${encodeURIComponent(e)}?fork=${encodeURIComponent(t)}`;window.open(f,"_blank","noopener,noreferrer")},p=(0,A.useCallback)(async f=>{d(f),l(null);try{let m=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/versions/${f}/composition.html`);if(!m.ok)throw new Error(`Load HTML failed (${m.status})`);let _=await m.text(),v=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/versions/${f}/composition.json`),h=v.ok?await v.text():null,y=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/composition.html`,{method:"PUT",headers:{"content-type":"text/html"},body:_});if(!y.ok){let S=await y.json().catch(()=>({}));throw new Error(S?.error||`Save HTML failed (${y.status})`)}h&&await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/composition.json`,{method:"PATCH",headers:{"content-type":"application/json"},body:h}).catch(()=>{}),o()}catch(m){l(m instanceof Error?m.message:String(m)),d(null)}},[t,o]);return(0,g.jsx)("div",{className:"decompose-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"history-modal-title",children:(0,g.jsxs)("div",{className:"decompose-modal history-modal",children:[(0,g.jsx)("h2",{id:"history-modal-title",children:"Version history"}),(0,g.jsx)("p",{children:"Every publish or manual snapshot creates an immutable version. Open this fork in the editor in a new tab, or revert this working copy to a past version."}),i===null&&!s&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Loading versions\u2026"}),s&&(0,g.jsx)("p",{className:"decompose-modal-error",children:s}),i!==null&&i.length===0&&!s&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"No published versions yet. Publish once to create v1."}),i&&i.length>0&&(0,g.jsx)("ul",{className:"history-list",children:i.map(f=>{let m=n!==null&&f.version===n;return(0,g.jsxs)("li",{className:`history-row${m?" history-row--current":""}`,children:[(0,g.jsxs)("div",{className:"history-row-head",children:[(0,g.jsxs)("span",{className:"history-version",children:["v",f.version,m&&" (current)"]}),f.createdAt&&(0,g.jsx)("span",{className:"history-date",children:new Date(f.createdAt).toLocaleString()})]}),f.message&&(0,g.jsx)("div",{className:"history-message",children:f.message}),f.reason&&(0,g.jsxs)("div",{className:"history-reason",children:["reason: ",f.reason]}),(0,g.jsxs)("div",{className:"history-actions",children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",disabled:!e,onClick:u,children:"Open in new tab"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button primary",disabled:c!==null||m,onClick:()=>void p(f.version),children:c===f.version?"Reverting\u2026":"Revert to this"})]})]},f.version)})}),(0,g.jsx)("div",{className:"decompose-modal-actions",children:(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:r,disabled:c!==null,children:"Close"})})]})})}function PX({id:t}){let[e,n]=(0,A.useState)("idle");(0,A.useEffect)(()=>{if(e==="idle")return;let o=window.setTimeout(()=>n("idle"),900);return()=>window.clearTimeout(o)},[e]);let r=()=>{if(t){if(typeof navigator>"u"||!navigator.clipboard){n("error");return}navigator.clipboard.writeText(t).then(()=>n("done")).catch(()=>n("error"))}};return(0,g.jsxs)("button",{type:"button",className:`click-copy-id click-copy-id--${e}`,onClick:r,disabled:!t,"aria-label":"Copy element id",title:t?`Click to copy: ${t}`:"No id",children:[(0,g.jsx)("code",{children:t||"\u2014"}),(0,g.jsx)("span",{className:"click-copy-id-state","aria-live":"polite",children:e==="done"?"\u2713":e==="error"?"!":"\u29C9"})]})}function V_({value:t,min:e,max:n,step:r=.01,onCommit:o}){let[i,a]=(0,A.useState)(()=>Number(t.toFixed(2)).toString()),[s,l]=(0,A.useState)(!1),c=(0,A.useRef)(!1);(0,A.useEffect)(()=>{s||a(Number(t.toFixed(2)).toString())},[s,t]);function d(p){return Number.isFinite(p)?Math.max(e??Number.NEGATIVE_INFINITY,Math.min(n??Number.POSITIVE_INFINITY,p)):t}function u(p=i){let f=Number(p);if(!Number.isFinite(f)){a(Number(t.toFixed(2)).toString());return}let m=d(f);a(Number(m.toFixed(2)).toString()),o(m)}return(0,g.jsx)("input",{type:"number",min:e,max:n,step:r,value:i,onFocus:()=>l(!0),onChange:p=>{a(p.target.value)},onBlur:()=>{if(l(!1),c.current){c.current=!1,a(Number(t.toFixed(2)).toString());return}u()},onKeyDown:p=>{p.key==="Enter"&&p.currentTarget.blur(),p.key==="Escape"&&(c.current=!0,a(Number(t.toFixed(2)).toString()),p.currentTarget.blur())}})}function zX(t,e,n,r){let o=e.slug.trim();o?t.setAttribute("data-hf-slug",o):t.removeAttribute("data-hf-slug");let i=e.note.trim();i?t.setAttribute("data-hf-note",i):t.removeAttribute("data-hf-note"),r.isMedia&&(t.setAttribute("src",e.src),r.isAudio||(t.style.objectFit=e.objectFit,t.style.objectPosition=e.objectPosition),t0(t,"img")&&Pm(t,e.kenBurns==="none"?null:e.kenBurns)),(r.isAudio||r.isVideoElement)&&(e.muted?t.setAttribute("muted",""):t.removeAttribute("muted"),t.setAttribute("data-volume",Kt(e.volume))),r.isVisual&&(t.style.left=`${e.x}%`,t.style.top=`${e.y}%`,t.style.width=`${e.width}%`,t.style.height=`${e.height}%`),r.isTextLike&&(t.setAttribute("data-label",e.text.slice(0,48)||n.label||n.id),BU(t,e.fontFamily,e.fontWeight),t.style.fontWeight=String(e.fontWeight),t.style.fontStyle=e.italic?"italic":"normal",t.style.textDecorationLine=e.underline?"underline":"none",t.style.color=e.color,t.style.background="transparent",t.style.fontSize=`${e.fontSize}px`,t.style.borderRadius=`${e.radius}px`,Q_(t,e.text,e.textBackgroundStyle,e.color,e.background,e.fontFamily,e.fontWeight))}function Y_(t,e,n,r,o){if(r.isMedia&&"src"in o&&t.setAttribute("src",e.src),r.isMedia&&!r.isAudio&&("objectFit"in o&&(t.style.objectFit=e.objectFit),"objectPosition"in o&&(t.style.objectPosition=e.objectPosition),"kenBurns"in o&&t0(t,"img")&&(Pm(t,e.kenBurns==="none"?null:e.kenBurns),YK(t))),(r.isAudio||r.isVideoElement)&&("muted"in o&&(e.muted?t.setAttribute("muted",""):t.removeAttribute("muted")),"volume"in o&&t.setAttribute("data-volume",Kt(e.volume))),r.isVisual&&("x"in o&&(t.style.left=`${e.x}%`),"y"in o&&(t.style.top=`${e.y}%`),"width"in o&&(t.style.width=`${e.width}%`),"height"in o&&(t.style.height=`${e.height}%`)),"slug"in o){let s=e.slug.trim();s?t.setAttribute("data-hf-slug",s):t.removeAttribute("data-hf-slug")}if("note"in o){let s=e.note.trim();s?t.setAttribute("data-hf-note",s):t.removeAttribute("data-hf-note")}if(!r.isTextLike)return;let i=t.querySelector("[data-vf-text-inline]"),a=t.querySelector("[data-vf-text-lines]");"text"in o&&t.setAttribute("data-label",e.text.slice(0,48)||n.label||n.id),("fontFamily"in o||"fontWeight"in o)&&(t.setAttribute("data-font-family",e.fontFamily),BU(t,e.fontFamily,e.fontWeight),i&&i.setAttribute("data-font-family",e.fontFamily),a&&(a.style.fontFamily=`${Jl(e.fontFamily)}, 'TikTok Sans'`)),"italic"in o&&(t.style.fontStyle=e.italic?"italic":"normal"),"underline"in o&&(t.style.textDecorationLine=e.underline?"underline":"none"),"color"in o&&(t.style.color=e.color,i&&(i.style.color=e.color)),"fontSize"in o&&(t.style.fontSize=`${e.fontSize}px`),"radius"in o&&(t.style.borderRadius=`${e.radius}px`),("text"in o||"textBackgroundStyle"in o||"background"in o)&&(t.style.background="transparent",Q_(t,e.text,e.textBackgroundStyle,e.color,e.background,e.fontFamily,e.fontWeight))}function FX(t){return t?t.tag!=="audio"&&t.tag!=="video"&&t.tag!=="img"&&t.tag!=="image":!1}function b1(t){return!t||t.tag==="audio"?!1:(t.hfId||t.domId||t.id||t.key)!=="source-video"}function JU(t){return{x:Qo(t.style,"left",0),y:Qo(t.style,"top",0),width:Qo(t.style,"width",100),height:Qo(t.style,"height",100),fontSize:Qo(t.style,"font-size",NaN)}}function f1(t,e){t.style.left=`${e.x}%`,t.style.top=`${e.y}%`,t.style.width=`${e.width}%`,t.style.height=`${e.height}%`,Number.isFinite(e.fontSize)&&(t.style.fontSize=`${e.fontSize}px`)}function HX(t,e,n){t.style.display="block",t.style.position="absolute",t.style.left=e.style.left||"0%",t.style.top=e.style.top||"0%",t.style.width=e.style.width||"100%",t.style.height=e.style.height||"100%",t.style.borderRadius=e.style.borderRadius||"0",t.style.zIndex="9999";let r=b1(n),o=e.getAttribute("data-hf-id")||e.id||Nt(n);r?(t.style.pointerEvents="auto",t.style.cursor="move",t.setAttribute("data-vf-frame-handle","move"),t.setAttribute("data-vf-target-id",o)):(t.style.pointerEvents="none",t.style.cursor="",t.removeAttribute("data-vf-frame-handle"),t.removeAttribute("data-vf-target-id")),t.style.border=r?"1px dashed #F2CD46":"3px solid #F2CD46",t.style.boxShadow=r?"0 0 0 2px #118df2":"inset 0 0 0 1px #000000, 0 0 0 7px rgba(242, 205, 70, 0.32)";for(let i of Array.from(t.querySelectorAll("[data-vf-frame-handle]")))i.remove();if(r)for(let[i,a]of[["top-left","left:-7px;top:-7px;cursor:nwse-resize;"],["top","top:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize;"],["top-right","right:-7px;top:-7px;cursor:nesw-resize;"],["right","right:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize;"],["bottom-right","right:-7px;bottom:-7px;cursor:nwse-resize;"],["bottom","bottom:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize;"],["bottom-left","left:-7px;bottom:-7px;cursor:nesw-resize;"],["left","left:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize;"]]){let s=t.ownerDocument.createElement("span");s.setAttribute("data-vf-frame-handle",i),s.setAttribute("data-vf-target-id",o),s.style.cssText=["position:absolute","display:block","width:14px","height:14px","box-sizing:border-box","border-radius:999px","border:2px solid #0b0d0a","background:#F2CD46","box-shadow:0 0 0 2px rgba(242,205,70,0.32),0 1px 4px rgba(0,0,0,0.38)","pointer-events:auto","touch-action:none",a].join(";"),t.append(s)}}var GX=(0,A.memo)(function({selected:e,html:n,visualFrameDraft:r,stageRef:o,getIframe:i,onStageFrame:a,onCommitDrag:s}){let[l,c]=(0,A.useState)(null),d=(0,A.useRef)(null),u=(0,A.useRef)(()=>{});u.current=()=>{if(!e||!b1(e)){c(null);return}let v=i(),h=o.current,y=v?.contentDocument,S=y?.querySelector("[data-composition-id]"),E=y?Bn(y,e):null;if(!v||!h||!re(S)||!re(E)){c(null);return}let R=v.getBoundingClientRect(),C=h.getBoundingClientRect(),I=r??JU(E);c({left:R.left-C.left+I.x/100*R.width,top:R.top-C.top+I.y/100*R.height,width:I.width/100*R.width,height:I.height/100*R.height,draft:I})},(0,A.useEffect)(()=>{u.current()},[n,e,r]),(0,A.useEffect)(()=>{let v=()=>u.current();return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);function p(v){if(!e)return;let h=i();km(h,e,R=>f1(R,v));let y=o.current;if(!h||!y)return;let S=h.getBoundingClientRect(),E=y.getBoundingClientRect();c({left:S.left-E.left+v.x/100*S.width,top:S.top-E.top+v.y/100*S.height,width:v.width/100*S.width,height:v.height/100*S.height,draft:v})}function f(v,h){if(!l)return;h.preventDefault(),h.stopPropagation();let y=i(),S=y?.getBoundingClientRect().width??1,E=y?.getBoundingClientRect().height??1;d.current={mode:v,originX:h.clientX,originY:h.clientY,rootWidth:S,rootHeight:E,draft:l.draft,latest:l.draft},h.currentTarget.setPointerCapture(h.pointerId)}function m(v){let h=d.current;if(!h)return;v.preventDefault(),v.stopPropagation();let y=(v.clientX-h.originX)/Math.max(1,h.rootWidth)*100,S=(v.clientY-h.originY)/Math.max(1,h.rootHeight)*100,E={...h.draft};if(h.mode==="move"&&(E.x=Lt(h.draft.x+y,0,100-h.draft.width),E.y=Lt(h.draft.y+S,0,100-h.draft.height)),h.mode==="left"||h.mode==="top-left"||h.mode==="bottom-left"){let R=Lt(h.draft.x+y,0,h.draft.x+h.draft.width-1);E.x=R,E.width=Lt(h.draft.width+(h.draft.x-R),1,100-R)}if((h.mode==="right"||h.mode==="top-right"||h.mode==="bottom-right")&&(E.width=Lt(h.draft.width+y,1,100-h.draft.x)),h.mode==="top"||h.mode==="top-left"||h.mode==="top-right"){let R=Lt(h.draft.y+S,0,h.draft.y+h.draft.height-1);E.y=R,E.height=Lt(h.draft.height+(h.draft.y-R),1,100-R)}if((h.mode==="bottom"||h.mode==="bottom-left"||h.mode==="bottom-right")&&(E.height=Lt(h.draft.height+S,1,100-h.draft.y)),FX(e)&&["top-left","top-right","bottom-left","bottom-right"].includes(h.mode)){let R=E.width/Math.max(1,h.draft.width),C=E.height/Math.max(1,h.draft.height),I=Math.sqrt(Math.max(.05,R*C));E.fontSize=Math.max(8,Math.min(180,(h.draft.fontSize??18)*I))}h.latest=E,p(E),e&&a(e,E)}function _(v){let h=d.current;!h||!e||(v.preventDefault(),v.stopPropagation(),d.current=null,a(e,h.latest),s?.())}return l?(0,g.jsx)("div",{className:"canvas-frame-overlay",style:{left:l.left,top:l.top,width:l.width,height:l.height},onPointerDown:v=>f("move",v),onPointerMove:m,onPointerUp:_,onPointerCancel:_,onLostPointerCapture:_,children:["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].map(v=>(0,g.jsx)("span",{className:`canvas-frame-handle ${v}`,onPointerDown:h=>f(v,h),"aria-hidden":"true"},v))}):null}),$X=(0,A.memo)(function({composition:e,selected:n,html:r,onPatchHtml:o,onPatchLiveElement:i,onPreviewLiveElement:a,onUnselect:s,onDraftStateChange:l,onStageTimelineDraft:c,onStageVisualFrameDraft:d,timelineDraft:u,visualFrameDraft:p,onClearTimelineDraft:f,onClearVisualFrameDraft:m,onDiscardVisualFrameDraft:_,onDiscardTimelineDraft:v,onDelete:h,maxDuration:y,onPublish:S,publishOptions:E=null,onPublishOption:R,publishDisabled:C,publishLabel:I,templateId:L,forkId:z,publishVersion:U,originalUrl:D,songName:N,songUrl:B,onOpenShare:V,onOpenDecompose:st,onOpenHistory:nt,decomposeDismissed:lt=!1,decomposeBusy:X=!1,onResumeDecompose:ct}){let F=n?Nt(n):null,gt=n?xU(r,n):null,J=n?d1(r,n):null,dt=J&>?l1(J,gt):null,[Xt,Ce]=(0,A.useState)(dt),[_n,Pn]=(0,A.useState)(F),[Z,Vt]=(0,A.useState)(!1);(0,A.useEffect)(()=>{let G=dt?{...dt,...u?.updates,...p}:null;Ce(G),Pn(F);let jt=!j_(G,dt);Vt(!1),l({dirty:jt,commit:jt&&G?()=>tc(G):null})},[F,r,u,p,l]);let Ut=(0,A.useRef)(null);if((0,A.useEffect)(()=>{Ut.current=n&&F&&_n===F&&Xt&&!j_(Xt,dt)?{key:F,commit:()=>$d(Xt)}:null}),(0,A.useEffect)(()=>{let G=F;return()=>{let jt=Ut.current;Ut.current=null,jt&&G&&jt.key===G&&jt.commit()}},[F]),!n)return(0,g.jsx)(NX,{composition:e,onPublish:S,publishOptions:E,onPublishOption:R,publishDisabled:C,publishLabel:I,templateId:L,forkId:z,publishVersion:U,originalUrl:D,songName:N,songUrl:B,onOpenShare:V,onOpenDecompose:st,onOpenHistory:nt,decomposeDismissed:lt,decomposeBusy:X,onResumeDecompose:ct});let ft=J??n,te=h1(ft),mt=J_(r,ft)??te?.kind,oe=XU(r,ft),Qt=ft.tag==="audio"||mt==="audio",cn=ft.tag==="video"||mt==="video",un=ft.tag==="img"||ft.tag==="image"||mt==="image",He=Qt||cn||un,dn=ft.tag==="video",ut=Qt||dn,Ft=oe==="html"||mt==="shape"&&!!te?.customHtml,yt=!Qt,kt=!He&&!Ft,bt=gt??xU(r,ft),K=Xt??l1(ft,bt),vt=!j_(K,dt),Ht=K.volume;function fn(G,jt){let kr={isAudio:Qt,isMedia:He,isTextLike:kt,isVisual:yt,isVideoElement:dn};a(ft,ko=>{Y_(ko,G,ft,kr,jt)})}function Ct(G){let jt={...Xt??l1(ft,bt),...G};if(("start"in G||"duration"in G||"track"in G)&&!c(ft,{start:jt.start,duration:jt.duration,track:jt.track}))return;if("x"in G||"y"in G||"width"in G||"height"in G){let Me={x:Lt(jt.x,0,Math.max(0,100-jt.width)),y:Lt(jt.y,0,Math.max(0,100-jt.height)),width:Lt(jt.width,1,100-jt.x),height:Lt(jt.height,1,100-jt.y)};jt.x=Me.x,jt.y=Me.y,jt.width=Me.width,jt.height=Me.height,d(ft,Me)}("src"in G||"volume"in G||"muted"in G||"x"in G||"y"in G||"width"in G||"height"in G||"fontFamily"in G||"fontWeight"in G||"fontSize"in G||"textBackgroundStyle"in G||"background"in G||"color"in G||"text"in G||"italic"in G||"underline"in G||"kenBurns"in G||"radius"in G)&&fn(jt,G);let ko=!j_(jt,dt);Ce(jt),l({dirty:ko,commit:ko?()=>tc(jt):null})}function Gd(G){i(ft,G)}function tc(G){let jt={isAudio:Qt,isMedia:He,isTextLike:kt,isVisual:yt,isVideoElement:dn},kr=RU(G,dt),ko=G.start!==ft.start||G.duration!==ft.duration||G.track!==ft.track;try{if(ko){let{html:Me}=KU(r,ft,{start:G.start,duration:G.duration,track:G.track});o(Zo(Me,ft,o0=>{Y_(o0,G,ft,jt,kr)})),F&&f(F),F&&m(F);return}Gd(Me=>{Y_(Me,G,ft,jt,kr)}),F&&f(F),F&&m(F)}catch(Me){Ar("editor.inspector-update-rejected",Me instanceof Error?Me.message:Me)}}function Fm(){vt&&tc(K)}function $d(G){if(_n!==F)return;let jt={isAudio:Qt,isMedia:He,isTextLike:kt,isVisual:yt,isVideoElement:dn},kr=RU(G,dt),ko=["start","duration","track","x","y","width","height"];Number.isFinite(p?.fontSize)&&ko.push("fontSize");for(let Me of ko)delete kr[Me];if(Object.keys(kr).length!==0)try{Gd(Me=>{Y_(Me,G,ft,jt,kr)})}catch(Me){Ar("editor.inspector-switch-commit-rejected",Me instanceof Error?Me.message:Me)}}return(0,g.jsxs)("section",{className:"dna-panel",children:[(0,g.jsxs)("div",{className:"panel-title",children:[(0,g.jsx)("span",{children:"Native Inspector"}),(0,g.jsx)("strong",{children:ft.tag}),vt?(0,g.jsxs)("div",{className:"panel-action-pair",children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>{if(dt){let G={isAudio:Qt,isMedia:He,isTextLike:kt,isVisual:yt,isVideoElement:dn};a(ft,jt=>{zX(jt,dt,ft,G)})}Ce(dt),F&&v(F),_(ft),l({dirty:!1,commit:null})},children:"Cancel"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button primary",onClick:()=>{Fm(),l({dirty:!1,commit:null})},children:"Update"})]}):(0,g.jsx)("button",{type:"button",className:"panel-close-button","aria-label":"Unselect layer",onClick:s,children:"x"})]}),(0,g.jsxs)("article",{className:"dna-card selected-card",children:[(0,g.jsx)("strong",{children:ft.label??ft.id}),(0,g.jsx)("p",{children:te?.viralNote??"Native timeline element."})]}),(0,g.jsxs)("article",{className:"inspector-identity",children:[(0,g.jsx)(PX,{id:ft.hfId??ft.id??""}),(0,g.jsxs)("div",{className:"inspector-identity-fields",children:[(0,g.jsx)("input",{className:"inspector-identity-input",type:"text",placeholder:"slug (snake_case)",spellCheck:!1,value:K.slug,onChange:G=>Ct({slug:r0(G.target.value)})}),(0,g.jsx)("input",{className:"inspector-identity-input",type:"text",placeholder:"note \u2014 viral DNA reference",value:K.note,onChange:G=>Ct({note:G.target.value})})]})]}),(0,g.jsxs)("article",{className:"inspector-timing",children:[(0,g.jsxs)("div",{className:"inspector-section-header",children:[(0,g.jsx)("h2",{children:"Timing"}),(0,g.jsx)("span",{className:"inspector-help-inline",children:"drag to move \xB7 edges to trim"})]}),(0,g.jsxs)("div",{className:"inspector-timing-grid",children:[(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Start"}),(0,g.jsx)(V_,{min:0,max:Math.max(0,y-K.duration),value:K.start,onCommit:G=>Ct({start:G})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"End"}),(0,g.jsx)(V_,{min:.05,max:y,value:K.start+K.duration,onCommit:G=>Ct({duration:Math.max(.05,G-K.start)})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Dur"}),(0,g.jsx)(V_,{min:.05,max:Math.max(.05,y-K.start),value:K.duration,onCommit:G=>Ct({duration:Math.max(.05,G)})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Layer"}),(0,g.jsx)(V_,{min:0,step:1,value:K.track,onCommit:G=>Ct({track:Math.max(0,Math.round(G))})})]})]})]}),ut&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Audio"}),(0,g.jsxs)("label",{className:"switch-row",children:[(0,g.jsx)("span",{children:"Mute audio"}),(0,g.jsx)("input",{type:"checkbox",checked:K.muted,onChange:G=>Ct({muted:G.target.checked})})]}),(0,g.jsxs)("label",{className:"volume-row",children:[(0,g.jsxs)("span",{children:["Volume ",Math.round(Ht*100),"%"]}),(0,g.jsx)("input",{type:"range",min:"0",max:"1",step:"0.01",value:Ht,onChange:G=>Ct({volume:Number(G.target.value)})})]})]}),He&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:Qt?"Replace audio":cn?"Replace video":"Replace image"}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Source URL"}),(0,g.jsx)("input",{type:"text",value:K.src,onChange:G=>Ct({src:G.target.value})})]}),!Qt&&(0,g.jsxs)("div",{className:"inspector-grid",children:[(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Fit"}),(0,g.jsxs)("select",{value:K.objectFit,onChange:G=>Ct({objectFit:G.target.value}),children:[(0,g.jsx)("option",{value:"cover",children:"Cover (fill + crop)"}),(0,g.jsx)("option",{value:"contain",children:"Contain (letterbox)"}),(0,g.jsx)("option",{value:"fill",children:"Fill (stretch)"}),(0,g.jsx)("option",{value:"none",children:"None (native)"}),(0,g.jsx)("option",{value:"scale-down",children:"Scale-down"})]})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Position"}),(0,g.jsxs)("select",{value:K.objectPosition,onChange:G=>Ct({objectPosition:G.target.value}),children:[(0,g.jsx)("option",{value:"center",children:"Center"}),(0,g.jsx)("option",{value:"top",children:"Top"}),(0,g.jsx)("option",{value:"bottom",children:"Bottom"}),(0,g.jsx)("option",{value:"left",children:"Left"}),(0,g.jsx)("option",{value:"right",children:"Right"}),(0,g.jsx)("option",{value:"top left",children:"Top-left"}),(0,g.jsx)("option",{value:"top right",children:"Top-right"}),(0,g.jsx)("option",{value:"bottom left",children:"Bottom-left"}),(0,g.jsx)("option",{value:"bottom right",children:"Bottom-right"})]})]})]}),un&&(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Animate (Ken Burns)"}),(0,g.jsx)("select",{value:K.kenBurns||"none",onChange:G=>Ct({kenBurns:G.target.value}),children:qK.map(G=>(0,g.jsx)("option",{value:G.value,children:G.label},G.value))})]})]}),kt&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Text"}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Content"}),(0,g.jsx)(OX,{value:K.text,onChange:G=>Ct({text:G}),onCommit:()=>$d(K)})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Font"}),(0,g.jsx)(CX,{value:K.fontFamily,onChange:G=>Ct({fontFamily:G,fontWeight:K.fontWeight>=600?Os(G):400})})]}),(0,g.jsx)("div",{className:"inspector-grid",children:(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Size"}),(0,g.jsx)("input",{type:"number",min:"8",max:"120",step:"1",value:K.fontSize,onChange:G=>Ct({fontSize:Number(G.target.value)})})]})}),(0,g.jsxs)("div",{className:"text-style-toggles",children:[(0,g.jsxs)("label",{className:"style-toggle bold",title:"Bold",children:[(0,g.jsx)("input",{type:"checkbox","aria-label":"Bold",checked:K.fontWeight>=600,onChange:G=>Ct({fontWeight:G.target.checked?Os(K.fontFamily):400})}),(0,g.jsx)("span",{"aria-hidden":"true",children:"B"})]}),(0,g.jsxs)("label",{className:"style-toggle italic",title:"Italic",children:[(0,g.jsx)("input",{type:"checkbox","aria-label":"Italic",checked:K.italic,onChange:G=>Ct({italic:G.target.checked})}),(0,g.jsx)("span",{"aria-hidden":"true",children:"I"})]}),(0,g.jsxs)("label",{className:"style-toggle underline",title:"Underline",children:[(0,g.jsx)("input",{type:"checkbox","aria-label":"Underline",checked:K.underline,onChange:G=>Ct({underline:G.target.checked})}),(0,g.jsx)("span",{"aria-hidden":"true",children:"U"})]})]}),(0,g.jsxs)("div",{className:"inspector-grid",children:[(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Text"}),(0,g.jsx)("input",{type:"color",value:K.color.startsWith("#")?K.color:"#ffffff",onChange:G=>Ct({color:G.target.value})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Effect color"}),(0,g.jsx)("input",{type:"color",value:K.background.startsWith("#")?K.background:"#000000",onChange:G=>Ct({background:G.target.value})})]})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Background"}),(0,g.jsx)(MX,{value:K.textBackgroundStyle,color:K.color,background:K.background,onChange:G=>Ct({textBackgroundStyle:G})})]})]}),yt&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Frame"}),(0,g.jsxs)("div",{className:"inspector-grid",children:[(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"X %"}),(0,g.jsx)("input",{type:"number",min:"0",max:"100",step:"0.5",value:K.x,onChange:G=>Ct({x:Number(G.target.value)})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Y %"}),(0,g.jsx)("input",{type:"number",min:"0",max:"100",step:"0.5",value:K.y,onChange:G=>Ct({y:Number(G.target.value)})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"W %"}),(0,g.jsx)("input",{type:"number",min:"1",max:"100",step:"0.5",value:K.width,onChange:G=>Ct({width:Number(G.target.value)})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"H %"}),(0,g.jsx)("input",{type:"number",min:"1",max:"100",step:"0.5",value:K.height,onChange:G=>Ct({height:Number(G.target.value)})})]}),kt&&(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Radius"}),(0,g.jsx)("input",{type:"number",min:"0",max:"999",step:"1",value:K.radius,onChange:G=>Ct({radius:Number(G.target.value)})})]})})]})]}),(0,g.jsx)("div",{className:"inspector-danger-zone",children:Z?(0,g.jsxs)("div",{className:"delete-confirm",children:[(0,g.jsx)("span",{children:"Delete this layer?"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>Vt(!1),children:"Cancel"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button danger",onClick:()=>{h(ft),s()},children:"Delete"})]}):(0,g.jsx)("button",{type:"button",className:"inspector-delete-button",disabled:ft.hfId==="source-video",onClick:()=>Vt(!0),children:"Delete layer"})})]})}),Rm={current:null},Nm={current:null},Cm={current:[]};function jX(t){if(Nm.current){Nm.current.onExportComplete(t);return}Cm.current.some(n=>n.url===t.url&&n.renderId===t.renderId)||Cm.current.push(t)}function Kl(t){let e=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`;return`${t}-${e}`}async function qX(t,e){let n=t.body?.getReader();if(!n)throw new Error("No response body");let r=new TextDecoder,o="";for(;;){let{value:i,done:a}=await n.read();if(a)break;o+=r.decode(i,{stream:!0});let s=o.split(`
|
|
1221
|
+
${t.documentElement.outerHTML}`}function oe(t){return!!(t&&typeof t=="object"&&t.nodeType===1&&"style"in t)}function t0(t,e){return oe(t)&&t.tagName.toLowerCase()===e.toLowerCase()}function Zo(t,e,n){let r=new DOMParser().parseFromString(t,"text/html"),o=Bn(r,e);return oe(o)?(n(o),Z_(r)):t}function km(t,e,n){try{let r=t?.contentDocument,o=r?Bn(r,e):null;return oe(o)?(n(o),!0):!1}catch{return!1}}function n1(t,e){try{let n=t?.contentDocument;if(!n)return 0;let r=new DOMParser().parseFromString(e,"text/html"),o=new Map;for(let a of Array.from(n.querySelectorAll("[data-start]"))){if(!oe(a))continue;let s=Ci(a);s&&o.set(s,a)}let i=0;for(let a of Array.from(r.querySelectorAll("[data-start]"))){if(!oe(a))continue;let s=Ci(a),l=s?o.get(s):null;if(!l)continue;for(let d of["data-start","data-duration","data-track-index","data-media-start","data-playback-start"]){let u=a.getAttribute(d);u===null?l.removeAttribute(d):l.setAttribute(d,u)}let c=Number(a.getAttribute("data-track-index")??Number.NaN);Number.isFinite(c)&&!t0(l,"audio")&&(l.style.zIndex=String(c)),i+=1}return i}catch{return 0}}var mU=new WeakSet;function bX(t){return t.hasAttribute("data-vf-selection-ring")||t.hasAttribute("data-vf-frame-handle")}function gU(t){return t.hasAttribute("data-vf-playback-source")?"@playback-source":t.getAttribute("data-hf-id")||t.id||null}function VU(t,e){let n=t.style.visibility;for(let r of Array.from(t.attributes))r.name!=="data-vf-selected"&&(e.hasAttribute(r.name)||t.removeAttribute(r.name));for(let r of Array.from(e.attributes))t.getAttribute(r.name)!==r.value&&t.setAttribute(r.name,r.value);t.style.visibility!==n&&(t.style.visibility=n)}function yX(t,e){VU(t,e),t.innerHTML!==e.innerHTML&&(t.innerHTML=e.innerHTML)}function hU(t,e){try{let n=t?.contentDocument,r=n?.querySelector("[data-composition-id]");if(!n||!oe(r))return!1;let i=new DOMParser().parseFromString(e,"text/html").querySelector("[data-composition-id]");if(!oe(i))return!1;let a=r.querySelector("[data-vf-playback-source]"),s=i.querySelector("[data-vf-playback-source]");if(!!a!=!!s)return!1;VU(r,i);let l=new Set,c=new Map;for(let m of Array.from(r.children)){if(bX(m)){l.add(m);continue}let _=gU(m);_!==null&&oe(m)&&!c.has(_)&&c.set(_,m)}let d=new Set,u=[];for(let m of Array.from(i.children)){if(!oe(m))continue;let _=gU(m),v=_!==null?c.get(_):void 0;v&&!d.has(v)&&v.tagName===m.tagName?(d.add(v),yX(v,m),u.push(v)):u.push(n.importNode(m,!0))}let p=new Set(u);for(let m of Array.from(r.children))l.has(m)||p.has(m)||(m instanceof HTMLMediaElement&&m.pause(),m.remove());let f=r.firstElementChild;for(let m of u){for(;f&&l.has(f);)f=f.nextElementSibling;if(f===m){f=f.nextElementSibling;continue}r.insertBefore(m,f)}return!0}catch{return!1}}function bU(t,e){try{let n=t?.contentDocument;return n?(n.open(),n.write(e),n.close(),!0):!1}catch{return!1}}function Am(t,e){for(let n of e){let r=t.getAttribute(n);if(r!==null){let o=Number(r);if(Number.isFinite(o))return o}}}function yU(t){let e=e0(t),n=e.querySelector("[data-composition-id]"),r=[];for(let i of Array.from(e.querySelectorAll("[data-start]")))i===n||!oe(i)||r.push(i);let o=n?Number(n.getAttribute("data-duration")||0):0;return{nodes:r,duration:o}}function _U(t){return g1([t.getAttribute("data-hf-id")??void 0,t.id||void 0])}function vU(t){return g1([t.key,t.hfId,t.domId,t.id])}function r1(t,e,n){let r=t.getState(),o=r.elements,i=yU(e),a=yU(n),s=new Set(i.nodes.flatMap(_U)),l=new Set,c=[];for(let u of a.nodes){let p=_U(u);if(p.length===0)continue;let f=Am(u,["data-start"])??0,m=Am(u,["data-duration"])??0,_=Am(u,["data-track-index"])??0,v=Am(u,["data-playback-start","data-media-start"]),h=Am(u,["data-volume"]),y=o.findIndex((S,E)=>!l.has(E)&&vU(S).some(R=>p.includes(R)));if(y>=0){l.add(y);let S=o[y],E=u.getAttribute("data-timeline-label")??u.getAttribute("data-label")??S.label??p[0],R=S.start===f&&S.duration===m&&S.track===_&&S.playbackStart===v&&S.volume===h&&S.label===E;c.push(R?S:{...S,start:f,duration:m,track:_,playbackStart:v,volume:h,label:E})}else{let S=p[0];c.push({id:S,key:S,hfId:u.getAttribute("data-hf-id")??void 0,domId:u.id||void 0,tag:u.tagName.toLowerCase(),label:u.getAttribute("data-timeline-label")??u.getAttribute("data-label")??S,start:f,duration:m,track:_,playbackStart:v,volume:h})}}o.forEach((u,p)=>{if(l.has(p))return;vU(u).some(m=>s.has(m))||c.push(u)});let d=c.length!==o.length||c.some((u,p)=>u!==o[p]);return d&&r.setElements(c),a.duration>0&&Math.abs(a.duration-r.duration)>.001&&r.setDuration?.(a.duration),d}function Ni(t,e){try{let a=function(){oe(i)&&(i.style.display="none")};var n=a;let r=t?.contentDocument;if(!r)return!1;let o=r.querySelector("[data-composition-id]"),i=r.querySelector("[data-vf-selection-ring='true']");for(let l of Array.from(r.querySelectorAll("[data-vf-selected='true']")))l.removeAttribute("data-vf-selected");if(!e)return a(),!0;let s=Bn(r,e);return!s||t0(s,"audio")?(a(),!1):(!oe(i)&&oe(o)&&(i=r.createElement("div"),i.setAttribute("data-vf-selection-ring","true"),o.append(i)),oe(i)&&HX(i,s,e),s.setAttribute("data-vf-selected","true"),!0)}catch{return!1}}function Ci(t){return t.getAttribute("data-hf-id")||t.id}function Ql(t){let e=Number(t.getAttribute("data-start")??0),n=Number(t.getAttribute("data-duration")??0),r=Number(t.getAttribute("data-track-index")??0);return{start:e,duration:n,track:r}}function Fd(t,e){if(t.track!==e.track)return!1;let n=t.start+t.duration,r=e.start+e.duration;return t.start<r-.001&&e.start<n-.001}function _X(t){let e=new Map;for(let n of t){let r=n.tag==="audio",o=e.get(n.track);e.set(n.track,(o===void 0||o)&&r)}return e}function o1(t){return Array.from(new Set(t.map(e=>e.track))).sort((e,n)=>n-e)}function SU(t,e,n){let r=new Set([Nt(e),e.hfId,e.domId,e.id].filter(o=>!!o));return t.filter(o=>![Nt(o),o.hfId,o.domId,o.id].some(a=>a&&r.has(a))).filter(o=>!n||J_(n,o)!=="track-placeholder").map(o=>({start:o.start,duration:o.duration,track:o.track}))}function Bm(t){return Number.isFinite(t.duration)&&t.duration>0}function i1(t,e){return Bm(t)?e.some(n=>Bm(n)&&Fd(t,n)):!1}function vX(t,e,n,r,o){if(!Number.isFinite(n)||n<=0)return Math.max(0,r);let a=t.filter(f=>f.track===e&&Bm(f)).map(f=>({start:f.start,end:f.start+f.duration})).sort((f,m)=>f.start-m.start),s=[];for(let f of a){let m=s[s.length-1];m&&f.start<=m.end+.001?m.end=Math.max(m.end,f.end):s.push({...f})}let l=Math.max(0,o-n),c=[],d=0;for(let f of s)f.start-d>=n-.001&&c.push({lo:d,hi:f.start-n}),d=Math.max(d,f.end);d<=l+.001&&c.push({lo:d,hi:l});let u=null,p=1/0;for(let f of c){let m=Math.min(f.hi,l);if(m<f.lo-.001)continue;let _=Lt(r,f.lo,Math.max(f.lo,m)),v=Math.abs(_-r);v<p-.001&&(u=_,p=v)}return u}function zm(t,e,n=new Set){if(!Number.isFinite(e.duration)||e.duration<=0)return e.track;let r=Array.from(t.querySelectorAll("[data-start]")).filter(a=>oe(a)),o=new Set;for(let a of r){let s=Ci(a);if(s&&n.has(s))continue;let l=Ql(a);!Number.isFinite(l.duration)||l.duration<=0||Fd({...e},l)&&o.add(l.track)}let i=Math.max(0,Math.floor(e.track));for(let a=0;a<512&&o.has(i);a+=1)i+=1;return i}function Bn(t,e){let n=hX(e);for(let r of n){if(r===e.selector&&e.selectorIndex!==void 0){let i=t.querySelectorAll(r).item(e.selectorIndex);if(oe(i))return i;continue}let o=t.querySelector(r);if(oe(o))return o}return null}function EU(t,e){return Bn(t,e)?.getAttribute("data-vf-group")||null}function TU(t,e,n){return e?Array.from(t.querySelectorAll(`[data-vf-group="${CSS.escape(e)}"]`)).filter(r=>oe(r)&&r.hasAttribute("data-start")):[n]}function SX(t,e,n){let r=new Set(e.map(Ci)),o=Array.from(t.querySelectorAll("[data-start]")).filter(a=>oe(a));for(let a of e){let s=Ci(a),l=n.get(s);if(!(!s||!l))for(let c of o){let d=Ci(c);if(!(!d||r.has(d))&&Fd(l,Ql(c)))throw new Error("Track collision: only one clip can occupy a track at a time.")}}let i=Array.from(n.entries()).filter(([,a])=>a.duration>0);for(let a=0;a<i.length;a+=1){let[s,l]=i[a];for(let[c,d]of i.slice(a+1))if(Fd(l,d))throw new Error(`Track collision: ${s} overlaps ${c} on track ${l.track}.`)}}function EX(t){let e=Array.from(t.querySelectorAll("[data-start]")).filter(r=>{if(!oe(r))return!1;let o=Number(r.getAttribute("data-duration")??0);return Number.isFinite(o)&&o>0});e.sort((r,o)=>{let i=Number(r.getAttribute("data-track-index")??0),a=Number(o.getAttribute("data-track-index")??0);if(i!==a)return i-a;let s=Number(r.getAttribute("data-start")??0),l=Number(o.getAttribute("data-start")??0);return s-l});let n=0;for(let r=0;r<e.length;r+=1){let o=e[r],i=Ql(o),a=!1;for(let d=0;d<r;d+=1)if(Fd(i,Ql(e[d]))){a=!0;break}if(!a)continue;let s=new Set,l=Ci(o);l&&s.add(l);let c=zm(t,i,s);c!==i.track&&(o.setAttribute("data-track-index",String(c)),o.style.zIndex&&(o.style.zIndex=String(c)),n+=1)}return n}function Ao(t,e){let n=new DOMParser().parseFromString(t,"text/html");e(n);let r=EX(n);return{html:Z_(n),resolvedCollisions:r}}function YU(t){if(!t)return null;let e=/<[^>]*data-composition-id[^>]*>/i.exec(t);if(!e)return null;let n=/\sdata-viral-dna\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(e[0]),r=n?.[1]??n?.[2];if(!r)return null;try{let o=r.replace(/"/g,'"').replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),i=JSON.parse(o);if(!i||typeof i!="object")return null;let a=d=>typeof d=="string"?d.trim():"",s=d=>Array.isArray(d)?d.map(u=>typeof u=="string"?u.trim():"").filter(u=>u.length>0):[],l=i,c={trendTagline:a(l.trend_tagline??l.trendTagline),hook:a(i.hook),retention:a(i.retention),payoff:a(i.payoff),preserve:s(i.preserve),avoid:s(i.avoid),promotions:s(l.promotions)};return!c.trendTagline&&!c.hook&&!c.retention&&!c.payoff&&c.preserve.length===0&&c.avoid.length===0&&c.promotions.length===0?null:c}catch{return null}}function TX(t){return!(!t||!t.includes("data-composition-id")||t.includes('data-vf-timeline-proxy="video"')||!t.includes("data-vf-playback-source")&&!/<video\b/i.test(t))}function Xl(t){if(!t||!t.includes("data-track-index"))return t;let e=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+[^\s"'>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'`=<>]+))?)*)\s*(\/?)>/g,n=/\s+([^\s"'>/=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s"'`=<>]+))?/g;return t.replace(e,(r,o,i,a)=>{let s=null,l='"',c=null,d=-1,u=-1;n.lastIndex=0;let p;for(;p=n.exec(i);){let m=p[1].toLowerCase(),_=p[2];if(_===void 0)continue;let v=_.startsWith('"')||_.startsWith("'"),h=v?_.slice(1,-1):_;if(m==="data-track-index"){let y=Number.parseInt(h,10);Number.isFinite(y)&&(s=y)}else m==="style"&&(l=v?_[0]:'"',c=h,d=p.index,u=p.index+p[0].length)}if(s===null)return r;let f=String(s);if(c!==null){let m;if(/(^|;)\s*z-index\s*:/i.test(c)){if(new RegExp(`(^|;)\\s*z-index\\s*:\\s*${f}\\s*(;|$)`,"i").test(c))return r;m=c.replace(/(^|;)\s*z-index\s*:\s*[^;]*/i,(v,h)=>`${h}z-index:${f}`)}else m=c.endsWith(";")||c.length===0?`${c}z-index:${f}`:`${c};z-index:${f}`;let _=`${i.slice(0,d)} style=${l}${m}${l}${i.slice(u)}`;return`<${o}${_}${a?"/":""}>`}return`<${o}${i} style="z-index:${f}"${a?"/":""}>`})}var wU=null,a1=null;function e0(t){if(wU===t&&a1)return a1;let e=new DOMParser().parseFromString(t,"text/html");return wU=t,a1=e,e}function n0(t,e){return Bn(e0(t),e)}function Qo(t,e,n){let r=t?.getPropertyValue(e)??"",o=Number.parseFloat(r);return Number.isFinite(o)?o:n}function xU(t,e){let n=n0(t,e),r=h1(e),o=n?.querySelector("[data-vf-text-inline]"),i=n?.getAttribute("data-text-background-style"),a=n?.getAttribute("data-text-background-color"),s=n?.style.background&&n.style.background!=="transparent"?n.style.background:"";return{text:n?.textContent?.trim()||r?.text||e.label||"",src:n?.getAttribute("src")||r?.src||"",fontFamily:K_(o?.style.fontFamily||n?.style.fontFamily),fontWeight:tX(o?.style.fontWeight||n?.style.fontWeight,Os(K_(o?.style.fontFamily||n?.style.fontFamily))),italic:n?.style.fontStyle==="italic",underline:(n?.style.textDecorationLine||n?.style.textDecoration||"").includes("underline"),color:o?.style.color||n?.style.color||r?.color||"#ffffff",background:a||o?.style.background||s||r?.background||"#000000",textBackgroundStyle:nX(i||r?.textBackgroundStyle),fontSize:Qo(n?.style,"font-size",r?.fontSize??18),radius:Qo(n?.style,"border-radius",r?.radius??0),x:Qo(n?.style,"left",r?.x??0),y:Qo(n?.style,"top",r?.y??0),width:Qo(n?.style,"width",r?.width??100),height:Qo(n?.style,"height",r?.height??100),volume:Number(n?.getAttribute("data-volume")??e.volume??r?.volume??1),muted:!!(n?.hasAttribute("muted")||r?.muted),objectFit:wX(n?.style.objectFit),objectPosition:xX(n?.style.objectPosition),kenBurns:n?.getAttribute("data-kenburns")||"none",slug:n?.getAttribute("data-hf-slug")??"",note:n?.getAttribute("data-hf-note")??""}}function r0(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,64)}function wX(t){let e=(t??"").trim().toLowerCase();return e==="contain"||e==="fill"||e==="none"||e==="scale-down"?e:"cover"}function xX(t){let e=(t??"").trim().toLowerCase().replace(/\s+/g," ");return["center","top","bottom","left","right","top left","top right","bottom left","bottom right"].includes(e)?e:"center"}function WU(t,e,n){let r=Bn(t,e);if(!r)return;let o=n.start??e.start,i=n.duration??e.duration,a=n.track??e.track;if(r.setAttribute("data-start",Kt(o)),r.setAttribute("data-duration",Kt(i)),r.setAttribute("data-end",Kt(o+i)),r.setAttribute("data-track-index",String(a)),n.playbackStart!==void 0){let s=Kt(n.playbackStart);r.setAttribute("data-media-start",s),r.setAttribute("data-playback-start",s)}}function KU(t,e,n){return Ao(t,r=>WU(r,e,n))}function s1(t,e){return Ao(t,n=>{for(let r of e)WU(n,r.element,r.updates)})}function h1(t){return Lm.find(e=>e.id===t.hfId||e.id===t.domId||e.id===t.id)}function J_(t,e){return n0(t,e)?.getAttribute("data-layer-kind")||null}function XU(t,e){return n0(t,e)?.getAttribute("data-layer-format")||null}function AU(t){return!Number.isFinite(t)||t<=0?1:Math.max(.05,Math.min(8,t))}function Cs(t){try{let e=t?.contentWindow;return e?.__player&&typeof e.__player.play=="function"?e.__player:null}catch{return null}}function $_(t){try{let e=Cs(t);return e?.refreshClips?.(),!!e?.refreshClips}catch{return!1}}function kU(t,e,n){try{t?.contentWindow?.postMessage({source:"hf-parent",type:"control",action:e,...n},"*")}catch{}}var AX=(0,A.memo)(function({disabled:e,speedDraft:n,onSpeedDraftChange:r,onCommitSpeed:o,onSeek:i,onTogglePlay:a,onUndo:s,onRedo:l,canUndo:c,canRedo:d,usePlayerStore:u}){let p=u(D=>D.isPlaying),f=u(D=>D.currentTime),m=u(D=>D.duration),_=u(D=>D.zoomMode),v=u(D=>D.manualZoomPercent),h=u(D=>D.setZoomMode),y=u(D=>D.setManualZoomPercent),S=m>0?m:Im,E=_==="fit"?100:v,[R,C]=(0,A.useState)(()=>Ms(f)),[k,L]=(0,A.useState)(!1);(0,A.useEffect)(()=>{k||C(Ms(f))},[f,k]);function F(D){h("manual"),y(Math.max(25,Math.min(400,D)))}function U(){let D=pU(R);if(D===null){C(Ms(f));return}i(Math.max(0,Math.min(S,D)))}return(0,g.jsxs)("div",{className:"direct-player-controls",children:[(0,g.jsx)("button",{className:"history-icon-button",type:"button","aria-label":"Undo",disabled:!c,onClick:s,children:(0,g.jsx)("span",{"aria-hidden":"true",children:"\u21B6"})}),(0,g.jsx)("button",{className:"play-icon-button",type:"button","aria-label":p?"Pause":"Play",disabled:e,onClick:a,children:(0,g.jsx)("span",{className:p?"pause-glyph":"play-glyph"})}),(0,g.jsx)("button",{className:"history-icon-button",type:"button","aria-label":"Redo",disabled:!d,onClick:l,children:(0,g.jsx)("span",{"aria-hidden":"true",children:"\u21B7"})}),(0,g.jsxs)("span",{className:"time-readout",children:[(0,g.jsx)("span",{className:"inline-time-input",children:(0,g.jsx)("input",{"aria-label":"Timeline position",type:"text",inputMode:"numeric",pattern:"\\\\d+:\\\\d{2}:\\\\d{2}",value:R,disabled:e,onFocus:()=>{L(!0),C(Ms(Math.min(f,S)))},onChange:D=>{let N=D.target.value;C(N);let B=pU(N);B!==null&&i(Math.max(0,Math.min(S,B)))},onBlur:()=>{L(!1),U()},onKeyDown:D=>{D.key==="Enter"&&D.currentTarget.blur(),D.key==="Escape"&&(C(Ms(f)),D.currentTarget.blur())}})}),(0,g.jsxs)("span",{children:["/ ",Ms(S)]})]}),(0,g.jsx)("input",{className:"preview-scrubber",type:"range",min:"0",max:S,step:"0.01",value:Math.min(f,S),disabled:e,onChange:D=>i(Number(D.target.value))}),(0,g.jsxs)("label",{className:"speed-input",children:[(0,g.jsx)("span",{children:"Speed"}),(0,g.jsxs)("span",{className:"suffix-number",children:[(0,g.jsx)("input",{type:"number",min:"0.05",max:"8",step:"0.05",value:n,disabled:e,onChange:D=>r(D.target.value),onBlur:D=>o(Number(D.target.value)),onKeyDown:D=>{D.key==="Enter"&&D.currentTarget.blur()}}),(0,g.jsx)("b",{children:"x"})]})]}),(0,g.jsxs)("label",{className:"zoom-input",children:[(0,g.jsx)("span",{children:"Zoom"}),(0,g.jsxs)("span",{className:"suffix-number",children:[(0,g.jsx)("input",{type:"number",min:"25",max:"400",step:"5",value:Math.round(E),disabled:e,onChange:D=>F(Number(D.target.value))}),(0,g.jsx)("b",{children:"%"})]})]})]})}),kX=(0,A.memo)(function({state:e,usePlayerStore:n,canGroup:r,canUngroup:o,onClose:i,onSeek:a,onSplit:s,onInsertLayer:l,onInsertText:c,onInsertMedia:d,onUploadMedia:u,onCopyTimestamp:p,onCopyCoordinates:f,onGroup:m,onUngroup:_,onDelete:v}){let h=n(N=>N.currentTime),y=(0,A.useRef)(null),S=220,E=e.element?362:258,R=Math.min(Math.max(8,e.x),Math.max(8,window.innerWidth-S-8)),C=Math.min(Math.max(8,e.y),Math.max(8,window.innerHeight-E-8)),k=e.element?.track??e.track,L=typeof k=="number",F=!!(e.element&&h>e.element.start&&h<e.element.start+e.element.duration),U=!!(e.element&&e.element.hfId!=="source-video");(0,A.useEffect)(()=>{function N(Y){y.current?.contains(Y.target)||i()}function B(Y){Y.key==="Escape"&&i()}return window.addEventListener("pointerdown",N),window.addEventListener("keydown",B),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",B)}},[i]);function D({children:N,disabled:B,danger:Y,onClick:st}){return(0,g.jsx)("button",{type:"button",disabled:B,className:`timeline-menu-item ${Y?"danger":""}`,onClick:()=>{B||(st(),i())},children:N})}return(0,g.jsx)("div",{ref:y,className:"timeline-context-menu",style:{left:R,top:C},onContextMenu:N=>N.preventDefault(),children:e.element?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"timeline-menu-title",children:[(0,g.jsx)("span",{children:e.element.label??e.element.id}),(0,g.jsx)("time",{children:X_(h)})]}),(0,g.jsx)(D,{disabled:!F,onClick:()=>e.element&&s(e.element,h),children:"Split at playhead"}),(0,g.jsx)(D,{disabled:!L,onClick:()=>L&&l(k,"above"),children:"New layer above"}),(0,g.jsx)(D,{disabled:!L,onClick:()=>L&&l(k,"below"),children:"New layer below"}),(0,g.jsx)(D,{onClick:()=>c({time:h,track:null}),children:"Insert Text"}),(0,g.jsx)(D,{onClick:()=>d({time:h,track:null}),children:"Insert Media"}),(0,g.jsx)(D,{onClick:()=>u({time:h,track:null}),children:"Upload Media\u2026"}),(0,g.jsx)(D,{onClick:()=>p(h),children:"Copy Timestamp"}),(0,g.jsx)(D,{onClick:()=>f({time:h,track:k??null}),children:"Copy Coordinates"}),r&&(0,g.jsx)(D,{onClick:m,children:"Group selected"}),o&&(0,g.jsx)(D,{onClick:_,children:"Ungroup"}),(0,g.jsx)(D,{disabled:!U,danger:!0,onClick:()=>e.element&&v(e.element),children:"Delete layer"})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(D,{onClick:()=>a(e.time),children:["Seek to ",X_(e.time)]}),(0,g.jsx)(D,{disabled:!L,onClick:()=>L&&l(k,"above"),children:"New layer above"}),(0,g.jsx)(D,{disabled:!L,onClick:()=>L&&l(k,"below"),children:"New layer below"}),(0,g.jsx)(D,{onClick:()=>c({time:e.time,track:null}),children:"Insert Text"}),(0,g.jsx)(D,{onClick:()=>d({time:e.time,track:null}),children:"Insert Media"}),(0,g.jsx)(D,{onClick:()=>u({time:e.time,track:null}),children:"Upload Media\u2026"}),(0,g.jsx)(D,{onClick:()=>p(e.time),children:"Copy Timestamp"}),(0,g.jsx)(D,{onClick:()=>f({time:e.time,track:k??null}),children:"Copy Coordinates"})]})})});function IX({state:t,onClose:e,onInsertText:n,onInsertMedia:r,onUploadMedia:o,onCopyTimestamp:i,onCopyCoordinates:a}){let s=(0,A.useRef)(null),l=220,c=174,d=Math.min(Math.max(8,t.x),Math.max(8,window.innerWidth-l-8)),u=Math.min(Math.max(8,t.y),Math.max(8,window.innerHeight-c-8));(0,A.useEffect)(()=>{function f(_){s.current?.contains(_.target)||e()}function m(_){_.key==="Escape"&&e()}return window.addEventListener("pointerdown",f),window.addEventListener("keydown",m),()=>{window.removeEventListener("pointerdown",f),window.removeEventListener("keydown",m)}},[e]);function p({children:f,onClick:m}){return(0,g.jsx)("button",{type:"button",className:"timeline-menu-item",onClick:()=>{m(),e()},children:f})}return(0,g.jsxs)("div",{ref:s,className:"timeline-context-menu preview-context-menu",style:{left:d,top:u},onContextMenu:f=>f.preventDefault(),children:[(0,g.jsx)(p,{onClick:()=>n({time:t.time,frame:t.frame}),children:"Insert Text"}),(0,g.jsx)(p,{onClick:()=>r({time:t.time,frame:t.frame}),children:"Insert Media"}),(0,g.jsx)(p,{onClick:()=>o({time:t.time,frame:t.frame}),children:"Upload Media\u2026"}),(0,g.jsx)(p,{onClick:()=>i(t.time),children:"Copy Timestamp"}),(0,g.jsx)(p,{onClick:()=>a(t.frame),children:"Copy Coordinates"})]})}function RX({state:t,onClose:e}){let n=KK(t),r=t.phase==="starting"||t.phase==="running",o=t.phase==="succeeded"?"Rendered":t.phase==="failed"?"Render failed":"Rendering...",i=t.status||(t.phase==="starting"?"STARTING":"RUNNING"),a=t.totalFrames?`${t.framesRendered??0} / ${t.totalFrames} frames`:`${t.framesRendered??0} frames`;return(0,g.jsx)("div",{className:"publish-modal-backdrop",role:"presentation",children:(0,g.jsxs)("section",{className:"publish-modal",role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:[(0,g.jsxs)("div",{className:"publish-modal-kicker",children:[(0,g.jsx)("span",{children:"Production AWS Lambda"}),!r&&(0,g.jsx)("button",{type:"button",className:"publish-modal-close","aria-label":"Close publish status",onClick:e,children:"x"})]}),(0,g.jsxs)("h2",{id:"publish-modal-title",children:[r&&(0,g.jsx)(Om,{label:"Rendering"}),o]}),(0,g.jsxs)("p",{className:"publish-modal-summary",children:["Rendering ",(0,g.jsx)("strong",{children:t.title})," on production infrastructure. The final output link will appear when the render succeeds."]}),r&&(0,g.jsx)("p",{className:"publish-modal-eta",children:"Estimated time: ~5 minutes. Feel free to open new tabs and keep working \u2014 this render continues in the background and the output link will appear here when it's ready."}),(0,g.jsx)("div",{className:"publish-progress-shell","aria-label":`Publish progress ${n}%`,children:(0,g.jsx)("span",{style:{width:`${n}%`}})}),(0,g.jsxs)("dl",{className:"publish-detail-grid",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Status"}),(0,g.jsx)("dd",{children:i})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Progress"}),(0,g.jsxs)("dd",{children:[n,"%"]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Frames"}),(0,g.jsx)("dd",{children:a})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Cost"}),(0,g.jsx)("dd",{children:t.cost||"$0.0000"})]}),t.renderId&&(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Render ID"}),(0,g.jsx)("dd",{children:t.renderId})]}),t.phase==="succeeded"&&t.outputS3Uri&&(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Output"}),(0,g.jsx)("dd",{children:t.outputS3Uri})]})]}),t.error||t.errors?.length?(0,g.jsxs)("div",{className:"publish-error-box",children:[(0,g.jsx)("strong",{children:t.error||t.errors?.[0]?.error||"Render failed"}),t.errors?.slice(0,2).map((s,l)=>(0,g.jsxs)("p",{children:[s.state?`${s.state}: `:"",s.cause||s.error]},`${s.state||"state"}-${l}`))]}):null,(0,g.jsx)("div",{className:"publish-modal-actions",children:t.outputUrl&&(0,g.jsx)("a",{href:t.outputUrl,target:"_blank",rel:"noreferrer",children:"Open output"})})]})})}function NX({action:t,composition:e=Um[0],onPublish:n,publishOptions:r=null,onPublishOption:o,publishDisabled:i=!1,publishLabel:a="Publish",templateId:s=null,forkId:l=null,publishVersion:c=null,originalUrl:d=null,songName:u=null,songUrl:p=null,onOpenShare:f,onOpenDecompose:m,onOpenHistory:_,decomposeDismissed:v=!1,decomposeBusy:h=!1,onResumeDecompose:y}){let S=e.viralDna,E=S.promotions??[],[R,C]=(0,A.useState)(!1),k=(0,A.useRef)(null),[L,F]=(0,A.useState)(!1),U=(0,A.useRef)(null),D=!!(r&&r.length>1&&o);(0,A.useEffect)(()=>{if(!L)return;let B=st=>{U.current&&(U.current.contains(st.target)||F(!1))},Y=st=>{st.key==="Escape"&&F(!1)};return document.addEventListener("mousedown",B),document.addEventListener("keydown",Y),()=>{document.removeEventListener("mousedown",B),document.removeEventListener("keydown",Y)}},[L]),(0,A.useEffect)(()=>{if(!R)return;let B=st=>{k.current&&(k.current.contains(st.target)||C(!1))},Y=st=>{st.key==="Escape"&&C(!1)};return document.addEventListener("mousedown",B),document.addEventListener("keydown",Y),()=>{document.removeEventListener("mousedown",B),document.removeEventListener("keydown",Y)}},[R]);let N=[{label:"New decompose\u2026",handler:m,disabled:!m},{label:"History\u2026",handler:_,disabled:!_||!l,hint:l?void 0:"Save first"}];return(0,g.jsxs)("section",{className:"dna-panel",children:[(0,g.jsxs)("div",{className:"panel-title",children:[(0,g.jsx)("span",{children:"Viral DNA"}),(0,g.jsxs)("div",{className:"panel-title-actions",children:[(0,g.jsx)(DX,{templateId:s,forkId:l,publishVersion:c,originalUrl:d,songName:u,songUrl:p,trendTagline:S.trendTagline??null}),(0,g.jsxs)("div",{className:"panel-menu-wrap",ref:k,children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button panel-menu-button","aria-haspopup":"menu","aria-expanded":R,"aria-label":"More actions",title:"More actions",onClick:()=>C(B=>!B),children:"\u22EF"}),R&&(0,g.jsx)("div",{className:"panel-menu-popover",role:"menu",children:N.map(B=>(0,g.jsx)("button",{type:"button",role:"menuitem",className:"panel-menu-item",disabled:B.disabled,title:B.hint,onClick:()=>{C(!1),B.handler?.()},children:B.label},B.label))})]}),(0,g.jsxs)("div",{className:"panel-menu-wrap",ref:U,children:[(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",disabled:i,"aria-busy":i?"true":void 0,"aria-haspopup":D?"menu":void 0,"aria-expanded":D?L:void 0,onClick:()=>{D?F(B=>!B):n?.()},children:[a==="Rendering"&&(0,g.jsx)(Om,{label:"Rendering"}),a]}),D&&L&&(0,g.jsx)("div",{className:"panel-menu-popover",role:"menu",children:r.map(B=>(0,g.jsx)("button",{type:"button",role:"menuitem",className:"panel-menu-item",title:B.hint,onClick:()=>{F(!1),o?.(B.key)},children:B.label},B.key))})]})]})]}),t,v&&y&&(0,g.jsxs)("article",{className:"decompose-cta",children:[(0,g.jsx)("strong",{children:"Not decomposed yet"}),(0,g.jsx)("p",{children:"Split this reference into editable scenes, captions, and viral DNA whenever you're ready. You can keep playing the preview and chatting with the AI in the meantime."}),(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",onClick:y,disabled:h,"aria-busy":h?"true":void 0,children:[h&&(0,g.jsx)(Om,{label:"Decomposing"}),h?"Decomposing\u2026":"Decompose"]})]}),(0,g.jsxs)("article",{className:"source-card",children:[(0,g.jsx)("h2",{children:"Reference"}),(0,g.jsx)("p",{children:e.title})]}),(0,g.jsxs)("article",{className:"dna-card",children:[(0,g.jsx)("strong",{children:"Hook"}),(0,g.jsx)("p",{children:S.hook})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Retention"}),(0,g.jsx)("p",{children:S.retention})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Payoff"}),(0,g.jsx)("p",{children:S.payoff})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Preserve"}),(0,g.jsx)("ul",{children:S.preserve.map(B=>(0,g.jsx)("li",{children:B},B))})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Avoid"}),(0,g.jsx)("ul",{children:S.avoid.map(B=>(0,g.jsx)("li",{children:B},B))})]}),E.length>0&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Reuse for promotions"}),(0,g.jsx)("p",{className:"dna-panel-hint",children:"Same viral tactic, different pitch. Ideas for what this format can promote without breaking the hook:"}),(0,g.jsx)("ul",{children:E.map(B=>(0,g.jsx)("li",{children:B},B))})]})]})}function CX({value:t,onChange:e}){let n=K_(t);return(0,g.jsxs)("div",{className:"font-select-wrap",children:[(0,g.jsx)("select",{"aria-label":"Caption font",value:n,style:{fontFamily:`${Jl(n)}, 'TikTok Sans'`,fontWeight:Os(n)},onChange:r=>e(K_(r.target.value)),children:LU.map(r=>(0,g.jsx)("option",{value:r,style:{fontFamily:`${Jl(r)}, 'TikTok Sans'`,fontWeight:Os(r)},children:eX(r)},r))}),(0,g.jsx)("span",{"aria-hidden":"true",children:"v"})]})}function MX({value:t,color:e,background:n,onChange:r}){return(0,g.jsx)("div",{className:"text-background-options",role:"radiogroup","aria-label":"Text background style",children:UU.map(o=>(0,g.jsxs)("button",{type:"button",role:"radio","aria-checked":t===o.id,className:`text-background-option ${t===o.id?"selected":""}`,onClick:()=>r(o.id),children:[(0,g.jsx)("span",{style:{color:e,width:o.id==="fullwidth"?"100%":void 0,background:o.id==="highlight-solid"?n:o.id==="highlight-translucent"?PU(n,.34):o.id==="fullwidth"?DU:"transparent",WebkitTextStroke:o.id==="outline"?`1px ${n}`:"0 transparent",textShadow:o.id==="outline"?`1px 0 ${n}, -1px 0 ${n}, 0 1px ${n}, 0 -1px ${n}`:"none"},children:"Aa"}),(0,g.jsx)("b",{children:o.label})]},o.id))})}function OX({value:t,onChange:e,onCommit:n}){let[r,o]=(0,A.useState)(!1);return(0,g.jsx)("div",{className:`text-draft-shell ${r?"active":""}`,children:(0,g.jsx)("textarea",{rows:3,value:t,onFocus:()=>o(!0),onBlur:()=>{o(!1),n()},onChange:i=>e(i.target.value),onKeyDown:i=>{(i.metaKey||i.ctrlKey)&&i.key==="Enter"&&(i.preventDefault(),n())}})})}function l1(t,e){return{...e,start:t.start,duration:t.duration,track:t.track}}function IU(t,e){return e?{...t,...e.updates}:t}function d1(t,e){let n=Bn(e0(t),e);return n?{...e,...Ql(n)}:e}function j_(t,e){return!t||!e?t===e:t.text===e.text&&t.src===e.src&&t.fontFamily===e.fontFamily&&t.fontWeight===e.fontWeight&&t.italic===e.italic&&t.underline===e.underline&&t.color===e.color&&t.background===e.background&&t.textBackgroundStyle===e.textBackgroundStyle&&t.fontSize===e.fontSize&&t.radius===e.radius&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height&&t.volume===e.volume&&t.muted===e.muted&&t.kenBurns===e.kenBurns&&t.start===e.start&&t.duration===e.duration&&t.track===e.track}function RU(t,e){if(!e)return{...t};let n={};for(let r of["text","src","fontFamily","fontWeight","italic","underline","color","background","textBackgroundStyle","fontSize","radius","x","y","width","height","volume","muted","kenBurns","start","duration","track"])t[r]!==e[r]&&(n[r]=t[r]);return n}function q_({value:t}){let[e,n]=(0,A.useState)("idle");(0,A.useEffect)(()=>{if(e==="idle")return;let o=window.setTimeout(()=>n("idle"),900);return()=>window.clearTimeout(o)},[e]);let r=()=>{if(!t||!navigator.clipboard){n("error");return}navigator.clipboard.writeText(t).then(()=>n("done")).catch(()=>n("error"))};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("code",{className:"publish-info-value",title:t?`Click to copy: ${t}`:"no value",onClick:r,children:t||"\u2014"}),(0,g.jsx)("button",{type:"button",className:`inspector-id-copy inspector-id-copy--${e}`,onClick:r,disabled:!t,"aria-label":"Copy value",title:"Copy",children:e==="done"?(0,g.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,g.jsx)("path",{d:"M20 6L9 17l-5-5"})}):(0,g.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,g.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),(0,g.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}function DX({templateId:t,forkId:e,publishVersion:n,originalUrl:r,songName:o,songUrl:i,trendTagline:a}){let[s,l]=(0,A.useState)(!1),c=(0,A.useRef)(null);return(0,A.useEffect)(()=>{if(!s)return;let d=p=>{c.current&&!c.current.contains(p.target)&&l(!1)},u=p=>{p.key==="Escape"&&l(!1)};return window.addEventListener("mousedown",d),window.addEventListener("keydown",u),()=>{window.removeEventListener("mousedown",d),window.removeEventListener("keydown",u)}},[s]),(0,g.jsxs)("div",{className:"publish-info-wrap",ref:c,children:[(0,g.jsx)("button",{type:"button",className:"publish-info-trigger",onClick:()=>l(d=>!d),"aria-label":"Template info",title:"Template info",children:(0,g.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,g.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,g.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),s&&(0,g.jsxs)("div",{className:"publish-info-popover",role:"dialog",children:[a?(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"trend_tagline"}),(0,g.jsx)(q_,{value:a})]}):null,(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"template_id"}),(0,g.jsx)(q_,{value:t??""})]}),(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"fork_id"}),(0,g.jsx)(q_,{value:e??""})]}),(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"version"}),(0,g.jsx)(q_,{value:n!==null?String(n):""})]}),r?(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"original"}),(0,g.jsx)("a",{className:"publish-info-link",href:r,target:"_blank",rel:"noopener noreferrer",children:r})]}):null,o||i?(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"song"}),i?(0,g.jsx)("a",{className:"publish-info-link",href:i,target:"_blank",rel:"noopener noreferrer",children:o||i}):(0,g.jsx)("span",{children:o})]}):null]})]})}function LX({mode:t,busy:e,finished:n,error:r,scenesCreated:o,ghostcutStatus:i,ghostcutProgress:a,userPrompt:s,onUserPromptChange:l,onDecompose:c,onFinish:d,onCancel:u,onDismiss:p}){let f=!!p&&!n;return(0,g.jsx)("div",{className:"decompose-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"decompose-modal-title",children:(0,g.jsxs)("div",{className:"decompose-modal",children:[f&&(0,g.jsx)("button",{type:"button",className:"decompose-modal-close","aria-label":"Dismiss \u2014 decompose later",title:"Later",onClick:p,disabled:e,children:"\u2715"}),n?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h2",{id:"decompose-modal-title",children:"Decomposed \u2713"}),(0,g.jsxs)("p",{children:[o!==null?`Split the video into ${o} editable scene${o===1?"":"s"}.`:"Split the video into editable scenes."," Click Finish to load the timeline."]}),i==="pending"&&(0,g.jsxs)("p",{className:"decompose-modal-note",children:["Removing hardcoded subtitles\u2026",a!==null&&` (${Math.round(a)}%)`," This usually takes about 5 minutes. You can leave this tab open, work in another tab, or come back later \u2014 Finish will unlock automatically once the cleaned video is ready."]}),i==="done"&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Hardcoded subtitles removed \u2713 \u2014 click Finish to load the cleaned video."}),i==="failed"&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Subtitle removal failed; original video retained."}),(0,g.jsx)("div",{className:"decompose-modal-actions",children:(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",onClick:d,disabled:i==="pending","aria-busy":i==="pending",children:[i==="pending"&&(0,g.jsx)(Om,{label:"Removing subtitles"}),i==="pending"?"Removing subtitles\u2026":"Finish"]})})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h2",{id:"decompose-modal-title",children:t==="redo"?"Re-decompose this composition":"Decompose this composition"}),(0,g.jsx)("p",{children:t==="redo"?"Runs the AI decomposer again from the current source video. Your existing timeline edits on this working copy will be replaced \u2014 publish or snapshot first if you want to keep them.":"Smart-decompose splits the source video into scenes, extracts on-screen captions, and generates viral DNA using your saved AI provider key (Gemini \u2192 OpenAI \u2192 OpenRouter). Requires an AI provider key in Settings. If you're the first user to decompose this inspiration, your decomposition becomes the default template fork for everyone else."}),(0,g.jsxs)("label",{className:"decompose-modal-prompt",children:[(0,g.jsx)("span",{children:"Guidance for the AI (optional)"}),(0,g.jsx)("textarea",{className:"decompose-modal-textarea",placeholder:"e.g. Pay attention to the pinned comment as the hook; the payoff is the dance-floor reveal at ~00:08; keep captions in lowercase to match the original TikTok voice.",value:s,rows:4,maxLength:4e3,onChange:m=>l(m.target.value),disabled:e}),(0,g.jsx)("span",{className:"decompose-modal-hint",children:"Tell the model what to focus on: which beats matter, which captions are the hook, tone, preferred scene granularity, etc. Left blank uses the default extraction prompt."})]}),r&&(0,g.jsx)("p",{className:"decompose-modal-error",children:r}),(0,g.jsxs)("div",{className:"decompose-modal-actions",children:[f&&(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:p,disabled:e,children:"Later"}),u&&(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:u,disabled:e,children:"Cancel"}),(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",onClick:c,disabled:e,"aria-busy":e,children:[e&&(0,g.jsx)(Om,{label:"Decomposing"}),e?"Decomposing\u2026":t==="redo"?"Re-decompose":"Decompose"]})]})]})]})})}function UX({forkId:t,onClose:e}){let[n,r]=(0,A.useState)(null),[o,i]=(0,A.useState)(!1),[a,s]=(0,A.useState)(null),[l,c]=(0,A.useState)(!1);(0,A.useEffect)(()=>{let p=!0;return fetch(`/api/v1/compositions/${encodeURIComponent(t)}`).then(f=>f.ok?f.json():null).then(f=>{if(!p||!f)return;let m=f.visibility;r(m==="private"||m==="public"||m==="unlisted"?m:"private")}).catch(()=>p&&r("private")),()=>{p=!1}},[t]);let d=(0,A.useCallback)(async p=>{i(!0),s(null),c(!1);try{let f=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/visibility`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({visibility:p})}),m=await f.json().catch(()=>({}));if(!f.ok||m?.ok===!1)throw new Error(m?.error||`Save failed (${f.status})`);r(p),c(!0)}catch(f){s(f instanceof Error?f.message:String(f))}finally{i(!1)}},[t]),u=typeof window<"u"?`${window.location.origin}/editor/?fork=${encodeURIComponent(t)}`:"";return(0,g.jsx)("div",{className:"decompose-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"share-modal-title",children:(0,g.jsxs)("div",{className:"decompose-modal",children:[(0,g.jsx)("h2",{id:"share-modal-title",children:"Share this composition"}),(0,g.jsx)("p",{children:"Anyone with the link can view a public composition. Private compositions are only visible to you."}),n===null?(0,g.jsx)("p",{className:"decompose-modal-note",children:"Loading current visibility\u2026"}):(0,g.jsxs)("div",{className:"share-modal-choices",children:[(0,g.jsxs)("label",{className:`share-choice${n==="private"?" share-choice--active":""}`,children:[(0,g.jsx)("input",{type:"radio",name:"visibility",value:"private",checked:n==="private",disabled:o,onChange:()=>void d("private")}),(0,g.jsx)("span",{className:"share-choice-label",children:"Private"}),(0,g.jsx)("span",{className:"share-choice-hint",children:"Only you can view or edit."})]}),(0,g.jsxs)("label",{className:`share-choice${n==="public"?" share-choice--active":""}`,children:[(0,g.jsx)("input",{type:"radio",name:"visibility",value:"public",checked:n==="public",disabled:o,onChange:()=>void d("public")}),(0,g.jsx)("span",{className:"share-choice-label",children:"Public (view-only)"}),(0,g.jsx)("span",{className:"share-choice-hint",children:"Anyone with the link can view."})]})]}),n==="public"&&(0,g.jsxs)("div",{className:"share-modal-link",children:[(0,g.jsx)("input",{readOnly:!0,value:u,onFocus:p=>p.currentTarget.select()}),(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(u)},children:"Copy"})]}),n==="unlisted"&&(0,g.jsx)("p",{className:"decompose-modal-note",children:'Currently "unlisted" (legacy). Switch to Public or Private to update.'}),a&&(0,g.jsx)("p",{className:"decompose-modal-error",children:a}),l&&!a&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Saved \u2713"}),(0,g.jsx)("div",{className:"decompose-modal-actions",children:(0,g.jsx)("button",{type:"button",className:"panel-action-button primary",onClick:e,disabled:o,children:"Done"})})]})})}function BX({forkId:t,templateId:e,currentVersion:n,onClose:r,onReverted:o}){let[i,a]=(0,A.useState)(null),[s,l]=(0,A.useState)(null),[c,d]=(0,A.useState)(null);(0,A.useEffect)(()=>{let f=!0;return fetch(`/api/v1/compositions/${encodeURIComponent(t)}/versions?limit=100`).then(m=>m.ok?m.json():null).then(m=>{if(!f)return;if(!m){l("Could not load versions");return}let v=(Array.isArray(m.versions)?m.versions:[]).map(h=>({version:Number(h.version),createdAt:typeof h.created_at=="string"?h.created_at:null,message:typeof h.message=="string"?h.message:null,reason:typeof h.reason=="string"?h.reason:null})).filter(h=>Number.isFinite(h.version));v.sort((h,y)=>y.version-h.version),a(v)}).catch(m=>f&&l(m instanceof Error?m.message:String(m))),()=>{f=!1}},[t]);let u=()=>{if(typeof window>"u"||!e)return;let f=`/editor/${encodeURIComponent(e)}?fork=${encodeURIComponent(t)}`;window.open(f,"_blank","noopener,noreferrer")},p=(0,A.useCallback)(async f=>{d(f),l(null);try{let m=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/versions/${f}/composition.html`);if(!m.ok)throw new Error(`Load HTML failed (${m.status})`);let _=await m.text(),v=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/versions/${f}/composition.json`),h=v.ok?await v.text():null,y=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/composition.html`,{method:"PUT",headers:{"content-type":"text/html"},body:_});if(!y.ok){let S=await y.json().catch(()=>({}));throw new Error(S?.error||`Save HTML failed (${y.status})`)}h&&await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/composition.json`,{method:"PATCH",headers:{"content-type":"application/json"},body:h}).catch(()=>{}),o()}catch(m){l(m instanceof Error?m.message:String(m)),d(null)}},[t,o]);return(0,g.jsx)("div",{className:"decompose-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"history-modal-title",children:(0,g.jsxs)("div",{className:"decompose-modal history-modal",children:[(0,g.jsx)("h2",{id:"history-modal-title",children:"Version history"}),(0,g.jsx)("p",{children:"Every publish or manual snapshot creates an immutable version. Open this fork in the editor in a new tab, or revert this working copy to a past version."}),i===null&&!s&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Loading versions\u2026"}),s&&(0,g.jsx)("p",{className:"decompose-modal-error",children:s}),i!==null&&i.length===0&&!s&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"No published versions yet. Publish once to create v1."}),i&&i.length>0&&(0,g.jsx)("ul",{className:"history-list",children:i.map(f=>{let m=n!==null&&f.version===n;return(0,g.jsxs)("li",{className:`history-row${m?" history-row--current":""}`,children:[(0,g.jsxs)("div",{className:"history-row-head",children:[(0,g.jsxs)("span",{className:"history-version",children:["v",f.version,m&&" (current)"]}),f.createdAt&&(0,g.jsx)("span",{className:"history-date",children:new Date(f.createdAt).toLocaleString()})]}),f.message&&(0,g.jsx)("div",{className:"history-message",children:f.message}),f.reason&&(0,g.jsxs)("div",{className:"history-reason",children:["reason: ",f.reason]}),(0,g.jsxs)("div",{className:"history-actions",children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",disabled:!e,onClick:u,children:"Open in new tab"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button primary",disabled:c!==null||m,onClick:()=>void p(f.version),children:c===f.version?"Reverting\u2026":"Revert to this"})]})]},f.version)})}),(0,g.jsx)("div",{className:"decompose-modal-actions",children:(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:r,disabled:c!==null,children:"Close"})})]})})}function PX({id:t}){let[e,n]=(0,A.useState)("idle");(0,A.useEffect)(()=>{if(e==="idle")return;let o=window.setTimeout(()=>n("idle"),900);return()=>window.clearTimeout(o)},[e]);let r=()=>{if(t){if(typeof navigator>"u"||!navigator.clipboard){n("error");return}navigator.clipboard.writeText(t).then(()=>n("done")).catch(()=>n("error"))}};return(0,g.jsxs)("button",{type:"button",className:`click-copy-id click-copy-id--${e}`,onClick:r,disabled:!t,"aria-label":"Copy element id",title:t?`Click to copy: ${t}`:"No id",children:[(0,g.jsx)("code",{children:t||"\u2014"}),(0,g.jsx)("span",{className:"click-copy-id-state","aria-live":"polite",children:e==="done"?"\u2713":e==="error"?"!":"\u29C9"})]})}function V_({value:t,min:e,max:n,step:r=.01,onCommit:o}){let[i,a]=(0,A.useState)(()=>Number(t.toFixed(2)).toString()),[s,l]=(0,A.useState)(!1),c=(0,A.useRef)(!1);(0,A.useEffect)(()=>{s||a(Number(t.toFixed(2)).toString())},[s,t]);function d(p){return Number.isFinite(p)?Math.max(e??Number.NEGATIVE_INFINITY,Math.min(n??Number.POSITIVE_INFINITY,p)):t}function u(p=i){let f=Number(p);if(!Number.isFinite(f)){a(Number(t.toFixed(2)).toString());return}let m=d(f);a(Number(m.toFixed(2)).toString()),o(m)}return(0,g.jsx)("input",{type:"number",min:e,max:n,step:r,value:i,onFocus:()=>l(!0),onChange:p=>{a(p.target.value)},onBlur:()=>{if(l(!1),c.current){c.current=!1,a(Number(t.toFixed(2)).toString());return}u()},onKeyDown:p=>{p.key==="Enter"&&p.currentTarget.blur(),p.key==="Escape"&&(c.current=!0,a(Number(t.toFixed(2)).toString()),p.currentTarget.blur())}})}function zX(t,e,n,r){let o=e.slug.trim();o?t.setAttribute("data-hf-slug",o):t.removeAttribute("data-hf-slug");let i=e.note.trim();i?t.setAttribute("data-hf-note",i):t.removeAttribute("data-hf-note"),r.isMedia&&(t.setAttribute("src",e.src),r.isAudio||(t.style.objectFit=e.objectFit,t.style.objectPosition=e.objectPosition),t0(t,"img")&&Pm(t,e.kenBurns==="none"?null:e.kenBurns)),(r.isAudio||r.isVideoElement)&&(e.muted?t.setAttribute("muted",""):t.removeAttribute("muted"),t.setAttribute("data-volume",Kt(e.volume))),r.isVisual&&(t.style.left=`${e.x}%`,t.style.top=`${e.y}%`,t.style.width=`${e.width}%`,t.style.height=`${e.height}%`),r.isTextLike&&(t.setAttribute("data-label",e.text.slice(0,48)||n.label||n.id),BU(t,e.fontFamily,e.fontWeight),t.style.fontWeight=String(e.fontWeight),t.style.fontStyle=e.italic?"italic":"normal",t.style.textDecorationLine=e.underline?"underline":"none",t.style.color=e.color,t.style.background="transparent",t.style.fontSize=`${e.fontSize}px`,t.style.borderRadius=`${e.radius}px`,Q_(t,e.text,e.textBackgroundStyle,e.color,e.background,e.fontFamily,e.fontWeight))}function Y_(t,e,n,r,o){if(r.isMedia&&"src"in o&&t.setAttribute("src",e.src),r.isMedia&&!r.isAudio&&("objectFit"in o&&(t.style.objectFit=e.objectFit),"objectPosition"in o&&(t.style.objectPosition=e.objectPosition),"kenBurns"in o&&t0(t,"img")&&(Pm(t,e.kenBurns==="none"?null:e.kenBurns),YK(t))),(r.isAudio||r.isVideoElement)&&("muted"in o&&(e.muted?t.setAttribute("muted",""):t.removeAttribute("muted")),"volume"in o&&t.setAttribute("data-volume",Kt(e.volume))),r.isVisual&&("x"in o&&(t.style.left=`${e.x}%`),"y"in o&&(t.style.top=`${e.y}%`),"width"in o&&(t.style.width=`${e.width}%`),"height"in o&&(t.style.height=`${e.height}%`)),"slug"in o){let s=e.slug.trim();s?t.setAttribute("data-hf-slug",s):t.removeAttribute("data-hf-slug")}if("note"in o){let s=e.note.trim();s?t.setAttribute("data-hf-note",s):t.removeAttribute("data-hf-note")}if(!r.isTextLike)return;let i=t.querySelector("[data-vf-text-inline]"),a=t.querySelector("[data-vf-text-lines]");"text"in o&&t.setAttribute("data-label",e.text.slice(0,48)||n.label||n.id),("fontFamily"in o||"fontWeight"in o)&&(t.setAttribute("data-font-family",e.fontFamily),BU(t,e.fontFamily,e.fontWeight),i&&i.setAttribute("data-font-family",e.fontFamily),a&&(a.style.fontFamily=`${Jl(e.fontFamily)}, 'TikTok Sans'`)),"italic"in o&&(t.style.fontStyle=e.italic?"italic":"normal"),"underline"in o&&(t.style.textDecorationLine=e.underline?"underline":"none"),"color"in o&&(t.style.color=e.color,i&&(i.style.color=e.color)),"fontSize"in o&&(t.style.fontSize=`${e.fontSize}px`),"radius"in o&&(t.style.borderRadius=`${e.radius}px`),("text"in o||"textBackgroundStyle"in o||"background"in o)&&(t.style.background="transparent",Q_(t,e.text,e.textBackgroundStyle,e.color,e.background,e.fontFamily,e.fontWeight))}function FX(t){return t?t.tag!=="audio"&&t.tag!=="video"&&t.tag!=="img"&&t.tag!=="image":!1}function b1(t){return!t||t.tag==="audio"?!1:(t.hfId||t.domId||t.id||t.key)!=="source-video"}function JU(t){return{x:Qo(t.style,"left",0),y:Qo(t.style,"top",0),width:Qo(t.style,"width",100),height:Qo(t.style,"height",100),fontSize:Qo(t.style,"font-size",NaN)}}function f1(t,e){t.style.left=`${e.x}%`,t.style.top=`${e.y}%`,t.style.width=`${e.width}%`,t.style.height=`${e.height}%`,Number.isFinite(e.fontSize)&&(t.style.fontSize=`${e.fontSize}px`)}function HX(t,e,n){t.style.display="block",t.style.position="absolute",t.style.left=e.style.left||"0%",t.style.top=e.style.top||"0%",t.style.width=e.style.width||"100%",t.style.height=e.style.height||"100%",t.style.borderRadius=e.style.borderRadius||"0",t.style.zIndex="9999";let r=b1(n),o=e.getAttribute("data-hf-id")||e.id||Nt(n);r?(t.style.pointerEvents="auto",t.style.cursor="move",t.setAttribute("data-vf-frame-handle","move"),t.setAttribute("data-vf-target-id",o)):(t.style.pointerEvents="none",t.style.cursor="",t.removeAttribute("data-vf-frame-handle"),t.removeAttribute("data-vf-target-id")),t.style.border=r?"1px dashed #F2CD46":"3px solid #F2CD46",t.style.boxShadow=r?"0 0 0 2px #118df2":"inset 0 0 0 1px #000000, 0 0 0 7px rgba(242, 205, 70, 0.32)";for(let i of Array.from(t.querySelectorAll("[data-vf-frame-handle]")))i.remove();if(r)for(let[i,a]of[["top-left","left:-7px;top:-7px;cursor:nwse-resize;"],["top","top:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize;"],["top-right","right:-7px;top:-7px;cursor:nesw-resize;"],["right","right:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize;"],["bottom-right","right:-7px;bottom:-7px;cursor:nwse-resize;"],["bottom","bottom:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize;"],["bottom-left","left:-7px;bottom:-7px;cursor:nesw-resize;"],["left","left:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize;"]]){let s=t.ownerDocument.createElement("span");s.setAttribute("data-vf-frame-handle",i),s.setAttribute("data-vf-target-id",o),s.style.cssText=["position:absolute","display:block","width:14px","height:14px","box-sizing:border-box","border-radius:999px","border:2px solid #0b0d0a","background:#F2CD46","box-shadow:0 0 0 2px rgba(242,205,70,0.32),0 1px 4px rgba(0,0,0,0.38)","pointer-events:auto","touch-action:none",a].join(";"),t.append(s)}}var GX=(0,A.memo)(function({selected:e,html:n,visualFrameDraft:r,stageRef:o,getIframe:i,onStageFrame:a,onCommitDrag:s}){let[l,c]=(0,A.useState)(null),d=(0,A.useRef)(null),u=(0,A.useRef)(()=>{});u.current=()=>{if(!e||!b1(e)){c(null);return}let v=i(),h=o.current,y=v?.contentDocument,S=y?.querySelector("[data-composition-id]"),E=y?Bn(y,e):null;if(!v||!h||!oe(S)||!oe(E)){c(null);return}let R=v.getBoundingClientRect(),C=h.getBoundingClientRect(),k=r??JU(E);c({left:R.left-C.left+k.x/100*R.width,top:R.top-C.top+k.y/100*R.height,width:k.width/100*R.width,height:k.height/100*R.height,draft:k})},(0,A.useEffect)(()=>{u.current()},[n,e,r]),(0,A.useEffect)(()=>{let v=()=>u.current();return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);function p(v){if(!e)return;let h=i();km(h,e,R=>f1(R,v));let y=o.current;if(!h||!y)return;let S=h.getBoundingClientRect(),E=y.getBoundingClientRect();c({left:S.left-E.left+v.x/100*S.width,top:S.top-E.top+v.y/100*S.height,width:v.width/100*S.width,height:v.height/100*S.height,draft:v})}function f(v,h){if(!l)return;h.preventDefault(),h.stopPropagation();let y=i(),S=y?.getBoundingClientRect().width??1,E=y?.getBoundingClientRect().height??1;d.current={mode:v,originX:h.clientX,originY:h.clientY,rootWidth:S,rootHeight:E,draft:l.draft,latest:l.draft},h.currentTarget.setPointerCapture(h.pointerId)}function m(v){let h=d.current;if(!h)return;v.preventDefault(),v.stopPropagation();let y=(v.clientX-h.originX)/Math.max(1,h.rootWidth)*100,S=(v.clientY-h.originY)/Math.max(1,h.rootHeight)*100,E={...h.draft};if(h.mode==="move"&&(E.x=Lt(h.draft.x+y,0,100-h.draft.width),E.y=Lt(h.draft.y+S,0,100-h.draft.height)),h.mode==="left"||h.mode==="top-left"||h.mode==="bottom-left"){let R=Lt(h.draft.x+y,0,h.draft.x+h.draft.width-1);E.x=R,E.width=Lt(h.draft.width+(h.draft.x-R),1,100-R)}if((h.mode==="right"||h.mode==="top-right"||h.mode==="bottom-right")&&(E.width=Lt(h.draft.width+y,1,100-h.draft.x)),h.mode==="top"||h.mode==="top-left"||h.mode==="top-right"){let R=Lt(h.draft.y+S,0,h.draft.y+h.draft.height-1);E.y=R,E.height=Lt(h.draft.height+(h.draft.y-R),1,100-R)}if((h.mode==="bottom"||h.mode==="bottom-left"||h.mode==="bottom-right")&&(E.height=Lt(h.draft.height+S,1,100-h.draft.y)),FX(e)&&["top-left","top-right","bottom-left","bottom-right"].includes(h.mode)){let R=E.width/Math.max(1,h.draft.width),C=E.height/Math.max(1,h.draft.height),k=Math.sqrt(Math.max(.05,R*C));E.fontSize=Math.max(8,Math.min(180,(h.draft.fontSize??18)*k))}h.latest=E,p(E)}function _(v){let h=d.current;!h||!e||(v.preventDefault(),v.stopPropagation(),d.current=null,a(e,h.latest),s?.())}return l?(0,g.jsx)("div",{className:"canvas-frame-overlay",style:{left:l.left,top:l.top,width:l.width,height:l.height},onPointerDown:v=>f("move",v),onPointerMove:m,onPointerUp:_,onPointerCancel:_,onLostPointerCapture:_,children:["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].map(v=>(0,g.jsx)("span",{className:`canvas-frame-handle ${v}`,onPointerDown:h=>f(v,h),"aria-hidden":"true"},v))}):null}),$X=(0,A.memo)(function({composition:e,selected:n,html:r,onPatchHtml:o,onPatchLiveElement:i,onPreviewLiveElement:a,onUnselect:s,onDraftStateChange:l,onStageTimelineDraft:c,onStageVisualFrameDraft:d,timelineDraft:u,visualFrameDraft:p,onClearTimelineDraft:f,onClearVisualFrameDraft:m,onDiscardVisualFrameDraft:_,onDiscardTimelineDraft:v,onDelete:h,maxDuration:y,onPublish:S,publishOptions:E=null,onPublishOption:R,publishDisabled:C,publishLabel:k,templateId:L,forkId:F,publishVersion:U,originalUrl:D,songName:N,songUrl:B,onOpenShare:Y,onOpenDecompose:st,onOpenHistory:ot,decomposeDismissed:lt=!1,decomposeBusy:X=!1,onResumeDecompose:ct}){let H=n?Nt(n):null,gt=n?xU(r,n):null,J=n?d1(r,n):null,dt=J&>?l1(J,gt):null,[Xt,Ce]=(0,A.useState)(dt),[_n,Pn]=(0,A.useState)(H),[tt,Vt]=(0,A.useState)(!1);(0,A.useEffect)(()=>{let G=dt?{...dt,...u?.updates,...p}:null;Ce(G),Pn(H);let jt=!j_(G,dt);Vt(!1),l({dirty:jt,commit:jt&&G?()=>tc(G):null})},[H,r,u,p,l]);let Ut=(0,A.useRef)(null);if((0,A.useEffect)(()=>{Ut.current=n&&H&&_n===H&&Xt&&!j_(Xt,dt)?{key:H,commit:()=>$d(Xt)}:null}),(0,A.useEffect)(()=>{let G=H;return()=>{let jt=Ut.current;Ut.current=null,jt&&G&&jt.key===G&&jt.commit()}},[H]),!n)return(0,g.jsx)(NX,{composition:e,onPublish:S,publishOptions:E,onPublishOption:R,publishDisabled:C,publishLabel:k,templateId:L,forkId:F,publishVersion:U,originalUrl:D,songName:N,songUrl:B,onOpenShare:Y,onOpenDecompose:st,onOpenHistory:ot,decomposeDismissed:lt,decomposeBusy:X,onResumeDecompose:ct});let ft=J??n,ee=h1(ft),mt=J_(r,ft)??ee?.kind,ie=XU(r,ft),Qt=ft.tag==="audio"||mt==="audio",cn=ft.tag==="video"||mt==="video",un=ft.tag==="img"||ft.tag==="image"||mt==="image",Ge=Qt||cn||un,dn=ft.tag==="video",ut=Qt||dn,Ft=ie==="html"||mt==="shape"&&!!ee?.customHtml,yt=!Qt,kt=!Ge&&!Ft,bt=gt??xU(r,ft),K=Xt??l1(ft,bt),vt=!j_(K,dt),Ht=K.volume;function fn(G,jt){let kr={isAudio:Qt,isMedia:Ge,isTextLike:kt,isVisual:yt,isVideoElement:dn};a(ft,ko=>{Y_(ko,G,ft,kr,jt)})}function Ct(G){let jt={...Xt??l1(ft,bt),...G};if(("start"in G||"duration"in G||"track"in G)&&!c(ft,{start:jt.start,duration:jt.duration,track:jt.track}))return;if("x"in G||"y"in G||"width"in G||"height"in G){let Me={x:Lt(jt.x,0,Math.max(0,100-jt.width)),y:Lt(jt.y,0,Math.max(0,100-jt.height)),width:Lt(jt.width,1,100-jt.x),height:Lt(jt.height,1,100-jt.y)};jt.x=Me.x,jt.y=Me.y,jt.width=Me.width,jt.height=Me.height,d(ft,Me)}("src"in G||"volume"in G||"muted"in G||"x"in G||"y"in G||"width"in G||"height"in G||"fontFamily"in G||"fontWeight"in G||"fontSize"in G||"textBackgroundStyle"in G||"background"in G||"color"in G||"text"in G||"italic"in G||"underline"in G||"kenBurns"in G||"radius"in G)&&fn(jt,G);let ko=!j_(jt,dt);Ce(jt),l({dirty:ko,commit:ko?()=>tc(jt):null})}function Gd(G){i(ft,G)}function tc(G){let jt={isAudio:Qt,isMedia:Ge,isTextLike:kt,isVisual:yt,isVideoElement:dn},kr=RU(G,dt),ko=G.start!==ft.start||G.duration!==ft.duration||G.track!==ft.track;try{if(ko){let{html:Me}=KU(r,ft,{start:G.start,duration:G.duration,track:G.track});o(Zo(Me,ft,o0=>{Y_(o0,G,ft,jt,kr)})),H&&f(H),H&&m(H);return}Gd(Me=>{Y_(Me,G,ft,jt,kr)}),H&&f(H),H&&m(H)}catch(Me){Ar("editor.inspector-update-rejected",Me instanceof Error?Me.message:Me)}}function Fm(){vt&&tc(K)}function $d(G){if(_n!==H)return;let jt={isAudio:Qt,isMedia:Ge,isTextLike:kt,isVisual:yt,isVideoElement:dn},kr=RU(G,dt),ko=["start","duration","track","x","y","width","height"];Number.isFinite(p?.fontSize)&&ko.push("fontSize");for(let Me of ko)delete kr[Me];if(Object.keys(kr).length!==0)try{Gd(Me=>{Y_(Me,G,ft,jt,kr)})}catch(Me){Ar("editor.inspector-switch-commit-rejected",Me instanceof Error?Me.message:Me)}}return(0,g.jsxs)("section",{className:"dna-panel",children:[(0,g.jsxs)("div",{className:"panel-title",children:[(0,g.jsx)("span",{children:"Native Inspector"}),(0,g.jsx)("strong",{children:ft.tag}),vt?(0,g.jsxs)("div",{className:"panel-action-pair",children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>{if(dt){let G={isAudio:Qt,isMedia:Ge,isTextLike:kt,isVisual:yt,isVideoElement:dn};a(ft,jt=>{zX(jt,dt,ft,G)})}Ce(dt),H&&v(H),_(ft),l({dirty:!1,commit:null})},children:"Cancel"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button primary",onClick:()=>{Fm(),l({dirty:!1,commit:null})},children:"Update"})]}):(0,g.jsx)("button",{type:"button",className:"panel-close-button","aria-label":"Unselect layer",onClick:s,children:"x"})]}),(0,g.jsxs)("article",{className:"dna-card selected-card",children:[(0,g.jsx)("strong",{children:ft.label??ft.id}),(0,g.jsx)("p",{children:ee?.viralNote??"Native timeline element."})]}),(0,g.jsxs)("article",{className:"inspector-identity",children:[(0,g.jsx)(PX,{id:ft.hfId??ft.id??""}),(0,g.jsxs)("div",{className:"inspector-identity-fields",children:[(0,g.jsx)("input",{className:"inspector-identity-input",type:"text",placeholder:"slug (snake_case)",spellCheck:!1,value:K.slug,onChange:G=>Ct({slug:r0(G.target.value)})}),(0,g.jsx)("input",{className:"inspector-identity-input",type:"text",placeholder:"note \u2014 viral DNA reference",value:K.note,onChange:G=>Ct({note:G.target.value})})]})]}),(0,g.jsxs)("article",{className:"inspector-timing",children:[(0,g.jsxs)("div",{className:"inspector-section-header",children:[(0,g.jsx)("h2",{children:"Timing"}),(0,g.jsx)("span",{className:"inspector-help-inline",children:"drag to move \xB7 edges to trim"})]}),(0,g.jsxs)("div",{className:"inspector-timing-grid",children:[(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Start"}),(0,g.jsx)(V_,{min:0,max:Math.max(0,y-K.duration),value:K.start,onCommit:G=>Ct({start:G})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"End"}),(0,g.jsx)(V_,{min:.05,max:y,value:K.start+K.duration,onCommit:G=>Ct({duration:Math.max(.05,G-K.start)})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Dur"}),(0,g.jsx)(V_,{min:.05,max:Math.max(.05,y-K.start),value:K.duration,onCommit:G=>Ct({duration:Math.max(.05,G)})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Layer"}),(0,g.jsx)(V_,{min:0,step:1,value:K.track,onCommit:G=>Ct({track:Math.max(0,Math.round(G))})})]})]})]}),ut&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Audio"}),(0,g.jsxs)("label",{className:"switch-row",children:[(0,g.jsx)("span",{children:"Mute audio"}),(0,g.jsx)("input",{type:"checkbox",checked:K.muted,onChange:G=>Ct({muted:G.target.checked})})]}),(0,g.jsxs)("label",{className:"volume-row",children:[(0,g.jsxs)("span",{children:["Volume ",Math.round(Ht*100),"%"]}),(0,g.jsx)("input",{type:"range",min:"0",max:"1",step:"0.01",value:Ht,onChange:G=>Ct({volume:Number(G.target.value)})})]})]}),Ge&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:Qt?"Replace audio":cn?"Replace video":"Replace image"}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Source URL"}),(0,g.jsx)("input",{type:"text",value:K.src,onChange:G=>Ct({src:G.target.value})})]}),!Qt&&(0,g.jsxs)("div",{className:"inspector-grid",children:[(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Fit"}),(0,g.jsxs)("select",{value:K.objectFit,onChange:G=>Ct({objectFit:G.target.value}),children:[(0,g.jsx)("option",{value:"cover",children:"Cover (fill + crop)"}),(0,g.jsx)("option",{value:"contain",children:"Contain (letterbox)"}),(0,g.jsx)("option",{value:"fill",children:"Fill (stretch)"}),(0,g.jsx)("option",{value:"none",children:"None (native)"}),(0,g.jsx)("option",{value:"scale-down",children:"Scale-down"})]})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Position"}),(0,g.jsxs)("select",{value:K.objectPosition,onChange:G=>Ct({objectPosition:G.target.value}),children:[(0,g.jsx)("option",{value:"center",children:"Center"}),(0,g.jsx)("option",{value:"top",children:"Top"}),(0,g.jsx)("option",{value:"bottom",children:"Bottom"}),(0,g.jsx)("option",{value:"left",children:"Left"}),(0,g.jsx)("option",{value:"right",children:"Right"}),(0,g.jsx)("option",{value:"top left",children:"Top-left"}),(0,g.jsx)("option",{value:"top right",children:"Top-right"}),(0,g.jsx)("option",{value:"bottom left",children:"Bottom-left"}),(0,g.jsx)("option",{value:"bottom right",children:"Bottom-right"})]})]})]}),un&&(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Animate (Ken Burns)"}),(0,g.jsx)("select",{value:K.kenBurns||"none",onChange:G=>Ct({kenBurns:G.target.value}),children:qK.map(G=>(0,g.jsx)("option",{value:G.value,children:G.label},G.value))})]})]}),kt&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Text"}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Content"}),(0,g.jsx)(OX,{value:K.text,onChange:G=>Ct({text:G}),onCommit:()=>$d(K)})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Font"}),(0,g.jsx)(CX,{value:K.fontFamily,onChange:G=>Ct({fontFamily:G,fontWeight:K.fontWeight>=600?Os(G):400})})]}),(0,g.jsx)("div",{className:"inspector-grid",children:(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Size"}),(0,g.jsx)("input",{type:"number",min:"8",max:"120",step:"1",value:K.fontSize,onChange:G=>Ct({fontSize:Number(G.target.value)})})]})}),(0,g.jsxs)("div",{className:"text-style-toggles",children:[(0,g.jsxs)("label",{className:"style-toggle bold",title:"Bold",children:[(0,g.jsx)("input",{type:"checkbox","aria-label":"Bold",checked:K.fontWeight>=600,onChange:G=>Ct({fontWeight:G.target.checked?Os(K.fontFamily):400})}),(0,g.jsx)("span",{"aria-hidden":"true",children:"B"})]}),(0,g.jsxs)("label",{className:"style-toggle italic",title:"Italic",children:[(0,g.jsx)("input",{type:"checkbox","aria-label":"Italic",checked:K.italic,onChange:G=>Ct({italic:G.target.checked})}),(0,g.jsx)("span",{"aria-hidden":"true",children:"I"})]}),(0,g.jsxs)("label",{className:"style-toggle underline",title:"Underline",children:[(0,g.jsx)("input",{type:"checkbox","aria-label":"Underline",checked:K.underline,onChange:G=>Ct({underline:G.target.checked})}),(0,g.jsx)("span",{"aria-hidden":"true",children:"U"})]})]}),(0,g.jsxs)("div",{className:"inspector-grid",children:[(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Text"}),(0,g.jsx)("input",{type:"color",value:K.color.startsWith("#")?K.color:"#ffffff",onChange:G=>Ct({color:G.target.value})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Effect color"}),(0,g.jsx)("input",{type:"color",value:K.background.startsWith("#")?K.background:"#000000",onChange:G=>Ct({background:G.target.value})})]})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Background"}),(0,g.jsx)(MX,{value:K.textBackgroundStyle,color:K.color,background:K.background,onChange:G=>Ct({textBackgroundStyle:G})})]})]}),yt&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Frame"}),(0,g.jsxs)("div",{className:"inspector-grid",children:[(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"X %"}),(0,g.jsx)("input",{type:"number",min:"0",max:"100",step:"0.5",value:K.x,onChange:G=>Ct({x:Number(G.target.value)})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Y %"}),(0,g.jsx)("input",{type:"number",min:"0",max:"100",step:"0.5",value:K.y,onChange:G=>Ct({y:Number(G.target.value)})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"W %"}),(0,g.jsx)("input",{type:"number",min:"1",max:"100",step:"0.5",value:K.width,onChange:G=>Ct({width:Number(G.target.value)})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"H %"}),(0,g.jsx)("input",{type:"number",min:"1",max:"100",step:"0.5",value:K.height,onChange:G=>Ct({height:Number(G.target.value)})})]}),kt&&(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Radius"}),(0,g.jsx)("input",{type:"number",min:"0",max:"999",step:"1",value:K.radius,onChange:G=>Ct({radius:Number(G.target.value)})})]})})]})]}),(0,g.jsx)("div",{className:"inspector-danger-zone",children:tt?(0,g.jsxs)("div",{className:"delete-confirm",children:[(0,g.jsx)("span",{children:"Delete this layer?"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>Vt(!1),children:"Cancel"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button danger",onClick:()=>{h(ft),s()},children:"Delete"})]}):(0,g.jsx)("button",{type:"button",className:"inspector-delete-button",disabled:ft.hfId==="source-video",onClick:()=>Vt(!0),children:"Delete layer"})})]})}),Rm={current:null},Nm={current:null},Cm={current:[]};function jX(t){if(Nm.current){Nm.current.onExportComplete(t);return}Cm.current.some(n=>n.url===t.url&&n.renderId===t.renderId)||Cm.current.push(t)}function Kl(t){let e=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`;return`${t}-${e}`}async function qX(t,e){let n=t.body?.getReader();if(!n)throw new Error("No response body");let r=new TextDecoder,o="";for(;;){let{value:i,done:a}=await n.read();if(a)break;o+=r.decode(i,{stream:!0});let s=o.split(`
|
|
1194
1222
|
|
|
1195
1223
|
`);o=s.pop()??"";for(let l of s)for(let c of l.split(`
|
|
1196
|
-
`)){if(!c.startsWith("data:"))continue;let d=c.slice(5).trim();if(!d||d==="[DONE]")continue;let u;try{u=JSON.parse(d)}catch{continue}if(!u||typeof u!="object")continue;let p=u,f=typeof p.type=="string"?p.type:null;if(f==="text-delta"&&typeof p.delta=="string")e.onDelta(p.delta);else if(f==="status"){let m=typeof p.status=="string"?p.status:typeof p.message=="string"?p.message:null;m&&e.onStatus&&e.onStatus(m)}else if(f==="tool-call"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string")e.onToolCall?.({toolCallId:p.toolCallId,toolName:p.toolName,args:p.args&&typeof p.args=="object"?p.args:void 0});else if(f==="tool-result"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string")e.onToolResult?.({toolCallId:p.toolCallId,toolName:p.toolName,result:p.result});else if(f==="error"){let m=typeof p.errorText=="string"?p.errorText:p.error&&typeof p.error=="object"&&typeof p.error.message=="string"?p.error.message:"Stream error";e.onError?.(m)}}}}async function QU(t){let e=new FormData;e.append("file",t.file),e.append("folder_path","");let n=await fetch("/api/v1/user/me/attachments/upload",{method:"POST",headers:{"vidfarm-api-key":t.apiKey},body:e}),r=await n.json().catch(()=>({}));if(!n.ok||!r?.attachment)throw new Error(r?.error||`Upload failed with status ${n.status}`);let o=r.attachment,i=o.viewUrl||o.view_url||o.publicUrl||o.public_url||o.url,a=o.fileName||o.file_name||o.name,s=o.contentType||o.content_type||o.mimeType||o.mime_type,l=o.id||o.attachmentId||o.attachment_id;if(!i||!a||!l)throw new Error("Attachment response was incomplete.");return{id:l,fileName:a,contentType:s||t.file.type||"application/octet-stream",viewUrl:i,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:typeof o.size_bytes=="number"?o.size_bytes:t.file.size}}async function VX(t){let n=zd()?.vidfarmApiKey??null;if(!n)throw new Error("Sign in required to upload media from your computer.");let r=await QU({file:t,apiKey:n});return{url:r.viewUrl,contentType:r.contentType,fileName:r.fileName}}function YX(t){let e=(t.type||"").toLowerCase();if(e.startsWith("video/"))return"video";if(e.startsWith("image/"))return"image";if(e.startsWith("audio/"))return"audio";let n=t.name.toLowerCase();return/\.(mp4|mov|webm|m4v|avi|mkv)$/.test(n)?"video":/\.(png|jpe?g|gif|webp|avif|bmp|svg)$/.test(n)?"image":/\.(mp3|wav|m4a|aac|ogg|flac)$/.test(n)?"audio":null}function WX(t){return t.replace(/\/$/,"")}function NU(t){let e=[];for(let n of t){if(!n||typeof n!="object")continue;let r=n,o=r.role==="user"||r.role==="assistant"?r.role:null,i=typeof r.id=="string"?r.id:null;if(!o||!i)continue;let a=typeof r.text=="string"?r.text:"",l=(Array.isArray(r.attachments)?r.attachments:[]).filter(u=>!!u&&typeof u=="object").map(u=>({id:typeof u.id=="string"?u.id:Kl("user").replace("user-","att-"),fileName:typeof u.fileName=="string"?u.fileName:"attachment",contentType:typeof u.contentType=="string"?u.contentType:"application/octet-stream",viewUrl:typeof u.viewUrl=="string"?u.viewUrl:"",sizeBytes:typeof u.sizeBytes=="number"?u.sizeBytes:0})),d=(Array.isArray(r.toolExchanges)?r.toolExchanges:[]).filter(u=>!!u&&typeof u=="object").map(u=>({toolCallId:typeof u.toolCallId=="string"?u.toolCallId:"",toolName:typeof u.toolName=="string"?u.toolName:"",args:u.args??void 0,result:u.result,status:u.status==="pending"||u.status==="complete"||u.status==="error"?u.status:"complete"}));e.push({id:i,role:o,text:a,attachments:l,toolExchanges:d,status:"complete"})}return e}function KX({boot:t,composition:e}){let[n,r]=(0,A.useState)([]),[o,i]=(0,A.useState)(""),[a,s]=(0,A.useState)(!1),[l,c]=(0,A.useState)(null),[d,u]=(0,A.useState)([]),[p,f]=(0,A.useState)(!1),[m,_]=(0,A.useState)(!1),[v,h]=(0,A.useState)([]),y=(0,A.useRef)(Kl("thread")),S=(0,A.useRef)(null),E=(0,A.useRef)(null),R=(0,A.useRef)(0),C=t?.vidfarmApiKey??null,
|
|
1224
|
+
`)){if(!c.startsWith("data:"))continue;let d=c.slice(5).trim();if(!d||d==="[DONE]")continue;let u;try{u=JSON.parse(d)}catch{continue}if(!u||typeof u!="object")continue;let p=u,f=typeof p.type=="string"?p.type:null;if(f==="text-delta"&&typeof p.delta=="string")e.onDelta(p.delta);else if(f==="status"){let m=typeof p.status=="string"?p.status:typeof p.message=="string"?p.message:null;m&&e.onStatus&&e.onStatus(m)}else if(f==="tool-call"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string")e.onToolCall?.({toolCallId:p.toolCallId,toolName:p.toolName,args:p.args&&typeof p.args=="object"?p.args:void 0});else if(f==="tool-result"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string")e.onToolResult?.({toolCallId:p.toolCallId,toolName:p.toolName,result:p.result});else if(f==="error"){let m=typeof p.errorText=="string"?p.errorText:p.error&&typeof p.error=="object"&&typeof p.error.message=="string"?p.error.message:"Stream error";e.onError?.(m)}}}}async function QU(t){let e=new FormData;e.append("file",t.file),e.append("folder_path","");let n=await fetch("/api/v1/user/me/attachments/upload",{method:"POST",headers:{"vidfarm-api-key":t.apiKey},body:e}),r=await n.json().catch(()=>({}));if(!n.ok||!r?.attachment)throw new Error(r?.error||`Upload failed with status ${n.status}`);let o=r.attachment,i=o.viewUrl||o.view_url||o.publicUrl||o.public_url||o.url,a=o.fileName||o.file_name||o.name,s=o.contentType||o.content_type||o.mimeType||o.mime_type,l=o.id||o.attachmentId||o.attachment_id;if(!i||!a||!l)throw new Error("Attachment response was incomplete.");return{id:l,fileName:a,contentType:s||t.file.type||"application/octet-stream",viewUrl:i,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:typeof o.size_bytes=="number"?o.size_bytes:t.file.size}}async function VX(t){let n=zd()?.vidfarmApiKey??null;if(!n)throw new Error("Sign in required to upload media from your computer.");let r=await QU({file:t,apiKey:n});return{url:r.viewUrl,contentType:r.contentType,fileName:r.fileName}}function YX(t){let e=(t.type||"").toLowerCase();if(e.startsWith("video/"))return"video";if(e.startsWith("image/"))return"image";if(e.startsWith("audio/"))return"audio";let n=t.name.toLowerCase();return/\.(mp4|mov|webm|m4v|avi|mkv)$/.test(n)?"video":/\.(png|jpe?g|gif|webp|avif|bmp|svg)$/.test(n)?"image":/\.(mp3|wav|m4a|aac|ogg|flac)$/.test(n)?"audio":null}function WX(t){return t.replace(/\/$/,"")}function NU(t){let e=[];for(let n of t){if(!n||typeof n!="object")continue;let r=n,o=r.role==="user"||r.role==="assistant"?r.role:null,i=typeof r.id=="string"?r.id:null;if(!o||!i)continue;let a=typeof r.text=="string"?r.text:"",l=(Array.isArray(r.attachments)?r.attachments:[]).filter(u=>!!u&&typeof u=="object").map(u=>({id:typeof u.id=="string"?u.id:Kl("user").replace("user-","att-"),fileName:typeof u.fileName=="string"?u.fileName:"attachment",contentType:typeof u.contentType=="string"?u.contentType:"application/octet-stream",viewUrl:typeof u.viewUrl=="string"?u.viewUrl:"",sizeBytes:typeof u.sizeBytes=="number"?u.sizeBytes:0})),d=(Array.isArray(r.toolExchanges)?r.toolExchanges:[]).filter(u=>!!u&&typeof u=="object").map(u=>({toolCallId:typeof u.toolCallId=="string"?u.toolCallId:"",toolName:typeof u.toolName=="string"?u.toolName:"",args:u.args??void 0,result:u.result,status:u.status==="pending"||u.status==="complete"||u.status==="error"?u.status:"complete"}));e.push({id:i,role:o,text:a,attachments:l,toolExchanges:d,status:"complete"})}return e}function KX({boot:t,composition:e}){let[n,r]=(0,A.useState)([]),[o,i]=(0,A.useState)(""),[a,s]=(0,A.useState)(!1),[l,c]=(0,A.useState)(null),[d,u]=(0,A.useState)([]),[p,f]=(0,A.useState)(!1),[m,_]=(0,A.useState)(!1),[v,h]=(0,A.useState)([]),y=(0,A.useRef)(Kl("thread")),S=(0,A.useRef)(null),E=(0,A.useRef)(null),R=(0,A.useRef)(0),C=t?.vidfarmApiKey??null,k=t?.editorChatApiUrl?.trim()||"/api/v1/editor-chat",L=WX(k),F=t?.compositionId??e.templateId;(0,A.useEffect)(()=>{if(!C)return;let tt=!1;return(async()=>{try{let Vt=new URLSearchParams({template_id:F??"",include_messages:"true",limit:"50"}),Ut=await fetch(`${L}/threads?${Vt.toString()}`,{headers:{"vidfarm-api-key":C}});if(!Ut.ok)return;let ft=await Ut.json().catch(()=>null);if(tt||!Array.isArray(ft?.threads))return;let ee=ft.threads.filter(mt=>!!mt&&typeof mt=="object").map(mt=>({id:String(mt.id??""),title:String(mt.title??"Chat"),templateId:String(mt.templateId??F),updatedAt:String(mt.updatedAt??""),lastMessageAt:typeof mt.lastMessageAt=="string"?mt.lastMessageAt:null,messageCount:typeof mt.messageCount=="number"?mt.messageCount:0,messages:Array.isArray(mt.messages)?mt.messages:[]})).filter(mt=>mt.id);if(tt)return;if(h(ee),ee.length>0){let mt=ee[0];y.current=mt.id,r(NU(mt.messages))}}catch{}})(),()=>{tt=!0}},[C,L,F]);let U=(0,A.useCallback)(tt=>{y.current=tt.id,r(NU(tt.messages)),_(!1),c(null)},[]),D=(0,A.useCallback)(()=>{y.current=Kl("thread"),r([]),_(!1),c(null)},[]);(0,A.useEffect)(()=>{let tt=S.current;tt&&(tt.scrollTop=tt.scrollHeight)},[n]),(0,A.useEffect)(()=>{let tt={onExportComplete:Vt=>{r(Ut=>{if(Ut.some(ie=>ie.role==="assistant"&&ie.status==="complete"&&typeof ie.text=="string"&&ie.text.includes(Vt.url)))return Ut;let ee=Vt.title?`"${Vt.title}" `:"",mt={id:Kl("assistant"),role:"assistant",text:`Render ${ee}finished. Rendered MP4: ${Vt.url}
|
|
1197
1225
|
|
|
1198
|
-
Say "approve it" to publish this MP4 as an approved post.`,toolExchanges:[],status:"complete"};return[...Ut,mt]})}};if(Nm.current=
|
|
1226
|
+
Say "approve it" to publish this MP4 as an approved post.`,toolExchanges:[],status:"complete"};return[...Ut,mt]})}};if(Nm.current=tt,Cm.current.length>0){let Vt=Cm.current.slice();Cm.current=[];for(let Ut of Vt)tt.onExportComplete(Ut)}return()=>{Nm.current===tt&&(Nm.current=null)}},[]);let N=(0,A.useCallback)((tt,Vt)=>{r(Ut=>Ut.map(ft=>ft.id===tt?Vt(ft):ft))},[]),B=(0,A.useCallback)(async tt=>{if(!C||tt.length===0)return;let Vt=tt.map(Ut=>({id:Kl("user").replace("user-","att-"),fileName:Ut.name,contentType:Ut.type||"application/octet-stream",viewUrl:"",sizeBytes:Ut.size,status:"uploading"}));u(Ut=>[...Ut,...Vt]);for(let Ut=0;Ut<tt.length;Ut+=1){let ft=tt[Ut],ee=Vt[Ut];try{let mt=await QU({file:ft,apiKey:C});u(ie=>ie.map(Qt=>Qt.id===ee.id?{...mt,status:"ready"}:Qt))}catch(mt){let ie=mt instanceof Error?mt.message:String(mt);u(Qt=>Qt.map(cn=>cn.id===ee.id?{...cn,status:"error",error:ie}:cn))}}},[C]),Y=(0,A.useCallback)(()=>{E.current?.click()},[]),st=(0,A.useCallback)(tt=>{let Vt=tt.target.files?Array.from(tt.target.files):[];tt.target.value="",Vt.length>0&&B(Vt)},[B]),ot=(0,A.useCallback)(tt=>{u(Vt=>Vt.filter(Ut=>Ut.id!==tt))},[]),lt=(0,A.useCallback)(tt=>{if(!C)return;let Vt=tt.clipboardData?.items?Array.from(tt.clipboardData.items):[],Ut=[];for(let ft of Vt)if(ft.kind==="file"){let ee=ft.getAsFile();ee&&Ut.push(ee)}Ut.length>0&&(tt.preventDefault(),B(Ut))},[C,B]),X=(0,A.useCallback)(tt=>{C&&tt.dataTransfer?.types?.includes("Files")&&(tt.preventDefault(),R.current+=1,f(!0))},[C]),ct=(0,A.useCallback)(tt=>{C&&tt.dataTransfer?.types?.includes("Files")&&(tt.preventDefault(),tt.dataTransfer.dropEffect="copy")},[C]),H=(0,A.useCallback)(tt=>{C&&(tt.preventDefault(),R.current=Math.max(0,R.current-1),R.current===0&&f(!1))},[C]),gt=(0,A.useCallback)(tt=>{if(!C)return;tt.preventDefault(),R.current=0,f(!1);let Vt=tt.dataTransfer?.files?Array.from(tt.dataTransfer.files):[];Vt.length>0&&B(Vt)},[C,B]),J=(0,A.useCallback)(async()=>{let tt=o.trim(),Vt=d.filter(K=>K.status==="ready");if(d.filter(K=>K.status==="uploading").length>0){c("Waiting for uploads to finish...");return}if(!tt&&Vt.length===0||a)return;if(!C){c("Sign in required to chat.");return}let ft=Vt.map(({status:K,error:vt,...Ht})=>Ht),ee={id:Kl("user"),role:"user",text:tt,attachments:ft,toolExchanges:[],status:"complete"},mt={id:Kl("assistant"),role:"assistant",text:"",toolExchanges:[],status:"pending"},ie=n;r(K=>[...K,ee,mt]),i(""),u(K=>K.filter(vt=>vt.status!=="ready")),s(!0),c("Sending...");let Qt=t?.compositionId??e.id,cn=t?.slugId??e.id,un=t?.title??e.title,Ge=e.summary??"",dn=Rm.current?.getSnapshot(),ut=ft.length>0?[`
|
|
1199
1227
|
|
|
1200
1228
|
<attachments>`,...ft.map(K=>`- ${K.fileName} (${K.contentType}): ${K.viewUrl}`),"</attachments>"].join(`
|
|
1201
|
-
`):"",Ft=dn?`${
|
|
1229
|
+
`):"",Ft=dn?`${tt}${ut}
|
|
1202
1230
|
|
|
1203
1231
|
<editor_context>
|
|
1204
1232
|
${JSON.stringify(dn,null,2)}
|
|
1205
|
-
</editor_context>`:`${
|
|
1233
|
+
</editor_context>`:`${tt}${ut}`,yt=K=>{let vt=[];K.text.trim()&&vt.push({type:"text",text:K.text});for(let Ht of K.attachments??[])vt.push({type:"file",data:Ht.viewUrl,mediaType:Ht.contentType});return vt},kt=[...ie.filter(K=>K.text.trim().length>0||(K.attachments?.length??0)>0).map(K=>({role:K.role,content:yt(K)})),{role:"user",content:[{type:"text",text:Ft},...ft.map(K=>({type:"file",data:K.viewUrl,mediaType:K.contentType}))]}],bt={template:{page:"docs",tracerId:null,tracers:[],defaultRequestTracer:null,templateId:Qt,templateSlug:cn,templateTitle:un,templateDescription:Ge,docsRoutes:[]},messages:kt,thread_id:y.current,thread_template_id:Qt,thread_title:un,thread_tracers:[],user_message:{id:ee.id,role:"user",text:Ft,attachments:ft.map(K=>({id:K.id,fileName:K.fileName,contentType:K.contentType,viewUrl:K.viewUrl}))},assistant_message:{id:mt.id}};try{let K=await fetch(k,{method:"POST",headers:{"content-type":"application/json","vidfarm-api-key":C},body:JSON.stringify(bt)});if(!K.ok){let vt=await K.text().catch(()=>K.statusText);throw new Error(vt||`HTTP ${K.status}`)}N(mt.id,vt=>({...vt,status:"streaming"})),await qX(K,{onDelta:vt=>{N(mt.id,Ht=>({...Ht,text:Ht.text+vt}))},onStatus:vt=>c(vt),onToolCall:vt=>{N(mt.id,Ht=>({...Ht,toolExchanges:[...Ht.toolExchanges,{toolCallId:vt.toolCallId,toolName:vt.toolName,args:vt.args,status:"pending"}]}))},onToolResult:vt=>{let Ht=null;if(vt.toolName==="editor_action"){let fn=gJ(vt.result);if(fn&&Rm.current)try{Ht=Rm.current.applyAction(fn)}catch(Ct){Ht={ok:!1,error:Ct instanceof Error?Ct.message:String(Ct)}}else fn&&(Ht={ok:!1,error:"Editor not ready to apply action."})}N(mt.id,fn=>({...fn,toolExchanges:fn.toolExchanges.map(Ct=>Ct.toolCallId===vt.toolCallId?{...Ct,result:vt.result,status:"complete",appliedSummary:Ht?.ok?Ht.summary:void 0,appliedError:Ht&&!Ht.ok?Ht.error:void 0}:Ct)}))},onError:vt=>{N(mt.id,Ht=>({...Ht,status:"error",error:vt}))}}),N(mt.id,vt=>vt.status==="error"?vt:{...vt,status:"complete"}),c(null)}catch(K){let vt=K instanceof Error?K.message:String(K);N(mt.id,Ht=>({...Ht,status:"error",error:vt})),c(`Error: ${vt}`)}finally{s(!1)}},[C,t,e,o,a,n,d,N]),dt=(0,A.useCallback)(tt=>{tt.preventDefault(),J()},[J]),Xt=(0,A.useCallback)(tt=>{tt.key==="Enter"&&!tt.shiftKey&&(tt.preventDefault(),J())},[J]),Ce=d.filter(tt=>tt.status==="uploading").length,_n=d.filter(tt=>tt.status==="ready").length,Pn=!!C&&!a&&Ce===0&&(o.trim().length>0||_n>0);return(0,g.jsxs)("aside",{className:`chat-workspace${p?" chat-workspace--drag":""}`,"aria-label":"Creative chat",onDragEnter:X,onDragOver:ct,onDragLeave:H,onDrop:gt,children:[(0,g.jsxs)("div",{className:"chat-header chat-header-row",children:[(0,g.jsx)("button",{type:"button",className:"chat-header-history","aria-label":m?"Back to chat":"Open chat history","aria-pressed":m,onClick:()=>_(tt=>!tt),children:m?(0,g.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,g.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,g.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,g.jsx)("circle",{cx:"10",cy:"10",r:"7.2"}),(0,g.jsx)("path",{d:"M10 6v4l2.6 1.6"})]})}),(0,g.jsxs)("div",{className:"chat-header-titles",children:[(0,g.jsx)("span",{children:"Vidfarm"}),(0,g.jsx)("strong",{children:m?"Chat history":t?.title??e.title??"Creative Chat"})]}),m?(0,g.jsx)("button",{type:"button",className:"chat-header-new",onClick:D,children:"New chat"}):null]}),(0,g.jsxs)("div",{className:"chat-thread","aria-live":"polite",ref:S,children:[m?v.length===0?(0,g.jsx)("div",{className:"chat-empty",children:"No previous conversations yet \u2014 start chatting to create one."}):(0,g.jsx)("ul",{className:"chat-thread-history",children:v.map(tt=>(0,g.jsx)("li",{children:(0,g.jsxs)("button",{type:"button",className:"chat-thread-history-item","data-active":tt.id===y.current?"true":"false",onClick:()=>U(tt),children:[(0,g.jsx)("span",{className:"chat-thread-history-title",children:tt.title||"Untitled chat"}),(0,g.jsxs)("span",{className:"chat-thread-history-meta",children:[tt.messageCount," message",tt.messageCount===1?"":"s"]})]})},tt.id))}):n.length===0?(0,g.jsx)("div",{className:"chat-empty",children:C?"Ask about this composition, request edits, or run a tool. Paste, drop, or clip an image to attach.":"Sign in to chat with Vidfarm."}):n.map(tt=>(0,g.jsx)(QX,{message:tt},tt.id)),l&&!m&&(0,g.jsx)("div",{className:"chat-status",children:l})]}),(0,g.jsxs)("form",{className:"chat-composer",onSubmit:dt,hidden:m,children:[d.length>0&&(0,g.jsx)("div",{className:"chat-composer-attachments",children:d.map(tt=>(0,g.jsx)(XX,{attachment:tt,onRemove:()=>ot(tt.id)},tt.id))}),(0,g.jsxs)("div",{className:"chat-composer-shell",children:[(0,g.jsx)("textarea",{"aria-label":"Message",placeholder:C?"Message Vidfarm...":"Sign in required",rows:3,value:o,onChange:tt=>i(tt.target.value),onKeyDown:Xt,onPaste:lt,disabled:!C||a}),(0,g.jsxs)("div",{className:"chat-composer-actions",children:[(0,g.jsx)("button",{type:"button",className:"chat-composer-icon",onClick:Y,disabled:!C||a,"aria-label":"Attach files",title:"Attach files (or paste / drop)",children:(0,g.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,g.jsx)("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),(0,g.jsx)("button",{type:"submit",className:"chat-composer-send",disabled:!Pn,"aria-label":"Send",title:"Send (Enter)",children:a?(0,g.jsx)("span",{className:"chat-composer-send-label",children:"\u2026"}):(0,g.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,g.jsx)("path",{d:"M5 12h14"}),(0,g.jsx)("path",{d:"M13 5l7 7-7 7"})]})})]})]}),(0,g.jsx)("input",{ref:E,type:"file",multiple:!0,hidden:!0,onChange:st}),p&&(0,g.jsx)("div",{className:"chat-composer-drop-hint","aria-hidden":"true",children:"Drop files to attach"})]})]})}function XX({attachment:t,onRemove:e}){let n=t.contentType.startsWith("image/");return(0,g.jsxs)("div",{className:`chat-attachment-chip chat-attachment-chip--${t.status}`,children:[n&&t.viewUrl?(0,g.jsx)("img",{src:t.viewUrl,alt:"",className:"chat-attachment-chip-thumb"}):(0,g.jsx)("span",{className:"chat-attachment-chip-file","aria-hidden":"true",children:"\u{1F4CE}"}),(0,g.jsxs)("div",{className:"chat-attachment-chip-meta",children:[(0,g.jsx)("span",{className:"chat-attachment-chip-name",title:t.fileName,children:t.fileName}),(0,g.jsx)("span",{className:"chat-attachment-chip-status",children:t.status==="uploading"?"Uploading\u2026":t.status==="error"?t.error||"Failed":"Ready"})]}),(0,g.jsx)("button",{type:"button",className:"chat-attachment-chip-remove",onClick:e,"aria-label":`Remove ${t.fileName}`,children:"\xD7"})]})}function ZU(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function c1(t){let e=ZU(t);return e=e.replace(/`([^`]+)`/g,"<code>$1</code>"),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/(^|[^\*])\*([^*]+)\*(?!\*)/g,"$1<em>$2</em>"),e=e.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),e=e.replace(/(^|[\s(])(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/g,'$1<a href="$2" target="_blank" rel="noopener noreferrer">$2</a>'),e}function JX(t){let e=t.replace(/\r\n/g,`
|
|
1206
1234
|
`).trim();return e?e.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>${ZU(l)}</code></pre>`}let i=o.split(`
|
|
1207
|
-
`);return i.every(l=>/^[-*]\s+/.test(l.trim()))?`<ul>${i.map(c=>c.trim().replace(/^[-*]\s+/,"")).map(c=>`<li>${c1(c)}</li>`).join("")}</ul>`:i.every(l=>/^\d+\.\s+/.test(l.trim()))?`<ol>${i.map(c=>c.trim().replace(/^\d+\.\s+/,"")).map(c=>`<li>${c1(c)}</li>`).join("")}</ol>`:`<p>${i.map(l=>c1(l.trim())).join("<br />")}</p>`}).filter(Boolean).join(""):""}function QX({message:t}){let e=t.text.trim().length>0,n=e?JX(t.text):"";return(0,g.jsxs)("div",{className:`chat-message chat-message--${t.role} chat-message--${t.status}`,children:[(0,g.jsx)("div",{className:"chat-message-role",children:t.role==="user"?"You":"Vidfarm"}),e&&(0,g.jsx)("div",{className:"chat-message-text chat-message-text--markdown",dangerouslySetInnerHTML:{__html:n}}),t.attachments&&t.attachments.length>0&&(0,g.jsx)("div",{className:"chat-message-attachments",children:t.attachments.map(r=>r.contentType.startsWith("image/")?(0,g.jsx)("a",{href:r.viewUrl,target:"_blank",rel:"noreferrer",className:"chat-message-attachment chat-message-attachment--image",children:(0,g.jsx)("img",{src:r.viewUrl,alt:r.fileName})},r.id):(0,g.jsxs)("a",{href:r.viewUrl,target:"_blank",rel:"noreferrer",className:"chat-message-attachment chat-message-attachment--file",children:["\u{1F4CE} ",r.fileName]},r.id))}),t.toolExchanges.map(r=>(0,g.jsx)(ZX,{exchange:r},r.toolCallId)),t.status==="error"&&t.error&&(0,g.jsx)("div",{className:"chat-message-error",children:t.error}),t.status==="pending"&&!t.text&&t.toolExchanges.length===0&&(0,g.jsx)("div",{className:"chat-message-pending",children:"Thinking..."})]})}function ZX({exchange:t}){let e=t.args?tJ(t.toolName,t.args):null,n=t.appliedError?"failed":t.appliedSummary?"applied":t.status==="pending"?"...":"done";return(0,g.jsxs)("details",{className:`chat-tool chat-tool--${t.status}${t.appliedError?" chat-tool--apply-error":""}`,children:[(0,g.jsxs)("summary",{children:[(0,g.jsx)("span",{className:"chat-tool-name",children:t.toolName}),e&&(0,g.jsx)("span",{className:"chat-tool-args",children:e}),(0,g.jsx)("span",{className:"chat-tool-status",children:n})]}),t.appliedSummary&&(0,g.jsx)("div",{className:"chat-tool-applied",children:t.appliedSummary}),t.appliedError&&(0,g.jsx)("div",{className:"chat-tool-applied chat-tool-applied--error",children:t.appliedError}),t.args&&(0,g.jsx)("pre",{className:"chat-tool-payload",children:JSON.stringify(t.args,null,2)}),t.result!==void 0&&(0,g.jsx)("pre",{className:"chat-tool-payload chat-tool-result",children:hJ(t.result)})]})}function tJ(t,e){if(t==="http_request"){let o=typeof e.method=="string"?e.method:"GET",i=typeof e.path=="string"?e.path:"";return`${o} ${i}`}if(t==="editor_action"){let o=typeof e.action_type=="string"?e.action_type:"?",i=typeof e.layer_key=="string"?` ${e.layer_key}`:"",a=typeof e.kind=="string"?` ${e.kind}`:"";return`${o}${a}${i}`}let n=Object.keys(e)[0];if(!n)return null;let r=e[n];return typeof r=="string"?`${n}: ${r.slice(0,60)}`:n}function Zl(t,e){if(!e)return t;let n=e===1?"auto-resolved 1 track collision":`auto-resolved ${e} track collisions`;return`${t} (${n})`}function t6(t,e,n){let r=n.trim();if(!r)return null;let o=h=>h.key===r||h.id===r||h.hfId===r||h.domId===r||Nt(h)===r,i=t.draftedElements.find(o);if(i)return i;if(!e)return null;let a=new DOMParser().parseFromString(e,"text/html"),s=r.replace(/["\\]/g,"\\$&"),l=a.querySelector(`[data-hf-slug="${s}"]`),c=a.querySelector(`[data-hf-id="${s}"]`)??a.getElementById(r),d=(l instanceof Element?l:null)??(c instanceof Element?c:null);if(!d)return null;let u=d.getAttribute("data-hf-id")||d.id;if(!u)return null;let p=t.draftedElements.find(h=>h.hfId===u||h.domId===u||h.id===u||h.key===u);if(p)return p;let f=Number(d.getAttribute("data-start")??0),m=Number(d.getAttribute("data-duration")??0),_=Number(d.getAttribute("data-track-index")??0),v=d instanceof HTMLElement&&d.id?d.id:void 0;return{id:u,key:u,hfId:u,domId:v,tag:d.tagName.toLowerCase(),start:Number.isFinite(f)?f:0,duration:Number.isFinite(m)?m:0,track:Number.isFinite(_)?_:0}}function eJ(t,e){if(!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0)return;let n=(a,s)=>s===0?a:n(s,a%s),r=Math.round(t),o=Math.round(e),i=n(r,o)||1;return`${r/i}:${o/i}`}function nJ(t,e){let r=l=>Number(l.toFixed(3));if(!Number.isFinite(e)||e<=0)return[];let o=t.filter(l=>Number.isFinite(l.start)&&Number.isFinite(l.end)&&l.end>l.start).sort((l,c)=>l.start-c.start),i=[];for(let l of o){let c=i[i.length-1];c&&l.start<=c.end+.001?c.end=Math.max(c.end,l.end):i.push({start:Math.max(0,l.start),end:l.end})}let a=[],s=0;for(let l of i)l.start-s>=.2&&a.push({start:r(s),end:r(l.start),duration:r(l.start-s)}),s=Math.max(s,l.end);return e-s>=.2&&a.push({start:r(s),end:r(e),duration:r(e-s)}),a}function rJ(t){let e=t.compositionHtmlRef.current,n=e?new DOMParser().parseFromString(e,"text/html"):null,r=t.getLastExport(),o=t.getCast(),i=[],a=t.draftedElements.map(v=>{let h=n?Bn(n,v):null,y=h?.style,S=h?.getAttribute("data-layer-kind")??void 0,E=h?.getAttribute("data-vf-timeline-proxy")==="video",R=F=>{if(!F)return;let gt=F.match(/(-?\d+(?:\.\d+)?)\s*%/);return gt?Number(gt[1]):void 0},C=R(y?.left),I=R(y?.top),L=R(y?.width),z=R(y?.height),U=E||C!==void 0&&I!==void 0&&L!==void 0&&z!==void 0&&C<=.5&&I<=.5&&L>=99.5&&z>=99.5,D=h?.getAttribute("src")??void 0,N=h?.getAttribute("data-volume"),B=N&&Number.isFinite(Number(N))?Number(N):void 0,V=y?.color||void 0,st=y?.background||void 0,nt=h?.getAttribute("data-hf-id")??v.hfId??v.id,lt=h?.getAttribute("data-hf-slug")??void 0,X=h?.getAttribute("data-hf-note")??void 0,ct=(S??"").toLowerCase();return(E||["video","image","html","shape"].includes(ct))&&Number.isFinite(v.duration)&&v.duration>0&&i.push({start:v.start,end:v.start+v.duration}),{key:Nt(v),element_id:nt??void 0,slug:lt,note:X,label:v.label,kind:S,tag:v.tag,is_timeline_proxy:E||void 0,is_full_canvas:U||void 0,src:D,start:v.start,duration:v.duration,track:v.track,playback_start:v.playbackStart,x:C,y:I,width:L,height:z,volume:B,color:V,background:st}}),s=t.composition.width,l=t.composition.height,c=Number.isFinite(t.activeCompositionDuration)?t.activeCompositionDuration:0,d=nJ(i,c),u=[];if(n)for(let v of Array.from(n.querySelectorAll("[data-vf-gen-media]"))){if(!re(v))continue;let h=v.getAttribute("data-vf-gen-media"),y=h==="image"?"image":h==="video"?"video":null;if(!y)continue;let S=Number(v.getAttribute("data-start")),E=Number(v.getAttribute("data-duration"));u.push({layer_key:v.getAttribute("data-hf-id")||v.id,media_type:y,status:v.getAttribute("data-vf-gen-status")||"generating",job_id:v.getAttribute("data-vf-gen-job")||void 0,start:Number.isFinite(S)?S:void 0,duration:Number.isFinite(E)?E:void 0,prompt:v.getAttribute("data-vf-gen-prompt")||void 0,error:v.getAttribute("data-vf-gen-error")||void 0})}let p=YU(e),m={source_title:(n?.querySelector("[data-composition-id]")?.getAttribute("data-source-title")||"").trim()||void 0,trend_tagline:p?.trendTagline||void 0,hook:p?.hook||void 0,retention:p?.retention||void 0,payoff:p?.payoff||void 0,preserve:p?.preserve?.length?p.preserve:void 0,avoid:p?.avoid?.length?p.avoid:void 0,promotions:p?.promotions?.length?p.promotions:void 0},_=Object.values(m).some(v=>v!==void 0);return{composition_id:t.composition.id,composition_title:t.composition.title,composition_context:_?m:void 0,composition_duration_seconds:t.activeCompositionDuration,composition_width:s&&s>0?s:void 0,composition_height:l&&l>0?l:void 0,aspect_ratio:eJ(s,l),selected_layer_key:t.selectedElementId,cast:o&&o.length?o:void 0,timeline_gaps:d.length?d:void 0,pending_generations:u.length?u:void 0,last_export_url:r.url,last_export_title:r.title,last_export_status:r.status,last_export_render_id:r.renderId,layers:a}}function CU(t,e){let n=e.compositionHtmlRef.current;if(!n)return{ok:!1,error:"Composition not loaded yet."};if(t.action_type==="replace_composition_html"){let i=t.composition_html;return!i||!i.includes("data-composition-id=")?{ok:!1,error:"composition_html must be a full HTML document containing data-composition-id."}:(e.patchCompositionHtml(i),{ok:!0,summary:`Replaced composition (${i.length} bytes).`})}if(t.action_type==="export_composition")return e.isExportInFlight()?{ok:!1,error:"Render already in flight \u2014 wait for the current render to finish."}:(e.startExport(),{ok:!0,summary:"Started composition export. The exported MP4 URL will land in editor_context.last_export_url when it succeeds."});if(t.action_type==="add_layer")return oJ(t,e,n);if(t.action_type==="generate_layer")return iJ(t,e,n);if(t.action_type==="group_layers")return pJ(t,e,n);if(t.action_type==="ungroup_layers")return mJ(t,e,n);let r=t.layer_key;if(!r)return{ok:!1,error:`layer_key required for ${t.action_type}.`};let o=t6(e,n,r);if(!o)return{ok:!1,error:`Layer not found: ${r}`};if(t.action_type==="set_layer_identity"){let i=Zo(n,o,a=>{if(t.slug!==void 0){let s=r0(t.slug);s?a.setAttribute("data-hf-slug",s):a.removeAttribute("data-hf-slug")}if(t.note!==void 0){let s=t.note.trim();s?a.setAttribute("data-hf-note",s):a.removeAttribute("data-hf-note")}});return i===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(i),{ok:!0,summary:`Updated identity of ${r} (slug=${t.slug??"-"} note=${t.note?"yes":"-"}).`})}if(t.action_type==="remove_layer")try{let{html:i,resolvedCollisions:a}=Ao(n,s=>{let l=Bn(s,o);l?.parentNode&&l.parentNode.removeChild(l)});return i===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(i),{ok:!0,summary:Zl(`Removed layer ${r}.`,a)})}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}if(t.action_type==="set_layer_timing"){let i={};if(t.start!==void 0&&(i.start=t.start),t.duration!==void 0&&(i.duration=t.duration),t.track!==void 0&&(i.track=t.track),t.playback_start!==void 0&&(i.playbackStart=t.playback_start),Object.keys(i).length===0)return{ok:!1,error:"set_layer_timing needs at least one of start, duration, track, or playback_start."};{let a=i.start??o.start,s=i.duration??o.duration,l=i.track??o.track,c=o.hfId||o.domId||o.id,d=new DOMParser().parseFromString(n,"text/html"),u=zm(d,{start:a,duration:s,track:l},new Set(c?[c]:[]));u!==l&&(i.track=u)}try{let{html:a,resolvedCollisions:s}=KU(n,o,i);if(a===n)return{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."};e.patchCompositionHtml(a);let l=Object.entries(i).map(([c,d])=>`${c}=${d}`).join(" ");return{ok:!0,summary:Zl(`Updated ${r} timing (${l}).`,s)}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}if(t.action_type==="set_layer_visual"){let a=["x","y","width","height","font_size","border_radius"].filter(c=>t[c]!==void 0);if(a.length===0)return{ok:!1,error:"set_layer_visual needs at least one of x, y, width, height, font_size, or border_radius."};let s=Zo(n,o,c=>{t.x!==void 0&&(c.style.left=`${t.x}%`),t.y!==void 0&&(c.style.top=`${t.y}%`),t.width!==void 0&&(c.style.width=`${t.width}%`),t.height!==void 0&&(c.style.height=`${t.height}%`),t.font_size!==void 0&&(c.style.fontSize=`${t.font_size}px`),t.border_radius!==void 0&&(c.style.borderRadius=`${t.border_radius}px`)});if(s===n)return{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."};e.patchCompositionHtml(s);let l=a.map(c=>`${c}=${t[c]}`).join(" ");return{ok:!0,summary:`Updated ${r} visual (${l}).`}}if(t.action_type==="set_layer_media")return cJ(t,e,n,o);if(t.action_type==="set_layer_style")return uJ(t,e,n,o);if(t.action_type==="duplicate_layer")return dJ(t,e,n,o);if(t.action_type==="split_layer")return fJ(t,e,n,o);if(t.action_type==="set_layer_text"){if(t.text===void 0)return{ok:!1,error:"set_layer_text requires a text value."};let i=t.text,a=Zo(n,o,s=>{s.textContent=i});return a===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(a),{ok:!0,summary:`Updated ${r} text.`})}return{ok:!1,error:`Unknown action_type: ${t.action_type??"(none)"}`}}function oJ(t,e,n){let r=t.kind;if(!r)return{ok:!1,error:"add_layer requires a kind (video, image, audio, text, or html)."};if((r==="video"||r==="image"||r==="audio")&&!t.src?.trim())return{ok:!1,error:`add_layer kind=${r} requires src (media URL).`};if(r==="text"&&t.text===void 0)return{ok:!1,error:"add_layer kind=text requires text."};if(r==="html"&&!t.html?.trim())return{ok:!1,error:"add_layer kind=html requires html."};let o=e.activeCompositionDuration>0?e.activeCompositionDuration:0,i=t.start??0,a=Math.max(0,o>0?Math.min(o-.1,i):i),s=o>0?Math.max(.1,o-a):4,l=t.duration??Math.min(4,s),c=Math.max(.1,o>0?Math.min(l,s):l),d=r==="text"?{x:12,y:68,width:76,height:12}:r==="audio"?{x:0,y:0,width:0,height:0}:{x:0,y:0,width:100,height:100},u=Lt(t.x??d.x,0,100),p=Lt(t.y??d.y,0,100),f=Lt(t.width??d.width,0,100),m=Lt(t.height??d.height,0,100),_=t.layer_key?.trim(),h=(_&&/^[A-Za-z][\w-]{0,63}$/.test(_)?_.startsWith("element_")?_:`element_${_}`:null)??`element_${r}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,y=t.label?.trim()||(r==="text"?"New text":r==="html"?"Custom HTML":`New ${r}`);try{let{html:S,resolvedCollisions:E}=Ao(n,R=>{let C=R.querySelector("[data-composition-id]");if(!re(C))throw new Error("Composition root not found.");let I=Array.from(R.querySelectorAll("[data-start]")).filter(V=>re(V)),L=t.track,z=I.reduce((V,st)=>{let nt=Number(st.getAttribute("data-track-index")??0);return Number.isFinite(nt)?Math.max(V,nt+1):V},0),U=Number.isFinite(L)&&L!==void 0?Math.max(0,Math.floor(L)):z,D=zm(R,{start:a,duration:c,track:U},new Set([h])),N;r==="video"?N=R.createElement("video"):r==="image"?N=R.createElement("img"):r==="audio"?N=R.createElement("audio"):N=R.createElement("div"),N.id=h,N.setAttribute("data-hf-id",h),N.setAttribute("data-layer-mode","publish");let B=r==="text"?"caption":r;if(N.setAttribute("data-layer-kind",B),N.setAttribute("data-viral-note",`AI inserted ${r} layer.`),N.setAttribute("data-start",Kt(a)),N.setAttribute("data-duration",Kt(c)),N.setAttribute("data-end",Kt(a+c)),N.setAttribute("data-track-index",String(D)),N.setAttribute("data-label",y),N.classList.add("clip"),t.slug){let V=r0(t.slug);V&&N.setAttribute("data-hf-slug",V)}if(t.note&&t.note.trim()&&N.setAttribute("data-hf-note",t.note.trim()),r!=="audio"?(N.style.position="absolute",N.style.left=`${u}%`,N.style.top=`${p}%`,N.style.width=`${f}%`,N.style.height=`${m}%`,N.style.zIndex=String(D),N.style.overflow="hidden"):N.style.display="none",r==="video"&&t.src){N.setAttribute("src",t.src),N.setAttribute("playsinline",""),N.setAttribute("preload","auto"),t.muted===!1||t.volume!==void 0&&t.volume>0||N.setAttribute("muted",""),N.setAttribute("data-volume",String(t.volume??1));let st=Kt(t.playback_start??0);N.setAttribute("data-media-start",st),N.setAttribute("data-playback-start",st),N.style.objectFit=t.object_fit??"cover",t.object_position&&(N.style.objectPosition=t.object_position),N.style.background="#050604"}else if(r==="image"&&t.src)N.setAttribute("src",t.src),N.style.objectFit=t.object_fit??"cover",t.object_position&&(N.style.objectPosition=t.object_position),t.ken_burns&&t.ken_burns!=="none"&&Pm(N,t.ken_burns,t.ken_burns_intensity);else if(r==="audio"&&t.src){if(N.setAttribute("src",t.src),N.setAttribute("preload","auto"),t.volume!==void 0&&N.setAttribute("data-volume",String(t.volume)),t.playback_start!==void 0){let V=Kt(t.playback_start);N.setAttribute("data-media-start",V),N.setAttribute("data-playback-start",V)}}else r==="text"?(N.setAttribute("data-text-background-style","plain"),N.setAttribute("data-text-background-color",t.background??"#000000"),N.setAttribute("data-font-family","Montserrat"),N.style.display="flex",N.style.alignItems="center",N.style.justifyContent="center",N.style.padding="3px",N.style.boxSizing="border-box",N.style.textAlign="center",N.style.color=t.color??"#ffffff",N.style.background="transparent",N.style.fontFamily="Montserrat, 'TikTok Sans', sans-serif",N.style.fontWeight="600",N.style.fontSize=`${t.font_size??22}px`,N.style.lineHeight="1.2",Q_(N,t.text??"","plain",t.color??"#ffffff",t.background??"#000000","Montserrat",600)):r==="html"&&t.html&&(N.innerHTML=t.html,t.color&&(N.style.color=t.color),t.background&&(N.style.background=t.background),t.font_size!==void 0&&(N.style.fontSize=`${t.font_size}px`));C.append(N)});return e.patchCompositionHtml(S),{ok:!0,summary:Zl(`Added ${r} layer ${h} (start=${a} duration=${c}).`,E)}}catch(S){return{ok:!1,error:S instanceof Error?S.message:String(S)}}}var MU="data:image/svg+xml;charset=utf-8,"+encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='360' height='640' viewBox='0 0 360 640'><rect width='360' height='640' fill='#0c0f0a'/><circle cx='180' cy='300' r='34' fill='none' stroke='#3ad07a' stroke-width='6' stroke-linecap='round' stroke-dasharray='150 60'/><text x='180' y='378' fill='#8ad9a6' font-family='monospace' font-size='20' text-anchor='middle'>Generating\u2026</text></svg>");function iJ(t,e,n){let r=t.media_type==="image"?"image":t.media_type==="video"?"video":null;if(!r)return{ok:!1,error:"generate_layer requires media_type 'video' or 'image'."};let o=t.prompt?.trim();if(!o)return{ok:!1,error:"generate_layer requires a non-empty prompt."};let i=t.intent??(t.replace_layer_key?"replace_layer":"add"),a=t.start,s=t.duration,l=t.track,c=t.x,d=t.y,u=t.width,p=t.height,f=null;if(i==="replace_layer"){let B=(t.replace_layer_key||t.layer_key||"").trim();if(!B)return{ok:!1,error:"generate_layer intent=replace_layer requires replace_layer_key (the layer to replace)."};let V=t6(e,n,B);if(!V)return{ok:!1,error:`generate_layer: layer to replace not found: ${B}`};f=V;let st=new DOMParser().parseFromString(n,"text/html"),nt=Bn(st,V),lt=nt?nt.getAttribute("data-vf-timeline-proxy")!==null||nt.getAttribute("data-vf-full-canvas")==="true"||nt.style.width==="100%"&&nt.style.height==="100%":!1;if(a===void 0&&(a=V.start),s===void 0&&(s=V.duration>0?V.duration:void 0),l===void 0&&(l=V.track),lt)c=0,d=0,u=100,p=100;else if(nt){let X=ct=>{let F=Number.parseFloat(ct);return Number.isFinite(F)?F:void 0};c===void 0&&(c=X(nt.style.left)),d===void 0&&(d=X(nt.style.top)),u===void 0&&(u=X(nt.style.width)),p===void 0&&(p=X(nt.style.height))}}let m=f?f.hfId||f.id:null,_=t.layer_key?.trim(),v=_&&_!==m&&/^[A-Za-z][\w-]{0,63}$/.test(_)?_:`vf-gen-${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,h=v.startsWith("element_")?v:`element_${v}`,y=e.activeCompositionDuration>0?e.activeCompositionDuration:0,S=a??0,E=Math.max(0,y>0?Math.min(y-.1,S):S),R=y>0?Math.max(.1,y-E):4,C=s??Math.min(r==="video"?t.gen_duration??4:4,R),I=Math.max(.1,y>0?Math.min(C,R):C),L=Lt(c??0,0,100),z=Lt(d??0,0,100),U=Lt(u??100,0,100),D=Lt(p??100,0,100),N=o.length>140?`${o.slice(0,137)}\u2026`:o;try{let{html:B,resolvedCollisions:V}=Ao(n,nt=>{let lt=nt.querySelector("[data-composition-id]");if(!re(lt))throw new Error("Composition root not found.");if(f){let dt=Bn(nt,f);dt?.parentNode&&dt.parentNode.removeChild(dt)}let X=l,ct=Array.from(nt.querySelectorAll("[data-start]")).reduce((dt,Xt)=>{let Ce=Number(Xt.getAttribute("data-track-index")??0);return Number.isFinite(Ce)?Math.max(dt,Ce+1):dt},0),F=Number.isFinite(X)&&X!==void 0?Math.max(0,Math.floor(X)):ct,gt=zm(nt,{start:E,duration:I,track:F},new Set([h])),J=r==="video"?nt.createElement("video"):nt.createElement("img");if(J.id=h,J.setAttribute("data-hf-id",h),J.setAttribute("data-layer-mode","publish"),J.setAttribute("data-layer-kind",r),J.setAttribute("data-viral-note",`AI generating ${r}: ${N}`),J.setAttribute("data-start",Kt(E)),J.setAttribute("data-duration",Kt(I)),J.setAttribute("data-end",Kt(E+I)),J.setAttribute("data-track-index",String(gt)),J.setAttribute("data-label",`Generating ${r}\u2026`),J.classList.add("clip"),t.slug){let dt=r0(t.slug);dt&&J.setAttribute("data-hf-slug",dt)}J.setAttribute("data-vf-gen","1"),J.setAttribute("data-vf-gen-media",r),J.setAttribute("data-vf-gen-status","submitting"),J.setAttribute("data-vf-gen-prompt",N),J.style.position="absolute",J.style.left=`${L}%`,J.style.top=`${z}%`,J.style.width=`${U}%`,J.style.height=`${D}%`,J.style.zIndex=String(gt),J.style.overflow="hidden",J.style.objectFit=t.object_fit??"cover",J.style.background="#0c0f0a",r==="video"?(J.setAttribute("poster",MU),J.setAttribute("playsinline",""),J.setAttribute("preload","auto"),J.setAttribute("muted",""),J.setAttribute("data-volume","1"),J.setAttribute("data-media-start","0"),J.setAttribute("data-playback-start","0")):(J.setAttribute("src",MU),t.ken_burns&&t.ken_burns!=="none"&&Pm(J,t.ken_burns,t.ken_burns_intensity)),lt.append(J)});e.patchCompositionHtml(B),aJ({deps:e,genId:h,mediaType:r,prompt:o,action:t});let st=i==="replace_layer"?`replacing ${m}`:`at ${E.toFixed(2)}s`;return{ok:!0,summary:Zl(`Started ${r} generation (${st}). A placeholder is on the timeline as ${v}; it will swap to the finished media automatically. Watch editor_context.pending_generations.`,V)}}catch(B){return{ok:!1,error:B instanceof Error?B.message:String(B)}}}function Mm(t,e,n){let r=t.compositionHtmlRef.current;if(!r)return!1;let o=e.replace(/["\\]/g,"\\$&"),i=new DOMParser().parseFromString(r,"text/html"),a=i.querySelector(`[data-hf-id="${o}"]`);return re(a)?(n(a),t.patchCompositionHtml(Z_(i)),!0):!1}async function aJ(t){let{deps:e,genId:n,mediaType:r,prompt:o,action:i}=t,a=r==="video"?"/api/v1/primitives/videos/generate":"/api/v1/primitives/images/generate",s=i.aspect_ratio?.trim(),l=i.provider?.trim(),c=i.model?.trim(),d=(i.input_references??[]).filter(m=>typeof m=="string"&&/^https?:\/\//i.test(m)),u=(i.prompt_attachments??[]).filter(m=>typeof m=="string"&&/^https?:\/\//i.test(m)),p={prompt:o};s&&(p.aspect_ratio=s),l&&(p.provider=l),c&&(p.model=c),r==="video"?(i.gen_duration&&Number.isFinite(i.gen_duration)&&(p.duration=Math.round(i.gen_duration)),i.resolution&&(p.resolution=i.resolution),i.generate_audio!==void 0&&(p.generate_audio=i.generate_audio),d.length&&(p.input_references=d.slice(0,8))):u.length&&(p.prompt_attachments=u.slice(0,16));let f=`editor-gen-${Date.now().toString(36)}`;try{let m=await fetch(a,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tracer:f,payload:p})}),_=await m.json().catch(()=>({}));if(!m.ok||!_.job_id){let v=_.error||`generation request failed (${m.status})`;Mm(e,n,h=>{h.setAttribute("data-vf-gen-status","error"),h.setAttribute("data-vf-gen-error",v.slice(0,200))});return}Mm(e,n,v=>{v.setAttribute("data-vf-gen-job",_.job_id),v.setAttribute("data-vf-gen-tracer",f),v.setAttribute("data-vf-gen-status","generating")})}catch(m){Mm(e,n,_=>{_.setAttribute("data-vf-gen-status","error"),_.setAttribute("data-vf-gen-error",(m instanceof Error?m.message:String(m)).slice(0,200))})}}function sJ(t){if(!t)return null;let e=l=>typeof l=="string"&&l.trim()?l.trim():null,n=l=>l&&typeof l=="object"?l:null,r=n(t.result)??{},o=n(r.output)??r,i=e(o.primary_file_url)??e(n(o.video)?.file_url)??e(n(o.image)?.file_url)??e(n(o.render)?.output_url);if(i)return i;let a=o.files;if(Array.isArray(a))for(let l of a){let c=e(typeof l=="string"?l:n(l)?.file_url??n(l)?.url);if(c)return c}let s=Array.isArray(t.artifacts)?t.artifacts:[];for(let l of s){let c=e(n(l)?.public_url);if(c)return c}return null}function lJ(t,e,n){return Mm(t,e,r=>{let o=r.getAttribute("data-vf-gen-media");r.setAttribute("src",n),r.removeAttribute("poster"),r.removeAttribute("data-vf-gen"),r.removeAttribute("data-vf-gen-media"),r.removeAttribute("data-vf-gen-prompt"),r.removeAttribute("data-vf-gen-job"),r.removeAttribute("data-vf-gen-tracer"),r.removeAttribute("data-vf-gen-error"),r.removeAttribute("data-vf-gen-status");let i=r.getAttribute("data-label");i&&/generating/i.test(i)&&r.setAttribute("data-label",o==="image"?"AI image":"AI video"),r.setAttribute("data-viral-note",`AI generated ${o==="image"?"image":"video"}.`)})}function cJ(t,e,n,r){let o=[],i=Zo(n,r,a=>{if(t.src!==void 0&&(a.setAttribute("src",t.src),o.push(`src=${t.src.slice(0,60)}`)),t.volume!==void 0&&(a.setAttribute("data-volume",String(t.volume)),o.push(`volume=${t.volume}`)),t.muted!==void 0&&(t.muted?a.setAttribute("muted",""):a.removeAttribute("muted"),o.push(`muted=${t.muted}`)),t.playback_start!==void 0){let s=Kt(t.playback_start);a.setAttribute("data-media-start",s),a.setAttribute("data-playback-start",s),o.push(`playback_start=${s}`)}t.object_fit&&(a.style.objectFit=t.object_fit,o.push(`object_fit=${t.object_fit}`)),t.object_position&&(a.style.objectPosition=t.object_position,o.push(`object_position=${t.object_position}`)),t.ken_burns!==void 0&&(Pm(a,t.ken_burns==="none"?null:t.ken_burns,t.ken_burns_intensity),o.push(`ken_burns=${t.ken_burns}`))});return o.length===0?{ok:!1,error:"set_layer_media needs at least one of src, volume, muted, playback_start, object_fit, object_position, or ken_burns."}:i===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(i),{ok:!0,summary:`Updated ${r.id} media (${o.join(" ")}).`})}function uJ(t,e,n,r){let o=[],i=Zo(n,r,a=>{if(t.color){a.style.color=t.color;let s=a.querySelector("[data-vf-text-inline]");s&&(s.style.color=t.color),o.push(`color=${t.color}`)}if(t.background_style||t.background!==void 0){let s=t.background_style??a.getAttribute("data-text-background-style")??"plain",l=t.background??a.getAttribute("data-text-background-color")??"#000000";a.setAttribute("data-text-background-style",s),a.setAttribute("data-text-background-color",l),o.push(`background=${l}(${s})`)}t.font_family&&(a.setAttribute("data-font-family",t.font_family),a.style.fontFamily=`${t.font_family}, 'TikTok Sans', sans-serif`,o.push(`font_family=${t.font_family}`)),t.font_weight!==void 0&&(a.style.fontWeight=String(t.font_weight),o.push(`font_weight=${t.font_weight}`)),t.italic!==void 0&&(a.style.fontStyle=t.italic?"italic":"normal",o.push(`italic=${t.italic}`)),t.underline!==void 0&&(a.style.textDecorationLine=t.underline?"underline":"none",o.push(`underline=${t.underline}`)),t.text_align&&(a.style.textAlign=t.text_align,o.push(`text_align=${t.text_align}`)),t.border_radius!==void 0&&(a.style.borderRadius=`${t.border_radius}px`,o.push(`border_radius=${t.border_radius}`)),t.font_size!==void 0&&(a.style.fontSize=`${t.font_size}px`,o.push(`font_size=${t.font_size}`))});return o.length===0?{ok:!1,error:"set_layer_style needs at least one style field."}:i===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(i),{ok:!0,summary:`Updated ${r.id} style (${o.join(" ")}).`})}function dJ(t,e,n,r){let o=t.layer_keys?.[1]?.trim(),a=(o&&/^[A-Za-z][\w-]{0,63}$/.test(o)?o.startsWith("element_")?o:`element_${o}`:null)??`element_dup_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`;try{let{html:s,resolvedCollisions:l}=Ao(n,c=>{let d=Bn(c,r);if(!d)throw new Error(`Layer node not found: ${r.id}`);let u=d.cloneNode(!0);u.id=a,u.setAttribute("data-hf-id",a),t.start!==void 0&&u.setAttribute("data-start",Kt(t.start)),t.duration!==void 0&&u.setAttribute("data-duration",Kt(t.duration)),t.label&&u.setAttribute("data-label",t.label);let p=Number(u.getAttribute("data-start")??r.start),f=Number(u.getAttribute("data-duration")??r.duration),m=t.track!==void 0?Math.max(0,Math.floor(t.track)):r.track,_=zm(c,{start:p,duration:f,track:m},new Set([r.hfId,r.domId,r.id,a].filter(v=>!!v)));u.setAttribute("data-track-index",String(_)),d.after(u)});return s===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(s),{ok:!0,summary:Zl(`Duplicated ${r.id} as ${a}.`,l)})}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}}function fJ(t,e,n,r){let o=t.split_time;if(o===void 0)return{ok:!1,error:"split_layer requires split_time."};if(o<=r.start||o>=r.start+r.duration)return{ok:!1,error:"split_time must fall inside the layer's [start, start+duration] range."};let i=`element_split_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`;try{let a=Zo(n,r,s=>{let l=Number(s.getAttribute("data-start")??r.start),c=Number(s.getAttribute("data-duration")??r.duration),d=o-l,u=l+c-o,p=Number(s.getAttribute("data-playback-start")??s.getAttribute("data-media-start")??r.playbackStart??0),f=Kt(p+d),m=s.getAttribute("data-layer-kind")??"layer";s.setAttribute("data-duration",Kt(d));let _=s.cloneNode(!0);_.id=i,_.setAttribute("data-hf-id",i),_.setAttribute("data-start",Kt(o)),_.setAttribute("data-duration",Kt(u)),_.setAttribute("data-media-start",f),_.setAttribute("data-playback-start",f),_.setAttribute("data-layer-kind",m),_.setAttribute("data-label",`${r.label??r.id} split`),s.after(_)});return a===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(a),{ok:!0,summary:`Split ${r.id} at ${o}; new layer ${i}.`})}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}function pJ(t,e,n){let r=(t.layer_keys??[]).filter(c=>typeof c=="string"&&c.trim().length>0);if(r.length<2)return{ok:!1,error:"group_layers requires layer_keys with at least two entries."};let o=r.map(c=>e.draftedElements.find(d=>Nt(d)===c)).filter(c=>!!c);if(o.length!==r.length)return{ok:!1,error:"One or more layer_keys not found in the composition."};let i=`vf-group-${Date.now().toString(36)}`,a=t.group_label?.trim()||"Vidfarm group",{html:s,resolvedCollisions:l}=Ao(n,c=>{for(let d of o){let u=Bn(c,d);u&&(u.setAttribute("data-vf-group",i),u.setAttribute("data-vf-group-label",a))}});return s===n?{ok:!1,error:"No change applied \u2014 layers not found."}:(e.patchCompositionHtml(s),{ok:!0,summary:Zl(`Grouped ${o.length} layers as ${i}.`,l)})}function mJ(t,e,n){let r=(t.layer_keys??[]).filter(s=>typeof s=="string"&&s.trim().length>0);if(r.length===0)return{ok:!1,error:"ungroup_layers requires layer_keys."};let o=r.map(s=>e.draftedElements.find(l=>Nt(l)===s)).filter(s=>!!s);if(o.length===0)return{ok:!1,error:"No matching layers found for ungroup_layers."};let{html:i,resolvedCollisions:a}=Ao(n,s=>{let l=new Set;for(let c of o){let u=Bn(s,c)?.getAttribute("data-vf-group");u&&l.add(u)}for(let c of l)for(let d of Array.from(s.querySelectorAll(`[data-vf-group="${CSS.escape(c)}"]`)))re(d)&&(d.removeAttribute("data-vf-group"),d.removeAttribute("data-vf-group-label"))});return i===n?{ok:!1,error:"No change applied \u2014 layers were not grouped."}:(e.patchCompositionHtml(i),{ok:!0,summary:Zl(`Ungrouped ${o.length} layers.`,a)})}function gJ(t){if(!t||typeof t!="object")return null;let e=t,n=e.action_type;if(typeof n!="string"||!["add_layer","remove_layer","set_layer_timing","set_layer_visual","set_layer_text","set_layer_media","set_layer_style","set_layer_identity","duplicate_layer","split_layer","group_layers","ungroup_layers","replace_composition_html","generate_layer"].includes(n))return null;let o=v=>typeof e[v]=="string"?e[v]:void 0,i=v=>typeof e[v]=="number"&&Number.isFinite(e[v])?e[v]:void 0,a=v=>typeof e[v]=="boolean"?e[v]:void 0,s=v=>Array.isArray(e[v])?e[v].filter(h=>typeof h=="string"):void 0,l=e.kind,c=l==="video"||l==="image"||l==="audio"||l==="text"||l==="html"?l:void 0,d=e.background_style,u=d==="plain"||d==="outline"||d==="highlight-solid"||d==="highlight-translucent"||d==="fullwidth"?d:void 0,p=e.media_type,f=p==="video"||p==="image"?p:void 0,m=e.intent,_=m==="fill_gap"||m==="replace_layer"||m==="add"?m:void 0;return{action_type:n,layer_key:o("layer_key"),layer_keys:s("layer_keys"),kind:c,src:o("src"),html:o("html"),label:o("label"),start:i("start"),duration:i("duration"),track:i("track"),playback_start:i("playback_start"),split_time:i("split_time"),x:i("x"),y:i("y"),width:i("width"),height:i("height"),font_size:i("font_size"),font_family:o("font_family"),font_weight:i("font_weight"),italic:a("italic"),underline:a("underline"),text_align:o("text_align"),border_radius:i("border_radius"),color:o("color"),background:o("background"),background_style:u,object_fit:o("object_fit"),object_position:o("object_position"),ken_burns:o("ken_burns"),ken_burns_intensity:i("ken_burns_intensity"),slug:o("slug"),note:o("note"),volume:i("volume"),muted:a("muted"),group_label:o("group_label"),text:o("text"),composition_html:o("composition_html"),explanation:o("explanation"),media_type:f,intent:_,prompt:o("prompt"),input_references:s("input_references"),prompt_attachments:s("prompt_attachments"),aspect_ratio:o("aspect_ratio"),gen_duration:i("gen_duration"),provider:o("provider"),model:o("model"),resolution:o("resolution"),generate_audio:a("generate_audio"),replace_layer_key:o("replace_layer_key")}}function hJ(t){try{return JSON.stringify(t,null,2)}catch{return String(t)}}function bJ({item:t}){let[e,n]=(0,A.useState)(0);if(t.media.type==="slideshow"){let r=t.media.slides.length,o=i=>{n((i+r)%r)};return(0,g.jsx)("div",{className:"document-video-block slideshow-preview-block",children:(0,g.jsxs)("div",{className:"document-video-stage slideshow-preview-stage",children:[(0,g.jsxs)("div",{className:"slideshow-preview-stack",children:[(0,g.jsx)("button",{type:"button",className:"carousel-nav previous","aria-label":"Previous slide",onClick:()=>o(e-1),children:"\u2039"}),(0,g.jsx)("img",{src:t.media.slides[e],alt:`Slide ${e+1}`}),(0,g.jsx)("button",{type:"button",className:"carousel-nav next","aria-label":"Next slide",onClick:()=>o(e+1),children:"\u203A"}),(0,g.jsxs)("span",{className:"carousel-count",children:[e+1," / ",r]})]}),(0,g.jsx)("div",{className:"slideshow-thumb-strip","aria-label":"Slides",children:t.media.slides.map((i,a)=>(0,g.jsx)("button",{type:"button",className:e===a?"active":"","aria-label":`Show slide ${a+1}`,onClick:()=>n(a),children:(0,g.jsx)("img",{src:i,alt:""})},i))})]})})}return(0,g.jsx)("div",{className:"document-video-block repeated-video-block",children:(0,g.jsx)("div",{className:"document-video-stage",children:(0,g.jsx)("video",{src:t.media.src,controls:!0,playsInline:!0,preload:"metadata",onLoadedMetadata:r=>{let o=r.currentTarget;xt("preview.video.loaded-metadata",{id:t.id,currentSrc:o.currentSrc,duration:o.duration,videoWidth:o.videoWidth,videoHeight:o.videoHeight})},onError:r=>{let o=r.currentTarget;xo("preview.video.error",{id:t.id,currentSrc:o.currentSrc,errorCode:o.error?.code,errorMessage:o.error?.message})}})})})}function yJ({onEdit:t}){return(0,g.jsx)("div",{className:"preview-feed","aria-label":"Preview output",children:Um.map(e=>{let n=[["Hook",e.viralDna.hook],["Retention",e.viralDna.retention],["Payoff",e.viralDna.payoff]];return(0,g.jsxs)("article",{className:"preview-feed-card",children:[(0,g.jsxs)("header",{className:"markdown-preview-header",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{children:e.eyebrow}),(0,g.jsx)("h1",{children:e.title})]}),(0,g.jsx)("div",{className:"markdown-preview-actions",children:(0,g.jsx)("button",{type:"button",className:"main-action-button",title:"Edit composition",onClick:()=>{xt("preview.edit-click",{id:e.id}),t(e)},children:"Edit"})})]}),(0,g.jsxs)("div",{className:"preview-feed-body",children:[(0,g.jsx)("div",{className:"preview-feed-spacer","aria-hidden":"true"}),(0,g.jsx)("section",{className:"preview-video-column","aria-label":"Reference render",children:(0,g.jsx)(bJ,{item:e})}),(0,g.jsxs)("aside",{className:"preview-detail-scroll","aria-label":"Preview details",children:[(0,g.jsxs)("section",{className:"markdown-section hero-section",children:[(0,g.jsx)("h2",{children:"Reference Render"}),(0,g.jsx)("p",{children:e.summary})]}),(0,g.jsxs)("section",{className:"markdown-section",children:[(0,g.jsx)("h2",{children:"Viral DNA"}),n.map(([r,o])=>(0,g.jsxs)("section",{className:"markdown-subsection",children:[(0,g.jsx)("h3",{children:r}),(0,g.jsx)("p",{children:o})]},r))]}),(0,g.jsxs)("section",{className:"markdown-section",children:[(0,g.jsx)("h2",{children:"Preserve"}),(0,g.jsx)("ul",{children:e.viralDna.preserve.map(r=>(0,g.jsx)("li",{children:r},r))})]}),(0,g.jsxs)("section",{className:"markdown-section",children:[(0,g.jsx)("h2",{children:"Avoid"}),(0,g.jsx)("ul",{children:e.viralDna.avoid.map(r=>(0,g.jsx)("li",{children:r},r))})]}),(0,g.jsxs)("section",{className:"markdown-section",children:[(0,g.jsx)("h2",{children:"Semantic Layers"}),(0,g.jsx)("div",{className:"markdown-layer-list",children:m1(e).map(r=>(0,g.jsxs)("article",{className:"markdown-layer-row",children:[(0,g.jsx)("span",{children:fX(r.kind,r.customHtml)}),(0,g.jsxs)("div",{children:[(0,g.jsx)("h3",{children:r.label}),(0,g.jsx)("p",{children:r.viralNote})]}),(0,g.jsxs)("time",{children:[X_(r.start)," - ",X_(r.start+r.duration)]})]},r.id))})]})]})]})]},e.id)})})}function _J({onPreview:t,composition:e}){let[n,r]=(0,A.useState)(null),[o,i]=(0,A.useState)(null),[a,s]=(0,A.useState)(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("fork")),[l,c]=(0,A.useState)(null),d=(0,A.useMemo)(()=>qU(e),[e]),u=(0,A.useRef)(null);(0,A.useEffect)(()=>{let f=!0;return xt("editor.studio-import-start"),W_().then(m=>{xt("editor.studio-import-success",{exports:Object.keys(m).sort()}),f&&r(m)}).catch(m=>{xo("editor.studio-import-error",m instanceof Error?m.stack:m),f&&i(m instanceof Error?m.message:String(m))}),()=>{f=!1,xt("editor.studio-import-cleanup")}},[]),(0,A.useEffect)(()=>{let f=!0,m=a?`/api/v1/compositions/${encodeURIComponent(a)}/composition.html`:`/editor/${encodeURIComponent(e.id)}/composition`;return fetch(m,{cache:"default"}).then(_=>_.ok?_.text():null).then(_=>{f&&c(Xl(_??d))}).catch(()=>{f&&c(Xl(d))}),()=>{f=!1}},[e.id,d,a]),(0,A.useEffect)(()=>{!n||!l||n.usePlayerStore.getState().reset()},[l,n]);let p=(0,A.useCallback)(async()=>{if(a)return a;if(u.current)return u.current;let f=(async()=>{let m=await fetch("/api/v1/compositions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:e.id,title:e.title})}),_=await m.json().catch(()=>({}));if(!m.ok||!_?.fork_id)throw new Error(_?.error||`Fork creation failed (${m.status})`);if(s(_.fork_id),typeof window<"u"){let v=new URL(window.location.href);v.searchParams.set("fork",_.fork_id),window.history.replaceState(null,"",v)}return _.fork_id})();u.current=f;try{return await f}finally{u.current=null}},[e.id,e.title,a]);return o?(0,g.jsxs)("section",{className:"editor-loading-shell","aria-label":"Editor load failed",children:[(0,g.jsx)("span",{children:"Editor failed to load"}),(0,g.jsx)("small",{children:o})]}):!n||!l?(0,g.jsx)("section",{className:"editor-loading-shell","aria-label":"Loading video editor",children:(0,g.jsx)("span",{children:"Loading editor"})}):(0,g.jsx)(vJ,{studio:n,onPreview:t,composition:e,initialCompositionHtml:l,forkId:a,ensureFork:p,replaceForkId:s})}function vJ({studio:t,onPreview:e,composition:n,initialCompositionHtml:r,forkId:o,ensureFork:i,replaceForkId:a}){let{Player:s,Timeline:l,liveTime:c,resolveIframe:d,usePlayerStore:u,useTimelinePlayer:p}=t,f=GU(n),[m,_]=(0,A.useState)(()=>r),v=(0,A.useMemo)(()=>{let b=YU(m);return b?{...n,viralDna:b}:n},[n,m]),h=(0,A.useRef)(m),[y,S]=(0,A.useState)(0),[E,R]=(0,A.useState)(!0),[C,I]=(0,A.useState)("1"),[L,z]=(0,A.useState)(null),[U,D]=(0,A.useState)(null),N=(0,A.useRef)(null),B=(0,A.useRef)(null),[V,st]=(0,A.useState)(null),[nt,lt]=(0,A.useState)(()=>new Map),[X,ct]=(0,A.useState)(()=>new Map),[F,gt]=(0,A.useState)(null),[J,dt]=(0,A.useState)(null),[Xt,Ce]=(0,A.useState)(!1),[_n,Pn]=(0,A.useState)(!1),[Z,Vt]=(0,A.useState)(null);(0,A.useEffect)(()=>{if(!o){Vt(null);return}let b=!0;return fetch(`/api/v1/compositions/${encodeURIComponent(o)}`).then(T=>T.ok?T.json():null).then(T=>{if(!b||!T)return;let x=Number(T.latest_version);Number.isFinite(x)&&Vt(x)}).catch(()=>{}),()=>{b=!1}},[o,F?.version]);let[Ut,ft]=(0,A.useState)(0),[te,mt]=(0,A.useState)(!1),oe=(0,A.useRef)(null),Qt=(0,A.useRef)(null),cn=(0,A.useRef)(null),un=(0,A.useRef)(null),He=(0,A.useRef)(null),dn=(0,A.useRef)(null),ut=(0,A.useRef)(0),Ft=(0,A.useRef)(0),yt=(0,A.useRef)(-1),kt=(0,A.useRef)(null),bt=(0,A.useRef)(!1),K=(0,A.useRef)([]),vt=(0,A.useRef)([]),Ht=(0,A.useRef)(null),fn=(0,A.useRef)({timing:()=>{},visual:()=>{},flushAll:()=>{}}),Ct=(0,A.useRef)(null),Gd=(0,A.useRef)(!1),tc=(0,A.useRef)(!1),Fm=(0,A.useRef)(null),$d=(0,A.useRef)({active:!1,pendingBody:null,pendingRevBump:!1});(0,A.useEffect)(()=>{let b=`comp:${n.id}`;Fm.current!==b&&TX(m)&&(Fm.current=b,dt({mode:"initial",dismissed:!1,busy:!1,finished:!1,error:null,scenesCreated:null,ghostcutStatus:null,ghostcutProgress:null,userPrompt:""}))},[n.id,m]);let G=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||G.current===o)return;G.current=o;let b=!1;return(async()=>{let T=Date.now(),x=900*1e3;for(await new Promise(k=>setTimeout(k,3e3));!b&&Date.now()-T<x;){try{let k=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/remove-video-captions-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),O=await k.json().catch(()=>({}));if(!k.ok||O?.ok===!1){await new Promise(H=>setTimeout(H,8e3));continue}let M=O.status??"none";if(M==="none"||M==="failed")return;if(M==="pending"&&dt(H=>H&&{...H,ghostcutStatus:"pending"}),M==="done"){O.swap_applied&&typeof window<"u"&&window.location.reload();return}}catch{}await new Promise(k=>setTimeout(k,2e4))}})(),()=>{b=!0,G.current=null}},[o]);let jt=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||jt.current===o)return;jt.current=o;let b=!1,T=async()=>{try{let x=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/cast.json`),k=await x.json().catch(()=>({}));return!x.ok||k?.ok===!1?null:(Array.isArray(k.cast)&&(h0.current=k.cast),k.status??"none")}catch{return null}};return(async()=>{let x=Date.now(),k=600*1e3;await new Promise(M=>setTimeout(M,3e3));let O=await T();if(!(O==="none"||O==="done"||O==="failed"))for(;!b&&Date.now()-x<k;){try{let M=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/cast-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),H=await M.json().catch(()=>({}));if(!M.ok||H?.ok===!1){await new Promise(it=>setTimeout(it,6e3));continue}await T();let Y=H.status??"none";if(Y==="none"||Y==="done"||Y==="failed")return}catch{}await new Promise(M=>setTimeout(M,4e3))}})(),()=>{b=!0,jt.current=null}},[o]);let kr=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||kr.current===o)return;kr.current=o;let b=!1;return(async()=>{let T=Date.now(),x=300*1e3;await new Promise(k=>setTimeout(k,3e3));try{let k=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/scene-annotations.json`),O=await k.json().catch(()=>({}));if(k.ok&&(O.status==="none"||O.status==="done"||O.status==="failed"))return}catch{}for(;!b&&Date.now()-T<x;){try{let k=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/scene-annotations-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),O=await k.json().catch(()=>({}));if(!k.ok||O?.ok===!1){await new Promise(H=>setTimeout(H,6e3));continue}let M=O.status??"none";if(M==="none"||M==="done"||M==="failed")return}catch{}await new Promise(k=>setTimeout(k,4e3))}})(),()=>{b=!0,kr.current=null}},[o]);let ko=(0,A.useCallback)(async()=>{dt(k=>k&&{...k,busy:!0,error:null});let b=J?.userPrompt?.trim()??"",T=async k=>{let O=await fetch(`/api/v1/compositions/${encodeURIComponent(k)}/auto-decompose`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(b?{user_prompt:b}:{})}),M=await O.json().catch(()=>({}));return{response:O,data:M}},x=async k=>{let O=Date.now(),M=600*1e3;for(;Date.now()-O<M;){await new Promise(H=>setTimeout(H,2e4));try{let H=await fetch(`/api/v1/compositions/${encodeURIComponent(k)}/remove-video-captions-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),Y=await H.json().catch(()=>({}));if(!H.ok||Y?.ok===!1)continue;let it=Y.status??"none",Q=typeof Y.progress=="number"?Y.progress:null;if(dt(_t=>_t&&{..._t,ghostcutStatus:it,ghostcutProgress:Q}),it==="done"||it==="failed"||it==="none")return}catch{}}};try{let k=o??await i(),{response:O,data:M}=await T(k);if(O.status===404||/fork not found/i.test(M?.error||"")){let Q=await fetch("/api/v1/compositions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:n.id,title:n.title})}),_t=await Q.json().catch(()=>({}));if(!Q.ok||!_t?.fork_id)throw new Error(_t?.error||`Fork creation failed (${Q.status})`);if(k=_t.fork_id,a(k),typeof window<"u"){let St=new URL(window.location.href);St.searchParams.set("fork",k),window.history.replaceState(null,"",St)}({response:O,data:M}=await T(k))}if(!O.ok||!M?.ok)throw new Error(M?.error||`Decompose failed (${O.status})`);let Y=typeof M.scene_count=="number"&&Number.isFinite(M.scene_count)?M.scene_count:null,it=M.ghostcut_pending?"pending":"none";dt(Q=>Q&&{...Q,busy:!1,finished:!0,error:null,scenesCreated:Y,ghostcutStatus:it,ghostcutProgress:null}),M.ghostcut_pending&&x(k)}catch(k){let O=k instanceof Error?k.message:String(k);dt(M=>M&&{...M,busy:!1,error:O})}},[i,o,n.id,n.title,a,J?.userPrompt]),Me=(0,A.useCallback)(()=>{dt(null),typeof window<"u"&&window.location.reload()},[]),o0=(0,A.useCallback)(()=>{dt(null)},[]),r6=(0,A.useCallback)(()=>{dt(b=>b&&{...b,dismissed:!0})},[]),o6=(0,A.useCallback)(()=>{dt(b=>b&&{...b,dismissed:!1})},[]),i6=(0,A.useCallback)(async()=>{try{o||await i()}catch{}dt({mode:"redo",dismissed:!1,busy:!1,finished:!1,error:null,scenesCreated:null,ghostcutStatus:null,ghostcutProgress:null,userPrompt:""})},[i,o]),a6=(0,A.useCallback)(async()=>{if(!o)try{await i()}catch{}Ce(!0)},[i,o]),s6=(0,A.useCallback)(()=>{o&&Pn(!0)},[o]),l6=(0,A.useCallback)(()=>{Pn(!1),typeof window<"u"&&window.location.reload()},[]),_1=o?`/composition/current.html?fork=${encodeURIComponent(o)}&rev=${y}`:`/composition/current.html?composition=${encodeURIComponent(n.id)}&rev=${y}`,{iframeRef:Hm,onIframeLoad:c6,resetPlayer:v1}=p(),ec=u(b=>b.selectedElementId),i0=u(b=>b.selectedElementIds),nc=u(b=>b.elements),S1=u(b=>b.timelineReady),u6=u(b=>b.isPlaying),Io=(0,A.useMemo)(()=>nc.map(b=>{let T=Nt(b);return IU(b,nt.get(T))}),[nc,nt]),E1=(0,A.useMemo)(()=>o1(Io),[Io]),a0=E1.length>0&&S1,[d6,f6]=(0,A.useState)(0),[p6,m6]=(0,A.useState)(0);(0,A.useEffect)(()=>{if(!a0)return;let b=cn.current?.querySelector('[aria-label="Timeline"]'),T=b?.firstElementChild instanceof HTMLElement?b.firstElementChild:null;if(!T)return;let x=()=>{f6(T.scrollTop),m6(T.scrollLeft)};return x(),T.addEventListener("scroll",x,{passive:!0}),()=>T.removeEventListener("scroll",x)},[a0]);let vn=Io.find(b=>Nt(b)===ec)??null,g6=vn?nt.get(Nt(vn)):void 0,T1=vn?X.get(Nt(vn))?.frame:void 0,h6=Ut>=0&&K.current.length>0,b6=Ut>=0&&vt.current.length>0,rc=F?.phase==="starting"||F?.phase==="running",y6=rc?"Rendering":"Render",_6=(0,A.useMemo)(()=>{let b=zd();return b?.localRender&&b?.cloudRenderAvailable?[{key:"local",label:"Render Local (Free)",hint:"Render in-process on this machine \u2014 no cloud charge"},{key:"cloud",label:"Render in Cloud",hint:"Render on the cloud account \u2014 billed to its wallet"}]:null},[]),Gm=(0,A.useMemo)(()=>new Set([...ec?[ec]:[],...Array.from(i0)]),[ec,i0]),v6=(0,A.useMemo)(()=>{if(Gm.size===0)return!1;let b=e0(m);return nc.some(T=>Gm.has(Nt(T))&&EU(b,T))},[m,nc,Gm]),Sn=(0,A.useCallback)(()=>{cancelAnimationFrame(ut.current),ut.current=0,Ft.current=0,yt.current=-1},[]);(0,A.useEffect)(()=>{if(!Gd.current){Gd.current=!0;return}v1(),Sn(),R(!0),I("1"),z(null),D(null),lt(new Map),ct(new Map),gt(null),mt(!1),K.current=[],vt.current=[],Ht.current=null,kt.current=null,bt.current=!1,un.current=null,He.current=null;let b=qU(n);h.current=b,_(b),S(T=>T+1),ft(T=>T+1)},[n.id,n,v1,Sn]);let oc=(0,A.useCallback)(()=>{ft(b=>b+1)},[]),ic=(0,A.useCallback)(()=>{let b=u.getState();return{html:h.current,time:b.currentTime,selectedElementId:b.selectedElementId,selectedElementIds:Array.from(b.selectedElementIds)}},[u]),or=(0,A.useCallback)(b=>{let T=K.current,x=Date.now(),k=Ht.current;Ht.current=b?{key:b,at:x}:null;let O=ic();!!!(b&&k&&k.key===b&&x-k.at<1200&&T.length>0)&&T[T.length-1]?.html!==O.html&&(K.current=[...T.slice(-49),O]),vt.current=[],oc()},[oc,ic]),It=(0,A.useCallback)(()=>{let b=d(dn.current);return b?(Hm.current=b,b):Hm.current},[Hm,d]),w1=(0,A.useCallback)(b=>{if(!b)return It();for(let T of Array.from(document.querySelectorAll("iframe")))if(T.contentWindow===b)return T;return It()},[It]),x1=(0,A.useCallback)((b,T)=>{let x=It()?.getBoundingClientRect(),k=Qt.current?.getBoundingClientRect(),O=x&&x.width>1&&x.height>1?x:k;if(!O)return{x:12,y:70,width:42,height:12};let M=(b-O.left)/Math.max(1,O.width)*100,H=(T-O.top)/Math.max(1,O.height)*100,Y=Lt(M,0,95),it=Lt(H,0,95);return{x:Y,y:it,width:Lt(42,1,100-Y),height:Lt(12,1,100-it)}},[It]),$m=(0,A.useCallback)(b=>{z(null),D(b)},[]),S6=(0,A.useCallback)(b=>{let T=b.target;if(T instanceof Element&&T.closest("button,input,textarea,select,a"))return;b.preventDefault(),b.stopPropagation();let x=u.getState();x.clearSelectedElementIds(),x.setSelectedElementId(null),$m({x:b.clientX,y:b.clientY,time:x.currentTime,frame:x1(b.clientX,b.clientY),elementId:null}),xt("editor.preview-stage-context-menu",{x:b.clientX,y:b.clientY,time:x.currentTime})},[x1,$m,u]),E6=(0,A.useCallback)(b=>{if(b.button!==0)return;let T=b.target;if(!(T instanceof Element)||T.closest("button,input,textarea,select,a,.canvas-frame-overlay")||T.closest("iframe"))return;let x=u.getState();x.setSelectedElementId(null),x.clearSelectedElementIds(),D(null),xt("editor.preview-blank-unselect")},[u]),s0=(0,A.useCallback)(()=>{let b=Cs(It());if(!b)return;let T=b.getTime(),x=b.getDuration(),k=x>0&&T>=x,O=b.isPlaying()&&!k,M=performance.now();if((!O||M-Ft.current>=66||Math.abs(T-yt.current)>=.25)&&(Ft.current=M,yt.current=T,u.getState().setCurrentTime(T)),!O){u.getState().setIsPlaying(!1),Sn();return}ut.current=requestAnimationFrame(s0)},[It,Sn]),ac=(0,A.useCallback)(()=>{Sn(),ut.current=requestAnimationFrame(s0)},[Sn,s0]),jd=(0,A.useCallback)(b=>{let T=AU(b);I(String(Number(T.toFixed(2))));let x=It(),k=Cs(x);return k?.setPlaybackRate?.(T),u.getState().audioMuted||(k?.setMuted?.(!1),kU(x,"set-muted",{muted:!1})),kU(x,"set-playback-rate",{playbackRate:T}),T},[It]),Ir=(0,A.useCallback)(b=>{let T=It(),x=Cs(T),k=u.getState(),O=x?.getDuration()||u.getState().duration||f,M=Math.max(0,Math.min(O,Number.isFinite(b)?b:0)),H=!!(x?.isPlaying()||k.isPlaying);if(Sn(),x){x.seek(M);let Y=x.getTime();c.notify(Y),k.setCurrentTime(Y),k.setIsPlaying(!!x.isPlaying())}else c.notify(M),k.setCurrentTime(M),k.requestSeek(M);return H&&x?.isPlaying()&&ac(),!0},[f,It,c,ac,Sn,u]),jm=(0,A.useCallback)(b=>!(b instanceof Element)||b.closest("button,input,textarea,select,a")||b.closest("[data-clip]")?!1:!!b.closest('[aria-label="Timeline"]'),[]),Sa=(0,A.useCallback)((b,T)=>{let x=cn.current?.querySelector('[aria-label="Timeline"]'),k=x?.firstElementChild instanceof HTMLElement?x.firstElementChild:null,O=u.getState().duration||f;if(!k||O<=0)return null;let M=k.getBoundingClientRect(),Y=Math.max(1,k.scrollWidth-uU)/O,it=b-M.left+k.scrollLeft-uU;if(it<0)return null;let Q=Math.max(0,Math.min(O,it/Y)),_t=T-M.top+k.scrollTop-dU,St=He.current?.rowOrder??o1(Io),ot=Math.floor(_t/fU),ie=T-M.top,We=St.length>0&&ie>=0&&ie<=dU,Je=We?Math.max(...St)+1:ot>=0&&ot<St.length?St[ot]:null,gc=Je===null?null:Io.find(No=>No.track===Je&&Q>=No.start&&Q<=No.start+No.duration)??null;return{time:Q,track:Je,syntheticTrack:We,element:gc,scrollLeft:k.scrollLeft,pixelsPerSecond:Y}},[f,Io,u]),A1=(0,A.useCallback)((b,T)=>{let x=Sa(b,0);if(!x)return!1;let{time:k,scrollLeft:O,pixelsPerSecond:M}=x;return Ir(k),xt("editor.timeline-capture-seek",{source:T,time:k,clientX:b,scrollLeft:O,pixelsPerSecond:M}),!0},[Ir,Sa]),T6=(0,A.useCallback)(b=>{if(b.button!==0||b.shiftKey||b.metaKey||b.ctrlKey||b.altKey){un.current=null;return}un.current={clientX:b.clientX,clientY:b.clientY,button:b.button,startedOnTimeline:jm(b.target)}},[jm]),w6=(0,A.useCallback)(b=>{let T=un.current;un.current=null,!(!T||T.button!==0||!T.startedOnTimeline||!jm(b.target)||Math.hypot(b.clientX-T.clientX,b.clientY-T.clientY)>5)&&A1(b.clientX,"click-capture")},[jm,A1]),x6=(0,A.useCallback)(b=>{let T=b.target;if(!(T instanceof Element)||!T.closest('[aria-label="Timeline"]'))return;b.preventDefault(),b.stopPropagation();let x=Sa(b.clientX,b.clientY);if(!x)return;let k=u.getState();if(x.element){let O=Nt(x.element);new Set([...k.selectedElementId?[k.selectedElementId]:[],...Array.from(k.selectedElementIds)]).has(O)||(k.clearSelectedElementIds(),k.setSelectedElementId(O))}else k.clearSelectedElementIds(),k.setSelectedElementId(null);z({x:b.clientX,y:b.clientY,time:x.time,track:x.syntheticTrack?null:x.track,element:x.element}),D(null)},[Sa,u]),qm=(0,A.useCallback)(b=>{Ni(It(),b)},[It]),k1=(0,A.useCallback)(()=>oe.current?.querySelector(".dna-panel")?.scrollTop??0,[]),I1=(0,A.useCallback)(b=>{requestAnimationFrame(()=>{let T=oe.current?.querySelector(".dna-panel");T&&(T.scrollTop=b)})},[]),sc=(0,A.useCallback)(()=>{let b=u.getState(),T=Cs(It());return{time:T?.getTime()??b.currentTime,selectedElementId:b.selectedElementId,selectedElementIds:Array.from(b.selectedElementIds),zoomMode:b.zoomMode,manualZoomPercent:b.manualZoomPercent,rightPanelScrollTop:k1(),playbackRate:AU(Number(C)),wasPlaying:!!(T?.isPlaying()||b.isPlaying)}},[It,k1,C,u]),A6=(0,A.useCallback)(()=>{let b=kt.current;if(!b){qm(vn);return}let T=0,x=()=>{let k=u.getState();if(!(k.timelineReady&&k.elements.length>0)&&T<12){T+=1,requestAnimationFrame(x);return}let M=Cs(It());if(b.wasPlaying&&!M&&T<30){T+=1,requestAnimationFrame(x);return}kt.current=null,I(String(Number(b.playbackRate.toFixed(2)))),k.setZoomMode(b.zoomMode),k.setManualZoomPercent(b.manualZoomPercent),k.setPlaybackRate(b.playbackRate),k.clearSelectedElementIds();for(let Y of b.selectedElementIds)k.toggleSelectedElementId(Y);k.setSelectedElementId(b.selectedElementId);let H=b.selectedElementId?k.elements.find(Y=>Nt(Y)===b.selectedElementId)??null:null;Ni(It(),H),I1(b.rightPanelScrollTop),jd(b.playbackRate),Ir(b.time),b.wasPlaying&&M?(M.play(),k.setIsPlaying(!0),ac()):k.setIsPlaying(!1),xt("editor.restore-after-reload",{time:b.time,selectedElementId:b.selectedElementId,selectedCount:b.selectedElementIds.length,zoomMode:b.zoomMode,manualZoomPercent:b.manualZoomPercent,rightPanelScrollTop:b.rightPanelScrollTop})};requestAnimationFrame(x)},[jd,Ir,It,I1,vn,ac,qm,u]);(0,A.useEffect)(()=>()=>Sn(),[Sn]),(0,A.useEffect)(()=>{h.current=m},[m]),(0,A.useEffect)(()=>{qm(vn)},[vn,qm]),(0,A.useEffect)(()=>{let b=T=>{let x=T.data;if(!x||x.source!=="vidfarm-composition")return;let k=u.getState();if(x.action==="preview-context-menu"){let M=w1(T.source),H=M?.getBoundingClientRect(),Y=M?.contentWindow?.innerWidth||H?.width||1,it=M?.contentWindow?.innerHeight||H?.height||1,Q=(H?.width??1)/Math.max(1,Y),_t=(H?.height??1)/Math.max(1,it),St=(H?.left??0)+Number(x.clientX??0)*Q,ot=(H?.top??0)+Number(x.clientY??0)*_t,ie={x:Number(x.frame?.x??12),y:Number(x.frame?.y??70),width:Number(x.frame?.width??42),height:Number(x.frame?.height??12)},We={x:Lt(ie.x,0,95),y:Lt(ie.y,0,95),width:Lt(ie.width,1,100-Lt(ie.x,0,95)),height:Lt(ie.height,1,100-Lt(ie.y,0,95))};$m({x:St,y:ot,time:Number.isFinite(Number(x.time))?Number(x.time):k.currentTime,frame:We,elementId:x.id??null}),xt("editor.preview-context-menu",{id:x.id??null,time:Number(x.time),frame:We});return}if(x.action!=="select-layer")return;if(k.clearSelectedElementIds(),!x.id){k.setSelectedElementId(null),D(null),xt("editor.canvas-empty-select");return}let O=k.elements.find(M=>M.hfId===x.id||M.domId===x.id||M.id===x.id||M.key===x.id);k.setSelectedElementId(O?Nt(O):null),D(null),xt("editor.canvas-layer-select",{id:x.id,elementKey:O?Nt(O):null})};return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[w1,$m,u]);let l0=(0,A.useCallback)(()=>{let b=$d.current;if(b.active)return;if(b.pendingBody===null){b.pendingRevBump&&(b.pendingRevBump=!1,S(x=>x+1),requestAnimationFrame(()=>R(!0)));return}let T=b.pendingBody;b.pendingBody=null,b.active=!0,(async()=>{try{let x=await i();await fetch(`/api/v1/compositions/${encodeURIComponent(x)}/composition.html`,{method:"PUT",headers:{"content-type":"text/html; charset=utf-8"},body:T})}catch(x){Ar("editor.composition-put-failed",x instanceof Error?x.message:x)}finally{b.active=!1,l0()}})()},[i]),lc=(0,A.useCallback)((b,T)=>{let x=$d.current;x.pendingBody=Xl(b),T.bumpRev&&(x.pendingRevBump=!0),l0()},[l0]),Wr=(0,A.useCallback)((b,T)=>{xt("editor.composition-persist",{bytes:b.length,mode:T}),lc(b,{bumpRev:!1})},[lc]),cc=(0,A.useCallback)((b,T)=>{b=Xl(b);let x={...sc(),...T};bt.current&&(x.wasPlaying=!0,bt.current=!1),kt.current=x,h.current=b,_(b),Sn(),u.getState().reset(),R(!1),xt("editor.composition-publish",{bytes:b.length}),lc(b,{bumpRev:!0})},[sc,lc,Sn,u]),Ro=(0,A.useCallback)(b=>{or(),cc(b)},[cc,or]),R1=(0,A.useCallback)((b,T)=>{or(),cc(b,{selectedElementId:T,selectedElementIds:[]})},[cc,or]),TJ=(0,A.useCallback)((b,T)=>{b=Xl(b),or(),h.current=b,_(b);let x=It(),k=n1(x,b),O=u.getState(),M=O.selectedElementId?O.elements.find(H=>Nt(H)===O.selectedElementId)??null:null;Ni(x,M),Wr(b,"soft"),T!==void 0&&Ir(T),xt("editor.timeline-timing-soft-patch",{bytes:b.length,patchedCount:k,seekTime:T})},[Ir,It,Wr,or,u]),k6=(0,A.useCallback)((b,T)=>{let x=h.current,k=Zo(x,b,T);if(k===x){xt("editor.live-patch-skipped-missing",{elementKey:Nt(b)});return}or(`live:${Nt(b)}`),h.current=k,_(k);let O=It(),M=km(O,b,T);Ni(O,b),xt("editor.live-patch",{elementKey:Nt(b),hfId:b.hfId,domId:b.domId,tag:b.tag,hasIframe:!!O,patched:M}),M?Wr(k,"soft"):cc(k)},[It,Wr,cc,or]),I6=(0,A.useCallback)((b,T)=>{let x=It(),k=km(x,b,T);Ni(x,b),xt("editor.live-preview-patch",{elementKey:Nt(b),patched:k})},[It]),Vm=(0,A.useCallback)(b=>{let T=h.current;h.current=b.html,_(b.html);let x=It(),k=hU(x,b.html),O=k?$_(x):!1;r1(u,T,b.html),Wr(b.html,"soft");let M=u.getState(),H=new Set(M.elements.map(Q=>Nt(Q))),Y=b.selectedElementId&&H.has(b.selectedElementId)?b.selectedElementId:null,it=b.selectedElementIds.filter(Q=>H.has(Q));if(k&&O){M.clearSelectedElementIds();for(let _t of it)M.toggleSelectedElementId(_t);M.setSelectedElementId(Y);let Q=Y?M.elements.find(_t=>Nt(_t)===Y)??null:null;Ni(x,Q),Ir(b.time),xt("editor.history-live-swap",{bytes:b.html.length});return}if(kt.current={...sc(),time:b.time,selectedElementId:Y,selectedElementIds:it},Sn(),bU(x,b.html)){xt("editor.history-document-write",{bytes:b.html.length});return}lc(b.html,{bumpRev:!0}),xt("editor.history-reload-fallback",{bytes:b.html.length})},[sc,Ir,lc,It,Wr,Sn,u]),c0=(0,A.useCallback)(b=>{let T=It(),x=T?.contentDocument??null,k=x?Z_(x):h.current;h.current=b,_(b);let O=hU(T,b),M=O?$_(T):!1;if(r1(u,k,b),O&&M){Ir(u.getState().currentTime),xt("editor.dev-reload-live-swap",{bytes:b.length});return}if(kt.current={...sc()},Sn(),bU(T,gX(b))){xt("editor.dev-reload-document-write",{bytes:b.length});return}Ar("editor.dev-reload-apply-failed",{bytes:b.length})},[sc,Ir,It,Sn,u]);(0,A.useEffect)(()=>{if(!o||!zd()?.liveReload)return;let b=new EventSource("/api/v1/dev/events"),T=x=>{let k={};try{k=JSON.parse(x.data)}catch{}k.forkId&&k.forkId!==o||fetch(`/api/v1/compositions/${encodeURIComponent(o)}/composition.html`,{cache:"reload"}).then(O=>O.ok?O.text():null).then(O=>{O!=null&&c0(Xl(O))}).catch(O=>Ar("editor.live-reload-fetch-failed",O instanceof Error?O.message:String(O)))};return b.addEventListener("reload",T),b.onerror=()=>Ar("editor.live-reload-sse-error"),()=>{b.removeEventListener("reload",T),b.close()}},[c0,o]);let qd=(0,A.useCallback)(()=>{fn.current.flushAll();let b=K.current.pop();b&&(vt.current=[ic(),...vt.current.slice(0,49)],Ht.current=null,oc(),Vm(b))},[Vm,oc,ic]),uc=(0,A.useCallback)(()=>{fn.current.flushAll();let b=vt.current.shift();b&&(K.current=[...K.current.slice(-49),ic()],Ht.current=null,oc(),Vm(b))},[Vm,oc,ic]),u0=(0,A.useRef)({undo:()=>{},redo:()=>{}});(0,A.useEffect)(()=>{u0.current={undo:qd,redo:uc}},[uc,qd]);let R6=(0,A.useCallback)(()=>{let b=It()?.contentDocument;!b||mU.has(b)||(mU.add(b),b.addEventListener("keydown",T=>{if(!(T.metaKey||T.ctrlKey)||T.altKey)return;let x=T.key.toLowerCase();x!=="z"&&x!=="y"||(T.preventDefault(),T.stopPropagation(),x==="y"||T.shiftKey?u0.current.redo():u0.current.undo())},!0))},[It]),N6=(0,A.useCallback)(b=>{Ct.current=b.commit,mt(b.dirty)},[]),d0=(0,A.useCallback)(b=>{ct(T=>{if(!T.has(b))return T;let x=new Map(T);return x.delete(b),x})},[]),C6=(0,A.useCallback)(b=>{let T=Nt(b),x=n0(h.current,b);if(x){let k=JU(x);km(It(),b,O=>f1(O,k)),Ni(It(),b)}d0(T)},[d0,It]),Ym=(0,A.useCallback)((b,T)=>{let x=Nt(b),k={x:Lt(T.x,0,Math.max(0,100-T.width)),y:Lt(T.y,0,Math.max(0,100-T.height)),width:Lt(T.width,1,100-T.x),height:Lt(T.height,1,100-T.y),...Number.isFinite(T.fontSize)?{fontSize:Math.max(8,Math.min(180,Number(T.fontSize)))}:{}};ct(O=>{let M=new Map(O);return M.set(x,{element:b,frame:k}),M}),Ni(It(),b),mt(!0)},[It]),M6=(0,A.useCallback)(()=>{window.setTimeout(()=>fn.current.visual(),0)},[]),dc=(0,A.useCallback)(()=>{let b=Array.from(X.values());if(b.length===0)return!1;or();let T=h.current;for(let x of b)T=Zo(T,x.element,k=>f1(k,x.frame));return h.current=T,_(T),ct(new Map),Wr(T,"soft"),Ni(It(),vn),xt("editor.visual-frame-drafts-commit",{count:b.length}),!0},[It,Wr,or,vn,X]);(0,A.useEffect)(()=>{let b=T=>{let x=T.data;if(!x||x.source!=="vidfarm-composition"||x.action!=="visual-frame-draft"||!x.id||!x.frame)return;let k=u.getState(),O=k.elements.find(Y=>Y.hfId===x.id||Y.domId===x.id||Y.id===x.id||Y.key===x.id);if(!O||!b1(O))return;let M=Number(x.frame.fontSize),H={x:Number(x.frame.x),y:Number(x.frame.y),width:Number(x.frame.width),height:Number(x.frame.height),...Number.isFinite(M)?{fontSize:M}:{}};[H.x,H.y,H.width,H.height].every(Number.isFinite)&&(k.clearSelectedElementIds(),k.setSelectedElementId(Nt(O)),Ym(O,H),x.phase==="end"&&window.setTimeout(()=>fn.current.visual(),0),xt("editor.iframe-visual-frame-draft",{elementKey:Nt(O),phase:x.phase,frame:H}))};return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[Ym,u]);let N1=(0,A.useCallback)(b=>{let T=Array.from(nt.entries()).filter(([x])=>x!==b).map(([,x])=>x);return T.length===0?h.current:s1(h.current,T).html},[nt]),f0=(0,A.useCallback)(b=>{lt(T=>{if(!T.has(b))return T;let x=new Map(T);return x.delete(b),x})},[]),O6=(0,A.useCallback)(b=>{let T=nt.get(b);if(T){let x=d1(h.current,T.element);u.getState().updateElement(b,{start:x.start,duration:x.duration,track:x.track,playbackStart:x.playbackStart})}f0(b)},[f0,nt,u]),Mi=(0,A.useCallback)((b,T,x)=>{let k=Nt(b),O=d1(h.current,b),H={...nt.get(k)?.updates??{},...T};if(!x?.bypassCollisionGuard){let St={start:H.start??O.start,duration:H.duration??O.duration,track:H.track??O.track},ot=SU(u.getState().elements,b,h.current),ie={start:O.start,duration:O.duration,track:O.track};if(i1(St,ot)&&!i1(ie,ot))return Ar("editor.timeline-stage-collision-rejected",{elementKey:k,proposed:St}),!1}let Y=h.current;try{let St=Array.from(nt.entries()).filter(([ot])=>ot!==k).map(([,ot])=>ot);Y=s1(h.current,[...St,{element:O,updates:H}]).html}catch(St){return Ar("editor.timeline-stage-rejected",St instanceof Error?St.message:St),!1}let it=u.getState();it.setSelectedElementId(k),it.updateElement(k,T),lt(St=>{let ot=new Map(St);return ot.set(k,{element:O,updates:H}),ot});let Q=It(),_t=n1(Q,Y);return Ni(Q,{...O,...H}),xt("editor.timeline-stage-applied",{elementKey:k,updates:H,patchedCount:_t}),!0},[It,nt,u]),fc=(0,A.useCallback)((b=new Set)=>{let T=Array.from(nt.entries()).filter(([it])=>!b.has(it));if(T.length===0)return;or();let x=h.current,{html:k,resolvedCollisions:O}=s1(x,T.map(([,it])=>it)),M=Xl(k);lt(it=>{let Q=new Map(it);for(let[_t]of T)Q.delete(_t);return Q}),h.current=M,_(M),u.getState().elements.length>0&&r1(u,x,M);let H=It(),Y=n1(H,M);$_(H),Wr(M,"soft"),xt("editor.timeline-timing-commit",{count:T.length,patchedCount:Y,resolvedCollisions:O})},[It,Wr,or,nt,u]),Wm=(0,A.useCallback)(()=>{let b=!1;te&&Ct.current&&(Ct.current(),Ct.current=null,mt(!1),b=!0);let T=vn?Nt(vn):null;return nt.size>0&&fc(b&&T?new Set([T]):new Set),X.size>0&&dc(),h.current},[fc,dc,te,vn,nt.size,X.size]);(0,A.useEffect)(()=>{fn.current={timing:()=>fc(),visual:()=>dc(),flushAll:()=>{Wm()}}},[Wm,fc,dc]);let Km=(0,A.useCallback)(async b=>{if(rc)return;let T=n.title;gt({phase:"starting",title:T,status:"STARTING",progress:0,framesRendered:0,totalFrames:null,lambdasInvoked:0,cost:"$0.0000"});try{let x=Wm(),k=await i(),O=await fetch(`/api/v1/compositions/${encodeURIComponent(k)}/render`,{method:"POST",headers:{"content-type":"application/json; charset=utf-8"},body:JSON.stringify({title:T,html:x,...b==="cloud"?{render_target:"cloud"}:{}})}),M=await O.json().catch(()=>({}));if(!O.ok||M.ok===!1)throw new Error(M.error||`Publish failed with ${O.status}`);xt("editor.publish-started",{forkId:k,renderId:M.renderId}),gt(cU(M,T))}catch(x){xo("editor.publish-start-error",x instanceof Error?x.stack:x),gt({phase:"failed",title:T,status:"FAILED",progress:0,error:x instanceof Error?x.message:String(x)})}},[Wm,n.title,i,rc]);(0,A.useEffect)(()=>{if(F?.phase!=="running"||!F.renderId||!o)return;let b=o,T=!1,x=0,k=0,O=async()=>{try{let M=await fetch(`/api/v1/compositions/${encodeURIComponent(b)}/renders/${encodeURIComponent(F.renderId||"")}`),H=await M.json().catch(()=>({}));if(T)return;if(!M.ok||H.ok===!1)throw new Error(H.error||`Publish progress failed with ${M.status}`);x=0,gt(cU(H,n.title))}catch(M){if(T)return;if(xo("editor.publish-poll-error",M instanceof Error?M.stack:M),x+=1,x<5){k=window.setTimeout(()=>{O()},4500);return}gt(H=>({...H??{title:n.title},phase:"failed",status:"FAILED",error:"Lost connection while checking render status \u2014 the render may still be running. Check your jobs list."}))}};return k=window.setTimeout(()=>{O()},4500),()=>{T=!0,window.clearTimeout(k)}},[n.title,o,F]);let D6=(0,A.useCallback)(()=>{let b=It(),T=Cs(b);if(!T)return;if(T.isPlaying()||u.getState().isPlaying){T.pause(),u.getState().setCurrentTime(T.getTime()),u.getState().setIsPlaying(!1),Sn();return}(te||nt.size>0||X.size>0)&&(bt.current=!0);let k=!1;te&&Ct.current&&(Ct.current(),Ct.current=null,mt(!1),k=!0);let O=vn?Nt(vn):null;nt.size>0&&fc(k&&O?new Set([O]):new Set),X.size>0&&dc(),bt.current&&(bt.current=!1);let M=jd(Number(C));T.getTime()>=T.getDuration()&&T.seek(0),T.setPlaybackRate?.(M),T.play(),u.getState().setIsPlaying(!0),ac()},[jd,dc,fc,It,te,vn,C,ac,Sn,nt.size,u,X.size]),L6=(0,A.useCallback)((b,T)=>{try{let x=new DOMParser().parseFromString(N1(),"text/html"),k=Bn(x,b);if(!k)return;let O=k.getAttribute("data-vf-group"),M=TU(x,O,k),H=Ql(k),Y=T.start-H.start,it=T.track-H.track,Q=new Map;for(let _t of M){let St=Ci(_t);if(!St)continue;let ot=Ql(_t);Q.set(St,{start:Math.max(0,ot.start+Y),duration:ot.duration,track:Math.max(0,ot.track+it)})}SX(x,M,Q);for(let _t of M){let St=Ci(_t),ot=St?Q.get(St):null;if(!St||!ot)continue;let ie=nc.find(Je=>Nt(Je)===St||Je.hfId===St||Je.domId===St||Je.id===St)??(St===Ci(k)?b:null);if(!ie)continue;if(!Mi(ie,{start:ot.start,track:ot.track},{bypassCollisionGuard:!0}))throw new Error("Timeline move could not be staged.")}window.setTimeout(()=>fn.current.timing(),0)}catch(x){return Ar("editor.timeline-move-rejected",x instanceof Error?x.message:x),Promise.reject(x)}},[nc,N1,Mi]),U6=(0,A.useCallback)((b,T)=>{try{if(!Mi(b,T))throw new Error("Timeline resize could not be staged.");window.setTimeout(()=>fn.current.timing(),0)}catch(x){return Ar("editor.timeline-resize-rejected",x instanceof Error?x.message:x),Promise.reject(x)}},[Mi]),p0=(0,A.useCallback)((b,T,x)=>{if(x.button!==0||x.shiftKey||x.metaKey||x.ctrlKey)return;if(x.altKey){x.preventDefault(),x.stopPropagation();return}let k=Nt(b),O=IU(b,nt.get(k)),M=Sa(x.clientX,x.clientY);if(!M)return;x.preventDefault(),x.stopPropagation();let H=u.getState();H.clearSelectedElementIds(),H.setSelectedElementId(k),un.current=null;let Y=_X(Io.filter(it=>J_(h.current,it)!=="track-placeholder"));He.current={element:O,mode:T,originClientX:x.clientX,originClientY:x.clientY,originPointerTime:M.time,originStart:O.start,originDuration:O.duration,originTrack:O.track,originPlaybackStart:O.playbackStart,moved:!1,rowOrder:o1(Io),laneAudioFlags:Y},xt("editor.manual-timeline-drag-start",{elementKey:k,mode:T,start:O.start,duration:O.duration,track:O.track})},[Io,Sa,nt,u]);(0,A.useEffect)(()=>{function b(x){let k=He.current;if(!k)return;let O=Math.hypot(x.clientX-k.originClientX,x.clientY-k.originClientY);if(!k.moved&&O<2)return;k.moved=!0,x.preventDefault();let M=Sa(x.clientX,x.clientY);if(!M)return;let H=M.time-k.originPointerTime,Y=k.originStart+k.originDuration,it=SU(u.getState().elements,k.element,h.current),Q=!1,_t=!1;if(k.mode==="move"){let St=Lt(k.originStart+H,0,Math.max(0,f-k.originDuration)),ot=M.track??k.originTrack,ie=it.reduce((No,Co)=>Math.max(No,Co.track),-1),We=M.syntheticTrack?Math.min(ot,Math.max(ie+1,k.originTrack)):ot,Je=k.element.tag==="audio",gc=k.laneAudioFlags.get(We);if(!M.syntheticTrack&&We!==k.originTrack&&gc!==void 0&&gc!==Je)_t=!0;else{let No={start:St,duration:k.originDuration,track:We},Co=i1(No,it)?vX(it,We,k.originDuration,St,f):St;Co===null?_t=!0:Q=Mi(k.element,{start:Co,track:We})}}else if(k.mode==="trim-start"){let St=it.reduce((No,Co)=>Bm(Co)&&Co.track===k.originTrack&&Co.start+Co.duration<=k.originStart+.001?Math.max(No,Co.start+Co.duration):No,0),ot=Math.max(0,Y-.05),ie=Math.min(St,ot),We=Lt(k.originStart+H,ie,ot),Je=We-k.originStart,gc=k.originPlaybackStart===void 0?void 0:Math.max(0,k.originPlaybackStart+Je);Q=Mi(k.element,{start:We,duration:Math.max(.05,Y-We),playbackStart:gc})}else{let St=it.reduce((We,Je)=>Bm(Je)&&Je.track===k.originTrack&&Je.start>=Y-.001?Math.min(We,Je.start):We,f),ot=Math.max(k.originStart+.05,St),ie=Lt(Y+H,k.originStart+.05,ot);Q=Mi(k.element,{duration:Math.max(.05,ie-k.originStart)})}_t?xt("editor.manual-timeline-drag-lane-full",{elementKey:Nt(k.element),mode:k.mode,track:M.track??k.originTrack}):Q||Ar("editor.manual-timeline-drag-rejected",{elementKey:Nt(k.element),mode:k.mode})}function T(){let x=He.current;x&&(xt("editor.manual-timeline-drag-end",{elementKey:Nt(x.element),mode:x.mode,moved:x.moved}),He.current=null,x.moved&&window.setTimeout(()=>fn.current.timing(),0))}return window.addEventListener("pointermove",b,{passive:!1}),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T),()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T)}},[f,Sa,Mi,u]);let C1=(0,A.useCallback)((b,T)=>{let x=Zo(m,b,k=>{let O=Number(k.getAttribute("data-start")??b.start),M=Number(k.getAttribute("data-duration")??b.duration),H=O+M;if(T<=O||T>=H)return;let Y=T-O,it=H-T,Q=k.cloneNode(!0),_t=`element_split_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,St=Number(k.getAttribute("data-playback-start")??k.getAttribute("data-media-start")??b.playbackStart??0),ot=k.getAttribute("data-layer-kind")||h1(b)?.kind||(b.tag==="audio"?"audio":b.tag==="video"?"video":"layer"),ie=Kt(St+Y);k.setAttribute("data-duration",Kt(Y)),k.setAttribute("data-layer-kind",ot),Q.id=_t,Q.setAttribute("data-hf-id",_t),Q.setAttribute("data-start",Kt(T)),Q.setAttribute("data-duration",Kt(it)),Q.setAttribute("data-media-start",ie),Q.setAttribute("data-playback-start",ie),Q.setAttribute("data-layer-kind",ot),Q.setAttribute("data-label",`${b.label??b.id} split`),k.after(Q)});Ro(x)},[m,Ro]),B6=(0,A.useCallback)((b,T)=>{let x=Math.max(0,T==="above"?b+1:b),{html:k}=Ao(m,O=>{for(let it of Array.from(O.querySelectorAll("[data-start]"))){if(!re(it))continue;let Q=Number(it.getAttribute("data-track-index")??0);Q>=x&&it.setAttribute("data-track-index",String(Q+1))}let M=O.querySelector("[data-composition-id]");if(!re(M))return;let H=`element_track_${x}_${Date.now().toString(36)}`,Y=O.createElement("div");Y.id=H,Y.setAttribute("data-hf-id",H),Y.setAttribute("data-layer-mode","publish"),Y.setAttribute("data-layer-kind","track-placeholder"),Y.setAttribute("data-viral-note","Empty layer row."),Y.setAttribute("data-start","0"),Y.setAttribute("data-duration","0"),Y.setAttribute("data-track-index",String(x)),Y.setAttribute("data-label","Empty layer"),Y.setAttribute("data-timeline-locked","true"),Y.style.cssText="position:absolute;left:0%;top:0%;width:1%;height:1%;display:none;",M.append(Y)});Ro(k),xt("editor.timeline-layer-inserted",{anchorTrack:b,placement:T,insertAt:x})},[m,Ro,u]),Xm=(0,A.useCallback)((b,T)=>{Ct.current?.();let x=`element_${b}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,k=u.getState().currentTime,O=Math.max(0,Math.min(f-.5,Number.isFinite(T.time)?T.time:k)),M=Math.max(.5,Math.min(4,f-O)),H=T.frame??{x:12,y:b==="text"?68:18,width:b==="text"?76:54,height:b==="text"?12:32},{html:Y}=Ao(h.current,it=>{let Q=it.querySelector("[data-composition-id]");if(!re(Q))return;let St=Array.from(it.querySelectorAll("[data-start]")).filter(ie=>re(ie)).reduce((ie,We)=>{let Je=Number(We.getAttribute("data-track-index")??0);return Number.isFinite(Je)?Math.max(ie,Je+1):ie},0),ot=b==="media"?it.createElement("video"):it.createElement("div");ot.id=x,ot.setAttribute("data-hf-id",x),ot.setAttribute("data-layer-mode","publish"),ot.setAttribute("data-layer-kind",b==="media"?"video":"caption"),ot.setAttribute("data-viral-note",b==="media"?"Inserted media layer.":"Inserted caption layer."),ot.setAttribute("data-start",Kt(O)),ot.setAttribute("data-duration",Kt(M)),ot.setAttribute("data-track-index",String(St)),ot.setAttribute("data-label",b==="media"?"New media":"New text"),b==="text"&&(ot.setAttribute("data-text-background-style","plain"),ot.setAttribute("data-text-background-color","#000000"),ot.setAttribute("data-font-family","Montserrat")),ot.style.position="absolute",ot.style.left=`${Lt(H.x,0,95)}%`,ot.style.top=`${Lt(H.y,0,95)}%`,ot.style.width=`${Lt(H.width,1,100-Lt(H.x,0,95))}%`,ot.style.height=`${Lt(H.height,1,100-Lt(H.y,0,95))}%`,ot.style.zIndex=String(100+St),ot.style.overflow="hidden",b==="media"&&ot instanceof HTMLVideoElement?(ot.setAttribute("src",Dm),ot.setAttribute("playsinline",""),ot.setAttribute("muted",""),ot.setAttribute("preload","auto"),ot.setAttribute("data-media-start","0"),ot.setAttribute("data-playback-start","0"),ot.style.objectFit="cover",ot.style.background="#050604"):(ot.style.display="flex",ot.style.alignItems="center",ot.style.justifyContent="center",ot.style.padding="3px",ot.style.boxSizing="border-box",ot.style.textAlign="center",ot.style.color="#ffffff",ot.style.background="transparent",ot.style.fontFamily="Montserrat, 'TikTok Sans', sans-serif",ot.style.fontWeight="600",ot.style.fontSize="22px",ot.style.lineHeight="1.2",ot.style.textTransform="none",Q_(ot,"New text","plain","#ffffff","#000000","Montserrat",600)),Q.append(ot)});R1(Y,x),z(null),D(null),xt("editor.layer-inserted",{id:x,kind:b,start:O,duration:M})},[f,R1,u]),m0=(0,A.useCallback)(()=>{let b=u.getState(),T=new Set([...b.selectedElementId?[b.selectedElementId]:[],...Array.from(b.selectedElementIds)]),x=b.elements.filter(M=>T.has(Nt(M)));if(x.length<2)return;let k=`vf-group-${Date.now().toString(36)}`,{html:O}=Ao(m,M=>{for(let H of x){let Y=Bn(M,H);Y&&(Y.setAttribute("data-vf-group",k),Y.setAttribute("data-vf-group-label","Vidfarm group"))}});Ro(O),xt("editor.group-created",{groupId:k,count:x.length})},[m,Ro,u]),g0=(0,A.useCallback)(()=>{let b=u.getState(),T=new Set([...b.selectedElementId?[b.selectedElementId]:[],...Array.from(b.selectedElementIds)]);if(T.size===0)return;let{html:x}=Ao(m,k=>{let O=new Set;for(let M of b.elements){if(!T.has(Nt(M)))continue;let H=EU(k,M);H&&O.add(H)}for(let M of O)for(let H of TU(k,M,k.body))H.removeAttribute("data-vf-group"),H.removeAttribute("data-vf-group-label")});Ro(x),xt("editor.group-removed")},[m,Ro,u]),Vd=(0,A.useCallback)(b=>{if(b.hfId==="source-video")return;or();let T=Zo(h.current,b,it=>it.remove());h.current=T,_(T);let x=It(),k=km(x,b,it=>{it instanceof HTMLMediaElement&&it.pause(),it.remove()}),O=$_(x),M=new Set([Nt(b),b.hfId,b.domId,b.id].filter(it=>!!it)),H=u.getState();H.setElements(H.elements.filter(it=>![Nt(it),it.hfId,it.domId,it.id].some(_t=>_t&&M.has(_t)))),H.clearSelectedElementIds(),H.setSelectedElementId(null),lt(it=>{let Q=new Map(it);for(let _t of M)Q.delete(_t);return Q}),ct(it=>{let Q=new Map(it);for(let _t of M)Q.delete(_t);return Q}),Wr(T,"soft");let Y=Cs(x);if(Y){let it=Y.getTime();Y.seek(it),H.setCurrentTime(Y.getTime()),H.setIsPlaying(Y.isPlaying())}xt("editor.layer-delete-soft",{elementKey:Nt(b),patched:k,refreshed:O}),(!k||!O)&&S(it=>it+1)},[It,Wr,or,S,u]);(0,A.useEffect)(()=>{let b=T=>{let x=T.target;if(!(x instanceof HTMLInputElement||x instanceof HTMLTextAreaElement||x instanceof HTMLSelectElement||x instanceof HTMLElement&&x.isContentEditable)){if((T.metaKey||T.ctrlKey)&&!T.altKey&&T.key.toLowerCase()==="z"){T.preventDefault(),T.shiftKey?uc():qd();return}if((T.metaKey||T.ctrlKey)&&!T.altKey&&!T.shiftKey&&T.key.toLowerCase()==="y"){T.preventDefault(),uc();return}if((T.metaKey||T.ctrlKey)&&T.key.toLowerCase()==="g"){T.preventDefault(),T.shiftKey?g0():m0();return}if(T.key==="Delete"||T.key==="Backspace"){let k=u.getState(),O=new Set([...k.selectedElementId?[k.selectedElementId]:[],...Array.from(k.selectedElementIds)]);if(O.size===0)return;let M=k.elements.filter(H=>O.has(Nt(H)));if(M.length===0)return;T.preventDefault();for(let H of M)H.hfId!=="source-video"&&Vd(H)}}};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[Vd,m0,uc,qd,g0,u]);let pc=(0,A.useCallback)((b,T)=>{navigator.clipboard?.writeText(b).then(()=>{xt("editor.clipboard-copy",{label:T,value:b})}).catch(x=>{Ar("editor.clipboard-copy-failed",{label:T,error:x instanceof Error?x.message:x})})},[]),M1=(0,A.useCallback)(b=>{pc(Ms(b),"timestamp")},[pc]),P6=(0,A.useCallback)(b=>{pc(`time=${Ms(b.time)} track=${b.track??"none"}`,"timeline-coordinates")},[pc]),z6=(0,A.useCallback)(b=>{pc(`x=${Kt(b.x)} y=${Kt(b.y)} width=${Kt(b.width)} height=${Kt(b.height)}`,"preview-coordinates")},[pc]),F6=(0,A.useMemo)(()=>new Map(Lm.map(b=>[b.id,b])),[Lm]),H6=(0,A.useCallback)(()=>{let b=u.getState();b.setSelectedElementId(null),b.clearSelectedElementIds()},[u]);function G6(b,T){let x=F6.get(b.hfId??b.domId??b.id),k=J_(h.current,b),O=XU(h.current,b),M=k??x?.kind??(b.tag==="audio"?"audio":b.tag==="video"?"video":"layer"),H=b.label??x?.label??b.id,Y=Nt(b),it=i0.has(Y);return(0,g.jsxs)("div",{"data-clip":"true",className:`native-clip-label ${it?"multi-selected":""}`,onPointerDown:Q=>{(Q.shiftKey||Q.metaKey||Q.ctrlKey)&&Q.stopPropagation()},onClick:Q=>{if(!(Q.shiftKey||Q.metaKey||Q.ctrlKey))return;Q.preventDefault(),Q.stopPropagation();let _t=u.getState();_t.selectedElementId?(_t.selectedElementId,_t.toggleSelectedElementId(Y)):_t.setSelectedElementId(Y),xt("editor.timeline-multi-select",{elementKey:Y,selected:Array.from(u.getState().selectedElementIds)})},children:[(0,g.jsx)("span",{className:"native-clip-trim-hit start","aria-label":"Trim clip start",onPointerDown:Q=>p0(b,"trim-start",Q),onClick:Q=>{Q.preventDefault(),Q.stopPropagation()}}),(0,g.jsx)("span",{className:"native-clip-drag-hit","aria-label":"Move clip",onPointerDown:Q=>p0(b,"move",Q),onClick:Q=>{Q.preventDefault(),Q.stopPropagation()}}),(0,g.jsx)("span",{className:"native-clip-trim-hit end","aria-label":"Trim clip end",onPointerDown:Q=>p0(b,"trim-end",Q),onClick:Q=>{Q.preventDefault(),Q.stopPropagation()}}),(0,g.jsx)("span",{className:`native-clip-thumb ${M}`,children:pX(M,O==="html"?"html":x?.customHtml)}),(0,g.jsx)("strong",{style:{color:T.label},children:H}),(0,g.jsxs)("small",{children:["L",b.track," \xB7 drag / edge trim"]}),it&&(0,g.jsx)("em",{children:"SEL"})]})}let ti=(0,A.useRef)({url:null,title:null,status:null,renderId:null}),h0=(0,A.useRef)(null),b0=(0,A.useRef)(rc);b0.current=rc;let y0=(0,A.useRef)(Km);y0.current=Km,(0,A.useEffect)(()=>{if(F){if(F.phase==="succeeded"&&F.outputUrl){let b=ti.current,T={url:F.outputUrl,title:F.title??null,renderId:F.renderId??null};ti.current={url:F.outputUrl,title:F.title??null,status:F.status??"SUCCEEDED",renderId:F.renderId??null},(b.url!==T.url||b.renderId!==T.renderId)&&jX(T);return}ti.current={...ti.current,status:F.status??ti.current.status}}},[F]);let O1=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||O1.current===o)return;O1.current=o;let b=!1;return(async()=>{try{let T=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/versions?limit=25`);if(!T.ok)return;let x=await T.json().catch(()=>null),O=(Array.isArray(x?.versions)?x.versions:[]).filter(M=>typeof M.render_job_id=="string"&&M.render_job_id.length>0).map(M=>({version:Number(M.version),renderJobId:M.render_job_id})).filter(M=>Number.isFinite(M.version)).sort((M,H)=>H.version-M.version).slice(0,5);for(let M of O){if(b)return;let H=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/renders/${encodeURIComponent(M.renderJobId)}`);if(!H.ok)continue;let Y=await H.json().catch(()=>({}));if(b)return;if(Y?.status==="SUCCEEDED"&&typeof Y.outputUrl=="string"&&Y.outputUrl){if(ti.current.url&&ti.current.renderId===Y.renderId)return;ti.current={url:Y.outputUrl,title:Y.title??n.title??null,status:Y.status,renderId:Y.renderId??M.renderJobId};return}}}catch{}})(),()=>{b=!0}},[o,n.title]);let mc=(0,A.useRef)({compositionHtmlRef:h,patchCompositionHtml:Ro,draftedElements:Io,selectedElementId:ec,composition:n,activeCompositionDuration:f,startExport:()=>{y0.current()},isExportInFlight:()=>b0.current,getLastExport:()=>ti.current,getCast:()=>h0.current});(0,A.useEffect)(()=>{mc.current={compositionHtmlRef:h,patchCompositionHtml:Ro,draftedElements:Io,selectedElementId:ec,composition:n,activeCompositionDuration:f,startExport:()=>{y0.current()},isExportInFlight:()=>b0.current,getLastExport:()=>ti.current,getCast:()=>h0.current}}),(0,A.useEffect)(()=>(Rm.current={getSnapshot:()=>rJ(mc.current),applyAction:b=>CU(b,mc.current)},()=>{Rm.current=null}),[]),(0,A.useEffect)(()=>{let b=!1,T=async()=>{let x=h.current;if(!x||!x.includes('data-vf-gen-status="generating"'))return;let k=new DOMParser().parseFromString(x,"text/html"),O=Array.from(k.querySelectorAll('[data-vf-gen-status="generating"][data-vf-gen-job]'));for(let M of O){if(b)return;let H=M.getAttribute("data-hf-id")||M.id,Y=M.getAttribute("data-vf-gen-job");if(!(!H||!Y))try{let it=await fetch(`/api/v1/user/me/jobs/${encodeURIComponent(Y)}`);if(!it.ok)continue;let Q=await it.json().catch(()=>null);if(!Q)continue;let _t=sJ(Q);if(_t){lJ(mc.current,H,_t);continue}let St=typeof Q.status=="string"?Q.status:"";if(St==="failed"||St==="cancelled"){let ot=typeof Q.error=="string"&&Q.error?Q.error:`generation ${St}`;Mm(mc.current,H,ie=>{ie.setAttribute("data-vf-gen-status","error"),ie.setAttribute("data-vf-gen-error",ot.slice(0,200))})}}catch{}}};return(async()=>{for(;!b;){if(await new Promise(x=>setTimeout(x,6e3)),b)return;await T()}})(),()=>{b=!0}},[]);let $6=(0,A.useCallback)((b,T)=>{Ar("editor.timeline-edit-blocked",{elementKey:Nt(b),intent:T,tag:b.tag,timingSource:b.timingSource,timelineLocked:b.timelineLocked})},[]),j6=(0,A.useCallback)(b=>{let T=u.getState();T.setSelectedElementId(b?Nt(b):null),T.clearSelectedElementIds()},[u]),q6=(0,A.useCallback)(()=>z(null),[]),V6=(0,A.useCallback)(()=>D(null),[]),Y6=(0,A.useCallback)(()=>gt(null),[]),D1=(0,A.useCallback)(b=>Xm("text",b),[Xm]),L1=(0,A.useCallback)(b=>Xm("media",b),[Xm]),U1=(0,A.useCallback)(b=>{B.current={time:Number.isFinite(b.time)?b.time:u.getState().currentTime,frame:b.frame};let T=N.current;T&&(T.value="",T.click())},[u]),W6=(0,A.useCallback)(async b=>{let T=b.target.files?.[0]??null;if(b.target.value="",!T)return;let x=B.current??{time:u.getState().currentTime};B.current=null;let k=YX(T);if(!k){st(`Unsupported file type: ${T.type||T.name}`),window.setTimeout(()=>st(null),4e3);return}Ct.current?.(),st(`Uploading ${T.name}\u2026`);try{let{url:O}=await VX(T),M=`element_${k}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,H=x.frame,Y={action_type:"add_layer",kind:k,src:O,start:x.time,layer_key:M,label:T.name,note:"Uploaded from computer"};if(k!=="audio"){let _t=H??{x:12,y:18,width:54,height:32};Y.x=_t.x,Y.y=_t.y,Y.width=_t.width,Y.height=_t.height}let it=CU(Y,mc.current);if(!it.ok){st(it.error??"Could not add the uploaded media."),window.setTimeout(()=>st(null),5e3);return}let Q=u.getState();Q.setSelectedElementId(M),Q.clearSelectedElementIds(),st(null)}catch(O){st(O instanceof Error?O.message:"Upload failed."),window.setTimeout(()=>st(null),5e3)}},[u]),K6=(0,g.jsxs)("div",{className:"preview-pane",children:[(0,g.jsxs)("div",{className:"player-stage",ref:Qt,onPointerDown:E6,onContextMenu:S6,children:[(0,g.jsxs)("div",{className:`source-watermark source-titlebar ${u6?"playing":""}`,children:[(0,g.jsx)("button",{type:"button",className:"mode-back-link",onClick:e,children:"< Preview"}),(0,g.jsx)("span",{children:"Studio"}),(0,g.jsx)("strong",{children:n.title})]}),E?(0,g.jsx)(s,{ref:b=>{dn.current=b,Hm.current=d(b)},directUrl:_1,onLoad:()=>{c6(),A6(),R6(),zd()?.liveReload&&o&&!tc.current&&(tc.current=!0,c0(h.current))},portrait:!0,suppressLoadingOverlay:!0},_1):(0,g.jsx)("section",{className:"editor-loading-shell","aria-label":"Composition loading",children:(0,g.jsx)("span",{children:"Loading composition"})}),(0,g.jsx)(GX,{selected:vn,html:m,visualFrameDraft:T1,stageRef:Qt,getIframe:It,onStageFrame:Ym,onCommitDrag:M6})]}),(0,g.jsx)(AX,{disabled:!S1,speedDraft:C,onSpeedDraftChange:I,onCommitSpeed:jd,onSeek:Ir,onTogglePlay:D6,onUndo:qd,onRedo:uc,canUndo:h6,canRedo:b6,usePlayerStore:u})]});return(0,g.jsxs)("section",{className:"studio-shell","aria-label":"Video editor output",children:[J&&!J.dismissed&&(0,g.jsx)(LX,{mode:J.mode,busy:J.busy,finished:J.finished,error:J.error,scenesCreated:J.scenesCreated,ghostcutStatus:J.ghostcutStatus,ghostcutProgress:J.ghostcutProgress,userPrompt:J.userPrompt,onUserPromptChange:b=>dt(T=>T&&{...T,userPrompt:b}),onDecompose:ko,onFinish:Me,onCancel:J.mode==="redo"?o0:void 0,onDismiss:J.mode==="initial"?r6:void 0}),Xt&&o&&(0,g.jsx)(UX,{forkId:o,onClose:()=>Ce(!1)}),_n&&o&&(0,g.jsx)(BX,{forkId:o,templateId:n.templateId??n.id,currentVersion:Z,onClose:()=>Pn(!1),onReverted:l6}),(0,g.jsxs)("section",{className:"studio-main",ref:oe,children:[K6,(0,g.jsx)($X,{composition:v,selected:vn,html:m,onPatchHtml:Ro,onPatchLiveElement:k6,onPreviewLiveElement:I6,onUnselect:H6,onDraftStateChange:N6,onStageTimelineDraft:Mi,onStageVisualFrameDraft:Ym,timelineDraft:g6,visualFrameDraft:T1,onClearTimelineDraft:f0,onClearVisualFrameDraft:d0,onDiscardVisualFrameDraft:C6,onDiscardTimelineDraft:O6,onDelete:Vd,maxDuration:f,onPublish:()=>Km(),publishOptions:_6,onPublishOption:b=>Km(b==="cloud"?"cloud":"local"),publishDisabled:rc,publishLabel:y6,templateId:n.templateId??null,forkId:o,publishVersion:F?.version??Z,originalUrl:n.originalUrl??null,songName:n.songName??null,songUrl:n.songUrl??null,onOpenShare:a6,onOpenDecompose:i6,onOpenHistory:s6,decomposeDismissed:!!J?.dismissed,decomposeBusy:!!J?.busy,onResumeDecompose:o6})]}),(0,g.jsxs)("section",{className:"native-timeline",ref:cn,onPointerDownCapture:T6,onClickCapture:w6,onContextMenuCapture:x6,children:[(0,g.jsx)(l,{onSeek:Ir,onMoveElement:L6,onResizeElement:U6,onBlockedEditAttempt:$6,onSplitElement:C1,onDeleteElement:Vd,onSelectElement:j6,renderClipContent:G6,theme:XK}),a0&&(0,g.jsx)("div",{className:"timeline-layer-numbers","aria-hidden":"true",style:{left:-p6},children:E1.map((b,T)=>(0,g.jsxs)("span",{className:"timeline-layer-number",style:{top:T*fU+2-d6},children:["L",b]},b))}),L&&(0,g.jsx)(kX,{state:L,usePlayerStore:u,canGroup:Gm.size>=2,canUngroup:v6,onClose:q6,onSeek:Ir,onSplit:C1,onInsertLayer:B6,onInsertText:D1,onInsertMedia:L1,onUploadMedia:U1,onCopyTimestamp:M1,onCopyCoordinates:P6,onGroup:m0,onUngroup:g0,onDelete:Vd})]}),U&&(0,g.jsx)(IX,{state:U,onClose:V6,onInsertText:D1,onInsertMedia:L1,onUploadMedia:U1,onCopyTimestamp:M1,onCopyCoordinates:z6}),(0,g.jsx)("input",{ref:N,type:"file",accept:"video/*,image/*,audio/*",style:{display:"none"},onChange:W6}),V&&(0,g.jsx)("div",{className:"editor-upload-toast",role:"status",children:V}),F&&(0,g.jsx)(RX,{state:F,onClose:Y6})]})}function zd(){if(typeof window>"u")return null;let t=window.__HF_BOOT__;if(t&&typeof t=="object"&&!Array.isArray(t))return OU(t);if(typeof document<"u"){let e=document.getElementById("hf-boot");if(e&&e.textContent)try{let n=JSON.parse(e.textContent);if(n&&typeof n=="object"&&!Array.isArray(n))return OU(n)}catch{}}return null}function OU(t){let e=typeof t.compositionId=="string"?t.compositionId:null;return e?{compositionId:e,draftPath:typeof t.draftPath=="string"?t.draftPath:void 0,slugId:typeof t.slugId=="string"?t.slugId:void 0,templateId:typeof t.templateId=="string"?t.templateId:null,title:typeof t.title=="string"?t.title:void 0,lambdaMemoryMb:typeof t.lambdaMemoryMb=="number"?t.lambdaMemoryMb:void 0,apiBase:typeof t.apiBase=="string"?t.apiBase:void 0,editorChatApiUrl:typeof t.editorChatApiUrl=="string"?t.editorChatApiUrl:null,vidfarmApiKey:typeof t.vidfarmApiKey=="string"?t.vidfarmApiKey:null,originalUrl:typeof t.originalUrl=="string"?t.originalUrl:null,songName:typeof t.songName=="string"?t.songName:null,songUrl:typeof t.songUrl=="string"?t.songUrl:null,localRender:t.localRender===!0,cloudRenderAvailable:t.cloudRenderAvailable===!0,initialThreadId:typeof t.initialThreadId=="string"?t.initialThreadId:null,liveReload:t.liveReload===!0}:null}function SJ(t){if(!t)return Um[0];let e=Um.find(n=>n.id===t.compositionId);return e?{...e,templateId:t.templateId??e.templateId??null,originalUrl:t.originalUrl??e.originalUrl??null,songName:t.songName??e.songName??null,songUrl:t.songUrl??e.songUrl??null}:{id:t.compositionId,eyebrow:"TEMPLATE",title:t.title??t.compositionId,sourceFolder:"",sourceType:"video",duration:12,width:720,height:1280,summary:"Template composition.",media:{type:"video",src:""},templateId:t.templateId??t.compositionId,originalUrl:t.originalUrl??null,songName:t.songName??null,songUrl:t.songUrl??null,viralDna:{hook:"",retention:"",payoff:"",preserve:[],avoid:[]},layers:[],editable:!0}}function e6({boot:t}={}){let e=(0,A.useMemo)(()=>SJ(t),[t]),n=!!t,[r,o]=(0,A.useState)(n?"edit":"preview"),[i,a]=(0,A.useState)(e);(0,A.useEffect)(()=>{let l=QK(),c=n?()=>{}:ZK();return()=>{l(),c()}},[n]),(0,A.useEffect)(()=>{xt("app.view-mode",{viewMode:r})},[r]);let s=r==="preview"?(0,g.jsx)("section",{className:"markdown-preview-shell","aria-label":"Preview output",children:(0,g.jsx)(yJ,{onEdit:l=>{a(l),xt("app.mode-change-request",{from:"preview",to:"edit",id:l.id}),o("edit")}})}):(0,g.jsx)(_J,{composition:i,onPreview:()=>{if(n){xt("app.mode-change-request",{from:"edit",to:"discover",boot:!0}),typeof window<"u"&&(window.location.href="/discover");return}xt("app.mode-change-request",{from:"edit",to:"preview"}),o("preview")}},i.id);return(0,g.jsxs)("main",{className:"vidfarm-workbench",children:[(0,g.jsx)(KX,{boot:t??null,composition:i}),(0,g.jsx)("section",{className:"editor-output",children:(0,g.jsx)(u1,{children:s})})]})}var Ds=Kr(Qm(),1);lU();xt("boot.entry-loaded");var y1=document.getElementById("root");if(!y1){xo("boot.root-missing");let t=new Error("Missing #root element");throw ta(t),t}var Hd=zd();xt("boot.config-resolved",Hd??{source:"none"});Hd?.templateId&&Yu.setTag("hyperframes.template_id",Hd.templateId);Hd?.compositionId&&Yu.setTag("hyperframes.composition_id",Hd.compositionId);function EJ(){return(0,Ds.jsxs)("section",{style:{display:"grid",placeItems:"center",height:"100vh",padding:"24px",textAlign:"center",gap:"12px",color:"#fffbe6",background:"#050604"},children:[(0,Ds.jsx)("strong",{style:{fontSize:"0.72rem",letterSpacing:"0.14em",textTransform:"uppercase"},children:"Editor crashed"}),(0,Ds.jsx)("span",{style:{fontSize:"0.92rem",opacity:.75},children:"Something went wrong loading the editor. Reload the page to try again."})]})}try{xt("boot.render-start",{rootChildren:y1.childNodes.length}),(0,n6.createRoot)(y1).render((0,Ds.jsx)(Yu.ErrorBoundary,{fallback:(0,Ds.jsx)(EJ,{}),onError:t=>xo("boot.render-error",t instanceof Error?t.stack:t),children:(0,Ds.jsx)(e6,{boot:Hd})})),xt("boot.render-called")}catch(t){throw xo("boot.render-error",t instanceof Error?t.stack:t),ta(t),t}
|
|
1235
|
+
`);return i.every(l=>/^[-*]\s+/.test(l.trim()))?`<ul>${i.map(c=>c.trim().replace(/^[-*]\s+/,"")).map(c=>`<li>${c1(c)}</li>`).join("")}</ul>`:i.every(l=>/^\d+\.\s+/.test(l.trim()))?`<ol>${i.map(c=>c.trim().replace(/^\d+\.\s+/,"")).map(c=>`<li>${c1(c)}</li>`).join("")}</ol>`:`<p>${i.map(l=>c1(l.trim())).join("<br />")}</p>`}).filter(Boolean).join(""):""}function QX({message:t}){let e=t.text.trim().length>0,n=e?JX(t.text):"";return(0,g.jsxs)("div",{className:`chat-message chat-message--${t.role} chat-message--${t.status}`,children:[(0,g.jsx)("div",{className:"chat-message-role",children:t.role==="user"?"You":"Vidfarm"}),e&&(0,g.jsx)("div",{className:"chat-message-text chat-message-text--markdown",dangerouslySetInnerHTML:{__html:n}}),t.attachments&&t.attachments.length>0&&(0,g.jsx)("div",{className:"chat-message-attachments",children:t.attachments.map(r=>r.contentType.startsWith("image/")?(0,g.jsx)("a",{href:r.viewUrl,target:"_blank",rel:"noreferrer",className:"chat-message-attachment chat-message-attachment--image",children:(0,g.jsx)("img",{src:r.viewUrl,alt:r.fileName})},r.id):(0,g.jsxs)("a",{href:r.viewUrl,target:"_blank",rel:"noreferrer",className:"chat-message-attachment chat-message-attachment--file",children:["\u{1F4CE} ",r.fileName]},r.id))}),t.toolExchanges.map(r=>(0,g.jsx)(ZX,{exchange:r},r.toolCallId)),t.status==="error"&&t.error&&(0,g.jsx)("div",{className:"chat-message-error",children:t.error}),t.status==="pending"&&!t.text&&t.toolExchanges.length===0&&(0,g.jsx)("div",{className:"chat-message-pending",children:"Thinking..."})]})}function ZX({exchange:t}){let e=t.args?tJ(t.toolName,t.args):null,n=t.appliedError?"failed":t.appliedSummary?"applied":t.status==="pending"?"...":"done";return(0,g.jsxs)("details",{className:`chat-tool chat-tool--${t.status}${t.appliedError?" chat-tool--apply-error":""}`,children:[(0,g.jsxs)("summary",{children:[(0,g.jsx)("span",{className:"chat-tool-name",children:t.toolName}),e&&(0,g.jsx)("span",{className:"chat-tool-args",children:e}),(0,g.jsx)("span",{className:"chat-tool-status",children:n})]}),t.appliedSummary&&(0,g.jsx)("div",{className:"chat-tool-applied",children:t.appliedSummary}),t.appliedError&&(0,g.jsx)("div",{className:"chat-tool-applied chat-tool-applied--error",children:t.appliedError}),t.args&&(0,g.jsx)("pre",{className:"chat-tool-payload",children:JSON.stringify(t.args,null,2)}),t.result!==void 0&&(0,g.jsx)("pre",{className:"chat-tool-payload chat-tool-result",children:hJ(t.result)})]})}function tJ(t,e){if(t==="http_request"){let o=typeof e.method=="string"?e.method:"GET",i=typeof e.path=="string"?e.path:"";return`${o} ${i}`}if(t==="editor_action"){let o=typeof e.action_type=="string"?e.action_type:"?",i=typeof e.layer_key=="string"?` ${e.layer_key}`:"",a=typeof e.kind=="string"?` ${e.kind}`:"";return`${o}${a}${i}`}let n=Object.keys(e)[0];if(!n)return null;let r=e[n];return typeof r=="string"?`${n}: ${r.slice(0,60)}`:n}function Zl(t,e){if(!e)return t;let n=e===1?"auto-resolved 1 track collision":`auto-resolved ${e} track collisions`;return`${t} (${n})`}function t6(t,e,n){let r=n.trim();if(!r)return null;let o=h=>h.key===r||h.id===r||h.hfId===r||h.domId===r||Nt(h)===r,i=t.draftedElements.find(o);if(i)return i;if(!e)return null;let a=new DOMParser().parseFromString(e,"text/html"),s=r.replace(/["\\]/g,"\\$&"),l=a.querySelector(`[data-hf-slug="${s}"]`),c=a.querySelector(`[data-hf-id="${s}"]`)??a.getElementById(r),d=(l instanceof Element?l:null)??(c instanceof Element?c:null);if(!d)return null;let u=d.getAttribute("data-hf-id")||d.id;if(!u)return null;let p=t.draftedElements.find(h=>h.hfId===u||h.domId===u||h.id===u||h.key===u);if(p)return p;let f=Number(d.getAttribute("data-start")??0),m=Number(d.getAttribute("data-duration")??0),_=Number(d.getAttribute("data-track-index")??0),v=d instanceof HTMLElement&&d.id?d.id:void 0;return{id:u,key:u,hfId:u,domId:v,tag:d.tagName.toLowerCase(),start:Number.isFinite(f)?f:0,duration:Number.isFinite(m)?m:0,track:Number.isFinite(_)?_:0}}function eJ(t,e){if(!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0)return;let n=(a,s)=>s===0?a:n(s,a%s),r=Math.round(t),o=Math.round(e),i=n(r,o)||1;return`${r/i}:${o/i}`}function nJ(t,e){let r=l=>Number(l.toFixed(3));if(!Number.isFinite(e)||e<=0)return[];let o=t.filter(l=>Number.isFinite(l.start)&&Number.isFinite(l.end)&&l.end>l.start).sort((l,c)=>l.start-c.start),i=[];for(let l of o){let c=i[i.length-1];c&&l.start<=c.end+.001?c.end=Math.max(c.end,l.end):i.push({start:Math.max(0,l.start),end:l.end})}let a=[],s=0;for(let l of i)l.start-s>=.2&&a.push({start:r(s),end:r(l.start),duration:r(l.start-s)}),s=Math.max(s,l.end);return e-s>=.2&&a.push({start:r(s),end:r(e),duration:r(e-s)}),a}function rJ(t){let e=t.compositionHtmlRef.current,n=e?new DOMParser().parseFromString(e,"text/html"):null,r=t.getLastExport(),o=t.getCast(),i=[],a=t.draftedElements.map(v=>{let h=n?Bn(n,v):null,y=h?.style,S=h?.getAttribute("data-layer-kind")??void 0,E=h?.getAttribute("data-vf-timeline-proxy")==="video",R=H=>{if(!H)return;let gt=H.match(/(-?\d+(?:\.\d+)?)\s*%/);return gt?Number(gt[1]):void 0},C=R(y?.left),k=R(y?.top),L=R(y?.width),F=R(y?.height),U=E||C!==void 0&&k!==void 0&&L!==void 0&&F!==void 0&&C<=.5&&k<=.5&&L>=99.5&&F>=99.5,D=h?.getAttribute("src")??void 0,N=h?.getAttribute("data-volume"),B=N&&Number.isFinite(Number(N))?Number(N):void 0,Y=y?.color||void 0,st=y?.background||void 0,ot=h?.getAttribute("data-hf-id")??v.hfId??v.id,lt=h?.getAttribute("data-hf-slug")??void 0,X=h?.getAttribute("data-hf-note")??void 0,ct=(S??"").toLowerCase();return(E||["video","image","html","shape"].includes(ct))&&Number.isFinite(v.duration)&&v.duration>0&&i.push({start:v.start,end:v.start+v.duration}),{key:Nt(v),element_id:ot??void 0,slug:lt,note:X,label:v.label,kind:S,tag:v.tag,is_timeline_proxy:E||void 0,is_full_canvas:U||void 0,src:D,start:v.start,duration:v.duration,track:v.track,playback_start:v.playbackStart,x:C,y:k,width:L,height:F,volume:B,color:Y,background:st}}),s=t.composition.width,l=t.composition.height,c=Number.isFinite(t.activeCompositionDuration)?t.activeCompositionDuration:0,d=nJ(i,c),u=[];if(n)for(let v of Array.from(n.querySelectorAll("[data-vf-gen-media]"))){if(!oe(v))continue;let h=v.getAttribute("data-vf-gen-media"),y=h==="image"?"image":h==="video"?"video":null;if(!y)continue;let S=Number(v.getAttribute("data-start")),E=Number(v.getAttribute("data-duration"));u.push({layer_key:v.getAttribute("data-hf-id")||v.id,media_type:y,status:v.getAttribute("data-vf-gen-status")||"generating",job_id:v.getAttribute("data-vf-gen-job")||void 0,start:Number.isFinite(S)?S:void 0,duration:Number.isFinite(E)?E:void 0,prompt:v.getAttribute("data-vf-gen-prompt")||void 0,error:v.getAttribute("data-vf-gen-error")||void 0})}let p=YU(e),m={source_title:(n?.querySelector("[data-composition-id]")?.getAttribute("data-source-title")||"").trim()||void 0,trend_tagline:p?.trendTagline||void 0,hook:p?.hook||void 0,retention:p?.retention||void 0,payoff:p?.payoff||void 0,preserve:p?.preserve?.length?p.preserve:void 0,avoid:p?.avoid?.length?p.avoid:void 0,promotions:p?.promotions?.length?p.promotions:void 0},_=Object.values(m).some(v=>v!==void 0);return{composition_id:t.composition.id,composition_title:t.composition.title,composition_context:_?m:void 0,composition_duration_seconds:t.activeCompositionDuration,composition_width:s&&s>0?s:void 0,composition_height:l&&l>0?l:void 0,aspect_ratio:eJ(s,l),selected_layer_key:t.selectedElementId,cast:o&&o.length?o:void 0,timeline_gaps:d.length?d:void 0,pending_generations:u.length?u:void 0,last_export_url:r.url,last_export_title:r.title,last_export_status:r.status,last_export_render_id:r.renderId,layers:a}}function CU(t,e){let n=e.compositionHtmlRef.current;if(!n)return{ok:!1,error:"Composition not loaded yet."};if(t.action_type==="replace_composition_html"){let i=t.composition_html;return!i||!i.includes("data-composition-id=")?{ok:!1,error:"composition_html must be a full HTML document containing data-composition-id."}:(e.patchCompositionHtml(i),{ok:!0,summary:`Replaced composition (${i.length} bytes).`})}if(t.action_type==="export_composition")return e.isExportInFlight()?{ok:!1,error:"Render already in flight \u2014 wait for the current render to finish."}:(e.startExport(),{ok:!0,summary:"Started composition export. The exported MP4 URL will land in editor_context.last_export_url when it succeeds."});if(t.action_type==="add_layer")return oJ(t,e,n);if(t.action_type==="generate_layer")return iJ(t,e,n);if(t.action_type==="group_layers")return pJ(t,e,n);if(t.action_type==="ungroup_layers")return mJ(t,e,n);let r=t.layer_key;if(!r)return{ok:!1,error:`layer_key required for ${t.action_type}.`};let o=t6(e,n,r);if(!o)return{ok:!1,error:`Layer not found: ${r}`};if(t.action_type==="set_layer_identity"){let i=Zo(n,o,a=>{if(t.slug!==void 0){let s=r0(t.slug);s?a.setAttribute("data-hf-slug",s):a.removeAttribute("data-hf-slug")}if(t.note!==void 0){let s=t.note.trim();s?a.setAttribute("data-hf-note",s):a.removeAttribute("data-hf-note")}});return i===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(i),{ok:!0,summary:`Updated identity of ${r} (slug=${t.slug??"-"} note=${t.note?"yes":"-"}).`})}if(t.action_type==="remove_layer")try{let{html:i,resolvedCollisions:a}=Ao(n,s=>{let l=Bn(s,o);l?.parentNode&&l.parentNode.removeChild(l)});return i===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(i),{ok:!0,summary:Zl(`Removed layer ${r}.`,a)})}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}if(t.action_type==="set_layer_timing"){let i={};if(t.start!==void 0&&(i.start=t.start),t.duration!==void 0&&(i.duration=t.duration),t.track!==void 0&&(i.track=t.track),t.playback_start!==void 0&&(i.playbackStart=t.playback_start),Object.keys(i).length===0)return{ok:!1,error:"set_layer_timing needs at least one of start, duration, track, or playback_start."};{let a=i.start??o.start,s=i.duration??o.duration,l=i.track??o.track,c=o.hfId||o.domId||o.id,d=new DOMParser().parseFromString(n,"text/html"),u=zm(d,{start:a,duration:s,track:l},new Set(c?[c]:[]));u!==l&&(i.track=u)}try{let{html:a,resolvedCollisions:s}=KU(n,o,i);if(a===n)return{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."};e.patchCompositionHtml(a);let l=Object.entries(i).map(([c,d])=>`${c}=${d}`).join(" ");return{ok:!0,summary:Zl(`Updated ${r} timing (${l}).`,s)}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}if(t.action_type==="set_layer_visual"){let a=["x","y","width","height","font_size","border_radius"].filter(c=>t[c]!==void 0);if(a.length===0)return{ok:!1,error:"set_layer_visual needs at least one of x, y, width, height, font_size, or border_radius."};let s=Zo(n,o,c=>{t.x!==void 0&&(c.style.left=`${t.x}%`),t.y!==void 0&&(c.style.top=`${t.y}%`),t.width!==void 0&&(c.style.width=`${t.width}%`),t.height!==void 0&&(c.style.height=`${t.height}%`),t.font_size!==void 0&&(c.style.fontSize=`${t.font_size}px`),t.border_radius!==void 0&&(c.style.borderRadius=`${t.border_radius}px`)});if(s===n)return{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."};e.patchCompositionHtml(s);let l=a.map(c=>`${c}=${t[c]}`).join(" ");return{ok:!0,summary:`Updated ${r} visual (${l}).`}}if(t.action_type==="set_layer_media")return cJ(t,e,n,o);if(t.action_type==="set_layer_style")return uJ(t,e,n,o);if(t.action_type==="duplicate_layer")return dJ(t,e,n,o);if(t.action_type==="split_layer")return fJ(t,e,n,o);if(t.action_type==="set_layer_text"){if(t.text===void 0)return{ok:!1,error:"set_layer_text requires a text value."};let i=t.text,a=Zo(n,o,s=>{s.textContent=i});return a===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(a),{ok:!0,summary:`Updated ${r} text.`})}return{ok:!1,error:`Unknown action_type: ${t.action_type??"(none)"}`}}function oJ(t,e,n){let r=t.kind;if(!r)return{ok:!1,error:"add_layer requires a kind (video, image, audio, text, or html)."};if((r==="video"||r==="image"||r==="audio")&&!t.src?.trim())return{ok:!1,error:`add_layer kind=${r} requires src (media URL).`};if(r==="text"&&t.text===void 0)return{ok:!1,error:"add_layer kind=text requires text."};if(r==="html"&&!t.html?.trim())return{ok:!1,error:"add_layer kind=html requires html."};let o=e.activeCompositionDuration>0?e.activeCompositionDuration:0,i=t.start??0,a=Math.max(0,o>0?Math.min(o-.1,i):i),s=o>0?Math.max(.1,o-a):4,l=t.duration??Math.min(4,s),c=Math.max(.1,o>0?Math.min(l,s):l),d=r==="text"?{x:12,y:68,width:76,height:12}:r==="audio"?{x:0,y:0,width:0,height:0}:{x:0,y:0,width:100,height:100},u=Lt(t.x??d.x,0,100),p=Lt(t.y??d.y,0,100),f=Lt(t.width??d.width,0,100),m=Lt(t.height??d.height,0,100),_=t.layer_key?.trim(),h=(_&&/^[A-Za-z][\w-]{0,63}$/.test(_)?_.startsWith("element_")?_:`element_${_}`:null)??`element_${r}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,y=t.label?.trim()||(r==="text"?"New text":r==="html"?"Custom HTML":`New ${r}`);try{let{html:S,resolvedCollisions:E}=Ao(n,R=>{let C=R.querySelector("[data-composition-id]");if(!oe(C))throw new Error("Composition root not found.");let k=Array.from(R.querySelectorAll("[data-start]")).filter(Y=>oe(Y)),L=t.track,F=k.reduce((Y,st)=>{let ot=Number(st.getAttribute("data-track-index")??0);return Number.isFinite(ot)?Math.max(Y,ot+1):Y},0),U=Number.isFinite(L)&&L!==void 0?Math.max(0,Math.floor(L)):F,D=zm(R,{start:a,duration:c,track:U},new Set([h])),N;r==="video"?N=R.createElement("video"):r==="image"?N=R.createElement("img"):r==="audio"?N=R.createElement("audio"):N=R.createElement("div"),N.id=h,N.setAttribute("data-hf-id",h),N.setAttribute("data-layer-mode","publish");let B=r==="text"?"caption":r;if(N.setAttribute("data-layer-kind",B),N.setAttribute("data-viral-note",`AI inserted ${r} layer.`),N.setAttribute("data-start",Kt(a)),N.setAttribute("data-duration",Kt(c)),N.setAttribute("data-end",Kt(a+c)),N.setAttribute("data-track-index",String(D)),N.setAttribute("data-label",y),N.classList.add("clip"),t.slug){let Y=r0(t.slug);Y&&N.setAttribute("data-hf-slug",Y)}if(t.note&&t.note.trim()&&N.setAttribute("data-hf-note",t.note.trim()),r!=="audio"?(N.style.position="absolute",N.style.left=`${u}%`,N.style.top=`${p}%`,N.style.width=`${f}%`,N.style.height=`${m}%`,N.style.zIndex=String(D),N.style.overflow="hidden"):N.style.display="none",r==="video"&&t.src){N.setAttribute("src",t.src),N.setAttribute("playsinline",""),N.setAttribute("preload","auto"),t.muted===!1||t.volume!==void 0&&t.volume>0||N.setAttribute("muted",""),N.setAttribute("data-volume",String(t.volume??1));let st=Kt(t.playback_start??0);N.setAttribute("data-media-start",st),N.setAttribute("data-playback-start",st),N.style.objectFit=t.object_fit??"cover",t.object_position&&(N.style.objectPosition=t.object_position),N.style.background="#050604"}else if(r==="image"&&t.src)N.setAttribute("src",t.src),N.style.objectFit=t.object_fit??"cover",t.object_position&&(N.style.objectPosition=t.object_position),t.ken_burns&&t.ken_burns!=="none"&&Pm(N,t.ken_burns,t.ken_burns_intensity);else if(r==="audio"&&t.src){if(N.setAttribute("src",t.src),N.setAttribute("preload","auto"),t.volume!==void 0&&N.setAttribute("data-volume",String(t.volume)),t.playback_start!==void 0){let Y=Kt(t.playback_start);N.setAttribute("data-media-start",Y),N.setAttribute("data-playback-start",Y)}}else r==="text"?(N.setAttribute("data-text-background-style","plain"),N.setAttribute("data-text-background-color",t.background??"#000000"),N.setAttribute("data-font-family","Montserrat"),N.style.display="flex",N.style.alignItems="center",N.style.justifyContent="center",N.style.padding="3px",N.style.boxSizing="border-box",N.style.textAlign="center",N.style.color=t.color??"#ffffff",N.style.background="transparent",N.style.fontFamily="Montserrat, 'TikTok Sans', sans-serif",N.style.fontWeight="600",N.style.fontSize=`${t.font_size??22}px`,N.style.lineHeight="1.2",Q_(N,t.text??"","plain",t.color??"#ffffff",t.background??"#000000","Montserrat",600)):r==="html"&&t.html&&(N.innerHTML=t.html,t.color&&(N.style.color=t.color),t.background&&(N.style.background=t.background),t.font_size!==void 0&&(N.style.fontSize=`${t.font_size}px`));C.append(N)});return e.patchCompositionHtml(S),{ok:!0,summary:Zl(`Added ${r} layer ${h} (start=${a} duration=${c}).`,E)}}catch(S){return{ok:!1,error:S instanceof Error?S.message:String(S)}}}var MU="data:image/svg+xml;charset=utf-8,"+encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='360' height='640' viewBox='0 0 360 640'><rect width='360' height='640' fill='#0c0f0a'/><circle cx='180' cy='300' r='34' fill='none' stroke='#3ad07a' stroke-width='6' stroke-linecap='round' stroke-dasharray='150 60'/><text x='180' y='378' fill='#8ad9a6' font-family='monospace' font-size='20' text-anchor='middle'>Generating\u2026</text></svg>");function iJ(t,e,n){let r=t.media_type==="image"?"image":t.media_type==="video"?"video":null;if(!r)return{ok:!1,error:"generate_layer requires media_type 'video' or 'image'."};let o=t.prompt?.trim();if(!o)return{ok:!1,error:"generate_layer requires a non-empty prompt."};let i=t.intent??(t.replace_layer_key?"replace_layer":"add"),a=t.start,s=t.duration,l=t.track,c=t.x,d=t.y,u=t.width,p=t.height,f=null;if(i==="replace_layer"){let B=(t.replace_layer_key||t.layer_key||"").trim();if(!B)return{ok:!1,error:"generate_layer intent=replace_layer requires replace_layer_key (the layer to replace)."};let Y=t6(e,n,B);if(!Y)return{ok:!1,error:`generate_layer: layer to replace not found: ${B}`};f=Y;let st=new DOMParser().parseFromString(n,"text/html"),ot=Bn(st,Y),lt=ot?ot.getAttribute("data-vf-timeline-proxy")!==null||ot.getAttribute("data-vf-full-canvas")==="true"||ot.style.width==="100%"&&ot.style.height==="100%":!1;if(a===void 0&&(a=Y.start),s===void 0&&(s=Y.duration>0?Y.duration:void 0),l===void 0&&(l=Y.track),lt)c=0,d=0,u=100,p=100;else if(ot){let X=ct=>{let H=Number.parseFloat(ct);return Number.isFinite(H)?H:void 0};c===void 0&&(c=X(ot.style.left)),d===void 0&&(d=X(ot.style.top)),u===void 0&&(u=X(ot.style.width)),p===void 0&&(p=X(ot.style.height))}}let m=f?f.hfId||f.id:null,_=t.layer_key?.trim(),v=_&&_!==m&&/^[A-Za-z][\w-]{0,63}$/.test(_)?_:`vf-gen-${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,h=v.startsWith("element_")?v:`element_${v}`,y=e.activeCompositionDuration>0?e.activeCompositionDuration:0,S=a??0,E=Math.max(0,y>0?Math.min(y-.1,S):S),R=y>0?Math.max(.1,y-E):4,C=s??Math.min(r==="video"?t.gen_duration??4:4,R),k=Math.max(.1,y>0?Math.min(C,R):C),L=Lt(c??0,0,100),F=Lt(d??0,0,100),U=Lt(u??100,0,100),D=Lt(p??100,0,100),N=o.length>140?`${o.slice(0,137)}\u2026`:o;try{let{html:B,resolvedCollisions:Y}=Ao(n,ot=>{let lt=ot.querySelector("[data-composition-id]");if(!oe(lt))throw new Error("Composition root not found.");if(f){let dt=Bn(ot,f);dt?.parentNode&&dt.parentNode.removeChild(dt)}let X=l,ct=Array.from(ot.querySelectorAll("[data-start]")).reduce((dt,Xt)=>{let Ce=Number(Xt.getAttribute("data-track-index")??0);return Number.isFinite(Ce)?Math.max(dt,Ce+1):dt},0),H=Number.isFinite(X)&&X!==void 0?Math.max(0,Math.floor(X)):ct,gt=zm(ot,{start:E,duration:k,track:H},new Set([h])),J=r==="video"?ot.createElement("video"):ot.createElement("img");if(J.id=h,J.setAttribute("data-hf-id",h),J.setAttribute("data-layer-mode","publish"),J.setAttribute("data-layer-kind",r),J.setAttribute("data-viral-note",`AI generating ${r}: ${N}`),J.setAttribute("data-start",Kt(E)),J.setAttribute("data-duration",Kt(k)),J.setAttribute("data-end",Kt(E+k)),J.setAttribute("data-track-index",String(gt)),J.setAttribute("data-label",`Generating ${r}\u2026`),J.classList.add("clip"),t.slug){let dt=r0(t.slug);dt&&J.setAttribute("data-hf-slug",dt)}J.setAttribute("data-vf-gen","1"),J.setAttribute("data-vf-gen-media",r),J.setAttribute("data-vf-gen-status","submitting"),J.setAttribute("data-vf-gen-prompt",N),J.style.position="absolute",J.style.left=`${L}%`,J.style.top=`${F}%`,J.style.width=`${U}%`,J.style.height=`${D}%`,J.style.zIndex=String(gt),J.style.overflow="hidden",J.style.objectFit=t.object_fit??"cover",J.style.background="#0c0f0a",r==="video"?(J.setAttribute("poster",MU),J.setAttribute("playsinline",""),J.setAttribute("preload","auto"),J.setAttribute("muted",""),J.setAttribute("data-volume","1"),J.setAttribute("data-media-start","0"),J.setAttribute("data-playback-start","0")):(J.setAttribute("src",MU),t.ken_burns&&t.ken_burns!=="none"&&Pm(J,t.ken_burns,t.ken_burns_intensity)),lt.append(J)});e.patchCompositionHtml(B),aJ({deps:e,genId:h,mediaType:r,prompt:o,action:t});let st=i==="replace_layer"?`replacing ${m}`:`at ${E.toFixed(2)}s`;return{ok:!0,summary:Zl(`Started ${r} generation (${st}). A placeholder is on the timeline as ${v}; it will swap to the finished media automatically. Watch editor_context.pending_generations.`,Y)}}catch(B){return{ok:!1,error:B instanceof Error?B.message:String(B)}}}function Mm(t,e,n){let r=t.compositionHtmlRef.current;if(!r)return!1;let o=e.replace(/["\\]/g,"\\$&"),i=new DOMParser().parseFromString(r,"text/html"),a=i.querySelector(`[data-hf-id="${o}"]`);return oe(a)?(n(a),t.patchCompositionHtml(Z_(i)),!0):!1}async function aJ(t){let{deps:e,genId:n,mediaType:r,prompt:o,action:i}=t,a=r==="video"?"/api/v1/primitives/videos/generate":"/api/v1/primitives/images/generate",s=i.aspect_ratio?.trim(),l=i.provider?.trim(),c=i.model?.trim(),d=(i.input_references??[]).filter(m=>typeof m=="string"&&/^https?:\/\//i.test(m)),u=(i.prompt_attachments??[]).filter(m=>typeof m=="string"&&/^https?:\/\//i.test(m)),p={prompt:o};s&&(p.aspect_ratio=s),l&&(p.provider=l),c&&(p.model=c),r==="video"?(i.gen_duration&&Number.isFinite(i.gen_duration)&&(p.duration=Math.round(i.gen_duration)),i.resolution&&(p.resolution=i.resolution),i.generate_audio!==void 0&&(p.generate_audio=i.generate_audio),d.length&&(p.input_references=d.slice(0,8))):u.length&&(p.prompt_attachments=u.slice(0,16));let f=`editor-gen-${Date.now().toString(36)}`;try{let m=await fetch(a,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tracer:f,payload:p})}),_=await m.json().catch(()=>({}));if(!m.ok||!_.job_id){let v=_.error||`generation request failed (${m.status})`;Mm(e,n,h=>{h.setAttribute("data-vf-gen-status","error"),h.setAttribute("data-vf-gen-error",v.slice(0,200))});return}Mm(e,n,v=>{v.setAttribute("data-vf-gen-job",_.job_id),v.setAttribute("data-vf-gen-tracer",f),v.setAttribute("data-vf-gen-status","generating")})}catch(m){Mm(e,n,_=>{_.setAttribute("data-vf-gen-status","error"),_.setAttribute("data-vf-gen-error",(m instanceof Error?m.message:String(m)).slice(0,200))})}}function sJ(t){if(!t)return null;let e=l=>typeof l=="string"&&l.trim()?l.trim():null,n=l=>l&&typeof l=="object"?l:null,r=n(t.result)??{},o=n(r.output)??r,i=e(o.primary_file_url)??e(n(o.video)?.file_url)??e(n(o.image)?.file_url)??e(n(o.render)?.output_url);if(i)return i;let a=o.files;if(Array.isArray(a))for(let l of a){let c=e(typeof l=="string"?l:n(l)?.file_url??n(l)?.url);if(c)return c}let s=Array.isArray(t.artifacts)?t.artifacts:[];for(let l of s){let c=e(n(l)?.public_url);if(c)return c}return null}function lJ(t,e,n){return Mm(t,e,r=>{let o=r.getAttribute("data-vf-gen-media");r.setAttribute("src",n),r.removeAttribute("poster"),r.removeAttribute("data-vf-gen"),r.removeAttribute("data-vf-gen-media"),r.removeAttribute("data-vf-gen-prompt"),r.removeAttribute("data-vf-gen-job"),r.removeAttribute("data-vf-gen-tracer"),r.removeAttribute("data-vf-gen-error"),r.removeAttribute("data-vf-gen-status");let i=r.getAttribute("data-label");i&&/generating/i.test(i)&&r.setAttribute("data-label",o==="image"?"AI image":"AI video"),r.setAttribute("data-viral-note",`AI generated ${o==="image"?"image":"video"}.`)})}function cJ(t,e,n,r){let o=[],i=Zo(n,r,a=>{if(t.src!==void 0&&(a.setAttribute("src",t.src),o.push(`src=${t.src.slice(0,60)}`)),t.volume!==void 0&&(a.setAttribute("data-volume",String(t.volume)),o.push(`volume=${t.volume}`)),t.muted!==void 0&&(t.muted?a.setAttribute("muted",""):a.removeAttribute("muted"),o.push(`muted=${t.muted}`)),t.playback_start!==void 0){let s=Kt(t.playback_start);a.setAttribute("data-media-start",s),a.setAttribute("data-playback-start",s),o.push(`playback_start=${s}`)}t.object_fit&&(a.style.objectFit=t.object_fit,o.push(`object_fit=${t.object_fit}`)),t.object_position&&(a.style.objectPosition=t.object_position,o.push(`object_position=${t.object_position}`)),t.ken_burns!==void 0&&(Pm(a,t.ken_burns==="none"?null:t.ken_burns,t.ken_burns_intensity),o.push(`ken_burns=${t.ken_burns}`))});return o.length===0?{ok:!1,error:"set_layer_media needs at least one of src, volume, muted, playback_start, object_fit, object_position, or ken_burns."}:i===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(i),{ok:!0,summary:`Updated ${r.id} media (${o.join(" ")}).`})}function uJ(t,e,n,r){let o=[],i=Zo(n,r,a=>{if(t.color){a.style.color=t.color;let s=a.querySelector("[data-vf-text-inline]");s&&(s.style.color=t.color),o.push(`color=${t.color}`)}if(t.background_style||t.background!==void 0){let s=t.background_style??a.getAttribute("data-text-background-style")??"plain",l=t.background??a.getAttribute("data-text-background-color")??"#000000";a.setAttribute("data-text-background-style",s),a.setAttribute("data-text-background-color",l),o.push(`background=${l}(${s})`)}t.font_family&&(a.setAttribute("data-font-family",t.font_family),a.style.fontFamily=`${t.font_family}, 'TikTok Sans', sans-serif`,o.push(`font_family=${t.font_family}`)),t.font_weight!==void 0&&(a.style.fontWeight=String(t.font_weight),o.push(`font_weight=${t.font_weight}`)),t.italic!==void 0&&(a.style.fontStyle=t.italic?"italic":"normal",o.push(`italic=${t.italic}`)),t.underline!==void 0&&(a.style.textDecorationLine=t.underline?"underline":"none",o.push(`underline=${t.underline}`)),t.text_align&&(a.style.textAlign=t.text_align,o.push(`text_align=${t.text_align}`)),t.border_radius!==void 0&&(a.style.borderRadius=`${t.border_radius}px`,o.push(`border_radius=${t.border_radius}`)),t.font_size!==void 0&&(a.style.fontSize=`${t.font_size}px`,o.push(`font_size=${t.font_size}`))});return o.length===0?{ok:!1,error:"set_layer_style needs at least one style field."}:i===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(i),{ok:!0,summary:`Updated ${r.id} style (${o.join(" ")}).`})}function dJ(t,e,n,r){let o=t.layer_keys?.[1]?.trim(),a=(o&&/^[A-Za-z][\w-]{0,63}$/.test(o)?o.startsWith("element_")?o:`element_${o}`:null)??`element_dup_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`;try{let{html:s,resolvedCollisions:l}=Ao(n,c=>{let d=Bn(c,r);if(!d)throw new Error(`Layer node not found: ${r.id}`);let u=d.cloneNode(!0);u.id=a,u.setAttribute("data-hf-id",a),t.start!==void 0&&u.setAttribute("data-start",Kt(t.start)),t.duration!==void 0&&u.setAttribute("data-duration",Kt(t.duration)),t.label&&u.setAttribute("data-label",t.label);let p=Number(u.getAttribute("data-start")??r.start),f=Number(u.getAttribute("data-duration")??r.duration),m=t.track!==void 0?Math.max(0,Math.floor(t.track)):r.track,_=zm(c,{start:p,duration:f,track:m},new Set([r.hfId,r.domId,r.id,a].filter(v=>!!v)));u.setAttribute("data-track-index",String(_)),d.after(u)});return s===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(s),{ok:!0,summary:Zl(`Duplicated ${r.id} as ${a}.`,l)})}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}}function fJ(t,e,n,r){let o=t.split_time;if(o===void 0)return{ok:!1,error:"split_layer requires split_time."};if(o<=r.start||o>=r.start+r.duration)return{ok:!1,error:"split_time must fall inside the layer's [start, start+duration] range."};let i=`element_split_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`;try{let a=Zo(n,r,s=>{let l=Number(s.getAttribute("data-start")??r.start),c=Number(s.getAttribute("data-duration")??r.duration),d=o-l,u=l+c-o,p=Number(s.getAttribute("data-playback-start")??s.getAttribute("data-media-start")??r.playbackStart??0),f=Kt(p+d),m=s.getAttribute("data-layer-kind")??"layer";s.setAttribute("data-duration",Kt(d));let _=s.cloneNode(!0);_.id=i,_.setAttribute("data-hf-id",i),_.setAttribute("data-start",Kt(o)),_.setAttribute("data-duration",Kt(u)),_.setAttribute("data-media-start",f),_.setAttribute("data-playback-start",f),_.setAttribute("data-layer-kind",m),_.setAttribute("data-label",`${r.label??r.id} split`),s.after(_)});return a===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(a),{ok:!0,summary:`Split ${r.id} at ${o}; new layer ${i}.`})}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}function pJ(t,e,n){let r=(t.layer_keys??[]).filter(c=>typeof c=="string"&&c.trim().length>0);if(r.length<2)return{ok:!1,error:"group_layers requires layer_keys with at least two entries."};let o=r.map(c=>e.draftedElements.find(d=>Nt(d)===c)).filter(c=>!!c);if(o.length!==r.length)return{ok:!1,error:"One or more layer_keys not found in the composition."};let i=`vf-group-${Date.now().toString(36)}`,a=t.group_label?.trim()||"Vidfarm group",{html:s,resolvedCollisions:l}=Ao(n,c=>{for(let d of o){let u=Bn(c,d);u&&(u.setAttribute("data-vf-group",i),u.setAttribute("data-vf-group-label",a))}});return s===n?{ok:!1,error:"No change applied \u2014 layers not found."}:(e.patchCompositionHtml(s),{ok:!0,summary:Zl(`Grouped ${o.length} layers as ${i}.`,l)})}function mJ(t,e,n){let r=(t.layer_keys??[]).filter(s=>typeof s=="string"&&s.trim().length>0);if(r.length===0)return{ok:!1,error:"ungroup_layers requires layer_keys."};let o=r.map(s=>e.draftedElements.find(l=>Nt(l)===s)).filter(s=>!!s);if(o.length===0)return{ok:!1,error:"No matching layers found for ungroup_layers."};let{html:i,resolvedCollisions:a}=Ao(n,s=>{let l=new Set;for(let c of o){let u=Bn(s,c)?.getAttribute("data-vf-group");u&&l.add(u)}for(let c of l)for(let d of Array.from(s.querySelectorAll(`[data-vf-group="${CSS.escape(c)}"]`)))oe(d)&&(d.removeAttribute("data-vf-group"),d.removeAttribute("data-vf-group-label"))});return i===n?{ok:!1,error:"No change applied \u2014 layers were not grouped."}:(e.patchCompositionHtml(i),{ok:!0,summary:Zl(`Ungrouped ${o.length} layers.`,a)})}function gJ(t){if(!t||typeof t!="object")return null;let e=t,n=e.action_type;if(typeof n!="string"||!["add_layer","remove_layer","set_layer_timing","set_layer_visual","set_layer_text","set_layer_media","set_layer_style","set_layer_identity","duplicate_layer","split_layer","group_layers","ungroup_layers","replace_composition_html","generate_layer"].includes(n))return null;let o=v=>typeof e[v]=="string"?e[v]:void 0,i=v=>typeof e[v]=="number"&&Number.isFinite(e[v])?e[v]:void 0,a=v=>typeof e[v]=="boolean"?e[v]:void 0,s=v=>Array.isArray(e[v])?e[v].filter(h=>typeof h=="string"):void 0,l=e.kind,c=l==="video"||l==="image"||l==="audio"||l==="text"||l==="html"?l:void 0,d=e.background_style,u=d==="plain"||d==="outline"||d==="highlight-solid"||d==="highlight-translucent"||d==="fullwidth"?d:void 0,p=e.media_type,f=p==="video"||p==="image"?p:void 0,m=e.intent,_=m==="fill_gap"||m==="replace_layer"||m==="add"?m:void 0;return{action_type:n,layer_key:o("layer_key"),layer_keys:s("layer_keys"),kind:c,src:o("src"),html:o("html"),label:o("label"),start:i("start"),duration:i("duration"),track:i("track"),playback_start:i("playback_start"),split_time:i("split_time"),x:i("x"),y:i("y"),width:i("width"),height:i("height"),font_size:i("font_size"),font_family:o("font_family"),font_weight:i("font_weight"),italic:a("italic"),underline:a("underline"),text_align:o("text_align"),border_radius:i("border_radius"),color:o("color"),background:o("background"),background_style:u,object_fit:o("object_fit"),object_position:o("object_position"),ken_burns:o("ken_burns"),ken_burns_intensity:i("ken_burns_intensity"),slug:o("slug"),note:o("note"),volume:i("volume"),muted:a("muted"),group_label:o("group_label"),text:o("text"),composition_html:o("composition_html"),explanation:o("explanation"),media_type:f,intent:_,prompt:o("prompt"),input_references:s("input_references"),prompt_attachments:s("prompt_attachments"),aspect_ratio:o("aspect_ratio"),gen_duration:i("gen_duration"),provider:o("provider"),model:o("model"),resolution:o("resolution"),generate_audio:a("generate_audio"),replace_layer_key:o("replace_layer_key")}}function hJ(t){try{return JSON.stringify(t,null,2)}catch{return String(t)}}function bJ({item:t}){let[e,n]=(0,A.useState)(0);if(t.media.type==="slideshow"){let r=t.media.slides.length,o=i=>{n((i+r)%r)};return(0,g.jsx)("div",{className:"document-video-block slideshow-preview-block",children:(0,g.jsxs)("div",{className:"document-video-stage slideshow-preview-stage",children:[(0,g.jsxs)("div",{className:"slideshow-preview-stack",children:[(0,g.jsx)("button",{type:"button",className:"carousel-nav previous","aria-label":"Previous slide",onClick:()=>o(e-1),children:"\u2039"}),(0,g.jsx)("img",{src:t.media.slides[e],alt:`Slide ${e+1}`}),(0,g.jsx)("button",{type:"button",className:"carousel-nav next","aria-label":"Next slide",onClick:()=>o(e+1),children:"\u203A"}),(0,g.jsxs)("span",{className:"carousel-count",children:[e+1," / ",r]})]}),(0,g.jsx)("div",{className:"slideshow-thumb-strip","aria-label":"Slides",children:t.media.slides.map((i,a)=>(0,g.jsx)("button",{type:"button",className:e===a?"active":"","aria-label":`Show slide ${a+1}`,onClick:()=>n(a),children:(0,g.jsx)("img",{src:i,alt:""})},i))})]})})}return(0,g.jsx)("div",{className:"document-video-block repeated-video-block",children:(0,g.jsx)("div",{className:"document-video-stage",children:(0,g.jsx)("video",{src:t.media.src,controls:!0,playsInline:!0,preload:"metadata",onLoadedMetadata:r=>{let o=r.currentTarget;xt("preview.video.loaded-metadata",{id:t.id,currentSrc:o.currentSrc,duration:o.duration,videoWidth:o.videoWidth,videoHeight:o.videoHeight})},onError:r=>{let o=r.currentTarget;xo("preview.video.error",{id:t.id,currentSrc:o.currentSrc,errorCode:o.error?.code,errorMessage:o.error?.message})}})})})}function yJ({onEdit:t}){return(0,g.jsx)("div",{className:"preview-feed","aria-label":"Preview output",children:Um.map(e=>{let n=[["Hook",e.viralDna.hook],["Retention",e.viralDna.retention],["Payoff",e.viralDna.payoff]];return(0,g.jsxs)("article",{className:"preview-feed-card",children:[(0,g.jsxs)("header",{className:"markdown-preview-header",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{children:e.eyebrow}),(0,g.jsx)("h1",{children:e.title})]}),(0,g.jsx)("div",{className:"markdown-preview-actions",children:(0,g.jsx)("button",{type:"button",className:"main-action-button",title:"Edit composition",onClick:()=>{xt("preview.edit-click",{id:e.id}),t(e)},children:"Edit"})})]}),(0,g.jsxs)("div",{className:"preview-feed-body",children:[(0,g.jsx)("div",{className:"preview-feed-spacer","aria-hidden":"true"}),(0,g.jsx)("section",{className:"preview-video-column","aria-label":"Reference render",children:(0,g.jsx)(bJ,{item:e})}),(0,g.jsxs)("aside",{className:"preview-detail-scroll","aria-label":"Preview details",children:[(0,g.jsxs)("section",{className:"markdown-section hero-section",children:[(0,g.jsx)("h2",{children:"Reference Render"}),(0,g.jsx)("p",{children:e.summary})]}),(0,g.jsxs)("section",{className:"markdown-section",children:[(0,g.jsx)("h2",{children:"Viral DNA"}),n.map(([r,o])=>(0,g.jsxs)("section",{className:"markdown-subsection",children:[(0,g.jsx)("h3",{children:r}),(0,g.jsx)("p",{children:o})]},r))]}),(0,g.jsxs)("section",{className:"markdown-section",children:[(0,g.jsx)("h2",{children:"Preserve"}),(0,g.jsx)("ul",{children:e.viralDna.preserve.map(r=>(0,g.jsx)("li",{children:r},r))})]}),(0,g.jsxs)("section",{className:"markdown-section",children:[(0,g.jsx)("h2",{children:"Avoid"}),(0,g.jsx)("ul",{children:e.viralDna.avoid.map(r=>(0,g.jsx)("li",{children:r},r))})]}),(0,g.jsxs)("section",{className:"markdown-section",children:[(0,g.jsx)("h2",{children:"Semantic Layers"}),(0,g.jsx)("div",{className:"markdown-layer-list",children:m1(e).map(r=>(0,g.jsxs)("article",{className:"markdown-layer-row",children:[(0,g.jsx)("span",{children:fX(r.kind,r.customHtml)}),(0,g.jsxs)("div",{children:[(0,g.jsx)("h3",{children:r.label}),(0,g.jsx)("p",{children:r.viralNote})]}),(0,g.jsxs)("time",{children:[X_(r.start)," - ",X_(r.start+r.duration)]})]},r.id))})]})]})]})]},e.id)})})}function _J({onPreview:t,composition:e}){let[n,r]=(0,A.useState)(null),[o,i]=(0,A.useState)(null),[a,s]=(0,A.useState)(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("fork")),[l,c]=(0,A.useState)(null),d=(0,A.useMemo)(()=>qU(e),[e]),u=(0,A.useRef)(null);(0,A.useEffect)(()=>{let f=!0;return xt("editor.studio-import-start"),W_().then(m=>{xt("editor.studio-import-success",{exports:Object.keys(m).sort()}),f&&r(m)}).catch(m=>{xo("editor.studio-import-error",m instanceof Error?m.stack:m),f&&i(m instanceof Error?m.message:String(m))}),()=>{f=!1,xt("editor.studio-import-cleanup")}},[]),(0,A.useEffect)(()=>{let f=!0,m=a?`/api/v1/compositions/${encodeURIComponent(a)}/composition.html`:`/editor/${encodeURIComponent(e.id)}/composition`;return fetch(m,{cache:"default"}).then(_=>_.ok?_.text():null).then(_=>{f&&c(Xl(_??d))}).catch(()=>{f&&c(Xl(d))}),()=>{f=!1}},[e.id,d,a]),(0,A.useEffect)(()=>{!n||!l||n.usePlayerStore.getState().reset()},[l,n]);let p=(0,A.useCallback)(async()=>{if(a)return a;if(u.current)return u.current;let f=(async()=>{let m=await fetch("/api/v1/compositions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:e.id,title:e.title})}),_=await m.json().catch(()=>({}));if(!m.ok||!_?.fork_id)throw new Error(_?.error||`Fork creation failed (${m.status})`);if(s(_.fork_id),typeof window<"u"){let v=new URL(window.location.href);v.searchParams.set("fork",_.fork_id),window.history.replaceState(null,"",v)}return _.fork_id})();u.current=f;try{return await f}finally{u.current=null}},[e.id,e.title,a]);return o?(0,g.jsxs)("section",{className:"editor-loading-shell","aria-label":"Editor load failed",children:[(0,g.jsx)("span",{children:"Editor failed to load"}),(0,g.jsx)("small",{children:o})]}):!n||!l?(0,g.jsx)("section",{className:"editor-loading-shell","aria-label":"Loading video editor",children:(0,g.jsx)("span",{children:"Loading editor"})}):(0,g.jsx)(vJ,{studio:n,onPreview:t,composition:e,initialCompositionHtml:l,forkId:a,ensureFork:p,replaceForkId:s})}function vJ({studio:t,onPreview:e,composition:n,initialCompositionHtml:r,forkId:o,ensureFork:i,replaceForkId:a}){let{Player:s,Timeline:l,liveTime:c,resolveIframe:d,usePlayerStore:u,useTimelinePlayer:p}=t,f=GU(n),[m,_]=(0,A.useState)(()=>r),v=(0,A.useMemo)(()=>{let b=YU(m);return b?{...n,viralDna:b}:n},[n,m]),h=(0,A.useRef)(m),[y,S]=(0,A.useState)(0),[E,R]=(0,A.useState)(!0),[C,k]=(0,A.useState)("1"),[L,F]=(0,A.useState)(null),[U,D]=(0,A.useState)(null),N=(0,A.useRef)(null),B=(0,A.useRef)(null),[Y,st]=(0,A.useState)(null),[ot,lt]=(0,A.useState)(()=>new Map),[X,ct]=(0,A.useState)(()=>new Map),[H,gt]=(0,A.useState)(null),[J,dt]=(0,A.useState)(null),[Xt,Ce]=(0,A.useState)(!1),[_n,Pn]=(0,A.useState)(!1),[tt,Vt]=(0,A.useState)(null);(0,A.useEffect)(()=>{if(!o){Vt(null);return}let b=!0;return fetch(`/api/v1/compositions/${encodeURIComponent(o)}`).then(T=>T.ok?T.json():null).then(T=>{if(!b||!T)return;let x=Number(T.latest_version);Number.isFinite(x)&&Vt(x)}).catch(()=>{}),()=>{b=!1}},[o,H?.version]);let[Ut,ft]=(0,A.useState)(0),[ee,mt]=(0,A.useState)(!1),ie=(0,A.useRef)(null),Qt=(0,A.useRef)(null),cn=(0,A.useRef)(null),un=(0,A.useRef)(null),Ge=(0,A.useRef)(null),dn=(0,A.useRef)(null),ut=(0,A.useRef)(0),Ft=(0,A.useRef)(0),yt=(0,A.useRef)(-1),kt=(0,A.useRef)(null),bt=(0,A.useRef)(!1),K=(0,A.useRef)([]),vt=(0,A.useRef)([]),Ht=(0,A.useRef)(null),fn=(0,A.useRef)({timing:()=>{},visual:()=>{},flushAll:()=>{}}),Ct=(0,A.useRef)(null),Gd=(0,A.useRef)(!1),tc=(0,A.useRef)(!1),Fm=(0,A.useRef)(null),$d=(0,A.useRef)({active:!1,pendingBody:null,pendingRevBump:!1});(0,A.useEffect)(()=>{let b=`comp:${n.id}`;Fm.current!==b&&TX(m)&&(Fm.current=b,dt({mode:"initial",dismissed:!1,busy:!1,finished:!1,error:null,scenesCreated:null,ghostcutStatus:null,ghostcutProgress:null,userPrompt:""}))},[n.id,m]);let G=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||G.current===o)return;G.current=o;let b=!1;return(async()=>{let T=Date.now(),x=900*1e3;for(await new Promise(I=>setTimeout(I,3e3));!b&&Date.now()-T<x;){try{let I=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/remove-video-captions-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),M=await I.json().catch(()=>({}));if(!I.ok||M?.ok===!1){await new Promise(P=>setTimeout(P,8e3));continue}let O=M.status??"none";if(O==="none"||O==="failed")return;if(O==="pending"&&dt(P=>P&&{...P,ghostcutStatus:"pending"}),O==="done"){M.swap_applied&&typeof window<"u"&&window.location.reload();return}}catch{}await new Promise(I=>setTimeout(I,2e4))}})(),()=>{b=!0,G.current=null}},[o]);let jt=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||jt.current===o)return;jt.current=o;let b=!1,T=async()=>{try{let x=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/cast.json`),I=await x.json().catch(()=>({}));return!x.ok||I?.ok===!1?null:(Array.isArray(I.cast)&&(h0.current=I.cast),I.status??"none")}catch{return null}};return(async()=>{let x=Date.now(),I=600*1e3;await new Promise(O=>setTimeout(O,3e3));let M=await T();if(!(M==="none"||M==="done"||M==="failed"))for(;!b&&Date.now()-x<I;){try{let O=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/cast-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),P=await O.json().catch(()=>({}));if(!O.ok||P?.ok===!1){await new Promise(et=>setTimeout(et,6e3));continue}await T();let q=P.status??"none";if(q==="none"||q==="done"||q==="failed")return}catch{}await new Promise(O=>setTimeout(O,4e3))}})(),()=>{b=!0,jt.current=null}},[o]);let kr=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||kr.current===o)return;kr.current=o;let b=!1;return(async()=>{let T=Date.now(),x=300*1e3;await new Promise(I=>setTimeout(I,3e3));try{let I=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/scene-annotations.json`),M=await I.json().catch(()=>({}));if(I.ok&&(M.status==="none"||M.status==="done"||M.status==="failed"))return}catch{}for(;!b&&Date.now()-T<x;){try{let I=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/scene-annotations-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),M=await I.json().catch(()=>({}));if(!I.ok||M?.ok===!1){await new Promise(P=>setTimeout(P,6e3));continue}let O=M.status??"none";if(O==="none"||O==="done"||O==="failed")return}catch{}await new Promise(I=>setTimeout(I,4e3))}})(),()=>{b=!0,kr.current=null}},[o]);let ko=(0,A.useCallback)(async()=>{dt(M=>M&&{...M,busy:!0,error:null});let b=J?.userPrompt?.trim()??"",T=async M=>{let O=await fetch(`/api/v1/compositions/${encodeURIComponent(M)}/auto-decompose`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({force:!0,...b?{user_prompt:b}:{}})}),P=await O.json().catch(()=>({}));return{response:O,data:P}},x=async M=>{let O=Date.now(),P=720*1e3;for(;Date.now()-O<P;){await new Promise(q=>setTimeout(q,5e3));try{let q=await fetch(`/api/v1/compositions/${encodeURIComponent(M)}/auto-decompose`,{method:"GET"});if(!q.ok)continue;let et=await q.json().catch(()=>({}));if(et?.ok===!1)continue;let Q=et.status??"none";if(Q==="done"||Q==="failed")return et}catch{}}return null},I=async M=>{let O=Date.now(),P=600*1e3;for(;Date.now()-O<P;){await new Promise(q=>setTimeout(q,2e4));try{let q=await fetch(`/api/v1/compositions/${encodeURIComponent(M)}/remove-video-captions-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),et=await q.json().catch(()=>({}));if(!q.ok||et?.ok===!1)continue;let Q=et.status??"none",St=typeof et.progress=="number"?et.progress:null;if(dt(_t=>_t&&{..._t,ghostcutStatus:Q,ghostcutProgress:St}),Q==="done"||Q==="failed"||Q==="none")return}catch{}}};try{let M=o??await i(),{response:O,data:P}=await T(M);if(O.status===404||/fork not found/i.test(P?.error||"")){let Z=await fetch("/api/v1/compositions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:n.id,title:n.title})}),Zt=await Z.json().catch(()=>({}));if(!Z.ok||!Zt?.fork_id)throw new Error(Zt?.error||`Fork creation failed (${Z.status})`);if(M=Zt.fork_id,a(M),typeof window<"u"){let Oe=new URL(window.location.href);Oe.searchParams.set("fork",M),window.history.replaceState(null,"",Oe)}({response:O,data:P}=await T(M))}let et=P;if(!(O.ok&&P?.ok!==!1&&P?.status==="done")){let Z=await x(M);if(!Z)throw new Error(P?.error||"Decompose is taking longer than expected. It may still finish \u2014 reload in a moment.");et=Z}if(et.status==="failed")throw new Error(et.error||P?.error||"Decompose failed.");let St=typeof et.scene_count=="number"&&Number.isFinite(et.scene_count)?et.scene_count:null,_t=et.ghostcut_pending?"pending":"none";dt(Z=>Z&&{...Z,busy:!1,finished:!0,error:null,scenesCreated:St,ghostcutStatus:_t,ghostcutProgress:null}),et.ghostcut_pending&&I(M)}catch(M){let O=M instanceof Error?M.message:String(M);dt(P=>P&&{...P,busy:!1,error:O})}},[i,o,n.id,n.title,a,J?.userPrompt]),Me=(0,A.useCallback)(()=>{dt(null),typeof window<"u"&&window.location.reload()},[]),o0=(0,A.useCallback)(()=>{dt(null)},[]),r6=(0,A.useCallback)(()=>{dt(b=>b&&{...b,dismissed:!0})},[]),o6=(0,A.useCallback)(()=>{dt(b=>b&&{...b,dismissed:!1})},[]),i6=(0,A.useCallback)(async()=>{try{o||await i()}catch{}dt({mode:"redo",dismissed:!1,busy:!1,finished:!1,error:null,scenesCreated:null,ghostcutStatus:null,ghostcutProgress:null,userPrompt:""})},[i,o]),a6=(0,A.useCallback)(async()=>{if(!o)try{await i()}catch{}Ce(!0)},[i,o]),s6=(0,A.useCallback)(()=>{o&&Pn(!0)},[o]),l6=(0,A.useCallback)(()=>{Pn(!1),typeof window<"u"&&window.location.reload()},[]),_1=o?`/composition/current.html?fork=${encodeURIComponent(o)}&rev=${y}`:`/composition/current.html?composition=${encodeURIComponent(n.id)}&rev=${y}`,{iframeRef:Hm,onIframeLoad:c6,resetPlayer:v1}=p(),ec=u(b=>b.selectedElementId),i0=u(b=>b.selectedElementIds),nc=u(b=>b.elements),S1=u(b=>b.timelineReady),u6=u(b=>b.isPlaying),Io=(0,A.useMemo)(()=>nc.map(b=>{let T=Nt(b);return IU(b,ot.get(T))}),[nc,ot]),E1=(0,A.useMemo)(()=>o1(Io),[Io]),a0=E1.length>0&&S1,[d6,f6]=(0,A.useState)(0),[p6,m6]=(0,A.useState)(0);(0,A.useEffect)(()=>{if(!a0)return;let b=cn.current?.querySelector('[aria-label="Timeline"]'),T=b?.firstElementChild instanceof HTMLElement?b.firstElementChild:null;if(!T)return;let x=()=>{f6(T.scrollTop),m6(T.scrollLeft)};return x(),T.addEventListener("scroll",x,{passive:!0}),()=>T.removeEventListener("scroll",x)},[a0]);let vn=Io.find(b=>Nt(b)===ec)??null,g6=vn?ot.get(Nt(vn)):void 0,T1=vn?X.get(Nt(vn))?.frame:void 0,h6=Ut>=0&&K.current.length>0,b6=Ut>=0&&vt.current.length>0,rc=H?.phase==="starting"||H?.phase==="running",y6=rc?"Rendering":"Render",_6=(0,A.useMemo)(()=>{let b=zd();return b?.localRender&&b?.cloudRenderAvailable?[{key:"local",label:"Render Local (Free)",hint:"Render in-process on this machine \u2014 no cloud charge"},{key:"cloud",label:"Render in Cloud",hint:"Render on the cloud account \u2014 billed to its wallet"}]:null},[]),Gm=(0,A.useMemo)(()=>new Set([...ec?[ec]:[],...Array.from(i0)]),[ec,i0]),v6=(0,A.useMemo)(()=>{if(Gm.size===0)return!1;let b=e0(m);return nc.some(T=>Gm.has(Nt(T))&&EU(b,T))},[m,nc,Gm]),Sn=(0,A.useCallback)(()=>{cancelAnimationFrame(ut.current),ut.current=0,Ft.current=0,yt.current=-1},[]);(0,A.useEffect)(()=>{if(!Gd.current){Gd.current=!0;return}v1(),Sn(),R(!0),k("1"),F(null),D(null),lt(new Map),ct(new Map),gt(null),mt(!1),K.current=[],vt.current=[],Ht.current=null,kt.current=null,bt.current=!1,un.current=null,Ge.current=null;let b=qU(n);h.current=b,_(b),S(T=>T+1),ft(T=>T+1)},[n.id,n,v1,Sn]);let oc=(0,A.useCallback)(()=>{ft(b=>b+1)},[]),ic=(0,A.useCallback)(()=>{let b=u.getState();return{html:h.current,time:b.currentTime,selectedElementId:b.selectedElementId,selectedElementIds:Array.from(b.selectedElementIds)}},[u]),or=(0,A.useCallback)(b=>{let T=K.current,x=Date.now(),I=Ht.current;Ht.current=b?{key:b,at:x}:null;let M=ic();!!!(b&&I&&I.key===b&&x-I.at<1200&&T.length>0)&&T[T.length-1]?.html!==M.html&&(K.current=[...T.slice(-49),M]),vt.current=[],oc()},[oc,ic]),It=(0,A.useCallback)(()=>{let b=d(dn.current);return b?(Hm.current=b,b):Hm.current},[Hm,d]),w1=(0,A.useCallback)(b=>{if(!b)return It();for(let T of Array.from(document.querySelectorAll("iframe")))if(T.contentWindow===b)return T;return It()},[It]),x1=(0,A.useCallback)((b,T)=>{let x=It()?.getBoundingClientRect(),I=Qt.current?.getBoundingClientRect(),M=x&&x.width>1&&x.height>1?x:I;if(!M)return{x:12,y:70,width:42,height:12};let O=(b-M.left)/Math.max(1,M.width)*100,P=(T-M.top)/Math.max(1,M.height)*100,q=Lt(O,0,95),et=Lt(P,0,95);return{x:q,y:et,width:Lt(42,1,100-q),height:Lt(12,1,100-et)}},[It]),$m=(0,A.useCallback)(b=>{F(null),D(b)},[]),S6=(0,A.useCallback)(b=>{let T=b.target;if(T instanceof Element&&T.closest("button,input,textarea,select,a"))return;b.preventDefault(),b.stopPropagation();let x=u.getState();x.clearSelectedElementIds(),x.setSelectedElementId(null),$m({x:b.clientX,y:b.clientY,time:x.currentTime,frame:x1(b.clientX,b.clientY),elementId:null}),xt("editor.preview-stage-context-menu",{x:b.clientX,y:b.clientY,time:x.currentTime})},[x1,$m,u]),E6=(0,A.useCallback)(b=>{if(b.button!==0)return;let T=b.target;if(!(T instanceof Element)||T.closest("button,input,textarea,select,a,.canvas-frame-overlay")||T.closest("iframe"))return;let x=u.getState();x.setSelectedElementId(null),x.clearSelectedElementIds(),D(null),xt("editor.preview-blank-unselect")},[u]),s0=(0,A.useCallback)(()=>{let b=Cs(It());if(!b)return;let T=b.getTime(),x=b.getDuration(),I=x>0&&T>=x,M=b.isPlaying()&&!I,O=performance.now();if((!M||O-Ft.current>=66||Math.abs(T-yt.current)>=.25)&&(Ft.current=O,yt.current=T,u.getState().setCurrentTime(T)),!M){u.getState().setIsPlaying(!1),Sn();return}ut.current=requestAnimationFrame(s0)},[It,Sn]),ac=(0,A.useCallback)(()=>{Sn(),ut.current=requestAnimationFrame(s0)},[Sn,s0]),jd=(0,A.useCallback)(b=>{let T=AU(b);k(String(Number(T.toFixed(2))));let x=It(),I=Cs(x);return I?.setPlaybackRate?.(T),u.getState().audioMuted||(I?.setMuted?.(!1),kU(x,"set-muted",{muted:!1})),kU(x,"set-playback-rate",{playbackRate:T}),T},[It]),Ir=(0,A.useCallback)(b=>{let T=It(),x=Cs(T),I=u.getState(),M=x?.getDuration()||u.getState().duration||f,O=Math.max(0,Math.min(M,Number.isFinite(b)?b:0)),P=!!(x?.isPlaying()||I.isPlaying);if(Sn(),x){x.seek(O);let q=x.getTime();c.notify(q),I.setCurrentTime(q),I.setIsPlaying(!!x.isPlaying())}else c.notify(O),I.setCurrentTime(O),I.requestSeek(O);return P&&x?.isPlaying()&&ac(),!0},[f,It,c,ac,Sn,u]),jm=(0,A.useCallback)(b=>!(b instanceof Element)||b.closest("button,input,textarea,select,a")||b.closest("[data-clip]")?!1:!!b.closest('[aria-label="Timeline"]'),[]),Sa=(0,A.useCallback)((b,T)=>{let x=cn.current?.querySelector('[aria-label="Timeline"]'),I=x?.firstElementChild instanceof HTMLElement?x.firstElementChild:null,M=u.getState().duration||f;if(!I||M<=0)return null;let O=I.getBoundingClientRect(),q=Math.max(1,I.scrollWidth-uU)/M,et=b-O.left+I.scrollLeft-uU;if(et<0)return null;let Q=Math.max(0,Math.min(M,et/q)),St=T-O.top+I.scrollTop-dU,_t=Ge.current?.rowOrder??o1(Io),Z=Math.floor(St/fU),Zt=T-O.top,Oe=_t.length>0&&Zt>=0&&Zt<=dU,Je=Oe?Math.max(..._t)+1:Z>=0&&Z<_t.length?_t[Z]:null,gc=Je===null?null:Io.find(No=>No.track===Je&&Q>=No.start&&Q<=No.start+No.duration)??null;return{time:Q,track:Je,syntheticTrack:Oe,element:gc,scrollLeft:I.scrollLeft,pixelsPerSecond:q}},[f,Io,u]),A1=(0,A.useCallback)((b,T)=>{let x=Sa(b,0);if(!x)return!1;let{time:I,scrollLeft:M,pixelsPerSecond:O}=x;return Ir(I),xt("editor.timeline-capture-seek",{source:T,time:I,clientX:b,scrollLeft:M,pixelsPerSecond:O}),!0},[Ir,Sa]),T6=(0,A.useCallback)(b=>{if(b.button!==0||b.shiftKey||b.metaKey||b.ctrlKey||b.altKey){un.current=null;return}un.current={clientX:b.clientX,clientY:b.clientY,button:b.button,startedOnTimeline:jm(b.target)}},[jm]),w6=(0,A.useCallback)(b=>{let T=un.current;un.current=null,!(!T||T.button!==0||!T.startedOnTimeline||!jm(b.target)||Math.hypot(b.clientX-T.clientX,b.clientY-T.clientY)>5)&&A1(b.clientX,"click-capture")},[jm,A1]),x6=(0,A.useCallback)(b=>{let T=b.target;if(!(T instanceof Element)||!T.closest('[aria-label="Timeline"]'))return;b.preventDefault(),b.stopPropagation();let x=Sa(b.clientX,b.clientY);if(!x)return;let I=u.getState();if(x.element){let M=Nt(x.element);new Set([...I.selectedElementId?[I.selectedElementId]:[],...Array.from(I.selectedElementIds)]).has(M)||(I.clearSelectedElementIds(),I.setSelectedElementId(M))}else I.clearSelectedElementIds(),I.setSelectedElementId(null);F({x:b.clientX,y:b.clientY,time:x.time,track:x.syntheticTrack?null:x.track,element:x.element}),D(null)},[Sa,u]),qm=(0,A.useCallback)(b=>{Ni(It(),b)},[It]),k1=(0,A.useCallback)(()=>ie.current?.querySelector(".dna-panel")?.scrollTop??0,[]),I1=(0,A.useCallback)(b=>{requestAnimationFrame(()=>{let T=ie.current?.querySelector(".dna-panel");T&&(T.scrollTop=b)})},[]),sc=(0,A.useCallback)(()=>{let b=u.getState(),T=Cs(It());return{time:T?.getTime()??b.currentTime,selectedElementId:b.selectedElementId,selectedElementIds:Array.from(b.selectedElementIds),zoomMode:b.zoomMode,manualZoomPercent:b.manualZoomPercent,rightPanelScrollTop:k1(),playbackRate:AU(Number(C)),wasPlaying:!!(T?.isPlaying()||b.isPlaying)}},[It,k1,C,u]),A6=(0,A.useCallback)(()=>{let b=kt.current;if(!b){qm(vn);return}let T=0,x=()=>{let I=u.getState();if(!(I.timelineReady&&I.elements.length>0)&&T<12){T+=1,requestAnimationFrame(x);return}let O=Cs(It());if(b.wasPlaying&&!O&&T<30){T+=1,requestAnimationFrame(x);return}kt.current=null,k(String(Number(b.playbackRate.toFixed(2)))),I.setZoomMode(b.zoomMode),I.setManualZoomPercent(b.manualZoomPercent),I.setPlaybackRate(b.playbackRate),I.clearSelectedElementIds();for(let q of b.selectedElementIds)I.toggleSelectedElementId(q);I.setSelectedElementId(b.selectedElementId);let P=b.selectedElementId?I.elements.find(q=>Nt(q)===b.selectedElementId)??null:null;Ni(It(),P),I1(b.rightPanelScrollTop),jd(b.playbackRate),Ir(b.time),b.wasPlaying&&O?(O.play(),I.setIsPlaying(!0),ac()):I.setIsPlaying(!1),xt("editor.restore-after-reload",{time:b.time,selectedElementId:b.selectedElementId,selectedCount:b.selectedElementIds.length,zoomMode:b.zoomMode,manualZoomPercent:b.manualZoomPercent,rightPanelScrollTop:b.rightPanelScrollTop})};requestAnimationFrame(x)},[jd,Ir,It,I1,vn,ac,qm,u]);(0,A.useEffect)(()=>()=>Sn(),[Sn]),(0,A.useEffect)(()=>{h.current=m},[m]),(0,A.useEffect)(()=>{qm(vn)},[vn,qm]),(0,A.useEffect)(()=>{let b=T=>{let x=T.data;if(!x||x.source!=="vidfarm-composition")return;let I=u.getState();if(x.action==="preview-context-menu"){let O=w1(T.source),P=O?.getBoundingClientRect(),q=O?.contentWindow?.innerWidth||P?.width||1,et=O?.contentWindow?.innerHeight||P?.height||1,Q=(P?.width??1)/Math.max(1,q),St=(P?.height??1)/Math.max(1,et),_t=(P?.left??0)+Number(x.clientX??0)*Q,Z=(P?.top??0)+Number(x.clientY??0)*St,Zt={x:Number(x.frame?.x??12),y:Number(x.frame?.y??70),width:Number(x.frame?.width??42),height:Number(x.frame?.height??12)},Oe={x:Lt(Zt.x,0,95),y:Lt(Zt.y,0,95),width:Lt(Zt.width,1,100-Lt(Zt.x,0,95)),height:Lt(Zt.height,1,100-Lt(Zt.y,0,95))};$m({x:_t,y:Z,time:Number.isFinite(Number(x.time))?Number(x.time):I.currentTime,frame:Oe,elementId:x.id??null}),xt("editor.preview-context-menu",{id:x.id??null,time:Number(x.time),frame:Oe});return}if(x.action!=="select-layer")return;if(I.clearSelectedElementIds(),!x.id){I.setSelectedElementId(null),D(null),xt("editor.canvas-empty-select");return}let M=I.elements.find(O=>O.hfId===x.id||O.domId===x.id||O.id===x.id||O.key===x.id);I.setSelectedElementId(M?Nt(M):null),D(null),xt("editor.canvas-layer-select",{id:x.id,elementKey:M?Nt(M):null})};return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[w1,$m,u]);let l0=(0,A.useCallback)(()=>{let b=$d.current;if(b.active)return;if(b.pendingBody===null){b.pendingRevBump&&(b.pendingRevBump=!1,S(x=>x+1),requestAnimationFrame(()=>R(!0)));return}let T=b.pendingBody;b.pendingBody=null,b.active=!0,(async()=>{try{let x=await i();await fetch(`/api/v1/compositions/${encodeURIComponent(x)}/composition.html`,{method:"PUT",headers:{"content-type":"text/html; charset=utf-8"},body:T})}catch(x){Ar("editor.composition-put-failed",x instanceof Error?x.message:x)}finally{b.active=!1,l0()}})()},[i]),lc=(0,A.useCallback)((b,T)=>{let x=$d.current;x.pendingBody=Xl(b),T.bumpRev&&(x.pendingRevBump=!0),l0()},[l0]),Wr=(0,A.useCallback)((b,T)=>{xt("editor.composition-persist",{bytes:b.length,mode:T}),lc(b,{bumpRev:!1})},[lc]),cc=(0,A.useCallback)((b,T)=>{b=Xl(b);let x={...sc(),...T};bt.current&&(x.wasPlaying=!0,bt.current=!1),kt.current=x,h.current=b,_(b),Sn(),u.getState().reset(),R(!1),xt("editor.composition-publish",{bytes:b.length}),lc(b,{bumpRev:!0})},[sc,lc,Sn,u]),Ro=(0,A.useCallback)(b=>{or(),cc(b)},[cc,or]),R1=(0,A.useCallback)((b,T)=>{or(),cc(b,{selectedElementId:T,selectedElementIds:[]})},[cc,or]),TJ=(0,A.useCallback)((b,T)=>{b=Xl(b),or(),h.current=b,_(b);let x=It(),I=n1(x,b),M=u.getState(),O=M.selectedElementId?M.elements.find(P=>Nt(P)===M.selectedElementId)??null:null;Ni(x,O),Wr(b,"soft"),T!==void 0&&Ir(T),xt("editor.timeline-timing-soft-patch",{bytes:b.length,patchedCount:I,seekTime:T})},[Ir,It,Wr,or,u]),k6=(0,A.useCallback)((b,T)=>{let x=h.current,I=Zo(x,b,T);if(I===x){xt("editor.live-patch-skipped-missing",{elementKey:Nt(b)});return}or(`live:${Nt(b)}`),h.current=I,_(I);let M=It(),O=km(M,b,T);Ni(M,b),xt("editor.live-patch",{elementKey:Nt(b),hfId:b.hfId,domId:b.domId,tag:b.tag,hasIframe:!!M,patched:O}),O?Wr(I,"soft"):cc(I)},[It,Wr,cc,or]),I6=(0,A.useCallback)((b,T)=>{let x=It(),I=km(x,b,T);Ni(x,b),xt("editor.live-preview-patch",{elementKey:Nt(b),patched:I})},[It]),Vm=(0,A.useCallback)(b=>{let T=h.current;h.current=b.html,_(b.html);let x=It(),I=hU(x,b.html),M=I?$_(x):!1;r1(u,T,b.html),Wr(b.html,"soft");let O=u.getState(),P=new Set(O.elements.map(Q=>Nt(Q))),q=b.selectedElementId&&P.has(b.selectedElementId)?b.selectedElementId:null,et=b.selectedElementIds.filter(Q=>P.has(Q));if(I&&M){O.clearSelectedElementIds();for(let St of et)O.toggleSelectedElementId(St);O.setSelectedElementId(q);let Q=q?O.elements.find(St=>Nt(St)===q)??null:null;Ni(x,Q),Ir(b.time),xt("editor.history-live-swap",{bytes:b.html.length});return}if(kt.current={...sc(),time:b.time,selectedElementId:q,selectedElementIds:et},Sn(),bU(x,b.html)){xt("editor.history-document-write",{bytes:b.html.length});return}lc(b.html,{bumpRev:!0}),xt("editor.history-reload-fallback",{bytes:b.html.length})},[sc,Ir,lc,It,Wr,Sn,u]),c0=(0,A.useCallback)(b=>{let T=It(),x=T?.contentDocument??null,I=x?Z_(x):h.current;h.current=b,_(b);let M=hU(T,b),O=M?$_(T):!1;if(r1(u,I,b),M&&O){Ir(u.getState().currentTime),xt("editor.dev-reload-live-swap",{bytes:b.length});return}if(kt.current={...sc()},Sn(),bU(T,gX(b))){xt("editor.dev-reload-document-write",{bytes:b.length});return}Ar("editor.dev-reload-apply-failed",{bytes:b.length})},[sc,Ir,It,Sn,u]);(0,A.useEffect)(()=>{if(!o||!zd()?.liveReload)return;let b=new EventSource("/api/v1/dev/events"),T=x=>{let I={};try{I=JSON.parse(x.data)}catch{}I.forkId&&I.forkId!==o||fetch(`/api/v1/compositions/${encodeURIComponent(o)}/composition.html`,{cache:"reload"}).then(M=>M.ok?M.text():null).then(M=>{M!=null&&c0(Xl(M))}).catch(M=>Ar("editor.live-reload-fetch-failed",M instanceof Error?M.message:String(M)))};return b.addEventListener("reload",T),b.onerror=()=>Ar("editor.live-reload-sse-error"),()=>{b.removeEventListener("reload",T),b.close()}},[c0,o]);let qd=(0,A.useCallback)(()=>{fn.current.flushAll();let b=K.current.pop();b&&(vt.current=[ic(),...vt.current.slice(0,49)],Ht.current=null,oc(),Vm(b))},[Vm,oc,ic]),uc=(0,A.useCallback)(()=>{fn.current.flushAll();let b=vt.current.shift();b&&(K.current=[...K.current.slice(-49),ic()],Ht.current=null,oc(),Vm(b))},[Vm,oc,ic]),u0=(0,A.useRef)({undo:()=>{},redo:()=>{}});(0,A.useEffect)(()=>{u0.current={undo:qd,redo:uc}},[uc,qd]);let R6=(0,A.useCallback)(()=>{let b=It()?.contentDocument;!b||mU.has(b)||(mU.add(b),b.addEventListener("keydown",T=>{if(!(T.metaKey||T.ctrlKey)||T.altKey)return;let x=T.key.toLowerCase();x!=="z"&&x!=="y"||(T.preventDefault(),T.stopPropagation(),x==="y"||T.shiftKey?u0.current.redo():u0.current.undo())},!0))},[It]),N6=(0,A.useCallback)(b=>{Ct.current=b.commit,mt(b.dirty)},[]),d0=(0,A.useCallback)(b=>{ct(T=>{if(!T.has(b))return T;let x=new Map(T);return x.delete(b),x})},[]),C6=(0,A.useCallback)(b=>{let T=Nt(b),x=n0(h.current,b);if(x){let I=JU(x);km(It(),b,M=>f1(M,I)),Ni(It(),b)}d0(T)},[d0,It]),Ym=(0,A.useCallback)((b,T)=>{let x=Nt(b),I={x:Lt(T.x,0,Math.max(0,100-T.width)),y:Lt(T.y,0,Math.max(0,100-T.height)),width:Lt(T.width,1,100-T.x),height:Lt(T.height,1,100-T.y),...Number.isFinite(T.fontSize)?{fontSize:Math.max(8,Math.min(180,Number(T.fontSize)))}:{}};ct(M=>{let O=new Map(M);return O.set(x,{element:b,frame:I}),O}),Ni(It(),b),mt(!0)},[It]),M6=(0,A.useCallback)(()=>{window.setTimeout(()=>fn.current.visual(),0)},[]),dc=(0,A.useCallback)(()=>{let b=Array.from(X.values());if(b.length===0)return!1;or();let T=h.current;for(let x of b)T=Zo(T,x.element,I=>f1(I,x.frame));return h.current=T,_(T),ct(new Map),Wr(T,"soft"),Ni(It(),vn),xt("editor.visual-frame-drafts-commit",{count:b.length}),!0},[It,Wr,or,vn,X]);(0,A.useEffect)(()=>{let b=T=>{let x=T.data;if(!x||x.source!=="vidfarm-composition"||x.action!=="visual-frame-draft"||!x.id||!x.frame)return;let I=u.getState(),M=I.elements.find(q=>q.hfId===x.id||q.domId===x.id||q.id===x.id||q.key===x.id);if(!M||!b1(M))return;let O=Number(x.frame.fontSize),P={x:Number(x.frame.x),y:Number(x.frame.y),width:Number(x.frame.width),height:Number(x.frame.height),...Number.isFinite(O)?{fontSize:O}:{}};[P.x,P.y,P.width,P.height].every(Number.isFinite)&&(I.clearSelectedElementIds(),I.setSelectedElementId(Nt(M)),Ym(M,P),x.phase==="end"&&window.setTimeout(()=>fn.current.visual(),0),xt("editor.iframe-visual-frame-draft",{elementKey:Nt(M),phase:x.phase,frame:P}))};return window.addEventListener("message",b),()=>window.removeEventListener("message",b)},[Ym,u]);let N1=(0,A.useCallback)(b=>{let T=Array.from(ot.entries()).filter(([x])=>x!==b).map(([,x])=>x);return T.length===0?h.current:s1(h.current,T).html},[ot]),f0=(0,A.useCallback)(b=>{lt(T=>{if(!T.has(b))return T;let x=new Map(T);return x.delete(b),x})},[]),O6=(0,A.useCallback)(b=>{let T=ot.get(b);if(T){let x=d1(h.current,T.element);u.getState().updateElement(b,{start:x.start,duration:x.duration,track:x.track,playbackStart:x.playbackStart})}f0(b)},[f0,ot,u]),Mi=(0,A.useCallback)((b,T,x)=>{let I=Nt(b),M=d1(h.current,b),P={...ot.get(I)?.updates??{},...T};if(!x?.bypassCollisionGuard){let _t={start:P.start??M.start,duration:P.duration??M.duration,track:P.track??M.track},Z=SU(u.getState().elements,b,h.current),Zt={start:M.start,duration:M.duration,track:M.track};if(i1(_t,Z)&&!i1(Zt,Z))return Ar("editor.timeline-stage-collision-rejected",{elementKey:I,proposed:_t}),!1}let q=h.current;try{let _t=Array.from(ot.entries()).filter(([Z])=>Z!==I).map(([,Z])=>Z);q=s1(h.current,[..._t,{element:M,updates:P}]).html}catch(_t){return Ar("editor.timeline-stage-rejected",_t instanceof Error?_t.message:_t),!1}let et=u.getState();et.setSelectedElementId(I),et.updateElement(I,T),lt(_t=>{let Z=new Map(_t);return Z.set(I,{element:M,updates:P}),Z});let Q=It(),St=n1(Q,q);return Ni(Q,{...M,...P}),xt("editor.timeline-stage-applied",{elementKey:I,updates:P,patchedCount:St}),!0},[It,ot,u]),fc=(0,A.useCallback)((b=new Set)=>{let T=Array.from(ot.entries()).filter(([et])=>!b.has(et));if(T.length===0)return;or();let x=h.current,{html:I,resolvedCollisions:M}=s1(x,T.map(([,et])=>et)),O=Xl(I);lt(et=>{let Q=new Map(et);for(let[St]of T)Q.delete(St);return Q}),h.current=O,_(O),u.getState().elements.length>0&&r1(u,x,O);let P=It(),q=n1(P,O);$_(P),Wr(O,"soft"),xt("editor.timeline-timing-commit",{count:T.length,patchedCount:q,resolvedCollisions:M})},[It,Wr,or,ot,u]),Wm=(0,A.useCallback)(()=>{let b=!1;ee&&Ct.current&&(Ct.current(),Ct.current=null,mt(!1),b=!0);let T=vn?Nt(vn):null;return ot.size>0&&fc(b&&T?new Set([T]):new Set),X.size>0&&dc(),h.current},[fc,dc,ee,vn,ot.size,X.size]);(0,A.useEffect)(()=>{fn.current={timing:()=>fc(),visual:()=>dc(),flushAll:()=>{Wm()}}},[Wm,fc,dc]);let Km=(0,A.useCallback)(async b=>{if(rc)return;let T=n.title;gt({phase:"starting",title:T,status:"STARTING",progress:0,framesRendered:0,totalFrames:null,lambdasInvoked:0,cost:"$0.0000"});try{let x=Wm(),I=await i(),M=await fetch(`/api/v1/compositions/${encodeURIComponent(I)}/render`,{method:"POST",headers:{"content-type":"application/json; charset=utf-8"},body:JSON.stringify({title:T,html:x,...b==="cloud"?{render_target:"cloud"}:{}})}),O=await M.json().catch(()=>({}));if(!M.ok||O.ok===!1)throw new Error(O.error||`Publish failed with ${M.status}`);xt("editor.publish-started",{forkId:I,renderId:O.renderId}),gt(cU(O,T))}catch(x){xo("editor.publish-start-error",x instanceof Error?x.stack:x),gt({phase:"failed",title:T,status:"FAILED",progress:0,error:x instanceof Error?x.message:String(x)})}},[Wm,n.title,i,rc]);(0,A.useEffect)(()=>{if(H?.phase!=="running"||!H.renderId||!o)return;let b=o,T=!1,x=0,I=0,M=async()=>{try{let O=await fetch(`/api/v1/compositions/${encodeURIComponent(b)}/renders/${encodeURIComponent(H.renderId||"")}`),P=await O.json().catch(()=>({}));if(T)return;if(!O.ok||P.ok===!1)throw new Error(P.error||`Publish progress failed with ${O.status}`);x=0,gt(cU(P,n.title))}catch(O){if(T)return;if(xo("editor.publish-poll-error",O instanceof Error?O.stack:O),x+=1,x<5){I=window.setTimeout(()=>{M()},4500);return}gt(P=>({...P??{title:n.title},phase:"failed",status:"FAILED",error:"Lost connection while checking render status \u2014 the render may still be running. Check your jobs list."}))}};return I=window.setTimeout(()=>{M()},4500),()=>{T=!0,window.clearTimeout(I)}},[n.title,o,H]);let D6=(0,A.useCallback)(()=>{let b=It(),T=Cs(b);if(!T)return;if(T.isPlaying()||u.getState().isPlaying){T.pause(),u.getState().setCurrentTime(T.getTime()),u.getState().setIsPlaying(!1),Sn();return}(ee||ot.size>0||X.size>0)&&(bt.current=!0);let I=!1;ee&&Ct.current&&(Ct.current(),Ct.current=null,mt(!1),I=!0);let M=vn?Nt(vn):null;ot.size>0&&fc(I&&M?new Set([M]):new Set),X.size>0&&dc(),bt.current&&(bt.current=!1);let O=jd(Number(C));T.getTime()>=T.getDuration()&&T.seek(0),T.setPlaybackRate?.(O),T.play(),u.getState().setIsPlaying(!0),ac()},[jd,dc,fc,It,ee,vn,C,ac,Sn,ot.size,u,X.size]),L6=(0,A.useCallback)((b,T)=>{try{let x=new DOMParser().parseFromString(N1(),"text/html"),I=Bn(x,b);if(!I)return;let M=I.getAttribute("data-vf-group"),O=TU(x,M,I),P=Ql(I),q=T.start-P.start,et=T.track-P.track,Q=new Map;for(let St of O){let _t=Ci(St);if(!_t)continue;let Z=Ql(St);Q.set(_t,{start:Math.max(0,Z.start+q),duration:Z.duration,track:Math.max(0,Z.track+et)})}SX(x,O,Q);for(let St of O){let _t=Ci(St),Z=_t?Q.get(_t):null;if(!_t||!Z)continue;let Zt=nc.find(Je=>Nt(Je)===_t||Je.hfId===_t||Je.domId===_t||Je.id===_t)??(_t===Ci(I)?b:null);if(!Zt)continue;if(!Mi(Zt,{start:Z.start,track:Z.track},{bypassCollisionGuard:!0}))throw new Error("Timeline move could not be staged.")}window.setTimeout(()=>fn.current.timing(),0)}catch(x){return Ar("editor.timeline-move-rejected",x instanceof Error?x.message:x),Promise.reject(x)}},[nc,N1,Mi]),U6=(0,A.useCallback)((b,T)=>{try{if(!Mi(b,T))throw new Error("Timeline resize could not be staged.");window.setTimeout(()=>fn.current.timing(),0)}catch(x){return Ar("editor.timeline-resize-rejected",x instanceof Error?x.message:x),Promise.reject(x)}},[Mi]),p0=(0,A.useCallback)((b,T,x)=>{if(x.button!==0||x.shiftKey||x.metaKey||x.ctrlKey)return;if(x.altKey){x.preventDefault(),x.stopPropagation();return}let I=Nt(b),M=IU(b,ot.get(I)),O=Sa(x.clientX,x.clientY);if(!O)return;x.preventDefault(),x.stopPropagation();let P=u.getState();P.clearSelectedElementIds(),P.setSelectedElementId(I),un.current=null;let q=_X(Io.filter(et=>J_(h.current,et)!=="track-placeholder"));Ge.current={element:M,mode:T,originClientX:x.clientX,originClientY:x.clientY,originPointerTime:O.time,originStart:M.start,originDuration:M.duration,originTrack:M.track,originPlaybackStart:M.playbackStart,moved:!1,rowOrder:o1(Io),laneAudioFlags:q},xt("editor.manual-timeline-drag-start",{elementKey:I,mode:T,start:M.start,duration:M.duration,track:M.track})},[Io,Sa,ot,u]);(0,A.useEffect)(()=>{function b(x){let I=Ge.current;if(!I)return;let M=Math.hypot(x.clientX-I.originClientX,x.clientY-I.originClientY);if(!I.moved&&M<2)return;I.moved=!0,x.preventDefault();let O=Sa(x.clientX,x.clientY);if(!O)return;let P=O.time-I.originPointerTime,q=I.originStart+I.originDuration,et=SU(u.getState().elements,I.element,h.current),Q=!1,St=!1;if(I.mode==="move"){let _t=Lt(I.originStart+P,0,Math.max(0,f-I.originDuration)),Z=O.track??I.originTrack,Zt=et.reduce((No,Co)=>Math.max(No,Co.track),-1),Oe=O.syntheticTrack?Math.min(Z,Math.max(Zt+1,I.originTrack)):Z,Je=I.element.tag==="audio",gc=I.laneAudioFlags.get(Oe);if(!O.syntheticTrack&&Oe!==I.originTrack&&gc!==void 0&&gc!==Je)St=!0;else{let No={start:_t,duration:I.originDuration,track:Oe},Co=i1(No,et)?vX(et,Oe,I.originDuration,_t,f):_t;Co===null?St=!0:Q=Mi(I.element,{start:Co,track:Oe})}}else if(I.mode==="trim-start"){let _t=et.reduce((No,Co)=>Bm(Co)&&Co.track===I.originTrack&&Co.start+Co.duration<=I.originStart+.001?Math.max(No,Co.start+Co.duration):No,0),Z=Math.max(0,q-.05),Zt=Math.min(_t,Z),Oe=Lt(I.originStart+P,Zt,Z),Je=Oe-I.originStart,gc=I.originPlaybackStart===void 0?void 0:Math.max(0,I.originPlaybackStart+Je);Q=Mi(I.element,{start:Oe,duration:Math.max(.05,q-Oe),playbackStart:gc})}else{let _t=et.reduce((Oe,Je)=>Bm(Je)&&Je.track===I.originTrack&&Je.start>=q-.001?Math.min(Oe,Je.start):Oe,f),Z=Math.max(I.originStart+.05,_t),Zt=Lt(q+P,I.originStart+.05,Z);Q=Mi(I.element,{duration:Math.max(.05,Zt-I.originStart)})}St?xt("editor.manual-timeline-drag-lane-full",{elementKey:Nt(I.element),mode:I.mode,track:O.track??I.originTrack}):Q||Ar("editor.manual-timeline-drag-rejected",{elementKey:Nt(I.element),mode:I.mode})}function T(){let x=Ge.current;x&&(xt("editor.manual-timeline-drag-end",{elementKey:Nt(x.element),mode:x.mode,moved:x.moved}),Ge.current=null,x.moved&&window.setTimeout(()=>fn.current.timing(),0))}return window.addEventListener("pointermove",b,{passive:!1}),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T),()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T)}},[f,Sa,Mi,u]);let C1=(0,A.useCallback)((b,T)=>{let x=Zo(m,b,I=>{let M=Number(I.getAttribute("data-start")??b.start),O=Number(I.getAttribute("data-duration")??b.duration),P=M+O;if(T<=M||T>=P)return;let q=T-M,et=P-T,Q=I.cloneNode(!0),St=`element_split_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,_t=Number(I.getAttribute("data-playback-start")??I.getAttribute("data-media-start")??b.playbackStart??0),Z=I.getAttribute("data-layer-kind")||h1(b)?.kind||(b.tag==="audio"?"audio":b.tag==="video"?"video":"layer"),Zt=Kt(_t+q);I.setAttribute("data-duration",Kt(q)),I.setAttribute("data-layer-kind",Z),Q.id=St,Q.setAttribute("data-hf-id",St),Q.setAttribute("data-start",Kt(T)),Q.setAttribute("data-duration",Kt(et)),Q.setAttribute("data-media-start",Zt),Q.setAttribute("data-playback-start",Zt),Q.setAttribute("data-layer-kind",Z),Q.setAttribute("data-label",`${b.label??b.id} split`),I.after(Q)});Ro(x)},[m,Ro]),B6=(0,A.useCallback)((b,T)=>{let x=Math.max(0,T==="above"?b+1:b),{html:I}=Ao(m,M=>{for(let et of Array.from(M.querySelectorAll("[data-start]"))){if(!oe(et))continue;let Q=Number(et.getAttribute("data-track-index")??0);Q>=x&&et.setAttribute("data-track-index",String(Q+1))}let O=M.querySelector("[data-composition-id]");if(!oe(O))return;let P=`element_track_${x}_${Date.now().toString(36)}`,q=M.createElement("div");q.id=P,q.setAttribute("data-hf-id",P),q.setAttribute("data-layer-mode","publish"),q.setAttribute("data-layer-kind","track-placeholder"),q.setAttribute("data-viral-note","Empty layer row."),q.setAttribute("data-start","0"),q.setAttribute("data-duration","0"),q.setAttribute("data-track-index",String(x)),q.setAttribute("data-label","Empty layer"),q.setAttribute("data-timeline-locked","true"),q.style.cssText="position:absolute;left:0%;top:0%;width:1%;height:1%;display:none;",O.append(q)});Ro(I),xt("editor.timeline-layer-inserted",{anchorTrack:b,placement:T,insertAt:x})},[m,Ro,u]),Xm=(0,A.useCallback)((b,T)=>{Ct.current?.();let x=`element_${b}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,I=u.getState().currentTime,M=Math.max(0,Math.min(f-.5,Number.isFinite(T.time)?T.time:I)),O=Math.max(.5,Math.min(4,f-M)),P=T.frame??{x:12,y:b==="text"?68:18,width:b==="text"?76:54,height:b==="text"?12:32},{html:q}=Ao(h.current,et=>{let Q=et.querySelector("[data-composition-id]");if(!oe(Q))return;let _t=Array.from(et.querySelectorAll("[data-start]")).filter(Zt=>oe(Zt)).reduce((Zt,Oe)=>{let Je=Number(Oe.getAttribute("data-track-index")??0);return Number.isFinite(Je)?Math.max(Zt,Je+1):Zt},0),Z=b==="media"?et.createElement("video"):et.createElement("div");Z.id=x,Z.setAttribute("data-hf-id",x),Z.setAttribute("data-layer-mode","publish"),Z.setAttribute("data-layer-kind",b==="media"?"video":"caption"),Z.setAttribute("data-viral-note",b==="media"?"Inserted media layer.":"Inserted caption layer."),Z.setAttribute("data-start",Kt(M)),Z.setAttribute("data-duration",Kt(O)),Z.setAttribute("data-track-index",String(_t)),Z.setAttribute("data-label",b==="media"?"New media":"New text"),b==="text"&&(Z.setAttribute("data-text-background-style","plain"),Z.setAttribute("data-text-background-color","#000000"),Z.setAttribute("data-font-family","Montserrat")),Z.style.position="absolute",Z.style.left=`${Lt(P.x,0,95)}%`,Z.style.top=`${Lt(P.y,0,95)}%`,Z.style.width=`${Lt(P.width,1,100-Lt(P.x,0,95))}%`,Z.style.height=`${Lt(P.height,1,100-Lt(P.y,0,95))}%`,Z.style.zIndex=String(100+_t),Z.style.overflow="hidden",b==="media"&&Z instanceof HTMLVideoElement?(Z.setAttribute("src",Dm),Z.setAttribute("playsinline",""),Z.setAttribute("muted",""),Z.setAttribute("preload","auto"),Z.setAttribute("data-media-start","0"),Z.setAttribute("data-playback-start","0"),Z.style.objectFit="cover",Z.style.background="#050604"):(Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="center",Z.style.padding="3px",Z.style.boxSizing="border-box",Z.style.textAlign="center",Z.style.color="#ffffff",Z.style.background="transparent",Z.style.fontFamily="Montserrat, 'TikTok Sans', sans-serif",Z.style.fontWeight="600",Z.style.fontSize="22px",Z.style.lineHeight="1.2",Z.style.textTransform="none",Q_(Z,"New text","plain","#ffffff","#000000","Montserrat",600)),Q.append(Z)});R1(q,x),F(null),D(null),xt("editor.layer-inserted",{id:x,kind:b,start:M,duration:O})},[f,R1,u]),m0=(0,A.useCallback)(()=>{let b=u.getState(),T=new Set([...b.selectedElementId?[b.selectedElementId]:[],...Array.from(b.selectedElementIds)]),x=b.elements.filter(O=>T.has(Nt(O)));if(x.length<2)return;let I=`vf-group-${Date.now().toString(36)}`,{html:M}=Ao(m,O=>{for(let P of x){let q=Bn(O,P);q&&(q.setAttribute("data-vf-group",I),q.setAttribute("data-vf-group-label","Vidfarm group"))}});Ro(M),xt("editor.group-created",{groupId:I,count:x.length})},[m,Ro,u]),g0=(0,A.useCallback)(()=>{let b=u.getState(),T=new Set([...b.selectedElementId?[b.selectedElementId]:[],...Array.from(b.selectedElementIds)]);if(T.size===0)return;let{html:x}=Ao(m,I=>{let M=new Set;for(let O of b.elements){if(!T.has(Nt(O)))continue;let P=EU(I,O);P&&M.add(P)}for(let O of M)for(let P of TU(I,O,I.body))P.removeAttribute("data-vf-group"),P.removeAttribute("data-vf-group-label")});Ro(x),xt("editor.group-removed")},[m,Ro,u]),Vd=(0,A.useCallback)(b=>{if(b.hfId==="source-video")return;or();let T=Zo(h.current,b,et=>et.remove());h.current=T,_(T);let x=It(),I=km(x,b,et=>{et instanceof HTMLMediaElement&&et.pause(),et.remove()}),M=$_(x),O=new Set([Nt(b),b.hfId,b.domId,b.id].filter(et=>!!et)),P=u.getState();P.setElements(P.elements.filter(et=>![Nt(et),et.hfId,et.domId,et.id].some(St=>St&&O.has(St)))),P.clearSelectedElementIds(),P.setSelectedElementId(null),lt(et=>{let Q=new Map(et);for(let St of O)Q.delete(St);return Q}),ct(et=>{let Q=new Map(et);for(let St of O)Q.delete(St);return Q}),Wr(T,"soft");let q=Cs(x);if(q){let et=q.getTime();q.seek(et),P.setCurrentTime(q.getTime()),P.setIsPlaying(q.isPlaying())}xt("editor.layer-delete-soft",{elementKey:Nt(b),patched:I,refreshed:M}),(!I||!M)&&S(et=>et+1)},[It,Wr,or,S,u]);(0,A.useEffect)(()=>{let b=T=>{let x=T.target;if(!(x instanceof HTMLInputElement||x instanceof HTMLTextAreaElement||x instanceof HTMLSelectElement||x instanceof HTMLElement&&x.isContentEditable)){if((T.metaKey||T.ctrlKey)&&!T.altKey&&T.key.toLowerCase()==="z"){T.preventDefault(),T.shiftKey?uc():qd();return}if((T.metaKey||T.ctrlKey)&&!T.altKey&&!T.shiftKey&&T.key.toLowerCase()==="y"){T.preventDefault(),uc();return}if((T.metaKey||T.ctrlKey)&&T.key.toLowerCase()==="g"){T.preventDefault(),T.shiftKey?g0():m0();return}if(T.key==="Delete"||T.key==="Backspace"){let I=u.getState(),M=new Set([...I.selectedElementId?[I.selectedElementId]:[],...Array.from(I.selectedElementIds)]);if(M.size===0)return;let O=I.elements.filter(P=>M.has(Nt(P)));if(O.length===0)return;T.preventDefault();for(let P of O)P.hfId!=="source-video"&&Vd(P)}}};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[Vd,m0,uc,qd,g0,u]);let pc=(0,A.useCallback)((b,T)=>{navigator.clipboard?.writeText(b).then(()=>{xt("editor.clipboard-copy",{label:T,value:b})}).catch(x=>{Ar("editor.clipboard-copy-failed",{label:T,error:x instanceof Error?x.message:x})})},[]),M1=(0,A.useCallback)(b=>{pc(Ms(b),"timestamp")},[pc]),P6=(0,A.useCallback)(b=>{pc(`time=${Ms(b.time)} track=${b.track??"none"}`,"timeline-coordinates")},[pc]),z6=(0,A.useCallback)(b=>{pc(`x=${Kt(b.x)} y=${Kt(b.y)} width=${Kt(b.width)} height=${Kt(b.height)}`,"preview-coordinates")},[pc]),F6=(0,A.useMemo)(()=>new Map(Lm.map(b=>[b.id,b])),[Lm]),H6=(0,A.useCallback)(()=>{let b=u.getState();b.setSelectedElementId(null),b.clearSelectedElementIds()},[u]);function G6(b,T){let x=F6.get(b.hfId??b.domId??b.id),I=J_(h.current,b),M=XU(h.current,b),O=I??x?.kind??(b.tag==="audio"?"audio":b.tag==="video"?"video":"layer"),P=b.label??x?.label??b.id,q=Nt(b),et=i0.has(q);return(0,g.jsxs)("div",{"data-clip":"true",className:`native-clip-label ${et?"multi-selected":""}`,onPointerDown:Q=>{(Q.shiftKey||Q.metaKey||Q.ctrlKey)&&Q.stopPropagation()},onClick:Q=>{if(!(Q.shiftKey||Q.metaKey||Q.ctrlKey))return;Q.preventDefault(),Q.stopPropagation();let St=u.getState();St.selectedElementId?(St.selectedElementId,St.toggleSelectedElementId(q)):St.setSelectedElementId(q),xt("editor.timeline-multi-select",{elementKey:q,selected:Array.from(u.getState().selectedElementIds)})},children:[(0,g.jsx)("span",{className:"native-clip-trim-hit start","aria-label":"Trim clip start",onPointerDown:Q=>p0(b,"trim-start",Q),onClick:Q=>{Q.preventDefault(),Q.stopPropagation()}}),(0,g.jsx)("span",{className:"native-clip-drag-hit","aria-label":"Move clip",onPointerDown:Q=>p0(b,"move",Q),onClick:Q=>{Q.preventDefault(),Q.stopPropagation()}}),(0,g.jsx)("span",{className:"native-clip-trim-hit end","aria-label":"Trim clip end",onPointerDown:Q=>p0(b,"trim-end",Q),onClick:Q=>{Q.preventDefault(),Q.stopPropagation()}}),(0,g.jsx)("span",{className:`native-clip-thumb ${O}`,children:pX(O,M==="html"?"html":x?.customHtml)}),(0,g.jsx)("strong",{style:{color:T.label},children:P}),(0,g.jsxs)("small",{children:["L",b.track," \xB7 drag / edge trim"]}),et&&(0,g.jsx)("em",{children:"SEL"})]})}let ti=(0,A.useRef)({url:null,title:null,status:null,renderId:null}),h0=(0,A.useRef)(null),b0=(0,A.useRef)(rc);b0.current=rc;let y0=(0,A.useRef)(Km);y0.current=Km,(0,A.useEffect)(()=>{if(H){if(H.phase==="succeeded"&&H.outputUrl){let b=ti.current,T={url:H.outputUrl,title:H.title??null,renderId:H.renderId??null};ti.current={url:H.outputUrl,title:H.title??null,status:H.status??"SUCCEEDED",renderId:H.renderId??null},(b.url!==T.url||b.renderId!==T.renderId)&&jX(T);return}ti.current={...ti.current,status:H.status??ti.current.status}}},[H]);let O1=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||O1.current===o)return;O1.current=o;let b=!1;return(async()=>{try{let T=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/versions?limit=25`);if(!T.ok)return;let x=await T.json().catch(()=>null),M=(Array.isArray(x?.versions)?x.versions:[]).filter(O=>typeof O.render_job_id=="string"&&O.render_job_id.length>0).map(O=>({version:Number(O.version),renderJobId:O.render_job_id})).filter(O=>Number.isFinite(O.version)).sort((O,P)=>P.version-O.version).slice(0,5);for(let O of M){if(b)return;let P=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/renders/${encodeURIComponent(O.renderJobId)}`);if(!P.ok)continue;let q=await P.json().catch(()=>({}));if(b)return;if(q?.status==="SUCCEEDED"&&typeof q.outputUrl=="string"&&q.outputUrl){if(ti.current.url&&ti.current.renderId===q.renderId)return;ti.current={url:q.outputUrl,title:q.title??n.title??null,status:q.status,renderId:q.renderId??O.renderJobId};return}}}catch{}})(),()=>{b=!0}},[o,n.title]);let mc=(0,A.useRef)({compositionHtmlRef:h,patchCompositionHtml:Ro,draftedElements:Io,selectedElementId:ec,composition:n,activeCompositionDuration:f,startExport:()=>{y0.current()},isExportInFlight:()=>b0.current,getLastExport:()=>ti.current,getCast:()=>h0.current});(0,A.useEffect)(()=>{mc.current={compositionHtmlRef:h,patchCompositionHtml:Ro,draftedElements:Io,selectedElementId:ec,composition:n,activeCompositionDuration:f,startExport:()=>{y0.current()},isExportInFlight:()=>b0.current,getLastExport:()=>ti.current,getCast:()=>h0.current}}),(0,A.useEffect)(()=>(Rm.current={getSnapshot:()=>rJ(mc.current),applyAction:b=>CU(b,mc.current)},()=>{Rm.current=null}),[]),(0,A.useEffect)(()=>{let b=!1,T=async()=>{let x=h.current;if(!x||!x.includes('data-vf-gen-status="generating"'))return;let I=new DOMParser().parseFromString(x,"text/html"),M=Array.from(I.querySelectorAll('[data-vf-gen-status="generating"][data-vf-gen-job]'));for(let O of M){if(b)return;let P=O.getAttribute("data-hf-id")||O.id,q=O.getAttribute("data-vf-gen-job");if(!(!P||!q))try{let et=await fetch(`/api/v1/user/me/jobs/${encodeURIComponent(q)}`);if(!et.ok)continue;let Q=await et.json().catch(()=>null);if(!Q)continue;let St=sJ(Q);if(St){lJ(mc.current,P,St);continue}let _t=typeof Q.status=="string"?Q.status:"";if(_t==="failed"||_t==="cancelled"){let Z=typeof Q.error=="string"&&Q.error?Q.error:`generation ${_t}`;Mm(mc.current,P,Zt=>{Zt.setAttribute("data-vf-gen-status","error"),Zt.setAttribute("data-vf-gen-error",Z.slice(0,200))})}}catch{}}};return(async()=>{for(;!b;){if(await new Promise(x=>setTimeout(x,6e3)),b)return;await T()}})(),()=>{b=!0}},[]);let $6=(0,A.useCallback)((b,T)=>{Ar("editor.timeline-edit-blocked",{elementKey:Nt(b),intent:T,tag:b.tag,timingSource:b.timingSource,timelineLocked:b.timelineLocked})},[]),j6=(0,A.useCallback)(b=>{let T=u.getState();T.setSelectedElementId(b?Nt(b):null),T.clearSelectedElementIds()},[u]),q6=(0,A.useCallback)(()=>F(null),[]),V6=(0,A.useCallback)(()=>D(null),[]),Y6=(0,A.useCallback)(()=>gt(null),[]),D1=(0,A.useCallback)(b=>Xm("text",b),[Xm]),L1=(0,A.useCallback)(b=>Xm("media",b),[Xm]),U1=(0,A.useCallback)(b=>{B.current={time:Number.isFinite(b.time)?b.time:u.getState().currentTime,frame:b.frame};let T=N.current;T&&(T.value="",T.click())},[u]),W6=(0,A.useCallback)(async b=>{let T=b.target.files?.[0]??null;if(b.target.value="",!T)return;let x=B.current??{time:u.getState().currentTime};B.current=null;let I=YX(T);if(!I){st(`Unsupported file type: ${T.type||T.name}`),window.setTimeout(()=>st(null),4e3);return}Ct.current?.(),st(`Uploading ${T.name}\u2026`);try{let{url:M}=await VX(T),O=`element_${I}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,P=x.frame,q={action_type:"add_layer",kind:I,src:M,start:x.time,layer_key:O,label:T.name,note:"Uploaded from computer"};if(I!=="audio"){let St=P??{x:12,y:18,width:54,height:32};q.x=St.x,q.y=St.y,q.width=St.width,q.height=St.height}let et=CU(q,mc.current);if(!et.ok){st(et.error??"Could not add the uploaded media."),window.setTimeout(()=>st(null),5e3);return}let Q=u.getState();Q.setSelectedElementId(O),Q.clearSelectedElementIds(),st(null)}catch(M){st(M instanceof Error?M.message:"Upload failed."),window.setTimeout(()=>st(null),5e3)}},[u]),K6=(0,g.jsxs)("div",{className:"preview-pane",children:[(0,g.jsxs)("div",{className:"player-stage",ref:Qt,onPointerDown:E6,onContextMenu:S6,children:[(0,g.jsxs)("div",{className:`source-watermark source-titlebar ${u6?"playing":""}`,children:[(0,g.jsx)("button",{type:"button",className:"mode-back-link",onClick:e,children:"< Preview"}),(0,g.jsx)("span",{children:"Studio"}),(0,g.jsx)("strong",{children:n.title})]}),E?(0,g.jsx)(s,{ref:b=>{dn.current=b,Hm.current=d(b)},directUrl:_1,onLoad:()=>{c6(),A6(),R6(),zd()?.liveReload&&o&&!tc.current&&(tc.current=!0,c0(h.current))},portrait:!0,suppressLoadingOverlay:!0},_1):(0,g.jsx)("section",{className:"editor-loading-shell","aria-label":"Composition loading",children:(0,g.jsx)("span",{children:"Loading composition"})}),(0,g.jsx)(GX,{selected:vn,html:m,visualFrameDraft:T1,stageRef:Qt,getIframe:It,onStageFrame:Ym,onCommitDrag:M6})]}),(0,g.jsx)(AX,{disabled:!S1,speedDraft:C,onSpeedDraftChange:k,onCommitSpeed:jd,onSeek:Ir,onTogglePlay:D6,onUndo:qd,onRedo:uc,canUndo:h6,canRedo:b6,usePlayerStore:u})]});return(0,g.jsxs)("section",{className:"studio-shell","aria-label":"Video editor output",children:[J&&!J.dismissed&&(0,g.jsx)(LX,{mode:J.mode,busy:J.busy,finished:J.finished,error:J.error,scenesCreated:J.scenesCreated,ghostcutStatus:J.ghostcutStatus,ghostcutProgress:J.ghostcutProgress,userPrompt:J.userPrompt,onUserPromptChange:b=>dt(T=>T&&{...T,userPrompt:b}),onDecompose:ko,onFinish:Me,onCancel:J.mode==="redo"?o0:void 0,onDismiss:J.mode==="initial"?r6:void 0}),Xt&&o&&(0,g.jsx)(UX,{forkId:o,onClose:()=>Ce(!1)}),_n&&o&&(0,g.jsx)(BX,{forkId:o,templateId:n.templateId??n.id,currentVersion:tt,onClose:()=>Pn(!1),onReverted:l6}),(0,g.jsxs)("section",{className:"studio-main",ref:ie,children:[K6,(0,g.jsx)($X,{composition:v,selected:vn,html:m,onPatchHtml:Ro,onPatchLiveElement:k6,onPreviewLiveElement:I6,onUnselect:H6,onDraftStateChange:N6,onStageTimelineDraft:Mi,onStageVisualFrameDraft:Ym,timelineDraft:g6,visualFrameDraft:T1,onClearTimelineDraft:f0,onClearVisualFrameDraft:d0,onDiscardVisualFrameDraft:C6,onDiscardTimelineDraft:O6,onDelete:Vd,maxDuration:f,onPublish:()=>Km(),publishOptions:_6,onPublishOption:b=>Km(b==="cloud"?"cloud":"local"),publishDisabled:rc,publishLabel:y6,templateId:n.templateId??null,forkId:o,publishVersion:H?.version??tt,originalUrl:n.originalUrl??null,songName:n.songName??null,songUrl:n.songUrl??null,onOpenShare:a6,onOpenDecompose:i6,onOpenHistory:s6,decomposeDismissed:!!J?.dismissed,decomposeBusy:!!J?.busy,onResumeDecompose:o6})]}),(0,g.jsxs)("section",{className:"native-timeline",ref:cn,onPointerDownCapture:T6,onClickCapture:w6,onContextMenuCapture:x6,children:[(0,g.jsx)(l,{onSeek:Ir,onMoveElement:L6,onResizeElement:U6,onBlockedEditAttempt:$6,onSplitElement:C1,onDeleteElement:Vd,onSelectElement:j6,renderClipContent:G6,theme:XK}),a0&&(0,g.jsx)("div",{className:"timeline-layer-numbers","aria-hidden":"true",style:{left:-p6},children:E1.map((b,T)=>(0,g.jsxs)("span",{className:"timeline-layer-number",style:{top:T*fU+2-d6},children:["L",b]},b))}),L&&(0,g.jsx)(kX,{state:L,usePlayerStore:u,canGroup:Gm.size>=2,canUngroup:v6,onClose:q6,onSeek:Ir,onSplit:C1,onInsertLayer:B6,onInsertText:D1,onInsertMedia:L1,onUploadMedia:U1,onCopyTimestamp:M1,onCopyCoordinates:P6,onGroup:m0,onUngroup:g0,onDelete:Vd})]}),U&&(0,g.jsx)(IX,{state:U,onClose:V6,onInsertText:D1,onInsertMedia:L1,onUploadMedia:U1,onCopyTimestamp:M1,onCopyCoordinates:z6}),(0,g.jsx)("input",{ref:N,type:"file",accept:"video/*,image/*,audio/*",style:{display:"none"},onChange:W6}),Y&&(0,g.jsx)("div",{className:"editor-upload-toast",role:"status",children:Y}),H&&(0,g.jsx)(RX,{state:H,onClose:Y6})]})}function zd(){if(typeof window>"u")return null;let t=window.__HF_BOOT__;if(t&&typeof t=="object"&&!Array.isArray(t))return OU(t);if(typeof document<"u"){let e=document.getElementById("hf-boot");if(e&&e.textContent)try{let n=JSON.parse(e.textContent);if(n&&typeof n=="object"&&!Array.isArray(n))return OU(n)}catch{}}return null}function OU(t){let e=typeof t.compositionId=="string"?t.compositionId:null;return e?{compositionId:e,draftPath:typeof t.draftPath=="string"?t.draftPath:void 0,slugId:typeof t.slugId=="string"?t.slugId:void 0,templateId:typeof t.templateId=="string"?t.templateId:null,title:typeof t.title=="string"?t.title:void 0,lambdaMemoryMb:typeof t.lambdaMemoryMb=="number"?t.lambdaMemoryMb:void 0,apiBase:typeof t.apiBase=="string"?t.apiBase:void 0,editorChatApiUrl:typeof t.editorChatApiUrl=="string"?t.editorChatApiUrl:null,vidfarmApiKey:typeof t.vidfarmApiKey=="string"?t.vidfarmApiKey:null,originalUrl:typeof t.originalUrl=="string"?t.originalUrl:null,songName:typeof t.songName=="string"?t.songName:null,songUrl:typeof t.songUrl=="string"?t.songUrl:null,localRender:t.localRender===!0,cloudRenderAvailable:t.cloudRenderAvailable===!0,initialThreadId:typeof t.initialThreadId=="string"?t.initialThreadId:null,liveReload:t.liveReload===!0}:null}function SJ(t){if(!t)return Um[0];let e=Um.find(n=>n.id===t.compositionId);return e?{...e,templateId:t.templateId??e.templateId??null,originalUrl:t.originalUrl??e.originalUrl??null,songName:t.songName??e.songName??null,songUrl:t.songUrl??e.songUrl??null}:{id:t.compositionId,eyebrow:"TEMPLATE",title:t.title??t.compositionId,sourceFolder:"",sourceType:"video",duration:12,width:720,height:1280,summary:"Template composition.",media:{type:"video",src:""},templateId:t.templateId??t.compositionId,originalUrl:t.originalUrl??null,songName:t.songName??null,songUrl:t.songUrl??null,viralDna:{hook:"",retention:"",payoff:"",preserve:[],avoid:[]},layers:[],editable:!0}}function e6({boot:t}={}){let e=(0,A.useMemo)(()=>SJ(t),[t]),n=!!t,[r,o]=(0,A.useState)(n?"edit":"preview"),[i,a]=(0,A.useState)(e);(0,A.useEffect)(()=>{let l=QK(),c=n?()=>{}:ZK();return()=>{l(),c()}},[n]),(0,A.useEffect)(()=>{xt("app.view-mode",{viewMode:r})},[r]);let s=r==="preview"?(0,g.jsx)("section",{className:"markdown-preview-shell","aria-label":"Preview output",children:(0,g.jsx)(yJ,{onEdit:l=>{a(l),xt("app.mode-change-request",{from:"preview",to:"edit",id:l.id}),o("edit")}})}):(0,g.jsx)(_J,{composition:i,onPreview:()=>{if(n){xt("app.mode-change-request",{from:"edit",to:"discover",boot:!0}),typeof window<"u"&&(window.location.href="/discover");return}xt("app.mode-change-request",{from:"edit",to:"preview"}),o("preview")}},i.id);return(0,g.jsxs)("main",{className:"vidfarm-workbench",children:[(0,g.jsx)(KX,{boot:t??null,composition:i}),(0,g.jsx)("section",{className:"editor-output",children:(0,g.jsx)(u1,{children:s})})]})}var Ds=Kr(Qm(),1);lU();xt("boot.entry-loaded");var y1=document.getElementById("root");if(!y1){xo("boot.root-missing");let t=new Error("Missing #root element");throw ta(t),t}var Hd=zd();xt("boot.config-resolved",Hd??{source:"none"});Hd?.templateId&&Yu.setTag("hyperframes.template_id",Hd.templateId);Hd?.compositionId&&Yu.setTag("hyperframes.composition_id",Hd.compositionId);function EJ(){return(0,Ds.jsxs)("section",{style:{display:"grid",placeItems:"center",height:"100vh",padding:"24px",textAlign:"center",gap:"12px",color:"#fffbe6",background:"#050604"},children:[(0,Ds.jsx)("strong",{style:{fontSize:"0.72rem",letterSpacing:"0.14em",textTransform:"uppercase"},children:"Editor crashed"}),(0,Ds.jsx)("span",{style:{fontSize:"0.92rem",opacity:.75},children:"Something went wrong loading the editor. Reload the page to try again."})]})}try{xt("boot.render-start",{rootChildren:y1.childNodes.length}),(0,n6.createRoot)(y1).render((0,Ds.jsx)(Yu.ErrorBoundary,{fallback:(0,Ds.jsx)(EJ,{}),onError:t=>xo("boot.render-error",t instanceof Error?t.stack:t),children:(0,Ds.jsx)(e6,{boot:Hd})})),xt("boot.render-called")}catch(t){throw xo("boot.render-error",t instanceof Error?t.stack:t),ta(t),t}
|
|
1208
1236
|
/*! Bundled license information:
|
|
1209
1237
|
|
|
1210
1238
|
scheduler/cjs/scheduler.production.js:
|