@mevdragon/vidfarm-devcli 0.5.3 → 0.6.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 +3 -3
- package/demo/README.md +28 -0
- package/demo/dist/app.css +1 -0
- package/demo/dist/app.js +1184 -0
- package/demo/dist/chunks/chunk-DXB73IDG.js +1 -0
- package/demo/dist/chunks/chunk-S7OWAJDS.js +36 -0
- package/demo/dist/chunks/chunk-VTIBZ6AN.js +1 -0
- package/demo/dist/chunks/dist-ADSJKBVE.js +332 -0
- package/demo/dist/chunks/domEditingLayers-VZMLL4AP-SGHWPND4.js +1 -0
- package/demo/dist/chunks/hyperframes-player-XB65TCD6.js +425 -0
- package/demo/dist/chunks/lib-XAQ37YOE.js +1 -0
- package/demo/dist/chunks/src-TJ2QYA4U.js +207 -0
- package/demo/dist/favicon.ico +0 -0
- package/demo/dist/icons/timeline/audio.svg +7 -0
- package/demo/dist/icons/timeline/captions.svg +5 -0
- package/demo/dist/icons/timeline/composition.svg +12 -0
- package/demo/dist/icons/timeline/image.svg +18 -0
- package/demo/dist/icons/timeline/music.svg +10 -0
- package/demo/dist/icons/timeline/text.svg +3 -0
- package/demo/dist/index.html +15 -0
- package/dist/src/account-pages-legacy.js +9396 -0
- package/dist/src/account-pages.js +61 -0
- package/dist/src/app.js +14378 -0
- package/dist/src/cli.js +1 -1
- package/dist/src/composition-runtime.js +613 -0
- package/dist/src/config.js +166 -0
- package/dist/src/context.js +447 -0
- package/dist/src/dev-app-legacy.js +739 -0
- package/dist/src/dev-app.js +6 -0
- package/dist/src/domain.js +2 -0
- package/dist/src/editor-chat-history.js +82 -0
- package/dist/src/editor-chat.js +449 -0
- package/dist/src/editor-dark-theme.js +1128 -0
- package/dist/src/frontend/debug.js +71 -0
- package/dist/src/frontend/flockposter-cache-store.js +124 -0
- package/dist/src/frontend/homepage-client.js +182 -0
- package/dist/src/frontend/homepage-shared.js +4 -0
- package/dist/src/frontend/homepage-store.js +28 -0
- package/dist/src/frontend/homepage-view.js +547 -0
- package/dist/src/frontend/page-runtime-client.js +132 -0
- package/dist/src/frontend/page-runtime-store.js +9 -0
- package/dist/src/frontend/sentry.js +42 -0
- package/dist/src/frontend/template-editor-chat.js +3960 -0
- package/dist/src/help-page.js +346 -0
- package/dist/src/homepage.js +1235 -0
- package/dist/src/hyperframes/composition.js +180 -0
- package/dist/src/index.js +16 -0
- package/dist/src/instrument.js +30 -0
- package/dist/src/lib/crypto.js +45 -0
- package/dist/src/lib/dev-log.js +54 -0
- package/dist/src/lib/display-name.js +11 -0
- package/dist/src/lib/ids.js +24 -0
- package/dist/src/lib/images.js +19 -0
- package/dist/src/lib/json.js +15 -0
- package/dist/src/lib/package-root.js +47 -0
- package/dist/src/lib/template-paths.js +28 -0
- package/dist/src/lib/time.js +7 -0
- package/dist/src/lib/url-clean.js +85 -0
- package/dist/src/page-runtime.js +2 -0
- package/dist/src/page-shell.js +1381 -0
- package/dist/src/primitive-context.js +357 -0
- package/dist/src/primitive-registry.js +2436 -0
- package/dist/src/primitive-sdk.js +4 -0
- package/dist/src/primitives/hyperframes-media.js +108 -0
- package/dist/src/react-page-shell.js +35 -0
- package/dist/src/ready-post-schedule-component.js +1540 -0
- package/dist/src/registry.js +296 -0
- package/dist/src/runtime.js +35 -0
- package/dist/src/services/api-call-history.js +249 -0
- package/dist/src/services/auth.js +152 -0
- package/dist/src/services/billing-pricing.js +39 -0
- package/dist/src/services/billing.js +228 -0
- package/dist/src/services/cast.js +127 -0
- package/dist/src/services/chat-threads.js +92 -0
- package/dist/src/services/composition-sanitize.js +124 -0
- package/dist/src/services/composition-watch.js +79 -0
- package/dist/src/services/fork-access.js +93 -0
- package/dist/src/services/fork-manifest.js +42 -0
- package/dist/src/services/ghostcut.js +179 -0
- package/dist/src/services/hyperframes.js +2307 -0
- package/dist/src/services/job-capacity.js +14 -0
- package/dist/src/services/job-logs.js +197 -0
- package/dist/src/services/jobs.js +136 -0
- package/dist/src/services/local-dynamo.js +0 -0
- package/dist/src/services/media-processing.js +766 -0
- package/dist/src/services/primitive-media-lambda.js +280 -0
- package/dist/src/services/providers.js +2926 -0
- package/dist/src/services/rate-limits.js +262 -0
- package/dist/src/services/serverless-auth.js +382 -0
- package/dist/src/services/serverless-jobs.js +1082 -0
- package/dist/src/services/serverless-provider-keys.js +409 -0
- package/dist/src/services/serverless-records.js +1385 -0
- package/dist/src/services/serverless-template-configs.js +75 -0
- package/dist/src/services/storage.js +383 -0
- package/dist/src/services/template-certification.js +413 -0
- package/dist/src/services/template-loader.js +99 -0
- package/dist/src/services/template-runtime-bundles.js +217 -0
- package/dist/src/services/template-sources.js +1017 -0
- package/dist/src/services/video-normalization.js +2 -0
- package/dist/src/services/webhooks.js +62 -0
- package/dist/src/template-editor-pages.js +2576 -0
- package/dist/src/template-editor-shell.js +2840 -0
- package/dist/src/template-sdk.js +4 -0
- package/dist/src/worker.js +17 -0
- package/package.json +6 -4
- package/public/assets/homepage-app.js +54 -0
- package/public/assets/homepage-client-app.js +80 -0
- package/public/assets/page-runtime-client-app.js +94 -0
- package/src/assets/SELLING_AWARENESS_STAGES.md +579 -0
- package/src/assets/SELLING_WITH_HOOKS.md +377 -0
- package/src/assets/SELLING_WITH_VSLS.md +606 -0
- package/src/assets/favicon.ico +0 -0
- package/src/assets/logo-vidfarm.png +0 -0
package/demo/dist/app.js
ADDED
|
@@ -0,0 +1,1184 @@
|
|
|
1
|
+
import{a as Ea,b as Y6,c as Wm}from"./chunks/chunk-S7OWAJDS.js";import{c as Ym,d as g0,e as Xr}from"./chunks/chunk-DXB73IDG.js";var zO=Ym(Ue=>{"use strict";function vT(t,e){var n=t.length;t.push(e);t:for(;0<n;){var r=n-1>>>1,o=t[r];if(0<db(o,e))t[r]=e,t[n]=o,n=r;else break t}}function Ti(t){return t.length===0?null:t[0]}function pb(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>db(s,n))l<o&&0>db(c,s)?(t[r]=c,t[l]=n,r=l):(t[r]=s,t[a]=n,r=a);else if(l<o&&0>db(c,n))t[r]=c,t[l]=n,r=l;else break t}}return e}function db(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}Ue.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(NO=performance,Ue.unstable_now=function(){return NO.now()}):(yT=Date,CO=yT.now(),Ue.unstable_now=function(){return yT.now()-CO});var NO,yT,CO,ea=[],os=[],dY=1,go=null,Kn=3,ST=!1,Ep=!1,Tp=!1,ET=!1,DO=typeof setTimeout=="function"?setTimeout:null,LO=typeof clearTimeout=="function"?clearTimeout:null,MO=typeof setImmediate<"u"?setImmediate:null;function fb(t){for(var e=Ti(os);e!==null;){if(e.callback===null)pb(os);else if(e.startTime<=t)pb(os),e.sortIndex=e.expirationTime,vT(ea,e);else break;e=Ti(os)}}function TT(t){if(Tp=!1,fb(t),!Ep)if(Ti(ea)!==null)Ep=!0,Wu||(Wu=!0,Yu());else{var e=Ti(os);e!==null&&wT(TT,e.startTime-t)}}var Wu=!1,wp=-1,UO=5,BO=-1;function PO(){return ET?!0:!(Ue.unstable_now()-BO<UO)}function bT(){if(ET=!1,Wu){var t=Ue.unstable_now();BO=t;var e=!0;try{t:{Ep=!1,Tp&&(Tp=!1,LO(wp),wp=-1),ST=!0;var n=Kn;try{e:{for(fb(t),go=Ti(ea);go!==null&&!(go.expirationTime>t&&PO());){var r=go.callback;if(typeof r=="function"){go.callback=null,Kn=go.priorityLevel;var o=r(go.expirationTime<=t);if(t=Ue.unstable_now(),typeof o=="function"){go.callback=o,fb(t),e=!0;break e}go===Ti(ea)&&pb(ea),fb(t)}else pb(ea);go=Ti(ea)}if(go!==null)e=!0;else{var i=Ti(os);i!==null&&wT(TT,i.startTime-t),e=!1}}break t}finally{go=null,Kn=n,ST=!1}e=void 0}}finally{e?Yu():Wu=!1}}}var Yu;typeof MO=="function"?Yu=function(){MO(bT)}:typeof MessageChannel<"u"?(_T=new MessageChannel,OO=_T.port2,_T.port1.onmessage=bT,Yu=function(){OO.postMessage(null)}):Yu=function(){DO(bT,0)};var _T,OO;function wT(t,e){wp=DO(function(){t(Ue.unstable_now())},e)}Ue.unstable_IdlePriority=5;Ue.unstable_ImmediatePriority=1;Ue.unstable_LowPriority=4;Ue.unstable_NormalPriority=3;Ue.unstable_Profiling=null;Ue.unstable_UserBlockingPriority=2;Ue.unstable_cancelCallback=function(t){t.callback=null};Ue.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"):UO=0<t?Math.floor(1e3/t):5};Ue.unstable_getCurrentPriorityLevel=function(){return Kn};Ue.unstable_next=function(t){switch(Kn){case 1:case 2:case 3:var e=3;break;default:e=Kn}var n=Kn;Kn=e;try{return t()}finally{Kn=n}};Ue.unstable_requestPaint=function(){ET=!0};Ue.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=Kn;Kn=t;try{return e()}finally{Kn=n}};Ue.unstable_scheduleCallback=function(t,e,n){var r=Ue.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:dY++,callback:e,priorityLevel:t,startTime:n,expirationTime:o,sortIndex:-1},n>r?(t.sortIndex=n,vT(os,t),Ti(ea)===null&&t===Ti(os)&&(Tp?(LO(wp),wp=-1):Tp=!0,wT(TT,n-r))):(t.sortIndex=o,vT(ea,t),Ep||ST||(Ep=!0,Wu||(Wu=!0,Yu()))),t};Ue.unstable_shouldYield=PO;Ue.unstable_wrapCallback=function(t){var e=Kn;return function(){var n=Kn;Kn=e;try{return t.apply(this,arguments)}finally{Kn=n}}}});var HO=Ym((Rvt,FO)=>{"use strict";FO.exports=zO()});var Z3=Ym(P_=>{"use strict";var hn=HO(),pL=Ea(),fY=Y6();function F(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 mL(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function um(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 gL(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 hL(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 GO(t){if(um(t)!==t)throw Error(F(188))}function pY(t){var e=t.alternate;if(!e){if(e=um(t),e===null)throw Error(F(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 GO(o),t;if(i===r)return GO(o),e;i=i.sibling}throw Error(F(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(F(189))}}if(n.alternate!==r)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?t:e}function yL(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=yL(t),e!==null)return e;t=t.sibling}return null}var Re=Object.assign,mY=Symbol.for("react.element"),mb=Symbol.for("react.transitional.element"),Mp=Symbol.for("react.portal"),td=Symbol.for("react.fragment"),bL=Symbol.for("react.strict_mode"),ow=Symbol.for("react.profiler"),_L=Symbol.for("react.consumer"),ca=Symbol.for("react.context"),Zw=Symbol.for("react.forward_ref"),iw=Symbol.for("react.suspense"),aw=Symbol.for("react.suspense_list"),tx=Symbol.for("react.memo"),is=Symbol.for("react.lazy");Symbol.for("react.scope");var sw=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var gY=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var $O=Symbol.iterator;function xp(t){return t===null||typeof t!="object"?null:(t=$O&&t[$O]||t["@@iterator"],typeof t=="function"?t:null)}var hY=Symbol.for("react.client.reference");function lw(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===hY?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case td:return"Fragment";case ow:return"Profiler";case bL:return"StrictMode";case iw:return"Suspense";case aw:return"SuspenseList";case sw:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Mp:return"Portal";case ca:return t.displayName||"Context";case _L:return(t._context.displayName||"Context")+".Consumer";case Zw:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case tx:return e=t.displayName||null,e!==null?e:lw(t.type)||"Memo";case is:e=t._payload,t=t._init;try{return lw(t(e))}catch{}}return null}var Op=Array.isArray,kt=pL.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=fY.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Dl={pending:!1,data:null,method:null,action:null},cw=[],ed=-1;function ki(t){return{current:t}}function kn(t){0>ed||(t.current=cw[ed],cw[ed]=null,ed--)}function we(t,e){ed++,cw[ed]=t.current,t.current=e}var Ii=ki(null),Xp=ki(null),hs=ki(null),Yb=ki(null);function Wb(t,e){switch(we(hs,e),we(Xp,t),we(Ii,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?XD(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=XD(e),t=z3(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}kn(Ii),we(Ii,t)}function _d(){kn(Ii),kn(Xp),kn(hs)}function uw(t){t.memoizedState!==null&&we(Yb,t);var e=Ii.current,n=z3(e,t.type);e!==n&&(we(Xp,t),we(Ii,n))}function Kb(t){Xp.current===t&&(kn(Ii),kn(Xp)),Yb.current===t&&(kn(Yb),sm._currentValue=Dl)}var xT,jO;function Nl(t){if(xT===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);xT=e&&e[1]||"",jO=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+xT+t+jO}var AT=!1;function IT(t,e){if(!t||AT)return"";AT=!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
|
+
`),c=s.split(`
|
|
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
|
+
`+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{AT=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Nl(n):""}function yY(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 IT(t.type,!1);case 11:return IT(t.type.render,!1);case 1:return IT(t.type,!0);case 31:return Nl("Activity");default:return""}}function qO(t){try{var e="",n=null;do e+=yY(t,n),n=t,t=t.return;while(t);return e}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var dw=Object.prototype.hasOwnProperty,ex=hn.unstable_scheduleCallback,kT=hn.unstable_cancelCallback,bY=hn.unstable_shouldYield,_Y=hn.unstable_requestPaint,$r=hn.unstable_now,vY=hn.unstable_getCurrentPriorityLevel,vL=hn.unstable_ImmediatePriority,SL=hn.unstable_UserBlockingPriority,Xb=hn.unstable_NormalPriority,SY=hn.unstable_LowPriority,EL=hn.unstable_IdlePriority,EY=hn.log,TY=hn.unstable_setDisableYieldValue,dm=null,jr=null;function ds(t){if(typeof EY=="function"&&TY(t),jr&&typeof jr.setStrictMode=="function")try{jr.setStrictMode(dm,t)}catch{}}var qr=Math.clz32?Math.clz32:AY,wY=Math.log,xY=Math.LN2;function AY(t){return t>>>=0,t===0?32:31-(wY(t)/xY|0)|0}var gb=256,hb=262144,yb=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 E_(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 fm(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function IY(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 TL(){var t=yb;return yb<<=1,(yb&62914560)===0&&(yb=4194304),t}function RT(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function pm(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function kY(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-qr(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&&wL(t,r,0),i!==0&&o===0&&t.tag!==0&&(t.suspendedLanes|=i&~(a&~e))}function wL(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-qr(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|n&261930}function xL(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-qr(n),o=1<<r;o&e|t[r]&e&&(t[r]|=e),n&=~o}}function AL(t,e){var n=e&-e;return n=(n&42)!==0?1:nx(n),(n&(t.suspendedLanes|e))!==0?0:n}function nx(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 rx(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function IL(){var t=se.p;return t!==0?t:(t=window.event,t===void 0?32:X3(t.type))}function VO(t,e){var n=se.p;try{return se.p=t,e()}finally{se.p=n}}var Rs=Math.random().toString(36).slice(2),On="__reactFiber$"+Rs,wr="__reactProps$"+Rs,Nd="__reactContainer$"+Rs,fw="__reactEvents$"+Rs,RY="__reactListeners$"+Rs,NY="__reactHandles$"+Rs,YO="__reactResources$"+Rs,mm="__reactMarker$"+Rs;function ox(t){delete t[On],delete t[wr],delete t[fw],delete t[RY],delete t[NY]}function nd(t){var e=t[On];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Nd]||n[On]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=eL(t);t!==null;){if(n=t[On])return n;t=eL(t)}return e}t=n,n=t.parentNode}return null}function Cd(t){if(t=t[On]||t[Nd]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Dp(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(F(33))}function fd(t){var e=t[YO];return e||(e=t[YO]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function In(t){t[mm]=!0}var kL=new Set,RL={};function jl(t,e){vd(t,e),vd(t+"Capture",e)}function vd(t,e){for(RL[t]=e,t=0;t<e.length;t++)kL.add(e[t])}var CY=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]*$"),WO={},KO={};function MY(t){return dw.call(KO,t)?!0:dw.call(WO,t)?!1:CY.test(t)?KO[t]=!0:(WO[t]=!0,!1)}function Mb(t,e,n){if(MY(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 bb(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 yo(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function NL(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function OY(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 pw(t){if(!t._valueTracker){var e=NL(t)?"checked":"value";t._valueTracker=OY(t,e,""+t[e])}}function CL(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=NL(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Jb(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 DY=/[\n"\\]/g;function vo(t){return t.replace(DY,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function mw(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=""+yo(e)):t.value!==""+yo(e)&&(t.value=""+yo(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?gw(t,a,yo(e)):n!=null?gw(t,a,yo(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=""+yo(s):t.removeAttribute("name")}function ML(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)){pw(t);return}n=n!=null?""+yo(n):"",e=e!=null?""+yo(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),pw(t)}function gw(t,e,n){e==="number"&&Jb(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function pd(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=""+yo(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 OL(t,e,n){if(e!=null&&(e=""+yo(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+yo(n):""}function DL(t,e,n,r){if(e==null){if(r!=null){if(n!=null)throw Error(F(92));if(Op(r)){if(1<r.length)throw Error(F(93));r=r[0]}n=r}n==null&&(n=""),e=n}n=yo(e),t.defaultValue=n,r=t.textContent,r===n&&r!==""&&r!==null&&(t.value=r),pw(t)}function Sd(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var LY=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 XO(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||LY.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function LL(t,e,n){if(e!=null&&typeof e!="object")throw Error(F(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&&XO(t,o,r)}else for(var i in e)e.hasOwnProperty(i)&&XO(t,i,e[i])}function ix(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 UY=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"]]),BY=/^[\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 Ob(t){return BY.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ua(){}var hw=null;function ax(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var rd=null,md=null;function JO(t){var e=Cd(t);if(e&&(t=e.stateNode)){var n=t[wr]||null;t:switch(t=e.stateNode,e.type){case"input":if(mw(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="'+vo(""+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(F(90));mw(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&&CL(r)}break t;case"textarea":OL(t,n.value,n.defaultValue);break t;case"select":e=n.value,e!=null&&pd(t,!!n.multiple,e,!1)}}}var NT=!1;function UL(t,e,n){if(NT)return t(e,n);NT=!0;try{var r=t(e);return r}finally{if(NT=!1,(rd!==null||md!==null)&&(D_(),rd&&(e=rd,t=md,md=rd=null,JO(e),t)))for(e=0;e<t.length;e++)JO(t[e])}}function Jp(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(F(231,e,typeof n));return n}var ga=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yw=!1;if(ga)try{Ku={},Object.defineProperty(Ku,"passive",{get:function(){yw=!0}}),window.addEventListener("test",Ku,Ku),window.removeEventListener("test",Ku,Ku)}catch{yw=!1}var Ku,fs=null,sx=null,Db=null;function BL(){if(Db)return Db;var t,e=sx,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 Db=o.slice(t,1<r?1-r:void 0)}function Lb(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 _b(){return!0}function QO(){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)?_b:QO,this.isPropagationStopped=QO,this}return Re(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=_b)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=_b)},persist:function(){},isPersistent:_b}),e}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},T_=xr(ql),gm=Re({},ql,{view:0,detail:0}),PY=xr(gm),CT,MT,Ap,w_=Re({},gm,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lx,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!==Ap&&(Ap&&t.type==="mousemove"?(CT=t.screenX-Ap.screenX,MT=t.screenY-Ap.screenY):MT=CT=0,Ap=t),CT)},movementY:function(t){return"movementY"in t?t.movementY:MT}}),ZO=xr(w_),zY=Re({},w_,{dataTransfer:0}),FY=xr(zY),HY=Re({},gm,{relatedTarget:0}),OT=xr(HY),GY=Re({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),$Y=xr(GY),jY=Re({},ql,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),qY=xr(jY),VY=Re({},ql,{data:0}),tD=xr(VY),YY={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WY={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"},KY={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function XY(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=KY[t])?!!e[t]:!1}function lx(){return XY}var JY=Re({},gm,{key:function(t){if(t.key){var e=YY[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Lb(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?WY[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lx,charCode:function(t){return t.type==="keypress"?Lb(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Lb(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),QY=xr(JY),ZY=Re({},w_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eD=xr(ZY),tW=Re({},gm,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lx}),eW=xr(tW),nW=Re({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),rW=xr(nW),oW=Re({},w_,{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}),iW=xr(oW),aW=Re({},ql,{newState:0,oldState:0}),sW=xr(aW),lW=[9,13,27,32],cx=ga&&"CompositionEvent"in window,Bp=null;ga&&"documentMode"in document&&(Bp=document.documentMode);var cW=ga&&"TextEvent"in window&&!Bp,PL=ga&&(!cx||Bp&&8<Bp&&11>=Bp),nD=" ",rD=!1;function zL(t,e){switch(t){case"keyup":return lW.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FL(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var od=!1;function uW(t,e){switch(t){case"compositionend":return FL(e);case"keypress":return e.which!==32?null:(rD=!0,nD);case"textInput":return t=e.data,t===nD&&rD?null:t;default:return null}}function dW(t,e){if(od)return t==="compositionend"||!cx&&zL(t,e)?(t=BL(),Db=sx=fs=null,od=!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 PL&&e.locale!=="ko"?null:e.data;default:return null}}var fW={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 oD(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!fW[t.type]:e==="textarea"}function HL(t,e,n,r){rd?md?md.push(r):md=[r]:rd=r,e=g_(e,"onChange"),0<e.length&&(n=new T_("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Pp=null,Qp=null;function pW(t){U3(t,0)}function x_(t){var e=Dp(t);if(CL(e))return t}function iD(t,e){if(t==="change")return e}var GL=!1;ga&&(ga?(Sb="oninput"in document,Sb||(DT=document.createElement("div"),DT.setAttribute("oninput","return;"),Sb=typeof DT.oninput=="function"),vb=Sb):vb=!1,GL=vb&&(!document.documentMode||9<document.documentMode));var vb,Sb,DT;function aD(){Pp&&(Pp.detachEvent("onpropertychange",$L),Qp=Pp=null)}function $L(t){if(t.propertyName==="value"&&x_(Qp)){var e=[];HL(e,Qp,t,ax(t)),UL(pW,e)}}function mW(t,e,n){t==="focusin"?(aD(),Pp=e,Qp=n,Pp.attachEvent("onpropertychange",$L)):t==="focusout"&&aD()}function gW(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return x_(Qp)}function hW(t,e){if(t==="click")return x_(e)}function yW(t,e){if(t==="input"||t==="change")return x_(e)}function bW(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Yr=typeof Object.is=="function"?Object.is:bW;function Zp(t,e){if(Yr(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(!dw.call(e,o)||!Yr(t[o],e[o]))return!1}return!0}function sD(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function lD(t,e){var n=sD(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=sD(n)}}function jL(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?jL(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function qL(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Jb(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=Jb(t.document)}return e}function ux(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 _W=ga&&"documentMode"in document&&11>=document.documentMode,id=null,bw=null,zp=null,_w=!1;function cD(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_w||id==null||id!==Jb(r)||(r=id,"selectionStart"in r&&ux(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}),zp&&Zp(zp,r)||(zp=r,r=g_(bw,"onSelect"),0<r.length&&(e=new T_("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=id)))}function Rl(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var ad={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")},LT={},VL={};ga&&(VL=document.createElement("div").style,"AnimationEvent"in window||(delete ad.animationend.animation,delete ad.animationiteration.animation,delete ad.animationstart.animation),"TransitionEvent"in window||delete ad.transitionend.transition);function Vl(t){if(LT[t])return LT[t];if(!ad[t])return t;var e=ad[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in VL)return LT[t]=e[n];return t}var YL=Vl("animationend"),WL=Vl("animationiteration"),KL=Vl("animationstart"),vW=Vl("transitionrun"),SW=Vl("transitionstart"),EW=Vl("transitioncancel"),XL=Vl("transitionend"),JL=new Map,vw="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(" ");vw.push("scrollEnd");function Jo(t,e){JL.set(t,e),jl(e,[t])}var Qb=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)},ho=[],sd=0,dx=0;function A_(){for(var t=sd,e=dx=sd=0;e<t;){var n=ho[e];ho[e++]=null;var r=ho[e];ho[e++]=null;var o=ho[e];ho[e++]=null;var i=ho[e];if(ho[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&&QL(n,o,i)}}function I_(t,e,n,r){ho[sd++]=t,ho[sd++]=e,ho[sd++]=n,ho[sd++]=r,dx|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function fx(t,e,n,r){return I_(t,e,n,r),Zb(t)}function Yl(t,e){return I_(t,null,null,e),Zb(t)}function QL(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-qr(n),t=i.hiddenUpdates,r=t[o],r===null?t[o]=[e]:r.push(e),e.lane=n|536870912),i):null}function Zb(t){if(50<Wp)throw Wp=0,Hw=null,Error(F(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var ld={};function TW(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 Hr(t,e,n,r){return new TW(t,e,n,r)}function px(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fa(t,e){var n=t.alternate;return n===null?(n=Hr(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 ZL(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 Ub(t,e,n,r,o,i){var a=0;if(r=t,typeof t=="function")px(t)&&(a=1);else if(typeof t=="string")a=AK(t,n,Ii.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case sw:return t=Hr(31,n,e,o),t.elementType=sw,t.lanes=i,t;case td:return Ll(n.children,o,i,e);case bL:a=8,o|=24;break;case ow:return t=Hr(12,n,e,o|2),t.elementType=ow,t.lanes=i,t;case iw:return t=Hr(13,n,e,o),t.elementType=iw,t.lanes=i,t;case aw:return t=Hr(19,n,e,o),t.elementType=aw,t.lanes=i,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ca:a=10;break t;case _L:a=9;break t;case Zw:a=11;break t;case tx:a=14;break t;case is:a=16,r=null;break t}a=29,n=Error(F(130,t===null?"null":typeof t,"")),r=null}return e=Hr(a,n,e,o),e.elementType=t,e.type=r,e.lanes=i,e}function Ll(t,e,n,r){return t=Hr(7,t,r,e),t.lanes=n,t}function UT(t,e,n){return t=Hr(6,t,null,e),t.lanes=n,t}function t5(t){var e=Hr(18,null,null,0);return e.stateNode=t,e}function BT(t,e,n){return e=Hr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var uD=new WeakMap;function So(t,e){if(typeof t=="object"&&t!==null){var n=uD.get(t);return n!==void 0?n:(e={value:t,source:e,stack:qO(e)},uD.set(t,e),e)}return{value:t,source:e,stack:qO(e)}}var cd=[],ud=0,t_=null,tm=0,bo=[],_o=0,xs=null,wi=1,xi="";function sa(t,e){cd[ud++]=tm,cd[ud++]=t_,t_=t,tm=e}function e5(t,e,n){bo[_o++]=wi,bo[_o++]=xi,bo[_o++]=xs,xs=t;var r=wi;t=xi;var o=32-qr(r)-1;r&=~(1<<o),n+=1;var i=32-qr(e)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,wi=1<<32-qr(e)+o|n<<o|r,xi=i+t}else wi=1<<i|n<<o|r,xi=t}function mx(t){t.return!==null&&(sa(t,1),e5(t,1,0))}function gx(t){for(;t===t_;)t_=cd[--ud],cd[ud]=null,tm=cd[--ud],cd[ud]=null;for(;t===xs;)xs=bo[--_o],bo[_o]=null,xi=bo[--_o],bo[_o]=null,wi=bo[--_o],bo[_o]=null}function n5(t,e){bo[_o++]=wi,bo[_o++]=xi,bo[_o++]=xs,wi=e.id,xi=e.overflow,xs=t}var Dn=null,ke=null,Kt=!1,ys=null,Eo=!1,Sw=Error(F(519));function As(t){var e=Error(F(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw em(So(e,t)),Sw}function dD(t){var e=t.stateNode,n=t.type,r=t.memoizedProps;switch(e[On]=t,e[wr]=r,n){case"dialog":qt("cancel",e),qt("close",e);break;case"iframe":case"object":case"embed":qt("load",e);break;case"video":case"audio":for(n=0;n<im.length;n++)qt(im[n],e);break;case"source":qt("error",e);break;case"img":case"image":case"link":qt("error",e),qt("load",e);break;case"details":qt("toggle",e);break;case"input":qt("invalid",e),ML(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":qt("invalid",e);break;case"textarea":qt("invalid",e),DL(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||P3(e.textContent,n)?(r.popover!=null&&(qt("beforetoggle",e),qt("toggle",e)),r.onScroll!=null&&qt("scroll",e),r.onScrollEnd!=null&&qt("scrollend",e),r.onClick!=null&&(e.onclick=ua),e=!0):e=!1,e||As(t,!0)}function fD(t){for(Dn=t.return;Dn;)switch(Dn.tag){case 5:case 31:case 13:Eo=!1;return;case 27:case 3:Eo=!0;return;default:Dn=Dn.return}}function Xu(t){if(t!==Dn)return!1;if(!Kt)return fD(t),Kt=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Vw(t.type,t.memoizedProps)),n=!n),n&&ke&&As(t),fD(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(F(317));ke=tL(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(F(317));ke=tL(t)}else e===27?(e=ke,Ns(t.type)?(t=Xw,Xw=null,ke=t):ke=e):ke=Dn?wo(t.stateNode.nextSibling):null;return!0}function zl(){ke=Dn=null,Kt=!1}function PT(){var t=ys;return t!==null&&(Er===null?Er=t:Er.push.apply(Er,t),ys=null),t}function em(t){ys===null?ys=[t]:ys.push(t)}var Ew=ki(null),Wl=null,da=null;function ss(t,e,n){we(Ew,e._currentValue),e._currentValue=n}function pa(t){t._currentValue=Ew.current,kn(Ew)}function Tw(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 ww(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),Tw(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(F(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),Tw(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 Md(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(F(387));if(a=a.memoizedProps,a!==null){var s=o.type;Yr(o.pendingProps.value,a.value)||(t!==null?t.push(s):t=[s])}}else if(o===Yb.current){if(a=o.alternate,a===null)throw Error(F(387));a.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(t!==null?t.push(sm):t=[sm])}o=o.return}t!==null&&ww(e,t,n,r),e.flags|=262144}function e_(t){for(t=t.firstContext;t!==null;){if(!Yr(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 r5(Wl,t)}function Eb(t,e){return Wl===null&&Fl(t),r5(t,e)}function r5(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},da===null){if(t===null)throw Error(F(308));da=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else da=da.next=e;return n}var wW=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()})}},xW=hn.unstable_scheduleCallback,AW=hn.unstable_NormalPriority,cn={$$typeof:ca,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hx(){return{controller:new wW,data:new Map,refCount:0}}function hm(t){t.refCount--,t.refCount===0&&xW(AW,function(){t.controller.abort()})}var Fp=null,xw=0,Ed=0,gd=null;function IW(t,e){if(Fp===null){var n=Fp=[];xw=0,Ed=Hx(),gd={status:"pending",value:void 0,then:function(r){n.push(r)}}}return xw++,e.then(pD,pD),e}function pD(){if(--xw===0&&Fp!==null){gd!==null&&(gd.status="fulfilled");var t=Fp;Fp=null,Ed=0,gd=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function kW(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 mD=kt.S;kt.S=function(t,e){y3=$r(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&IW(t,e),mD!==null&&mD(t,e)};var Ul=ki(null);function yx(){var t=Ul.current;return t!==null?t:ve.pooledCache}function Bb(t,e){e===null?we(Ul,Ul.current):we(Ul,e.pool)}function o5(){var t=yx();return t===null?null:{parent:cn._currentValue,pool:t}}var Od=Error(F(460)),bx=Error(F(474)),k_=Error(F(542)),n_={then:function(){}};function gD(t){return t=t.status,t==="fulfilled"||t==="rejected"}function i5(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,yD(t),t;default:if(typeof e.status=="string")e.then(ua,ua);else{if(t=ve,t!==null&&100<t.shellSuspendCounter)throw Error(F(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,yD(t),t}throw Bl=e,Od}}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,Od):n}}var Bl=null;function hD(){if(Bl===null)throw Error(F(459));var t=Bl;return Bl=null,t}function yD(t){if(t===Od||t===k_)throw Error(F(483))}var hd=null,nm=0;function Tb(t){var e=nm;return nm+=1,hd===null&&(hd=[]),i5(hd,t,e)}function Ip(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function wb(t,e){throw e.$$typeof===mY?Error(F(525)):(t=Object.prototype.toString.call(e),Error(F(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function a5(t){function e(h,b){if(t){var S=h.deletions;S===null?(h.deletions=[b],h.flags|=16):S.push(b)}}function n(h,b){if(!t)return null;for(;b!==null;)e(h,b),b=b.sibling;return null}function r(h){for(var b=new Map;h!==null;)h.key!==null?b.set(h.key,h):b.set(h.index,h),h=h.sibling;return b}function o(h,b){return h=fa(h,b),h.index=0,h.sibling=null,h}function i(h,b,S){return h.index=S,t?(S=h.alternate,S!==null?(S=S.index,S<b?(h.flags|=67108866,b):S):(h.flags|=67108866,b)):(h.flags|=1048576,b)}function a(h){return t&&h.alternate===null&&(h.flags|=67108866),h}function s(h,b,S,E){return b===null||b.tag!==6?(b=UT(S,h.mode,E),b.return=h,b):(b=o(b,S),b.return=h,b)}function l(h,b,S,E){var R=S.type;return R===td?d(h,b,S.props.children,E,S.key):b!==null&&(b.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===is&&Ml(R)===b.type)?(b=o(b,S.props),Ip(b,S),b.return=h,b):(b=Ub(S.type,S.key,S.props,null,h.mode,E),Ip(b,S),b.return=h,b)}function c(h,b,S,E){return b===null||b.tag!==4||b.stateNode.containerInfo!==S.containerInfo||b.stateNode.implementation!==S.implementation?(b=BT(S,h.mode,E),b.return=h,b):(b=o(b,S.children||[]),b.return=h,b)}function d(h,b,S,E,R){return b===null||b.tag!==7?(b=Ll(S,h.mode,E,R),b.return=h,b):(b=o(b,S),b.return=h,b)}function u(h,b,S){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return b=UT(""+b,h.mode,S),b.return=h,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case mb:return S=Ub(b.type,b.key,b.props,null,h.mode,S),Ip(S,b),S.return=h,S;case Mp:return b=BT(b,h.mode,S),b.return=h,b;case is:return b=Ml(b),u(h,b,S)}if(Op(b)||xp(b))return b=Ll(b,h.mode,S,null),b.return=h,b;if(typeof b.then=="function")return u(h,Tb(b),S);if(b.$$typeof===ca)return u(h,Eb(h,b),S);wb(h,b)}return null}function p(h,b,S,E){var R=b!==null?b.key:null;if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return R!==null?null:s(h,b,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case mb:return S.key===R?l(h,b,S,E):null;case Mp:return S.key===R?c(h,b,S,E):null;case is:return S=Ml(S),p(h,b,S,E)}if(Op(S)||xp(S))return R!==null?null:d(h,b,S,E,null);if(typeof S.then=="function")return p(h,b,Tb(S),E);if(S.$$typeof===ca)return p(h,b,Eb(h,S),E);wb(h,S)}return null}function f(h,b,S,E,R){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return h=h.get(S)||null,s(b,h,""+E,R);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case mb:return h=h.get(E.key===null?S:E.key)||null,l(b,h,E,R);case Mp:return h=h.get(E.key===null?S:E.key)||null,c(b,h,E,R);case is:return E=Ml(E),f(h,b,S,E,R)}if(Op(E)||xp(E))return h=h.get(S)||null,d(b,h,E,R,null);if(typeof E.then=="function")return f(h,b,S,Tb(E),R);if(E.$$typeof===ca)return f(h,b,S,Eb(b,E),R);wb(b,E)}return null}function m(h,b,S,E){for(var R=null,C=null,I=b,L=b=0,P=null;I!==null&&L<S.length;L++){I.index>L?(P=I,I=null):P=I.sibling;var U=p(h,I,S[L],E);if(U===null){I===null&&(I=P);break}t&&I&&U.alternate===null&&e(h,I),b=i(U,b,L),C===null?R=U:C.sibling=U,C=U,I=P}if(L===S.length)return n(h,I),Kt&&sa(h,L),R;if(I===null){for(;L<S.length;L++)I=u(h,S[L],E),I!==null&&(b=i(I,b,L),C===null?R=I:C.sibling=I,C=I);return Kt&&sa(h,L),R}for(I=r(I);L<S.length;L++)P=f(I,h,L,S[L],E),P!==null&&(t&&P.alternate!==null&&I.delete(P.key===null?L:P.key),b=i(P,b,L),C===null?R=P:C.sibling=P,C=P);return t&&I.forEach(function(O){return e(h,O)}),Kt&&sa(h,L),R}function _(h,b,S,E){if(S==null)throw Error(F(151));for(var R=null,C=null,I=b,L=b=0,P=null,U=S.next();I!==null&&!U.done;L++,U=S.next()){I.index>L?(P=I,I=null):P=I.sibling;var O=p(h,I,U.value,E);if(O===null){I===null&&(I=P);break}t&&I&&O.alternate===null&&e(h,I),b=i(O,b,L),C===null?R=O:C.sibling=O,C=O,I=P}if(U.done)return n(h,I),Kt&&sa(h,L),R;if(I===null){for(;!U.done;L++,U=S.next())U=u(h,U.value,E),U!==null&&(b=i(U,b,L),C===null?R=U:C.sibling=U,C=U);return Kt&&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),b=i(U,b,L),C===null?R=U:C.sibling=U,C=U);return t&&I.forEach(function(N){return e(h,N)}),Kt&&sa(h,L),R}function v(h,b,S,E){if(typeof S=="object"&&S!==null&&S.type===td&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case mb:t:{for(var R=S.key;b!==null;){if(b.key===R){if(R=S.type,R===td){if(b.tag===7){n(h,b.sibling),E=o(b,S.props.children),E.return=h,h=E;break t}}else if(b.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===is&&Ml(R)===b.type){n(h,b.sibling),E=o(b,S.props),Ip(E,S),E.return=h,h=E;break t}n(h,b);break}else e(h,b);b=b.sibling}S.type===td?(E=Ll(S.props.children,h.mode,E,S.key),E.return=h,h=E):(E=Ub(S.type,S.key,S.props,null,h.mode,E),Ip(E,S),E.return=h,h=E)}return a(h);case Mp:t:{for(R=S.key;b!==null;){if(b.key===R)if(b.tag===4&&b.stateNode.containerInfo===S.containerInfo&&b.stateNode.implementation===S.implementation){n(h,b.sibling),E=o(b,S.children||[]),E.return=h,h=E;break t}else{n(h,b);break}else e(h,b);b=b.sibling}E=BT(S,h.mode,E),E.return=h,h=E}return a(h);case is:return S=Ml(S),v(h,b,S,E)}if(Op(S))return m(h,b,S,E);if(xp(S)){if(R=xp(S),typeof R!="function")throw Error(F(150));return S=R.call(S),_(h,b,S,E)}if(typeof S.then=="function")return v(h,b,Tb(S),E);if(S.$$typeof===ca)return v(h,b,Eb(h,S),E);wb(h,S)}return typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint"?(S=""+S,b!==null&&b.tag===6?(n(h,b.sibling),E=o(b,S),E.return=h,h=E):(n(h,b),E=UT(S,h.mode,E),E.return=h,h=E),a(h)):n(h,b)}return function(h,b,S,E){try{nm=0;var R=v(h,b,S,E);return hd=null,R}catch(I){if(I===Od||I===k_)throw I;var C=Hr(29,I,null,h.mode);return C.lanes=E,C.return=h,C}finally{}}}var Hl=a5(!0),s5=a5(!1),as=!1;function _x(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Aw(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 bs(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,(ae&2)!==0){var o=r.pending;return o===null?e.next=e:(e.next=o.next,o.next=e),r.pending=e,e=Zb(t),QL(t,null,n),e}return I_(t,r,e,n),Zb(t)}function Hp(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,xL(t,n)}}function zT(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 Iw=!1;function Gp(){if(Iw){var t=gd;if(t!==null)throw t}}function $p(t,e,n,r){Iw=!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?(Wt&p)===p:(r&p)===p){p!==0&&p===Ed&&(Iw=!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=Re({},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),ks|=a,t.lanes=a,t.memoizedState=u}}function l5(t,e){if(typeof t!="function")throw Error(F(191,t));t.call(e)}function c5(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)l5(n[t],e)}var Td=ki(null),r_=ki(0);function bD(t,e){t=_a,we(r_,t),we(Td,e),_a=t|e.baseLanes}function kw(){we(r_,_a),we(Td,Td.current)}function vx(){_a=r_.current,kn(Td),kn(r_)}var Wr=ki(null),To=null;function ls(t){var e=t.alternate;we(Xe,Xe.current&1),we(Wr,t),To===null&&(e===null||Td.current!==null||e.memoizedState!==null)&&(To=t)}function Rw(t){we(Xe,Xe.current),we(Wr,t),To===null&&(To=t)}function u5(t){t.tag===22?(we(Xe,Xe.current),we(Wr,t),To===null&&(To=t)):cs(t)}function cs(){we(Xe,Xe.current),we(Wr,Wr.current)}function Fr(t){kn(Wr),To===t&&(To=null),kn(Xe)}var Xe=ki(0);function o_(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ww(n)||Kw(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,Ft=null,pe=null,sn=null,i_=!1,yd=!1,Gl=!1,a_=0,rm=0,bd=null,RW=0;function Ve(){throw Error(F(321))}function Sx(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Yr(t[n],e[n]))return!1;return!0}function Ex(t,e,n,r,o,i){return ha=i,Ft=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,kt.H=t===null||t.memoizedState===null?H5:Ox,Gl=!1,i=n(r,o),Gl=!1,yd&&(i=f5(e,n,r,o)),d5(t),i}function d5(t){kt.H=om;var e=pe!==null&&pe.next!==null;if(ha=0,sn=pe=Ft=null,i_=!1,rm=0,bd=null,e)throw Error(F(300));t===null||un||(t=t.dependencies,t!==null&&e_(t)&&(un=!0))}function f5(t,e,n,r){Ft=t;var o=0;do{if(yd&&(bd=null),rm=0,yd=!1,25<=o)throw Error(F(301));if(o+=1,sn=pe=null,t.updateQueue!=null){var i=t.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}kt.H=G5,i=e(n,r)}while(yd);return i}function NW(){var t=kt.H,e=t.useState()[0];return e=typeof e.then=="function"?ym(e):e,t=t.useState()[0],(pe!==null?pe.memoizedState:null)!==t&&(Ft.flags|=1024),e}function Tx(){var t=a_!==0;return a_=0,t}function wx(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function xx(t){if(i_){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}i_=!1}ha=0,sn=pe=Ft=null,yd=!1,rm=a_=0,bd=null}function rr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sn===null?Ft.memoizedState=sn=t:sn=sn.next=t,sn}function Je(){if(pe===null){var t=Ft.alternate;t=t!==null?t.memoizedState:null}else t=pe.next;var e=sn===null?Ft.memoizedState:sn.next;if(e!==null)sn=e,pe=t;else{if(t===null)throw Ft.alternate===null?Error(F(467)):Error(F(310));pe=t,t={memoizedState:pe.memoizedState,baseState:pe.baseState,baseQueue:pe.baseQueue,queue:pe.queue,next:null},sn===null?Ft.memoizedState=sn=t:sn=sn.next=t}return sn}function R_(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ym(t){var e=rm;return rm+=1,bd===null&&(bd=[]),t=i5(bd,t,e),e=Ft,(sn===null?e.memoizedState:sn.next)===null&&(e=e.alternate,kt.H=e===null||e.memoizedState===null?H5:Ox),t}function N_(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ym(t);if(t.$$typeof===ca)return Ln(t)}throw Error(F(438,String(t)))}function Ax(t){var e=null,n=Ft.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var r=Ft.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=R_(),Ft.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]=gY;return e.index++,n}function ya(t,e){return typeof e=="function"?e(t):e}function Pb(t){var e=Je();return Ix(e,pe,t)}function Ix(t,e,n){var r=t.queue;if(r===null)throw Error(F(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?(Wt&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===Ed&&(d=!0);else if((ha&p)===p){c=c.next,p===Ed&&(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,Ft.lanes|=p,ks|=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,Ft.lanes|=u,ks|=u;c=c.next}while(c!==null&&c!==e);if(l===null?a=i:l.next=s,!Yr(i,t.memoizedState)&&(un=!0,d&&(n=gd,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 FT(t){var e=Je(),n=e.queue;if(n===null)throw Error(F(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);Yr(i,e.memoizedState)||(un=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function p5(t,e,n){var r=Ft,o=Je(),i=Kt;if(i){if(n===void 0)throw Error(F(407));n=n()}else n=e();var a=!Yr((pe||o).memoizedState,n);if(a&&(o.memoizedState=n,un=!0),o=o.queue,kx(h5.bind(null,r,o,t),[t]),o.getSnapshot!==e||a||sn!==null&&sn.memoizedState.tag&1){if(r.flags|=2048,wd(9,{destroy:void 0},g5.bind(null,r,o,n,e),null),ve===null)throw Error(F(349));i||(ha&127)!==0||m5(r,e,n)}return n}function m5(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Ft.updateQueue,e===null?(e=R_(),Ft.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function g5(t,e,n,r){e.value=n,e.getSnapshot=r,y5(e)&&b5(t)}function h5(t,e,n){return n(function(){y5(e)&&b5(t)})}function y5(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Yr(t,n)}catch{return!0}}function b5(t){var e=Yl(t,2);e!==null&&Tr(e,t,2)}function Nw(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:ya,lastRenderedState:t},e}function _5(t,e,n,r){return t.baseState=n,Ix(t,pe,typeof r=="function"?r:ya)}function CW(t,e,n,r,o){if(M_(t))throw Error(F(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)}};kt.T!==null?n(!0):i.isTransition=!1,r(i),n=e.pending,n===null?(i.next=e.pending=i,v5(e,i)):(i.next=n.next,e.pending=n.next=i)}}function v5(t,e){var n=e.action,r=e.payload,o=t.state;if(e.isTransition){var i=kt.T,a={};kt.T=a;try{var s=n(o,r),l=kt.S;l!==null&&l(a,s),_D(t,e,s)}catch(c){Cw(t,e,c)}finally{i!==null&&a.types!==null&&(i.types=a.types),kt.T=i}}else try{i=n(o,r),_D(t,e,i)}catch(c){Cw(t,e,c)}}function _D(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){vD(t,e,r)},function(r){return Cw(t,e,r)}):vD(t,e,n)}function vD(t,e,n){e.status="fulfilled",e.value=n,S5(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,v5(t,n)))}function Cw(t,e,n){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=n,S5(e),e=e.next;while(e!==r)}t.action=null}function S5(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function E5(t,e){return e}function SD(t,e){if(Kt){var n=ve.formState;if(n!==null){t:{var r=Ft;if(Kt){if(ke){e:{for(var o=ke,i=Eo;o.nodeType!==8;){if(!i){o=null;break e}if(o=wo(o.nextSibling),o===null){o=null;break e}}i=o.data,o=i==="F!"||i==="F"?o:null}if(o){ke=wo(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:E5,lastRenderedState:e},n.queue=r,n=P5.bind(null,Ft,r),r.dispatch=n,r=Nw(!1),i=Mx.bind(null,Ft,!1,r.queue),r=rr(),o={state:e,dispatch:null,action:t,pending:null},r.queue=o,n=CW.bind(null,Ft,o,i,n),o.dispatch=n,r.memoizedState=t,[e,n,!1]}function ED(t){var e=Je();return T5(e,pe,t)}function T5(t,e,n){if(e=Ix(t,e,E5)[0],t=Pb(ya)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=ym(e)}catch(a){throw a===Od?k_:a}else r=e;e=Je();var o=e.queue,i=o.dispatch;return n!==e.memoizedState&&(Ft.flags|=2048,wd(9,{destroy:void 0},MW.bind(null,o,n),null)),[r,i,t]}function MW(t,e){t.action=e}function TD(t){var e=Je(),n=pe;if(n!==null)return T5(e,n,t);Je(),e=e.memoizedState,n=Je();var r=n.queue.dispatch;return n.memoizedState=t,[e,r,!1]}function wd(t,e,n,r){return t={tag:t,create:n,deps:r,inst:e,next:null},e=Ft.updateQueue,e===null&&(e=R_(),Ft.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 w5(){return Je().memoizedState}function zb(t,e,n,r){var o=rr();Ft.flags|=t,o.memoizedState=wd(1|e,{destroy:void 0},n,r===void 0?null:r)}function C_(t,e,n,r){var o=Je();r=r===void 0?null:r;var i=o.memoizedState.inst;pe!==null&&r!==null&&Sx(r,pe.memoizedState.deps)?o.memoizedState=wd(e,i,n,r):(Ft.flags|=t,o.memoizedState=wd(1|e,i,n,r))}function wD(t,e){zb(8390656,8,t,e)}function kx(t,e){C_(2048,8,t,e)}function OW(t){Ft.flags|=4;var e=Ft.updateQueue;if(e===null)e=R_(),Ft.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function x5(t){var e=Je().memoizedState;return OW({ref:e,nextImpl:t}),function(){if((ae&2)!==0)throw Error(F(440));return e.impl.apply(void 0,arguments)}}function A5(t,e){return C_(4,2,t,e)}function I5(t,e){return C_(4,4,t,e)}function k5(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 R5(t,e,n){n=n!=null?n.concat([t]):null,C_(4,4,k5.bind(null,e,t),n)}function Rx(){}function N5(t,e){var n=Je();e=e===void 0?null:e;var r=n.memoizedState;return e!==null&&Sx(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function C5(t,e){var n=Je();e=e===void 0?null:e;var r=n.memoizedState;if(e!==null&&Sx(e,r[1]))return r[0];if(r=t(),Gl){ds(!0);try{t()}finally{ds(!1)}}return n.memoizedState=[r,e],r}function Nx(t,e,n){return n===void 0||(ha&1073741824)!==0&&(Wt&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=_3(),Ft.lanes|=t,ks|=t,n)}function M5(t,e,n,r){return Yr(n,e)?n:Td.current!==null?(t=Nx(t,n,r),Yr(t,e)||(un=!0),t):(ha&42)===0||(ha&1073741824)!==0&&(Wt&261930)===0?(un=!0,t.memoizedState=n):(t=_3(),Ft.lanes|=t,ks|=t,e)}function O5(t,e,n,r,o){var i=se.p;se.p=i!==0&&8>i?i:8;var a=kt.T,s={};kt.T=s,Mx(t,!1,e,n);try{var l=o(),c=kt.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var d=kW(l,r);jp(t,e,d,Vr(t))}else jp(t,e,r,Vr(t))}catch(u){jp(t,e,{then:function(){},status:"rejected",reason:u},Vr())}finally{se.p=i,a!==null&&s.types!==null&&(a.types=s.types),kt.T=a}}function DW(){}function Mw(t,e,n,r){if(t.tag!==5)throw Error(F(476));var o=D5(t).queue;O5(t,o,e,Dl,n===null?DW:function(){return L5(t),n(r)})}function D5(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:ya,lastRenderedState:Dl},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function L5(t){var e=D5(t);e.next===null&&(e=t.alternate.memoizedState),jp(t,e.next.queue,{},Vr())}function Cx(){return Ln(sm)}function U5(){return Je().memoizedState}function B5(){return Je().memoizedState}function LW(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=Vr();t=bs(n);var r=_s(e,t,n);r!==null&&(Tr(r,e,n),Hp(r,e,n)),e={cache:hx()},t.payload=e;return}e=e.return}}function UW(t,e,n){var r=Vr();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},M_(t)?z5(e,n):(n=fx(t,e,n,r),n!==null&&(Tr(n,t,r),F5(n,e,r)))}function P5(t,e,n){var r=Vr();jp(t,e,n,r)}function jp(t,e,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(M_(t))z5(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,Yr(s,a))return I_(t,e,o,0),ve===null&&A_(),!1}catch{}finally{}if(n=fx(t,e,o,r),n!==null)return Tr(n,t,r),F5(n,e,r),!0}return!1}function Mx(t,e,n,r){if(r={lane:2,revertLane:Hx(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},M_(t)){if(e)throw Error(F(479))}else e=fx(t,n,r,2),e!==null&&Tr(e,t,2)}function M_(t){var e=t.alternate;return t===Ft||e!==null&&e===Ft}function z5(t,e){yd=i_=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function F5(t,e,n){if((n&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,xL(t,n)}}var om={readContext:Ln,use:N_,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};om.useEffectEvent=Ve;var H5={readContext:Ln,use:N_,useCallback:function(t,e){return rr().memoizedState=[t,e===void 0?null:e],t},useContext:Ln,useEffect:wD,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,zb(4194308,4,k5.bind(null,e,t),n)},useLayoutEffect:function(t,e){return zb(4194308,4,t,e)},useInsertionEffect:function(t,e){zb(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=UW.bind(null,Ft,t),[r.memoizedState,t]},useRef:function(t){var e=rr();return t={current:t},e.memoizedState=t},useState:function(t){t=Nw(t);var e=t.queue,n=P5.bind(null,Ft,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Rx,useDeferredValue:function(t,e){var n=rr();return Nx(n,t,e)},useTransition:function(){var t=Nw(!1);return t=O5.bind(null,Ft,t.queue,!0,!1),rr().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var r=Ft,o=rr();if(Kt){if(n===void 0)throw Error(F(407));n=n()}else{if(n=e(),ve===null)throw Error(F(349));(Wt&127)!==0||m5(r,e,n)}o.memoizedState=n;var i={value:n,getSnapshot:e};return o.queue=i,wD(h5.bind(null,r,i,t),[t]),r.flags|=2048,wd(9,{destroy:void 0},g5.bind(null,r,i,n,e),null),n},useId:function(){var t=rr(),e=ve.identifierPrefix;if(Kt){var n=xi,r=wi;n=(r&~(1<<32-qr(r)-1)).toString(32)+n,e="_"+e+"R_"+n,n=a_++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=RW++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Cx,useFormState:SD,useActionState:SD,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=Mx.bind(null,Ft,!0,n),n.dispatch=e,[t,e]},useMemoCache:Ax,useCacheRefresh:function(){return rr().memoizedState=LW.bind(null,Ft)},useEffectEvent:function(t){var e=rr(),n={impl:t};return e.memoizedState=n,function(){if((ae&2)!==0)throw Error(F(440));return n.impl.apply(void 0,arguments)}}},Ox={readContext:Ln,use:N_,useCallback:N5,useContext:Ln,useEffect:kx,useImperativeHandle:R5,useInsertionEffect:A5,useLayoutEffect:I5,useMemo:C5,useReducer:Pb,useRef:w5,useState:function(){return Pb(ya)},useDebugValue:Rx,useDeferredValue:function(t,e){var n=Je();return M5(n,pe.memoizedState,t,e)},useTransition:function(){var t=Pb(ya)[0],e=Je().memoizedState;return[typeof t=="boolean"?t:ym(t),e]},useSyncExternalStore:p5,useId:U5,useHostTransitionStatus:Cx,useFormState:ED,useActionState:ED,useOptimistic:function(t,e){var n=Je();return _5(n,pe,t,e)},useMemoCache:Ax,useCacheRefresh:B5};Ox.useEffectEvent=x5;var G5={readContext:Ln,use:N_,useCallback:N5,useContext:Ln,useEffect:kx,useImperativeHandle:R5,useInsertionEffect:A5,useLayoutEffect:I5,useMemo:C5,useReducer:FT,useRef:w5,useState:function(){return FT(ya)},useDebugValue:Rx,useDeferredValue:function(t,e){var n=Je();return pe===null?Nx(n,t,e):M5(n,pe.memoizedState,t,e)},useTransition:function(){var t=FT(ya)[0],e=Je().memoizedState;return[typeof t=="boolean"?t:ym(t),e]},useSyncExternalStore:p5,useId:U5,useHostTransitionStatus:Cx,useFormState:TD,useActionState:TD,useOptimistic:function(t,e){var n=Je();return pe!==null?_5(n,pe,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:Ax,useCacheRefresh:B5};G5.useEffectEvent=x5;function HT(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Re({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Ow={enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Vr(),o=bs(r);o.payload=e,n!=null&&(o.callback=n),e=_s(t,o,r),e!==null&&(Tr(e,t,r),Hp(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Vr(),o=bs(r);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=_s(t,o,r),e!==null&&(Tr(e,t,r),Hp(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Vr(),r=bs(n);r.tag=2,e!=null&&(r.callback=e),e=_s(t,r,n),e!==null&&(Tr(e,t,n),Hp(e,t,n))}};function xD(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?!Zp(n,r)||!Zp(o,i):!0}function AD(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&&Ow.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=Re({},n));for(var o in t)n[o]===void 0&&(n[o]=t[o])}return n}function $5(t){Qb(t)}function j5(t){console.error(t)}function q5(t){Qb(t)}function s_(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function ID(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 Dw(t,e,n){return n=bs(n),n.tag=3,n.payload={element:null},n.callback=function(){s_(t,e)},n}function V5(t){return t=bs(t),t.tag=3,t}function Y5(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(){ID(e,n,r)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){ID(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 BW(t,e,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=n.alternate,e!==null&&Md(e,n,o,!0),n=Wr.current,n!==null){switch(n.tag){case 31:case 13:return To===null?f_():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===n_?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([r]):e.add(r),QT(t,r,o)),!1;case 22:return n.flags|=65536,r===n_?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)),QT(t,r,o)),!1}throw Error(F(435,n.tag))}return QT(t,r,o),f_(),!1}if(Kt)return e=Wr.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=o,r!==Sw&&(t=Error(F(422),{cause:r}),em(So(t,n)))):(r!==Sw&&(e=Error(F(423),{cause:r}),em(So(e,n))),t=t.current.alternate,t.flags|=65536,o&=-o,t.lanes|=o,r=So(r,n),o=Dw(t.stateNode,r,o),zT(t,o),Ye!==4&&(Ye=2)),!1;var i=Error(F(520),{cause:r});if(i=So(i,n),Yp===null?Yp=[i]:Yp.push(i),Ye!==4&&(Ye=2),e===null)return!0;r=So(r,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=o&-o,n.lanes|=t,t=Dw(n.stateNode,r,t),zT(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=V5(o),Y5(o,t,n,r),zT(n,o),!1}n=n.return}while(n!==null);return!1}var Dx=Error(F(461)),un=!1;function Mn(t,e,n,r){e.child=t===null?s5(e,null,n,r):Hl(e,t.child,n,r)}function kD(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=Ex(t,e,n,a,i,o),s=Tx(),t!==null&&!un?(wx(t,e,o),ba(t,e,o)):(Kt&&s&&mx(e),e.flags|=1,Mn(t,e,r,o),e.child)}function RD(t,e,n,r,o){if(t===null){var i=n.type;return typeof i=="function"&&!px(i)&&i.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=i,W5(t,e,i,r,o)):(t=Ub(n.type,null,r,e,e.mode,o),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!Lx(t,o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Zp,n(a,r)&&t.ref===e.ref)return ba(t,e,o)}return e.flags|=1,t=fa(i,r),t.ref=e.ref,t.return=e,e.child=t}function W5(t,e,n,r,o){if(t!==null){var i=t.memoizedProps;if(Zp(i,r)&&t.ref===e.ref)if(un=!1,e.pendingProps=r=i,Lx(t,o))(t.flags&131072)!==0&&(un=!0);else return e.lanes=t.lanes,ba(t,e,o)}return Lw(t,e,n,r,o)}function K5(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 ND(t,e,i,n,r)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Bb(e,i!==null?i.cachePool:null),i!==null?bD(e,i):kw(),u5(e);else return r=e.lanes=536870912,ND(t,e,i!==null?i.baseLanes|n:n,n,r)}else i!==null?(Bb(e,i.cachePool),bD(e,i),cs(e),e.memoizedState=null):(t!==null&&Bb(e,null),kw(),cs(e));return Mn(t,e,o,n),e.child}function Lp(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function ND(t,e,n,r,o){var i=yx();return i=i===null?null:{parent:cn._currentValue,pool:i},e.memoizedState={baseLanes:n,cachePool:i},t!==null&&Bb(e,null),kw(),u5(e),t!==null&&Md(t,e,r,!0),e.childLanes=o,null}function Fb(t,e){return e=l_({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function CD(t,e,n){return Hl(e,t.child,null,n),t=Fb(e,e.pendingProps),t.flags|=2,Fr(e),e.memoizedState=null,t}function PW(t,e,n){var r=e.pendingProps,o=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(Kt){if(r.mode==="hidden")return t=Fb(e,r),e.lanes=536870912,Lp(null,t);if(Rw(e),(t=ke)?(t=H3(t,Eo),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=t5(t),n.return=e,e.child=n,Dn=e,ke=null)):t=null,t===null)throw As(e);return e.lanes=536870912,null}return Fb(e,r)}var i=t.memoizedState;if(i!==null){var a=i.dehydrated;if(Rw(e),o)if(e.flags&256)e.flags&=-257,e=CD(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(F(558));else if(un||Md(t,e,n,!1),o=(n&t.childLanes)!==0,un||o){if(r=ve,r!==null&&(a=AL(r,n),a!==0&&a!==i.retryLane))throw i.retryLane=a,Yl(t,a),Tr(r,t,a),Dx;f_(),e=CD(t,e,n)}else t=i.treeContext,ke=wo(a.nextSibling),Dn=e,Kt=!0,ys=null,Eo=!1,t!==null&&n5(e,t),e=Fb(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 Hb(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(F(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Lw(t,e,n,r,o){return Fl(e),n=Ex(t,e,n,r,void 0,o),r=Tx(),t!==null&&!un?(wx(t,e,o),ba(t,e,o)):(Kt&&r&&mx(e),e.flags|=1,Mn(t,e,n,o),e.child)}function MD(t,e,n,r,o,i){return Fl(e),e.updateQueue=null,n=f5(e,r,n,o),d5(t),r=Tx(),t!==null&&!un?(wx(t,e,i),ba(t,e,i)):(Kt&&r&&mx(e),e.flags|=1,Mn(t,e,n,i),e.child)}function OD(t,e,n,r,o){if(Fl(e),e.stateNode===null){var i=ld,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=Ow,e.stateNode=i,i._reactInternals=e,i=e.stateNode,i.props=r,i.state=e.memoizedState,i.refs={},_x(e),a=n.contextType,i.context=typeof a=="object"&&a!==null?Ln(a):ld,i.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(HT(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&&Ow.enqueueReplaceState(i,i.state,null),$p(e,r,i,o),Gp(),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=ld,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)&&AD(e,i,r,a),as=!1;var p=e.memoizedState;i.state=p,$p(e,r,i,o),Gp(),c=e.memoizedState,s||p!==c||as?(typeof u=="function"&&(HT(e,n,u,r),c=e.memoizedState),(l=as||xD(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,Aw(t,e),a=e.memoizedProps,d=$l(n,a),i.props=d,u=e.pendingProps,p=i.context,c=n.contextType,l=ld,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)&&AD(e,i,r,l),as=!1,p=e.memoizedState,i.state=p,$p(e,r,i,o),Gp();var f=e.memoizedState;a!==u||p!==f||as||t!==null&&t.dependencies!==null&&e_(t.dependencies)?(typeof s=="function"&&(HT(e,n,s,r),f=e.memoizedState),(d=as||xD(e,n,d,r,p,f,l)||t!==null&&t.dependencies!==null&&e_(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,Hb(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=ba(t,e,o),t}function DD(t,e,n,r){return zl(),e.flags|=256,Mn(t,e,n,r),e.child}var GT={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $T(t){return{baseLanes:t,cachePool:o5()}}function jT(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Gr),t}function X5(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:(Xe.current&2)!==0),a&&(o=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(Kt){if(o?ls(e):cs(e),(t=ke)?(t=H3(t,Eo),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=t5(t),n.return=e,e.child=n,Dn=e,ke=null)):t=null,t===null)throw As(e);return Kw(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,o?(cs(e),o=e.mode,s=l_({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=$T(n),r.childLanes=jT(t,a,n),e.memoizedState=GT,Lp(null,r)):(ls(e),Uw(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=qT(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=l_({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=$T(n),r.childLanes=jT(t,a,n),e.memoizedState=GT,e=Lp(null,r));else if(ls(e),Kw(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,r=Error(F(419)),r.stack="",r.digest=a,em({value:r,source:null,stack:null}),e=qT(t,e,n)}else if(un||Md(t,e,n,!1),a=(n&t.childLanes)!==0,un||a){if(a=ve,a!==null&&(r=AL(a,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Yl(t,r),Tr(a,t,r),Dx;Ww(s)||f_(),e=qT(t,e,n)}else Ww(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,ke=wo(s.nextSibling),Dn=e,Kt=!0,ys=null,Eo=!1,t!==null&&n5(e,t),e=Uw(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,Lp(null,r),r=e.child,s=t.child.memoizedState,s===null?s=$T(n):(o=s.cachePool,o!==null?(l=cn._currentValue,o=o.parent!==l?{parent:l,pool:l}:o):o=o5(),s={baseLanes:s.baseLanes|n,cachePool:o}),r.memoizedState=s,r.childLanes=jT(t,a,n),e.memoizedState=GT,Lp(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 Uw(t,e){return e=l_({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function l_(t,e){return t=Hr(22,t,null,e),t.lanes=0,t}function qT(t,e,n){return Hl(e,t.child,null,n),t=Uw(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function LD(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Tw(t.return,e,n)}function VT(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 J5(t,e,n){var r=e.pendingProps,o=r.revealOrder,i=r.tail;r=r.children;var a=Xe.current,s=(a&2)!==0;if(s?(a=a&1|2,e.flags|=128):a&=1,we(Xe,a),Mn(t,e,r,n),r=Kt?tm:0,!s&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&LD(t,n,e);else if(t.tag===19)LD(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&&o_(t)===null&&(o=n),n=n.sibling;n=o,n===null?(o=e.child,e.child=null):(o=n.sibling,n.sibling=null),VT(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&&o_(t)===null){e.child=o;break}t=o.sibling,o.sibling=n,n=o,o=t}VT(e,!0,n,null,i,r);break;case"together":VT(e,!1,null,null,void 0,r);break;default:e.memoizedState=null}return e.child}function ba(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ks|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Md(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(F(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 Lx(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&e_(t)))}function zW(t,e,n){switch(e.tag){case 3:Wb(e,e.stateNode.containerInfo),ss(e,cn,t.memoizedState.cache),zl();break;case 27:case 5:uw(e);break;case 4:Wb(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,Rw(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?X5(t,e,n):(ls(e),t=ba(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||(Md(t,e,n,!1),r=(n&e.childLanes)!==0),o){if(r)return J5(t,e,n);e.flags|=128}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),we(Xe,Xe.current),r)break;return null;case 22:return e.lanes=0,K5(t,e,n,e.pendingProps);case 24:ss(e,cn,t.memoizedState.cache)}return ba(t,e,n)}function Q5(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)un=!0;else{if(!Lx(t,n)&&(e.flags&128)===0)return un=!1,zW(t,e,n);un=(t.flags&131072)!==0}else un=!1,Kt&&(e.flags&1048576)!==0&&e5(e,tm,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")px(t)?(r=$l(t,r),e.tag=1,e=OD(null,e,t,r,n)):(e.tag=0,e=Lw(null,e,t,r,n));else{if(t!=null){var o=t.$$typeof;if(o===Zw){e.tag=11,e=kD(null,e,t,r,n);break t}else if(o===tx){e.tag=14,e=RD(null,e,t,r,n);break t}}throw e=lw(t)||t,Error(F(306,e,""))}}return e;case 0:return Lw(t,e,e.type,e.pendingProps,n);case 1:return r=e.type,o=$l(r,e.pendingProps),OD(t,e,r,o,n);case 3:t:{if(Wb(e,e.stateNode.containerInfo),t===null)throw Error(F(387));r=e.pendingProps;var i=e.memoizedState;o=i.element,Aw(t,e),$p(e,r,null,n);var a=e.memoizedState;if(r=a.cache,ss(e,cn,r),r!==i.cache&&ww(e,[cn],n,!0),Gp(),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=DD(t,e,r,n);break t}else if(r!==o){o=So(Error(F(424)),e),em(o),e=DD(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(ke=wo(t.firstChild),Dn=e,Kt=!0,ys=null,Eo=!0,n=s5(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zl(),r===o){e=ba(t,e,n);break t}Mn(t,e,r,n)}e=e.child}return e;case 26:return Hb(t,e),t===null?(n=rL(e.type,null,e.pendingProps,null))?e.memoizedState=n:Kt||(n=e.type,t=e.pendingProps,r=h_(hs.current).createElement(n),r[On]=e,r[wr]=t,Un(r,n,t),In(r),e.stateNode=r):e.memoizedState=rL(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return uw(e),t===null&&Kt&&(r=e.stateNode=G3(e.type,e.pendingProps,hs.current),Dn=e,Eo=!0,o=ke,Ns(e.type)?(Xw=o,ke=wo(r.firstChild)):ke=o),Mn(t,e,e.pendingProps.children,n),Hb(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Kt&&((o=r=ke)&&(r=pK(r,e.type,e.pendingProps,Eo),r!==null?(e.stateNode=r,Dn=e,ke=wo(r.firstChild),Eo=!1,o=!0):o=!1),o||As(e)),uw(e),o=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,r=i.children,Vw(o,i)?r=null:a!==null&&Vw(o,a)&&(e.flags|=32),e.memoizedState!==null&&(o=Ex(t,e,NW,null,null,n),sm._currentValue=o),Hb(t,e),Mn(t,e,r,n),e.child;case 6:return t===null&&Kt&&((t=n=ke)&&(n=mK(n,e.pendingProps,Eo),n!==null?(e.stateNode=n,Dn=e,ke=null,t=!0):t=!1),t||As(e)),null;case 13:return X5(t,e,n);case 4:return Wb(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 kD(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 RD(t,e,e.type,e.pendingProps,n);case 15:return W5(t,e,e.type,e.pendingProps,n);case 19:return J5(t,e,n);case 31:return PW(t,e,n);case 22:return K5(t,e,n,e.pendingProps);case 24:return Fl(e),r=Ln(cn),t===null?(o=yx(),o===null&&(o=ve,i=hx(),o.pooledCache=i,i.refCount++,i!==null&&(o.pooledCacheLanes|=n),o=i),e.memoizedState={parent:r,cache:o},_x(e),ss(e,cn,o)):((t.lanes&n)!==0&&(Aw(t,e),$p(e,null,null,n),Gp()),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,cn,r)):(r=i.cache,ss(e,cn,r),r!==o.cache&&ww(e,[cn],n,!0))),Mn(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(F(156,e.tag))}function ra(t){t.flags|=4}function YT(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(E3())t.flags|=8192;else throw Bl=n_,bx}else t.flags&=-16777217}function UD(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!q3(e))if(E3())t.flags|=8192;else throw Bl=n_,bx}function xb(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?TL():536870912,t.lanes|=e,xd|=e)}function kp(t,e){if(!Kt)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 FW(t,e,n){var r=e.pendingProps;switch(gx(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(cn),_d(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Xu(e)?ra(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,PT())),Ie(e),null;case 26:var o=e.type,i=e.memoizedState;return t===null?(ra(e),i!==null?(Ie(e),UD(e,i)):(Ie(e),YT(e,o,null,r,n))):i?i!==t.memoizedState?(ra(e),Ie(e),UD(e,i)):(Ie(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&ra(e),Ie(e),YT(e,o,t,r,n)),null;case 27:if(Kb(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(F(166));return Ie(e),null}t=Ii.current,Xu(e)?dD(e,t):(t=G3(o,r,n),e.stateNode=t,ra(e))}return Ie(e),null;case 5:if(Kb(e),o=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ra(e);else{if(!r){if(e.stateNode===null)throw Error(F(166));return Ie(e),null}if(i=Ii.current,Xu(e))dD(e,i);else{var a=h_(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),YT(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(F(166));if(t=hs.current,Xu(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||P3(t.nodeValue,n)),t||As(e,!0)}else t=h_(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=Xu(e),n!==null){if(t===null){if(!r)throw Error(F(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(F(557));t[On]=e}else zl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ie(e),t=!1}else n=PT(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Fr(e),e):(Fr(e),null);if((e.flags&128)!==0)throw Error(F(558))}return Ie(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(o=Xu(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(F(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(F(317));o[On]=e}else zl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ie(e),o=!1}else o=PT(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),o=!0;if(!o)return e.flags&256?(Fr(e),e):(Fr(e),null)}return Fr(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),xb(e,e.updateQueue),Ie(e),null);case 4:return _d(),t===null&&Gx(e.stateNode.containerInfo),Ie(e),null;case 10:return pa(e.type),Ie(e),null;case 19:if(kn(Xe),r=e.memoizedState,r===null)return Ie(e),null;if(o=(e.flags&128)!==0,i=r.rendering,i===null)if(o)kp(r,!1);else{if(Ye!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(i=o_(t),i!==null){for(e.flags|=128,kp(r,!1),t=i.updateQueue,e.updateQueue=t,xb(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)ZL(n,t),n=n.sibling;return we(Xe,Xe.current&1|2),Kt&&sa(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&$r()>u_&&(e.flags|=128,o=!0,kp(r,!1),e.lanes=4194304)}else{if(!o)if(t=o_(i),t!==null){if(e.flags|=128,o=!0,t=t.updateQueue,e.updateQueue=t,xb(e,t),kp(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Kt)return Ie(e),null}else 2*$r()-r.renderingStartTime>u_&&n!==536870912&&(e.flags|=128,o=!0,kp(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=$r(),t.sibling=null,n=Xe.current,we(Xe,o?n&1|2:n&1),Kt&&sa(e,r.treeForkCount),t):(Ie(e),null);case 22:case 23:return Fr(e),vx(),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&&xb(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&&kn(Ul),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),pa(cn),Ie(e),null;case 25:return null;case 30:return null}throw Error(F(156,e.tag))}function HW(t,e){switch(gx(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return pa(cn),_d(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Kb(e),null;case 31:if(e.memoizedState!==null){if(Fr(e),e.alternate===null)throw Error(F(340));zl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Fr(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(F(340));zl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return kn(Xe),null;case 4:return _d(),null;case 10:return pa(e.type),null;case 22:case 23:return Fr(e),vx(),t!==null&&kn(Ul),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return pa(cn),null;case 25:return null;default:return null}}function Z5(t,e){switch(gx(e),e.tag){case 3:pa(cn),_d();break;case 26:case 27:case 5:Kb(e);break;case 4:_d();break;case 31:e.memoizedState!==null&&Fr(e);break;case 13:Fr(e);break;case 19:kn(Xe);break;case 10:pa(e.type);break;case 22:case 23:Fr(e),vx(),t!==null&&kn(Ul);break;case 24:pa(cn)}}function bm(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){ue(e,e.return,s)}}function Is(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){ue(o,l,d)}}}r=r.next}while(r!==i)}}catch(d){ue(e,e.return,d)}}function t3(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{c5(e,n)}catch(r){ue(t,t.return,r)}}}function e3(t,e,n){n.props=$l(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(r){ue(t,e,r)}}function qp(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){ue(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){ue(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){ue(t,e,o)}else n.current=null}function n3(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){ue(t,t.return,o)}}function WT(t,e,n){try{var r=t.stateNode;sK(r,t.type,n,e),r[wr]=e}catch(o){ue(t,t.return,o)}}function r3(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ns(t.type)||t.tag===4}function KT(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||r3(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 Bw(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(Bw(t,e,n),t=t.sibling;t!==null;)Bw(t,e,n),t=t.sibling}function c_(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(c_(t,e,n),t=t.sibling;t!==null;)c_(t,e,n),t=t.sibling}function o3(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){ue(t,t.return,i)}}var la=!1,ln=!1,XT=!1,BD=typeof WeakSet=="function"?WeakSet:Set,An=null;function GW(t,e){if(t=t.containerInfo,jw=v_,t=qL(t),ux(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(qw={focusedElem:t,selectionRange:n},v_=!1,An=e;An!==null;)if(e=An,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,An=t;else for(;An!==null;){switch(e=An,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(_){ue(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Yw(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Yw(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(F(163))}if(t=e.sibling,t!==null){t.return=e.return,An=t;break}An=e.return}}function i3(t,e,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ia(t,n),r&4&&bm(5,n);break;case 1:if(ia(t,n),r&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){ue(n,n.return,a)}else{var o=$l(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(o,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){ue(n,n.return,a)}}r&64&&t3(n),r&512&&qp(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{c5(t,e)}catch(a){ue(n,n.return,a)}}break;case 27:e===null&&r&4&&o3(n);case 26:case 5:ia(t,n),e===null&&r&4&&n3(n),r&512&&qp(n,n.return);break;case 12:ia(t,n);break;case 31:ia(t,n),r&4&&l3(t,n);break;case 13:ia(t,n),r&4&&c3(t,n),r&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=JW.bind(null,n),gK(t,n))));break;case 22:if(r=n.memoizedState!==null||la,!r){e=e!==null&&e.memoizedState!==null||ln,o=la;var i=ln;la=r,(ln=e)&&!i?aa(t,n,(n.subtreeFlags&8772)!==0):ia(t,n),la=o,ln=i}break;case 30:break;default:ia(t,n)}}function a3(t){var e=t.alternate;e!==null&&(t.alternate=null,a3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&ox(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 Be=null,Sr=!1;function oa(t,e,n){for(n=n.child;n!==null;)s3(t,e,n),n=n.sibling}function s3(t,e,n){if(jr&&typeof jr.onCommitFiberUnmount=="function")try{jr.onCommitFiberUnmount(dm,n)}catch{}switch(n.tag){case 26:ln||Ai(n,e),oa(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ln||Ai(n,e);var r=Be,o=Sr;Ns(n.type)&&(Be=n.stateNode,Sr=!1),oa(t,e,n),Kp(n.stateNode),Be=r,Sr=o;break;case 5:ln||Ai(n,e);case 6:if(r=Be,o=Sr,Be=null,oa(t,e,n),Be=r,Sr=o,Be!==null)if(Sr)try{(Be.nodeType===9?Be.body:Be.nodeName==="HTML"?Be.ownerDocument.body:Be).removeChild(n.stateNode)}catch(i){ue(n,e,i)}else try{Be.removeChild(n.stateNode)}catch(i){ue(n,e,i)}break;case 18:Be!==null&&(Sr?(t=Be,QD(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Rd(t)):QD(Be,n.stateNode));break;case 4:r=Be,o=Sr,Be=n.stateNode.containerInfo,Sr=!0,oa(t,e,n),Be=r,Sr=o;break;case 0:case 11:case 14:case 15:Is(2,n,e),ln||Is(4,n,e),oa(t,e,n);break;case 1:ln||(Ai(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"&&e3(n,e,r)),oa(t,e,n);break;case 21:oa(t,e,n);break;case 22:ln=(r=ln)||n.memoizedState!==null,oa(t,e,n),ln=r;break;default:oa(t,e,n)}}function l3(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Rd(t)}catch(n){ue(e,e.return,n)}}}function c3(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Rd(t)}catch(n){ue(e,e.return,n)}}function $W(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new BD),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new BD),e;default:throw Error(F(435,t.tag))}}function Ab(t,e){var n=$W(t);e.forEach(function(r){if(!n.has(r)){n.add(r);var o=QW.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)){Be=s.stateNode,Sr=!1;break t}break;case 5:Be=s.stateNode,Sr=!1;break t;case 3:case 4:Be=s.stateNode.containerInfo,Sr=!0;break t}s=s.return}if(Be===null)throw Error(F(160));s3(i,a,o),Be=null,Sr=!1,i=o.alternate,i!==null&&(i.return=null),o.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)u3(e,t),e=e.sibling}var Xo=null;function u3(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&&(Is(3,t,t.return),bm(3,t),Is(5,t,t.return));break;case 1:_r(e,t),vr(t),r&512&&(ln||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&&(ln||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[mm]||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=iL("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=iL("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(F(468,r))}i[On]=t,In(i),r=i}t.stateNode=r}else aL(o,t.type,t.stateNode);else t.stateNode=oL(o,r,t.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?aL(o,t.type,t.stateNode):oL(o,r,t.memoizedProps)):r===null&&t.stateNode!==null&&WT(t,t.memoizedProps,n.memoizedProps)}break;case 27:_r(e,t),vr(t),r&512&&(ln||n===null||Ai(n,n.return)),n!==null&&r&4&&WT(t,t.memoizedProps,n.memoizedProps);break;case 5:if(_r(e,t),vr(t),r&512&&(ln||n===null||Ai(n,n.return)),t.flags&32){o=t.stateNode;try{Sd(o,"")}catch(m){ue(t,t.return,m)}}r&4&&t.stateNode!=null&&(o=t.memoizedProps,WT(t,o,n!==null?n.memoizedProps:o)),r&1024&&(XT=!0);break;case 6:if(_r(e,t),vr(t),r&4){if(t.stateNode===null)throw Error(F(162));r=t.memoizedProps,n=t.stateNode;try{n.nodeValue=r}catch(m){ue(t,t.return,m)}}break;case 3:if(jb=null,o=Xo,Xo=y_(e.containerInfo),_r(e,t),Xo=o,vr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rd(e.containerInfo)}catch(m){ue(t,t.return,m)}XT&&(XT=!1,d3(t));break;case 4:r=Xo,Xo=y_(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,Ab(t,r)));break;case 13:_r(e,t),vr(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(O_=$r()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ab(t,r)));break;case 22:o=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=la,d=ln;if(la=c||o,ln=d||l,_r(e,t),ln=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||ln||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){ue(l,l.return,m)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=o?"":l.memoizedProps}catch(m){ue(l,l.return,m)}}}else if(e.tag===18){if(n===null){l=e;try{var f=l.stateNode;o?ZD(f,!0):ZD(l.stateNode,!1)}catch(m){ue(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,Ab(t,n))));break;case 19:_r(e,t),vr(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Ab(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(r3(r)){n=r;break}r=r.return}if(n==null)throw Error(F(160));switch(n.tag){case 27:var o=n.stateNode,i=KT(t);c_(t,i,o);break;case 5:var a=n.stateNode;n.flags&32&&(Sd(a,""),n.flags&=-33);var s=KT(t);c_(t,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=KT(t);Bw(t,c,l);break;default:throw Error(F(161))}}catch(d){ue(t,t.return,d)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function d3(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;d3(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;)i3(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:Is(4,e,e.return),Ol(e);break;case 1:Ai(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&e3(e,e.return,n),Ol(e);break;case 27:Kp(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),bm(4,i);break;case 1:if(aa(o,i,n),r=i,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(c){ue(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++)l5(l[o],s)}catch(c){ue(r,r.return,c)}}n&&a&64&&t3(i),qp(i,i.return);break;case 27:o3(i);case 26:case 5:aa(o,i,n),n&&r===null&&a&4&&n3(i),qp(i,i.return);break;case 12:aa(o,i,n);break;case 31:aa(o,i,n),n&&a&4&&l3(o,i);break;case 13:aa(o,i,n),n&&a&4&&c3(o,i);break;case 22:i.memoizedState===null&&aa(o,i,n),qp(i,i.return);break;case 30:break;default:aa(o,i,n)}e=e.sibling}}function Ux(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&&hm(n))}function Bx(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&hm(t))}function Ko(t,e,n,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)f3(t,e,n,r),e=e.sibling}function f3(t,e,n,r){var o=e.flags;switch(e.tag){case 0:case 11:case 15:Ko(t,e,n,r),o&2048&&bm(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&&hm(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){ue(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):Vp(t,e):i._visibility&2?Ko(t,e,n,r):(i._visibility|=2,Qu(t,e,n,r,(e.subtreeFlags&10256)!==0||!1)),o&2048&&Ux(a,e);break;case 24:Ko(t,e,n,r),o&2048&&Bx(e.alternate,e);break;default:Ko(t,e,n,r)}}function Qu(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:Qu(i,a,s,l,o),bm(8,a);break;case 23:break;case 22:var d=a.stateNode;a.memoizedState!==null?d._visibility&2?Qu(i,a,s,l,o):Vp(i,a):(d._visibility|=2,Qu(i,a,s,l,o)),o&&c&2048&&Ux(a.alternate,a);break;case 24:Qu(i,a,s,l,o),o&&c&2048&&Bx(a.alternate,a);break;default:Qu(i,a,s,l,o)}e=e.sibling}}function Vp(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:Vp(n,r),o&2048&&Ux(r.alternate,r);break;case 24:Vp(n,r),o&2048&&Bx(r.alternate,r);break;default:Vp(n,r)}e=e.sibling}}var Up=8192;function Ju(t,e,n){if(t.subtreeFlags&Up)for(t=t.child;t!==null;)p3(t,e,n),t=t.sibling}function p3(t,e,n){switch(t.tag){case 26:Ju(t,e,n),t.flags&Up&&t.memoizedState!==null&&IK(n,Xo,t.memoizedState,t.memoizedProps);break;case 5:Ju(t,e,n);break;case 3:case 4:var r=Xo;Xo=y_(t.stateNode.containerInfo),Ju(t,e,n),Xo=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=Up,Up=16777216,Ju(t,e,n),Up=r):Ju(t,e,n));break;default:Ju(t,e,n)}}function m3(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 Rp(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];An=r,h3(r,t)}m3(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)g3(t),t=t.sibling}function g3(t){switch(t.tag){case 0:case 11:case 15:Rp(t),t.flags&2048&&Is(9,t,t.return);break;case 3:Rp(t);break;case 12:Rp(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Gb(t)):Rp(t);break;default:Rp(t)}}function Gb(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];An=r,h3(r,t)}m3(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Is(8,e,e.return),Gb(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Gb(e));break;default:Gb(e)}t=t.sibling}}function h3(t,e){for(;An!==null;){var n=An;switch(n.tag){case 0:case 11:case 15:Is(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:hm(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,An=r;else t:for(n=t;An!==null;){r=An;var o=r.sibling,i=r.return;if(a3(r),r===n){An=null;break t}if(o!==null){o.return=i,An=o;break t}An=i}}}var jW={getCacheForType:function(t){var e=Ln(cn),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return Ln(cn).controller.signal}},qW=typeof WeakMap=="function"?WeakMap:Map,ae=0,ve=null,Vt=null,Wt=0,ce=0,zr=null,ps=!1,Dd=!1,Px=!1,_a=0,Ye=0,ks=0,Pl=0,zx=0,Gr=0,xd=0,Yp=null,Er=null,Pw=!1,O_=0,y3=0,u_=1/0,d_=null,vs=null,gn=0,Ss=null,Ad=null,ma=0,zw=0,Fw=null,b3=null,Wp=0,Hw=null;function Vr(){return(ae&2)!==0&&Wt!==0?Wt&-Wt:kt.T!==null?Hx():IL()}function _3(){if(Gr===0)if((Wt&536870912)===0||Kt){var t=hb;hb<<=1,(hb&3932160)===0&&(hb=262144),Gr=t}else Gr=536870912;return t=Wr.current,t!==null&&(t.flags|=32),Gr}function Tr(t,e,n){(t===ve&&(ce===2||ce===9)||t.cancelPendingCommit!==null)&&(Id(t,0),ms(t,Wt,Gr,!1)),pm(t,n),((ae&2)===0||t!==ve)&&(t===ve&&((ae&2)===0&&(Pl|=n),Ye===4&&ms(t,Wt,Gr,!1)),Ri(t))}function v3(t,e,n){if((ae&6)!==0)throw Error(F(327));var r=!n&&(e&127)===0&&(e&t.expiredLanes)===0||fm(t,e),o=r?WW(t,e):JT(t,e,!0),i=r;do{if(o===0){Dd&&!r&&ms(t,e,0,!1);break}else{if(n=t.current.alternate,i&&!VW(n)){o=JT(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=Yp;var l=s.current.memoizedState.isDehydrated;if(l&&(Id(s,a).flags|=256),a=JT(s,a,!1),a!==2){if(Px&&!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(F(345));case 4:if((e&4194048)!==e)break;case 6:ms(r,e,Gr,!ps);break t;case 2:Er=null;break;case 3:case 5:break;default:throw Error(F(329))}if((e&62914560)===e&&(o=O_+300-$r(),10<o)){if(ms(r,e,Gr,!ps),E_(r,0,!0)!==0)break t;ma=e,r.timeoutHandle=F3(PD.bind(null,r,n,Er,d_,Pw,e,Gr,Pl,xd,ps,i,"Throttled",-0,0),o);break t}PD(r,n,Er,d_,Pw,e,Gr,Pl,xd,ps,i,null,-0,0)}}break}while(!0);Ri(t)}function PD(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},p3(e,i,u);var m=(i&62914560)===i?O_-$r():(i&4194048)===i?y3-$r():0;if(m=kK(u,m),m!==null){ma=i,t.cancelPendingCommit=m(FD.bind(null,t,e,i,n,r,o,a,s,l,d,u,null,p,f)),ms(t,i,a,!c);return}}FD(t,e,i,n,r,o,a,s,l)}function VW(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(!Yr(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&=~zx,e&=~Pl,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var o=e;0<o;){var i=31-qr(o),a=1<<i;r[i]=-1,o&=~a}n!==0&&wL(t,n,e)}function D_(){return(ae&6)===0?(_m(0,!1),!1):!0}function Fx(){if(Vt!==null){if(ce===0)var t=Vt.return;else t=Vt,da=Wl=null,xx(t),hd=null,nm=0,t=Vt;for(;t!==null;)Z5(t.alternate,t),t=t.return;Vt=null}}function Id(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,uK(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),ma=0,Fx(),ve=t,Vt=n=fa(t.current,null),Wt=e,ce=0,zr=null,ps=!1,Dd=fm(t,e),Px=!1,xd=Gr=zx=Pl=ks=Ye=0,Er=Yp=null,Pw=!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-qr(r),i=1<<o;e|=t[o],r&=~i}return _a=e,A_(),n}function S3(t,e){Ft=null,kt.H=om,e===Od||e===k_?(e=hD(),ce=3):e===bx?(e=hD(),ce=4):ce=e===Dx?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,zr=e,Vt===null&&(Ye=1,s_(t,So(e,t.current)))}function E3(){var t=Wr.current;return t===null?!0:(Wt&4194048)===Wt?To===null:(Wt&62914560)===Wt||(Wt&536870912)!==0?t===To:!1}function T3(){var t=kt.H;return kt.H=om,t===null?om:t}function w3(){var t=kt.A;return kt.A=jW,t}function f_(){Ye=4,ps||(Wt&4194048)!==Wt&&Wr.current!==null||(Dd=!0),(ks&134217727)===0&&(Pl&134217727)===0||ve===null||ms(ve,Wt,Gr,!1)}function JT(t,e,n){var r=ae;ae|=2;var o=T3(),i=w3();(ve!==t||Wt!==e)&&(d_=null,Id(t,e)),e=!1;var a=Ye;t:do try{if(ce!==0&&Vt!==null){var s=Vt,l=zr;switch(ce){case 8:Fx(),a=6;break t;case 3:case 2:case 9:case 6:Wr.current===null&&(e=!0);var c=ce;if(ce=0,zr=null,dd(t,s,l,c),n&&Dd){a=0;break t}break;default:c=ce,ce=0,zr=null,dd(t,s,l,c)}}YW(),a=Ye;break}catch(d){S3(t,d)}while(!0);return e&&t.shellSuspendCounter++,da=Wl=null,ae=r,kt.H=o,kt.A=i,Vt===null&&(ve=null,Wt=0,A_()),a}function YW(){for(;Vt!==null;)x3(Vt)}function WW(t,e){var n=ae;ae|=2;var r=T3(),o=w3();ve!==t||Wt!==e?(d_=null,u_=$r()+500,Id(t,e)):Dd=fm(t,e);t:do try{if(ce!==0&&Vt!==null){e=Vt;var i=zr;e:switch(ce){case 1:ce=0,zr=null,dd(t,e,i,1);break;case 2:case 9:if(gD(i)){ce=0,zr=null,zD(e);break}e=function(){ce!==2&&ce!==9||ve!==t||(ce=7),Ri(t)},i.then(e,e);break t;case 3:ce=7;break t;case 4:ce=5;break t;case 7:gD(i)?(ce=0,zr=null,zD(e)):(ce=0,zr=null,dd(t,e,i,7));break;case 5:var a=null;switch(Vt.tag){case 26:a=Vt.memoizedState;case 5:case 27:var s=Vt;if(a?q3(a):s.stateNode.complete){ce=0,zr=null;var l=s.sibling;if(l!==null)Vt=l;else{var c=s.return;c!==null?(Vt=c,L_(c)):Vt=null}break e}}ce=0,zr=null,dd(t,e,i,5);break;case 6:ce=0,zr=null,dd(t,e,i,6);break;case 8:Fx(),Ye=6;break t;default:throw Error(F(462))}}KW();break}catch(d){S3(t,d)}while(!0);return da=Wl=null,kt.H=r,kt.A=o,ae=n,Vt!==null?0:(ve=null,Wt=0,A_(),Ye)}function KW(){for(;Vt!==null&&!bY();)x3(Vt)}function x3(t){var e=Q5(t.alternate,t,_a);t.memoizedProps=t.pendingProps,e===null?L_(t):Vt=e}function zD(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=MD(n,e,e.pendingProps,e.type,void 0,Wt);break;case 11:e=MD(n,e,e.pendingProps,e.type.render,e.ref,Wt);break;case 5:xx(e);default:Z5(n,e),e=Vt=ZL(e,_a),e=Q5(n,e,_a)}t.memoizedProps=t.pendingProps,e===null?L_(t):Vt=e}function dd(t,e,n,r){da=Wl=null,xx(e),hd=null,nm=0;var o=e.return;try{if(BW(t,o,e,n,Wt)){Ye=1,s_(t,So(n,t.current)),Vt=null;return}}catch(i){if(o!==null)throw Vt=o,i;Ye=1,s_(t,So(n,t.current)),Vt=null;return}e.flags&32768?(Kt||r===1?t=!0:Dd||(Wt&536870912)!==0?t=!1:(ps=t=!0,(r===2||r===9||r===3||r===6)&&(r=Wr.current,r!==null&&r.tag===13&&(r.flags|=16384))),A3(e,t)):L_(e)}function L_(t){var e=t;do{if((e.flags&32768)!==0){A3(e,ps);return}t=e.return;var n=FW(e.alternate,e,_a);if(n!==null){Vt=n;return}if(e=e.sibling,e!==null){Vt=e;return}Vt=e=t}while(e!==null);Ye===0&&(Ye=5)}function A3(t,e){do{var n=HW(t.alternate,t);if(n!==null){n.flags&=32767,Vt=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Vt=t;return}Vt=t=n}while(t!==null);Ye=6,Vt=null}function FD(t,e,n,r,o,i,a,s,l){t.cancelPendingCommit=null;do U_();while(gn!==0);if((ae&6)!==0)throw Error(F(327));if(e!==null){if(e===t.current)throw Error(F(177));if(i=e.lanes|e.childLanes,i|=dx,kY(t,n,i,a,s,l),t===ve&&(Vt=ve=null,Wt=0),Ad=e,Ss=t,ma=n,zw=i,Fw=o,b3=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,ZW(Xb,function(){return C3(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=kt.T,kt.T=null,o=se.p,se.p=2,a=ae,ae|=4;try{GW(t,e,n)}finally{ae=a,se.p=o,kt.T=r}}gn=1,I3(),k3(),R3()}}function I3(){if(gn===1){gn=0;var t=Ss,e=Ad,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=kt.T,kt.T=null;var r=se.p;se.p=2;var o=ae;ae|=4;try{u3(e,t);var i=qw,a=qL(t.containerInfo),s=i.focusedElem,l=i.selectionRange;if(a!==s&&s&&s.ownerDocument&&jL(s.ownerDocument.documentElement,s)){if(l!==null&&ux(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=lD(s,_),b=lD(s,v);if(h&&b&&(f.rangeCount!==1||f.anchorNode!==h.node||f.anchorOffset!==h.offset||f.focusNode!==b.node||f.focusOffset!==b.offset)){var S=u.createRange();S.setStart(h.node,h.offset),f.removeAllRanges(),_>v?(f.addRange(S),f.extend(b.node,b.offset)):(S.setEnd(b.node,b.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}}v_=!!jw,qw=jw=null}finally{ae=o,se.p=r,kt.T=n}}t.current=e,gn=2}}function k3(){if(gn===2){gn=0;var t=Ss,e=Ad,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=kt.T,kt.T=null;var r=se.p;se.p=2;var o=ae;ae|=4;try{i3(t,e.alternate,e)}finally{ae=o,se.p=r,kt.T=n}}gn=3}}function R3(){if(gn===4||gn===3){gn=0,_Y();var t=Ss,e=Ad,n=ma,r=b3;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?gn=5:(gn=0,Ad=Ss=null,N3(t,t.pendingLanes));var o=t.pendingLanes;if(o===0&&(vs=null),rx(n),e=e.stateNode,jr&&typeof jr.onCommitFiberRoot=="function")try{jr.onCommitFiberRoot(dm,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=kt.T,o=se.p,se.p=2,kt.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{kt.T=e,se.p=o}}(ma&3)!==0&&U_(),Ri(t),o=t.pendingLanes,(n&261930)!==0&&(o&42)!==0?t===Hw?Wp++:(Wp=0,Hw=t):Wp=0,_m(0,!1)}}function N3(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,hm(e)))}function U_(){return I3(),k3(),R3(),C3()}function C3(){if(gn!==5)return!1;var t=Ss,e=zw;zw=0;var n=rx(ma),r=kt.T,o=se.p;try{se.p=32>n?32:n,kt.T=null,n=Fw,Fw=null;var i=Ss,a=ma;if(gn=0,Ad=Ss=null,ma=0,(ae&6)!==0)throw Error(F(331));var s=ae;if(ae|=4,g3(i.current),f3(i,i.current,a,n),ae=s,_m(0,!1),jr&&typeof jr.onPostCommitFiberRoot=="function")try{jr.onPostCommitFiberRoot(dm,i)}catch{}return!0}finally{se.p=o,kt.T=r,N3(t,e)}}function HD(t,e,n){e=So(n,e),e=Dw(t.stateNode,e,2),t=_s(t,e,2),t!==null&&(pm(t,2),Ri(t))}function ue(t,e,n){if(t.tag===3)HD(t,t,n);else for(;e!==null;){if(e.tag===3){HD(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=So(n,t),n=V5(2),r=_s(e,n,2),r!==null&&(Y5(n,r,e,t),pm(r,2),Ri(r));break}}e=e.return}}function QT(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new qW;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)||(Px=!0,o.add(n),t=XW.bind(null,t,e,n),e.then(t,t))}function XW(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,ve===t&&(Wt&n)===n&&(Ye===4||Ye===3&&(Wt&62914560)===Wt&&300>$r()-O_?(ae&2)===0&&Id(t,0):zx|=n,xd===Wt&&(xd=0)),Ri(t)}function M3(t,e){e===0&&(e=TL()),t=Yl(t,e),t!==null&&(pm(t,e),Ri(t))}function JW(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),M3(t,n)}function QW(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(F(314))}r!==null&&r.delete(e),M3(t,n)}function ZW(t,e){return ex(t,e)}var p_=null,Zu=null,Gw=!1,m_=!1,ZT=!1,gs=0;function Ri(t){t!==Zu&&t.next===null&&(Zu===null?p_=Zu=t:Zu=Zu.next=t),m_=!0,Gw||(Gw=!0,eK())}function _m(t,e){if(!ZT&&m_){ZT=!0;do for(var n=!1,r=p_;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-qr(42|t)+1)-1,i&=o&~(a&~s),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,GD(r,i))}else i=Wt,i=E_(r,r===ve?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||fm(r,i)||(n=!0,GD(r,i));r=r.next}while(n);ZT=!1}}function tK(){O3()}function O3(){m_=Gw=!1;var t=0;gs!==0&&cK()&&(t=gs);for(var e=$r(),n=null,r=p_;r!==null;){var o=r.next,i=D3(r,e);i===0?(r.next=null,n===null?p_=o:n.next=o,o===null&&(Zu=n)):(n=r,(t!==0||(i&3)!==0)&&(m_=!0)),r=o}gn!==0&&gn!==5||_m(t,!1),gs!==0&&(gs=0)}function D3(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,o=t.expirationTimes,i=t.pendingLanes&-62914561;0<i;){var a=31-qr(i),s=1<<a,l=o[a];l===-1?((s&n)===0||(s&r)!==0)&&(o[a]=IY(s,e)):l<=e&&(t.expiredLanes|=s),i&=~s}if(e=ve,n=Wt,n=E_(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,n===0||t===e&&(ce===2||ce===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&kT(r),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||fm(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(r!==null&&kT(r),rx(n)){case 2:case 8:n=SL;break;case 32:n=Xb;break;case 268435456:n=EL;break;default:n=Xb}return r=L3.bind(null,t),n=ex(n,r),t.callbackPriority=e,t.callbackNode=n,e}return r!==null&&r!==null&&kT(r),t.callbackPriority=2,t.callbackNode=null,2}function L3(t,e){if(gn!==0&&gn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(U_()&&t.callbackNode!==n)return null;var r=Wt;return r=E_(t,t===ve?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(v3(t,r,e),D3(t,$r()),t.callbackNode!=null&&t.callbackNode===n?L3.bind(null,t):null)}function GD(t,e){if(U_())return null;v3(t,e,!0)}function eK(){dK(function(){(ae&6)!==0?ex(vL,tK):O3()})}function Hx(){if(gs===0){var t=Ed;t===0&&(t=gb,gb<<=1,(gb&261888)===0&&(gb=256)),gs=t}return gs}function $D(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ob(""+t)}function jD(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 nK(t,e,n,r,o){if(e==="submit"&&n&&n.stateNode===o){var i=$D((o[wr]||null).action),a=r.submitter;a&&(e=(e=a[wr]||null)?$D(e.formAction):a.getAttribute("formAction"),e!==null&&(i=e,a=null));var s=new T_("action","action",null,r,o);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(gs!==0){var l=a?jD(o,a):new FormData(o);Mw(n,{pending:!0,data:l,method:o.method,action:i},null,l)}}else typeof i=="function"&&(s.preventDefault(),l=a?jD(o,a):new FormData(o),Mw(n,{pending:!0,data:l,method:o.method,action:i},i,l))},currentTarget:o}]})}}for(Ib=0;Ib<vw.length;Ib++)kb=vw[Ib],qD=kb.toLowerCase(),VD=kb[0].toUpperCase()+kb.slice(1),Jo(qD,"on"+VD);var kb,qD,VD,Ib;Jo(YL,"onAnimationEnd");Jo(WL,"onAnimationIteration");Jo(KL,"onAnimationStart");Jo("dblclick","onDoubleClick");Jo("focusin","onFocus");Jo("focusout","onBlur");Jo(vW,"onTransitionRun");Jo(SW,"onTransitionStart");Jo(EW,"onTransitionCancel");Jo(XL,"onTransitionEnd");vd("onMouseEnter",["mouseout","mouseover"]);vd("onMouseLeave",["mouseout","mouseover"]);vd("onPointerEnter",["pointerout","pointerover"]);vd("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 im="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(" "),rK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(im));function U3(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){Qb(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){Qb(d)}o.currentTarget=null,i=l}}}}function qt(t,e){var n=e[fw];n===void 0&&(n=e[fw]=new Set);var r=t+"__bubble";n.has(r)||(B3(e,t,2,!1),n.add(r))}function tw(t,e,n){var r=0;e&&(r|=4),B3(n,t,r,e)}var Rb="_reactListening"+Math.random().toString(36).slice(2);function Gx(t){if(!t[Rb]){t[Rb]=!0,kL.forEach(function(n){n!=="selectionchange"&&(rK.has(n)||tw(n,!1,t),tw(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Rb]||(e[Rb]=!0,tw("selectionchange",!1,e))}}function B3(t,e,n,r){switch(X3(e)){case 2:var o=CK;break;case 8:o=MK;break;default:o=Vx}n=o.bind(null,e,n,t),o=void 0,!yw||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 ew(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=nd(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}UL(function(){var c=i,d=ax(n),u=[];t:{var p=JL.get(t);if(p!==void 0){var f=T_,m=t;switch(t){case"keypress":if(Lb(n)===0)break t;case"keydown":case"keyup":f=QY;break;case"focusin":m="focus",f=OT;break;case"focusout":m="blur",f=OT;break;case"beforeblur":case"afterblur":f=OT;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=ZO;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=FY;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=eW;break;case YL:case WL:case KL:f=$Y;break;case XL:f=rW;break;case"scroll":case"scrollend":f=PY;break;case"wheel":f=iW;break;case"copy":case"cut":case"paste":f=qY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=eD;break;case"toggle":case"beforetoggle":f=sW}var _=(e&4)!==0,v=!_&&(t==="scroll"||t==="scrollend"),h=_?p!==null?p+"Capture":null:p;_=[];for(var b=c,S;b!==null;){var E=b;if(S=E.stateNode,E=E.tag,E!==5&&E!==26&&E!==27||S===null||h===null||(E=Jp(b,h),E!=null&&_.push(am(b,E,S))),v)break;b=b.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!==hw&&(m=n.relatedTarget||n.fromElement)&&(nd(m)||m[Nd]))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?nd(m):null,m!==null&&(v=um(m),_=m.tag,m!==v||_!==5&&_!==27&&_!==6)&&(m=null)):(f=null,m=c),f!==m)){if(_=ZO,E="onMouseLeave",h="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(_=eD,E="onPointerLeave",h="onPointerEnter",b="pointer"),v=f==null?p:Dp(f),S=m==null?p:Dp(m),p=new _(E,b+"leave",f,n,d),p.target=v,p.relatedTarget=S,E=null,nd(d)===c&&(_=new _(h,b+"enter",m,n,d),_.target=S,_.relatedTarget=v,E=_),v=E,f&&m)e:{for(_=oK,h=f,b=m,S=0,E=h;E;E=_(E))S++;E=0;for(var R=b;R;R=_(R))E++;for(;0<S-E;)h=_(h),S--;for(;0<E-S;)b=_(b),E--;for(;S--;){if(h===b||b!==null&&h===b.alternate){_=h;break e}h=_(h),b=_(b)}_=null}else _=null;f!==null&&YD(u,p,f,_,!1),m!==null&&v!==null&&YD(u,v,m,_,!0)}}t:{if(p=c?Dp(c):window,f=p.nodeName&&p.nodeName.toLowerCase(),f==="select"||f==="input"&&p.type==="file")var C=iD;else if(oD(p))if(GL)C=yW;else{C=gW;var I=mW}else f=p.nodeName,!f||f.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?c&&ix(c.elementType)&&(C=iD):C=hW;if(C&&(C=C(t,c))){HL(u,C,n,d);break t}I&&I(t,p,c),t==="focusout"&&c&&p.type==="number"&&c.memoizedProps.value!=null&&gw(p,"number",p.value)}switch(I=c?Dp(c):window,t){case"focusin":(oD(I)||I.contentEditable==="true")&&(id=I,bw=c,zp=null);break;case"focusout":zp=bw=id=null;break;case"mousedown":_w=!0;break;case"contextmenu":case"mouseup":case"dragend":_w=!1,cD(u,n,d);break;case"selectionchange":if(_W)break;case"keydown":case"keyup":cD(u,n,d)}var L;if(cx)t:{switch(t){case"compositionstart":var P="onCompositionStart";break t;case"compositionend":P="onCompositionEnd";break t;case"compositionupdate":P="onCompositionUpdate";break t}P=void 0}else od?zL(t,n)&&(P="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(PL&&n.locale!=="ko"&&(od||P!=="onCompositionStart"?P==="onCompositionEnd"&&od&&(L=BL()):(fs=d,sx="value"in fs?fs.value:fs.textContent,od=!0)),I=g_(c,P),0<I.length&&(P=new tD(P,t,null,n,d),u.push({event:P,listeners:I}),L?P.data=L:(L=FL(n),L!==null&&(P.data=L)))),(L=cW?uW(t,n):dW(t,n))&&(P=g_(c,"onBeforeInput"),0<P.length&&(I=new tD("onBeforeInput","beforeinput",null,n,d),u.push({event:I,listeners:P}),I.data=L)),nK(u,t,c,n,d)}U3(u,e)})}function am(t,e,n){return{instance:t,listener:e,currentTarget:n}}function g_(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=Jp(t,n),o!=null&&r.unshift(am(t,o,i)),o=Jp(t,e),o!=null&&r.push(am(t,o,i))),t.tag===3)return r;t=t.return}return[]}function oK(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function YD(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=Jp(n,i),c!=null&&a.unshift(am(n,c,l))):o||(c=Jp(n,i),c!=null&&a.push(am(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var iK=/\r\n?/g,aK=/\u0000|\uFFFD/g;function WD(t){return(typeof t=="string"?t:""+t).replace(iK,`
|
|
9
|
+
`).replace(aK,"")}function P3(t,e){return e=WD(e),WD(t)===e}function fe(t,e,n,r,o,i){switch(n){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||Sd(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&Sd(t,""+r);break;case"className":bb(t,"class",r);break;case"tabIndex":bb(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":bb(t,n,r);break;case"style":LL(t,r,i);break;case"data":if(e!=="object"){bb(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=Ob(""+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"&&fe(t,e,"name",o.name,o,null),fe(t,e,"formEncType",o.formEncType,o,null),fe(t,e,"formMethod",o.formMethod,o,null),fe(t,e,"formTarget",o.formTarget,o,null)):(fe(t,e,"encType",o.encType,o,null),fe(t,e,"method",o.method,o,null),fe(t,e,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(n);break}r=Ob(""+r),t.setAttribute(n,r);break;case"onClick":r!=null&&(t.onclick=ua);break;case"onScroll":r!=null&&qt("scroll",t);break;case"onScrollEnd":r!=null&&qt("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(F(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(F(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=Ob(""+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":qt("beforetoggle",t),qt("toggle",t),Mb(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":Mb(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=UY.get(n)||n,Mb(t,n,r))}}function $w(t,e,n,r,o,i){switch(n){case"style":LL(t,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(F(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(F(60));t.innerHTML=n}}break;case"children":typeof r=="string"?Sd(t,r):(typeof r=="number"||typeof r=="bigint")&&Sd(t,""+r);break;case"onScroll":r!=null&&qt("scroll",t);break;case"onScrollEnd":r!=null&&qt("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(!RL.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,""):Mb(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":qt("error",t),qt("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(F(137,e));default:fe(t,e,i,a,n,null)}}o&&fe(t,e,"srcSet",n.srcSet,n,null),r&&fe(t,e,"src",n.src,n,null);return;case"input":qt("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(F(137,e));break;default:fe(t,e,r,d,n,null)}}ML(t,i,s,l,c,a,o,!1);return;case"select":qt("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:fe(t,e,o,s,n,null)}e=i,n=a,t.multiple=!!r,e!=null?pd(t,!!r,e,!1):n!=null&&pd(t,!!r,n,!0);return;case"textarea":qt("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(F(91));break;default:fe(t,e,a,s,n,null)}DL(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:fe(t,e,l,r,n,null)}return;case"dialog":qt("beforetoggle",t),qt("toggle",t),qt("cancel",t),qt("close",t);break;case"iframe":case"object":qt("load",t);break;case"video":case"audio":for(r=0;r<im.length;r++)qt(im[r],t);break;case"image":qt("error",t),qt("load",t);break;case"details":qt("toggle",t);break;case"embed":case"source":case"link":qt("error",t),qt("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(F(137,e));default:fe(t,e,c,r,n,null)}return;default:if(ix(e)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&$w(t,e,d,r,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(r=n[s],r!=null&&fe(t,e,s,r,n,null))}function sK(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)||fe(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(F(137,e));break;default:f!==u&&fe(t,e,p,f,r,u)}}mw(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)||fe(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&&fe(t,e,o,i,r,l)}e=s,n=a,r=f,p!=null?pd(t,!!n,p,!1):!!r!=!!n&&(e!=null?pd(t,!!n,e,!0):pd(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:fe(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(F(91));break;default:o!==i&&fe(t,e,a,o,r,i)}OL(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:fe(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:fe(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(_)&&fe(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(F(137,e));break;default:fe(t,e,c,p,r,f)}return;default:if(ix(e)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!==void 0&&!r.hasOwnProperty(v)&&$w(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||$w(t,e,d,p,r,f);return}}for(var h in n)p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h)&&fe(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||fe(t,e,u,p,r,f)}function KD(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lK(){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&&KD(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&&KD(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 jw=null,qw=null;function h_(t){return t.nodeType===9?t:t.ownerDocument}function XD(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 z3(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 Vw(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 nw=null;function cK(){var t=window.event;return t&&t.type==="popstate"?t===nw?!1:(nw=t,!0):(nw=null,!1)}var F3=typeof setTimeout=="function"?setTimeout:void 0,uK=typeof clearTimeout=="function"?clearTimeout:void 0,JD=typeof Promise=="function"?Promise:void 0,dK=typeof queueMicrotask=="function"?queueMicrotask:typeof JD<"u"?function(t){return JD.resolve(null).then(t).catch(fK)}:F3;function fK(t){setTimeout(function(){throw t})}function Ns(t){return t==="head"}function QD(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),Rd(e);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Kp(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Kp(n);for(var i=n.firstChild;i;){var a=i.nextSibling,s=i.nodeName;i[mm]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=a}}else n==="body"&&Kp(t.ownerDocument.body);n=o}while(n);Rd(e)}function ZD(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 Yw(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":Yw(n),ox(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function pK(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[mm])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=wo(t.nextSibling),t===null)break}return null}function mK(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=wo(t.nextSibling),t===null))return null;return t}function H3(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=wo(t.nextSibling),t===null))return null;return t}function Ww(t){return t.data==="$?"||t.data==="$~"}function Kw(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function gK(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 wo(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 Xw=null;function tL(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return wo(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function eL(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 G3(t,e,n){switch(e=h_(n),t){case"html":if(t=e.documentElement,!t)throw Error(F(452));return t;case"head":if(t=e.head,!t)throw Error(F(453));return t;case"body":if(t=e.body,!t)throw Error(F(454));return t;default:throw Error(F(451))}}function Kp(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);ox(t)}var xo=new Map,nL=new Set;function y_(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var va=se.d;se.d={f:hK,r:yK,D:bK,C:_K,L:vK,m:SK,X:TK,S:EK,M:wK};function hK(){var t=va.f(),e=D_();return t||e}function yK(t){var e=Cd(t);e!==null&&e.tag===5&&e.type==="form"?L5(e):va.r(t)}var Ld=typeof document>"u"?null:document;function $3(t,e,n){var r=Ld;if(r&&typeof e=="string"&&e){var o=vo(e);o='link[rel="'+t+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),nL.has(o)||(nL.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 bK(t){va.D(t),$3("dns-prefetch",t,null)}function _K(t,e){va.C(t,e),$3("preconnect",t,e)}function vK(t,e,n){va.L(t,e,n);var r=Ld;if(r&&t&&e){var o='link[rel="preload"][as="'+vo(e)+'"]';e==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+vo(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+vo(n.imageSizes)+'"]')):o+='[href="'+vo(t)+'"]';var i=o;switch(e){case"style":i=kd(t);break;case"script":i=Ud(t)}xo.has(i)||(t=Re({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),xo.set(i,t),r.querySelector(o)!==null||e==="style"&&r.querySelector(vm(i))||e==="script"&&r.querySelector(Sm(i))||(e=r.createElement("link"),Un(e,"link",t),In(e),r.head.appendChild(e)))}}function SK(t,e){va.m(t,e);var n=Ld;if(n&&t){var r=e&&typeof e.as=="string"?e.as:"script",o='link[rel="modulepreload"][as="'+vo(r)+'"][href="'+vo(t)+'"]',i=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Ud(t)}if(!xo.has(i)&&(t=Re({rel:"modulepreload",href:t},e),xo.set(i,t),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Sm(i)))return}r=n.createElement("link"),Un(r,"link",t),In(r),n.head.appendChild(r)}}}function EK(t,e,n){va.S(t,e,n);var r=Ld;if(r&&t){var o=fd(r).hoistableStyles,i=kd(t);e=e||"default";var a=o.get(i);if(!a){var s={loading:0,preload:null};if(a=r.querySelector(vm(i)))s.loading=5;else{t=Re({rel:"stylesheet",href:t,"data-precedence":e},n),(n=xo.get(i))&&$x(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,$b(a,e,r)}a={type:"stylesheet",instance:a,count:1,state:s},o.set(i,a)}}}function TK(t,e){va.X(t,e);var n=Ld;if(n&&t){var r=fd(n).hoistableScripts,o=Ud(t),i=r.get(o);i||(i=n.querySelector(Sm(o)),i||(t=Re({src:t,async:!0},e),(e=xo.get(o))&&jx(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 wK(t,e){va.M(t,e);var n=Ld;if(n&&t){var r=fd(n).hoistableScripts,o=Ud(t),i=r.get(o);i||(i=n.querySelector(Sm(o)),i||(t=Re({src:t,async:!0,type:"module"},e),(e=xo.get(o))&&jx(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 rL(t,e,n,r){var o=(o=hs.current)?y_(o):null;if(!o)throw Error(F(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=kd(n.href),n=fd(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=kd(n.href);var i=fd(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(vm(t)))&&!i._p&&(a.instance=i,a.state.loading=5),xo.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},xo.set(t,n),i||xK(o,t,n,a.state))),e&&r===null)throw Error(F(528,""));return a}if(e&&r!==null)throw Error(F(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Ud(n),n=fd(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(F(444,t))}}function kd(t){return'href="'+vo(t)+'"'}function vm(t){return'link[rel="stylesheet"]['+t+"]"}function j3(t){return Re({},t,{"data-precedence":t.precedence,precedence:null})}function xK(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 Ud(t){return'[src="'+vo(t)+'"]'}function Sm(t){return"script[async]"+t}function oL(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+vo(n.href)+'"]');if(r)return e.instance=r,In(r),r;var o=Re({},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),$b(r,n.precedence,t),e.instance=r;case"stylesheet":o=kd(n.href);var i=t.querySelector(vm(o));if(i)return e.state.loading|=4,e.instance=i,In(i),i;r=j3(n),(o=xo.get(o))&&$x(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,$b(i,n.precedence,t),e.instance=i;case"script":return i=Ud(n.src),(o=t.querySelector(Sm(i)))?(e.instance=o,In(o),o):(r=n,(o=xo.get(i))&&(r=Re({},n),jx(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(F(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,$b(r,n.precedence,t));return e.instance}function $b(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 $x(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function jx(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var jb=null;function iL(t,e,n){if(jb===null){var r=new Map,o=jb=new Map;o.set(n,r)}else o=jb,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[mm]||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 aL(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function AK(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 q3(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function IK(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=kd(r.href),i=e.querySelector(vm(o));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=b_.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=i,In(i);return}i=e.ownerDocument||e,r=j3(r),(o=xo.get(o))&&$x(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=b_.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var rw=0;function kK(t,e){return t.stylesheets&&t.count===0&&qb(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var r=setTimeout(function(){if(t.stylesheets&&qb(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4+e);0<t.imgBytes&&rw===0&&(rw=62500*lK());var o=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&qb(t,t.stylesheets),t.unsuspend)){var i=t.unsuspend;t.unsuspend=null,i()}},(t.imgBytes>rw?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function b_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qb(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var __=null;function qb(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,__=new Map,e.forEach(RK,t),__=null,b_.call(t))}function RK(t,e){if(!(e.state.loading&4)){var n=__.get(t);if(n)var r=n.get(null);else{n=new Map,__.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=b_.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 sm={$$typeof:ca,Provider:null,Consumer:null,_currentValue:Dl,_currentValue2:Dl,_threadCount:0};function NK(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=RT(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=RT(0),this.hiddenUpdates=RT(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 V3(t,e,n,r,o,i,a,s,l,c,d,u){return t=new NK(t,e,n,a,l,c,d,u,s),e=1,i===!0&&(e|=24),i=Hr(3,null,null,e),t.current=i,i.stateNode=t,e=hx(),e.refCount++,t.pooledCache=e,e.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:e},_x(i),t}function Y3(t){return t?(t=ld,t):ld}function W3(t,e,n,r,o,i){o=Y3(o),r.context===null?r.context=o:r.pendingContext=o,r=bs(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),Hp(n,t,e))}function sL(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function qx(t,e){sL(t,e),(t=t.alternate)&&sL(t,e)}function K3(t){if(t.tag===13||t.tag===31){var e=Yl(t,67108864);e!==null&&Tr(e,t,67108864),qx(t,67108864)}}function lL(t){if(t.tag===13||t.tag===31){var e=Vr();e=nx(e);var n=Yl(t,e);n!==null&&Tr(n,t,e),qx(t,e)}}var v_=!0;function CK(t,e,n,r){var o=kt.T;kt.T=null;var i=se.p;try{se.p=2,Vx(t,e,n,r)}finally{se.p=i,kt.T=o}}function MK(t,e,n,r){var o=kt.T;kt.T=null;var i=se.p;try{se.p=8,Vx(t,e,n,r)}finally{se.p=i,kt.T=o}}function Vx(t,e,n,r){if(v_){var o=Jw(r);if(o===null)ew(t,e,r,S_,n),cL(t,r);else if(DK(o,t,e,n,r))r.stopPropagation();else if(cL(t,r),e&4&&-1<OK.indexOf(t)){for(;o!==null;){var i=Cd(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-qr(a);s.entanglements[1]|=l,a&=~l}Ri(i),(ae&6)===0&&(u_=$r()+500,_m(0,!1))}}break;case 31:case 13:s=Yl(i,2),s!==null&&Tr(s,i,2),D_(),qx(i,2)}if(i=Jw(r),i===null&&ew(t,e,r,S_,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else ew(t,e,r,null,n)}}function Jw(t){return t=ax(t),Yx(t)}var S_=null;function Yx(t){if(S_=null,t=nd(t),t!==null){var e=um(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=gL(e),t!==null)return t;t=null}else if(n===31){if(t=hL(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 S_=t,null}function X3(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(vY()){case vL:return 2;case SL:return 8;case Xb:case SY:return 32;case EL:return 268435456;default:return 32}default:return 32}}var Qw=!1,Es=null,Ts=null,ws=null,lm=new Map,cm=new Map,us=[],OK="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 cL(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":lm.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":cm.delete(e.pointerId)}}function Np(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=Cd(e),e!==null&&K3(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,o!==null&&e.indexOf(o)===-1&&e.push(o),t)}function DK(t,e,n,r,o){switch(e){case"focusin":return Es=Np(Es,t,e,n,r,o),!0;case"dragenter":return Ts=Np(Ts,t,e,n,r,o),!0;case"mouseover":return ws=Np(ws,t,e,n,r,o),!0;case"pointerover":var i=o.pointerId;return lm.set(i,Np(lm.get(i)||null,t,e,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,cm.set(i,Np(cm.get(i)||null,t,e,n,r,o)),!0}return!1}function J3(t){var e=nd(t.target);if(e!==null){var n=um(e);if(n!==null){if(e=n.tag,e===13){if(e=gL(n),e!==null){t.blockedOn=e,VO(t.priority,function(){lL(n)});return}}else if(e===31){if(e=hL(n),e!==null){t.blockedOn=e,VO(t.priority,function(){lL(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 Vb(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Jw(t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);hw=r,n.target.dispatchEvent(r),hw=null}else return e=Cd(n),e!==null&&K3(e),t.blockedOn=n,!1;e.shift()}return!0}function uL(t,e,n){Vb(t)&&n.delete(e)}function LK(){Qw=!1,Es!==null&&Vb(Es)&&(Es=null),Ts!==null&&Vb(Ts)&&(Ts=null),ws!==null&&Vb(ws)&&(ws=null),lm.forEach(uL),cm.forEach(uL)}function Nb(t,e){t.blockedOn===e&&(t.blockedOn=null,Qw||(Qw=!0,hn.unstable_scheduleCallback(hn.unstable_NormalPriority,LK)))}var Cb=null;function dL(t){Cb!==t&&(Cb=t,hn.unstable_scheduleCallback(hn.unstable_NormalPriority,function(){Cb===t&&(Cb=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(Yx(r||n)===null)continue;break}var i=Cd(n);i!==null&&(t.splice(e,3),e-=3,Mw(i,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Rd(t){function e(l){return Nb(l,t)}Es!==null&&Nb(Es,t),Ts!==null&&Nb(Ts,t),ws!==null&&Nb(ws,t),lm.forEach(e),cm.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);)J3(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||dL(n);else if(a){var s=null;if(i&&i.hasAttribute("formAction")){if(o=i,a=i[wr]||null)s=a.formAction;else if(Yx(o)!==null)continue}else s=a.action;typeof s=="function"?n[r+1]=s:(n.splice(r,3),r-=3),dL(n)}}}function Q3(){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 Wx(t){this._internalRoot=t}B_.prototype.render=Wx.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(F(409));var n=e.current,r=Vr();W3(n,r,t,e,null,null)};B_.prototype.unmount=Wx.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;W3(t.current,2,null,t,null,null),D_(),e[Nd]=null}};function B_(t){this._internalRoot=t}B_.prototype.unstable_scheduleHydration=function(t){if(t){var e=IL();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&&J3(t)}};var fL=pL.version;if(fL!=="19.2.7")throw Error(F(527,fL,"19.2.7"));se.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(F(188)):(t=Object.keys(t).join(","),Error(F(268,t)));return t=pY(e),t=t!==null?yL(t):null,t=t===null?null:t.stateNode,t};var UK={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:kt,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Cp=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Cp.isDisabled&&Cp.supportsFiber))try{dm=Cp.inject(UK),jr=Cp}catch{}var Cp;P_.createRoot=function(t,e){if(!mL(t))throw Error(F(299));var n=!1,r="",o=$5,i=j5,a=q5;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=V3(t,1,!1,null,null,n,r,null,o,i,a,Q3),t[Nd]=e.current,Gx(t),new Wx(e)};P_.hydrateRoot=function(t,e,n){if(!mL(t))throw Error(F(299));var r=!1,o="",i=$5,a=j5,s=q5,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=V3(t,1,!0,e,n??null,r,o,l,i,a,s,Q3),e.context=Y3(null),n=e.current,r=Vr(),r=nx(r),o=bs(r),o.callback=null,_s(n,o,r),n=r,e.current.lanes=n,pm(e,n),Ri(e),t[Nd]=e.current,Gx(t),new B_(e)};P_.version="19.2.7"});var nU=Ym((Cvt,eU)=>{"use strict";function tU(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tU)}catch(t){console.error(t)}}tU(),eU.exports=Z3()});var Vu={};g0(Vu,{BrowserClient:()=>du,ErrorBoundary:()=>hp,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>zc,OpenFeatureIntegrationHook:()=>ab,Profiler:()=>Bu,SDK_VERSION:()=>ir,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>bt,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>at,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>ni,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>Dt,Scope:()=>Gn,WINDOW:()=>j,addBreadcrumb:()=>Tn,addEventProcessor:()=>Lc,addIntegration:()=>Xs,bindScopeToEmitter:()=>j0,breadcrumbsIntegration:()=>uy,browserApiErrorsIntegration:()=>dy,browserProfilingIntegration:()=>iM,browserSessionIntegration:()=>fy,browserTracingIntegration:()=>Pr,buildLaunchDarklyFlagUsedHandler:()=>lM,captureConsoleIntegration:()=>Ev,captureEvent:()=>Zr,captureException:()=>wt,captureFeedback:()=>$c,captureMessage:()=>Da,captureReactException:()=>gp,captureSession:()=>Ua,chromeStackLineParser:()=>GS,close:()=>Wg,consoleLoggingIntegration:()=>Mv,contextLinesIntegration:()=>WN,continueTrace:()=>Lg,createConsolaReporter:()=>Dv,createLangChainCallbackHandler:()=>tu,createReduxEnhancer:()=>CM,createTransport:()=>xf,createUserFeedbackEnvelope:()=>ON,cultureContextIntegration:()=>py,dedupeIntegration:()=>Mf,defaultRequestInstrumentationOptions:()=>fp,defaultStackLineParsers:()=>jS,defaultStackParser:()=>ly,diagnoseSdkConnectivity:()=>pM,elementTimingIntegration:()=>RS,endSession:()=>Uc,eventFiltersIntegration:()=>ah,eventFromException:()=>Yh,eventFromMessage:()=>Wh,exceptionFromError:()=>cu,extraErrorDataIntegration:()=>Tv,featureFlagsIntegration:()=>kv,feedbackAsyncIntegration:()=>tN,feedbackIntegration:()=>pS,feedbackSyncIntegration:()=>pS,fetchStreamPerformanceIntegration:()=>Zy,flush:()=>Yg,forceLoad:()=>zN,functionToStringIntegration:()=>Nf,geckoStackLineParser:()=>$S,getActiveSpan:()=>Lt,getClient:()=>B,getCurrentScope:()=>nt,getDefaultIntegrations:()=>YS,getFeedback:()=>FR,getGlobalScope:()=>lr,getIsolationScope:()=>zt,getReplay:()=>c2,getRootSpan:()=>Pt,getSpanDescendants:()=>ii,getSpanStatusFromHttpCode:()=>vg,getTraceData:()=>el,globalHandlersIntegration:()=>my,graphqlClientIntegration:()=>QN,growthbookIntegration:()=>dM,httpClientIntegration:()=>jN,httpContextIntegration:()=>gy,inboundFiltersIntegration:()=>Cf,init:()=>sb,instrumentAnthropicAiClient:()=>Gv,instrumentCreateReactAgent:()=>Yv,instrumentGoogleGenAIClient:()=>jv,instrumentLangChainEmbeddings:()=>Kv,instrumentLangGraph:()=>Wv,instrumentOpenAiClient:()=>zv,instrumentOutgoingRequests:()=>Qy,instrumentSupabaseClient:()=>fh,isBotUserAgent:()=>WE,isEnabled:()=>Dc,isInitialized:()=>Kg,lastEventId:()=>Oc,launchDarklyIntegration:()=>sM,lazyLoadIntegration:()=>qh,linkedErrorsIntegration:()=>hy,logger:()=>gh,makeBrowserOfflineTransport:()=>H2,makeFetchTransport:()=>vu,makeMultiplexedTransport:()=>mv,metrics:()=>Fa,moduleMetadataIntegration:()=>Sv,normalizeStringifyValue:()=>Eu,onLoad:()=>FN,openFeatureIntegration:()=>cM,opera10StackLineParser:()=>NN,opera11StackLineParser:()=>CN,parameterize:()=>oh,reactErrorHandler:()=>vM,reactRouterBrowserTracingIntegration:()=>TO,reactRouterV3BrowserTracingIntegration:()=>OM,reactRouterV4BrowserTracingIntegration:()=>BM,reactRouterV5BrowserTracingIntegration:()=>PM,reactRouterV6BrowserTracingIntegration:()=>pO,reactRouterV7BrowserTracingIntegration:()=>bO,registerSpanErrorInstrumentation:()=>df,registerWebWorker:()=>hM,replayCanvasIntegration:()=>w2,replayIntegration:()=>Yy,reportPageLoaded:()=>P2,reportingObserverIntegration:()=>GN,rewriteFramesIntegration:()=>wv,sendFeedback:()=>iS,setActiveSpanInBrowser:()=>z2,setAttribute:()=>jg,setAttributes:()=>$g,setContext:()=>La,setConversationId:()=>Vg,setCurrentClient:()=>rh,setExtra:()=>Hg,setExtras:()=>Fg,setHttpStatus:()=>ri,setMeasurement:()=>qs,setTag:()=>Mc,setTags:()=>Gg,setUser:()=>qg,showReportDialog:()=>Kf,spanStreamingIntegration:()=>F2,spanToBaggageHeader:()=>Ng,spanToJSON:()=>tt,spanToTraceHeader:()=>Ac,spotlightBrowserIntegration:()=>aM,startBrowserTracingNavigationSpan:()=>Wo,startBrowserTracingPageLoadSpan:()=>Yo,startInactiveSpan:()=>xe,startNewTrace:()=>bf,startSession:()=>Ks,startSpan:()=>on,startSpanManual:()=>jn,statsigIntegration:()=>fM,supabaseIntegration:()=>xv,suppressTracing:()=>Rc,tanstackRouterBrowserTracingIntegration:()=>LM,thirdPartyErrorFilterIntegration:()=>Iv,uiProfiler:()=>kN,unleashIntegration:()=>uM,updateSpanName:()=>kg,useProfiler:()=>RM,viewHierarchyIntegration:()=>ZN,webVitalsIntegration:()=>tb,webWorkerIntegration:()=>gM,winjsStackLineParser:()=>RN,withActiveSpan:()=>Qr,withErrorBoundary:()=>NM,withIsolationScope:()=>tf,withProfiler:()=>kM,withScope:()=>Ce,withSentryReactRouterV6Routing:()=>yO,withSentryReactRouterV7Routing:()=>_O,withSentryRouting:()=>HM,withStreamedSpan:()=>z0,wrapCreateBrowserRouter:()=>xO,wrapCreateBrowserRouterV6:()=>gO,wrapCreateBrowserRouterV7:()=>vO,wrapCreateMemoryRouter:()=>AO,wrapCreateMemoryRouterV6:()=>hO,wrapCreateMemoryRouterV7:()=>SO,wrapReactRouterRouting:()=>wO,wrapUseRoutes:()=>IO,wrapUseRoutesV6:()=>mO,wrapUseRoutesV7:()=>EO,zodErrorsIntegration:()=>Av});var z=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Z=globalThis;var ir="10.63.0";function Jn(){return Ta(Z),Z}function Ta(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||ir,e[ir]=e[ir]||{}}function Mo(t,e,n=Z){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"],W6="Sentry Logger ",Ls={};function dn(t){if(!("console"in Z))return t();let e=Z.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 K6(){y0().enabled=!0}function X6(){y0().enabled=!1}function O1(){return y0().enabled}function J6(...t){h0("log",...t)}function Q6(...t){h0("warn",...t)}function Z6(...t){h0("error",...t)}function h0(t,...e){z&&O1()&&dn(()=>{Z.console[t](`${W6}[${t}]:`,...e)})}function y0(){return z?Mo("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var w={enable:K6,disable:X6,isEnabled:O1,log:J6,warn:Q6,error:Z6};var D1=/\(error: (.*)\)/,L1=/captureMessage|captureException/;function jd(...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
|
+
`);for(let s=r;s<a.length;s++){let l=a[s];l.length>1024&&(l=l.slice(0,1024));let c=D1.test(l)?l.replace(D1,"$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 _0(i.slice(o))}}function Xm(t){return Array.isArray(t)?jd(...t):t}function _0(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(Km(e).function||"")&&e.pop(),e.reverse(),L1.test(Km(e).function||"")&&(e.pop(),L1.test(Km(e).function||"")&&e.pop()),e.slice(0,50).map(n=>({...n,filename:n.filename||Km(e).filename,function:n.function||"?"}))}function Km(t){return t[t.length-1]||{}}var b0="<anonymous>";function Qn(t){try{return!t||typeof t!="function"?b0:t.name||b0}catch{return b0}}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 U1(t){let e=t?.startsWith("file://")?t.slice(7):t;return e?.match(/\/[A-Z]:/)&&(e=e.slice(1)),e}var qd={},B1={};function Pn(t,e){return qd[t]=qd[t]||[],qd[t].push(e),()=>{let n=qd[t];if(n){let r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}function zn(t,e){if(!B1[t]){B1[t]=!0;try{e()}catch(n){z&&w.error(`Error while instrumenting ${t}`,n)}}}function tn(t,e){let n=t&&qd[t];if(n)for(let r of n)try{r(e)}catch(o){z&&w.error(`Error while triggering instrumentation handler.
|
|
11
|
+
Type: ${t}
|
|
12
|
+
Name: ${Qn(r)}
|
|
13
|
+
Error:`,o)}}var v0=null;function Vd(t){let e="error";Pn(e,t),zn(e,tB)}function tB(){v0=Z.onerror,Z.onerror=function(t,e,n,r,o){return tn("error",{column:r,error:o,line:n,msg:t,url:e}),v0?v0.apply(this,arguments):!1},Z.onerror.__SENTRY_INSTRUMENTED__=!0}var S0=null;function Yd(t){let e="unhandledrejection";Pn(e,t),zn(e,eB)}function eB(){S0=Z.onunhandledrejection,Z.onunhandledrejection=function(t){return tn("unhandledrejection",t),S0?S0.apply(this,arguments):!0},Z.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var P1=Object.prototype.toString;function fn(t){switch(P1.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Oo(t,Error)}}function gc(t,e){return P1.call(t)===`[object ${e}]`}function hc(t){return gc(t,"ErrorEvent")}function Wd(t){return gc(t,"DOMError")}function Jm(t){return gc(t,"DOMException")}function pn(t){return gc(t,"String")}function ei(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function en(t){return t===null||ei(t)||typeof t!="object"&&typeof t!="function"}function ge(t){return gc(t,"Object")}function xa(t){return typeof Event<"u"&&Oo(t,Event)}function Qm(t){return gc(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 Kd(t){return typeof Request<"u"&&Oo(t,Request)}function he(t,e,n){if(!(e in t))return;let r=t[e];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Xd(o,r);try{t[e]=o}catch{z&&w.log(`Failed to replace method "${e}" in object`,t)}}function Ht(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{z&&w.log(`Failed to add non-enumerable property "${String(e)}" to object`,t)}}function Xd(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,Ht(t,"__sentry_original__",e)}catch{}}function Aa(t){return t.__sentry_original__}function Jd(t){if(fn(t))return{message:t.message,name:t.name,stack:t.stack,...z1(t)};if(xa(t)){let{type:e,target:n,currentTarget:r,detail:o}=t;return{type:e,target:n,currentTarget:r,...o?{detail:o}:{},...z1(t)}}return t}function z1(t){return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}function Zm(t){let e=Object.keys(Jd(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=Z;return e in n&&typeof n[e]=="function"?(yc=n[e],yc(t)):(yc=null,t())}function ar(){return Bs(()=>Math.random())}function Fn(){return Bs(()=>Date.now())}var F1=Symbol.for("sentry.skipNormalization"),H1=Symbol.for("sentry.overrideNormalizationDepth");function E0(t){Ht(t,F1,!0)}function T0(t,e){Ht(t,H1,e)}function G1(t){return!!t[F1]}function $1(t){let e=t[H1];return typeof e=="number"?e:void 0}var w0;function bc(t){w0=t}function le(t,e=100,n=1/0){try{return x0("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Qd(t,e=3,n=100*1024){let r=le(t,e);return oB(r)>n?Qd(t,e-1,n):r}function x0(t,e,n=1/0,r=1/0,o=iB()){let[i,a]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let s=A0(t,e);if(!s.startsWith("[object "))return s;if(G1(e))return e;let l=$1(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 x0("",m,c-1,r,o)}catch{}let u=Array.isArray(e)?[]:{},p=0,f=Jd(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]=x0(m,_,c-1,r,o),p++}return a(e),u}function A0(t,e){try{if(w0){let r=w0(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 ${nB(e)}]`}catch(n){return`**non-serializable** (${n})`}}function nB(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function rB(t){return~-encodeURI(t).split(/%..|./).length}function oB(t){return rB(JSON.stringify(t))}function iB(){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 _c(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 Ia(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let o=t[r];en(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(A0(void 0,o))}return n.join(e)}function ka(t,e,n=!1){return pn(t)?Qm(e)?e.test(t):pn(e)?n?t===e:t.includes(e):typeof e=="function"?e(t):!1:!1}function nn(t,e=[],n=!1){for(let r of e)if(ka(t,r,n))return!0;return!1}function aB(){let t=Z;return t.crypto||t.msCrypto}var I0;function sB(){return ar()*16}function oe(t=aB()){try{if(t?.randomUUID)return Bs(()=>t.randomUUID()).replace(/-/g,"")}catch{}return I0||(I0="10000000100040008000"+1e11),I0.replace(/[018]/g,e=>(e^(sB()&15)>>e/4).toString(16))}function j1(t){return t.exception?.values?.[0]}function Lo(t){let{message:e,event_id:n}=t;if(e)return e;let r=j1(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 Sn(t,e){let n=j1(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 tg(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=>_c(a,0));let i=Math.min(r-1,o);e.context_line=_c(t[i],e.colno||0),e.post_context=t.slice(Math.min(o+1,r),o+1+n).map(a=>_c(a,0))}function Zd(t){if(k0(t))return!0;try{Ht(t,"__sentry_captured__",!0)}catch{}return!1}function k0(t){try{return t.__sentry_captured__}catch{}}var V1=1e3;function sr(){return Fn()/V1}function lB(){let{performance:t}=Z;if(!t?.now||!t.timeOrigin)return sr;let e=t.timeOrigin;return()=>(e+Bs(()=>t.now()))/V1}var q1;function Ot(){return(q1??(q1=lB()))()}var R0=null;function cB(){let{performance:t}=Z;if(!t?.now)return;let e=3e5,n=Bs(()=>t.now()),r=Fn(),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 Qt(){return R0===null&&(R0=cB()),R0}function Y1(t){let e=Ot(),n={sid:oe(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>uB(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||Ot(),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:oe()),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 W1(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Oi(t,n)}function uB(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 oe()}function Hn(){return oe().substring(16)}function eg(t){try{let e=Z.WeakRef;if(typeof e=="function")return new e(t)}catch{}return t}function ng(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}var N0="_sentrySpan";function Zn(t,e){e?Ht(t,N0,eg(e)):delete t[N0]}function Uo(t){return ng(t[N0])}var dB=100,Gn=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():ge(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:dB;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||oe();if(!this._client)return z&&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||oe();if(!this._client)return z&&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||oe();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(z&&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 K1(){return Mo("defaultCurrentScope",()=>new Gn)}function X1(){return Mo("defaultIsolationScope",()=>new Gn)}var J1=t=>t instanceof Promise&&!t[Q1],Q1=Symbol("chained PromiseLike"),rg=(t,e,n)=>{let r=t.then(o=>(e(o),o),o=>{throw n(o),o});return J1(r)&&J1(t)?r:fB(t,r)},fB=(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,{[Q1]:!0}),e};var C0=class{constructor(e,n){let r;e?r=e:r=new Gn;let o;n?o=n:o=new Gn,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)?rg(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 vc(){let t=Jn(),e=Ta(t);return e.stack=e.stack||new C0(K1(),X1())}function pB(t){return vc().withScope(t)}function mB(t,e){let n=vc();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function Z1(t){return vc().withScope(()=>t(vc().getIsolationScope()))}function tA(){return{withIsolationScope:Z1,withScope:pB,withSetScope:mB,withSetIsolationScope:(t,e)=>Z1(e),getCurrentScope:()=>vc().getScope(),getIsolationScope:()=>vc().getIsolationScope()}}function Jr(t){let e=Ta(t);return e.acs?e.acs:tA()}function gB(t){return typeof t=="object"&&t!=null&&!Array.isArray(t)&&Object.keys(t).includes("value")}function hB(t,e){let{value:n,unit:r}=gB(t)?t:{value:t,unit:void 0},o=yB(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=hB(o,e);i&&(n[r]=i)}return n}function M0(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+=eA(o[0])*o.length:en(o)?e+=eA(o):e+=100}return e}function eA(t){return typeof t=="string"?t.length*2:typeof t=="boolean"?4:typeof t=="number"?8:0}function yB(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 nA;function O0(){return nA?.()}function og(){return nA!==void 0}function nt(){let t=Jn();return Jr(t).getCurrentScope()}function zt(){let t=Jn();return Jr(t).getIsolationScope()}function lr(){return Mo("globalScope",()=>new Gn)}function Ce(...t){let e=Jn(),n=Jr(e);if(t.length===2){let[r,o]=t;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(t[0])}function tf(...t){let e=Jn(),n=Jr(e);if(t.length===2){let[r,o]=t;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(t[0])}function B(){return nt().getClient()}function Sc(t){let e=O0();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||Hn()};return o&&(a.parent_span_id=o),a}var Dt="sentry.source",ni="sentry.sample_rate",Ec="sentry.previous_trace_sample_rate",bt="sentry.op",at="sentry.origin",ig="sentry.status.message",Li="sentry.idle_span_finish_reason",Bo="sentry.measurement_unit",Po="sentry.measurement_value",ag="sentry.release",sg="sentry.environment",lg="sentry.segment.name",cg="sentry.segment.id",ug="sentry.sdk.name",dg="sentry.sdk.version",fg="sentry.sdk.integrations",pg="user.id",mg="user.email",gg="user.ip_address",hg="user.name",zs="sentry.custom_span_name",Fs="sentry.profile_id",$n="sentry.exclusive_time";var yg="http.request.method",Tc="url.full",bg="sentry.link.type",_g="gen_ai.conversation.id";function vg(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=vg(e);n.message!=="unknown_error"&&t.setStatus(n)}var rA="_sentryScope",oA="_sentryIsolationScope",bB=Symbol.for("sentry.otelSourceInference");function Na(t,e,n){t&&(Ht(t,oA,eg(n)),Ht(t,rA,e))}function oi(t){let e=t;return{scope:e[rA],isolationScope:ng(e[oA])}}function iA(t){return t[bB]===!0}var ef="sentry-";var _B=8192;function wc(t){let e=vB(t);if(!e)return;let n=Object.entries(e).reduce((r,[o,i])=>{if(o.startsWith(ef)){let a=o.slice(ef.length);r[a]=i}return r},{});if(Object.keys(n).length>0)return n}function Sg(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,o])=>(o&&(n[`${ef}${r}`]=o),n),{});return SB(e)}function vB(t){if(!(!t||!pn(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=aA(n);return Object.entries(r).forEach(([o,i])=>{e[o]=i}),e},{}):aA(t)}function aA(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 SB(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>_B?(z&&w.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):a},"")}var EB=/^o(\d+)\./,TB=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function wB(t){return t==="http"||t==="https"}function rn(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 Eg(t){let e=TB.exec(t);if(!e){dn(()=>{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 sA({host:i,pass:o,path:l,projectId:c,port:a,protocol:n,publicKey:r})}function sA(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function xB(t){if(!z)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+$/)?wB(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 AB(t){return t.match(EB)?.[1]}function Tg(t){let e=t.getOptions(),{host:n}=t.getDsn()||{},r;return e.orgId?r=String(e.orgId):n&&(r=AB(n)),r}function nf(t){let e=typeof t=="string"?Eg(t):sA(t);if(!(!e||!xB(e)))return e}function Nr(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 wg=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function lA(t){if(!t)return;let e=t.match(wg);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 rf(t,e){let n=lA(t),r=wc(e);if(!n?.traceId)return{traceId:Cn(),sampleRand:ar()};let o=IB(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 of(t=Cn(),e=Hn(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function af(t=Cn(),e=Hn(),n){return`00-${t}-${e}-${n?"01":"00"}`}function IB(t,e){let n=Nr(e?.sample_rand);if(n!==void 0)return n;let r=Nr(e?.sample_rate);return r&&t?.parentSampled!==void 0?t.parentSampled?ar()*r:r+ar()*(1-r):ar()}function D0(t,e){let n=Tg(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 xg=0,lf=1,cA=!1;function fA(t){let{spanId:e,traceId:n}=t.spanContext(),{data:r,op:o,parent_span_id:i,status:a,origin:s,links:l}=tt(t);return{parent_span_id:i,span_id:e,trace_id:n,data:r,op:o,status:a,origin:s,links:l}}function xc(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),o=r?e:tt(t).parent_span_id,i=oi(t).scope,a=r?i?.getPropagationContext().propagationSpanId||Hn():e;return{parent_span_id:o,span_id:a,trace_id:n}}function Ac(t){let{traceId:e,spanId:n}=t.spanContext(),r=En(t);return of(e,n,r)}function pA(t){let{traceId:e,spanId:n}=t.spanContext(),r=En(t);return af(e,n,r)}function cf(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===lf,attributes:i,...o}))}function U0(t){if(t?.length)return t.map(({context:{spanId:e,traceId:n,traceFlags:r},attributes:o})=>({span_id:e,trace_id:n,sampled:r===lf,attributes:o}))}function cr(t){return typeof t=="number"?uA(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?uA(t.getTime()):Ot()}function uA(t){return t>9999999999?t/1e3:t}function tt(t){if(hA(t))return t.getSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(gA(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:mA(t),start_timestamp:cr(o),timestamp:cr(a)||void 0,status:uf(s),op:r[bt],origin:r[at],links:cf(l)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function Ca(t){if(hA(t))return t.getStreamedSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(gA(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:mA(t),start_timestamp:cr(o),end_timestamp:cr(a),is_segment:t===Gs(t),status:Ig(s),attributes:B0(r,s),links:U0(l)}}return{span_id:e,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:t===Gs(t)}}function mA(t){return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0}function Ag(t){return{...t,attributes:Di(t.attributes),links:t.links?.map(e=>({...e,attributes:Di(e.attributes)}))}}function gA(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function hA(t){return typeof t.getSpanJSON=="function"}function En(t){let{traceFlags:e}=t.spanContext();return e===lf}function uf(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"internal_error"}function Ig(t){return!t||t.code===1||t.code===0||t.message==="cancelled"?"ok":"error"}function B0(t,e){let n=Ig(e)==="error"?e?.message:void 0;return{...n&&{[ig]:n},...t}}var Hs="_sentryChildSpans",L0="_sentryRootSpan";function Ic(t,e){let n=t[L0]||t;Ht(e,L0,n),t[Hs]?t[Hs].add(e):Ht(t,Hs,new Set([e]))}function yA(t,e){t[Hs]&&t[Hs].delete(e)}function ii(t){let e=new Set;function n(r){if(!e.has(r)&&En(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 Pt=Gs;function Gs(t){return t[L0]||t}function Lt(){let t=Jn(),e=Jr(t);return e.getActiveSpan?e.getActiveSpan():Uo(nt())}function $s(){cA||(dn(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),cA=!0)}function kg(t,e){t.updateName(e),t.setAttributes({[Dt]:"custom",[zs]:e})}var bA=!1;function df(){if(bA)return;function t(){let e=Lt(),n=e&&Pt(e);if(n){let r="internal_error";z&&w.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}bA=!0,Vd(t),Yd(t)}function Me(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||B()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function _A(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(RB(n)){if(t.description&&ka(t.description,n))return z&&_A(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&&ka(t.description,n.name):!0,i=n.op?t.op&&ka(t.op,n.op):!0,a=n.attributes?Object.entries(n.attributes).every(([s,l])=>kB(t.attributes?.[s],l)):!0;if(o&&i&&a)return z&&_A(t),!0}return!1}function kB(t,e){return typeof t=="string"&&(typeof e=="string"||e instanceof RegExp)?ka(t,e):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t===e}function vA(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 RB(t){return typeof t=="string"||t instanceof RegExp}var SA=Symbol.for("sentry.nonRecordingSpan"),ur=class{constructor(e={}){this._traceId=e.traceId||Cn(),this._spanId=e.spanId||Hn(),this.dropReason=e.dropReason,Ht(this,SA,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:xg}}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[SA]===!0}var zo="production";var EA="_frozenDsc";function P0(t,e){Ht(t,EA,e)}function Rg(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:Tg(e)};return e.emit("createDsc",o),o}function Bi(t,e){let n=e.getPropagationContext();return n.dsc||Rg(n.traceId,t)}function $e(t){let e=B();if(!e)return{};let n=Pt(t),r=tt(n),o=r.data,i=n.spanContext().traceState,a=i?.get("sentry.sample_rate")??o[ni]??o[Ec];function s(m){return(typeof a=="number"||typeof a=="string")&&(m.sample_rate=`${a}`),m}let l=n[EA];if(l)return s(l);if(ai(n)&&!Me(e.getOptions())){let m=oi(n).scope;if(m)return s({...Bi(e,m)})}let c=i?.get("sentry.dsc"),d=c&&wc(c);if(d)return s(d);let u=Rg(t.spanContext().traceId,e),p=o[Dt]??o["sentry.span.source"],f=r.description;return p!=="url"&&f&&(u.transaction=f),Me()&&(u.sampled=String(En(n)),u.sample_rand=i?.get("sentry.sample_rand")??oi(n).scope?.getPropagationContext().sampleRand.toString()),s(u),e.emit("createDsc",u,n),u}function Ng(t){let e=$e(t);return Sg(e)}function z0(t){return Ht(t,"_streamed",!0),t}function Pi(t){return!!t&&typeof t=="function"&&"_streamed"in t&&!!t._streamed}function Oe(t,e=[]){return[t,e]}function ff(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 Cg(t){let e=Ta(Z);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function NB(t){let e=Ta(Z);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:[Cg(r),i]:r.push(typeof i=="string"?Cg(i):i)}for(let i of n){let[a,s]=i;if(o(`
|
|
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(le(s))}o(l)}}return typeof r=="string"?r:CB(r)}function CB(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 Mg(t){let e=typeof t=="string"?Cg(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(NB(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 Og(t){return[{type:"span"},t]}function Dg(t){let e=typeof t.data=="string"?Cg(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var TA={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 MB(t){return t in TA}function pf(t){return MB(t)?TA[t]:t}function Fo(t){if(!t?.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function kc(t,e,n,r){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date(Fn()).toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:rn(r)},...o&&{trace:o}}}function OB(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 wA(t,e,n,r){let o=Fo(n),i={sent_at:new Date(Fn()).toISOString(),...o&&{sdk:o},...!!r&&e&&{dsn:rn(e)}},a="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Oe(i,[a])}function xA(t,e,n,r){let o=Fo(n),i=t.type&&t.type!=="replay_event"?t.type:"event";OB(t,n?.sdk);let a=kc(t,o,r,e);return delete t.sdkProcessingMetadata,Oe(a,[[{type:i},t]])}function AA(t,e){function n(f){return!!f.trace_id&&!!f.public_key}let r=$e(t[0]),o=e?.getDsn(),i=e?.getOptions().tunnel,a={sent_at:new Date(Fn()).toISOString(),...n(r)&&{trace:r},...!!i&&o&&{dsn:rn(o)}},{beforeSendSpan:s,ignoreSpans:l}=e?.getOptions()||{},c=l?.length?t.filter(f=>{let m=tt(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=tt(f),_=Pi(s)?m:s(m);return _||($s(),m)}:tt,p=[];for(let f of c){let m=u(f);m&&p.push(Og(m))}return Oe(a,p)}function IA(t){if(!z)return;let{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=tt(t),{spanId:o}=t.spanContext(),i=En(t),a=Pt(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}=tt(a);c.push(`root ID: ${a.spanContext().spanId}`),d&&c.push(`root op: ${d}`),u&&c.push(`root description: ${u}`)}w.log(`${l}
|
|
16
|
+
${c.join(`
|
|
17
|
+
`)}`)}function kA(t){if(!z)return;let{description:e="< unknown name >",op:n="< unknown op >"}=tt(t),{spanId:r}=t.spanContext(),i=Pt(t)===t,a=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${e}" with ID ${r}`;w.log(a)}function qs(t,e,n,r=Lt()){let o=r&&Pt(r);o&&(z&&w.log(`[Measurement] Setting measurement on root span: ${t} = ${e} ${n}`),o.addEvent(t,{[Po]:e,[Bo]:n}))}function mf(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 RA=1e3,Ma=class{constructor(e={}){this._traceId=e.traceId||Cn(),this._spanId=e.spanId||Hn(),this._startTime=e.startTimestamp||Ot(),this._links=e.links,this._attributes={},this.setAttributes({[at]:"manual",[bt]: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?lf:xg}}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,iA(this)||this.setAttribute(Dt,"custom"),this}end(e){this._endTime||(this._endTime=cr(e),kA(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[bt],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:uf(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[at],profile_id:this._attributes[Fs],exclusive_time:this._attributes[$n],measurements:mf(this._events),is_segment:this._isStandaloneSpan&&Pt(this)===this||void 0,segment_id:this._isStandaloneSpan?Pt(this).spanContext().spanId:void 0,links:cf(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===Pt(this),status:Ig(this._status),attributes:B0(this._attributes,this._status),links:U0(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){z&&w.log("[Tracing] Adding an event to span:",e);let o=NA(n)?n:r||Ot(),i=NA(n)?{}:n||{},a={name:e,time:cr(o),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=B();if(e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Pt(this)))return;if(this._isStandaloneSpan){this._sampled?LB(AA([this],e)):(z&&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||nt()).captureEvent(r)}_convertSpanToTransaction(){if(!CA(tt(this)))return;this._name||(z&&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&&!DB(u)).map(u=>tt(u)).filter(CA),a=this._attributes[Dt];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:fA(this)},spans:i.length>RA?i.sort((u,p)=>u.start_timestamp-p.start_timestamp).slice(0,RA):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=mf(this._events);return c&&Object.keys(c).length&&(z&&w.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),l.measurements=c),l}};function NA(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function CA(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function DB(t){return t instanceof Ma&&t.isStandaloneSpan()}function LB(t){let e=B();if(!e)return;let n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function gf(t,e,n=()=>{},r=()=>{}){let o;try{o=t()}catch(i){throw e(i),n(),i}return UB(o,e,n,r)}function UB(t,e,n,r){return Nn(t)?rg(t,o=>{n(),r(o)},o=>{e(o),n()}):(n(),r(t),t)}function MA(t,e,n){if(!Me(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=Nr(o);if(i===void 0)return z&&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 z&&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||z&&w.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[a,i,r]}var hf="__SENTRY_SUPPRESS_TRACING__";function on(t,e){let n=Vs();if(n.startSpan)return n.startSpan(t,e);let r=G0(t),{forceTransaction:o,parentSpan:i,scope:a}=t,s=a?.clone();return Ce(s,()=>DA(i)(()=>{let c=nt(),d=$0(c,i),u=B(),f=t.onlyIfParent&&!d?F0(c,u):H0({parentSpan:d,spanArguments:r,forceTransaction:o,scope:c});return(!LA(f)||!d)&&Zn(c,f),gf(()=>e(f),()=>{let{status:m}=tt(f);f.isRecording()&&(!m||m==="ok")&&f.setStatus({code:2,message:"internal_error"})},()=>{f.end()})}))}function jn(t,e){let n=Vs();if(n.startSpanManual)return n.startSpanManual(t,e);let r=G0(t),{forceTransaction:o,parentSpan:i,scope:a}=t,s=a?.clone();return Ce(s,()=>DA(i)(()=>{let c=nt(),d=$0(c,i),p=t.onlyIfParent&&!d?F0(c,B()):H0({parentSpan:d,spanArguments:r,forceTransaction:o,scope:c});return(!LA(p)||!d)&&Zn(c,p),gf(()=>e(p,()=>p.end()),()=>{let{status:f}=tt(p);p.isRecording()&&(!f||f==="ok")&&p.setStatus({code:2,message:"internal_error"})})}))}function xe(t){let e=Vs();if(e.startInactiveSpan)return e.startInactiveSpan(t);let n=G0(t),{forceTransaction:r,parentSpan:o}=t;return(t.scope?a=>Ce(t.scope,a):o!==void 0?a=>Qr(o,a):a=>a())(()=>{let a=nt(),s=$0(a,o),l=B();return t.onlyIfParent&&!s?F0(a,l):H0({parentSpan:s,spanArguments:n,forceTransaction:r,scope:a})})}var Lg=(t,e)=>{let n=Jn(),r=Jr(n);if(r.continueTrace)return r.continueTrace(t,e);let{sentryTrace:o,baggage:i}=t,a=B(),s=wc(i);return a&&!D0(a,s?.org_id)?bf(e):Ce(l=>{let c=rf(o,i);return l.setPropagationContext(c),Zn(l,void 0),e()})};function Qr(t,e){let n=Vs();return n.withActiveSpan?n.withActiveSpan(t,e):Ce(r=>(Zn(r,t||void 0),e(r)))}function Rc(t){let e=Vs();return e.suppressTracing?e.suppressTracing(t):Ce(n=>{n.setSDKProcessingMetadata({[hf]:!0});let r=t();return n.setSDKProcessingMetadata({[hf]:void 0}),r})}function yf(t=nt()){let e=Vs();return e.isTracingSuppressed?e.isTracingSuppressed(t):t.getScopeData().sdkProcessingMetadata[hf]===!0}function bf(t){let e=Vs();return e.startNewTrace?e.startNewTrace(t):Ce(n=>(n.setPropagationContext({traceId:Cn(),sampleRand:ar()}),z&&w.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),Qr(null,t)))}function F0(t,e){e?.recordDroppedEvent("no_parent_span","span");let n=new ur({traceId:t.getPropagationContext().traceId});return Na(n,t,zt()),n}function H0({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){let o=zt();if(!Me()){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=B();if(PB(i,e)){yf(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=BB(t,r,e,o),Ic(t,a);else if(t){let s=$e(t),{traceId:l,spanId:c}=t.spanContext(),d=En(t);a=OA({traceId:l,parentSpanId:c,...e},r,o,d),P0(a,s)}else{let{traceId:s,dsc:l,parentSpanId:c,sampled:d}={...o.getPropagationContext(),...r.getPropagationContext()};a=OA({traceId:s,parentSpanId:c,...e},r,o,d),l&&P0(a,l)}return IA(a),a}function G0(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 Jr(t)}function OA(t,e,n,r){let o=B(),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=yf(e),[p,f,m]=u?[!1]:MA(i,{name:a,parentSampled:l,attributes:c,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:Nr(d.dsc?.sample_rate)},d.sampleRand),_=new Ma({...t,attributes:{[Dt]:"custom",[ni]:f!==void 0&&m?f:void 0,...c},sampled:p});return!p&&o&&!u&&(z&&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 BB(t,e,n,r){let{spanId:o,traceId:i}=t.spanContext(),a=yf(e),s=a?!1:En(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=B();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 $0(t,e){if(e)return e;if(e===null)return;let n=Uo(t);if(!n)return;let r=B();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Pt(n):n}function DA(t){return t!==void 0?e=>Qr(t,e):e=>e()}function PB(t,e){let n=t?.getOptions().ignoreSpans;return!t||!je(t)||!n?.length?!1:Ui({description:e.name||"",op:e.attributes?.[bt]||e.op,attributes:e.attributes},n)}function LA(t){return ai(t)&&t.dropReason==="ignored"}var Nc={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},zB="heartbeatFailed",FB="idleTimeout",HB="finalTimeout",GB="externalFinish";function Ug(t,e={}){let n=new Map,r=!1,o,i=GB,a=!e.disableAutoFinish,s=[],{idleTimeout:l=Nc.idleTimeout,finalTimeout:c=Nc.finalTimeout,childSpanTimeout:d=Nc.childSpanTimeout,beforeSpanEnd:u,trimIdleSpanEndTimestamp:p=!0}=e,f=B(),m=nt();if(!f||!Me()){let I=new ur({traceId:m.getPropagationContext().traceId});return Na(I,m,zt()),I}let _=Lt(),v=$B(t);v.end=new Proxy(v.end,{apply(I,L,P){if(u&&u(v),ai(L))return;let[U,...O]=P,N=U||Ot(),W=cr(N),X=ii(v).filter(Y=>Y!==v),pt=tt(v);if(!X.length||!p)return C(W),Reflect.apply(I,L,[W,...O]);let et=f.getOptions().ignoreSpans,lt=X?.reduce((Y,dt)=>{let K=tt(dt);return!K.timestamp||et&&Ui({description:K.description,op:K.op,attributes:K.data},et)?Y:Y?Math.max(Y,K.timestamp):K.timestamp},void 0),H=pt.start_timestamp,ct=Math.min(H?H+c/1e3:1/0,Math.max(H||-1/0,Math.min(W,lt||1/0)));return C(ct),Reflect.apply(I,L,[ct,...O])}});function h(){o&&(clearTimeout(o),o=void 0)}function b(I){h(),o=setTimeout(()=>{!r&&n.size===0&&a&&(i=FB,v.end(I))},l)}function S(I){o=setTimeout(()=>{!r&&a&&(i=zB,v.end(I))},d)}function E(I){h(),n.set(I,!0);let L=Ot();S(L+d/1e3)}function R(I){if(n.has(I)&&n.delete(I),n.size===0){let L=Ot();b(L+l/1e3)}}function C(I){r=!0,n.clear(),s.forEach(X=>X()),Zn(m,_);let L=tt(v),{start_timestamp:P}=L;if(!P)return;L.data[Li]||v.setAttribute(Li,i);let O=L.status;(!O||O==="unknown")&&v.setStatus({code:1}),w.log(`[Tracing] Idle span "${L.op}" finished`);let N=ii(v).filter(X=>X!==v),W=0;N.forEach(X=>{X.isRecording()&&(X.setStatus({code:2,message:"cancelled"}),X.end(I),z&&w.log("[Tracing] Cancelling span since span ended early",JSON.stringify(X,void 0,2)));let pt=tt(X),{timestamp:et=0,start_timestamp:lt=0}=pt,H=lt<=I,ct=(c+l)/1e3,Y=et-lt<=ct;if(z){let dt=JSON.stringify(X,void 0,2);H?Y||w.log("[Tracing] Discarding span since it finished after idle span final timeout",dt):w.log("[Tracing] Discarding span since it happened after idle span was finished",dt)}(!Y||!H)&&(yA(v,X),W++)}),W>0&&v.setAttribute("sentry.idle_span_discarded_spans",W)}return s.push(f.on("spanStart",I=>{if(r||I===v||tt(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,b(),n.size&&S())})),e.disableAutoFinish||b(),setTimeout(()=>{r||(v.setStatus({code:2,message:"deadline_exceeded"}),i=HB,v.end())},c),v}function $B(t){let e=xe(t);return Zn(nt(),e),z&&w.log("[Tracing] Started span is an idle span"),e}var jB=["addListener","on","once","prependListener","prependOnceListener","addEventListener"],qB=["removeListener","off","removeEventListener"],UA=Symbol("SentryScopeBoundListeners"),Cc;function VB(t){return Cc!==void 0&&(t===Cc||t.listener===Cc)}function j0(t,e=nt()){let n=t;if(Bg(n))return t;q0(n);for(let r of jB)typeof n[r]=="function"&&(n[r]=WB(n,n[r],e));for(let r of qB)typeof n[r]=="function"&&(n[r]=KB(n,n[r]));return typeof n.removeAllListeners=="function"&&(n.removeAllListeners=XB(n,n.removeAllListeners)),t}function YB(t,e){return function(...n){return Ce(e,()=>t.apply(this,n))}}function BA(t){return typeof t=="function"}function WB(t,e,n){return function(...r){let o=r[0],i=r[1],a=r.slice(2);if(!BA(i)||VB(i))return e.apply(this,r);let s=Bg(t)||q0(t),l=s.get(o);l||(l=new WeakMap,s.set(o,l));let c=l.get(i);c||(c=YB(i,n),l.set(i,c));let d=Cc;Cc=c;try{return e.call(this,o,c,...a)}finally{Cc=d}}}function KB(t,e){return function(...n){let r=n[0],o=n[1],i=n.slice(2),a=BA(o)?Bg(t)?.get(r)?.get(o):void 0;return a?e.call(this,r,a,...i):e.apply(this,n)}}function XB(t,e){return function(...n){let r=Bg(t);if(r)if(n.length===0)q0(t);else{let o=n[0];r.delete(o)}return e.apply(this,n)}}function q0(t){let e=new Map;return t[UA]=e,e}function Bg(t){return t[UA]}function zA(t,e){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=e;JB(t,e),r&&t4(t,r),e4(t,n),QB(t,o),ZB(t,i)}function PA(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;_f(t,"extra",n),_f(t,"tags",r),_f(t,"attributes",o),_f(t,"user",i),_f(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 _f(t,e,n){t[e]=Ra(t[e],n,1)}function si(t,e){let n=lr().getScopeData();return t&&PA(n,t.getScopeData()),e&&PA(n,e.getScopeData()),n}function JB(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 QB(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function ZB(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function t4(t,e){t.contexts={trace:xc(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:$e(e),...t.sdkProcessingMetadata};let n=Pt(e),r=tt(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function e4(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 FA(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 Pg(t,e){let n=Ca(t),r=Gs(t),o=Ca(r),{isolationScope:i,scope:a}=oi(t),s=si(i,a);o4(n,o,e,s);let l=t.kind;e.emit("preprocessSpan",n,{spanKind:l}),n.is_segment&&(n4(n,s),r4(n,e),e.emit("processSegmentSpan",n)),e.emit("processSpan",n);let{beforeSendSpan:c}=e.getOptions(),d=c&&Pi(c)?i4(n,c):n,u=d.attributes?.[Dt];return u&&Cr(d,{"sentry.span.source":u}),{...Ag(d),_segmentSpan:r}}function n4(t,e){let n=FA(e.contexts);Cr(t,n)}function Cr(t,e){let n=t.attributes??(t.attributes={});Object.entries(e).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}function r4(t,e){let n=e.getIntegrationNames();n.length&&Cr(t,{[fg]:n})}function o4(t,e,n,r){let o=n.getSdkMetadata(),{release:i,environment:a}=n.getOptions();Cr(t,{[ag]:i,[sg]:a||zo,[lg]:e.name,[cg]:e.span_id,[ug]:o?.sdk?.name,[dg]:o?.sdk?.version,[pg]:r.user?.id,[mg]:r.user?.email,[gg]:r.user?.ip_address,[hg]:r.user?.username,...r.attributes})}function i4(t,e){let n=e(t);return n||($s(),t)}var V0=0,HA=1,GA=2;function li(t){return new vf(e=>{e(t)})}function Ys(t){return new vf((e,n)=>{n(t)})}var vf=class t{constructor(e){this._state=V0,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===V0)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===HA&&n[1](this._value),this._state===GA&&n[2](this._value),n[0]=!0)})}_runExecutor(e){let n=(i,a)=>{if(this._state===V0){if(Nn(a)){a.then(r,o);return}this._state=i,this._value=a,this._executeHandlers()}},r=i=>{n(HA,i)},o=i=>{n(GA,i)};try{e(r,o)}catch(i){o(i)}}};function $A(t,e,n,r=0){try{let o=Y0(e,n,t,r);return Nn(o)?o:li(o)}catch(o){return Ys(o)}}function Y0(t,e,n,r){let o=n[r];if(!t||!o)return t;let i=o({...t},e);return z&&i===null&&w.log(`Event processor "${o.id||"?"}" dropped event`),Nn(i)?i.then(a=>Y0(a,e,n,r+1)):Y0(i,e,n,r+1)}var Ws,jA,qA,Oa;function zg(t){let e=Z._sentryDebugIds,n=Z._debugIds;if(!e&&!n)return{};let r=e?Object.keys(e):[],o=n?Object.keys(n):[];if(Oa&&r.length===jA&&o.length===qA)return Oa;jA=r.length,qA=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 W0(t,e){let n=zg(t);if(!n)return[];let r=[];for(let o of e){let i=U1(o);i&&n[i]&&r.push({type:"sourcemap",code_file:o,debug_id:n[i]})}return r}function Sf(t,e,n,r,o,i){let{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=t,l={...e,event_id:e.event_id||n.event_id||oe(),timestamp:e.timestamp||sr()},c=n.integrations||t.integrations.map(h=>h.name);a4(l,t),c4(l,c),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&s4(l,t.stackParser);let d=d4(r,n.captureContext);n.mechanism&&Sn(l,n.mechanism);let u=o?o.getEventProcessors():[],p=si(i,d),f=[...n.attachments||[],...p.attachments];f.length&&(n.attachments=f),zA(l,p);let m=[...u,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?li(l):$A(m,l,n)).then(h=>(h&&l4(h),typeof a=="number"&&a>0?u4(h,a,s):h))}function a4(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 s4(t,e){let n=zg(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function l4(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 c4(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function u4(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:le(o.data,e,n)}}))},...t.user&&{user:le(t.user,e,n)},...t.contexts&&{contexts:le(t.contexts,e,n)},...t.extra&&{extra:le(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=le(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>({...o,...o.data&&{data:le(o.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=le(t.contexts.flags,3,n)),r}function d4(t,e){if(!e)return t;let n=t?t.clone():new Gn;return n.update(e),n}function VA(t){if(t)return f4(t)?{captureContext:t}:m4(t)?{captureContext:t}:t}function f4(t){return t instanceof Gn||typeof t=="function"}var p4=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function m4(t){return Object.keys(t).some(e=>p4.includes(e))}function wt(t,e){return nt().captureException(t,VA(e))}function Da(t,e){let n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return nt().captureMessage(t,n,r)}function Zr(t,e){return nt().captureEvent(t,e)}function La(t,e){zt().setContext(t,e)}function Fg(t){zt().setExtras(t)}function Hg(t,e){zt().setExtra(t,e)}function Gg(t){zt().setTags(t)}function Mc(t,e){zt().setTag(t,e)}function $g(t){zt().setAttributes(t)}function jg(t,e){zt().setAttribute(t,e)}function qg(t){zt().setUser(t)}function Vg(t){zt().setConversationId(t)}function Oc(){return zt().lastEventId()}async function Yg(t){let e=B();return e?e.flush(t):(z&&w.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Wg(t){let e=B();return e?e.close(t):(z&&w.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function Kg(){return!!B()}function Dc(){let t=B();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function Lc(t){zt().addEventProcessor(t)}function Ks(t){let e=zt(),{user:n}=si(e,nt()),{userAgent:r}=Z.navigator||{},o=Y1({user:n,...r&&{userAgent:r},...t}),i=e.getSession();return i?.status==="ok"&&Oi(i,{status:"exited"}),Uc(),e.setSession(o),o}function Uc(){let t=zt(),n=nt().getSession()||t.getSession();n&&W1(n),YA(),t.setSession()}function YA(){let t=zt(),e=B(),n=t.getSession();n&&e&&e.captureSession(n)}function Ua(t=!1){if(t){Uc();return}YA()}function Ba(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}var WA="7";function KA(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function g4(t){return`${KA(t)}${t.projectId}/envelope/`}function h4(t,e){let n={sentry_version:WA};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function Ef(t,e,n){return e||`${g4(t)}?${h4(t,n)}`}function K0(t,e){let n=nf(t);if(!n)return"";let r=`${KA(n)}embed/error-page/`,o=`dsn=${rn(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 Xg=[];function y4(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 Jg(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 y4(r)}function XA(t,e){let n={};return e.forEach(r=>{r?.beforeSetup&&r.beforeSetup(t)}),e.forEach(r=>{r&&J0(t,r,n)}),n}function X0(t,e){for(let n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function J0(t,e,n){if(n[e.name]){z&&w.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!Xg.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),Xg.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))}),z&&w.log(`Integration installed: ${e.name}`)}function Xs(t){let e=B();if(!e){z&&w.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`);return}e.addIntegration(t)}var b4="sentry.timestamp.sequence",Q0=0,Z0;function Qg(t){let e=Math.floor(t*1e3);Z0!==void 0&&e!==Z0&&(Q0=0);let n=Q0;return Q0++,Z0=e,{key:b4,value:{value:n,type:"integer"}}}function Zg(t,e){return e?Ce(e,()=>{let n=Lt(),r=n?xc(n):Sc(e);return[n?$e(n):Bi(t,e),r]}):[void 0,void 0]}var JA={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function tv(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function ev(){return"npm"}function QA(){return!tv()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function qn(){return typeof window<"u"&&(!QA()||_4())}function _4(){return Z.process?.type==="renderer"}function v4(t,e){let n=e?"auto":"never";return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...qn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function ZA(t,e,n,r,o){let i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=rn(r)),Oe(i,[v4(t,o)])}var S4=100;function ci(t,e,n,r=!0){n&&(!t[e]||r)&&(t[e]=n)}function tI(t,e){let n=rv(),r=eI(t);r===void 0?n.set(t,[e]):r.length>=S4?(Js(t,r),n.set(t,[e])):n.set(t,[...r,e])}function Pa(t,e=nt(),n=tI){let r=e?.getClient()??B();if(!r){z&&w.warn("No client available to capture log.");return}let{release:o,environment:i,enableLogs:a=!1,beforeSendLog:s}=r.getOptions();if(!a){z&&w.warn("logging option not enabled, log will not be captured.");return}let[,l]=Zg(r,e),c={...t.attributes},{user:{id:d,email:u,username:p},attributes:f={}}=si(zt(),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 b=t.message;if(ei(b)){let{__sentry_template_string__:W,__sentry_template_values__:X=[]}=b;X?.length&&(c["sentry.message.template"]=W),X.forEach((pt,et)=>{c[`sentry.message.parameter.${et}`]=pt})}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?dn(()=>s(E)):E;if(!R){r.recordDroppedEvent("before_send","log_item",1),z&&w.warn("beforeSendLog returned null, log will not be captured.");return}let{level:C,message:I,attributes:L={},severityNumber:P}=R,U=Ot(),O=Qg(U),N={timestamp:U,level:C,body:nv(String(I)),trace_id:l?.trace_id,severity_number:P??JA[C],attributes:E4({...Di(f),...Di(L,!0),[O.key]:O.value})};n(r,N),r.emit("afterCaptureLog",R)}function Js(t,e){let n=e??eI(t)??[];if(n.length===0)return;let r=t.getOptions(),o=ZA(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);rv().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(o)}function eI(t){return rv().get(t)}function rv(){return Mo("clientToLogBufferMap",()=>new WeakMap)}function E4(t){let e={};for(let[n,r]of Object.entries(t)){let o=nv(n);r.type==="string"?e[o]={...r,value:nv(r.value)}:e[o]=r}return e}function nv(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 T4(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,...qn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function nI(t,e,n,r,o){let i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=rn(r)),Oe(i,[T4(t,o)])}var w4=1e3;function Fi(t,e,n,r=!0){n&&(r||!(e in t))&&(t[e]=n)}function rI(t,e){let n=iv(),r=oI(t);r===void 0?n.set(t,[e]):r.length>=w4?(Bc(t,r),n.set(t,[e])):n.set(t,[...r,e])}function x4(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 A4(t,e,n,r){let[,o]=Zg(e,n),i=Uo(n),a=i?i.spanContext().traceId:o?.trace_id,s=i?i.spanContext().spanId:void 0,l=Ot(),c=Qg(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 ov(t,e){let n=e?.scope??nt(),r=e?.captureSerializedMetric??rI,o=n?.getClient()??B();if(!o){z&&w.warn("No client available to capture metric.");return}let{_experiments:i,enableMetrics:a,beforeSendMetric:s}=o.getOptions();if(!(a??i?.enableMetrics??!0)){z&&w.warn("metrics option not enabled, metric will not be captured.");return}let{user:c,attributes:d}=si(zt(),n),u=x4(t,o,c);o.emit("processMetric",u);let p=s||i?.beforeSendMetric,f=p?p(u):u;if(!f){z&&w.log("`beforeSendMetric` returned `null`, will not send metric.");return}let m=A4(f,o,n,d);z&&w.log("[Metric]",m),r(o,m),o.emit("afterCaptureMetric",f)}function Bc(t,e){let n=e??oI(t)??[];if(n.length===0)return;let r=t.getOptions(),o=nI(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);iv().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(o)}function oI(t){return iv().get(t)}function iv(){return Mo("clientToMetricBufferMap",()=>new WeakMap)}function iI(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 Ag(e)}function aI(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(iI(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,...qn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}var Pc=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(Pc);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 sI=60*1e3;function th(t,e=Fn()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?sI:r-e}function lI(t,e){return t[e]||t.all||0}function Tf(t,e,n=Fn()){return lI(t,e)>n}function wf(t,{statusCode:e,headers:n},r=Fn()){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+th(a,r):e===429&&(o.all=r+60*1e3);return o}var av=64;function xf(t,e,n=Qs(t.bufferSize||av)){let r={},o=a=>n.drain(a);function i(a){let s=[];if(dr(a,(u,p)=>{let f=pf(p);Tf(r,f)?t.recordDroppedEvent("ratelimit_backoff",f):s.push(u)}),s.length===0)return Promise.resolve({});let l=Oe(a[0],s),c=u=>{if(js(l,["client_report"])){z&&w.warn(`Dropping client report. Will not send outcomes (reason: ${u}).`);return}dr(l,(p,f)=>{t.recordDroppedEvent(u,pf(f))})},d=()=>e({body:zi(l)}).then(u=>u.statusCode===413?(z&&w.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),u):(z&&u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&w.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),r=wf(r,u),u),u=>{throw c("network_error"),z&&w.error("Encountered error running transport request:",u),u});return n.add(d).then(u=>u,u=>{if(u===Pc)return z&&w.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw u})}return{send:i,flush:o}}function cI(t,e,n){let r=[{type:"client_report"},{timestamp:n||sr(),discarded_events:t}];return Oe(e?{dsn:e}:{},[r])}function eh(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 uI(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?.[$n],measurements:t.measurements,is_segment:!0}}function dI(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&&{[$n]:t.exclusive_time}}}},measurements:t.measurements}}var Zs="[Filtered]",Af=["forwarded","-ip","remote-","via","-user"],sv=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],fI=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function pI(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:Af},httpHeaders:{request:{deny:Af},response:{deny:Af}},httpBodies:[],queryParams:{deny:Af},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:7}}var I4={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 mI(t){let e=t.dataCollection!=null?I4:pI(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 gI="Not capturing exception because it's already been captured.",hI="Discarded session because of missing or non-string release",EI=Symbol.for("SentryInternalError"),TI=Symbol.for("SentryDoNotSendEventError"),k4=5e3;function nh(t){return{message:t,[EI]:!0}}function lv(t){return{message:t,[TI]:!0}}function yI(t){return!!t&&typeof t=="object"&&EI in t}function bI(t){return!!t&&typeof t=="object"&&TI in t}function _I(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??k4;c>0&&(s=!0,a=Ba(setTimeout(()=>{o(t)},c)))}}),t.on("flush",()=>{o(t)})}var If=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Qs(e.transportOptions?.bufferSize??av),this._dataCollection=mI(e),e.dsn?this._dsn=nf(e.dsn):z&&w.warn("No DSN provided, client will not send events."),this._dsn){let r=Ef(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&&_I(this,"afterCaptureLog","flushLogs",M4,Js),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&_I(this,"afterCaptureMetric","flushMetrics",C4,Bc)}captureException(e,n,r){let o=oe();if(Zd(e))return z&&w.log(gI),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:oe(),...r},a=ei(e)?e:String(e),s=en(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=oe();if(n?.originalException&&Zd(n.originalException))return z&&w.log(gI),o;let i={event_id:o,...n},a=e.sdkProcessingMetadata||{},s=a.capturedSpanScope,l=a.capturedSpanIsolationScope,c=vI(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),J0(this,e,this._integrations),n||X0(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=aI(e,this),o=xA(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=ff(o,Dg(i));r&&(o=ff(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){z&&w.warn(hI);return}i.release=i.release||n,i.environment=i.environment||r,e.attrs=i}else{if(!e.release&&!n){z&&w.warn(hI);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);let o=wA(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}`;z&&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 z&&w.error("Error while sending envelope:",n),{}}return z&&w.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=XA(this,e),X0(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),Sf(i,e,n,r,this,o).then(s=>{if(s===null)return s;this.emit("postprocessEvent",s,n),s.contexts={trace:{...s.contexts?.trace,...Sc(r)},...s.contexts};let l=Bi(this,r);return s.sdkProcessingMetadata={dynamicSamplingContext:l,...s.sdkProcessingMetadata},s})}_captureEvent(e,n={},r=nt(),o=zt()){return z&&cv(e)&&w.log(`Captured error event \`${eh(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,o).then(i=>i.event_id,i=>{z&&(bI(i)?w.log(i.message):yI(i)?w.warn(i.message):w.warn(i))})}_processEvent(e,n,r,o){let i=this.getOptions(),{sampleRate:a}=i,s=wI(e),l=cv(e),d=`before send for type \`${e.type||"error"}\``,u=typeof a>"u"?void 0:Nr(a);if(l&&typeof u=="number"&&ar()>u)return this.recordDroppedEvent("sample_rate","error"),Ys(lv(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let p=vI(e.type);return this._prepareEvent(e,n,r,o).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",p),lv("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return f;let _=N4(this,i,f,n);return R4(_,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 lv(`${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,b=v-h;b>0&&this.recordDroppedEvent("before_send","span",b)}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 bI(f)||yI(f)?f:(this.captureException(f,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:f}),nh(`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===Pc&&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(){z&&w.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){z&&w.log("No outcomes to send");return}if(!this._dsn){z&&w.log("No dsn provided, will not send outcomes");return}z&&w.log("Sending outcomes:",e);let n=cI(e,this._options.tunnel&&rn(this._dsn));this.sendEnvelope(n)}};function vI(t){return t==="replay_event"?"replay":t||"error"}function R4(t,e){let n=`${e} must return \`null\` or a valid event.`;if(Nn(t))return t.then(r=>{if(!ge(r)&&r!==null)throw nh(n);return r},r=>{throw nh(`${e} rejected with ${r}`)});if(!ge(t)&&t!==null)throw nh(n);return t}function N4(t,e,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:a}=e,s=!Pi(e.beforeSendSpan)&&e.beforeSendSpan,l=n;if(cv(l)&&o)return o(l,r);if(wI(l)){if(s||a){let c=uI(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,dI(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)){vA(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 cv(t){return t.type===void 0}function wI(t){return t.type==="transaction"}function C4(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+xI(t.attributes)}function M4(t){let e=0;return t.message&&(e+=t.message.length*2),e+xI(t.attributes)}function xI(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*SI(n[0]):en(n)?e+=SI(n):e+=100}),e}function SI(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function uv(t,e){e.debug===!0&&(z?w.enable():dn(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),nt().update(e.initialScope);let r=new t(e);return rh(r),r.init(),r}function rh(t){nt().setClient(t)}var dv=100,fv=5e3,O4=36e5;function pv(t){function e(...n){z&&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=fv,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(Fn()).toISOString(),d(p,!0).catch(f=>{e("Failed to retry sending",f)}))},u))}function c(){a||(l(i),i=Math.min(i*2,O4))}async function d(u,p=!1){if(!p&&js(u,["replay_event","replay_recording"]))return await o.push(u),l(dv),{};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=dv;if(f){if(f.headers?.["retry-after"])m=th(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=fv,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=fv,l(dv)),r.flush(u))}}}var zc="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function AI(t,e){let n;return dr(t,(r,o)=>(e.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function D4(t,e){return n=>{let r=t(n);return{...r,send:async o=>{let i=AI(o,["event","transaction","profile","replay_event"]);return i&&(i.release=e),r.send(o)}}}}function L4(t,e){return Oe(e?{...t[0],dsn:e}:t[0],t[1])}function mv(t,e){return n=>{let r=t(n),o=new Map,i=e||(c=>{let d=c.getEvent();return d?.extra?.[zc]&&Array.isArray(d.extra[zc])?d.extra[zc]:[]});function a(c,d){let u=d?`${c}:${d}`:c,p=o.get(u);if(!p){let f=Eg(c);if(!f)return;let m=Ef(f,n.tunnel);p=d?D4(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 AI(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(L4(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 gv(t,e){return e.some(n=>t.includes(n))}function za(t,e,n){if(e===!1)return{};let r=n!=null?[...sv,...n]:sv,o={};if(e===!0){for(let a of Object.keys(t))o[a]=gv(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=gv(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(gv(s,r))o[a]=Zs;else{let l=i.some(c=>s.includes(c));o[a]=l?t[a]:Zs}}return o}function II(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 kf(t,e){if(e===!1)return{};try{let n=II(t);return Object.keys(n).length===0?{}:za(n,e,fI)}catch{return Zs}}var U4="thismessage:/";function tl(t){return"isRelative"in t}function ui(t,e){let n=t.indexOf("://")<=0&&t.indexOf("//")!==0,r=e??(n?U4: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 Fc(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 to(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 Hc(t){return t.split(/[?#]/,1)[0]}function Vn(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 Gc(t,e){let n=e?.getDsn(),r=e?.getOptions().tunnel;return P4(t,n)||B4(t,r)}function B4(t,e){return e?kI(t)===kI(e):!1}function P4(t,e){let n=ui(t);return!n||tl(n)||!e?!1:z4(n.hostname,e.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function z4(t,e){return t===e||e.length>0&&t.endsWith(`.${e}`)}function kI(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function oh(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 hv=oh;function yv(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 Rf(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||B();if(!Dc()||!e)return{};let n=Jn(),r=Jr(n);if(r.getTraceData)return r.getTraceData(t);let o=t.scope||nt(),i=t.span||Lt(),a=ai(i)&&!Me(e.getOptions());if(!i&&og())return{};let s=i&&!a?Ac(i):F4(o),l=i?$e(i):Bi(e,o),c=Sg(l);if(!wg.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?pA(i):H4(o)),u}function F4(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return of(e,r,n)}function H4(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return af(e,r,n)}function bv(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 G4=100;function Tn(t,e){let n=B(),r=zt();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=G4}=n.getOptions();if(i<=0)return;let s={timestamp:sr(),...t},l=o?dn(()=>o(s,e)):s;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,e),r.addBreadcrumb(l,i))}var RI,$4="FunctionToString",NI=new WeakMap,j4=(()=>({name:$4,setupOnce(){RI=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=Aa(this),n=NI.has(B())&&e!==void 0?e:this;return RI.apply(n,t)}}catch{}},setup(t){NI.set(t,!0)}})),Nf=j4;var q4=[/^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$/],V4="EventFilters",ah=(t={})=>{let e;return{name:V4,setup(n){let r=n.getOptions();e=CI(t,r)},processEvent(n,r,o){if(!e){let i=o.getOptions();e=CI(t,i)}return Y4(n,e)?null:n}}},Cf=((t={})=>({...ah(t),name:"InboundFilters"}));function CI(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:q4],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function Y4(t,e){if(t.type){if(t.type==="transaction"&&K4(t,e.ignoreTransactions))return z&&w.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
19
|
+
Event: ${Lo(t)}`),!0}else{if(W4(t,e.ignoreErrors))return z&&w.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
20
|
+
Event: ${Lo(t)}`),!0;if(Z4(t))return z&&w.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
21
|
+
Event: ${Lo(t)}`),!0;if(X4(t,e.denyUrls))return z&&w.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
22
|
+
Event: ${Lo(t)}.
|
|
23
|
+
Url: ${ih(t)}`),!0;if(!J4(t,e.allowUrls))return z&&w.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
24
|
+
Event: ${Lo(t)}.
|
|
25
|
+
Url: ${ih(t)}`),!0}return!1}function W4(t,e){return e?.length?eh(t).some(n=>nn(n,e)):!1}function K4(t,e){if(!e?.length)return!1;let n=t.transaction;return n?nn(n,e):!1}function X4(t,e){if(!e?.length)return!1;let n=ih(t);return n?nn(n,e):!1}function J4(t,e){if(!e?.length)return!0;let n=ih(t);return n?nn(n,e):!0}function Q4(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 ih(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Q4(n):null}catch{return z&&w.error(`Cannot extract url for event ${Lo(t)}`),null}}function Z4(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function vv(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=_v(t,e,r,i.originalException,n,o.exception.values,a,0))}function _v(t,e,n,r,o,i,a,s){if(i.length>=n+1)return i;let l=[...i];if(Oo(r[o],Error)){MI(a,s,r);let c=t(e,r[o]),d=l.length;OI(c,o,d,s),l=_v(t,e,n,r[o],o,[c,...l],c,d)}return DI(r)&&r.errors.forEach((c,d)=>{if(Oo(c,Error)){MI(a,s,r);let u=t(e,c),p=l.length;OI(u,`errors[${d}]`,p,s),l=_v(t,e,n,c,o,[u,...l],u,p)}}),l}function DI(t){return Array.isArray(t.errors)}function MI(t,e,n){t.mechanism={handled:!0,type:"auto.core.linked_errors",...DI(n)&&{is_exception_group:!0},...t.mechanism,exception_id:e}}function OI(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function tP(t){return fn(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function sh(t){return tP(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}var UI=new Map,LI=new Set;function eP(t){if(Z._sentryModuleMetadata)for(let e of Object.keys(Z._sentryModuleMetadata)){let n=Z._sentryModuleMetadata[e];if(LI.has(e))continue;LI.add(e);let r=t(e);for(let o of r.reverse())if(o.filename){UI.set(o.filename,n);break}}}function nP(t,e){return eP(t),UI.get(e)}function lh(t,e){e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(r=>{if(!r.filename||r.module_metadata)return;let o=nP(t,r.filename);o&&(r.module_metadata=o)})})}function ch(t){t.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(n=>{delete n.module_metadata})})}var Sv=()=>({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&&(ch(o),n[1]=o)}})}),t.on("applyFrameMetadata",e=>{if(e.type)return;let n=t.getOptions().stackParser;lh(n,e)})}});var BI=new Set([]);function nl(t){let e="console",n=Pn(e,t);return zn(e,rP),n}function rP(){"console"in Z&&wa.forEach(function(t){t in Z.console&&he(Z.console,t,function(e){return Ls[t]=e,function(...n){let r=n[0],o=Ls[t],i=BI.size&&typeof r=="string"&&nn(r,BI);i||tn("console",{args:n,level:t}),(!i||z&&w.isEnabled())&&o?.apply(Z.console,n)}})})}function Hi(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var oP="CaptureConsole",iP=((t={})=>{let e=t.levels||wa,n=t.handled??!0;return{name:oP,setup(r){"console"in Z&&nl(({args:o,level:i})=>{B()!==r||!e.includes(i)||aP(o,i,n)})}}}),Ev=iP;function aP(t,e,n){let r=Hi(e),o=new Error,i={level:Hi(e),extra:{arguments:t}};Ce(a=>{if(a.addEventProcessor(c=>(c.logger="console",Sn(c,{handled:n,type:"auto.core.capture_console"}),c)),e==="assert"){if(!t[0]){let c=`Assertion failed: ${Ia(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){wt(s,i);return}let l=Ia(t," ");a.captureMessage(l,r,{captureContext:i,syntheticException:o})})}var sP="Dedupe",lP=(()=>{let t;return{name:sP,processEvent(e){if(e.type)return e;try{if(cP(e,t))return z&&w.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}}),Mf=lP;function cP(t,e){return e?!!(uP(t,e)||dP(t,e)):!1}function uP(t,e){let n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!FI(t,e)||!zI(t,e))}function dP(t,e){let n=PI(e),r=PI(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!FI(t,e)||!zI(t,e))}function zI(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 FI(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 PI(t){return t.exception?.values?.[0]}var fP="ExtraErrorData",pP=((t={})=>{let{depth:e=3,captureErrorCause:n=!0}=t;return{name:fP,processEvent(r,o,i){let{maxValueLength:a}=i.getOptions();return mP(r,o,e,n,a)}}}),Tv=pP;function mP(t,e={},n,r,o){if(!e.originalException||!fn(e.originalException))return t;let i=e.originalException.name||e.originalException.constructor.name,a=HI(e.originalException,r,o);if(a){let s={...t.contexts},l=le(a,n);return ge(l)&&(E0(l),s[i]=l),{...t,contexts:s}}return t}function HI(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]=fn(a)||typeof a=="string"?n?Do(`${a}`,n):`${a}`:a}if(e&&t.cause!==void 0)if(fn(t.cause)){let i=t.cause.name||t.cause.constructor.name;o.cause={[i]:HI(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]=fn(s)?s.toString():s}}return o}catch(r){z&&w.error("Unable to extract extra data from the Error object:",r)}return null}function gP(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 hP=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function yP(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=hP.exec(e);return n?n.slice(1):[]}function GI(...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=gP(e.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+e||"."}function $I(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 jI(t,e){t=GI(t).slice(1),e=GI(e).slice(1);let n=$I(t.split("/")),r=$I(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 qI(t,e){let n=yP(t)[2]||"";return e&&n.slice(e.length*-1)===e&&(n=n.slice(0,n.length-e.length)),n}var bP="RewriteFrames",wv=(t={})=>{let e=t.root,n=t.prefix||"app:///",r="window"in Z&&!!Z.window,o=t.iteratee||_P({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:bP,processEvent(s){let l=s;return s.exception&&Array.isArray(s.exception.values)&&(l=i(l)),l}}};function _P({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?jI(e,a):qI(a);r.filename=`${n}${s}`}return r}}var vP=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],SP=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],EP={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"},YI=["select","insert","upsert","update","delete"];function uh(t){try{t.__SENTRY_INSTRUMENTED__=!0}catch{}}function dh(t){try{return t.__SENTRY_INSTRUMENTED__}catch{return!1}}function WI(t,e){if(Object.keys(e).length>0)return e;if(Array.isArray(t)&&t.length>0)return t}function TP(t,e){return WI(t,e)!==void 0}function wP(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 xP(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&&EP[n]||"filter",`${o}(${t}, ${r.join(".")})`}function VI(t,e=!1){return new Proxy(t,{apply(n,r,o){return on({name:`auth ${e?"(admin) ":""}${t.name}`,attributes:{[at]:"auto.db.supabase",[bt]:"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}),wt(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(),wt(a,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),a}).then(...o))}})}function AP(t){let e=t.auth;if(!(!e||dh(t.auth))){for(let n of vP){let r=e[n];r&&typeof t.auth[n]=="function"&&(t.auth[n]=VI(r))}for(let n of SP){let r=e.admin[n];r&&typeof t.auth.admin[n]=="function"&&(t.auth.admin[n]=VI(r,!0))}uh(t.auth)}}function IP(t,e){dh(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 RP(a,e),i}}),uh(t.prototype.from))}function kP(t,e){dh(t.prototype.then)||(t.prototype.then=new Proxy(t.prototype.then,{apply(n,r,o){let i=YI,a=r,s=wP(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(xP(E,R));let u=Object.create(null);if(ge(a.body))for(let[E,R]of Object.entries(a.body))u[E]=R;let p=B(),f=e.sendOperationData??p?.getDataCollectionOptions().userInfo===!0,m=WI(a.body,u),_=s==="select"?"":`${s}${TP(a.body,u)?"(...) ":""}`,v=f?d.join(" "):d.length>0?"[redacted]":"",h=[_.trimEnd(),v].filter(Boolean).join(" "),b=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",[bt]:"db"};return d.length&&f&&(S["db.query"]=d),m!==void 0&&f&&(S["db.body"]=m),on({name:b,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 P={};d.length&&f&&(P.query=d),m!==void 0&&f&&(P.body=m),wt(L,U=>(U.addEventProcessor(O=>(Sn(O,{handled:!1,type:"auto.db.supabase.postgres"}),O)),U.setContext("supabase",P),U))}let C={type:"supabase",category:`db.${s}`,message:b},I={};return d.length&&f&&(I.query=d),m!==void 0&&f&&(I.body=m),Object.keys(I).length&&(C.data=I),Tn(C),R},R=>{throw E&&(ri(E,500),E.end()),R}).then(...o))}}),uh(t.prototype.then))}function RP(t,e){for(let n of YI)dh(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 z&&w.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),kP(s,e),a}}),uh(t.prototype[n]))}var fh=(t,e={})=>{if(!t){z&&w.warn("Supabase integration was not installed because no Supabase client was provided.");return}let n=t.constructor===Function?t:t.constructor;IP(n,e),AP(t)},NP="Supabase",CP=((t,e)=>({setupOnce(){fh(t,e)},name:NP})),xv=t=>CP(t.supabaseClient,{sendOperationData:t.sendOperationData});var MP=10,OP="ZodErrors";function DP(t){return fn(t)&&t.name==="ZodError"&&Array.isArray(t.issues)}function LP(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 UP(t){return t.map(e=>typeof e=="number"?"<array>":e).join(".")}function BP(t){let e=new Set;for(let r of t.issues){let o=UP(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 PP(t,e=!1,n,r){if(!n.exception?.values||!r.originalException||!DP(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(e?r.originalException.issues:r.originalException.issues.slice(0,t)).map(LP);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:BP(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 zP=((t={})=>{let e=t.limit??MP;return{name:OP,processEvent(n,r){return PP(e,t.saveZodIssuesAsAttachment,n,r)}}}),Av=zP;var Iv=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&&(ch(i),r[1]=i)}})}),e.on("applyFrameMetadata",n=>{if(n.type)return;let r=e.getOptions().stackParser;lh(r,n)})},preprocessEvent(e){t.ignoreSentryInternalFrames&&(Z._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=HP(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 FP(t,e,n){if(e!==0)return!1;if(n&&GP(t)||t.function==="sentryWrapped")return!0;if(!t.context_line||!t.filename||!t.filename.includes("sentry")||!t.filename.includes("helpers")||!t.context_line.includes(jP))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($P))return!0}return!1}function HP(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||!FP(o,i,!!n)).map(o=>o.module_metadata?Object.keys(o.module_metadata).filter(i=>i.startsWith(KI)).map(i=>i.slice(KI.length)):[])}function GP(t){return!t.context_line&&!t.pre_context&&!!t.function&&t.function.length<=2}var KI="_sentryBundlerPluginAppKey:",$P="Attempt to invoke user-land function",jP="fn.apply(this, wrappedArguments)";var XI=100,JI=10,ph="flag.evaluation.";function Mr(t){if(t.type)return t;let n=nt().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=XI){let r=nt().getScopeData().contexts;r.flags||(r.flags={values:[]});let o=r.flags.values;qP(o,t,e,n)}function qP(t,e,n,r){if(typeof n!="boolean")return;if(t.length>r){z&&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=JI){if(typeof e!="boolean")return;let r=Lt();if(!r)return;let o=tt(r).data;if(`${ph}${t}`in o){r.setAttribute(`${ph}${t}`,e);return}Object.keys(o).filter(a=>a.startsWith(ph)).length<n&&r.setAttribute(`${ph}${t}`,e)}var kv=()=>({name:"FeatureFlags",processEvent(t,e,n){return Mr(t)},addFeatureFlag(t,e){fr(t,e),pr(t,e)}});var Rv=({growthbookClass:t})=>({name:"GrowthBook",setupOnce(){let e=t.prototype;typeof e.isOn=="function"&&he(e,"isOn",QI),typeof e.getFeatureValue=="function"&&he(e,"getFeatureValue",QI)},processEvent(e,n,r){return Mr(e)}});function QI(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 VP="ConversationId",YP=(()=>({name:VP,setup(t){t.on("spanStart",e=>{let n=nt().getScopeData(),r=zt().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:a,description:s}=tt(e);if(!i?.startsWith("gen_ai.")&&!a["ai.operationId"]&&!s?.startsWith("ai."))return;e.setAttribute(_g,o)}})}})),Nv=YP;function Cv(t,e,n,r,o){if(!t.fetchData)return;let{method:i,url:a}=t.fetchData,s=Me()&&e(a);if(t.endTimestamp){let m=t.fetchData.__span;if(!m)return;let _=r[m];_&&(s&&(KP(_,t),WP(_,t,o)),delete r[m]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},d=B(),p=!!Lt()||!!d&&je(d),f=s&&p?xe(QP(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=tk(m,_,Me()&&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 WP(t,e,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(t,{headers:e.response?.headers,error:e.error})}function tk(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||(Kd(t)?t.headers:void 0);if(l)if(XP(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?mh(d)||c.set("baggage",`${d},${a}`):c.set("baggage",a)}return c}else if(JP(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"&&mh(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(_=>mh(_)):mh(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 KP(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 mh(t){return typeof t!="string"?!1:t.split(",").some(e=>e.trim().startsWith(ef))}function XP(t){return typeof Headers<"u"&&Oo(t,Headers)}function JP(t){return Array.isArray(t)?t.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string"):!1}function QP(t,e,n){if(t.startsWith("data:")){let i=Vn(t);return{name:`${e} ${i}`,attributes:ZI(t,void 0,e,n)}}let r=ui(t),o=r?Fc(r):t;return{name:`${e} ${o}`,attributes:ZI(t,r,e,n)}}function ZI(t,e,n,r){let o={url:Vn(t),type:"fetch","http.method":n,[at]:r,[bt]:"http.client"};return e&&(tl(e)||(o["http.url"]=Vn(e.href),o["server.address"]=e.host),e.search&&(o["http.query"]=e.search),e.hash&&(o["http.fragment"]=e.hash)),o}function $c(t,e={},n=nt()){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()||B();return u&&u.emit("beforeSendFeedback",d,e),n.captureEvent(d,e)}var gh={};g0(gh,{debug:()=>t8,error:()=>r8,fatal:()=>o8,fmt:()=>hv,info:()=>e8,trace:()=>ZP,warn:()=>n8});function jc(t,e,n,r,o){Pa({level:t,message:e,attributes:n,severityNumber:o},r)}function ZP(t,e,{scope:n}={}){jc("trace",t,e,n)}function t8(t,e,{scope:n}={}){jc("debug",t,e,n)}function e8(t,e,{scope:n}={}){jc("info",t,e,n)}function n8(t,e,{scope:n}={}){jc("warn",t,e,n)}function r8(t,e,{scope:n}={}){jc("error",t,e,n)}function o8(t,e,{scope:n}={}){jc("fatal",t,e,n)}function qc(t,e,n){return"util"in Z&&typeof Z.util.format=="function"?Z.util.format(...t):i8(t,e,n)}function i8(t,e,n){return t.map(r=>en(r)?String(r):JSON.stringify(le(r,e,n))).join(" ")}function hh(t){return/%[sdifocO]/.test(t)}function yh(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 a8="ConsoleLogs",ek={[at]:"auto.log.console"},s8=((t={})=>{let e=t.levels||wa;return{name:a8,setup(n){let{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){z&&w.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let a=nl(({args:s,level:l})=>{if(B()!==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: ${qc(d,o,i)}`:"Assertion failed";Pa({level:"error",message:f,attributes:ek})}return}let u=l==="log",p={...ek};if(ge(c)){Object.assign(p,le(c,o,i));let f=typeof s[1]=="string"?2:1;s.slice(f).forEach((_,v)=>{p[`sentry.message.parameter.${v}`]=le(_,o,i)})}else if(d.length>0&&typeof c=="string"&&!hh(c)){let m=yh(c,d);for(let[_,v]of Object.entries(m))p[_]=_.startsWith("sentry.message.parameter.")?le(v,o,i):v}Pa({level:u?"info":l,message:qc(s,o,i),severityNumber:u?10:void 0,attributes:p})});n.registerCleanup(a)}}}),Mv=s8;var Fa={};g0(Fa,{count:()=>l8,distribution:()=>u8,gauge:()=>c8});function Ov(t,e,n,r){ov({type:t,name:e,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function l8(t,e=1,n){Ov("counter",t,e,n)}function c8(t,e,n){Ov("gauge",t,e,n)}function u8(t,e,n){Ov("distribution",t,e,n)}var d8=["trace","debug","info","warn","error","fatal"];function Dv(t={}){let e=new Set(t.levels??d8),n=t.client;return{log(r){let{type:o,level:i,message:a,args:s,tag:l,date:c,...d}=r,u=n||B();if(!u)return;let p=m8(o,i);if(!e.has(p))return;let{normalizeDepth:f=3,normalizeMaxBreadth:m=1e3}=u.getOptions(),_={};for(let[h,b]of Object.entries(d))_[h]=le(b,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=h8(g8(s,f,m),f,m);v?.attributes&&Object.assign(_,v.attributes),Pa({level:p,message:v?.message||a||s&&qc(s,f,m)||"",attributes:_})}}}var f8={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"},p8={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function m8(t,e){if(t==="verbose")return"debug";if(t==="silent")return"trace";if(t){let n=f8[t];if(n)return n}if(typeof e=="number"){let n=p8[e];if(n)return n}return"info"}function g8(t,e,n){if(!t?.length)return{message:""};let r=qc(t,e,n),o=t[0];if(ge(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"&&!hh(o);return{message:r,messageTemplate:a?o:void 0,messageParameters:a?i:void 0}}}function h8(t,e,n){let{message:r,attributes:o,messageTemplate:i,messageParameters:a}=t,s={};if(i&&a){let l=yh(i,a);for(let[c,d]of Object.entries(l))s[c]=c.startsWith("sentry.message.parameter.")?le(d,e,n):d}else a&&a.length>0&&a.forEach((l,c)=>{s[`sentry.message.parameter.${c}`]=le(l,e,n)});return{message:r,attributes:{...le(o,e,n),...s}}}var nk="gen_ai.prompt",di="gen_ai.system",Ae="gen_ai.request.model",Vc="gen_ai.request.stream",Ha="gen_ai.request.temperature",Yc="gen_ai.request.max_tokens",Ga="gen_ai.request.frequency_penalty",Wc="gen_ai.request.presence_penalty",$a="gen_ai.request.top_p",bh="gen_ai.request.top_k",_h="gen_ai.request.encoding_format",vh="gen_ai.request.dimensions",fi="gen_ai.response.finish_reasons",eo="gen_ai.response.model",ja="gen_ai.response.id",rk="gen_ai.response.stop_reason",no="gen_ai.usage.input_tokens",ro="gen_ai.usage.output_tokens",Or="gen_ai.usage.total_tokens",mn="gen_ai.operation.name",oo="sentry.sdk_meta.gen_ai.input.messages.original_length",Ho="gen_ai.input.messages";var pi="gen_ai.system_instructions",Yn="gen_ai.response.text",mi="gen_ai.request.available_tools",ok="gen_ai.response.streaming",mr="gen_ai.response.tool_calls",rl="gen_ai.agent.name",ik="gen_ai.pipeline.name",Of="gen_ai.conversation.id",ak="gen_ai.usage.cache_creation_input_tokens",sk="gen_ai.usage.cache_read_input_tokens";var lk="gen_ai.invoke_agent",Kc="gen_ai.embeddings.input",Lv="gen_ai.embeddings",Uv="gen_ai.execute_tool",Sh="gen_ai.tool.name",ck="gen_ai.tool.call.id",uk="gen_ai.tool.type",Eh="gen_ai.tool.input",Th="gen_ai.tool.output",dk="gen_ai.tool.description";function qa(t){return!t||typeof t!="object"?!1:b8(t)||pk(t)||y8(t)||mk(t)||gk(t)||_8(t)||v8(t)||S8(t)||E8(t)||T8(t)||w8(t)||x8(t)}function y8(t){return"image_url"in t?typeof t.image_url=="string"?t.image_url.startsWith("data:"):fk(t):!1}function fk(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 b8(t){return"type"in t&&typeof t.type=="string"&&"source"in t&&qa(t.source)}function pk(t){return"inlineData"in t&&!!t.inlineData&&typeof t.inlineData=="object"&&"data"in t.inlineData&&typeof t.inlineData.data=="string"}function mk(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 gk(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 _8(t){return"media_type"in t&&typeof t.media_type=="string"&&"data"in t}function v8(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 S8(t){return"type"in t&&t.type==="image"&&"image"in t&&typeof t.image=="string"&&!t.image.startsWith("http://")&&!t.image.startsWith("https://")}function E8(t){return"type"in t&&(t.type==="blob"||t.type==="base64")}function T8(t){return"b64_json"in t}function w8(t){return"type"in t&&"result"in t&&t.type==="image_generation"}function x8(t){return"uri"in t&&typeof t.uri=="string"&&t.uri.startsWith("data:")}var Df="[Blob substitute]",A8=["image_url","data","content","b64_json","result","uri","image"];function ol(t){let e={...t};qa(e.source)&&(e.source=ol(e.source)),pk(t)&&(e.inlineData={...t.inlineData,data:Df}),fk(t)&&(e.image_url={...t.image_url,url:Df}),mk(t)&&(e.input_audio={...t.input_audio,data:Df}),gk(t)&&(e.file={...t.file,file_data:Df});for(let n of A8)typeof e[n]=="string"&&(e[n]=Df);return e}var yk=2e4,wh=t=>new TextEncoder().encode(t).length,Pv=t=>wh(JSON.stringify(t));function xh(t,e){if(wh(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);wh(a)<=e?(o=a,n=i+1):r=i-1}return o}function I8(t){return typeof t=="string"?t:"text"in t&&typeof t.text=="string"?t.text:""}function hk(t,e){return typeof t=="string"?e:{...t,text:e}}function k8(t){return t!==null&&typeof t=="object"&&"content"in t&&typeof t.content=="string"}function bk(t){return t!==null&&typeof t=="object"&&"content"in t&&Array.isArray(t.content)}function _k(t){return t!==null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)&&t.parts.length>0}function R8(t,e){let n={...t,content:""},r=Pv(n),o=e-r;if(o<=0)return[];let i=xh(t.content,o);return[{...t,content:i}]}function N8(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 C8(t,e){let{key:n,items:r}=N8(t);if(n===null||r.length===0)return[];let o=r.map(l=>hk(l,"")),i=Pv({...t,[n]:o}),a=e-i;if(a<=0)return[];let s=[];for(let l of r){let c=I8(l),d=wh(c);if(d<=a)s.push(l),a-=d;else if(s.length===0){let u=xh(c,a);u&&s.push(hk(l,u));break}else break}return s.length<=0?[]:[{...t,[n]:s}]}function M8(t,e){if(!t)return[];if(typeof t=="string"){let n=xh(t,e);return n?[n]:[]}return typeof t!="object"?[]:k8(t)?R8(t,e):bk(t)||_k(t)?C8(t,e):[]}function Bv(t){return t.map(n=>{let r;return n&&typeof n=="object"&&(bk(n)?r={...n,content:Bv(n.content)}:"content"in n&&qa(n.content)&&(r={...n,content:ol(n.content)}),_k(n)&&(r={...r??n,parts:Bv(n.parts)}),qa(r)?r=ol(r):qa(n)&&(r=ol(n))),r??n})}function O8(t,e){if(!Array.isArray(t)||t.length===0)return t;let n=e-2,r=t[t.length-1],o=Bv([r]),i=o[0];return Pv(i)<=n?o:M8(i,n)}function vk(t){return O8(t,yk)}function Sk(t){return xh(t,yk)}function Dr(t){let e=B()?.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=B();return e?!je(e)&&e.getOptions().streamGenAiSpans===!1:!0}function Xc(t,e){return t?`${t}.${e}`:e}function Ek(t,e,n,r,o){if(e!==void 0&&t.setAttributes({[no]:e}),n!==void 0&&t.setAttributes({[ro]: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({[Or]:i})}}function il(t,e,n){if(!t.isRecording())return;let r={[ok]:!0};e.responseId&&(r[ja]=e.responseId),e.responseModel&&(r[eo]=e.responseModel),e.promptTokens!==void 0&&(r[no]=e.promptTokens),e.completionTokens!==void 0&&(r[ro]=e.completionTokens),e.totalTokens!==void 0?r[Or]=e.totalTokens:(e.promptTokens!==void 0||e.completionTokens!==void 0||e.cacheCreationInputTokens!==void 0||e.cacheReadInputTokens!==void 0)&&(r[Or]=(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[Yn]=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 Sk(t);if(Array.isArray(t)){let e=vk(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 D8(t,e,n){let r=t.catch(a=>{throw wt(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 Jc(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 D8(c,e,n)}:typeof s=="function"?s.bind(a):s}}):e}var Tk={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},L8=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],wk=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...L8];function xk(t){return t!==null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.startsWith("response.")}function Ak(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion.chunk"}function Ik(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[eo]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[Of]=r.id),r.usage&&typeof r.usage=="object"){let i=r.usage,a=i.prompt_tokens??i.input_tokens;typeof a=="number"&&(o[no]=a);let s=i.completion_tokens??i.output_tokens;typeof s=="number"&&(o[ro]=s),typeof i.total_tokens=="number"&&(o[Or]=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[Yn]=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[Yn]&&(o[Yn]=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 U8(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 kk(t){let e={[Ae]: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[Wc]=t.presence_penalty),"stream"in t&&(e[Vc]=t.stream),"encoding_format"in t&&(e[_h]=t.encoding_format),"dimensions"in t&&(e[vh]=t.dimensions);let n=U8(t);return n&&(e[Of]=n),e}function B8(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 P8(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&&B8(r.delta.tool_calls,e)),r.finish_reason&&e.finishReasons.push(r.finish_reason)}function z8(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"}),wt(t,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in t))return;let o=t;if(!wk.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*Rk(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)Ak(o)?P8(o,r,n):xk(o)&&z8(o,r,n,e),yield o}finally{let o=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];il(e,{...r,toolCalls:o},n)}}function F8(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){z&&w.error("Failed to serialize OpenAI tools:",i);return}}function H8(t,e){let n={[di]:"openai",[mn]:e,[at]:"auto.ai.openai"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let r=t[0],o=F8(r);o&&(n[mi]=o),Object.assign(n,kk(r))}else n[Ae]="unknown";return n}function Nk(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(Kc,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(oo,a.length):t.setAttribute(oo,1)}function G8(t,e,n,r,o){return function(...a){let s=n.operation||"unknown",l=H8(a,s),c=l[Ae]||"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=jn(p,h=>(_=t.apply(r,a),o.recordInputs&&d&&Nk(h,d,s,gr(o.enableTruncation)),(async()=>{try{let b=await _;return Rk(b,h,o.recordOutputs??!1)}catch(b){throw h.setStatus({code:2,message:"internal_error"}),wt(b,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:e}}}),h.end(),b}})()));return Jc(_,v,"auto.ai.openai")}let f,m=on(p,_=>(f=t.apply(r,a),o.recordInputs&&d&&Nk(_,d,s,gr(o.enableTruncation)),f.then(v=>(Ik(_,v,o.recordOutputs),v),v=>{throw wt(v,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:e}}}),v})));return Jc(f,m,"auto.ai.openai")}}function Ck(t,e="",n){return new Proxy(t,{get(r,o){let i=r[o],a=Xc(e,String(o)),s=Tk[a];return typeof i=="function"&&s?G8(i,a,s,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?Ck(i,a,n):i}})}function zv(t,e){return Ck(t,"",Dr(e))}var Mk={"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 Ok(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),[oo]:i})}var $8={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 Fv(t){return t&&$8[t]||"internal_error"}function Dk(t,e){e.error&&(t.setStatus({code:2,message:Fv(e.error.type)}),wt(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function Lk(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 j8(t,e){return"type"in t&&typeof t.type=="string"&&t.type==="error"?(e.setStatus({code:2,message:Fv(t.error?.type)}),wt(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function q8(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 V8(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 Y8(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 W8(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 Uk(t,e,n,r){!(t&&typeof t=="object")||j8(t,r)||(q8(t,e),V8(t,e),Y8(t,e,n),W8(t,e))}async function*Bk(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)Uk(o,r,n,e),yield o}finally{il(e,r,n)}}function Pk(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=>{Uk(o,r,n,e)}),t.on("message",()=>{il(e,r,n)}),t.on("error",o=>{wt(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end())}),t}function K8(t,e,n){let r={[di]:"anthropic",[mn]: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[Ae]=o.model??"unknown","temperature"in o&&(r[Ha]=o.temperature),"top_p"in o&&(r[$a]=o.top_p),"stream"in o&&(r[Vc]=o.stream),"top_k"in o&&(r[bh]=o.top_k),"frequency_penalty"in o&&(r[Ga]=o.frequency_penalty),"max_tokens"in o&&(r[Yc]=o.max_tokens)}else e==="models.retrieve"||e==="models.get"?r[Ae]=t[0]:r[Ae]="unknown";return r}function Hv(t,e,n){let r=Lk(e);Ok(t,r,n),"prompt"in e&&t.setAttributes({[nk]:JSON.stringify(e.prompt)})}function X8(t,e){if("content"in e&&Array.isArray(e.content)){t.setAttributes({[Yn]: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({[Yn]:e.completion}),"input_tokens"in e&&t.setAttributes({[Yn]:JSON.stringify(e.input_tokens)})}function J8(t,e){"id"in e&&"model"in e&&(t.setAttributes({[ja]:e.id,[eo]:e.model}),"usage"in e&&e.usage&&Ek(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.cache_creation_input_tokens,e.usage.cache_read_input_tokens))}function Q8(t,e,n){if(!(!e||typeof e!="object")){if("type"in e&&e.type==="error"){Dk(t,e);return}n&&X8(t,e),J8(t,e)}}function zk(t,e,n){throw wt(t,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end()),t}function Z8(t,e,n,r,o,i,a,s,l,c,d){let u=o[Ae]??"unknown",p={name:`${i} ${u}`,op:`gen_ai.${i}`,attributes:o};if(c&&!d){let f,m=jn(p,_=>(f=t.apply(n,r),l.recordInputs&&s&&Hv(_,s,gr(l.enableTruncation)),(async()=>{try{let v=await f;return Bk(v,_,l.recordOutputs??!1)}catch(v){return zk(v,_,a)}})()));return Jc(f,m,"auto.ai.anthropic")}else return jn(p,f=>{try{l.recordInputs&&s&&Hv(f,s,gr(l.enableTruncation));let m=e.apply(n,r);return Pk(m,f,l.recordOutputs??!1)}catch(m){return zk(m,f,a)}})}function tz(t,e,n,r,o){return new Proxy(t,{apply(i,a,s){let l=n.operation||"unknown",c=K8(s,e,l),d=c[Ae]??"unknown",u=typeof s[0]=="object"?s[0]:void 0,p=!!u?.stream,f=n.streaming===!0;if(p||f)return Z8(t,i,r,s,c,l,e,u,o,p,f);let m,_=on({name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:c},v=>(m=i.apply(r,s),o.recordInputs&&u&&Hv(v,u,gr(o.enableTruncation)),m.then(h=>(Q8(v,h,o.recordOutputs),h),h=>{throw wt(h,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:e}}}),h})));return Jc(m,_,"auto.ai.anthropic")}})}function Fk(t,e="",n){return new Proxy(t,{get(r,o){let i=r[o],a=Xc(e,String(o)),s=Mk[a];return typeof i=="function"&&s?tz(i,a,s,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?Fk(i,a,n):i}})}function Gv(t,e){return Fk(t,"",Dr(e))}var Hk={"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}},Gk="google_genai";function ez(t,e){let n=t?.promptFeedback;if(n?.blockReason){let r=n.blockReasonMessage??n.blockReason;return e.setStatus({code:2,message:"internal_error"}),wt(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function nz(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 rz(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 oz(t,e,n,r){!t||ez(t,r)||(nz(t,e),rz(t,e,n))}async function*$k(t,e,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let o of t)oz(o,r,n,e),yield o}finally{il(e,r,n)}}function Qc(t,e="user"){return typeof t=="string"?[{role:e,content:t}]:Array.isArray(t)?t.flatMap(n=>Qc(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 jk(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 iz(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[bh]=t.topK),"maxOutputTokens"in t&&typeof t.maxOutputTokens=="number"&&(e[Yc]=t.maxOutputTokens),"frequencyPenalty"in t&&typeof t.frequencyPenalty=="number"&&(e[Ga]=t.frequencyPenalty),"presencePenalty"in t&&typeof t.presencePenalty=="number"&&(e[Wc]=t.presencePenalty),e}function az(t,e,n){let r={[di]:Gk,[mn]:t,[at]:"auto.ai.google_genai"};if(e){if(r[Ae]=jk(e,n),"config"in e&&typeof e.config=="object"&&e.config){let o=e.config;if(Object.assign(r,iz(o)),"tools"in o&&Array.isArray(o.tools)){let i=o.tools.flatMap(a=>a.functionDeclarations);r[mi]=JSON.stringify(i)}}}else r[Ae]=jk({},n);return r}function qk(t,e,n,r){if(n){let i=e.contents;i!=null&&t.setAttribute(Kc,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(...Qc(e.config.systemInstruction,"system")),"history"in e&&o.push(...Qc(e.history,"user")),"contents"in e&&o.push(...Qc(e.contents,"user")),"message"in e&&o.push(...Qc(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({[oo]:s,[Ho]:r?$o(a):Go(a)})}}function sz(t,e,n){if(!(!e||typeof e!="object")){if(e.modelVersion&&t.setAttribute(eo,e.modelVersion),e.usageMetadata&&typeof e.usageMetadata=="object"){let r=e.usageMetadata;typeof r.promptTokenCount=="number"&&t.setAttributes({[no]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&t.setAttributes({[ro]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&t.setAttributes({[Or]: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({[Yn]:r.join("")})}if(n&&e.functionCalls){let r=e.functionCalls;Array.isArray(r)&&r.length>0&&t.setAttributes({[mr]:JSON.stringify(r)})}}}function lz(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=az(c,d,r),p=u[Ae]??"unknown";return n.streaming?jn({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:u},async f=>{try{o.recordInputs&&d&&qk(f,d,i,gr(o.enableTruncation));let m=await a.apply(r,l);return $k(m,f,!!o.recordOutputs)}catch(m){throw f.setStatus({code:2,message:"internal_error"}),wt(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}}),f.end(),m}}):on({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:u},f=>(o.recordInputs&&d&&qk(f,d,i,gr(o.enableTruncation)),gf(()=>a.apply(r,l),m=>{wt(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}})},()=>{},m=>{i||sz(f,m,o.recordOutputs)})))}})}function $v(t,e="",n){return new Proxy(t,{get:(r,o,i)=>{let a=Reflect.get(r,o,i),s=Xc(e,String(o)),l=Hk[s];if(typeof a=="function"&&l){let c=l.operation?lz(a,s,l,r,n):a.bind(r);return l.proxyResultPath?function(...d){let u=c(...d);return u&&typeof u=="object"?$v(u,l.proxyResultPath,n):u}:c}return typeof a=="function"?a.bind(r):a&&typeof a=="object"?$v(a,s,n):a}})}function jv(t,e){return $v(t,"",Dr(e))}var Gi="auto.ai.langchain",Vk={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var io=(t,e,n)=>{n!=null&&(t[e]=n)},Lr=(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 Zc(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 Lf(t){let e=t.toLowerCase();return Vk[e]??e}function Yk(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 qv(t){if(!(!t||Array.isArray(t)))return t.invocation_params}function Uf(t){return t.map(e=>{let n=e._getType;if(typeof n=="function"){let o=n.call(e);return{role:Lf(o),content:Zc(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"?Yk(i):"user";return{role:Lf(a),content:Zc(e.kwargs?.content)}}if(e.type){let o=String(e.type).toLowerCase();return{role:Lf(o),content:Zc(e.content)}}if(e.role)return{role:Lf(String(e.role)),content:Zc(e.content)};let r=e.constructor?.name;return r&&r!=="Object"?{role:Lf(Yk(r)),content:Zc(e.content)}:{role:"user",content:Zc(e.content)}})}function cz(t,e,n){let r={},o="kwargs"in t?t.kwargs:void 0,i=e?.temperature??n?.ls_temperature??o?.temperature;Lr(r,Ha,i);let a=e?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Lr(r,Yc,a);let s=e?.top_p??o?.top_p;Lr(r,$a,s);let l=e?.frequency_penalty;Lr(r,Ga,l);let c=e?.presence_penalty;return Lr(r,Wc,c),e&&"stream"in e&&io(r,Vc,!!e.stream),r}function Kk(t,e,n,r,o){return{[di]:al(t??"langchain"),[mn]:"chat",[Ae]:al(e),[at]:Gi,...cz(n,r,o)}}function Xk(t,e,n,r,o,i){let a=i?.ls_provider,s=o?.model??i?.ls_model_name??"unknown",l=Kk(a,s,t,o,i);if(n&&Array.isArray(e)&&e.length>0){io(l,oo,e.length);let c=e.map(d=>({role:"user",content:d}));io(l,Ho,r?$o(c):Go(c))}return l}function Jk(t,e,n,r,o,i){let a=i?.ls_provider??t.id?.[2],s=o?.model??i?.ls_model_name??"unknown",l=Kk(a,s,t,o,i);if(n&&Array.isArray(e)&&e.length>0){let c=Uf(e.flat()),{systemInstructions:d,filteredMessages:u}=gi(c);d&&io(l,pi,d);let p=Array.isArray(u)?u.length:0;io(l,oo,p),io(l,Ho,r?$o(u):Go(u))}return l}function uz(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&&io(e,mr,al(n))}function dz(t,e){if(!t)return;let n=t.tokenUsage,r=t.usage;if(n)Lr(e,no,n.promptTokens),Lr(e,ro,n.completionTokens),Lr(e,Or,n.totalTokens);else if(r){Lr(e,no,r.input_tokens),Lr(e,ro,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&&Lr(e,Or,a),r.cache_creation_input_tokens!==void 0&&Lr(e,ak,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Lr(e,sk,r.cache_read_input_tokens)}}function Qk(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&&io(n,fi,al(c)),uz(t.generations,n),e){let d=t.generations.flat().map(u=>u.text??u.message?.content).filter(u=>typeof u=="string");d.length>0&&io(n,Yn,al(d))}}dz(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&&io(n,eo,a);let s=r?.id??i?.id;s&&io(n,ja,s);let l=r?.stop_reason??i?.response_metadata?.finish_reason;return l&&io(n,rk,al(l)),n}function Ah(t){let e={},n=t?.lc_agent_name;return typeof n=="string"&&(e[rl]=n),e}function Zk(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 fz(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.addHandler=="function"&&typeof e.copy=="function"}function pz(t){return typeof t=="object"&&t?.name==="SentryCallbackHandler"}function Wk(t){return t.some(pz)}function tR(t,e){if(!t)return[e];if(fz(t)){if(Wk(t.handlers??[]))return t;let r=t.copy();return r.addHandler(e,!0),r}let n=Array.isArray(t)?t:[t];return Wk(n)?t:[...n,e]}function tu(t={}){let{recordInputs:e,recordOutputs:n}=Dr(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 _=qv(p),v=Xk(s,l,e,r,_,f),h=v[Ae],b=v[mn];jn({name:`${b} ${h}`,op:"gen_ai.chat",attributes:{...Ah(f),...v,[bt]:"gen_ai.chat"}},S=>(o.set(c,S),S))},handleChatModelStart(s,l,c,d,u,p,f,m){let _=qv(p),v=Jk(s,l,e,r,_,f),h=Zk(u);h&&(v[mi]=h);let b=v[Ae],S=v[mn];jn({name:`${S} ${b}`,op:"gen_ai.chat",attributes:{...Ah(f),...v,[bt]:"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=Qk(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)),wt(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)),jn({name:`chain ${_}`,op:"gen_ai.invoke_agent",attributes:{...v,[bt]:"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)),wt(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",_={...Ah(p),[at]:Gi,[mn]:"execute_tool",[Sh]:m};e&&(_[Eh]=l),jn({name:`execute_tool ${m}`,op:"gen_ai.execute_tool",attributes:{..._,[bt]:"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({[Th]: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)),wt(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 Bf="auto.ai.langgraph";function eR(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 nR(t){let e=t[0];return typeof e=="object"&&e&&"name"in e&&typeof e.name=="string"?e.name:null}function rR(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]:Bf,[bt]:Uv,[mn]:"execute_tool",[Sh]:s,[uk]:"function"},_=p[1]?.metadata?.lc_agent_name??n;typeof _=="string"&&(f[rl]=_),l&&(f[dk]=l);let v=p[0];if(typeof v=="object"&&v&&("id"in v&&typeof v.id=="string"&&(f[ck]=v.id),e.recordInputs)){let h="args"in v&&typeof v.args=="object"?v.args:v;try{f[Eh]=JSON.stringify(h)}catch{}}return on({op:Uv,name:`execute_tool ${s}`,attributes:f},async h=>{try{let b=await Reflect.apply(d,u,p);if(e.recordOutputs)try{let S=b,E=S&&typeof S=="object"&&"content"in S?S.content:b;h.setAttribute(Th,typeof E=="string"?E:JSON.stringify(E))}catch{}return b}catch(b){throw h.setStatus({code:2,message:"internal_error"}),wt(b,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),b}})}});i.invoke=c,Object.defineProperty(i,r,{value:!0,enumerable:!1})}return t}function mz(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 gz(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 hz(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(eo,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&t.setAttribute(fi,[r.finish_reason])}}function oR(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 iR(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=mz(a);s&&t.setAttribute(mr,JSON.stringify(s));let l=Uf(a);t.setAttribute(Yn,JSON.stringify(l));let c=0,d=0,u=0;for(let p of a){let f=gz(p);c+=f.inputTokens,d+=f.outputTokens,u+=f.totalTokens,hz(t,p)}c>0&&t.setAttribute(no,c),d>0&&t.setAttribute(ro,d),u>0&&t.setAttribute(Or,u)}var Vv=!1,Ih="__sentry_patched__";function aR(t,e){if(Object.prototype.hasOwnProperty.call(t,Ih))return t;let n=tu(e),r=new Proxy(t,{apply(o,i,a){return Vv?Reflect.apply(o,i,a):on({op:"gen_ai.create_agent",name:"create_agent",attributes:{[at]:Bf,[bt]:"gen_ai.create_agent",[mn]:"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=sR(d.bind(l),l,c,e,void 0,n)),l}catch(l){throw s.setStatus({code:2,message:"internal_error"}),wt(l,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),l}})}});return Object.defineProperty(r,Ih,{value:!0,enumerable:!1}),r}function sR(t,e,n,r,o,i){return new Proxy(t,{apply(a,s,l){let c=o?.modelName??o?.model;return on({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[at]:Bf,[bt]:lk,[mn]:"invoke_agent"}},async d=>{try{let u=n?.name;u&&typeof u=="string"&&(d.setAttribute(ik,u),d.setAttribute(rl,u),d.updateName(`invoke_agent ${u}`)),c&&d.setAttribute(Ae,c);let m=(l.length>1?l[1]:void 0)?.configurable?.thread_id;if(m&&typeof m=="string"&&d.setAttribute(Of,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=tR(E.callbacks,i)}let _=oR(e);_&&d.setAttribute(mi,JSON.stringify(_));let v=r.recordInputs,h=r.recordOutputs,b=l.length>0?l[0]?.messages??[]:[];if(b&&v){let E=Uf(b),{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),[oo]:L})}let S=await Reflect.apply(a,s,l);return h&&iR(d,b??null,S),S}catch(u){throw d.setStatus({code:2,message:"internal_error"}),wt(u,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),u}})}})}function Yv(t,e){if(Object.prototype.hasOwnProperty.call(t,Ih))return t;let n=Dr(e),r=tu(n),o=new Proxy(t,{apply(i,a,s){let l=eR(s),c=nR(s),d=s[0];d&&Array.isArray(d.tools)&&d.tools.length>0&&rR(d.tools,n,c??void 0),Vv=!0;let u;try{u=Reflect.apply(i,a,s)}finally{Vv=!1}let p=u.invoke;if(p&&typeof p=="function"){let f={};c&&(f.name=c),u.invoke=sR(p.bind(u),u,f,n,l,r)}return u}});return Object.defineProperty(o,Ih,{value:!0,enumerable:!1}),o}function Wv(t,e){return t.compile=aR(t.compile,Dr(e)),t}function lR(t,e,n){let r=n.getOptions(),o=n.getDsn(),i=r.tunnel,a=Fo(r._metadata),s={sent_at:new Date(Fn()).toISOString(),...yz(e)&&{trace:e},...a&&{sdk:a},...!!i&&o&&{dsn:rn(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,...qn()&&{ingest_settings:{infer_ip:l,infer_user_agent:l}},items:t}];return Oe(s,[c])}function yz(t){return!!t.trace_id&&!!t.public_key}function cR(t){let e=156;if(e+=t.name.length*2,e+=M0(t.attributes),t.links&&t.links.length>0){let r=t.links[0]?.attributes,o=100+(r?M0(r):0);e+=o*t.links.length}return e}var uR=1e3,bz=5e6,Pf=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<=uR?r:uR,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=i&&i>0?i:bz,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+=cR(e),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(z&&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){z&&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=lR(a,i,this._client);z&&w.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(s).then(null,l=>{z&&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 kh(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var eu=Z;function Rh(){return"history"in eu&&!!eu.history}function _z(){if(!("fetch"in eu))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function nu(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function ru(){if(typeof EdgeRuntime=="string")return!0;if(!_z())return!1;if(nu(eu.fetch))return!0;let t=!1,e=eu.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow?.fetch&&(t=nu(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){z&&w.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function Nh(){return"ReportingObserver"in eu}function hi(t,e){let n="fetch",r=Pn(n,t);return zn(n,()=>fR(void 0,e)),r}function Mh(t){let e="fetch-body-resolved",n=Pn(e,t);return zn(e,()=>fR(Sz)),n}function fR(t,e=!1){e&&!ru()||he(Z,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:a}=Ez(r),s={args:r,fetchData:{method:i,url:a},startTimestamp:Ot()*1e3,virtualError:o,headers:Tz(r)};return t||tn("fetch",{...s}),n.apply(Z,r).then(async l=>(t?t(l):tn("fetch",{...s,endTimestamp:Ot()*1e3,response:l}),l),l=>{tn("fetch",{...s,endTimestamp:Ot()*1e3,error:l}),fn(l)&&l.stack===void 0&&(l.stack=o.stack,Ht(l,"framesToPop",1));let d=B()?.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})`:Ht(l,"__sentry_fetch_url_host__",f)}catch{}throw l})}})}async function vz(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 Sz(t){let e;try{e=t.clone()}catch{return}vz(e,()=>{tn("fetch-body-resolved",{endTimestamp:Ot()*1e3,response:t})})}function Ch(t,e){return!!t&&typeof t=="object"&&!!t[e]}function dR(t){return typeof t=="string"?t:t?Ch(t,"url")?t.url:t.toString?t.toString():"":""}function Ez(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:dR(n),method:Ch(r,"method")?String(r.method).toUpperCase():Kd(n)&&Ch(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:dR(e),method:Ch(e,"method")?String(e.method).toUpperCase():"GET"}}function Tz(t){let[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Kd(e))return new Headers(e.headers)}catch{}}var pR=Z;function Wn(){try{return pR.document.location.href}catch{return""}}function Va(t,e=5){if(!pR.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 wz(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 xz(t){let e=t??{},n={[at]:Gi,[bt]:Lv,[mn]:"embeddings",[Ae]:e.model??"unknown"};return n[di]=wz(e),"dimensions"in e&&(n[vh]=e.dimensions),"encodingFormat"in e&&(n[_h]=e.encodingFormat),n}function mR(t,e={}){let{recordInputs:n}=Dr(e);return new Proxy(t,{apply(r,o,i){let a=xz(o),s=a[Ae]||"unknown";if(n){let l=i[0];l!=null&&(a[Kc]=typeof l=="string"?l:JSON.stringify(l))}return on({name:`embeddings ${s}`,op:Lv,attributes:a},()=>Reflect.apply(r,o,i).then(void 0,l=>{throw wt(l,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),l}))}})}function Kv(t,e){let n=t;return typeof n.embedQuery=="function"&&(n.embedQuery=mR(n.embedQuery,e)),typeof n.embedDocuments=="function"&&(n.embedDocuments=mR(n.embedDocuments,e)),t}var jo=Z,ye=jo.document,zf=jo.navigator,OR="Report a Bug",Wz="Cancel",Kz="Send Bug Report",Xz="Confirm",Jz="Report a Bug",Qz="your.email@example.org",Zz="Email",tF="What's the bug? What did you expect?",eF="Description",nF="Your Name",rF="Name",oF="Thank you for your report!",iF="(required)",aF="Add a screenshot",sF="Remove screenshot",lF="Highlight",cF="Hide",uF="Remove",DR="Unable to submit feedback with empty message",LR="No client setup, cannot send feedback.",UR="Unable to determine if Feedback was correctly sent.",BR="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",PR="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",dF="widget",fF="api",pF=5e3,mF={ERROR_EMPTY_MESSAGE:DR,ERROR_NO_CLIENT:LR,ERROR_TIMEOUT:UR,ERROR_FORBIDDEN:BR,ERROR_GENERIC:PR};function Uh(t,e){return e?.[t]??mF[t]}function gR(t,e){return new Error(Uh(t,e))}var iS=(t,e={includeReplay:!0})=>{let n=e.errorMessages;if(!t.message)throw gR("ERROR_EMPTY_MESSAGE",n);let r=B();if(!r)throw gR("ERROR_NO_CLIENT",n);t.tags&&Object.keys(t.tags).length&&nt().setTags(t.tags);let o=$c({source:fF,url:Wn(),...t},e);return new Promise((i,a)=>{let s=setTimeout(()=>{l(),a(Uh("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(Uh("ERROR_FORBIDDEN",n)):a(Uh("ERROR_GENERIC",n))})})},Bh=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function gF(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(zf.userAgent)||/Macintosh/i.test(zf.userAgent)&&zf.maxTouchPoints&&zf.maxTouchPoints>1||!isSecureContext)}function Oh(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 hF(t){let e=ye.createElement("style");return e.textContent=`
|
|
27
|
+
.widget__actor {
|
|
28
|
+
position: fixed;
|
|
29
|
+
z-index: var(--z-index);
|
|
30
|
+
margin: var(--page-margin);
|
|
31
|
+
inset: var(--actor-inset);
|
|
32
|
+
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 8px;
|
|
36
|
+
padding: 16px;
|
|
37
|
+
|
|
38
|
+
font-family: inherit;
|
|
39
|
+
font-size: var(--font-size);
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
line-height: 1.14em;
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
|
|
44
|
+
background: var(--actor-background, var(--background));
|
|
45
|
+
border-radius: var(--actor-border-radius, 1.7em/50%);
|
|
46
|
+
border: var(--actor-border, var(--border));
|
|
47
|
+
box-shadow: var(--actor-box-shadow, var(--box-shadow));
|
|
48
|
+
color: var(--actor-color, var(--foreground));
|
|
49
|
+
fill: var(--actor-color, var(--foreground));
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
opacity: 1;
|
|
52
|
+
transition: transform 0.2s ease-in-out;
|
|
53
|
+
transform: translate(0, 0) scale(1);
|
|
54
|
+
}
|
|
55
|
+
.widget__actor[aria-hidden="true"] {
|
|
56
|
+
opacity: 0;
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
visibility: hidden;
|
|
59
|
+
transform: translate(0, 16px) scale(0.98);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.widget__actor:hover {
|
|
63
|
+
background: var(--actor-hover-background, var(--background));
|
|
64
|
+
filter: var(--interactive-filter);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.widget__actor svg {
|
|
68
|
+
width: 1.14em;
|
|
69
|
+
height: 1.14em;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media (max-width: 600px) {
|
|
73
|
+
.widget__actor span {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`,t&&e.setAttribute("nonce",t),e}function Ur(t,e){return Object.entries(e).forEach(([n,r])=>{t.setAttributeNS(null,n,r)}),t}var ou=20,yF="http://www.w3.org/2000/svg";function bF(){let t=s=>jo.document.createElementNS(yF,s),e=Ur(t("svg"),{width:`${ou}`,height:`${ou}`,viewBox:`0 0 ${ou} ${ou}`,fill:"var(--actor-color, var(--foreground))"}),n=Ur(t("g"),{clipPath:"url(#clip0_57_80)"}),r=Ur(t("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});e.appendChild(n).appendChild(r);let o=t("defs"),i=Ur(t("clipPath"),{id:"clip0_57_80"}),a=Ur(t("rect"),{width:`${ou}`,height:`${ou}`,fill:"white"});return i.appendChild(a),o.appendChild(i),e.appendChild(o).appendChild(i).appendChild(a),e}function _F({triggerLabel:t,triggerAriaLabel:e,shadow:n,styleNonce:r}){let o=ye.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=e||t||OR,o.appendChild(bF()),t){let a=ye.createElement("span");a.appendChild(ye.createTextNode(t)),o.appendChild(a)}let i=hF(r);return{el:o,appendToDom(){n.appendChild(i),n.appendChild(o)},removeFromDom(){o.remove(),i.remove()},show(){o.ariaHidden="false"},hide(){o.ariaHidden="true"}}}var zR="rgba(88, 74, 192, 1)",vF={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:zR,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},hR={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:zR,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function yR(t){return`
|
|
78
|
+
--foreground: ${t.foreground};
|
|
79
|
+
--background: ${t.background};
|
|
80
|
+
--accent-foreground: ${t.accentForeground};
|
|
81
|
+
--accent-background: ${t.accentBackground};
|
|
82
|
+
--success-color: ${t.successColor};
|
|
83
|
+
--error-color: ${t.errorColor};
|
|
84
|
+
--border: ${t.border};
|
|
85
|
+
--box-shadow: ${t.boxShadow};
|
|
86
|
+
--outline: ${t.outline};
|
|
87
|
+
--interactive-filter: ${t.interactiveFilter};
|
|
88
|
+
`}function bR({colorScheme:t,themeDark:e,themeLight:n,styleNonce:r}){let o=ye.createElement("style");return o.textContent=`
|
|
89
|
+
:host {
|
|
90
|
+
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
|
|
91
|
+
--font-size: 14px;
|
|
92
|
+
--z-index: 100000;
|
|
93
|
+
|
|
94
|
+
--page-margin: 16px;
|
|
95
|
+
--inset: auto 0 0 auto;
|
|
96
|
+
--actor-inset: var(--inset);
|
|
97
|
+
|
|
98
|
+
font-family: var(--font-family);
|
|
99
|
+
font-size: var(--font-size);
|
|
100
|
+
|
|
101
|
+
${t!=="system"?`color-scheme: only ${t};`:""}
|
|
102
|
+
|
|
103
|
+
${yR(t==="dark"?{...hR,...e}:{...vF,...n})}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
${t==="system"?`
|
|
107
|
+
@media (prefers-color-scheme: dark) {
|
|
108
|
+
:host {
|
|
109
|
+
color-scheme: only dark;
|
|
110
|
+
|
|
111
|
+
${yR({...hR,...e})}
|
|
112
|
+
}
|
|
113
|
+
}`:""}
|
|
114
|
+
`,r&&o.setAttribute("nonce",r),o}var $h=({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:b={},addScreenshotButtonLabel:S=aF,cancelButtonLabel:E=Wz,confirmButtonLabel:R=Xz,emailLabel:C=Zz,emailPlaceholder:I=Qz,formTitle:L=Jz,isRequiredLabel:P=iF,messageLabel:U=eF,messagePlaceholder:O=tF,nameLabel:N=rF,namePlaceholder:W=nF,removeScreenshotButtonLabel:X=sF,submitButtonLabel:pt=Kz,successMessageText:et=oF,triggerLabel:lt=OR,triggerAriaLabel:H="",highlightToolText:ct=lF,hideToolText:Y=cF,removeHighlightText:dt=uF,errorEmptyMessageText:K=DR,errorNoClientText:yt=LR,errorTimeoutText:Jt=UR,errorForbiddenText:He=BR,errorGenericText:Rn=PR,onFormOpen:yn,onFormClose:Q,onSubmitSuccess:ut,onSubmitError:Bt,onFormSubmitted:ne}={})=>{let Zt={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:b,themeLight:h,triggerLabel:lt,triggerAriaLabel:H,cancelButtonLabel:E,submitButtonLabel:pt,confirmButtonLabel:R,formTitle:L,emailLabel:C,emailPlaceholder:I,messageLabel:U,messagePlaceholder:O,nameLabel:N,namePlaceholder:W,successMessageText:et,isRequiredLabel:P,addScreenshotButtonLabel:S,removeScreenshotButtonLabel:X,highlightToolText:ct,hideToolText:Y,removeHighlightText:dt,errorEmptyMessageText:K,errorNoClientText:yt,errorTimeoutText:Jt,errorForbiddenText:He,errorGenericText:Rn,onFormClose:Q,onFormOpen:yn,onSubmitError:Bt,onSubmitSuccess:ut,onFormSubmitted:ne},ft=null,te=null,me=[],ze=st=>{if(!ft){let Ct=ye.createElement("div");Ct.id=String(st.id),ye.body.appendChild(Ct),ft=Ct.attachShadow({mode:"open"}),te=bR(st),ft.appendChild(te)}return ft},Ge=async st=>{let Ct=st.enableScreenshot&&gF(),St,ot;try{St=(e?e():await t("feedbackModalIntegration",_))(),Xs(St)}catch{throw Bh&&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 mt=Ct?n?n():await t("feedbackScreenshotIntegration",_):void 0;mt&&(ot=mt(),Xs(ot))}catch{Bh&&w.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}let _t={ERROR_EMPTY_MESSAGE:st.errorEmptyMessageText,ERROR_NO_CLIENT:st.errorNoClientText,ERROR_TIMEOUT:st.errorTimeoutText,ERROR_FORBIDDEN:st.errorForbiddenText,ERROR_GENERIC:st.errorGenericText},gt=(mt,Qe)=>iS(mt,{includeReplay:!0,...Qe,errorMessages:_t}),Et=St.createDialog({options:{...st,onFormClose:()=>{Et?.close(),st.onFormClose?.()},onFormSubmitted:()=>{Et?.close(),st.onFormSubmitted?.()}},screenshotIntegration:ot,sendFeedback:gt,shadow:ze(st)});return Et},bn=(st,Ct={})=>{let St=Oh(Zt,Ct),ot=typeof st=="string"?ye.querySelector(st):typeof st.addEventListener=="function"?st:null;if(!ot)throw Bh&&w.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let _t=null,gt=async()=>{_t||(_t=await Ge({...St,onFormSubmitted:()=>{_t?.removeFromDom(),St.onFormSubmitted?.()}})),_t.appendToDom(),_t.open()};ot.addEventListener("click",gt);let Et=()=>{me=me.filter(mt=>mt!==Et),_t?.removeFromDom(),_t=null,ot.removeEventListener("click",gt)};return me.push(Et),Et},Xn=(st={})=>{let Ct=Oh(Zt,st),St=ze(Ct),ot=_F({triggerLabel:Ct.triggerLabel,triggerAriaLabel:Ct.triggerAriaLabel,shadow:St,styleNonce:m});return bn(ot.el,{...Ct,onFormOpen(){ot.hide()},onFormClose(){ot.show()},onFormSubmitted(){ot.show()}}),ot};return{name:"Feedback",setupOnce(){!qn()||!Zt.autoInject||(ye.readyState==="loading"?ye.addEventListener("DOMContentLoaded",()=>Xn().appendToDom()):Xn().appendToDom())},attachTo:bn,createWidget(st={}){let Ct=Xn(Oh(Zt,st));return Ct.appendToDom(),Ct},async createForm(st={}){return Ge(Oh(Zt,st))},setTheme(st){if(Zt.colorScheme=st,ft){let Ct=bR(Zt);te?ft.replaceChild(Ct,te):ft.prepend(Ct),te=Ct}},remove(){ft&&(ft.parentElement?.remove(),ft=null,te=null),me.forEach(st=>st()),me=[]}}});function FR(){return B()?.getIntegrationByName("Feedback")}var jh,_e,HR,sl,_R,GR,eS,Ff={},aS=[],SF=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,sS=Array.isArray;function Wa(t,e){for(var n in e)t[n]=e[n];return t}function $R(t){var e=t.parentNode;e&&e.removeChild(t)}function $t(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?jh.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 Ph(t,a,r,o,null)}function Ph(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??++HR,__i:-1,__u:0};return o==null&&_e.vnode!=null&&_e.vnode(i),i}function Hf(t){return t.children}function zh(t,e){this.props=t,this.context=e}function au(t,e){if(e==null)return t.__?au(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"?au(t):null}function EF(t,e,n){var r,o=t.__v,i=o.__e,a=t.__P;if(a)return(r=Wa({},o)).__v=o.__v+1,_e.vnode&&_e.vnode(r),lS(a,r,o,t.__n,a.ownerSVGElement!==void 0,32&o.__u?[i]:null,e,i??au(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&jR(r),r}function jR(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 jR(t)}}function vR(t){(!t.__d&&(t.__d=!0)&&sl.push(t)&&!Gh.__r++||_R!==_e.debounceRendering)&&((_R=_e.debounceRendering)||GR)(Gh)}function Gh(){var t,e,n,r=[],o=[];for(sl.sort(eS);t=sl.shift();)t.__d&&(n=sl.length,e=EF(t,r,o)||e,n===0||sl.length>n?(nS(r,e,o),o.length=r.length=0,e=void 0,sl.sort(eS)):e&&_e.__c&&_e.__c(e,aS));e&&nS(r,e,o),Gh.__r=0}function qR(t,e,n,r,o,i,a,s,l,c,d){var u,p,f,m,_,v=r&&r.__k||aS,h=e.length;for(n.__d=l,TF(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?Ff:v[f.__i]||Ff,f.__i=u,lS(t,f,p,o,i,a,s,l,c,d),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&cS(p.ref,null,f),d.push(f.ref,f.__c||m,f)),_==null&&m!=null&&(_=m),65536&f.__u||p.__k===f.__k?l=VR(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 TF(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?Ph(null,o,null,null,o):sS(o)?Ph(Hf,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Ph(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=t,o.__b=t.__b+1,s=wF(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=au(i)),rS(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=au(i)),rS(i,i))}function VR(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=VR(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 wF(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 SR(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||SF.test(e)?n:n+"px"}function Dh(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||SR(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||SR(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?TR:ER,i)):t.removeEventListener(e,i?TR:ER,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 ER(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(_e.event?_e.event(t):t)}}function TR(t){if(this.l)return this.l[t.type+!0](_e.event?_e.event(t):t)}function lS(t,e,n,r,o,i,a,s,l,c){var d,u,p,f,m,_,v,h,b,S,E,R,C,I,L,P=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(d=_e.__b)&&d(e);t:if(typeof P=="function")try{if(h=e.props,b=(d=P.contextType)&&r[d.__c],S=d?b?b.props.value:d.__:r,n.__c?v=(u=e.__c=n.__c).__=u.__E:("prototype"in P&&P.prototype.render?e.__c=u=new P(h,S):(e.__c=u=new zh(h,S),u.constructor=P,u.render=AF),b&&b.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),P.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Wa({},u.__s)),Wa(u.__s,P.getDerivedStateFromProps(h,u.__s))),f=u.props,m=u.state,u.__v=e,p)P.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(P.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=_e.__r,C=0,"prototype"in P&&P.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)),qR(t,sS(L=d!=null&&d.type===Hf&&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),_e.__e(U,e,n)}else i==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=xF(n.__e,e,n,r,o,i,a,l,c);(d=_e.diffed)&&d(e)}function nS(t,e,n){for(var r=0;r<n.length;r++)cS(n[r],n[++r],n[++r]);_e.__c&&_e.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(i){i.call(o)})}catch(i){_e.__e(i,o.__v)}})}function xF(t,e,n,r,o,i,a,s,l){var c,d,u,p,f,m,_,v=n.props,h=e.props,b=e.type;if(b==="svg"&&(o=!0),i!=null){for(c=0;c<i.length;c++)if((f=i[c])&&"setAttribute"in f==!!b&&(b?f.localName===b:f.nodeType===3)){t=f,i[c]=null;break}}if(t==null){if(b===null)return document.createTextNode(h);t=o?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,h.is&&h),i=null,s=!1}if(b===null)v===h||s&&t.data===h||(t.data=h);else{if(i=i&&jh.call(t.childNodes),v=n.props||Ff,!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||Dh(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||Dh(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=""),qR(t,sS(p)?p:[p],e,n,r,o&&b!=="foreignObject",i,a,i?i[0]:n.__k&&au(n,0),s,l),i!=null)for(c=i.length;c--;)i[c]!=null&&$R(i[c]);s||(c="value",m!==void 0&&(m!==t[c]||b==="progress"&&!m||b==="option"&&m!==v[c])&&Dh(t,c,m,v[c],!1),c="checked",_!==void 0&&_!==t[c]&&Dh(t,c,_,v[c],!1))}return t}function cS(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){_e.__e(r,n)}}function rS(t,e,n){var r,o;if(_e.unmount&&_e.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||cS(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){_e.__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]&&rS(r[o],e,n||typeof t.type!="function");n||t.__e==null||$R(t.__e),t.__=t.__e=t.__d=void 0}function AF(t,e,n){return this.constructor(t,n)}function IF(t,e,n){var r,o,i,a;_e.__&&_e.__(t,e),o=(r=!1)?null:e.__k,i=[],a=[],lS(e,t=e.__k=$t(Hf,null,[t]),o||Ff,Ff,e.ownerSVGElement!==void 0,o?null:e.firstChild?jh.call(e.childNodes):null,i,o?o.__e:e.firstChild,r,a),t.__d=void 0,nS(i,t,a)}jh=aS.slice,_e={__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}},HR=0,zh.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),vR(this))},zh.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),vR(this))},zh.prototype.render=Hf,sl=[],GR=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,eS=function(t,e){return t.__v.__b-e.__v.__b},Gh.__r=0;var $i,be,Xv,wR,su=0,YR=[],Fh=[],Fe=_e,xR=Fe.__b,AR=Fe.__r,IR=Fe.diffed,kR=Fe.__c,RR=Fe.unmount,NR=Fe.__;function cl(t,e){Fe.__h&&Fe.__h(be,t,su||e),su=0;var n=be.__H||(be.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:Fh}),n.__[t]}function ll(t){return su=1,WR(XR,t)}function WR(t,e,n){var r=cl($i++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):XR(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=be,!be.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))};be.u=!0;var i=be.shouldComponentUpdate,a=be.componentWillUpdate;be.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)},be.shouldComponentUpdate=o}return r.__N||r.__}function kF(t,e){var n=cl($i++,3);!Fe.__s&&uS(n.__H,e)&&(n.__=t,n.i=e,be.__H.__h.push(n))}function KR(t,e){var n=cl($i++,4);!Fe.__s&&uS(n.__H,e)&&(n.__=t,n.i=e,be.__h.push(n))}function RF(t){return su=5,Gf(function(){return{current:t}},[])}function NF(t,e,n){su=6,KR(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 Gf(t,e){var n=cl($i++,7);return uS(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function iu(t,e){return su=8,Gf(function(){return t},e)}function CF(t){var e=be.context[t.__c],n=cl($i++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(be)),e.props.value):t.__}function MF(t,e){Fe.useDebugValue&&Fe.useDebugValue(e?e(t):t)}function OF(t){var e=cl($i++,10),n=ll();return e.__=t,be.componentDidCatch||(be.componentDidCatch=function(r,o){e.__&&e.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function DF(){var t=cl($i++,11);if(!t.__){for(var e=be.__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 LF(){for(var t;t=YR.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Hh),t.__H.__h.forEach(oS),t.__H.__h=[]}catch(e){t.__H.__h=[],Fe.__e(e,t.__v)}}Fe.__b=function(t){be=null,xR&&xR(t)},Fe.__=function(t,e){e.__k&&e.__k.__m&&(t.__m=e.__k.__m),NR&&NR(t,e)},Fe.__r=function(t){AR&&AR(t),$i=0;var e=(be=t.__c).__H;e&&(Xv===be?(e.__h=[],be.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Fh,n.__N=n.i=void 0})):(e.__h.forEach(Hh),e.__h.forEach(oS),e.__h=[],$i=0)),Xv=be},Fe.diffed=function(t){IR&&IR(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(YR.push(e)!==1&&wR===Fe.requestAnimationFrame||((wR=Fe.requestAnimationFrame)||UF)(LF)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Fh&&(n.__=n.__V),n.i=void 0,n.__V=Fh})),Xv=be=null},Fe.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Hh),n.__h=n.__h.filter(function(r){return!r.__||oS(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],Fe.__e(r,n.__v)}}),kR&&kR(t,e)},Fe.unmount=function(t){RR&&RR(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Hh(r)}catch(o){e=o}}),n.__H=void 0,e&&Fe.__e(e,n.__v))};var CR=typeof requestAnimationFrame=="function";function UF(t){var e,n=function(){clearTimeout(r),CR&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);CR&&(e=requestAnimationFrame(n))}function Hh(t){var e=be,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),be=e}function oS(t){var e=be;t.__c=t.__(),be=e}function uS(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function XR(t,e){return typeof e=="function"?e(t):e}var BF=Object.defineProperty({__proto__:null,useCallback:iu,useContext:CF,useDebugValue:MF,useEffect:kF,useErrorBoundary:OF,useId:DF,useImperativeHandle:NF,useLayoutEffect:KR,useMemo:Gf,useReducer:WR,useRef:RF,useState:ll},Symbol.toStringTag,{value:"Module"}),PF="http://www.w3.org/2000/svg";function zF(){let t=r=>ye.createElementNS(PF,r),e=Ur(t("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Ur(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 FF({options:t}){let e=Gf(()=>({__html:zF().outerHTML}),[]);return $t("h2",{class:"dialog__header"},$t("span",{class:"dialog__title"},t.formTitle),t.showBranding?$t("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:e}):null)}function HF(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 Jv(t,e){let n=t.get(e);return typeof n=="string"?n.trim():""}function GF({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:b,messagePlaceholder:S,nameLabel:E,namePlaceholder:R,submitButtonLabel:C,isRequiredLabel:I}=t,[L,P]=ll(!1),[U,O]=ll(null),[N,W]=ll(!1),X=c?.input,[pt,et]=ll(null),lt=iu(Y=>{et(Y),W(!1)},[]),H=iu(Y=>{let dt=HF(Y,{emailLabel:m,isEmailRequired:v,isNameRequired:h,messageLabel:b,nameLabel:E});return dt.length>0?O(`Please enter in the following required fields: ${dt.join(", ")}`):O(null),dt.length===0},[m,v,h,b,E]),ct=iu(async Y=>{P(!0);try{if(Y.preventDefault(),!(Y.target instanceof HTMLFormElement))return;let dt=new FormData(Y.target),K=await(c&&N?c.value():void 0),yt={name:Jv(dt,"name"),email:Jv(dt,"email"),message:Jv(dt,"message"),attachments:K?[K]:void 0};if(!H(yt))return;try{let Jt=await o({name:yt.name,email:yt.email,message:yt.message,source:dF,tags:d},{attachments:yt.attachments});i(yt,Jt)}catch(Jt){Bh&&w.error(Jt);let He=Jt instanceof Error?Jt:new Error(String(Jt));O(He.message),a(He)}}finally{P(!1)}},[c&&N,i,a]);return $t("form",{class:"form",onSubmit:ct},X&&N?$t(X,{onError:lt}):null,$t("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:L},$t("div",{class:"form__top"},U?$t("div",{class:"form__error-container"},U):null,l?$t("label",{for:"name",class:"form__label"},$t(Qv,{label:E,isRequiredLabel:I,isRequired:h}),$t("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:R,required:h,type:"text"})):$t("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),s?$t("label",{for:"email",class:"form__label"},$t(Qv,{label:m,isRequiredLabel:I,isRequired:v}),$t("input",{class:"form__input",defaultValue:e,id:"email",name:"email",placeholder:_,required:v,type:"email"})):$t("input",{"aria-hidden":!0,value:e,name:"email",type:"hidden"}),$t("label",{for:"message",class:"form__label"},$t(Qv,{label:b,isRequiredLabel:I,isRequired:!0}),$t("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:S,required:!0,rows:5})),X?$t("label",{for:"screenshot",class:"form__label"},$t("button",{class:"btn btn--default",disabled:L,type:"button",onClick:()=>{et(null),W(Y=>!Y)}},N?p:u),pt?$t("div",{class:"form__error-container"},pt.message):null):null),$t("div",{class:"btn-group"},$t("button",{class:"btn btn--primary",disabled:L,type:"submit"},C),$t("button",{class:"btn btn--default",disabled:L,type:"button",onClick:r},f))))}function Qv({label:t,isRequired:e,isRequiredLabel:n}){return $t("span",{class:"form__label__text"},t,e&&$t("span",{class:"form__label__text--required"},n))}var Lh=16,MR=17,$F="http://www.w3.org/2000/svg";function jF(){let t=l=>jo.document.createElementNS($F,l),e=Ur(t("svg"),{width:`${Lh}`,height:`${MR}`,viewBox:`0 0 ${Lh} ${MR}`,fill:"inherit"}),n=Ur(t("g"),{clipPath:"url(#clip0_57_156)"}),r=Ur(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=Ur(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=Ur(t("clipPath"),{id:"clip0_57_156"}),s=Ur(t("rect"),{width:`${Lh}`,height:`${Lh}`,fill:"white",transform:"translate(0 0.5)"});return a.appendChild(s),i.appendChild(a),e.appendChild(i).appendChild(a).appendChild(s),e}function qF({open:t,onFormSubmitted:e,...n}){let r=n.options,o=Gf(()=>({__html:jF().outerHTML}),[]),[i,a]=ll(null),s=iu(()=>{i&&(clearTimeout(i),a(null)),e()},[i]),l=iu((c,d)=>{n.onSubmitSuccess(c,d),a(setTimeout(()=>{e(),a(null)},pF))},[e]);return $t(Hf,null,i?$t("div",{class:"success__position",onClick:s},$t("div",{class:"success__content"},r.successMessageText,$t("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):$t("dialog",{class:"dialog",onClick:r.onFormClose,open:t},$t("div",{class:"dialog__position"},$t("div",{class:"dialog__content",onClick:c=>{c.stopPropagation()}},$t(FF,{options:r}),$t(GF,{...n,onSubmitSuccess:l})))))}var VF=`
|
|
115
|
+
.dialog {
|
|
116
|
+
position: fixed;
|
|
117
|
+
z-index: var(--z-index);
|
|
118
|
+
margin: 0;
|
|
119
|
+
inset: 0;
|
|
120
|
+
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
justify-content: center;
|
|
124
|
+
padding: 0;
|
|
125
|
+
height: 100vh;
|
|
126
|
+
width: 100vw;
|
|
127
|
+
|
|
128
|
+
color: var(--dialog-color, var(--foreground));
|
|
129
|
+
fill: var(--dialog-color, var(--foreground));
|
|
130
|
+
line-height: 1.75em;
|
|
131
|
+
|
|
132
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
133
|
+
border: none;
|
|
134
|
+
inset: 0;
|
|
135
|
+
opacity: 1;
|
|
136
|
+
transition: opacity 0.2s ease-in-out;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.dialog__position {
|
|
140
|
+
position: fixed;
|
|
141
|
+
z-index: var(--z-index);
|
|
142
|
+
inset: var(--dialog-inset);
|
|
143
|
+
padding: var(--page-margin);
|
|
144
|
+
display: flex;
|
|
145
|
+
max-height: calc(100vh - (2 * var(--page-margin)));
|
|
146
|
+
}
|
|
147
|
+
@media (max-width: 600px) {
|
|
148
|
+
.dialog__position {
|
|
149
|
+
inset: var(--page-margin);
|
|
150
|
+
padding: 0;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.dialog__position:has(.editor) {
|
|
155
|
+
inset: var(--page-margin);
|
|
156
|
+
padding: 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.dialog:not([open]) {
|
|
160
|
+
opacity: 0;
|
|
161
|
+
pointer-events: none;
|
|
162
|
+
visibility: hidden;
|
|
163
|
+
}
|
|
164
|
+
.dialog:not([open]) .dialog__content {
|
|
165
|
+
transform: translate(0, -16px) scale(0.98);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.dialog__content {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
gap: 16px;
|
|
172
|
+
padding: var(--dialog-padding, 24px);
|
|
173
|
+
max-width: 100%;
|
|
174
|
+
width: 100%;
|
|
175
|
+
max-height: 100%;
|
|
176
|
+
overflow: auto;
|
|
177
|
+
|
|
178
|
+
background: var(--dialog-background, var(--background));
|
|
179
|
+
border-radius: var(--dialog-border-radius, 20px);
|
|
180
|
+
border: var(--dialog-border, var(--border));
|
|
181
|
+
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
|
|
182
|
+
transform: translate(0, 0) scale(1);
|
|
183
|
+
transition: transform 0.2s ease-in-out;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
`,YF=`
|
|
187
|
+
.dialog__header {
|
|
188
|
+
display: flex;
|
|
189
|
+
gap: 4px;
|
|
190
|
+
justify-content: space-between;
|
|
191
|
+
font-weight: var(--dialog-header-weight, 600);
|
|
192
|
+
margin: 0;
|
|
193
|
+
}
|
|
194
|
+
.dialog__title {
|
|
195
|
+
align-self: center;
|
|
196
|
+
width: var(--form-width, 272px);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@media (max-width: 600px) {
|
|
200
|
+
.dialog__title {
|
|
201
|
+
width: auto;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.dialog__position:has(.editor) .dialog__title {
|
|
206
|
+
width: auto;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
.brand-link {
|
|
211
|
+
display: inline-flex;
|
|
212
|
+
}
|
|
213
|
+
.brand-link:focus-visible {
|
|
214
|
+
outline: var(--outline);
|
|
215
|
+
}
|
|
216
|
+
`,WF=`
|
|
217
|
+
.form {
|
|
218
|
+
display: flex;
|
|
219
|
+
overflow: auto;
|
|
220
|
+
flex-direction: row;
|
|
221
|
+
gap: 16px;
|
|
222
|
+
flex: 1 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.form fieldset {
|
|
226
|
+
border: none;
|
|
227
|
+
margin: 0;
|
|
228
|
+
padding: 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.form__right {
|
|
232
|
+
flex: 0 0 auto;
|
|
233
|
+
display: flex;
|
|
234
|
+
overflow: auto;
|
|
235
|
+
flex-direction: column;
|
|
236
|
+
justify-content: space-between;
|
|
237
|
+
gap: 20px;
|
|
238
|
+
width: var(--form-width, 100%);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.dialog__position:has(.editor) .form__right {
|
|
242
|
+
width: var(--form-width, 272px);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.form__top {
|
|
246
|
+
display: flex;
|
|
247
|
+
flex-direction: column;
|
|
248
|
+
gap: 8px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.form__error-container {
|
|
252
|
+
color: var(--error-color);
|
|
253
|
+
fill: var(--error-color);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.form__label {
|
|
257
|
+
display: flex;
|
|
258
|
+
flex-direction: column;
|
|
259
|
+
gap: 4px;
|
|
260
|
+
margin: 0px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.form__label__text {
|
|
264
|
+
display: flex;
|
|
265
|
+
gap: 4px;
|
|
266
|
+
align-items: center;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.form__label__text--required {
|
|
270
|
+
font-size: 0.85em;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.form__input {
|
|
274
|
+
font-family: inherit;
|
|
275
|
+
line-height: inherit;
|
|
276
|
+
background: transparent;
|
|
277
|
+
box-sizing: border-box;
|
|
278
|
+
border: var(--input-border, var(--border));
|
|
279
|
+
border-radius: var(--input-border-radius, 6px);
|
|
280
|
+
color: var(--input-color, inherit);
|
|
281
|
+
fill: var(--input-color, inherit);
|
|
282
|
+
font-size: var(--input-font-size, inherit);
|
|
283
|
+
font-weight: var(--input-font-weight, 500);
|
|
284
|
+
padding: 6px 12px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.form__input::placeholder {
|
|
288
|
+
opacity: 0.65;
|
|
289
|
+
color: var(--input-placeholder-color, inherit);
|
|
290
|
+
filter: var(--interactive-filter);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.form__input:focus-visible {
|
|
294
|
+
outline: var(--input-focus-outline, var(--outline));
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.form__input--textarea {
|
|
298
|
+
font-family: inherit;
|
|
299
|
+
resize: vertical;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.error {
|
|
303
|
+
color: var(--error-color);
|
|
304
|
+
fill: var(--error-color);
|
|
305
|
+
}
|
|
306
|
+
`,KF=`
|
|
307
|
+
.btn-group {
|
|
308
|
+
display: grid;
|
|
309
|
+
gap: 8px;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.btn {
|
|
313
|
+
line-height: inherit;
|
|
314
|
+
border: var(--button-border, var(--border));
|
|
315
|
+
border-radius: var(--button-border-radius, 6px);
|
|
316
|
+
cursor: pointer;
|
|
317
|
+
font-family: inherit;
|
|
318
|
+
font-size: var(--button-font-size, inherit);
|
|
319
|
+
font-weight: var(--button-font-weight, 600);
|
|
320
|
+
padding: var(--button-padding, 6px 16px);
|
|
321
|
+
}
|
|
322
|
+
.btn[disabled] {
|
|
323
|
+
opacity: 0.6;
|
|
324
|
+
pointer-events: none;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.btn--primary {
|
|
328
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
329
|
+
fill: var(--button-primary-color, var(--accent-foreground));
|
|
330
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
331
|
+
border: var(--button-primary-border, var(--border));
|
|
332
|
+
border-radius: var(--button-primary-border-radius, 6px);
|
|
333
|
+
font-weight: var(--button-primary-font-weight, 500);
|
|
334
|
+
}
|
|
335
|
+
.btn--primary:hover {
|
|
336
|
+
color: var(--button-primary-hover-color, var(--accent-foreground));
|
|
337
|
+
fill: var(--button-primary-hover-color, var(--accent-foreground));
|
|
338
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
339
|
+
filter: var(--interactive-filter);
|
|
340
|
+
}
|
|
341
|
+
.btn--primary:focus-visible {
|
|
342
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
343
|
+
filter: var(--interactive-filter);
|
|
344
|
+
outline: var(--button-primary-focus-outline, var(--outline));
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.btn--default {
|
|
348
|
+
color: var(--button-color, var(--foreground));
|
|
349
|
+
fill: var(--button-color, var(--foreground));
|
|
350
|
+
background: var(--button-background, var(--background));
|
|
351
|
+
border: var(--button-border, var(--border));
|
|
352
|
+
border-radius: var(--button-border-radius, 6px);
|
|
353
|
+
font-weight: var(--button-font-weight, 500);
|
|
354
|
+
}
|
|
355
|
+
.btn--default:hover {
|
|
356
|
+
color: var(--button-color, var(--foreground));
|
|
357
|
+
fill: var(--button-color, var(--foreground));
|
|
358
|
+
background: var(--button-hover-background, var(--background));
|
|
359
|
+
filter: var(--interactive-filter);
|
|
360
|
+
}
|
|
361
|
+
.btn--default:focus-visible {
|
|
362
|
+
background: var(--button-hover-background, var(--background));
|
|
363
|
+
filter: var(--interactive-filter);
|
|
364
|
+
outline: var(--button-focus-outline, var(--outline));
|
|
365
|
+
}
|
|
366
|
+
`,XF=`
|
|
367
|
+
.success__position {
|
|
368
|
+
position: fixed;
|
|
369
|
+
inset: var(--dialog-inset);
|
|
370
|
+
padding: var(--page-margin);
|
|
371
|
+
z-index: var(--z-index);
|
|
372
|
+
}
|
|
373
|
+
.success__content {
|
|
374
|
+
background: var(--success-background, var(--background));
|
|
375
|
+
border: var(--success-border, var(--border));
|
|
376
|
+
border-radius: var(--success-border-radius, 1.7em/50%);
|
|
377
|
+
box-shadow: var(--success-box-shadow, var(--box-shadow));
|
|
378
|
+
font-weight: var(--success-font-weight, 600);
|
|
379
|
+
color: var(--success-color);
|
|
380
|
+
fill: var(--success-color);
|
|
381
|
+
padding: 12px 24px;
|
|
382
|
+
line-height: 1.75em;
|
|
383
|
+
|
|
384
|
+
display: grid;
|
|
385
|
+
align-items: center;
|
|
386
|
+
grid-auto-flow: column;
|
|
387
|
+
gap: 6px;
|
|
388
|
+
cursor: default;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.success__icon {
|
|
392
|
+
display: flex;
|
|
393
|
+
}
|
|
394
|
+
`;function JF(t){let e=ye.createElement("style");return e.textContent=`
|
|
395
|
+
:host {
|
|
396
|
+
--dialog-inset: var(--inset);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
${VF}
|
|
400
|
+
${YF}
|
|
401
|
+
${WF}
|
|
402
|
+
${KF}
|
|
403
|
+
${XF}
|
|
404
|
+
`,t&&e.setAttribute("nonce",t),e}function QF(){let t=nt().getUser(),e=zt().getUser(),n=lr().getUser();return t&&Object.keys(t).length?t:e&&Object.keys(e).length?e:n}var JR=(()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:t,screenshotIntegration:e,sendFeedback:n,shadow:r})=>{let o=r,i=t.useSentryUser,a=QF(),s=ye.createElement("div"),l=JF(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?.(),B()?.emit("openFeedbackWidget"),c=ye.body.style.overflow,ye.body.style.overflow="hidden"},close(){p(!1),ye.body.style.overflow=c}},u=e?.createInput({h:$t,hooks:BF,dialog:d,options:t}),p=f=>{IF($t(qF,{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 ZF({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 tH(t){let e=ye.createElement("style"),n="#1A141F",r="#302735";return e.textContent=`
|
|
405
|
+
.editor {
|
|
406
|
+
display: flex;
|
|
407
|
+
flex-grow: 1;
|
|
408
|
+
flex-direction: column;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.editor__image-container {
|
|
412
|
+
justify-items: center;
|
|
413
|
+
padding: 15px;
|
|
414
|
+
position: relative;
|
|
415
|
+
height: 100%;
|
|
416
|
+
border-radius: var(--menu-border-radius, 6px);
|
|
417
|
+
|
|
418
|
+
background-color: ${n};
|
|
419
|
+
background-image: repeating-linear-gradient(
|
|
420
|
+
-145deg,
|
|
421
|
+
transparent,
|
|
422
|
+
transparent 8px,
|
|
423
|
+
${n} 8px,
|
|
424
|
+
${n} 11px
|
|
425
|
+
),
|
|
426
|
+
repeating-linear-gradient(
|
|
427
|
+
-45deg,
|
|
428
|
+
transparent,
|
|
429
|
+
transparent 15px,
|
|
430
|
+
${r} 15px,
|
|
431
|
+
${r} 16px
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.editor__canvas-container {
|
|
436
|
+
width: 100%;
|
|
437
|
+
height: 100%;
|
|
438
|
+
position: relative;
|
|
439
|
+
display: flex;
|
|
440
|
+
align-items: center;
|
|
441
|
+
justify-content: center;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.editor__canvas-container > * {
|
|
445
|
+
object-fit: contain;
|
|
446
|
+
position: absolute;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.editor__tool-container {
|
|
450
|
+
padding-top: 8px;
|
|
451
|
+
display: flex;
|
|
452
|
+
justify-content: center;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.editor__tool-bar {
|
|
456
|
+
display: flex;
|
|
457
|
+
gap: 8px;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.editor__tool {
|
|
461
|
+
display: flex;
|
|
462
|
+
padding: 8px 12px;
|
|
463
|
+
justify-content: center;
|
|
464
|
+
align-items: center;
|
|
465
|
+
border: var(--button-border, var(--border));
|
|
466
|
+
border-radius: var(--button-border-radius, 6px);
|
|
467
|
+
background: var(--button-background, var(--background));
|
|
468
|
+
color: var(--button-color, var(--foreground));
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.editor__tool--active {
|
|
472
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
473
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.editor__rect {
|
|
477
|
+
position: absolute;
|
|
478
|
+
z-index: 2;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.editor__rect button {
|
|
482
|
+
opacity: 0;
|
|
483
|
+
position: absolute;
|
|
484
|
+
top: -12px;
|
|
485
|
+
right: -12px;
|
|
486
|
+
cursor: pointer;
|
|
487
|
+
padding: 0;
|
|
488
|
+
z-index: 3;
|
|
489
|
+
border: none;
|
|
490
|
+
background: none;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.editor__rect:hover button {
|
|
494
|
+
opacity: 1;
|
|
495
|
+
}
|
|
496
|
+
`,t&&e.setAttribute("nonce",t),e}function eH({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 nH({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 zf.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 rH(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 Zv(t,e){Ya(t,{alpha:!0},(n,r)=>{r.drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height)})}function tS(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=>{rH(i,o,e)})})}function oH({h:t,hooks:e,outputBuffer:n,dialog:r,options:o}){let i=nH({hooks:e}),a=eH({h:t}),s=ZF({h:t}),l={__html:tH(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),b=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 W=getComputedStyle(N);return W.getPropertyValue("--button-primary-background")||W.getPropertyValue("--accent-background")},[o.id]);e.useLayoutEffect(()=>{let N=()=>{let W=v.current;W&&(Ya(u.canvas,{alpha:!1},X=>{let pt=Math.min(W.clientWidth/X.width,W.clientHeight/X.height);R(pt)}),(W.clientHeight===0||W.clientWidth===0)&&setTimeout(N,0))};return N(),jo.addEventListener("resize",N),()=>{jo.removeEventListener("resize",N)}},[u]);let I=e.useCallback((N,W)=>{Ya(N,{alpha:!0},(X,pt)=>{pt.scale(W,W),X.width=u.canvas.width,X.height=u.canvas.height})},[u]);e.useEffect(()=>{I(h.current,u.dpi),Zv(h.current,u.canvas)},[u]),e.useEffect(()=>{I(b.current,u.dpi),Ya(b.current,{alpha:!0},(N,W)=>{W.clearRect(0,0,N.width,N.height)}),tS(b.current,C,m)},[m,C]),e.useEffect(()=>{I(n,u.dpi),Zv(n,u.canvas),Ya(ye.createElement("canvas"),{alpha:!0},(N,W)=>{W.scale(u.dpi,u.dpi),N.width=u.canvas.width,N.height=u.canvas.height,tS(N,C,m),Zv(n,N)})},[m,u,C]);let L=N=>{if(!p||!S.current)return;let W=S.current.getBoundingClientRect(),X={type:p,x:N.offsetX/E,y:N.offsetY/E},pt=(H,ct)=>{let Y=(ct.clientX-W.x)/E,dt=(ct.clientY-W.y)/E;return{type:H.type,x:Math.min(H.x,Y),y:Math.min(H.y,dt),w:Math.abs(Y-H.x),h:Math.abs(dt-H.y)}},et=H=>{Ya(b.current,{alpha:!0},(ct,Y)=>{Y.clearRect(0,0,ct.width,ct.height)}),tS(b.current,C,[...m,pt(X,H)])},lt=H=>{let ct=pt(X,H);ct.w*E>=1&&ct.h*E>=1&&_(Y=>[...Y,ct]),ye.removeEventListener("mousemove",et),ye.removeEventListener("mouseup",lt)};ye.addEventListener("mousemove",et),ye.addEventListener("mouseup",lt)},P=e.useCallback(N=>W=>{W.preventDefault(),W.stopPropagation(),_(X=>{let pt=[...X];return pt.splice(N,1),pt})},[]),U={width:`${u.canvas.width*E}px`,height:`${u.canvas.height*E}px`},O=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:b,id:"foreground",style:U}),t("div",{ref:S,onMouseDown:L,style:U},m.map((N,W)=>t("div",{key:W,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:P(W),onMouseDown:O,onMouseUp:O,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,b)=>{b.scale(v,v),h.width=_.videoWidth,h.height=_.videoHeight,b.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 QR=(()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:t,hooks:e,dialog:n,options:r})=>{let o=ye.createElement("canvas");return{input:oH({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 j=Z,dS=0;function fS(){return dS>0}function iH(){dS++,setTimeout(()=>{dS--})}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){Z._sentryWrappedDepth=(Z._sentryWrappedDepth||0)+1;try{let i=o.map(a=>ul(a,e));return t.apply(this,i)}catch(i){throw iH(),Ce(a=>{a.addEventProcessor(s=>(e.mechanism&&(Ps(s,void 0,void 0),Sn(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),wt(i)}),i}finally{Z._sentryWrappedDepth=(Z._sentryWrappedDepth||0)-1}};try{for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch{}Xd(r,t),Ht(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function lu(){let t=Wn(),{referrer:e}=j.document||{},{userAgent:n}=j.navigator||{},r={...e&&{Referer:e},...n&&{"User-Agent":n}};return{url:t,headers:r}}var aH=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],sH={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function lH(t){return sH[t]||t.replace("Integration","").toLowerCase()}var ZR=j;async function qh(t,e){let n=aH.includes(t)?lH(t):void 0,r=ZR.Sentry=ZR.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=cH(n),a=j.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=j.document.currentScript,c=j.document.body||j.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 cH(t){let n=B()?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${ir}/${t}.min.js`,n).toString()}var tN=$h({lazyLoadIntegration:qh});var pS=$h({getModalIntegration:()=>JR,getScreenshotIntegration:()=>QR});function cu(t,e){let n=Vh(t,e),r={type:mH(e),value:gH(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function uH(t,e,n,r){let i=B()?.getOptions().normalizeDepth,a=bH(e),s={__serialized__:Qd(e,i)};if(a)return{exception:{values:[cu(t,a)]},extra:s};let l={exception:{values:[{type:xa(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:hH(e,{isUnhandledRejection:r})}]},extra:s};if(n){let c=Vh(t,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function mS(t,e){return{exception:{values:[cu(t,e)]}}}function Vh(t,e){let n=e.stacktrace||e.stack||"",r=fH(e),o=pH(e);try{return t(n,r,o)}catch{}return[]}var dH=/Minified React error #\d+;/i;function fH(t){return t&&dH.test(t.message)?1:0}function pH(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function eN(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function mH(t){let e=t?.name;return!e&&eN(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function gH(t){let e=t?.message;return eN(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?sh(e.error):sh(t):"No error message"}function Yh(t,e,n,r){let o=n?.syntheticException||void 0,i=uu(t,e,o,r);return Sn(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),li(i)}function Wh(t,e,n="info",r,o){let i=r?.syntheticException||void 0,a=gS(t,e,i,o);return a.level=n,r?.event_id&&(a.event_id=r.event_id),li(a)}function uu(t,e,n,r,o){let i;if(hc(e)&&e.error)return mS(t,e.error);if(Wd(e)||Jm(e)){let a=e;if("stack"in e){i=mS(t,e);let s=i.exception?.values?.[0];if(r&&n&&s&&!s.stacktrace){let l=Vh(t,n);l.length&&(s.stacktrace={frames:l},Sn(i,{synthetic:!0}))}}else{let s=a.name||(Wd(a)?"DOMError":"DOMException"),l=a.message?`${s}: ${a.message}`:s;i=gS(t,l,n,r),Ps(i,l)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return fn(e)?mS(t,e):ge(e)||xa(e)?(i=uH(t,e,n,o),Sn(i,{synthetic:!0}),i):(i=gS(t,e,n,r),Ps(i,`${e}`,void 0),Sn(i,{synthetic:!0}),i)}function gS(t,e,n,r){let o={};if(r&&n){let i=Vh(t,n);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]}),Sn(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 hH(t,{isUnhandledRejection:e}){let n=Zm(t),r=e?"promise rejection":"exception";return hc(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:xa(t)?`Event \`${yH(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function yH(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function bH(t){return Object.values(t).find(e=>e instanceof Error)}var du=class extends If{constructor(e){let n=_H(e),r=j.SENTRY_SDK_SOURCE||ev();Rf(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;j.document&&(i||a||c)&&j.document.addEventListener("visibilitychange",()=>{j.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),a&&Js(this),c&&Bc(this))}),o&&this.on("beforeSendSession",yv)}eventFromException(e,n){return Yh(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Wh(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 _H(t){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:j.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...t}}var wn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var ht=Z;var vH=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",yi=(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=vH(e.value,n),t(e)))}};var ji=(t=!0)=>{let e=ht.performance?.getEntriesByType?.("navigation")[0];if(!t||e&&e.responseStart>0&&e.responseStart<performance.now())return e};var so=()=>ji()?.activationStart??0;function lo(t,e,n){ht.document&&ht.addEventListener(t,e,n)}function dl(t,e,n){ht.document&&ht.removeEventListener(t,e,n)}var fu=-1,nN=new Set,SH=()=>ht.document?.visibilityState==="hidden"&&!ht.document?.prerendering?0:1/0,Kh=t=>{if(EH(t)&&fu>-1){if(t.type==="visibilitychange"||t.type==="pagehide")for(let e of nN)e();isFinite(fu)||(fu=t.type==="visibilitychange"?t.timeStamp:0,dl("prerenderingchange",Kh,!0))}},bi=()=>{if(ht.document&&fu<0){let t=so();fu=(ht.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>t)[0]?.startTime)??SH(),lo("visibilitychange",Kh,!0),lo("pagehide",Kh,!0),lo("prerenderingchange",Kh,!0)}return{get firstHiddenTime(){return fu},onHidden(t){nN.add(t)}}};function EH(t){return t.type==="pagehide"||ht.document?.visibilityState==="hidden"}var rN=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var _i=(t,e=-1)=>{let n=ji(),r="navigate";return n&&(ht.document?.prerendering||so()>0?r="prerender":ht.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:rN(),navigationType:r}};var hS=new WeakMap;function pu(t,e){try{return hS.get(t)||hS.set(t,new e),hS.get(t)}catch{return new e}}var Xh=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 co=(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 mu=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Ka=t=>{ht.document?.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()};var TH=[1800,3e3],oN=(t,e={})=>{Ka(()=>{let n=bi(),r=_i("FCP"),o,a=co("paint",s=>{for(let l of s)l.name==="first-contentful-paint"&&(a.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-so(),0),r.entries.push(l),o(!0)))});a&&(o=yi(t,r,TH,e.reportAllChanges))})};var wH=[.1,.25],iN=(t,e={})=>{oN(mu(()=>{let n=_i("CLS",0),r,o=bi(),i=pu(e,Xh),a=l=>{for(let c of l)i._processEntry(c);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},s=co("layout-shift",a);s&&(r=yi(t,n,wH,e.reportAllChanges),o.onHidden(()=>{a(s.takeRecords()),r(!0)}),ht?.setTimeout?.(r))}))};var aN=0,yS=1/0,Jh=0,xH=t=>{t.forEach(e=>{e.interactionId&&(yS=Math.min(yS,e.interactionId),Jh=Math.max(Jh,e.interactionId),aN=Jh?(Jh-yS)/7+1:0)})},bS,_S=()=>bS?aN:performance.interactionCount||0,sN=()=>{"interactionCount"in performance||bS||(bS=co("event",xH,{type:"event",buffered:!0,durationThreshold:0}))};var vS=10,lN=0,AH=()=>_S()-lN,Qh=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){lN=_S(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(AH()/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<vS||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>vS){let o=this._longestInteractionList.splice(vS);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var fl=t=>{let e=ht.requestIdleCallback||ht.setTimeout;ht.document?.visibilityState==="hidden"?t():(t=mu(t),lo("visibilitychange",t,{once:!0,capture:!0}),lo("pagehide",t,{once:!0,capture:!0}),e(()=>{t(),dl("visibilitychange",t,{capture:!0}),dl("pagehide",t,{capture:!0})}))};var IH=[200,500],kH=40,cN=(t,e={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=bi();Ka(()=>{sN();let r=_i("INP"),o,i=pu(e,Qh),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=co("event",a,{durationThreshold:e.durationThreshold??kH});o=yi(t,r,IH,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{a(s.takeRecords()),o(!0)}))})};var Zh=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}};var RH=[2500,4e3],uN=(t,e={})=>{Ka(()=>{let n=bi(),r=_i("LCP"),o,i=pu(e,Zh),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-so(),0),r.entries=[c],o())},s=co("largest-contentful-paint",a);if(s){o=yi(t,r,RH,e.reportAllChanges);let l=mu(()=>{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"])lo(d,c,{capture:!0})}})};var NH=[800,1800],SS=t=>{ht.document?.prerendering?Ka(()=>SS(t)):ht.document?.readyState!=="complete"?addEventListener("load",()=>SS(t),!0):setTimeout(t)},dN=(t,e={})=>{let n=_i("TTFB"),r=yi(t,n,NH,e.reportAllChanges);SS(()=>{let o=ji();o&&(n.value=Math.max(o.responseStart-so(),0),n.entries=[o],r(!0))})};var $f={},ty={},fN,pN,mN,gN;function qi(t,e=!1){return ey("cls",t,CH,fN,e)}function Vi(t,e=!1){return ey("lcp",t,MH,pN,e)}function ES(t){return ey("ttfb",t,OH,mN)}function pl(t){return ey("inp",t,DH,gN)}function hr(t,e){return hN(t,e),ty[t]||(LH(t),ty[t]=!0),yN(t,e)}function jf(t,e){let n=$f[t];if(n?.length)for(let r of n)try{r(e)}catch(o){wn&&w.error(`Error while triggering instrumentation handler.
|
|
497
|
+
Type: ${t}
|
|
498
|
+
Name: ${Qn(r)}
|
|
499
|
+
Error:`,o)}}function CH(){return iN(t=>{jf("cls",{metric:t}),fN=t},{reportAllChanges:!0})}function MH(){return uN(t=>{jf("lcp",{metric:t}),pN=t},{reportAllChanges:!0})}function OH(){return dN(t=>{jf("ttfb",{metric:t}),mN=t})}function DH(){return cN(t=>{jf("inp",{metric:t}),gN=t})}function ey(t,e,n,r,o=!1){hN(t,e);let i;return ty[t]||(i=n(),ty[t]=!0),r&&e({metric:r}),yN(t,e,o?i:void 0)}function LH(t){let e={};t==="event"&&(e.durationThreshold=0),co(t,n=>{jf(t,{entries:n})},e)}function hN(t,e){$f[t]=$f[t]||[],$f[t].push(e)}function yN(t,e,n){return()=>{n&&n();let r=$f[t];if(!r)return;let o=r.indexOf(e);o!==-1&&r.splice(o,1)}}function bN(t){return"duration"in t}var UH=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 de(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||UH;for(;n&&i++<r&&(c=BH(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 BH(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&&pn(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 _N=t=>{let e=n=>{(n.type==="pagehide"||ht.document?.visibilityState==="hidden")&&t(n)};lo("visibilitychange",e,{capture:!0,once:!0}),lo("pagehide",e,{capture:!0,once:!0})};function ny(t){return typeof t=="number"&&isFinite(t)}function Yi(t,e,n,{...r}){let o=tt(t).start_timestamp;return o&&o>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),Qr(t,()=>{let i=xe({startTime:e,...r});return i&&i.end(n),i})}function gu(t){let e=B();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=nt(),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":ht.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return xe({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function uo(){return ht.addEventListener&&ht.performance}function ie(t){return t/1e3}function vN(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}_N(()=>{o("pagehide")});let i=t.on("beforeStartNavigationSpan",(s,l)=>{l?.isRedirect||(o("navigation"),i(),a())}),a=t.on("afterStartPageLoadSpan",s=>{n=s,a()})}function SN(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)=>{PH(e,n,i,o),r()})}function PH(t,e,n,r){wn&&w.log(`Sending CLS span (${t})`);let o=e?ie((Qt()||0)+e.startTime):Ot(),i=nt().getScopeData().transactionName,a=e?de(e.sources[0]?.node):"Layout shift",s={[at]:"auto.http.browser.cls",[bt]:"ui.webvital.cls",[$n]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e?.sources&&e.sources.forEach((c,d)=>{s[`cls.source.${d+1}`]=de(c.node)});let l=gu({name:a,transaction:i,attributes:s,startTime:o});l&&(l.addEvent("cls",{[Bo]:"",[Po]:t}),l.end(o))}var zH=6e4;function yl(t){return t!=null&&t>0&&t<=zH}function EN(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||!yl(o.value)||(e=o.value,n=i)},!0);hl(t,(o,i)=>{FH(e,n,i,o),r()})}function FH(t,e,n,r){if(!yl(t))return;wn&&w.log(`Sending LCP span (${t})`);let o=ie((Qt()||0)+(e?.startTime||0)),i=nt().getScopeData().transactionName,a=e?de(e.element):"Largest contentful paint",s={[at]:"auto.http.browser.lcp",[bt]:"ui.webvital.lcp",[$n]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e&&(e.element&&(s["lcp.element"]=de(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=gu({name:a,transaction:i,attributes:s,startTime:o});l&&(l.addEvent("lcp",{[Bo]:"millisecond",[Po]:t}),l.end(o))}function fo(t){return t&&((Qt()||performance.timeOrigin)+t)/1e3}function qf(t){let e={};if(t.nextHopProtocol!=null){let{name:n,version:r}=vN(t.nextHopProtocol);e["network.protocol.version"]=r,e["network.protocol.name"]=n}return Qt()||uo()?.timeOrigin?HH({...e,"http.request.redirect_start":fo(t.redirectStart),"http.request.redirect_end":fo(t.redirectEnd),"http.request.worker_start":fo(t.workerStart),"http.request.fetch_start":fo(t.fetchStart),"http.request.domain_lookup_start":fo(t.domainLookupStart),"http.request.domain_lookup_end":fo(t.domainLookupEnd),"http.request.connect_start":fo(t.connectStart),"http.request.secure_connection_start":fo(t.secureConnectionStart),"http.request.connection_end":fo(t.connectEnd),"http.request.request_start":fo(t.requestStart),"http.request.response_start":fo(t.responseStart),"http.request.response_end":fo(t.responseEnd),"http.request.time_to_first_byte":t.responseStart!=null?t.responseStart/1e3:void 0}):e}function HH(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!=null))}var GH=2147483647,TN=0,br={},yr,oy;function TS({recordClsStandaloneSpans:t,recordLcpStandaloneSpans:e,client:n}){let r=uo();if(r&&Qt()){r.mark&&ht.performance.mark("sentry-tracing-init");let o=e?EN(n):e===!1?jH():void 0,i=t?SN(n):t===!1?$H():void 0,a=qH(),s=VH();return()=>{a(),s(),o?.(),i?.()}}return()=>{}}function wS(){hr("longtask",({entries:t})=>{let e=Lt();if(!e)return;let{op:n,start_timestamp:r}=tt(e);for(let o of t){let i=ie(Qt()+o.startTime),a=ie(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 xS(){new PerformanceObserver(e=>{let n=Lt();if(n)for(let r of e.getEntries()){if(!r.scripts[0])continue;let o=ie(Qt()+r.startTime),{start_timestamp:i,op:a}=tt(n);if(a==="navigation"&&i&&o<i)continue;let s=ie(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 AS(){hr("event",({entries:t})=>{let e=Lt();if(e){for(let n of t)if(n.name==="click"){let r=ie(Qt()+n.startTime),o=ie(n.duration),i={name:de(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 $H(){return qi(({metric:t})=>{let e=t.entries[t.entries.length-1];e&&(br.cls={value:t.value,unit:""},oy=e)},!0)}function jH(){return Vi(({metric:t})=>{let e=t.entries[t.entries.length-1];!e||!yl(t.value)||(br.lcp={value:t.value,unit:"millisecond"},yr=e)},!0)}function qH(){return ES(({metric:t})=>{t.entries[t.entries.length-1]&&(br.ttfb={value:t.value,unit:"millisecond"})})}function VH(){return hr("paint",({entries:t})=>{let e=bi();for(let n of t){let r=n.startTime<e.firstHiddenTime;n.name==="first-paint"&&r&&(br.fp={value:n.startTime,unit:"millisecond"}),n.name==="first-contentful-paint"&&r&&(br.fcp={value:n.startTime,unit:"millisecond"})}})}function IS(t,e){let n=uo(),r=Qt();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:a}=e,s=ie(r),l=n.getEntries(),{op:c,start_timestamp:d}=tt(t);l.slice(TN).forEach(u=>{let p=ie(u.startTime),f=ie(Math.max(0,u.duration));if(!(c==="navigation"&&d&&s+p<d))switch(u.entryType){case"navigation":{XH(t,u,s);break}case"mark":case"paint":case"measure":{WH(t,u,p,f,s,i);break}case"resource":{ZH(t,u,u.name,p,f,s,a);break}}}),TN=Math.max(l.length-1,0),t7(t,o)}function kS(t,e){let n=Qt();if(!uo()?.getEntries||!n){wN();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:o,recordLcpOnPageloadSpan:i}=e,a=ie(n);if(tt(t).op==="pageload"){if(r7(br),r){let s=(l,c,d)=>{let u=d??`browser.web_vital.${l}.value`;t.setAttribute(u,c),wn&&w.log("Setting web vital attribute",{[u]:c},"on pageload span")};["ttfb","fp","fcp"].forEach(l=>{br[l]&&s(l,br[l].value)}),br["ttfb.requestTime"]&&s("ttfb.requestTime",br["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else o||delete br.cls,i||delete br.lcp,Object.entries(br).forEach(([s,l])=>{qs(s,l.value,l.unit,t)}),e7(t,e);t.setAttribute(r?"browser.performance.time_origin":"performance.timeOrigin",a),t.setAttribute(r?"browser.performance.navigation.activation_start":"performance.activationStart",so())}wN()}function wN(){yr=void 0,oy=void 0,br={}}function YH(t){if(t?.entryType==="measure")try{return t.detail.devtools.track==="Components \u269B"}catch{return}}function WH(t,e,n,r,o,i){if(YH(e)||["mark","measure"].includes(e.entryType)&&nn(e.name,i))return;let a=ji(!1),s=ie(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),KH(u,e),l<=d&&Yi(t,l,d,{name:e.name,op:e.entryType,attributes:u})}function KH(t,e){try{let n=e.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&en(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(en(n)){t["sentry.browser.measure.detail"]=n;return}try{t["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function XH(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{ry(t,e,r,n)}),ry(t,e,"secureConnection",n,"TLS/SSL"),ry(t,e,"fetch",n,"cache"),ry(t,e,"domainLookup",n,"DNS"),QH(t,e,n)}function ry(t,e,n,r,o=n){let i=JH(n),a=e[i],s=e[`${n}Start`];!s||!a||Yi(t,r+ie(s),r+ie(a),{op:`browser.${o}`,name:e.name,attributes:{[at]:"auto.ui.browser.metrics",...n==="redirect"&&e.redirectCount!=null?{"http.redirect_count":e.redirectCount}:{}}})}function JH(t){return t==="secureConnection"?"connectEnd":t==="fetch"?"domainLookupStart":`${t}End`}function QH(t,e,n){let r=n+ie(e.requestStart),o=n+ie(e.responseEnd),i=n+ie(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 ZH(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=to(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(ht.location.origin),l[Tc]=n,n7(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,...qf(e)},u=i+r,p=u+o;Yi(t,u,p,{name:n.replace(ht.location.origin,""),op:s,attributes:d})}function t7(t,e){let n=ht.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),ny(r.rtt)&&(e?t.setAttribute("network.connection.rtt",r.rtt):tt(t).op==="pageload"&&qs("connection.rtt",r.rtt,"millisecond"))),ny(n.deviceMemory)&&(e?t.setAttribute("device.memory.estimated_capacity",n.deviceMemory):t.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),ny(n.hardwareConcurrency)&&(e?t.setAttribute("device.processor_count",n.hardwareConcurrency):t.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function e7(t,e){yr&&e.recordLcpOnPageloadSpan&&(yr.element&&t.setAttribute("lcp.element",de(yr.element)),yr.id&&t.setAttribute("lcp.id",yr.id),yr.url&&t.setAttribute("lcp.url",yr.url.trim().slice(0,200)),yr.loadTime!=null&&t.setAttribute("lcp.loadTime",yr.loadTime),yr.renderTime!=null&&t.setAttribute("lcp.renderTime",yr.renderTime),t.setAttribute("lcp.size",yr.size)),oy?.sources&&e.recordClsOnPageloadSpan&&oy.sources.forEach((n,r)=>t.setAttribute(`cls.source.${r+1}`,de(n.node)))}function n7(t,e,n){n.forEach(([r,o])=>{let i=t[r];i!=null&&(typeof i=="number"&&i<GH||typeof i=="string")&&(e[o]=i)})}function r7(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 o7="ElementTiming",i7=(()=>({name:o7,setup(){!uo()||!Qt()||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})}})}})),RS=i7;var NS=[],Vf=new Map,hu=new Map,CS=60;function MS(){if(uo()&&Qt()){let e=a7();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 a7(){return pl(s7)}var s7=({metric:t})=>{if(t.value==null)return;let e=ie(t.value);if(e>CS)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=ie(Qt()+n.startTime),a=Lt(),s=a?Pt(a):void 0,l=r!=null?Vf.get(r):void 0,c=l?.span||s,d=c?tt(c).description:nt().getScopeData().transactionName,u=l?.elementName||de(n.target),p={[at]:"auto.http.browser.inp",[bt]:`ui.interaction.${o}`,[$n]:n.duration},f=gu({name:u,transaction:d,attributes:p,startTime:i});f&&(f.addEvent("inp",{[Bo]:"millisecond",[Po]:t.value}),f.end(i+e))};function xN(t){return t!=null?Vf.get(t):void 0}function OS(){let t=Object.keys(yu);qn()&&t.forEach(o=>{ht.addEventListener(o,e,{capture:!0,passive:!0})});function e(o){let i=o.target;if(!i)return;let a=de(i),s=Math.round(o.timeStamp);if(hu.set(s,a),hu.size>50){let l=hu.keys().next().value;l!==void 0&&hu.delete(l)}}function n(o){let i=Math.round(o.startTime),a=hu.get(i);if(!a)for(let s=-5;s<=5;s++){let l=hu.get(i+s);if(l){a=l;break}}return a||"<unknown>"}let r=({entries:o})=>{let i=Lt(),a=i&&Pt(i);o.forEach(s=>{if(!bN(s))return;let l=s.interactionId;if(l==null||Vf.has(l))return;let c=s.target?de(s.target):n(s);if(NS.length>10){let d=NS.shift();Vf.delete(d)}NS.push(l),Vf.set(l,{span:a,elementName:c})})};hr("event",r),hr("first-input",r)}function DS(t){let{name:e,op:n,origin:r,metricName:o,value:i,attributes:a,parentSpan:s,reportEvent:l,startTime:c,endTime:d}=t,u=nt().getScopeData().transactionName,p={[at]:r,[bt]:n,[$n]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":u,"user_agent.original":ht.navigator?.userAgent,...a};s&&Ca(s).attributes?.[bt]==="pageload"&&(p["sentry.pageload.span_id"]=s.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let f=xe({name:e,attributes:p,startTime:c,parentSpan:s});f&&f.end(d??c)}function LS(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||!yl(o.value)||(e=o.value,n=i)},!0);hl(t,(o,i,a)=>{l7(e,n,a,o),r()})}function l7(t,e,n,r){if(!yl(t))return;wn&&w.log(`Sending LCP span (${t})`);let o=Qt()||0,i=ie(o),a=ie(o+(e?.startTime||0)),s=e?de(e.element):"Largest contentful paint",l={};e?.element&&(l["browser.web_vital.lcp.element"]=de(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),DS({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 US(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)=>{c7(e,n,a,o),r()})}function c7(t,e,n,r){wn&&w.log(`Sending CLS span (${t})`);let o=e?ie((Qt()||0)+e.startTime):Ot(),i=e?de(e.sources[0]?.node):"Layout shift",a={};e?.sources&&e.sources.forEach((s,l)=>{a[`browser.web_vital.cls.source.${l+1}`]=de(s.node)}),DS({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:t,attributes:a,parentSpan:n,reportEvent:r,startTime:o})}function BS(){if(!uo()||!Qt())return;pl(({metric:n})=>{if(n.value==null||ie(n.value)>CS)return;let o=n.entries.find(i=>i.duration===n.value&&yu[i.name]);o&&u7(n.value,o)})}function u7(t,e){wn&&w.log(`Sending INP span (${t})`);let n=ie(Qt()+e.startTime),r=ie(t),o=yu[e.name],i=xN(e.interactionId),a=Lt(),s=a?Pt(a):void 0,l=i?.span||s,c=l?Ca(l).name:nt().getScopeData().transactionName,d=i?.elementName||de(e.target);DS({name:d,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:t,attributes:{[$n]:e.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var d7=1e3,AN,PS,zS;function Yf(t){Pn("dom",t),zn("dom",f7)}function f7(){if(!ht.document)return;let t=tn.bind(null,"dom"),e=IN(t,!0);ht.document.addEventListener("click",e,!1),ht.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let o=ht[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(he(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=IN(t);d.handler=u,i.call(this,a,u,l)}d.refCount++}catch{}return i.call(this,a,s,l)}}),he(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 p7(t){if(t.type!==PS)return!1;try{if(!t.target||t.target._sentryId!==zS)return!1}catch{}return!0}function m7(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function IN(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;let r=g7(n);if(m7(n.type,r))return;Ht(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ht(r,"_sentryId",oe());let o=n.type==="keypress"?"input":n.type;p7(n)||(t({event:n,name:o,global:e}),PS=n.type,zS=r?r._sentryId:void 0),clearTimeout(AN),AN=ht.setTimeout(()=>{zS=void 0,PS=void 0},d7)}}function g7(t){try{return t.target}catch{return null}}var iy;function Wi(t){let e="history";Pn(e,t),zn(e,h7)}function h7(){if(ht.addEventListener("popstate",()=>{let e=ht.location.href,n=iy;if(iy=e,n===e)return;tn("history",{from:n,to:e})}),!Rh())return;function t(e){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=iy,i=y7(String(r));if(iy=i,o===i)return e.apply(this,n);tn("history",{from:o,to:i})}return e.apply(this,n)}}he(ht.history,"pushState",t),he(ht.history,"replaceState",t)}function y7(t){try{return new URL(t,ht.location.origin).toString()}catch{return t}}var ay={};function bu(t){let e=ay[t];if(e)return e;let n=ht[t];if(nu(n))return ay[t]=n.bind(ht);let r=ht.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){wn&&w.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return n&&(ay[t]=n.bind(ht))}function FS(t){ay[t]=void 0}function bl(...t){return bu("setTimeout")(...t)}var tr="__sentry_xhr_v3__";function _l(t){Pn("xhr",t),zn("xhr",b7)}function b7(){if(!ht.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){let o=new Error,i=Ot()*1e3,a=pn(r[0])?r[0].toUpperCase():void 0,s=_7(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:Ot()*1e3,startTimestamp:i,xhr:n,virtualError:o};tn("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&&pn(p)&&pn(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:Ot()*1e3,xhr:n};return tn("xhr",i),e.apply(n,r)}})}function _7(t){if(pn(t))return t;try{return t.toString()}catch{}}var v7=Symbol.for("sentry__originalRequestBody");function sy(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[sy(t)];if(!t)return[void 0]}catch(n){return wn&&e.error(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return wn&&e.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function _u(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][v7];return n!==void 0?n:void 0}}function Wf(t){let e;try{e=t.getAllResponseHeaders()}catch(n){return wn&&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 HS(t){if(typeof Element>"u")return!1;try{return t instanceof Element}catch{return!1}}var S7=40;function vu(t,e=bu("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 FS("fetch"),l}finally{n-=a,r--}}return xf(t,o,Qs(t.bufferSize||S7))}var V=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function E7(){let t=B();if(!t){V&&w.warn("No Sentry client available, profiling is not started");return}if(!t.getIntegrationByName("BrowserProfiling")){V&&w.warn("BrowserProfiling integration is not available");return}t.emit("startUIProfiler")}function T7(){let t=B();if(!t){V&&w.warn("No Sentry client available, profiling is not started");return}if(!t.getIntegrationByName("BrowserProfiling")){V&&w.warn("ProfilingIntegration is not available");return}t.emit("stopUIProfiler")}var kN={startProfiler:E7,stopProfiler:T7};var w7=10,x7=20,A7=30,I7=40,k7=50;function Su(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 R7=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,N7=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,C7=/\((\S*)(?::(\d+))(?::(\d+))\)/,M7=/at (.+?) ?\(data:(.+?),/,O7=t=>{let e=t.match(M7);if(e)return{filename:`<data:${e[2]}>`,function:e[1]};let n=R7.exec(t);if(n){let[,o,i,a]=n;return Su(o,"?",+i,+a)}let r=N7.exec(t);if(r){if(r[2]?.indexOf("eval")===0){let s=C7.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[i,a]=MN(r[1]||"?",r[2]);return Su(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},GS=[A7,O7],D7=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,L7=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,U7=t=>{let e=D7.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=L7.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]=MN(o,r),Su(r,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},$S=[k7,U7],B7=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,P7=t=>{let e=B7.exec(t);return e?Su(e[2],e[1]||"?",+e[3],e[4]?+e[4]:void 0):void 0},RN=[I7,P7],z7=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,F7=t=>{let e=z7.exec(t);return e?Su(e[2],e[3]||"?",+e[1]):void 0},NN=[w7,F7],H7=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,G7=t=>{let e=H7.exec(t);return e?Su(e[5],e[3]||e[4]||"?",+e[1],+e[2]):void 0},CN=[x7,G7],jS=[GS,$S],ly=jd(...jS),MN=(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 ON(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:rn(r)}},i=$7(t);return Oe(o,[i])}function $7(t){return[{type:"user_report"},t]}var cy=1024,j7="Breadcrumbs",q7=((t={})=>{let e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:j7,setup(n){e.console&&nl(W7(n)),e.dom&&Yf(Y7(n,e.dom)),e.xhr&&_l(K7(n)),e.fetch&&hi(X7(n)),e.history&&Wi(J7(n)),e.sentry&&n.on("beforeSendEvent",V7(n))}}}),uy=q7;function V7(t){return function(n){B()===t&&Tn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Lo(n)},{event:n})}}function Y7(t,e){return function(r){if(B()!==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>cy&&(V&&w.warn(`\`dom.maxStringLength\` cannot exceed ${cy}, but a value of ${s} was configured. Sentry will use ${cy} instead.`),s=cy),typeof a=="string"&&(a=[a]);try{let c=r.event,d=Q7(c)?c.target:c;o=de(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}),Tn(l,{event:r.event,name:r.name,global:r.global})}}function W7(t){return function(n){if(B()!==t)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:Hi(n.level),message:Ia(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Ia(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Tn(r,{input:n.args,level:n.level})}}function K7(t){return function(n){if(B()!==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:kh(l)};t.emit("beforeOutgoingRequestBreadcrumb",p,u),Tn(p,u)}}function X7(t){return function(n){if(B()!==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),Tn(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:kh(a.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",l,s),Tn(l,s)}}}function J7(t){return function(n){if(B()!==t)return;let r=n.from,o=n.to,i=to(j.location.href),a=r?to(r):void 0,s=to(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),Tn({category:"navigation",data:{from:r,to:o}})}}function Q7(t){return!!t&&!!t.target}var Z7="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(","),t9="BrowserApiErrors",e9=((t={})=>{let e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...t};return{name:t9,setupOnce(){e.setTimeout&&he(j,"setTimeout",DN),e.setInterval&&he(j,"setInterval",DN),e.requestAnimationFrame&&he(j,"requestAnimationFrame",n9),e.XMLHttpRequest&&"XMLHttpRequest"in j&&he(XMLHttpRequest.prototype,"send",r9);let n=e.eventTarget;n&&(Array.isArray(n)?n:Z7).forEach(o=>o9(o,e))}}}),dy=e9;function DN(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 n9(t){return function(e){return t.apply(this,[ul(e,{mechanism:{data:{handler:Qn(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function r9(t){return function(...e){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&he(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 o9(t,e){let r=j[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(he(r,"addEventListener",function(o){return function(i,a,s){try{i9(a)&&(a.handleEvent=ul(a.handleEvent,{mechanism:{data:{handler:Qn(a),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return e.unregisterOriginalCallbacks&&a9(this,i,a),o.apply(this,[i,ul(a,{mechanism:{data:{handler:Qn(a),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),s])}}),he(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 i9(t){return typeof t.handleEvent=="function"}function a9(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}var fy=(t={})=>{let e=t.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof j.document>"u"){V&&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=zt(),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 s9="CultureContext",l9=(()=>({name:s9,preprocessEvent(t){let e=LN();e&&(t.contexts={...t.contexts,culture:{...e,...t.contexts?.culture}})},processSegmentSpan(t){let e=LN();e&&Cr(t,{"culture.locale":e.locale,"culture.timezone":e.timezone,"culture.calendar":e.calendar})}})),py=l9;function LN(){try{let t=j.Intl;if(!t)return;let e=t.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone,calendar:e.calendar}}catch{return}}var c9="GlobalHandlers",u9=((t={})=>{let e={onerror:!0,onunhandledrejection:!0,...t};return{name:c9,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(d9(n),UN("onerror")),e.onunhandledrejection&&(f9(n),UN("onunhandledrejection"))}}}),my=u9;function d9(t){Vd(e=>{let{stackParser:n,attachStacktrace:r}=BN();if(B()!==t||fS())return;let{msg:o,url:i,line:a,column:s,error:l}=e,c=p9(uu(n,l||o,void 0,r,!1),i,a,s);c.level="error",Zr(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function f9(t){Yd(e=>{let{stackParser:n,attachStacktrace:r}=BN();if(B()!==t||fS())return;let o=qS(e),i=en(o)?VS(o):uu(n,o,void 0,r,!0);i.level="error",Zr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function qS(t){if(en(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 VS(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function p9(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:m9(e)??Wn(),function:"?",in_app:!0}),t}function UN(t){V&&w.log(`Global Handler attached: ${t}`)}function BN(){return B()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function m9(t){if(!(!pn(t)||t.length===0))return t.startsWith("data:")?`<${Vn(t,!1)}>`:t}var gy=()=>({name:"HttpContext",preprocessEvent(t){if(!j.navigator&&!j.location&&!j.document)return;let e=lu(),n={...e.headers,...t.request?.headers};t.request={...e,...t.request,headers:n}},processSegmentSpan(t){let e=t.attributes?.[bt];if(!j.navigator&&!j.location&&!j.document)return;let n=lu();Cr(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 g9="cause",h9=5,y9="LinkedErrors",b9=((t={})=>{let e=t.limit||h9,n=t.key||g9;return{name:y9,preprocessEvent(r,o,i){let a=i.getOptions();vv(cu,a.stackParser,n,e,r,o)}}}),hy=b9;var _9=/^HTML(\w*)Element$/;function Eu(t){if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(HS(t)){let e=v9(t);if(_9.test(e))return`[HTMLElement: ${de(t)}]`}}function v9(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function PN(){return S9()?(V&&dn(()=>{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 S9(){if(typeof j.window>"u")return!1;let t=j;if(t.nw||!(t.chrome||t.browser)?.runtime?.id)return!1;let n=Wn();return!(j===j.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function YS(t){return[Cf(),Nf(),Nv(),dy(),uy(),my(),hy(),Mf(),gy(),py(),fy()]}function WS(t={}){let e=!t.skipBrowserExtensionCheck&&PN(),n=t.defaultIntegrations==null?YS():t.defaultIntegrations,r={...t,enabled:e?!1:t.enabled,stackParser:Xm(t.stackParser||ly),integrations:Jg({integrations:t.integrations,defaultIntegrations:n}),transport:t.transport||vu};return bc(Eu),uv(du,r)}function zN(){}function FN(t){t()}function Kf(t={}){let e=j.document,n=e?.head||e?.body;if(!n){V&&w.error("[showReportDialog] Global document not defined");return}let r=nt(),i=B()?.getDsn();if(!i){V&&w.error("[showReportDialog] DSN not configured");return}let a={...t,user:{...r.getUser(),...t.user},eventId:t.eventId||Oc()},s=j.document.createElement("script");s.async=!0,s.crossOrigin="anonymous",s.src=K0(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{j.removeEventListener("message",d)}};j.addEventListener("message",d)}n.appendChild(s)}var E9=Z,T9="ReportingObserver",HN=new WeakMap,w9=((t={})=>{let e=t.types||["crash","deprecation","intervention"];function n(r){if(HN.has(B()))for(let o of r)Ce(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:T9,setupOnce(){if(!Nh())return;new E9.ReportingObserver(n,{buffered:!0,types:e}).observe()},setup(r){HN.set(r,!0)}}}),GN=w9;var x9="HttpClient",A9=((t={})=>{let e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...t};return{name:x9,setup(n){O9(n,e),D9(n,e)}}}),jN=A9;function I9(t,e,n,r,o){if(qN(t,n.status,n.url)){let i=L9(e,r),a,s,l,c,d=YN();if(d.requestHeaders!==!1&&(a=za($N(i.headers),d.requestHeaders)),d.responseHeaders!==!1&&(s=za($N(n.headers),d.responseHeaders)),d.cookies!==!1){let p=i.headers.get("Cookie")||void 0;if(p){let m=kf(p,d.cookies);typeof m=="object"&&(l=m)}let f=n.headers.get("Set-Cookie")||void 0;if(f){let m=kf(f,d.cookies);typeof m=="object"&&(c=m)}}let u=VN({url:i.url,method:i.method,status:n.status,requestHeaders:a,responseHeaders:s,requestCookies:l,responseCookies:c,error:o,type:"fetch"});Zr(u)}}function k9(t,e,n,r,o){if(qN(t,e.status,e.responseURL)){let i,a,s,l=YN();if(l.cookies!==!1)try{let d=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;if(d){let u=kf(d,l.cookies);typeof u=="object"&&(a=u)}}catch{}if(l.responseHeaders!==!1)try{s=za(N9(e),l.responseHeaders)}catch{}l.requestHeaders!==!1&&(i=za(r,l.requestHeaders));let c=VN({url:e.responseURL,method:n,status:e.status,requestHeaders:i,responseHeaders:s,responseCookies:a,error:o,type:"xhr"});Zr(c)}}function R9(t){if(t){let e=t["Content-Length"]||t["content-length"];if(e)return parseInt(e,10)}}function $N(t){let e={};return t.forEach((n,r)=>{e[r]=n}),e}function N9(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 C9(t,e){return t.some(n=>typeof n=="string"?e.includes(n):n.test(e))}function M9(t,e){return t.some(n=>typeof n=="number"?n===e:e>=n[0]&&e<=n[1])}function O9(t,e){ru()&&hi(n=>{if(B()!==t)return;let{response:r,args:o,error:i,virtualError:a}=n,[s,l]=o;r&&I9(e,s,r,l,i||a)},!1)}function D9(t,e){"XMLHttpRequest"in Z&&_l(n=>{if(B()!==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{k9(e,i,s,l,r||o)}catch(c){V&&w.warn("Error while extracting response event form XHR response",c)}})}function qN(t,e,n){return M9(t.failedRequestStatusCodes,e)&&C9(t.failedRequestTargets,n)&&!Gc(n,B())}function VN(t){let e=B(),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:R9(t.responseHeaders)}}};return Sn(i,{type:`auto.http.client.${t.type}`,handled:!1}),i}function L9(t,e){return!e&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,e)}function YN(){let t=B();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 KS=Z,U9=7,B9="ContextLines",P9=((t={})=>({name:B9,processEvent(e,n,r){let o=t.frameContextLines??r?.getDataCollectionOptions().frameContextLines??U9;return z9(e,o)}})),WN=P9;function z9(t,e){let n=KS.document,r=KS.location&&Hc(KS.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=>F9(c,a,r,e)))}),t}function F9(t,e,n,r){return t.filename!==n||!t.lineno||!e.length||tg(e,t,r),t}var H9="GraphQLClient",G9=(t=>({name:H9,setup(e){$9(e,t),j9(e,t)}}));function $9(t,e){t.on("beforeOutgoingRequestSpan",(n,r)=>{let i=tt(n).data||{};if(!(i[bt]==="http.client"))return;let l=i[Tc]||i["http.url"]||i.url,c=i[yg]||i["http.method"];if(!pn(l)||!pn(c))return;let{endpoints:d}=e,u=nn(l,d),p=XN(r);if(u&&p){let f=JN(p);if(f){let m=KN(f);n.updateName(`${c} ${l} (${m})`),by(f)&&n.setAttribute("graphql.document",f.query),_y(f)&&(n.setAttribute("graphql.persisted_query.hash.sha256",f.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",f.extensions.persistedQuery.version))}}})}function j9(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=nn(d,u),f=XN(r);if(p&&a&&f){let m=JN(f);if(!a.graphql&&m){let _=KN(m);a["graphql.operation"]=_,by(m)&&(a["graphql.document"]=m.query),_y(m)&&(a["graphql.persisted_query.hash.sha256"]=m.extensions.persistedQuery.sha256Hash,a["graphql.persisted_query.version"]=m.extensions.persistedQuery.version)}}}})}function KN(t){if(_y(t))return`persisted ${t.operationName}`;if(by(t)){let{query:e,operationName:n}=t,{operationName:r=n,operationType:o}=q9(e);return r?`${o} ${r}`:`${o}`}return"unknown"}function XN(t){let e="xhr"in t,n;if(e){let r=t.xhr[tr];n=r&&vl(r.body)[0]}else{let r=_u(t.input);n=vl(r)[0]}return n}function q9(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 yy(t){return typeof t=="object"&&t!==null}function by(t){return yy(t)&&typeof t.query=="string"}function _y(t){return yy(t)&&typeof t.operationName=="string"&&yy(t.extensions)&&yy(t.extensions.persistedQuery)&&typeof t.extensions.persistedQuery.sha256Hash=="string"&&typeof t.extensions.persistedQuery.version=="number"}function JN(t){try{let e=JSON.parse(t);return by(e)||_y(e)?e:void 0}catch{return}}var QN=G9;var ZN=(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?.()||j.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 Te=Z,xE="sentryReplaySession",V9="replay_event",AE="Unable to send Replay",Y9=3e5,W9=9e5,K9=5e3,X9=5500,J9=6e4,Q9=5e3,Z9=3,tC=15e4,vy=5e3,tG=3e3,eG=300,IE=2e7,nG=4999,rG=5e4,eC=36e5,oG=Object.defineProperty,iG=(t,e,n)=>e in t?oG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,nC=(t,e,n)=>iG(t,typeof e!="symbol"?e+"":e,n),an=(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))(an||{});function aG(t){return t.nodeType===t.ELEMENT_NODE}function Qf(t){return t?.host?.shadowRoot===t}function Zf(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function sG(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 lG(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 xy(t){try{let e=t.rules||t.cssRules;return e?sG(Array.from(e,AC).join("")):null}catch{return null}}function cG(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 AC(t){let e;if(dG(t))try{e=xy(t.styleSheet)||lG(t)}catch{}else if(fG(t)){let n=t.cssText,r=t.selectorText.includes(":"),o=typeof t.style.all=="string"&&t.style.all;if(o&&(n=cG(t)),r&&(n=uG(n)),r||o)return n}return e||t.cssText}function uG(t){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function dG(t){return"styleSheet"in t}function fG(t){return"selectorText"in t}var Ay=class{constructor(){nC(this,"idNodeMap",new Map),nC(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 pG(){return new Ay}function Fy({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 ep({isMasked:t,element:e,value:n,maskInputFn:r}){let o=n||"";return t?(r&&(o=r(o,e)),"*".repeat(o.length)):o}function Nu(t){return t.toLowerCase()}function eE(t){return t.toUpperCase()}var rC="__rrweb_original__";function mG(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=rC in i?i[rC]: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 kE(t){let e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Nu(e):null}function Iy(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}function IC(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 oC={};function kC(t){let e=oC[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 oC[t]=r.bind(window)}function nE(...t){return kC("setTimeout")(...t)}function RC(...t){return kC("clearTimeout")(...t)}function NC(t){try{return t.contentDocument}catch{}}function gG(t){try{return t.contentWindow}catch{}}var hG=1,yG=new RegExp("[^a-z0-9-_:]"),np=-2;function RE(){return hG++}function bG(t){if(t instanceof HTMLFormElement)return"form";let e=Nu(t.tagName);return yG.test(e)?"div":e}function _G(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var Tu,iC,vG=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,SG=/^(?:[a-z+]+:)?\/\//i,EG=/^www\..*/i,TG=/^(data:)([^,]*),(.*)/i;function wG(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 ky(t,e){return(t||"").replace(vG,(n,r,o,i,a,s)=>{let l=o||a||s,c=r||i||"";if(!l)return n;if(SG.test(l)||EG.test(l))return`url(${c}${l}${c})`;if(TG.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${_G(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 xG=/^[^ \t\n\r\u000c]+/,AG=/^[, \t\n\r\u000c]+/;function IG(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(AG),!(n>=e.length);){let i=r(xG);if(i.slice(-1)===",")i=Au(t,i.substring(0,i.length-1)),o.push(i);else{let a="";i=Au(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 aC=new WeakMap;function Au(t,e){return!e||e.trim()===""?e:Hy(t,e)}function kG(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function Hy(t,e){let n=aC.get(t);if(n||(n=t.createElement("a"),aC.set(t,n)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return n.setAttribute("href",e),n.href}function CC(t,e,n,r,o,i,a){if(!r)return r;if(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#"))return Au(t,r);if(n==="xlink:href"&&r[0]!=="#")return Au(t,r);if(n==="background"&&(e==="table"||e==="td"||e==="th"))return Au(t,r);if(n==="srcset")return IG(t,r);if(n==="style"){let s=ky(r,Hy(t));return a&&a.size>0&&(s=wG(s,a)),s}else if(e==="object"&&n==="data")return Au(t,r);return typeof i=="function"?i(n,r,o):r}function MC(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function RG(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 NG(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(NG(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Cu(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 CG(t,e,n){let r=gG(t);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let s=nE(()=>{o||(e(),o=!0)},n);t.addEventListener("load",()=>{RC(s),o=!0,e()});return}let a="about:blank";if(r.location.href!==a||t.src===a||t.src==="")return nE(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function MG(t,e,n){let r=!1,o;try{o=t.sheet}catch{o=null}if(o)return;let i=nE(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{RC(i),r=!0,e()})}function OG(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:b,recordCanvas:S,keepIframeSrcFn:E,newlyAddedElement:R=!1,ignoreCSSAttributes:C}=e,I=DG(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:an.Document,childNodes:[],compatMode:t.compatMode}:{type:an.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:an.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:I};case t.ELEMENT_NODE:return UG(t,{doc:n,blockClass:o,blockSelector:i,unblockSelector:a,inlineStylesheet:f,maskAttributeFn:l,maskInputOptions:m,maskInputFn:v,dataURLOptions:h,inlineImages:b,recordCanvas:S,keepIframeSrcFn:E,newlyAddedElement:R,rootId:I,maskTextClass:c,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:p,ignoreCSSAttributes:C});case t.TEXT_NODE:return LG(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:an.CDATA,textContent:"",rootId:I};case t.COMMENT_NODE:return{type:an.Comment,textContent:t.textContent||"",rootId:I};default:return!1}}function DG(t,e){if(!e.hasNode(t))return;let n=e.getId(t);return n===1?void 0:n}function LG(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=xy(t.parentNode.sheet))}catch(h){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${h}`,t)}p=ky(p,Hy(e.doc))}m&&(p="SCRIPT_PLACEHOLDER");let v=Cu(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=Fy({type:null,tagName:u,maskInputOptions:l});p=ep({isMasked:Cu(t,r,i,o,a,h),element:t,value:p,maskInputFn:c})}return{type:an.Text,textContent:p||"",isStyle:f,rootId:d}}function UG(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:b,unmaskTextSelector:S,ignoreCSSAttributes:E}=e,R=RG(t,r,o,i),C=bG(t),I={},L=t.attributes.length;for(let U=0;U<L;U++){let O=t.attributes[U];O.name&&!MC(C,O.name,O.value)&&(I[O.name]=CC(n,C,Nu(O.name),O.value,t,l,E))}if(C==="link"&&a){let U=Array.from(n.styleSheets).find(N=>N.href===t.href),O=null;U&&(O=xy(U)),O&&(I.rel=null,I.href=null,I.crossorigin=null,I._cssText=ky(O,U.href))}if(C==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){let U=xy(t.sheet);U&&(I._cssText=ky(U,Hy(n)))}if(C==="input"||C==="textarea"||C==="select"||C==="option"){let U=t,O=kE(U),N=Iy(U,eE(C),O),W=U.checked;if(O!=="submit"&&O!=="button"&&N){let X=Cu(U,v,b,h,S,Fy({type:O,tagName:eE(C),maskInputOptions:s}));I.value=ep({isMasked:X,element:U,value:N,maskInputFn:c})}W&&(I.checked=W)}if(C==="option"&&(t.selected&&!s.select?I.selected=!0:delete I.selected),C==="canvas"&&p){if(t.__context==="2d")mG(t)||(I.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){let U=t.toDataURL(d.type,d.quality),O=n.createElement("canvas");O.width=t.width,O.height=t.height;let N=O.toDataURL(d.type,d.quality);U!==N&&(I.rr_dataURL=U)}}if(C==="img"&&u){Tu||(Tu=n.createElement("canvas"),iC=Tu.getContext("2d"));let U=t,O=U.currentSrc||U.getAttribute("src")||"<unknown-src>",N=U.crossOrigin,W=()=>{U.removeEventListener("load",W);try{Tu.width=U.naturalWidth,Tu.height=U.naturalHeight,iC.drawImage(U,0,0),I.rr_dataURL=Tu.toDataURL(d.type,d.quality)}catch(X){if(U.crossOrigin!=="anonymous"){U.crossOrigin="anonymous",U.complete&&U.naturalWidth!==0?W():U.addEventListener("load",W);return}else console.warn(`Cannot inline img src=${O}! Error: ${X}`)}U.crossOrigin==="anonymous"&&(N?I.crossOrigin=N:U.removeAttribute("crossorigin"))};U.complete&&U.naturalWidth!==0?W():U.addEventListener("load",W)}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:O}=t.getBoundingClientRect();I={class:I.class,rr_width:`${U}px`,rr_height:`${O}px`}}C==="iframe"&&!f(I.src)&&(!R&&!NC(t)&&(I.rr_src=I.src),delete I.src);let P;try{customElements.get(C)&&(P=!0)}catch{}return{type:an.Element,tagName:C,attributes:I,childNodes:[],isSVG:kG(t)||void 0,needBlock:R,rootId:_,isCustom:P}}function Ee(t){return t==null?"":t.toLowerCase()}function BG(t,e){if(e.comment&&t.type===an.Comment)return!0;if(t.type===an.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"&&IC(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(Ee(t.attributes.name).match(/^msapplication-tile(image|color)$/)||Ee(t.attributes.name)==="application-name"||Ee(t.attributes.rel)==="icon"||Ee(t.attributes.rel)==="apple-touch-icon"||Ee(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&Ee(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Ee(t.attributes.property).match(/^(og|twitter|fb):/)||Ee(t.attributes.name).match(/^(og|twitter):/)||Ee(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(Ee(t.attributes.name)==="robots"||Ee(t.attributes.name)==="googlebot"||Ee(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(Ee(t.attributes.name)==="author"||Ee(t.attributes.name)==="generator"||Ee(t.attributes.name)==="framework"||Ee(t.attributes.name)==="publisher"||Ee(t.attributes.name)==="progid"||Ee(t.attributes.property).match(/^article:/)||Ee(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(Ee(t.attributes.name)==="google-site-verification"||Ee(t.attributes.name)==="yandex-verification"||Ee(t.attributes.name)==="csrf-token"||Ee(t.attributes.name)==="p:domain_verify"||Ee(t.attributes.name)==="verify-v1"||Ee(t.attributes.name)==="verification"||Ee(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ku(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:b,dataURLOptions:S={},inlineImages:E=!1,recordCanvas:R=!1,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:L=5e3,onBlockedImageLoad:P,onStylesheetLoad:U,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:W=!1,ignoreCSSAttributes:X}=e,{preserveWhiteSpace:pt=!0}=e,et=OG(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:W,ignoreCSSAttributes:X});if(!et)return console.warn(t,"not serialized"),null;let lt;r.hasNode(t)?lt=r.getId(t):BG(et,b)||!pt&&et.type===an.Text&&!et.isStyle&&!et.textContent.trim().length?lt=np:lt=RE();let H=Object.assign(et,{id:lt});if(r.add(t,H),lt===np)return null;C&&C(t);let ct=!p;if(H.type===an.Element){ct=ct&&!H.needBlock;let Y=t.shadowRoot;Y&&Zf(Y)&&(H.isShadowHost=!0)}if((H.type===an.Document||H.type===an.Element)&&ct){b.headWhitespace&&H.type===an.Element&&H.tagName==="head"&&(pt=!1);let Y={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:b,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:pt,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:L,onBlockedImageLoad:P,onStylesheetLoad:U,stylesheetLoadTimeout:O,keepIframeSrcFn:N,ignoreCSSAttributes:X},dt=t.childNodes?Array.from(t.childNodes):[];for(let K of dt){let yt=ku(K,Y);yt&&H.childNodes.push(yt)}if(aG(t)&&t.shadowRoot)for(let K of Array.from(t.shadowRoot.childNodes)){let yt=ku(K,Y);yt&&(Zf(t.shadowRoot)&&(yt.isShadow=!0),H.childNodes.push(yt))}}if(t.parentNode&&Qf(t.parentNode)&&Zf(t.parentNode)&&(H.isShadow=!0),H.type===an.Element&&H.tagName==="iframe"&&!H.needBlock&&CG(t,()=>{let Y=NC(t);if(Y&&I){let dt=ku(Y,{doc:Y,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:b,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:pt,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:L,onStylesheetLoad:U,stylesheetLoadTimeout:O,keepIframeSrcFn:N,ignoreCSSAttributes:X});dt&&I(t,dt)}},L),H.type===an.Element&&H.tagName==="img"&&!t.complete&&H.needBlock){let Y=t,dt=()=>{if(Y.isConnected&&!Y.complete&&P)try{let K=Y.getBoundingClientRect();K.width>0&&K.height>0&&P(Y,H,K)}catch{}Y.removeEventListener("load",dt)};Y.isConnected&&Y.addEventListener("load",dt)}return H.type===an.Element&&H.tagName==="link"&&typeof H.attributes.rel=="string"&&(H.attributes.rel==="stylesheet"||H.attributes.rel==="preload"&&typeof H.attributes.href=="string"&&IC(H.attributes.href)==="css")&&MG(t,()=>{if(U){let Y=ku(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:b,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:pt,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:L,onStylesheetLoad:U,stylesheetLoadTimeout:O,keepIframeSrcFn:N,ignoreCSSAttributes:X});Y&&U(t,Y)}},O),H.type===an.Element&&delete H.needBlock,H}function PG(t,e){let{mirror:n=new Ay,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:b=!1,dataURLOptions:S,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:C,iframeLoadTimeout:I,onBlockedImageLoad:L,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:O=()=>!1,ignoreCSSAttributes:N=new Set([])}=e||{};return ku(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:b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:b==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:b===!1?{}:b,dataURLOptions:S,inlineImages:p,recordCanvas:f,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:C,iframeLoadTimeout:I,onBlockedImageLoad:L,onStylesheetLoad:P,stylesheetLoadTimeout:U,keepIframeSrcFn:O,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 wu=`Please stop import mirror directly. Instead of that,\r
|
|
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.`,sC={map:{},getId(){return console.error(wu),-1},getNode(){return console.error(wu),null},removeNodeFromMap(){console.error(wu)},has(){return console.error(wu),!1},reset(){console.error(wu)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(sC=new Proxy(sC,{get(t,e,n){return e==="map"&&console.error(wu),Reflect.get(t,e,n)}}));function rp(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&&(jG(r),r=null),o=a,t.apply(l,i)):!r&&n.trailing!==!1&&(r=Gy(()=>{o=n.leading===!1?0:Date.now(),r=null,t.apply(l,i)},s))}}function OC(t,e,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(a){Gy(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>OC(t,e,i||{},!0)}function NE(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 Ry=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ry=()=>new Date().getTime());function DC(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 LC(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function UC(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function BC(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function Br(t,e,n,r,o){if(!t)return!1;let i=BC(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 zG(t,e){return e.getId(t)!==-1}function XS(t,e){return e.getId(t)===np}function PC(t,e){if(Qf(t))return!1;let n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?PC(t.parentNode,e):!0:!0}function rE(t){return!!t.changedTouches}function FG(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 zC(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function FC(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function oE(t){return!!t?.shadowRoot}var iE=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 HC(t){let e=null;return t.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function HG(t){let e=t,n;for(;n=HC(e);)e=n;return e}function GG(t){let e=t.ownerDocument;if(!e)return!1;let n=HG(t);return e.contains(n)}function GC(t){let e=t.ownerDocument;return e?e.contains(t)||GG(t):!1}var lC={};function CE(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 $G(...t){return CE("requestAnimationFrame")(...t)}function Gy(...t){return CE("setTimeout")(...t)}function jG(...t){return CE("clearTimeout")(...t)}var Gt=(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))(Gt||{}),Nt=(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))(Nt||{}),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||{}),xu=(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))(xu||{}),tp;function qG(t){tp=t}function VG(){tp=void 0}var Xt=t=>tp?((...n)=>{try{return t(...n)}catch(r){if(tp&&tp(r)===!0)return()=>{};throw r}}):t,cC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",YG=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Xf=0;Xf<cC.length;Xf++)YG[cC.charCodeAt(Xf)]=Xf;var Xf,Ny=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function ME(t){try{return t.contentDocument}catch{}}function op(t){try{return t.contentWindow}catch{}}var aE=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 uC(t){return"__ln"in t}var sE=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&&uC(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&&uC(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--)}},dC=(t,e)=>`${t}@${e}`,lE=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 sE,o=l=>{let c=l,d=np;for(;d===np;)c=c&&c.nextSibling,d=c&&this.mirror.getId(c);return d},i=l=>{if(!l.parentNode||!GC(l))return;let c=Qf(l.parentNode)?this.mirror.getId(HC(l)):this.mirror.getId(l.parentNode),d=o(l);if(c===-1||d===-1)return r.addNode(l);let u=ku(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=>{zC(p,this.mirror)&&!Br(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),FC(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),oE(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,f)=>{if(Br(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,f);let m=op(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)fC(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(let l of this.addedSet)!pC(this.droppedSet,l)&&!fC(this.removes,l,this.mirror)||pC(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(!XS(e.target,this.mirror))switch(e.type){case"characterData":{let n=e.target.textContent;!Br(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Cu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,BC(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=kE(n),s=n.tagName;o=Iy(n,s,a);let l=Fy({maskInputOptions:this.maskInputOptions,tagName:s,type:a}),c=Cu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=ep({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(Br(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(!ME(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"),!MC(n.tagName,r)&&(i.attributes[r]=CC(this.doc,Nu(n.tagName),Nu(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(Br(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=Qf(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Br(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||XS(n,this.mirror)||!zG(n,this.mirror)||(this.addedSet.has(n)?(cE(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||PC(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[dC(r,o)]?cE(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:Qf(e.target)&&Zf(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(XS(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[dC(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Br(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(r=>this.genAdds(r)),oE(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 aE(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 cE(t,e){t.delete(e),e.childNodes?.forEach(n=>cE(t,n))}function fC(t,e,n){return t.length===0?!1:WG(t,e,n)}function WG(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 pC(t,e){return t.size===0?!1:$C(t,e)}function $C(t,e){let{parentNode:n}=e;return n?t.has(n)?!0:$C(t,n):!1}var Ru=[];function cp(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 jC(t,e){let n=new lE;Ru.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(Xt(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 KG({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=rp(Xt(u=>{let p=Date.now()-s;t(a.map(f=>(f.timeOffset-=p,f)),u),a=[],s=null}),i),c=Xt(rp(Xt(u=>{let p=cp(u),{clientX:f,clientY:m}=rE(u)?u.changedTouches[0]:u;s||(s=Ry()),a.push({x:f,y:m,id:r.getId(p),timeOffset:Ry()-s}),l(typeof DragEvent<"u"&&u instanceof DragEvent?Nt.Drag:u instanceof MouseEvent?Nt.MouseMove:Nt.TouchMove)}),o,{trailing:!1})),d=[nr("mousemove",c,n),nr("touchmove",c,n),nr("drag",c,n)];return Xt(()=>{d.forEach(u=>u())})}function XG({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=cp(p);if(Br(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 rE(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=rE(p)?p.changedTouches[0]:p;if(!v)return;let h=n.getId(f),{clientX:b,clientY:S}=v;Xt(t)({type:er[_],id:h,x:b,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=Nu(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))}),Xt(()=>{l.forEach(u=>u())})}function qC({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:a}){let s=Xt(rp(Xt(l=>{let c=cp(l);if(!c||Br(c,r,o,i,!0))return;let d=n.getId(c);if(c===e&&e.defaultView){let u=DC(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 JG({viewportResizeCb:t},{win:e}){let n=-1,r=-1,o=Xt(rp(Xt(()=>{let i=LC(),a=UC();(n!==i||r!==a)&&(t({width:Number(a),height:Number(i)}),n=i,r=a)}),200));return nr("resize",o,e)}var QG=["INPUT","TEXTAREA","SELECT"],mC=new WeakMap;function ZG({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=cp(I),P=I.isTrusted,U=L&&eE(L.tagName);if(U==="OPTION"&&(L=L.parentElement),!L||!U||QG.indexOf(U)<0||Br(L,r,o,i,!0))return;let O=L;if(O.classList.contains(a)||s&&O.matches(s))return;let N=kE(L),W=Iy(O,U,N),X=!1,pt=Fy({maskInputOptions:l,tagName:U,type:N}),et=Cu(L,p,m,f,_,pt);(N==="radio"||N==="checkbox")&&(X=L.checked),W=ep({isMasked:et,element:L,value:W,maskInputFn:c}),h(L,u?{text:W,isChecked:X,userTriggered:P}:{text:W,isChecked:X});let lt=L.name;N==="radio"&<&&X&&e.querySelectorAll(`input[type="radio"][name="${lt}"]`).forEach(H=>{if(H!==L){let ct=ep({isMasked:et,element:H,value:Iy(H,U,N),maskInputFn:c});h(H,u?{text:ct,isChecked:!X,userTriggered:!1}:{text:ct,isChecked:!X})}})}function h(I,L){let P=mC.get(I);if(!P||P.text!==L.text||P.isChecked!==L.isChecked){mC.set(I,L);let U=n.getId(I);Xt(t)({...L,id:U})}}let S=(d.input==="last"?["change"]:["input","change"]).map(I=>nr(I,Xt(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=>OC(I[0],I[1],{set(){Xt(v)({target:this,isTrusted:!1})}},!1,E))),Xt(()=>{S.forEach(I=>I())})}function Cy(t){let e=[];function n(r,o){if(Sy("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Sy("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Sy("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Sy("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 t$({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:Xt((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:Xt((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:Xt((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:Xt((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={};Ey("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Ey("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Ey("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Ey("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:Xt((p,f,m)=>{let[_,v]=m,{id:h,styleId:b}=Ja(f.parentStyleSheet,e,n.styleMirror);return(h&&h!==-1||b&&b!==-1)&&t({id:h,styleId:b,adds:[{rule:_,index:[...Cy(f),v||0]}]}),p.apply(f,m)})}),u.prototype.deleteRule=new Proxy(c[d].deleteRule,{apply:Xt((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:[...Cy(f),_]}]}),p.apply(f,m)})})}),Xt(()=>{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 VC({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}}),Xt(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function e$({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Xt((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:Cy(l.parentRule)}),s.apply(l,c)})});let a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Xt((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:Cy(l.parentRule)}),s.apply(l,c)})}),Xt(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a})}function n$({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:a}){let s=Xt(c=>rp(Xt(d=>{let u=cp(d);if(!u||Br(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(xu.Play),a),nr("pause",s(xu.Pause),a),nr("seeked",s(xu.Seeked),a),nr("volumechange",s(xu.VolumeChange),a),nr("ratechange",s(xu.RateChange),a)];return Xt(()=>{l.forEach(c=>c())})}function r$({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=NE(e.fonts,"add",function(s){return function(l){return Gy(Xt(()=>{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),Xt(()=>{r.forEach(s=>s())})}function o$(t){let{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:a}=t,s=!0,l=Xt(()=>{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;Br(m,r,o,i,!0)||Br(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 i$({doc:t,customElementCb:e}){let n=t.defaultView;return!n||!n.customElements?()=>{}:NE(n.customElements,"define",function(o){return function(i,a,s){try{e({define:{name:i}})}catch{}return o.apply(this,[i,a,s])}})}function a$(t,e={}){let n=t.doc.defaultView;if(!n)return()=>{};let r;t.recordDOM&&(r=jC(t,t.doc));let o=KG(t),i=XG(t),a=qC(t),s=JG(t,{win:n}),l=ZG(t),c=n$(t),d=()=>{},u=()=>{},p=()=>{},f=()=>{};t.recordDOM&&(d=t$(t,{win:n}),u=VC(t,t.doc),p=e$(t,{win:n}),t.collectFonts&&(f=r$(t)));let m=o$(t),_=i$(t),v=[];for(let h of t.plugins)v.push(h.observer(h.callback,n,h.options));return Xt(()=>{Ru.forEach(h=>h.reset()),r?.disconnect(),o(),i(),a(),s(),l(),c(),d(),u(),p(),f(),m(),_(),v.forEach(h=>h())})}function Sy(t){return typeof window[t]<"u"}function Ey(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var ip=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}},uE=class{constructor(){this.crossOriginIframeMirror=new ip(RE),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},dE=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ip(RE),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ip(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=op(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&&op(e)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(e);let r=ME(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 Gt.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:Gt.IncrementalSnapshot,data:{source:Nt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Gt.Meta:case Gt.Load:case Gt.DomContentLoaded:return!1;case Gt.Plugin:return n;case Gt.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case Gt.IncrementalSnapshot:switch(n.data.source){case Nt.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 Nt.Drag:case Nt.TouchMove:case Nt.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Nt.ViewportResize:return!1;case Nt.MediaInteraction:case Nt.MouseInteraction:case Nt.Scroll:case Nt.CanvasMutation:case Nt.Input:return this.replaceIds(n.data,e,["id"]),n;case Nt.StyleSheetRule:case Nt.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case Nt.Font:return n;case Nt.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case Nt.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!==an.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},fE=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},pE=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(!Zf(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let r=jC({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(qC({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),Gy(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(VC({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){let n=ME(e),r=op(e);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(e,n){let r=this;this.restoreHandlers.push(NE(e.prototype,"attachShadow",function(o){return function(i){let a=o.call(this,i);return this.shadowRoot&&GC(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()}},mE=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new iE,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:AC(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){}},gE=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,$G(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}},qe,My;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=pG();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:b,maskInputFn:S,maskTextFn:E,maxCanvasSize:R=null,packFn:C,sampling:I={},dataURLOptions:L={},mousemoveWait:P,recordDOM:U=!0,recordCanvas:O=!1,recordCrossOriginIframes:N=!1,recordAfter:W=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:X=!1,collectFonts:pt=!1,inlineImages:et=!1,plugins:lt,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:ct=new Set([]),errorHandler:Y,onMutation:dt,getCanvasManager:K}=t;qG(Y);let yt=N?window.parent===window:!0,Jt=!1;if(!yt)try{window.parent.document&&(Jt=!1)}catch{Jt=!0}if(yt&&!e)throw new Error("emit function is required");if(!yt&&!Jt)return()=>{};P!==void 0&&I.mousemove===void 0&&(I.mousemove=P),qo.reset();let He=_===!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:{},Rn=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||{};FG();let yn,Q=0,ut=st=>{for(let Ct of lt||[])Ct.eventProcessor&&(st=Ct.eventProcessor(st));return C&&!Jt&&(st=C(st)),st};qe=(st,Ct)=>{let St=st;if(St.timestamp=Ry(),Ru[0]?.isFrozen()&&St.type!==Gt.FullSnapshot&&!(St.type===Gt.IncrementalSnapshot&&St.data.source===Nt.Mutation)&&Ru.forEach(ot=>ot.unfreeze()),yt)e?.(ut(St),Ct);else if(Jt){let ot={type:"rrweb",event:ut(St),origin:window.location.origin,isCheckout:Ct};window.parent.postMessage(ot,"*")}if(St.type===Gt.FullSnapshot)yn=St,Q=0;else if(St.type===Gt.IncrementalSnapshot){if(St.data.source===Nt.Mutation&&St.data.isAttachIframe)return;Q++;let ot=r&&Q>=r,_t=n&&yn&&St.timestamp-yn.timestamp>n;(ot||_t)&&Xn(!0)}};let Bt=st=>{qe({type:Gt.IncrementalSnapshot,data:{source:Nt.Mutation,...st}})},ne=st=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.Scroll,...st}}),Zt=st=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.CanvasMutation,...st}}),ft=st=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.AdoptedStyleSheet,...st}}),te=new mE({mutationCb:Bt,adoptedStyleSheetCb:ft}),me=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new uE:new dE({mirror:qo,mutationCb:Bt,stylesheetManager:te,recordCrossOriginIframes:N,wrappedEmit:qe});for(let st of lt||[])st.getMirror&&st.getMirror({nodeMirror:qo,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror});let ze=new gE,Ge=l$(K,{mirror:qo,win:window,mutationCb:st=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.CanvasMutation,...st}}),recordCanvas:O,blockClass:o,blockSelector:i,unblockSelector:a,maxCanvasSize:R,sampling:I.canvas,dataURLOptions:L,errorHandler:Y}),bn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new fE:new pE({mutationCb:Bt,scrollCb:ne,bypassOptions:{onMutation:dt,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskInputOptions:He,dataURLOptions:L,maskAttributeFn:b,maskTextFn:E,maskInputFn:S,recordCanvas:O,inlineImages:et,sampling:I,slimDOMOptions:Rn,iframeManager:me,stylesheetManager:te,canvasManager:Ge,keepIframeSrcFn:H,processedNodeManager:ze,ignoreCSSAttributes:ct},mirror:qo}),Xn=(st=!1)=>{if(!U)return;qe({type:Gt.Meta,data:{href:window.location.href,width:UC(),height:LC()}},st),te.reset(),bn.init(),Ru.forEach(St=>St.lock());let Ct=PG(document,{mirror:qo,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskAllInputs:He,maskAttributeFn:b,maskInputFn:S,maskTextFn:E,slimDOM:Rn,dataURLOptions:L,recordCanvas:O,inlineImages:et,onSerialize:St=>{zC(St,qo)&&me.addIframe(St),FC(St,qo)&&te.trackLinkElement(St),oE(St)&&bn.addShadowRoot(St.shadowRoot,document)},onIframeLoad:(St,ot)=>{me.attachIframe(St,ot);let _t=op(St);_t&&Ge.addWindow(_t),bn.observeAttachShadow(St)},onStylesheetLoad:(St,ot)=>{te.attachLinkElement(St,ot)},onBlockedImageLoad:(St,ot,{width:_t,height:gt})=>{Bt({adds:[],removes:[],texts:[],attributes:[{id:ot.id,attributes:{style:{width:`${_t}px`,height:`${gt}px`}}}]})},keepIframeSrcFn:H,ignoreCSSAttributes:ct});if(!Ct)return console.warn("Failed to snapshot the document");qe({type:Gt.FullSnapshot,data:{node:Ct,initialOffset:DC(window)}}),Ru.forEach(St=>St.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&te.adoptStyleSheets(document.adoptedStyleSheets,qo.getId(document))};My=Xn;try{let st=[],Ct=ot=>Xt(a$)({onMutation:dt,mutationCb:Bt,mousemoveCb:(_t,gt)=>qe({type:Gt.IncrementalSnapshot,data:{source:gt,positions:_t}}),mouseInteractionCb:_t=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.MouseInteraction,..._t}}),scrollCb:ne,viewportResizeCb:_t=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.ViewportResize,..._t}}),inputCb:_t=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.Input,..._t}}),mediaInteractionCb:_t=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.MediaInteraction,..._t}}),styleSheetRuleCb:_t=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.StyleSheetRule,..._t}}),styleDeclarationCb:_t=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.StyleDeclaration,..._t}}),canvasMutationCb:Zt,fontCb:_t=>qe({type:Gt.IncrementalSnapshot,data:{source:Nt.Font,..._t}}),selectionCb:_t=>{qe({type:Gt.IncrementalSnapshot,data:{source:Nt.Selection,..._t}})},customElementCb:_t=>{qe({type:Gt.IncrementalSnapshot,data:{source:Nt.CustomElement,..._t}})},blockClass:o,ignoreClass:s,ignoreSelector:l,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,maskInputOptions:He,inlineStylesheet:m,sampling:I,recordDOM:U,recordCanvas:O,inlineImages:et,userTriggeredOnInput:X,collectFonts:pt,doc:ot,maskAttributeFn:b,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:H,blockSelector:i,unblockSelector:a,slimDOMOptions:Rn,dataURLOptions:L,mirror:qo,iframeManager:me,stylesheetManager:te,shadowDomManager:bn,processedNodeManager:ze,canvasManager:Ge,ignoreCSSAttributes:ct,plugins:lt?.filter(_t=>_t.observer)?.map(_t=>({observer:_t.observer,options:_t.options,callback:gt=>qe({type:Gt.Plugin,data:{plugin:_t.name,payload:gt}})}))||[]},{});me.addLoadListener(ot=>{try{st.push(Ct(ot.contentDocument))}catch(_t){console.warn(_t)}});let St=()=>{Xn(),st.push(Ct(document))};return document.readyState==="interactive"||document.readyState==="complete"?St():(st.push(nr("DOMContentLoaded",()=>{qe({type:Gt.DomContentLoaded,data:{}}),W==="DOMContentLoaded"&&St()})),st.push(nr("load",()=>{qe({type:Gt.Load,data:{}}),W==="load"&&St()},window))),()=>{st.forEach(ot=>ot()),ze.destroy(),My=void 0,VG()}}catch(st){console.warn(st)}}function s$(t){if(!My)throw new Error("please take full snapshot after start recording");My(t)}Vo.mirror=qo;Vo.takeFullSnapshot=s$;function l$(t,e){try{return t?t(e):new Ny}catch{return console.warn("Unable to initialize CanvasManager"),new Ny}}var gC;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(gC||(gC={}));var c$=3,u$=5;function OE(t){return t>9999999999?t:t*1e3}function JS(t){return t>9999999999?t/1e3:t}function up(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:Gt.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:le(e,10,1e3)}}),e.category==="console")))}var d$="button,a";function YC(t){return t.closest(d$)||t}function WC(t){let e=KC(t);return!e||!(e instanceof Element)?e:YC(e)}function KC(t){return f$(t)?t.target:t}function f$(t){return typeof t=="object"&&!!t&&"target"in t}var Qa;function p$(t){return Qa||(Qa=[],m$()),Qa.push(t),()=>{let e=Qa?Qa.indexOf(t):-1;e>-1&&Qa.splice(e,1)}}function m$(){he(Te,"open",function(t){return function(...e){if(Qa)try{Qa.forEach(n=>n())}catch{}return t.apply(Te,e)}})}var g$=new Set([Nt.Mutation,Nt.StyleSheetRule,Nt.StyleDeclaration,Nt.AdoptedStyleSheet,Nt.CanvasMutation,Nt.Selection,Nt.MediaInteraction]);function h$(t,e,n){t.handleClick(e,n)}var hE=class{constructor(e,n,r=up){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=p$(()=>{this._lastMutation=hC()});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(b$(n,this._ignoreSelector)||!_$(e))return;let r={timestamp:JS(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=JS(e)}registerScroll(e=Date.now()){this._lastScroll=JS(e)}registerClick(e){let n=YC(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=hC();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:Te.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:Te.location.href,route:n.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=bl(()=>this._checkClicks(),1e3)}},y$=["A","BUTTON","INPUT"];function b$(t,e){return!!(!y$.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 _$(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function hC(){return Date.now()/1e3}function v$(t,e){try{if(!S$(e))return;let{source:n}=e.data;if(g$.has(n)&&t.registerMutation(e.timestamp),n===Nt.Scroll&&t.registerScroll(e.timestamp),E$(e)){let{type:r,id:o}=e.data,i=Vo.mirror.getNode(o);i instanceof HTMLElement&&r===er.Click&&t.registerClick(i)}}catch{}}function S$(t){return t.type===c$}function E$(t){return t.data.source===Nt.MouseInteraction}function vi(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var $y=(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))($y||{}),T$=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function w$(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(T$.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}var x$=t=>e=>{if(!t.isEnabled())return;let n=A$(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&&h$(t.clickDetector,n,WC(e.event)),up(t,n)};function XC(t,e){let n=Vo.mirror.getId(t),r=n&&Vo.mirror.getNode(n),o=r&&Vo.mirror.getMeta(r),i=o&&k$(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===$y.Text&&a.textContent).filter(Boolean).map(a=>a.trim()).join(""),attributes:w$(i.attributes)}}:{}}}function A$(t){let{target:e,message:n}=I$(t);return vi({category:`ui.${t.name}`,...XC(e,n)})}function I$(t){let e=t.name==="click",n,r=null;try{r=e?WC(t.event):KC(t.event),n=de(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function k$(t){return t.type===$y.Element}function R$(t,e){if(!t.isEnabled())return;t.updateUserActivity();let n=N$(e);n&&up(t,n)}function N$(t){let{metaKey:e,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:a}=t;if(!a||C$(a)||!i)return null;let s=e||r||o,l=i.length===1;if(!s&&l)return null;let c=de(a,{maxStringLength:200})||"<unknown>",d=XC(a,c);return vi({category:"ui.keyDown",message:c,data:{...d.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function C$(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}var M$={resource:B$,paint:L$,navigation:U$};function QS(t,e){return({metric:n})=>void e.replayPerformanceEntries.push(t(n))}function O$(t){return t.map(D$).filter(Boolean)}function D$(t){let e=M$[t.entryType];return e?e(t):null}function Mu(t){return((Qt()||Te.performance.timeOrigin)+t)/1e3}function L$(t){let{duration:e,entryType:n,name:r,startTime:o}=t,i=Mu(o);return{type:n,name:r,start:i,end:i+e,data:void 0}}function U$(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:Mu(f),end:Mu(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 B$(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:Mu(i),end:Mu(o),name:r,data:{size:c,statusCode:l,decodedBodySize:a,encodedBodySize:s}}}function P$(t){let e=t.entries[t.entries.length-1],n=e?.element?[e.element]:void 0;return DE(t,"largest-contentful-paint",n)}function z$(t){return t.sources!==void 0}function F$(t){let e=[],n=[];for(let r of t.entries)if(z$(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 DE(t,"cumulative-layout-shift",n,e)}function H$(t){let e=t.entries[t.entries.length-1],n=e?.target?[e.target]:void 0;return DE(t,"interaction-to-next-paint",n)}function DE(t,e,n,r){let o=t.value,i=t.rating,a=Mu(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 G$(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(QS(P$,t)),qi(QS(F$,t)),pl(QS(H$,t))),()=>{r.forEach(o=>o())}}var xt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,$$='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 j$(){let t=new Blob([$$]);return URL.createObjectURL(t)}var yC=["log","warn","error"],wy="[Replay] ";function ZS(t,e="info"){Tn({category:"console",data:{logger:"replay"},level:e,message:`${wy}${t}`},{level:e})}function q$(){let t=!1,e=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{t=!!r.captureExceptions,e=!!r.traceInternals}};return xt?(yC.forEach(r=>{n[r]=(...o)=>{w[r](wy,...o),e&&ZS(o.join(""),Hi(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),w.error(wy,r),t?wt(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):e&&ZS(r,"error")},n.infoTick=(...r)=>{w.log(wy,...r),e&&setTimeout(()=>ZS(r[0]),0)}):yC.forEach(r=>{n[r]=()=>{}}),n}var At=q$(),ap=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${IE}.`)}},Oy=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>IE)throw new ap;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:OE(e)}},yE=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){xt&&At.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():(xt&&At.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{xt&&At.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(){xt&&At.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++}},bE=class{constructor(e){this._worker=new yE(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=OE(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>IE?Promise.reject(new ap):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{xt&&At.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}},_E=class{constructor(e){this._fallback=new Oy,this._compression=new bE(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){xt&&At.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){xt&&At.exception(i,"Failed to add events when switching buffers.")}}};function V$({useCompression:t,workerUrl:e}){if(t&&window.Worker){let n=Y$(e);if(n)return n}return xt&&At.log("Using simple buffer"),new Oy}function Y$(t){try{let e=t||W$();if(!e)return;xt&&At.log(`Using compression worker${t?` from ${t}`:""}`);let n=new Worker(e);return new _E(n)}catch(e){xt&&At.exception(e,"Failed to create compression worker")}}function W$(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?j$():""}function LE(){try{return"sessionStorage"in Te&&!!Te.sessionStorage}catch{return!1}}function K$(t){X$(),t.session=void 0}function X$(){if(LE())try{Te.sessionStorage.removeItem(xE)}catch{}}function JC(t){return t===void 0?!1:Math.random()<t}function jy(t){if(LE())try{Te.sessionStorage.setItem(xE,JSON.stringify(t))}catch{}}function QC(t){let e=Date.now(),n=t.id||oe(),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 J$(t,e){return JC(t)?"session":e?"buffer":!1}function bC({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){let o=J$(t,e),i=QC({sampled:o,previousSessionId:r});return n&&jy(i),i}function Q$(){if(!LE())return null;try{let t=Te.sessionStorage.getItem(xE);if(!t)return null;let e=JSON.parse(t);return xt&&At.infoTick("Loading existing session"),QC(e)}catch{return null}}function vE(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function Z$(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return vE(t.started,e,r)||vE(t.lastActivity,n,r)}function Dy(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!Z$(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function tE({sessionIdleExpire:t,maxReplayDuration:e,previousSessionId:n},r){let o=r.stickySession&&Q$();return o?Dy(o,{sessionIdleExpire:t,maxReplayDuration:e})?(xt&&At.infoTick("Session in sessionStorage is expired, creating new one..."),bC(r,{previousSessionId:o.id})):o:(xt&&At.infoTick("Creating new session"),bC(r,{previousSessionId:n}))}function tj(t){return t.type===Gt.Custom}function UE(t,e,n){return t2(t,e)?(ZC(t,e,n),!0):!1}function ej(t,e,n){return t2(t,e)?ZC(t,e,n):Promise.resolve(null)}async function ZC(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=nj(e,i.beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(i){let a=i&&i instanceof ap,s=a?"eventBufferOverflow":"eventBufferError",l=B();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 t2(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;let n=OE(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(xt&&At.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function nj(t,e){try{if(typeof e=="function"&&tj(t))return e(t)}catch(n){return xt&&At.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return t}var rj=100;function e2(t,e){let n=t.getContext();n.traceIds.size<rj&&n.traceIds.add(e)}function oj(t){return e=>{if(!t.isEnabled()||!En(e))return;let n=e.spanContext().traceId;n&&e2(t,n)}}function BE(t){return!t.type}function SE(t){return t.type==="transaction"}function ij(t){return t.type==="replay_event"}function _C(t){return t.type==="feedback"}function aj(t){return(e,n)=>{if(!t.isEnabled()||!BE(e)&&!SE(e))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(SE(e)){sj(t,e);return}lj(t,e)}}}function sj(t,e){let n=e.contexts?.trace?.trace_id;n&&e2(t,n)}function lj(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)||bl(async()=>{try{await t.sendBufferedReplayOrFlush()}catch(o){t.handleException(o)}})}function cj(t){return e=>{!t.isEnabled()||!BE(e)||uj(t,e)}}function uj(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:Wn()}});up(t,r)}}function dj(t){let e=B();e&&e.on("beforeAddBreadcrumb",n=>fj(t,n))}function fj(t,e){if(!t.isEnabled()||!n2(e))return;let n=pj(e);n&&up(t,n)}function pj(t){return!n2(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui.")?null:t.category==="console"?mj(t):vi(t)}function mj(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>vy?(n=!0,`${o.slice(0,vy)}\u2026`):o;if(typeof o=="object")try{let i=le(o,7);return JSON.stringify(i).length>vy?(n=!0,`${JSON.stringify(i,null,2).slice(0,vy)}\u2026`):i}catch{}return o});return vi({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function n2(t){return!!t.category}function gj(t,e){return t.type||!t.exception?.values?.length?!1:!!e.originalException?.__rrweb__}function Ly(){let t=nt().getPropagationContext().dsc;t&&delete t.replay_id;let e=Lt();if(e){let n=$e(e);delete n.replay_id}}function vC(t){let e=nt().getPropagationContext().dsc;e&&(e.replay_id=t);let n=Lt();if(n){let r=$e(n);r.replay_id=t}}function hj(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:Gt.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 yj(t,e){return t.recordingMode!=="buffer"||e.message===AE||!e.exception||e.type?!1:JC(t.getOptions().errorSampleRate)}function bj(t){return Object.assign((e,n)=>{if(t.session&&Dy(t.session,{maxReplayDuration:t.getOptions().maxReplayDuration,sessionIdleExpire:t.timeouts.sessionIdleExpire})&&Ly(),!t.isEnabled()||t.isPaused())return e;if(ij(e))return delete e.breadcrumbs,e;if(!BE(e)&&!SE(e)&&!_C(e))return e;if(!t.checkAndHandleExpiredSession())return Ly(),e;if(_C(e))return t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),hj(t,e),e;if(gj(e,n)&&!t.getOptions()._experiments.captureExceptions)return xt&&At.log("Ignoring error from rrweb internals",e),null;let o=yj(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&&jy(a)}return e},{id:"Replay"})}function qy(t,e){return e.map(({type:n,start:r,end:o,name:i,data:a})=>{let s=t.throttledAddEvent({type:Gt.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 _j(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 vj(t){return e=>{if(!t.isEnabled())return;let n=_j(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(qy(t,[n]),!1)))}}function Sj(t,e){return xt&&t.getOptions()._experiments.traceInternals?!1:Gc(e,B())}function r2(t,e){t.isEnabled()&&e!==null&&(Sj(t,e.name)||t.addUpdate(()=>(qy(t,[e]),!0)))}function Vy(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=sy(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function o2(t){if(!t)return;let e=parseInt(t,10);return isNaN(e)?void 0:e}function Uy(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 i2(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 sp(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}=Ej(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function EE(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 Ej(t){if(!t||typeof t!="string")return{body:t};let e=t.length>tC,n=Tj(t);if(e){let r=t.slice(0,tC);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 Tj(t){let e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function By(t,e){let n=wj(t);return nn(n,e)}function wj(t,e=Te.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(Te.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 xj(t,e,n){try{let r=await Ij(t,e,n),o=i2("resource.fetch",r);r2(n.replay,o)}catch(r){xt&&At.exception(r,"Failed to capture fetch breadcrumb")}}function Aj(t,e){let{input:n,response:r}=e,o=n?_u(n):void 0,i=Vy(o),a=r?o2(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 Ij(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=By(a,n.networkDetailAllowUrls)&&!By(a,n.networkDetailDenyUrls),p=u?kj(n,e.input,c):sp(c),f=await Rj(u,n,e.response,d);return{startTimestamp:o,endTimestamp:i,url:a,method:s,statusCode:l,request:p,response:f}}function kj({networkCaptureBodies:t,networkRequestHeaders:e},n,r){let o=n?Mj(n,e):{};if(!t)return Za(o,r,void 0);let i=_u(n),[a,s]=vl(i,At),l=Za(o,r,a);return s?Uy(l,s):l}async function Rj(t,{networkCaptureBodies:e,networkResponseHeaders:n},r,o){if(!t&&o!==void 0)return sp(o);let i=r?a2(r.headers,n):{};if(!r||!e&&o!==void 0)return Za(i,o,void 0);let[a,s]=await Cj(r),l=Nj(a,{networkCaptureBodies:e,responseBodySize:o,captureDetails:t,headers:i});return s?Uy(l,s):l}function Nj(t,{networkCaptureBodies:e,responseBodySize:n,captureDetails:r,headers:o}){try{let i=t?.length&&n===void 0?Vy(t):n;return r?e?Za(o,i,t):Za(o,i,void 0):sp(i)}catch(i){return xt&&At.exception(i,"Failed to serialize response body"),Za(o,n,void 0)}}async function Cj(t){let e=Oj(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await Dj(e)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(xt&&At.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(xt&&At.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function a2(t,e){let n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function Mj(t,e){return t.length===1&&typeof t[0]!="string"?SC(t[0],e):t.length===2?SC(t[1],e):{}}function SC(t,e){if(!t)return{};let n=t.headers;return n?n instanceof Headers?a2(n,e):Array.isArray(n)?{}:EE(n,e):{}}function Oj(t){try{return t.clone()}catch(e){xt&&At.exception(e,"Failed to clone response body")}}function Dj(t){return new Promise((e,n)=>{let r=bl(()=>n(new Error("Timeout while trying to read response body")),500);Lj(t).then(o=>e(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function Lj(t){return await t.text()}async function Uj(t,e,n){try{let r=Pj(t,e,n),o=i2("resource.xhr",r);r2(n.replay,o)}catch(r){xt&&At.exception(r,"Failed to capture xhr breadcrumb")}}function Bj(t,e){let{xhr:n,input:r}=e;if(!n)return;let o=Vy(r),i=n.getResponseHeader("content-length")?o2(n.getResponseHeader("content-length")):Hj(n.response,n.responseType);o!==void 0&&(t.data.request_body_size=o),i!==void 0&&(t.data.response_body_size=i)}function Pj(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||!By(l,n.networkDetailAllowUrls)||By(l,n.networkDetailDenyUrls)){let C=sp(u),I=sp(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:d,request:C,response:I}}let f=s[tr],m=f?EE(f.request_headers,n.networkRequestHeaders):{},_=EE(Wf(s),n.networkResponseHeaders),[v,h]=n.networkCaptureBodies?vl(a,At):[void 0],[b,S]=n.networkCaptureBodies?zj(s):[void 0],E=Za(m,u,v),R=Za(_,p,b);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:d,request:h?Uy(E,h):E,response:S?Uy(R,S):R}}function zj(t){let e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return Fj(t.response,t.responseType)}catch(n){e.push(n)}return xt&&At.warn("Failed to get xhr response body",...e),[void 0]}function Fj(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 xt&&At.exception(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return xt&&At.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Hj(t,e){try{let n=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return Vy(n)}catch{return}}function Gj(t){let e=B();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)=>$j(s,l,c))}catch{}}function $j(t,e,n){if(e.data)try{jj(e)&&Vj(n)&&(Bj(e,n),Uj(e,n,t)),qj(e)&&Yj(n)&&(Aj(e,n),xj(e,n,t))}catch(r){xt&&At.exception(r,"Error when enriching network breadcrumb")}}function jj(t){return t.category==="xhr"}function qj(t){return t.category==="fetch"}function Vj(t){return t?.xhr}function Yj(t){return t?.input!==void 0}function Wj(t){let e=B();Yf(x$(t)),Wi(vj(t)),dj(t),Gj(t);let n=bj(t);Lc(n),e&&(e.on("beforeSendEvent",cj(t)),e.on("afterSendEvent",aj(t)),e.on("createDsc",r=>{let o=t.getSessionId();o&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(r.replay_id=o)}),e.on("afterSegmentSpanEnd",oj(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 Kj(t){try{return Promise.all(qy(t,[Xj(Te.performance.memory)]))}catch{return[]}}function Xj(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 Jj(t,e,n){return bv(t,e,{...n,setTimeoutImpl:bl})}var Ty=Z.navigator;function Qj(){return/iPhone|iPad|iPod/i.test(Ty?.userAgent??"")||/Macintosh/i.test(Ty?.userAgent??"")&&Ty?.maxTouchPoints&&Ty?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function Zj(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){xt&&At.warn("Received replay event after session expired.");return}let o=r||!e;e=!0,tq(n),t.clickDetector&&v$(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&o&&t.setInitialState(),!UE(t,n,o))return!0;if(!o)return!1;let i=t.session;if(nq(t,o),t.recordingMode==="buffer"&&i&&t.eventBuffer&&!i.dirty){let a=t.eventBuffer.getEarliestTimestamp();a&&(xt&&At.log(`Updating session start time to earliest event in buffer to ${new Date(a)}`),i.started=a,t.getOptions().stickySession&&jy(i))}return i?.previousSessionId||t.recordingMode==="session"&&t.flush(),!0})}}function tq(t){let e=t.data;if(!(t.type!==Gt.IncrementalSnapshot||!e||typeof e!="object"||!("source"in e)||e.source!==Nt.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===$y.Element)for(let[i,a]of Object.entries(n.attributes))a===null?delete o.attributes[i]:o.attributes[i]=a}}function eq(t){let e=t.getOptions();return{type:Gt.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 nq(t,e){!e||t.session?.segmentId!==0||UE(t,eq(t),!1)}function rq(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function oq(t,e,n,r){return Oe(kc(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 iq({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 aq({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 Sf(t.getOptions(),r,i,e,t,zt());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 sq({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:o,session:i}){let a=iq({recordingData:t,headers:{segment_id:n}}),{urls:s,errorIds:l,traceIds:c,initialTimestamp:d}=r,u=B(),p=nt(),f=u?.getTransport(),m=u?.getDsn();if(!u||!f||!m||!i.sampled)return Promise.resolve({});let _={type:V9,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 aq({scope:p,client:u,replayId:e,event:_});if(!v)return u.recordDroppedEvent("event_processor","replay"),xt&&At.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete v.sdkProcessingMetadata;let h=oq(v,a,m,u.getOptions().tunnel),b;try{b=await f.send(h)}catch(E){let R=new Error(AE);try{R.cause=E}catch{}throw R}let S=wf({},b);if(Tf(S,"replay"))throw new lp(S);if(typeof b.statusCode=="number"&&(b.statusCode<200||b.statusCode>=300))throw new Py(b.statusCode);return b}var Py=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},lp=class extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}},zy=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function s2(t,e={count:0,interval:Q9}){let{recordingData:n,onError:r}=t;if(n.length)try{return await sq(t),!0}catch(o){if(o instanceof Py||o instanceof lp)throw o;if(La("Replays",{_retryCount:e.count}),r&&r(o),e.count>=Z9){let i=new Error(`${AE} - max retries exceeded`);try{i.cause=o}catch{}throw i}return e.interval*=++e.count,new Promise((i,a)=>{bl(async()=>{try{await s2(t,e),i(!0)}catch(s){a(s)}},e.interval)})}}var l2="__THROTTLED",lq="__SKIPPED";function cq(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?lq:l2}a=!1;let c=r.get(l)||0;return r.set(l,c+1),t(...s)}}var TE=class{constructor({options:e,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:Y9,sessionIdleExpire:W9},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=Jj(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=cq((a,s)=>ej(this,a,s),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(tG,r),timeout:r,scrollTimeout:eG,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new hE(this,i)),xt){let a=e._experiments;At.setConfig({captureExceptions:!!a.captureExceptions,traceInternals:!!a.traceInternals})}this._handleVisibilityChange=()=>{Te.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=>{R$(this,a)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){xt&&At.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){xt&&At.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",xt&&At.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){xt&&At.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){xt&&At.log("Buffering is in progress, call `flush()` to save the replay");return}xt&&At.infoTick("Starting replay in session mode"),this._updateUserActivity();let e=tE({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){xt&&At.log("Buffering is in progress, call `flush()` to save the replay");return}xt&&At.infoTick("Starting replay in buffer mode");let e=tE({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:J9}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Zj(this),...Qj(),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";B()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{xt&&At.log(`Stopping Replay triggered by ${r}`),Ly(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,K$(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),xt&&At.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),xt&&At.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();xt&&At.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(),vC(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&&vE(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${Te.location.pathname}${Te.location.hash}${Te.location.search}`,n=`${Te.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===l2){let o=vi({category:"replay.throttled"});this.addUpdate(()=>!UE(this,{type:u$,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let e=this.lastActiveSpan||Lt(),n=e&&Pt(e),o=(n&&tt(n).data||{})[Dt];if(!(!n||!o||!["route","custom"].includes(o)))return tt(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=V$({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&B()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&vC(this.session.id)}_initializeSessionForSampling(e){let n=this._options.errorSampleRate>0,r=tE({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 Dy(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{Te.document.addEventListener("visibilitychange",this._handleVisibilityChange),Te.addEventListener("blur",this._handleWindowBlur),Te.addEventListener("focus",this._handleWindowFocus),Te.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Wj(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=G$(this)}_removeListeners(){try{Te.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Te.removeEventListener("blur",this._handleWindowBlur),Te.removeEventListener("focus",this._handleWindowFocus),Te.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(Dy(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Ly();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){xt&&At.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:Gt.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=O$(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(qy(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){xt&&At.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await Kj(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new zy;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await s2({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=B();if(r){let o;n instanceof lp?o="ratelimit_backoff":n instanceof zy?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){xt&&At.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){xt&&At.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&&xt&&At.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&&jy(this.session)}_onMutationHandler(e){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&e.some(s=>{let l=rq(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 Jf(t,e){return[...t,...e].join(",")}function uq({mask:t,unmask:e,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],a=Jf(t,[".sentry-mask","[data-sentry-mask]"]),s=Jf(e,[]);return{maskTextSelector:a,unmaskTextSelector:s,blockSelector:Jf(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:Jf(r,[]),ignoreSelector:Jf(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function dq({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 EC='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',fq=["content-length","content-type","accept"],pq=Symbol.for("sentry__originalRequestBody"),TC=!1,wC=!1;function mq(){if(typeof Request>"u"||wC)return;let t=Request;try{let e=function(n,r){let o=new t(n,r);return r?.body!=null&&(o[pq]=r.body),o};e.prototype=t.prototype,Z.Request=e,wC=!0}catch{}}var Yy=(t=>new wE(t)),wE=class{constructor({flushMinDelay:e=K9,flushMaxDelay:n=X9,minReplayDuration:r=nG,maxReplayDuration:o=eC,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:b=!0,networkRequestHeaders:S=[],networkResponseHeaders:E=[],mask:R=[],maskAttributes:C=["title","placeholder","aria-label"],unmask:I=[],block:L=[],unblock:P=[],ignore:U=[],maskFn:O,beforeAddRecordingEvent:N,beforeErrorSampling:W,onError:X,attachRawBodyFromRequest:pt=!1}={}){this.name="Replay";let et=uq({mask:R,unmask:I,block:L,unblock:P,ignore:U});if(this._recordingOptions={maskAllInputs:d,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:O,maskInputFn:O,maskAttributeFn:(lt,H,ct)=>dq({maskAttributes:C,maskAllText:c,privacyOptions:et,key:lt,value:H,el:ct}),...et,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,rG),maxReplayDuration:Math.min(o,eC),stickySession:i,useCompression:a,workerUrl:s,blockAllMedia:u,maskAllInputs:d,maskAllText:c,mutationBreadcrumbLimit:p,mutationLimit:f,slowClickTimeout:m,slowClickIgnoreSelectors:_,networkDetailAllowUrls:v,networkDetailDenyUrls:h,networkCaptureBodies:b,networkRequestHeaders:xC(S),networkResponseHeaders:xC(E),beforeAddRecordingEvent:N,beforeErrorSampling:W,onError:X,attachRawBodyFromRequest:pt,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${EC}`:EC,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&qn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return TC}set _isInitialized(e){TC=e}afterAllSetup(e){!qn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&mq(),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&&(Cr(e,{"sentry.replay_id":n}),this.getRecordingMode()==="buffer"&&Cr(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let n=gq(this._initialOptions,e);this._replay=new TE({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let n=e.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function gq(t,e){let n=e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...t},o=Nr(n.replaysSessionSampleRate),i=Nr(n.replaysOnErrorSampleRate);return o==null&&i==null&&dn(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function xC(t){return[...fq,...t.map(e=>e.toLowerCase())]}function c2(){return B()?.getIntegrationByName("Replay")}var hq=Object.defineProperty,yq=(t,e,n)=>e in t?hq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,u2=(t,e,n)=>yq(t,typeof e!="symbol"?e+"":e,n),zE=class{constructor(){u2(this,"idNodeMap",new Map),u2(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 bq(){return new zE}function _q(t,e){for(let n=t.classList.length;n--;){let r=t.classList[n];if(e.test(r))return!0}return!1}function FE(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:FE(t.parentNode,e,n,r+1)}function d2(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(_q(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}var Ou=`Please stop import mirror directly. Instead of that,\r
|
|
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.`,f2={map:{},getId(){return console.error(Ou),-1},getNode(){return console.error(Ou),null},removeNodeFromMap(){console.error(Ou)},has(){return console.error(Ou),!1},reset(){console.error(Ou)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(f2=new Proxy(f2,{get(t,e,n){return e==="map"&&console.error(Ou),Reflect.get(t,e,n)}}));function GE(t,e,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(a){v2(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>GE(t,e,i||{},!0)}function $E(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 vq(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function Jy(t,e,n,r,o){if(!t)return!1;let i=vq(t);if(!i)return!1;let a=d2(e,n);if(!o){let c=r&&i.matches(r);return a(i)&&!c}let s=FE(i,a),l=-1;return s<0?!1:(r&&(l=FE(i,d2(null,r))),s>-1&&l<0?!0:s<l)}var p2={};function _2(t){let e=p2[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 p2[t]=r.bind(window)}function El(...t){return _2("requestAnimationFrame")(...t)}function v2(...t){return _2("setTimeout")(...t)}var Lu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Lu||{}),Ky;function Sq(t){Ky=t}var PE=t=>Ky?((...n)=>{try{return t(...n)}catch(r){if(Ky&&Ky(r)===!0)return()=>{};throw r}}):t,Du="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Eq=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(dp=0;dp<Du.length;dp++)Eq[Du.charCodeAt(dp)]=dp;var dp,Tq=function(t){var e=new Uint8Array(t),n,r=e.length,o="";for(n=0;n<r;n+=3)o+=Du[e[n]>>2],o+=Du[(e[n]&3)<<4|e[n+1]>>4],o+=Du[(e[n+1]&15)<<2|e[n+2]>>6],o+=Du[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},m2=new Map;function wq(t,e){let n=m2.get(t);return n||(n=new Map,m2.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}var S2=(t,e,n)=>{if(!t||!(T2(t,e)||typeof t=="object"))return;let r=t.constructor.name,o=wq(n,r),i=o.indexOf(t);return i===-1&&(i=o.length,o.push(t)),i};function Xy(t,e,n){if(t instanceof Array)return t.map(r=>Xy(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=Tq(t);return{rr_type:r,base64:o}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Xy(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:[Xy(t.data,e,n),t.width,t.height]};if(T2(t,e)||typeof t=="object"){let r=t.constructor.name,o=S2(t,e,n);return{rr_type:r,index:o}}}}return t}var E2=(t,e,n)=>t.map(r=>Xy(r,e,n)),T2=(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 xq(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=$E(e.CanvasRenderingContext2D.prototype,s,function(c){return function(...d){return Jy(this.canvas,n,r,o,!0)||v2(()=>{let u=E2(d,e,this);t(this.canvas,{type:Lu["2D"],property:s,args:u})},0),c.apply(this,d)}});i.push(l)}catch{let l=GE(e.CanvasRenderingContext2D.prototype,s,{set(c){t(this.canvas,{type:Lu["2D"],property:s,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(s=>s())}}function Aq(t){return t==="experimental-webgl"?"webgl":t}function g2(t,e,n,r,o){let i=[];try{let a=$E(t.HTMLCanvasElement.prototype,"getContext",function(s){return function(l,...c){if(!Jy(this,e,n,r,!0)){let d=Aq(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 h2(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=$E(t,d,function(p){return function(...f){let m=p.apply(this,f);if(S2(m,s,this),"tagName"in this.canvas&&!Jy(this.canvas,r,o,i,!0)){let _=E2(f,s,this),v={type:e,property:d,args:_};n(this.canvas,v)}return m}});l.push(u)}catch{let u=GE(t,d,{set(p){n(this.canvas,{type:e,property:d,args:[p],setter:!0})}});l.push(u)}return l}function Iq(t,e,n,r,o,i){let a=[];return a.push(...h2(e.WebGLRenderingContext.prototype,Lu.WebGL,t,n,r,o,i,e)),typeof e.WebGL2RenderingContext<"u"&&a.push(...h2(e.WebGL2RenderingContext.prototype,Lu.WebGL2,t,n,r,o,i,e)),()=>{a.forEach(s=>s())}}var kq='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 Rq(){let t=new Blob([kq]);return URL.createObjectURL(t)}var HE=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&&Sq(a),(i&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&PE(()=>{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}PE(()=>{if(a&&n==="all"&&this.initCanvasMutationObserver(e,r,o,i),a&&typeof n=="number"){let l=g2(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(Rq());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:Lu["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=g2(e,n,r,o,!1),a=xq(this.processMutation.bind(this),e,n,r,o),s=Iq(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=>{Jy(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=>{PE(()=>{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)}bq();var y2;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(y2||(y2={}));var b2={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}}},Nq="ReplayCanvas",Wy=1280,Cq=((t={})=>{let[e,n]=t.maxCanvasSize||[],r={quality:t.quality||"medium",enableManualSnapshot:t.enableManualSnapshot,maxCanvasSize:[e?Math.min(e,Wy):Wy,n?Math.min(n,Wy):Wy]},o,i,a=new Promise(s=>i=s);return{name:Nq,getOptions(){let{quality:s,enableManualSnapshot:l,maxCanvasSize:c}=r;return{enableManualSnapshot:l,recordCanvas:!0,getCanvasManager:d=>{let u=new HE({...d,enableManualSnapshot:l,maxCanvasSize:c,errorHandler:p=>{try{typeof p=="object"&&(p.__rrweb__=!0)}catch{}}});return o=u,i(u),u},...b2[s]||b2.medium}},async snapshot(s,l){(o||await a).snapshot(s,l)}}}),w2=Cq;function x2(t){return t.split(",").some(e=>e.trim().startsWith("sentry-"))}function jE(t){try{return new URL(t,j.location.origin).href}catch{return}}function A2(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function qE(t){try{return new Headers(t)}catch{return}}var fp={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Qy(t,e){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:s,onRequestSpanEnd:l}={...fp,...e},c=typeof o=="function"?o:f=>!0,d=f=>Oq(f,a),u={},p=t.getOptions().propagateTraceparent;n&&hi(f=>{let m=Cv(f,c,d,u,{propagateTraceparent:p,onRequestSpanEnd:l});if(m){let _=jE(f.fetchData.url),v=_?to(_).host:void 0,h=_?Vn(_):void 0;m.setAttributes({"http.url":h,"url.full":h,"server.address":v}),i&&I2(m,t),s?.(m,{headers:f.headers})}}),r&&_l(f=>{let m=Dq(f,c,d,u,p,l);m&&(i&&I2(m,t),s?.(m,{headers:qE(f.xhr.__sentry_xhr_v3__?.request_headers)}))})}var Mq=300;function I2(t,e){let{url:n}=tt(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??Ot(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(s),clearTimeout(d))};r=c;let d=setTimeout(c,Mq)}}let o=hr("resource",({entries:i})=>{i.forEach(a=>{A2(a)&&a.name.endsWith(n)&&(t.setAttributes(qf(a)),r())})})}function Oq(t,e){let n=Wn();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?nn(r.toString(),e)||i&&nn(r.pathname,e):i}else{let r=!!t.match(/^\/(?!\/)/);return e?nn(t,e):r}}function Dq(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=Me()&&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:qE(Wf(a)),error:t.error})),delete r[S]);return}let u=jE(l),p=u?to(u):to(l),f=u?Vn(u):void 0,m=Vn(Hc(l)),_=B(),h=!!Lt()||!!_&&je(_),b=d&&h?xe({name:`${c} ${m}`,attributes:{url:Vn(l),type:"xhr","http.method":c,"http.url":f,"url.full":f,"server.address":p?.host,[at]:"auto.http.browser",[bt]:"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__=b.spanContext().spanId,r[a.__sentry_xhr_span_id__]=b,n(l)&&Lq(a,Me()&&h?b:void 0,o),_&&_.emit("beforeOutgoingRequestSpan",b,t),b}function Lq(t,e,n){let{"sentry-trace":r,baggage:o,traceparent:i}=el({span:e,propagateTraceparent:n});r&&Uq(t,r,o,i)}function Uq(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||!x2(i))&&t.setRequestHeader("baggage",n)}}catch{}}var k2=new WeakMap,R2=new WeakMap,Bq=9e4,Pq=["text/event-stream","application/x-ndjson","application/stream+json"],Zy=()=>({name:"FetchStreamPerformance",setup(){Mh(t=>{if(t.response){let e=k2.get(t.response);if(e&&t.endTimestamp){e.end(t.endTimestamp);let n=R2.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")||!Pq.some(l=>e.startsWith(l)))return;let n=t.fetchData?.url||"",r=t.fetchData?.method||"GET",o=ui(n),i=n.startsWith("data:")?Vn(n):o?Fc(o):n,a=xe({name:`${r} ${i}`,startTime:t.endTimestamp,attributes:{url:Vn(n),"http.method":r,type:"fetch",[bt]:"http.client.stream",[at]:"auto.http.browser.stream"}});k2.set(t.response,a);let s=setTimeout(()=>{a.isRecording()&&a.end()},Bq);R2.set(t.response,s)}})}});var VE="WebVitals",tb=(t={})=>{let e=new Set(t.ignore??[]);return{name:VE,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=TS({recordClsStandaloneSpans:a,recordLcpStandaloneSpans:s,client:n}),c=new WeakSet;n.on("afterStartPageLoadSpan",d=>{c.add(d)}),n.on("spanEnd",d=>{c.delete(d)&&(l(),kS(d,{recordClsOnPageloadSpan:a===!1,recordLcpOnPageloadSpan:s===!1,spanStreamingEnabled:r}))}),r?(e.has("lcp")||LS(n),e.has("cls")||US(n),e.has("inp")||BS()):e.has("inp")||MS()},afterAllSetup(){e.has("inp")||OS()}}};function N2(){j.document?j.document.addEventListener("visibilitychange",()=>{let t=Lt();if(!t)return;let e=Pt(t);if(j.document.hidden&&e){let n="cancelled",{op:r,status:o}=tt(e);V&&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()}}):V&&w.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var zq=3600,C2="sentry_previous_trace",Fq="sentry.previous_trace";function M2(t,{linkPreviousTrace:e,consistentTraceSampling:n}){let r=e==="session-storage",o=r?$q():void 0;t.on("spanStart",a=>{if(Pt(a)!==a)return;let s=nt().getPropagationContext();o=Hq(o,a,s),r&&Gq(o)});let i=!0;n&&t.on("beforeSampling",a=>{if(!o)return;let s=nt(),l=s.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}s.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(YE(o.spanContext))},sampleRand:o.sampleRand}),a.parentSampled=YE(o.spanContext),a.parentSampleRate=o.sampleRate,a.spanAttributes={...a.spanAttributes,[Ec]:o.sampleRate}})}function Hq(t,e,n){let r=tt(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<=zq&&(V&&w.log(`Adding previous_trace \`${JSON.stringify(a)}\` link to span \`${JSON.stringify({op:r.op,...e.spanContext()})}\``),e.addLink({context:a,attributes:{[bg]:"previous_trace"}}),e.setAttribute(Fq,`${a.traceId}-${a.spanId}-${YE(a)?1:0}`)),i)}function Gq(t){try{j.sessionStorage.setItem(C2,JSON.stringify(t))}catch(e){V&&w.warn("Could not store previous trace in sessionStorage",e)}}function $q(){try{let t=j.sessionStorage?.getItem(C2);return JSON.parse(t)}catch{return}}function YE(t){return t.traceFlags===1}var jq="BrowserTracing",qq=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function WE(){let t=j.navigator;return t?.userAgent?qq.test(t.userAgent):!1}var Vq={...Nc,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...fp},Pr=((t={})=>{"enableElementTiming"in t&&dn(()=>{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=j.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:b,ignoreResourceSpans:S,ignorePerformanceApiSpans:E,instrumentPageLoad:R,instrumentNavigation:C,detectRedirects:I,linkPreviousTrace:L,consistentTraceSampling:P,enableReportPageLoaded:U,onRequestSpanStart:O,onRequestSpanEnd:N}={...Vq,...t},W=WE(),X,pt;function et(lt,H,ct=!0){let Y=H.op==="pageload",dt=H.name,K=c?c(H):H,yt=K.attributes||{};if(dt!==K.name&&(yt[Dt]="custom",K.attributes=yt),!ct){let Rn=sr();xe({...K,startTime:Rn}).end(Rn);return}e.name=K.name,e.source=yt[Dt];let Jt=Ug(K,{idleTimeout:d,finalTimeout:u,childSpanTimeout:p,disableAutoFinish:Y,beforeSpanEnd:Rn=>{IS(Rn,{ignoreResourceSpans:S,ignorePerformanceApiSpans:E,spanStreamingEnabled:je(lt)}),L2(lt,void 0);let yn=nt(),Q=yn.getPropagationContext();yn.setPropagationContext({...Q,traceId:Jt.spanContext().traceId,sampled:En(Jt),dsc:$e(Rn)}),Y&&(pt=void 0)},trimIdleSpanEndTimestamp:!U});Y&&U&&(pt=Jt),L2(lt,Jt);function He(){n&&["interactive","complete"].includes(n.readyState)&&(lt.emit("idleSpanEnableAutoFinish",Jt),n.removeEventListener("readystatechange",He))}Y&&!U&&n&&(n.addEventListener("readystatechange",He),He())}return{name:jq,setup(lt){if(W){V&&w.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(df(),i&&Z.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?xS():o&&wS(),a&&AS(),I&&n){let ct=()=>{X=Ot()};addEventListener("click",ct,{capture:!0}),addEventListener("keydown",ct,{capture:!0,passive:!0})}function H(){let ct=pp(lt);ct&&!tt(ct).timestamp&&(V&&w.log(`[Tracing] Finishing current active span with op: ${tt(ct).op}`),ct.setAttribute(Li,"cancelled"),ct.end())}lt.on("startNavigationSpan",(ct,Y)=>{if(B()!==lt)return;if(Y?.isRedirect){V&&w.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),et(lt,{op:"navigation.redirect",...ct},!1);return}X=void 0,H(),zt().setPropagationContext({traceId:Cn(),sampleRand:Math.random(),propagationSpanId:Me()?void 0:Hn()});let dt=nt();dt.setPropagationContext({traceId:Cn(),sampleRand:Math.random(),propagationSpanId:Me()?void 0:Hn()}),dt.setSDKProcessingMetadata({normalizedRequest:void 0}),et(lt,{op:"navigation",...ct,parentSpan:null,forceTransaction:!0})}),lt.on("startPageLoadSpan",(ct,Y={})=>{if(B()!==lt)return;H();let dt=Y.sentryTrace||O2("sentry-trace")||D2("sentry-trace"),K=Y.baggage||O2("baggage")||D2("baggage"),yt=rf(dt,K),Jt=nt();Jt.setPropagationContext(yt),Me()||(Jt.getPropagationContext().propagationSpanId=Hn()),Jt.setSDKProcessingMetadata({normalizedRequest:lu()}),et(lt,{op:"pageload",...ct})}),lt.on("endPageloadSpan",()=>{U&&pt&&(pt.setAttribute(Li,"reportPageLoaded"),pt.end())})},afterAllSetup(lt){if(W)return;lt.addIntegration&&!lt.getIntegrationByName?.(VE)&<.addIntegration(tb({ignore:r?[]:["inp"],_experiments:{enableStandaloneClsSpans:s,enableStandaloneLcpSpans:l}}));let H=Wn();if(L!=="off"&&M2(lt,{linkPreviousTrace:L,consistentTraceSampling:P}),j.location){if(R){let ct=Qt();Yo(lt,{name:j.location.pathname,startTime:ct?ct/1e3:void 0,attributes:{[Dt]:"url",[at]:"auto.pageload.browser"}})}C&&Wi(({to:ct,from:Y})=>{if(Y===void 0&&H?.indexOf(ct)!==-1){H=void 0;return}H=void 0;let dt=ui(ct),K=pp(lt),yt=K&&I&&Wq(K,X);Wo(lt,{name:dt?.pathname||j.location.pathname,attributes:{[Dt]:"url",[at]:"auto.navigation.browser"}},{url:ct,isRedirect:yt})})}f&&N2(),a&&Yq(lt,d,u,p,e),Qy(lt,{traceFetch:m,traceXHR:_,tracePropagationTargets:lt.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:h,enableHTTPTimings:b,onRequestSpanStart:O,onRequestSpanEnd:N}),v&<.addIntegration(Zy())}}});function Yo(t,e,n){t.emit("startPageLoadSpan",e,n),nt().setTransactionName(e.name);let r=pp(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=nt();return i.setTransactionName(e.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...lu(),url:r}}),pp(t)}function O2(t){return j.document?.querySelector(`meta[name=${t}]`)?.getAttribute("content")||void 0}function D2(t){return j.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===t)?.description}function Yq(t,e,n,r,o){let i=j.document,a,s=()=>{let l="ui.action.click",c=pp(t);if(c){let d=tt(c).op;if(["navigation","pageload"].includes(d)){V&&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){V&&w.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}a=Ug({name:o.name,op:l,attributes:{[Dt]:o.source||"url"}},{idleTimeout:e,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",s,{capture:!0})}var B2="_sentry_idleSpan";function pp(t){return t[B2]}function L2(t,e){Ht(t,B2,e)}var U2=1.5;function Wq(t,e){let n=tt(t),r=sr(),o=n.start_timestamp;return!(r-o>U2||e&&r-e<=U2)}function P2(t=B()){t?.emit("endPageloadSpan")}function z2(t){let e=Lt();if(e===t)return;let n=nt();t.end=new Proxy(t.end,{apply(r,o,i){return Zn(n,e),Reflect.apply(r,o,i)}}),Zn(n,t)}var F2=()=>({name:"SpanStreaming",beforeSetup(t){let e=t.getOptions();e.traceLifecycle||(V&&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",V&&w.warn(`${e} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!Pi(o)){r.traceLifecycle="static",V&&w.warn(`${e} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let i=new Pf(t);t.on("afterSpanEnd",a=>{En(a)&&i.add(Pg(a,t))}),t.on("afterSegmentSpanEnd",a=>{let s=a.spanContext().traceId;setTimeout(()=>{i.flush(s)},500)})}});function Uu(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Kq(t,e){let n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);let r=Uu(n);return o=>r.then(i=>o(i.transaction(e,"readwrite").objectStore(e)))}function KE(t){return Uu(t.getAllKeys())}function Xq(t,e,n){return t(r=>KE(r).then(o=>{if(!(o.length>=n))return r.put(e,Math.max(...o,0)+1),Uu(r.transaction)}))}function Jq(t,e,n){return t(r=>KE(r).then(o=>{if(!(o.length>=n))return r.put(e,Math.min(...o,0)-1),Uu(r.transaction)}))}function Qq(t){return t(e=>KE(e).then(n=>{let r=n[0];if(r!=null)return Uu(e.get(r)).then(o=>(e.delete(r),Uu(e.transaction).then(()=>o)))}))}function Zq(t){let e;function n(){return e==null&&(e=Kq(t.dbName||"sentry-offline",t.storeName||"queue")),e}return{push:async r=>{try{let o=zi(r);await Xq(n(),o,t.maxQueueSize||30)}catch{}},unshift:async r=>{try{let o=zi(r);await Jq(n(),o,t.maxQueueSize||30)}catch{}},shift:async()=>{try{let r=await Qq(n());if(r)return Mg(r)}catch{}}}}function tV(t){return e=>{let n=t({...e,createStore:Zq});return j.addEventListener("online",async r=>{await n.flush()}),n}}function H2(t=vu){return tV(pv(t))}var G2=1e6,eV="window"in Z&&Z.window===Z&&typeof importScripts>"u",wl=String(0),JE=eV?"main":"worker",eb=j.navigator,j2="",q2="",V2="",XE=eb?.userAgent||"",Y2="",nV=eb?.language||eb?.languages?.[0]||"";function rV(t){return typeof t=="object"&&t!==null&&"getHighEntropyValues"in t}var $2=eb?.userAgentData;rV($2)&&$2.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(t=>{if(j2=t.platform||"",V2=t.architecture||"",Y2=t.model||"",q2=t.platformVersion||"",t.fullVersionList?.length){let e=t.fullVersionList[t.fullVersionList.length-1];XE=`${e.brand} ${e.version}`}}).catch(t=>{});function oV(t){return!("thread_metadata"in t)}function iV(t){return oV(t)?cV(t):t}function aV(t){let e=t.contexts?.trace?.trace_id;return typeof e=="string"&&e.length!==32&&V&&w.log(`[Profiling] Invalid traceId: ${e} on profiled event`),typeof e!="string"?"":e}function sV(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=aV(r),i=iV(n),a=e||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:Ot()*1e3),s=typeof r.timestamp=="number"?r.timestamp*1e3:Ot()*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:j.navigator.userAgent},os:{name:j2,version:q2,build_number:XE},device:{locale:nV,model:Y2,manufacturer:XE,architecture:V2,is_emulator:!1},debug_meta:{images:Q2(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||oe(),trace_id:o,active_thread_id:wl,relative_start_ns:"0",relative_end_ns:((s-a)*1e6).toFixed(0)}]}}function W2(t,e,n){if(t==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${t} instead.`);let r=lV(t),o=e.getOptions(),i=e.getSdkMetadata?.()?.sdk;return{chunk_id:oe(),client_sdk:{name:i?.name??"sentry.javascript.browser",version:i?.version??"0.0.0"},profiler_id:n||oe(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:Q2(t.resources)},profile:r}}function K2(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 lV(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=Qt(),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:JE}}}}function nb(t){return tt(t).op==="pageload"}function cV(t){let e,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[wl]:{name:JE}}},o=t.samples[0];if(!o)return r;let i=o.timestamp,a=Qt(),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)*G2).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)*G2).toFixed(0),stack_id:n,thread_id:wl};r.stacks[n]=p,r.samples[d]=f,n++}),r}function X2(t,e){if(!e.length)return t;for(let n of e)t[1].push([{type:"profile"},n]);return t}function J2(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 Q2(t){let r=B()?.getOptions()?.stackParser;return r?W0(r,t):[]}function Z2(t){return typeof t!="number"&&typeof t!="boolean"||typeof t=="number"&&isNaN(t)?(V&&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?(V&&w.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function uV(t){return t.samples.length<2?(V&&w.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):t.frames.length?!0:(V&&w.log("[Profiling] Discarding profile because it contains no frames"),!1)}var QE=!1,ZE=3e4;function dV(t){return typeof t=="function"}function rb(){let t=j.Profiler;if(!dV(t)){V&&w.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}let e=10,n=Math.floor(ZE/e);try{return new t({sampleInterval:e,maxBufferSize:n})}catch{V&&(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.")),QE=!0}}function tT(t){if(QE)return V&&w.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!t.isRecording())return V&&w.log("[Profiling] Discarding profile because root span was not sampled."),!1;let n=B()?.getOptions();if(!n)return V&&w.log("[Profiling] Profiling disabled, no options found."),!1;let r=n.profilesSampleRate;return Z2(r)?r?(r===!0?!0:Math.random()<r)?!0:(V&&w.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(V&&w.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(V&&w.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function tM(t){if(QE)return V&&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 V&&w.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let e=t.profileSessionSampleRate;return Z2(e)?e?Math.random()<=e:(V&&w.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(V&&w.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function mp(t){return typeof t.profilesSampleRate<"u"}function eM(t,e,n,r){return uV(n)?sV(t,e,n,r):null}var Tl=new Map;function nM(){return Tl.size}function rM(t){let e=Tl.get(t);return e&&Tl.delete(t),e}function oM(t,e){if(Tl.set(t,e),Tl.size>30){let n=Tl.keys().next().value;n!==void 0&&Tl.delete(n)}}var ob=new WeakSet;function xl(t){t.setAttribute("thread.id",wl),t.setAttribute("thread.name",JE)}function eT(t){let e;nb(t)&&(e=Ot()*1e3);let n=rb();if(!n)return;V&&w.log(`[Profiling] started profiling span: ${tt(t).description}`);let r=oe(),o=null;nt().setContext("profile",{profile_id:r,start_timestamp:e}),ob.add(t),xl(t);async function i(){if(t&&n){if(o){V&&w.log("[Profiling] profile for:",tt(t).description,"already exists, returning early");return}return n.stop().then(c=>{if(a&&(j.clearTimeout(a),a=void 0),V&&w.log(`[Profiling] stopped profiling of span: ${tt(t).description}`),!c){V&&w.log(`[Profiling] profiler returned null profile for: ${tt(t).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=c,oM(r,c)}).catch(c=>{V&&w.log("[Profiling] error while stopping profiler:",c)})}}let a=j.setTimeout(()=>{V&&w.log("[Profiling] max profile duration elapsed, stopping profiling for:",tt(t).description),i()},ZE),s=t.end.bind(t);function l(){return t?(i().then(()=>{s()},()=>{s()}),t):s()}t.end=l}var fV=6e4,pV=3e5,ib=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=tM(e.getOptions());V&&w.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||V&&w.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=oe(),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"){V&&w.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){V&&w.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){V&&w.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){V&&w.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){V&&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&&(V&&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,V&&w.log("[Profiling] Started profiling with profiler ID:",this._profilerId),lr().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){V&&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=>{V&&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){V&&w.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==Pt(n))return;if(!n.isRecording()){V&&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&&(V&&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;V&&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=>{V&&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),pV);this._rootSpanTimeouts.set(e,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let e=rb();if(!e){V&&w.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=e}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{V&&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()}},fV))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(V&&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=W2(n,this._client,this._profilerId),o=K2(r);if("reason"in o){V&&w.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),V&&w.log("[Profiling] Collected browser profile chunk.")}catch(n){V&&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=Oe({event_id:oe(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&o&&{dsn:rn(o)}},[[{type:"profile_chunk",platform:"javascript"},e]]);n.sendEnvelope(a).then(null,s=>{V&&w.error("Error while sending profile chunk envelope:",s)})}};var mV="BrowserProfiling",gV=(()=>({name:mV,setup(t){let e=t.getOptions(),n=new ib;if(!mp(e)&&!e.profileLifecycle&&(e.profileLifecycle="manual"),mp(e)&&!e.profilesSampleRate){V&&w.log("[Profiling] Profiling disabled, no profiling options found.");return}let r=Lt(),o=r&&Pt(r);if(mp(e)&&e.profileSessionSampleRate!==void 0&&V&&w.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),mp(e))o&&nb(o)&&tT(o)&&eT(o),t.on("spanStart",i=>{let a=Pt(i);i===a?tT(i)&&eT(i):ob.has(a)&&xl(i)}),t.on("beforeEnvelope",i=>{if(!nM())return;let a=J2(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"){V&&w.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!d){V&&w.log("[Profiling] cannot find profile for a span without a profile context");continue}c?.profile&&delete c.profile;let p=rM(d);if(!p){V&&w.log(`[Profiling] Could not retrieve profile for span: ${d}`);continue}let f=eM(d,u,p,l);f&&s.push(f)}X2(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(!Me(e)){V&&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),j.setTimeout(()=>{let a=Lt(),s=a&&Pt(a);s&&n.notifyRootSpanActive(s)},0)}}}})),iM=gV;var hV="SpotlightBrowser",yV=[{op:"ui.interaction.click",name:"#sentry-spotlight"}],bV=((t={})=>{let e=t.sidecarUrl||"http://localhost:8969/stream";return{name:hV,setup:()=>{V&&w.log("Using Sidecar URL",e)},beforeSetup(n){let r=n.getOptions();r.ignoreSpans=[...r.ignoreSpans||[],...yV]},afterAllSetup:n=>{_V(n,e)}}});function _V(t,e){let n=bu("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 aM=bV;var sM=()=>({name:"LaunchDarkly",processEvent(t,e,n){return Mr(t)}});function lM(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(t,e,n)=>{fr(t,e.value),pr(t,e.value)}}}var cM=()=>({name:"OpenFeature",processEvent(t,e,n){return Mr(t)}}),ab=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 uM=({featureFlagClientClass:t})=>({name:"Unleash",setupOnce(){let e=t.prototype;he(e,"isEnabled",vV)},processEvent(e,n,r){return Mr(e)}});function vV(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)):V&&w.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var dM=(({growthbookClass:t})=>Rv({growthbookClass:t}));var fM=({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 Mr(e)}});async function pM(){let t=B();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 Rc(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}var SV="WebWorker",gM=({worker:t})=>({name:SV,setupOnce:()=>{(Array.isArray(t)?t:[t]).forEach(e=>mM(e))},addWorker:e=>mM(e)});function mM(t){t.addEventListener("message",e=>{if(TV(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(V&&w.log("Sentry debugId web worker message received",e.data),j._sentryDebugIds={...e.data._sentryDebugIds,...j._sentryDebugIds}),e.data._sentryModuleMetadata&&(V&&w.log("Sentry module metadata web worker message received",e.data),j._sentryModuleMetadata={...e.data._sentryModuleMetadata,...j._sentryModuleMetadata}),e.data._sentryWasmImages){V&&w.log("Sentry WASM images web worker message received",e.data);let n=j._sentryWasmImages||[],r=e.data._sentryWasmImages.filter(o=>ge(o)&&typeof o.code_file=="string"&&!n.some(i=>i.code_file===o.code_file));j._sentryWasmImages=[...n,...r]}e.data._sentryWorkerError&&(V&&w.log("Sentry worker rejection message received",e.data._sentryWorkerError),EV(e.data._sentryWorkerError))}})}function EV(t){let e=B();if(!e)return;let n=e.getOptions().stackParser,r=e.getOptions().attachStacktrace,o=t.reason,i=en(o)?VS(o):uu(n,o,void 0,r,!0);i.level="error",t.filename&&(i.contexts={...i.contexts,worker:{filename:t.filename}}),Zr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),V&&w.log("Captured worker unhandled rejection",o)}function hM({self:t}){t.postMessage({_sentryMessage:!0,_sentryDebugIds:t._sentryDebugIds??void 0,_sentryModuleMetadata:t._sentryModuleMetadata??void 0}),t.addEventListener("unhandledrejection",e=>{let r={reason:qS(e),filename:t.location?.href};t.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),V&&w.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),V&&w.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function TV(t){if(!ge(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&&!(ge(t._sentryDebugIds)||t._sentryDebugIds===void 0)||n&&!(ge(t._sentryModuleMetadata)||t._sentryModuleMetadata===void 0)||r&&!ge(t._sentryWorkerError)||o&&(!Array.isArray(t._sentryWasmImages)||!t._sentryWasmImages.every(i=>ge(i)&&typeof i.code_file=="string")))}var bM=Xr(Ea(),1);function yM(t){return ge(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function sb(t){let e={...t};Rf(e,"react"),La("react",{version:bM.version});let n=WS(e);return bc(wV),n}function wV(t){return yM(t)?"[SyntheticEvent]":Eu(t)}var _M=Xr(Ea(),1);function xV(t){let e=t.match(/^([^.]+)/);return e!==null&&parseInt(e[0])>=17}function AV(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 gp(t,{componentStack:e},n){if(xV(_M.version)&&fn(t)&&e){let r=new Error(t.message);r.name=`React ErrorBoundary ${t.name}`,r.stack=e,AV(t,r)}return wt(t,n)}function vM(t){return(e,n)=>{let r=!!t,o=gp(e,n,{mechanism:{handled:r,type:"auto.function.react.error_handler"}});r&&t(e,n,o)}}var Ji=Xr(Ea(),1);var nT="ui.react.render",SM="ui.react.update",rT="ui.react.mount";var IV={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},kV={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},RV={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},AM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},NV=Symbol.for("react.forward_ref"),IM=Symbol.for("react.memo");function CV(t){return typeof t=="object"&&t!==null&&t.$$typeof===IM}var oT={};oT[NV]=RV;oT[IM]=AM;function EM(t){if(CV(t))return AM;let e=t.$$typeof;return e&&oT[e]||IV}var MV=Object.defineProperty.bind(Object),OV=Object.getOwnPropertyNames.bind(Object),TM=Object.getOwnPropertySymbols?.bind(Object),wM=Object.getOwnPropertyDescriptor.bind(Object),DV=Object.getPrototypeOf.bind(Object),xM=Object.prototype;function Xi(t,e,n){if(typeof e!="string"){if(xM){let a=DV(e);a&&a!==xM&&Xi(t,a)}let r=OV(e);TM&&(r=r.concat(TM(e)));let o=EM(t),i=EM(e);for(let a of r)if(!kV[a]&&!i?.[a]&&!o?.[a]&&!wM(t,a)){let s=wM(e,a);if(s)try{MV(t,a,s)}catch{}}}return t}var LV="unknown",Bu=class extends Ji.Component{constructor(e){super(e);let{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=xe({name:`<${n}>`,onlyIfParent:!0,op:rT,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=Ot();this._updateSpan=Qr(this._mountSpan,()=>xe({name:`<${this.props.name}>`,onlyIfParent:!0,op:SM,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=Ot(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){let o=tt(this._mountSpan).timestamp;Qr(this._mountSpan,()=>{let i=xe({onlyIfParent:!0,name:`<${n}>`,op:nT,startTime:o,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":n}});i&&i.end(e)})}}render(){return this.props.children}};Object.assign(Bu,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});function kM(t,e){let n=e?.name||t.displayName||t.name||LV,r=o=>Ji.createElement(Bu,{...e,name:n,updateProps:o},Ji.createElement(t,{...o}));return r.displayName=`profiler(${n})`,Xi(r,t),r}function RM(t,e={disabled:!1,hasRenderSpan:!0}){let[n]=Ji.useState(()=>{if(!e?.disabled)return xe({name:`<${t}>`,onlyIfParent:!0,op:rT,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":t}})});Ji.useEffect(()=>(n&&n.end(),()=>{if(n&&e.hasRenderSpan){let r=tt(n).timestamp,o=Ot(),i=xe({name:`<${t}>`,onlyIfParent:!0,op:nT,startTime:r,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":t}});i&&i.end(o)}}),[])}var Si=Xr(Ea(),1);var Le=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var UV="unknown",iT={componentStack:null,error:null,eventId:null},hp=class extends Si.Component{constructor(e){super(e),this.state=iT,this._openFallbackReportDialog=!0;let n=B();n&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Kf({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:a,dialogOptions:s}=this.props;Ce(l=>{o&&o(l,e,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,d=gp(e,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(e,r,d),a&&(this._lastEventId=d,this._openFallbackReportDialog&&Kf({...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===iT?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(iT)}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&&Le&&w.warn("fallback did not produce a valid ReactElement"),null)}};function NM(t,e){let n=t.displayName||t.name||UV,r=Si.memo(o=>Si.createElement(hp,{...e},Si.createElement(t,{...o})));return r.displayName=`errorBoundary(${n})`,Xi(r,t),r}var BV="redux.action",PV="info",zV={attachReduxState:!0,actionTransformer:t=>t,stateTransformer:t=>t||null};function CM(t){let e={...zV,...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=nt(),p=e.actionTransformer(c);typeof p<"u"&&p!==null&&Tn({category:BV,data:p,type:PV});let f=e.stateTransformer(d);if(typeof f<"u"&&f!==null){let h=B()?.getOptions()?.normalizeDepth||3,b={state:{type:"redux",value:f}};T0(b,3+h),u.setContext("state",b)}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 OM(t){let e=Pr({...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&&j.location&&MM(r,j.location,o,(l,c="url")=>{Yo(s,{name:l,attributes:{[bt]:"pageload",[at]:"auto.pageload.react.reactrouter_v3",[Dt]:c}})}),a&&n.listen&&n.listen(l=>{(l.action==="PUSH"||l.action==="POP")&&MM(r,l,o,(c,d="url")=>{Wo(s,{name:c,attributes:{[bt]:"navigation",[at]:"auto.navigation.react.reactrouter_v3",[Dt]:d}})})})}}}function MM(t,e,n,r){let o=e.pathname;n({location:e,routes:t},(i,a,s)=>{if(i||!s)return r(o);let l=FV(s.routes||[]);return l.length===0||l==="/*"?r(o):(o=l,r(o,"route"))})}function FV(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 LM(t,e={}){let n=t,r=Pr({...e,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:o=!0,instrumentNavigation:i=!0}=e;return{...r,afterAllSetup(a){r.afterAllSetup(a);let s=j.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:{[bt]:"pageload",[at]:"auto.pageload.react.tanstack_router",[Dt]:d?"route":"url",...DM(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=j.location,f=Wo(a,{name:u?u.routeId:p.pathname,attributes:{[bt]:"navigation",[at]:"auto.navigation.react.tanstack_router",[Dt]: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],b=h?.routeId!=="__root__"?h:void 0;b&&(f.updateName(b.routeId),f.setAttribute(Dt,"route"),f.setAttributes(DM(b)))}})})}}}function DM(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 UM=Xr(Ea(),1);function BM(t){let e=Pr({...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),zM(s,i,a,n,"reactrouter_v4",r,o)}}}function PM(t){let e=Pr({...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),zM(s,i,a,n,"reactrouter_v5",r,o)}}}function zM(t,e,n,r,o,i=[],a){function s(){if(r.location)return r.location.pathname;if(j.location)return j.location.pathname}function l(c){if(i.length===0||!a)return[c,"url"];let d=FM(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:{[bt]:"pageload",[at]:`auto.pageload.react.${o}`,[Dt]: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:{[bt]:"navigation",[at]:`auto.navigation.react.${o}`,[Dt]:p}})}})}function FM(t,e,n,r=[]){return t.some(o=>{let i=o.path?n(e,o):r.length?r[r.length-1].match:HV(e);return i&&(r.push({route:o,match:i}),o.routes&&FM(o.routes,e,n,r)),!!i}),r}function HV(t){return{path:"/",url:"/",params:{},isExact:t==="/"}}function HM(t){let e=t.displayName||t.name,n=r=>{if(r?.computedMatch?.isExact){let o=r.computedMatch.path,i=GV();nt().setTransactionName(o),i&&(i.updateName(o),i.setAttribute(Dt,"route"))}return UM.createElement(t,{...r})};return n.displayName=`sentryRoute(${e})`,Xi(n,t),n}function GV(){let t=Lt(),e=t&&Pt(t);if(!e)return;let n=tt(e).op;return n==="navigation"||n==="pageload"?e:void 0}var Ei=Xr(Ea(),1);function Pu(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 GM=new WeakMap;function VM(t,e,n){if(!t||!e?.length)return null;let r=n?Pu(t,n):t,o=GM.get(e);o||(o=WV(e),GM.set(e,o),Le&&w.log("[React Router] Sorted route manifest by specificity:",o.length,"patterns"));for(let i of o)if($V(r,i))return Le&&w.log("[React Router] Matched pathname",r,"to pattern",i),i;return Le&&w.log("[React Router] No manifest match found for pathname:",r),null}function $V(t,e){if(e==="/")return t==="/"||t==="";let n=jM(t),r=jM(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(!$M(n[a],s))return!1;return!0}if(n.length!==r.length)return!1;for(let[i,a]of r.entries())if(!$M(n[i],a))return!1;return!0}function $M(t,e){return t===void 0||e===void 0?!1:YM.test(e)?!0:t===e}function jM(t){return t.split("/").filter(Boolean)}var YM=/^:[\w-]+$/,jV=10,qV=3,VV=1,YV=-2;function qM(t){let e=t.split("/"),n=e.length;e.includes("*")&&(n+=YV);for(let r of e)r!=="*"&&(YM.test(r)?n+=qV:r===""?n+=VV:n+=jV);return n}function WV(t){return[...t].sort((e,n)=>{let r=qM(e);return qM(n)-r})}var aT,Al=!1,ts=[],KV=10;function JM(t,e){let n={};return ts.length>=KV&&(Le&&w.warn("[React Router] Navigation context stack overflow - removing oldest context"),ts.shift()),ts.push({token:n,targetPath:t,span:e}),n}function QM(t){ts[ts.length-1]?.token===t&&ts.pop()}function sT(){let t=ts.length;return t>0?ts[t-1]??null:null}function ZM(t,e=!1){aT=t,Al=e}function XV(t){return QV(t.route.path||"")}function JV(t){return t.params["*"]||""}function QV(t){return t[t.length-1]==="*"?t.slice(0,-1):t}function zu(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function tO(t){return t.endsWith("*")}function Qi(t){return t.includes("/*")||t.endsWith("*")}function WM(t,e){return tO(t)&&!!e.route.children?.length||!1}function ZV(t){return!!(!t.children&&t.element&&t.path?.endsWith("/*"))}function tY(t,e,n){let r=t&&t.length>0?t:Al?Pu(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 KM(t){return t.split(/\\?\//).filter(e=>e.length>0&&e!==",").length}function lb(t){return t[0]==="/"?t:`/${t}`}function eO(t,e){let n=aT(t,e);if(!n||n.length===0)return"";for(let r of n)if(r.route.path&&r.route.path!=="*"){let o=XV(r),i=Pu(e.pathname,lb(r.pathnameBase));return e.pathname===i?zu(i):zu(zu(o||"")+lb(eO(t.filter(a=>a!==r.route),{pathname:i})))}return""}function eY(t,e){let n=aT(e,t);if(n){for(let r of n)if(ZV(r.route)&&JV(r))return!0}return!1}function XM(t,e){return Al?Pu(t.pathname,e):t.pathname||""}function nY(t,e,n,r=""){if(!t||t.length===0)return[Al?Pu(e.pathname,r):e.pathname,"url"];if(!n)return[XM(e,r),"url"];let o="";for(let i of n){let a=i.route;if(!a)continue;if(a.index)return tY(o,i.pathname,r);let s=a.path;if(!s||WM(s,i))continue;let l=s[0]==="/"||o[o.length-1]==="/"?s:`/${s}`;if(o=zu(o)+lb(l),zu(e.pathname)===zu(r+i.pathname))return KM(o)!==KM(i.pathname)&&!tO(o)?[(Al?"":r)+l,"route"]:(WM(o,i)&&(o=o.slice(0,-1)),[(Al?"":r)+o,"route"])}return[XM(e,r),"url"]}function yp(t,e,n,r,o="",i,a){if(a&&i&&i.length>0){let d=VM(t.pathname,i,o);if(d)return[(Al?"":o)+d,"route"]}let s,l="url",c=eY(t,n);return c&&(s=lb(eO(n,t)),l="route"),(!c||!s)&&([s,l]=nY(e,t,r,o)),[s||t.pathname,l]}function po(){let t=Lt(),e=t?Pt(t):void 0;if(!e)return;let n=tt(e).op;return n==="navigation"||n==="pageload"?e:void 0}function rY(){let t=sT();if(t)return t.targetPath?{pathname:t.targetPath,search:"",hash:"",state:null,key:"default"}:null;if(typeof j<"u")try{let e=j.location;if(e)return{pathname:e.pathname,search:e.search||"",hash:e.hash||"",state:null,key:"default"}}catch{Le&&w.warn("[React Router] Could not access window.location")}return null}function oY(){let t=sT();return t?t.span:po()}function iY(t,e,n,r){let o=new Proxy(t,{apply(i,a,s){let l=rY(),c=oY(),d=i.apply(a,s);return aY(d,e,n,r,l,c),d}});return Ht(o,"__sentry_proxied__",!0),o}function aY(t,e,n,r,o,i){Nn(t)?t.then(a=>{Array.isArray(a)&&r(a,e,o??void 0,i)}).catch(a=>{Le&&w.warn(`Error resolving async handler '${n}' for route`,e,a)}):Array.isArray(t)&&r(t,e,o??void 0,i)}function bp(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]=iY(r,t,n,e))}if(Array.isArray(t.children))for(let n of t.children)bp(n,e)}var Fu,es,ns,cb,mo,rs=!1,kl=3e3,_p,fT="",oO=new WeakSet,iO=j?.document?Ei.useLayoutEffect:Ei.useEffect,Il=new WeakMap,xn=new Set,ub=new WeakMap,cT=new WeakMap;function sY(t){return j?.requestAnimationFrame?j.requestAnimationFrame(t):setTimeout(t,0)}function nO(t){j?.cancelAnimationFrame?j.cancelAnimationFrame(t):clearTimeout(t)}function aO(t){return`${t.pathname}${t.search||""}${t.hash||""}`}function rO(t){return t.includes(":")||t.includes("*")}function lY(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&&rO(t.routeName),l=rO(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 sO(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 lO(t,e){let n=ub.get(t);n||(n=new Set,ub.set(t,n)),n.add(e),e.finally(()=>{let r=ub.get(t);r&&r.delete(e)})}function cO(t){let e=new Promise(n=>{cT.set(t,n)});lO(t,e)}function cY(t){let e=cT.get(t);e&&(e(),cT.delete(t),t.__sentry_may_have_lazy_routes__&&(t.__sentry_may_have_lazy_routes__=!1))}function pT(t,e,n=null,r){t.forEach(i=>{xn.add(i),rs&&bp(i,pT)}),e&&sO(t,e);let o=r??po();if(o){let i=tt(o);if(i.timestamp){Le&&w.warn("[React Router] Lazy handler resolved after span ended - skipping update");return}let a=i.op,s=n;if(!s&&!r&&typeof j<"u"){let l=j.location;l?.pathname&&(s={pathname:l.pathname})}s&&(a==="pageload"?Sp({activeRootSpan:o,location:{pathname:s.pathname},routes:Array.from(xn),allRoutes:Array.from(xn)}):a==="navigation"&&uT(o,s,Array.from(xn),!1,mo))}}function uT(t,e,n,r=!1,o){let i=tt(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]=yp(e,n,n,d||[],fT,_p,rs),f=i.data?.[Dt];u&&(!a||!s&&(f!=="route"||p==="route")||f!=="route"&&p==="route"||f==="route"&&p==="route"&&l)&&(t.updateName(u),t.setAttribute(Dt,p),!Qi(u)&&p==="route"&&Ht(t,"__sentry_navigation_name_set__",!0))}}function uO(t,e,n,r,o){let i=!1,a=!!o&&tt(o).op==="pageload",s=!1,l=null,c=null;t.subscribe(d=>{if(!i){let p=po();p&&tt(p).op==="pageload"?a=!0:a&&(d.historyAction==="POP"&&!s?s=!0:i=!0)}if(d.historyAction==="PUSH"||d.historyAction==="POP"&&i){let p=aO(d.location),f=()=>{c!==p&&(c=p,l=null,mT({location:d.location,routes:e,navigationType:d.historyAction,version:n,basename:r,allRoutes:Array.from(xn)}))};d.navigation.state!=="idle"?(c!==p&&(c=null),l!==null&&nO(l),l=sY(f)):(l!==null&&(nO(l),l=null),f())}})}function Hu(t,e){return!Fu||!es||!ns||!mo?(Le&&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(vp(n),rs)for(let c of n)bp(c,pT);let o=po();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Ht(o,"__sentry_may_have_lazy_routes__",!0),cO(o));let a=dO(r,!1,o),s=t(n,a),l=r?.basename;return s.state.historyAction==="POP"&&o&&Sp({activeRootSpan:o,location:s.state.location,routes:n,basename:l,allRoutes:Array.from(xn)}),fT=l||"",uO(s,n,e,l,o),s}}function Gu(t,e){return!Fu||!es||!ns||!mo?(Le&&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(vp(n),rs)for(let v of n)bp(v,pT);let o=po();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Ht(o,"__sentry_may_have_lazy_routes__",!0),cO(o));let a=dO(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,_=po();return s.state.historyAction==="POP"&&_&&Sp({activeRootSpan:_,location:m,routes:n,basename:l,allRoutes:Array.from(xn)}),fT=l||"",uO(s,n,e,l,_),s}}function $u(t,e){let n=Pr({...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?(kl=_,Le&&w.log("[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:",_,"ms to prevent indefinite hangs")):Number.isNaN(h)?(Le&&w.warn("[React Router] lazyRouteTimeout must be a number, falling back to default:",v),kl=v):h<0?(Le&&w.warn("[React Router] lazyRouteTimeout must be non-negative or Infinity, got:",h,"falling back to:",v),kl=v):kl=h,Fu=r,es=o,ns=i,mo=s,cb=a,rs=c,_p=f,ZM(s,l||!1)},afterAllSetup(m){n.afterAllSetup(m);let _=j.location?.pathname;d&&_&&Yo(m,{name:_,attributes:{[Dt]:"url",[bt]:"pageload",[at]:`auto.pageload.react.reactrouter${e?`_v${e}`:""}`}}),u&&oO.add(m)}}}function ju(t,e){if(!Fu||!es||!ns||!mo)return Le&&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 iO(()=>{let u=typeof d=="string"?{pathname:d}:d;o.current?(vp(i),Sp({activeRootSpan:po(),location:u,routes:i,allRoutes:Array.from(xn)}),o.current=!1):mT({location:u,routes:i,navigationType:c,version:e,allRoutes:Array.from(xn)})},[c,d]),s};return(r,o)=>Ei.createElement(n,{routes:r,locationArg:o})}function dO(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=po()??n;if(!e){let l=o?.patch,c=o?.matches;l&&(o.patch=(d,u)=>{if(vp(u),c&&c.length>0){let m=c[c.length-1]?.route;if(m){let _=Array.from(xn).find(v=>{let h=v.id!==void 0&&v.id===d,b=v===m,S=v.path!==void 0&&m.path!==void 0&&v.path===m.path;return h||b||S});_&&sO(u,_)}}let p=a?tt(a):void 0;return i&&a&&p&&!p.timestamp&&p.op==="navigation"&&uT(a,{pathname:i,search:"",hash:"",state:null,key:"default"},Array.from(xn),!0,mo),l(d,u)})}let s=(async()=>{let l=JM(i,a),c;try{c=await r(o)}finally{QM(l),a&&cY(a)}let d=a?tt(a):void 0;if(a&&d&&!d.timestamp&&d.op==="navigation"){let u=i;u&&uT(a,{pathname:u,search:"",hash:"",state:null,key:"default"},Array.from(xn),!1,mo)}return c})();return a&&lO(a,s),s}}}function mT(t){let{location:e,routes:n,navigationType:r,version:o,matches:i,basename:a,allRoutes:s}=t,l=Array.isArray(i)?i:mo(s||n,e,a),c=B();if(!c||!oO.has(c))return;let d=po();if(!(d&&tt(d).op==="pageload"&&r==="POP")&&(r==="PUSH"||r==="POP")&&l){let[u,p]=yp(e,s||n,s||n,l,a,_p,rs),f=aO(e),m=Il.get(c),_=m&&!m.isPlaceholder?!!tt(m.span).timestamp:!1,{skip:v,shouldUpdate:h}=lY(m,f,u,_);if(v){if(h&&m){let R=m.routeName;m.isPlaceholder?(m.routeName=u,Le&&w.log(`[Tracing] Updated placeholder navigation name from "${R}" to "${u}" (will apply to real span)`)):(m.span.updateName(u),m.span.setAttribute(Dt,p),Ht(m.span,"__sentry_navigation_name_set__",!0),m.routeName=u,Le&&w.log(`[Tracing] Updated navigation span name from "${R}" to "${u}"`))}else Le&&w.log(`[Tracing] Skipping duplicate navigation for location: ${f}`);return}let S={span:{end:()=>{}},routeName:u,pathname:e.pathname,locationKey:f,isPlaceholder:!0};Il.set(c,S);let E;try{E=Wo(c,{name:S.routeName,attributes:{[Dt]:p,[bt]:"navigation",[at]:`auto.navigation.react.reactrouter${o?`_v${o}`:""}`}})}catch(R){throw Il.delete(c),R}E?(Il.set(c,{span:E,routeName:S.routeName,pathname:e.pathname,locationKey:f}),dT(E,e,n,a,"navigation")):Il.delete(c)}}function vp(t){t.forEach(e=>{fO(e).forEach(r=>{xn.add(r)})})}function fO(t,e=new Set){return e.has(t)||(e.add(t),t.children&&!t.index&&t.children.forEach(n=>{fO(n,e).forEach(o=>{e.add(o)})})),e}function Sp({activeRootSpan:t,location:e,routes:n,matches:r,basename:o,allRoutes:i}){let a=Array.isArray(r)?r:mo(i||n,e,o);if(a){let[s,l]=yp(e,i||n,i||n,a,o,_p,rs);nt().setTransactionName(s||"/"),t&&(t.updateName(s),t.setAttribute(Dt,l),dT(t,e,n,o,"pageload"))}else t&&dT(t,e,n,o,"pageload")}function uY(t,e,n,r,o=!1){return n?!!(!t&&o||t&&Qi(t)&&r==="route"&&!Qi(n)||e!=="route"&&r==="route"):!1}function lT(t,e,n,r,o,i,a,s){try{let l=e.data?.[Dt];if(l==="route"&&n&&!Qi(n))return;let c=Array.from(s),d=c.length>0?c:o,u=mo(d,r,i);if(!u)return;let[p,f]=yp(r,d,d,u,i,_p,rs),m=uY(n,l,p,f,!0),_=a==="pageload"||!e.timestamp;m&&_&&(t.updateName(p),t.setAttribute(Dt,f))}catch(l){Le&&w.warn(`Error updating span details before ending: ${l}`)}}function dT(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=tt(t),f=p.description,m=p.data?.[Dt],_=()=>{let E=B();if(E&&o==="navigation"){let R=Il.get(E);R&&R.span===t&&Il.delete(E)}},v=ub.get(t),h=t.__sentry_may_have_lazy_routes__;if((v&&v.size>0||h)&&f&&(Qi(f)||m!=="route")){if(kl===0){lT(t,p,f,e,n,r,o,xn),_(),s(u);return}let E=new Promise(C=>setTimeout(C,kl)),R;if(v&&v.size>0){let C=Promise.allSettled(v).then(()=>{});R=kl===1/0?C:Promise.race([C,E])}else R=E;R.then(()=>{let C=tt(t);lT(t,C,C.description,e,n,r,o,xn),_(),s(u)}).catch(()=>{_(),s(u)});return}lT(t,p,f,e,n,r,o,xn),_(),s(u)},Ht(t,i,!0)}function qu(t,e){if(!Fu||!es||!ns||!cb||!mo)return Le&&w.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.
|
|
508
|
+
useEffect: ${Fu}. useLocation: ${es}. useNavigationType: ${ns}.
|
|
509
|
+
createRoutesFromChildren: ${cb}. matchRoutes: ${mo}.`),t;let n=r=>{let o=Ei.useRef(!0),i=es(),a=ns();return iO(()=>{let s=cb(r.children);o.current?(vp(s),Sp({activeRootSpan:po(),location:i,routes:s,allRoutes:Array.from(xn)}),o.current=!1):mT({location:i,routes:s,navigationType:a,version:e,allRoutes:Array.from(xn)})},[i,a]),Ei.createElement(t,{...r})};return Xi(n,t),n}function pO(t){return $u(t,"6")}function mO(t){return ju(t,"6")}function gO(t){return Hu(t,"6")}function hO(t){return Gu(t,"6")}function yO(t){return qu(t,"6")}function bO(t){return $u(t,"7")}function _O(t){return qu(t,"7")}function vO(t){return Hu(t,"7")}function SO(t){return Gu(t,"7")}function EO(t){return ju(t,"7")}function TO(t){return $u(t,"")}function wO(t){return qu(t,"")}function xO(t){return Hu(t,"")}function AO(t){return Gu(t,"")}function IO(t){return ju(t,"")}function gT(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,hT=Zi?.dsn?.trim()||"";if(hT&&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)));sb({dsn:hT,environment:t,release:Zi?.release?.trim()||void 0,integrations:[Pr(),Yy({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:gT(Zi?.tracesSampleRate,e),tracePropagationTargets:o,replaysSessionSampleRate:gT(Zi?.replaysSessionSampleRate,n),replaysOnErrorSampleRate:gT(Zi?.replaysOnErrorSampleRate,1),enableLogs:Zi?.enableLogs??!0,sendDefaultPii:Zi?.sendDefaultPii??!0}),Mc("vidfarm.bundle","hyperframes-editor")}function kO(){return!!hT&&typeof window<"u"&&window.__vidfarmSentryInitialized===!0}function ta(t,e){if(kO())try{wt(t,e?{extra:e}:void 0)}catch{}}function RO(t,e){if(kO())try{Da(t,e?{level:"error",extra:e}:{level:"error"})}catch{}}var ZU=Xr(nU(),1);var BK="[vidfarm-demo]",rU=1e3;function PK(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 Kx(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>rU&&window.__VIDFARM_DEBUG_LOGS__.splice(0,window.__VIDFARM_DEBUG_LOGS__.length-rU)),PK(t)&&console[t](BK,e,n??"")}function It(t,e){Kx("debug",t,e)}function Ar(t,e){Kx("warn",t,e)}function Ao(t,e){Kx("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}):RO(`vidfarm-demo:${t}`,{detail:e})}function oU(){typeof window>"u"||window.__VIDFARM_DEBUG_HOOKS__||(window.__VIDFARM_DEBUG_HOOKS__=!0,It("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;Ao("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;Ao("window.unhandledrejection",{reason:e?e.stack:t.reason}),e&&ta(e,{source:"window.unhandledrejection"})}))}var A=Xr(Ea(),1);var g=Xr(Wm(),1),NU="rgba(60, 60, 60, 0.78)",a1=class extends A.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e.message:String(e)}}componentDidCatch(e,n){Ao("react.editor-boundary",{error:e instanceof Error?e.stack:e,componentStack:n.componentStack}),e instanceof Error&&ta(e,{source:"EditorErrorBoundary",componentStack:n.componentStack})}render(){return this.state.error?(0,g.jsxs)("section",{className:"editor-loading-shell","aria-label":"Editor crashed",children:[(0,g.jsx)("span",{children:"Editor view crashed"}),(0,g.jsx)("small",{children:this.state.error})]}):this.props.children}};function Nm({label:t="Loading"}){return(0,g.jsx)("span",{className:"vf-inline-spinner",role:"status","aria-label":t})}function zK(t,e){return t==="SUCCEEDED"?"succeeded":e||t==="FAILED"||t==="TIMED_OUT"||t==="ABORTED"?"failed":"running"}function iU(t,e){return{phase:zK(t.status,t.fatalErrorEncountered),title:t.title||e,renderId:t.renderId,version:typeof t.version=="number"?t.version:void 0,status:t.status,progress:typeof t.progress=="number"?t.progress:0,framesRendered:t.framesRendered,totalFrames:t.totalFrames,lambdasInvoked:t.lambdasInvoked,cost:t.cost,outputS3Uri:t.outputS3Uri,outputUrl:t.outputUrl,error:t.error,errors:t.errors}}function FK(t){return Math.max(0,Math.min(100,Math.round((t.progress??0)*100)))}var Cm="/media/inspiration-posts/simple-video/best-at-what-cost.mp4",xm=54.533333,HK={shellBackground:"#0d100c",shellBorder:"#252c23",clipBackground:"#78C25E",clipBackgroundActive:"#F2CD46",clipBorderActive:"#F2CD46",textPrimary:"#f5f1e8",textSecondary:"#a7aea2"},aU=32,sU=24,lU=48,CU=["TikTok Sans","Montserrat","Source Code Pro","Yesteryear","Georgia","Abel"],MU=[{id:"plain",label:"No border"},{id:"outline",label:"Text border"},{id:"highlight-solid",label:"Solid highlight"},{id:"highlight-translucent",label:"Translucent highlight"},{id:"fullwidth",label:"Fullwidth"}],GK='@import url("https://fonts.googleapis.com/css2?family=Abel&family=Montserrat:wght@600&family=Source+Code+Pro:wght@700&family=TikTok+Sans:wght@400;600;700;800;900&family=Yesteryear&display=swap");',Xx=null,Jx=null;function j_(){return Xx=Xx??import("./chunks/dist-ADSJKBVE.js"),Xx}function $K(){if(typeof window>"u")return j_(),()=>{};let t=window;if(t.requestIdleCallback){let n=t.requestIdleCallback(()=>{j_()},{timeout:1200});return()=>t.cancelIdleCallback?.(n)}let e=window.setTimeout(()=>{j_()},80);return()=>window.clearTimeout(e)}function jK(){if(typeof window>"u"||typeof document>"u")return()=>{};let t=()=>{if(Jx)return;let n=document.createElement("video");n.preload="auto",n.muted=!0,n.playsInline=!0,n.src=Cm,n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;left:-9999px;top:0;",document.body.append(n),Jx=n;try{n.load()}catch{n.remove(),Jx=null}},e=window.setTimeout(t,120);return()=>window.clearTimeout(e)}function q_(t){let e=(t??"").split(",")[0].replaceAll('"',"").replaceAll("'","").trim();return CU.find(n=>n.toLowerCase()===e.toLowerCase())??"TikTok Sans"}function Jl(t){return t==="Georgia"?"Georgia":`'${t}'`}function Os(t){return t==="Georgia"||t==="Source Code Pro"?700:t==="Montserrat"?600:900}function qK(t,e){let n=Number.parseInt(t??"",10);return Number.isFinite(n)?Math.max(100,Math.min(900,n)):e}function VK(t){return t==="Georgia"?"Georgia Bold":t==="Montserrat"?"Montserrat Semibold":t==="Source Code Pro"?"Source Code Pro Bold":t}function OU(t,e,n=Os(e)){let r=`${Jl(e)}, 'TikTok Sans'`,o=String(n),i=[t,...Array.from(t.querySelectorAll("[data-vf-text-lines], [data-vf-text-inline]"))];for(let a of i)a.style.setProperty("font-family",r),a.style.setProperty("font-weight",o)}function YK(t){return MU.some(e=>e.id===t)?t:"highlight-solid"}function DU(t,e){let n=t.trim(),r=n.startsWith("#")?n.slice(1):"";if(r.length===3||r.length===6){let o=r.length===3?r.split("").map(a=>a+a).join(""):r,i=Number.parseInt(o,16);if(Number.isFinite(i)){let a=i>>16&255,s=i>>8&255,l=i&255;return`rgba(${a}, ${s}, ${l}, ${e})`}}return n.startsWith("rgba(")||n.startsWith("rgb(")?n:`rgba(0, 0, 0, ${e})`}function LU(t,e,n,r,o){let i=["display:inline","box-decoration-break:clone","-webkit-box-decoration-break:clone","line-height:inherit"];return t==="plain"&&i.push("padding:0","border-radius:0","background:transparent","text-shadow:none","-webkit-text-stroke:0 transparent"),t==="outline"&&i.push("padding:0","border-radius:0","background:transparent",`text-shadow:2px 0 ${n},-2px 0 ${n},0 2px ${n},0 -2px ${n},1.5px 1.5px ${n},-1.5px 1.5px ${n},1.5px -1.5px ${n},-1.5px -1.5px ${n}`,`-webkit-text-stroke:1.5px ${n}`,"paint-order:stroke fill"),t==="highlight-solid"&&i.push("padding:0.07em 0.46em 0.09em","border-radius:0.32em",`background:${n}`,"text-shadow:none","-webkit-text-stroke:0 transparent"),t==="highlight-translucent"&&i.push("padding:0.07em 0.46em 0.09em","border-radius:0.32em",`background:${DU(n,.34)}`,"text-shadow:none","-webkit-text-stroke:0 transparent"),t==="fullwidth"&&i.push("padding:0","border-radius:0","background:transparent","text-shadow:none","-webkit-text-stroke:0 transparent"),r&&i.push(`font-family:${Jl(r)}, 'TikTok Sans'`),o&&i.push(`font-weight:${o}`),i.push(`color:${e}`),i.join(";")}function UU(t){let e=["display:block","max-width:100%","text-align:inherit","line-height:1.48","white-space:pre-wrap","overflow:visible"];return t==="fullwidth"&&e.push("width:100%","box-sizing:border-box","padding:0.18em 0.5em",`background:${NU}`),e.join(";")}function W_(t,e,n,r,o,i,a){t.textContent="",t.style.background="transparent",t.setAttribute("data-text-background-style",n),t.setAttribute("data-text-background-color",o),i&&(t.setAttribute("data-font-family",i),t.style.fontFamily=`${Jl(i)}, 'TikTok Sans'`),a&&(t.style.fontWeight=String(a));let s=t.ownerDocument.createElement("span");s.setAttribute("data-vf-text-lines","true"),s.style.cssText=UU(n);let l=t.ownerDocument.createElement("span");l.setAttribute("data-vf-text-inline","true"),i&&l.setAttribute("data-font-family",i),l.style.cssText=LU(n,r,o,i,a),l.textContent=e,s.append(l),t.append(s)}function V_(t){let e=Number.isFinite(t)&&t>0?t:0,n=Math.floor(e/60),r=Math.floor(e%60);return`${n}:${r.toString().padStart(2,"0")}`}function Ms(t){let e=Number.isFinite(t)&&t>0?t:0,n=Math.round(e*100),r=Math.floor(n/6e3),o=Math.floor(n%6e3/100),i=n%100;return[r.toString().padStart(2,"0"),o.toString().padStart(2,"0"),i.toString().padStart(2,"0")].join(":")}function cU(t){let e=t.trim().split(":");if(e.length!==3)return null;let[n,r,o]=e,i=Number(n),a=Number(r),s=Number(o);return!Number.isFinite(i)||!Number.isFinite(a)||!Number.isFinite(s)||i<0||a<0||a>=60||s<0||s>=100?null:i*60+a+s/100}function Ut(t,e,n){return Math.max(e,Math.min(n,t))}var Mm=[{id:"source-video",label:"best-at-what-cost.mp4",kind:"video",mode:"both",start:0,duration:xm,track:0,z:0,viralNote:"Dominant source footage is the proof layer. It makes the cost feel physically real.",src:Cm},{id:"source-audio",label:"Original audio",kind:"audio",mode:"both",start:0,duration:xm,track:1,z:1,viralNote:"Native source audio stays separate from the visual layer so it can be muted, replaced, or timed independently.",src:Cm,volume:1,muted:!1},{id:"caption-hook-promise",label:"Original hook caption",kind:"caption",mode:"publish",start:0,duration:8.2,track:2,z:8,viralNote:"Persistent lowercase caption frames the destination as desirable while immediately introducing the cost.",text:`best beach in vancouver
|
|
510
|
+
but at what cost`,color:"#ffffff",background:"#000000",textBackgroundStyle:"plain",fontFamily:"Montserrat",fontWeight:600,fontSize:32,radius:0,x:13.5,width:73,y:47.25,height:10.5},{id:"caption-descent-tension",label:"Descent tension caption",kind:"caption",mode:"publish",start:8.2,duration:33.8,track:2,z:8,viralNote:"The same caption stays on-screen through the stair descent so the viewer keeps measuring payoff against effort.",text:`best beach in vancouver
|
|
511
|
+
but at what cost`,color:"#ffffff",background:"#000000",textBackgroundStyle:"plain",fontFamily:"Montserrat",fontWeight:600,fontSize:32,radius:0,x:13.5,width:73,y:47.25,height:10.5},{id:"caption-payoff-context",label:"Payoff context caption",kind:"caption",mode:"publish",start:42,duration:xm-42,track:2,z:8,viralNote:"The caption persists into the beach reveal, preserving the cost-versus-reward question until the payoff lands.",text:`best beach in vancouver
|
|
512
|
+
but at what cost`,color:"#ffffff",background:"#000000",textBackgroundStyle:"plain",fontFamily:"Montserrat",fontWeight:600,fontSize:32,radius:0,x:13.5,width:73,y:47.25,height:10.5}],Bd={hook:"A high-reward claim is immediately paired with physical cost: the viewer wants to know whether the beach is worth the stairs.",retention:"The long stair descent creates escalating proof and makes the payoff feel earned.",payoff:"The beach reveal resolves the cost-benefit question.",preserve:["Persistent lowercase white caption: destination promise versus visible effort.","Source video remains dominant so the proof is experiential, not decorative.","The timeline must hold tension through the descent before the reveal.","The payoff must arrive late enough to reward retention."],avoid:["Do not cover the stair footage with large decorative panels.","Do not reveal the beach payoff too early.","Do not replace the physical-cost proof with unrelated b-roll."]},Om=[{id:"hard-video",eyebrow:"Hard Video",title:"drafts/inspiration-posts/hard-video/ssstik.io_@asimon313__1782769678573.mp4",sourceFolder:"drafts/inspiration-posts/hard-video",sourceType:"video",duration:12.7,width:720,height:1280,summary:"A wedding dance-floor reference with scene cuts and an editable top comment screenshot hook.",media:{type:"video",src:"/drafts/inspiration-posts/hard-video/ssstik.io_@asimon313__1782769678573.mp4"},viralDna:{hook:"A pinned comment screenshot creates the social dare before the dance payoff.",retention:"Scene cuts move from living-room practice to wedding-floor crowd energy while the comment stays visible.",payoff:"The wedding dance resolves the comment's relationship prediction.",preserve:["Keep the top comment as editable HTML.","Keep the living-room setup and wedding payoff as separate scene clips.","Keep source audio separately editable."],avoid:["Do not flatten the comment into the video.","Do not cover the dancers with oversized UI.","Do not remove the practice-to-wedding contrast."]},layers:[{id:"hard-video-scene-1",kind:"video",label:"Living-room dance hook",note:"Introduces the couple dancing under the comment dare.",start:0,duration:3.566667},{id:"hard-video-scene-2",kind:"video",label:"Wedding dance reveal",note:"Hard cut from practice to wedding-floor payoff.",start:3.566667,duration:3.033333},{id:"hard-video-scene-3",kind:"video",label:"Crowd energy escalation",note:"Keeps the relationship payoff alive through public reaction.",start:6.6,duration:2.6},{id:"hard-video-scene-4",kind:"video",label:"Bride spin payoff",note:"Final energetic proof that the comment was right.",start:9.2,duration:3.5},{id:"hard-video-audio",kind:"audio",label:"Original audio",note:"Continuous source audio across the scene split.",start:0,duration:12.7},{id:"hard-video-comment",kind:"shape",label:"Pinned TikTok comment screenshot",note:"Editable deterministic HTML recreation of the comment screenshot.",start:0,duration:12.7}],editable:!0},{id:"medium-easy-video",eyebrow:"Medium Easy Video",title:"drafts/inspiration-posts/medium-easy-video/ssstik.io_@indeed_au_1782770164389.mp4",sourceFolder:"drafts/inspiration-posts/medium-easy-video",sourceType:"video",duration:12.833333,width:576,height:1024,summary:"A Gen Z workplace-reply meme decomposed into a face-reaction scene, caption, and slow-zoom screenshot images.",media:{type:"video",src:"/drafts/inspiration-posts/medium-easy-video/ssstik.io_@indeed_au_1782770164389.mp4"},viralDna:{hook:"A face reaction labeled 'gen z' frames the screenshots as a workplace-email joke.",retention:"Short screenshot beats reveal increasingly blunt reply lines with slow zoom movement.",payoff:"The tip-screen screenshot turns the joke into a payment UI punchline.",preserve:["Keep the first face scene as live source video.","Keep the 'gen z' caption editable.","Use separate image layers for the screenshot beats."],avoid:["Do not flatten the screenshots into one video track.","Do not remove the slow zoom movement.","Do not cover the readable screenshot text."]},layers:[{id:"medium-easy-video-face",kind:"video",label:"Face reaction hook",note:"Live reaction hook before the email screenshots.",start:0,duration:1.733333},{id:"medium-easy-video-caption",kind:"caption",label:"gen z caption",note:"Editable first-scene label.",start:0,duration:1.733333},{id:"medium-easy-video-email-1",kind:"image",label:"Have the day you deserve image",note:"First readable email screenshot beat.",start:1.733333,duration:2.3},{id:"medium-easy-video-email-2",kind:"image",label:"Crying but trying image",note:"Blunt workplace reply screenshot.",start:4.033333,duration:1.666667},{id:"medium-easy-video-email-3",kind:"image",label:"Please hesitate image",note:"Punchline phrasing stays readable while zooming.",start:5.7,duration:1.866667},{id:"medium-easy-video-email-4",kind:"image",label:"Literal trenches image",note:"Another screenshot escalation.",start:7.566667,duration:1.9},{id:"medium-easy-video-email-5",kind:"image",label:"Leave me alone image",note:"Last email-copy beat before the UI payoff.",start:9.466667,duration:1.866666},{id:"medium-easy-video-tip",kind:"image",label:"Leave a tip image",note:"Final UI screenshot payoff.",start:11.333333,duration:1.5},{id:"medium-easy-video-audio",kind:"audio",label:"Original audio",note:"Continuous source audio across the face scene and image beats.",start:0,duration:12.833333}],editable:!0},{id:"simple-video",eyebrow:"Simple Video",title:"drafts/inspiration-posts/simple-video/best-at-what-cost.mp4",sourceFolder:"drafts/inspiration-posts/simple-video",sourceType:"video",duration:xm,width:576,height:1024,summary:Bd.hook,media:{type:"video",src:Cm},viralDna:{hook:Bd.hook,retention:Bd.retention,payoff:Bd.payoff,preserve:Bd.preserve,avoid:Bd.avoid},layers:Mm.filter(t=>t.mode==="both"||t.mode==="publish").map(t=>({id:t.id,kind:t.kind,label:t.label,note:t.viralNote,start:t.start,duration:t.duration})),editable:!0},{id:"medium-video-loop-split",eyebrow:"Medium Video Loop Split",title:"drafts/inspiration-posts/medium-video-loop-split/ssstik.io_@shaymarie.00_1782767642405.mp4",sourceFolder:"drafts/inspiration-posts/medium-video-loop-split",sourceType:"video",duration:40.533333,width:576,height:1024,summary:"A medium-length TikTok reference video decomposed conservatively into editable source video and separate audio tracks.",media:{type:"video",src:"/drafts/inspiration-posts/medium-video-loop-split/ssstik.io_@shaymarie.00_1782767642405.mp4"},viralDna:{hook:"Use the first visual beat as the scroll-stopping reference before adding derived overlays.",retention:"Keep the source clip intact while editing timeline cuts, captions, and replacement layers around it.",payoff:"The full reference remains editable as separate video and audio foundations.",preserve:["Keep source video and source audio separated.","Keep the original vertical framing.","Add new caption/media layers on their own tracks."],avoid:["Do not invent baked captions during decomposition.","Do not put simultaneous frames on the same timeline track.","Do not flatten audio into the video layer."]},layers:[{id:"medium-video-loop-split-video",kind:"video",label:"Source video",note:"Editable source visual track.",start:0,duration:40.533333},{id:"medium-video-loop-split-audio",kind:"audio",label:"Source audio",note:"Editable source audio track.",start:0,duration:40.533333}],editable:!0},{id:"medium-video",eyebrow:"Medium Video",title:"drafts/inspiration-posts/medium-video/ssstik.io_@cailinsummer_1782717838898.mp4",sourceFolder:"drafts/inspiration-posts/medium-video",sourceType:"video",duration:24.1,width:720,height:1280,summary:"A medium TikTok reference video decomposed into editable source video and separate audio tracks.",media:{type:"video",src:"/drafts/inspiration-posts/medium-video/ssstik.io_@cailinsummer_1782717838898.mp4"},viralDna:{hook:"Start from the original reference footage, then layer edits without flattening the source.",retention:"A clean two-track base keeps visual timing and audio timing independently adjustable.",payoff:"The clip can be edited immediately in the timeline while preserving the original reference.",preserve:["Keep the native vertical video aspect ratio.","Keep source audio separately editable.","Use dedicated tracks for any added captions or media."],avoid:["Do not add guessed captions as baked decomposition output.","Do not overlap two frames on one track.","Do not reset the source timing during import."]},layers:[{id:"medium-video-video",kind:"video",label:"Source video",note:"Editable source visual track.",start:0,duration:24.1},{id:"medium-video-audio",kind:"audio",label:"Source audio",note:"Editable source audio track.",start:0,duration:24.1}],editable:!0},{id:"slides",eyebrow:"Slideshow",title:"drafts/inspiration-posts/slides",sourceFolder:"drafts/inspiration-posts/slides",sourceType:"slideshow",duration:9,width:1080,height:1920,summary:"A viral advice carousel using 9:16 lifestyle/fashion images with bold centered white captions and black outline.",media:{type:"slideshow",slides:["/drafts/inspiration-posts/slides/1-slide.webp","/drafts/inspiration-posts/slides/2-slide.webp","/drafts/inspiration-posts/slides/3-slide.webp"]},viralDna:{hook:"The first slide promises a cleaner, more viral slideshow format and frames the advice as opinionated.",retention:"Numbered rules create an open loop because viewers expect the missing steps and continue swiping.",payoff:"Each slide gives one concrete visual cleanliness rule.",preserve:["Keep all slides vertical 9:16.","Use lifestyle/fashion imagery as the visual proof layer.","Use bold white caption text with black outline, centered over the subject."],avoid:["Do not use block text backgrounds for these slides.","Do not make captions tiny or move them into TikTok UI-safe dead zones.","Do not break the numbered advice pattern."]},layers:[{id:"slide-1-image",kind:"image",label:"1-slide.webp",note:"Source slideshow image.",start:0,duration:3},{id:"slide-1-title-caption",kind:"caption",label:"Slide 1 title",note:"Editable baked slideshow caption.",start:0,duration:3},{id:"slide-1-opinion-caption",kind:"caption",label:"Slide 1 opinion",note:"Editable baked slideshow caption.",start:0,duration:3},{id:"slide-2-image",kind:"image",label:"2-slide.webp",note:"Source slideshow image.",start:3,duration:3},{id:"slide-2-rule-caption",kind:"caption",label:"Slide 2 rule",note:"Editable baked slideshow caption.",start:3,duration:3},{id:"slide-3-image",kind:"image",label:"3-slide.webp",note:"Source slideshow image.",start:6,duration:3},{id:"slide-3-rule-caption",kind:"caption",label:"Slide 3 rule",note:"Editable baked slideshow caption.",start:6,duration:3}],editable:!0}];function WK(){let e={kind:"caption",mode:"publish",track:1,z:5,viralNote:"Editable baked slideshow caption.",color:"#ffffff",background:"#000000",textBackgroundStyle:"outline",fontFamily:"Montserrat",fontWeight:600,fontSize:54,radius:0},n=["/drafts/inspiration-posts/slides/1-slide.webp","/drafts/inspiration-posts/slides/2-slide.webp","/drafts/inspiration-posts/slides/3-slide.webp"],r=[[{id:"slide-1-title-caption",label:"Slide 1 title",text:`How to make
|
|
513
|
+
your Slideshows cleaner
|
|
514
|
+
(Viral)`,track:1,x:13,y:43,width:74,height:17},{id:"slide-1-opinion-caption",label:"Slide 1 opinion",text:"(My opinion)",track:2,x:16,y:72,width:68,height:8}],[{id:"slide-2-rule-caption",label:"Slide 2 rule",text:`2. never blur your face
|
|
515
|
+
Its not 2019 anymore\u{1F940}`,track:1,x:6,y:49,width:88,height:15}],[{id:"slide-3-rule-caption",label:"Slide 3 rule",text:`4. make sure all pics
|
|
516
|
+
are in (9:16) format`,track:1,x:8,y:41,width:84,height:16}]];return n.flatMap((o,i)=>{let a=i*3;return[{id:`slide-${i+1}-image`,label:`${i+1}-slide.webp`,kind:"image",mode:"both",start:a,duration:3,track:0,z:0,viralNote:"Source slideshow image.",src:o,x:0,y:0,width:100,height:100},...(r[i]??[]).map(s=>({...e,...s,start:a,duration:3}))]})}function BU(t){return decodeURIComponent(t.split("/").pop()??t)}function c1(t,e,n=[]){if(t.media.type!=="video")return[];let r=BU(t.media.src),o=[];for(let i=0;i<e.length-1;i+=1){let a=e[i],s=e[i+1],l=Math.max(.05,s-a);o.push({id:`${t.id}-scene-${i+1}`,label:n[i]??`Scene ${i+1}`,kind:"video",mode:"both",start:a,duration:l,track:0,z:0,viralNote:`Scene clip from ${r}.`,src:t.media.src,playbackStart:a})}return o}function KK(t){return t.media.type!=="video"?[]:[...c1(t,[0,3.566667,6.6,9.2,12.7],["Living-room dance hook","Wedding dance reveal","Crowd energy escalation","Bride spin payoff"]),{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 the scene split.",src:t.media.src,playbackStart:0,volume:1,muted:!1},{id:`${t.id}-comment`,label:"Pinned TikTok comment screenshot",kind:"shape",mode:"publish",start:0,duration:t.duration,track:2,z:12,viralNote:"Editable deterministic HTML recreation of the source comment screenshot.",x:13.9,y:11.6,width:72,height:7.5,radius:2,color:"#ffffff",background:"#17181d",textBackgroundStyle:"plain",fontFamily:"TikTok Sans",fontWeight:600,fontSize:18,customHtml:[`<div style="display:grid;grid-template-columns:44px 1fr;column-gap:12px;width:100%;height:100%;box-sizing:border-box;padding:10px 12px 8px 12px;text-align:left;font-family:'TikTok Sans',Arial,sans-serif;color:#fff;line-height:1.08;background:#17181d">`,'<div style="width:40px;height:40px;border-radius:50%;background:linear-gradient(135deg,#2f3138,#0d0e12);border:1px solid rgba(255,255,255,.18);position:relative;overflow:hidden"><span style="position:absolute;left:12px;top:8px;width:15px;height:15px;border-radius:50%;background:#d0b489"></span><span style="position:absolute;left:7px;bottom:5px;width:26px;height:15px;border-radius:15px 15px 7px 7px;background:#efe2c2"></span></div>',`<div><div style="font-size:18px;font-weight:500;color:#d8d9de">kay</div><div style="font-size:18px;font-weight:600;color:#fff;white-space:nowrap">if they don't get married I'm gonna scream</div><div style="display:flex;align-items:center;gap:18px;margin-top:8px;font-size:15px;color:#999ca6"><span>2020-9-22</span><span>Reply</span><span style="margin-left:auto;color:#ff2d74;font-size:22px;line-height:1">\u2665</span><span style="color:#d8d9de">1,317</span><span style="color:#d8d9de">\u25B1</span></div></div>`,"</div>"].join("")}]}function XK(t){return t.media.type!=="video"?[]:[...c1(t,[0,1.2,3.066667,4.733333,6.5,8.733333,15.366667,16.033333,22.2,22.933333,23.533333,29.266667,30.3,35.433333,36.366667,37.733333,39.766667,40.533333],["Road hazard hook","Driver reaction","Windshield impact","Driver reaction smile","Bison on road","Driver concern","Bison close pass","Driver checks blind spot","Side look reaction","Bison standoff","Driver considers next move","Hands up reaction","Insurance visor check","Visor proof beat","Pointing payoff","Final disbelief","End reaction"]),{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}]}function JK(t){if(t.media.type!=="video")return[];let e={kind:"image",mode:"both",track:0,z:0,viralNote:"Slow-zoom screenshot image beat.",x:0,y:0,width:100,height:100},n="/drafts/inspiration-posts/medium-easy-video",r=[{id:"email-1",label:"Have the day you deserve image",start:1.733333,duration:2.3,src:`${n}/email-scene-01.jpg`,note:"First readable email screenshot beat."},{id:"email-2",label:"Crying but trying image",start:4.033333,duration:1.666667,src:`${n}/email-scene-02.jpg`,note:"Blunt workplace reply screenshot."},{id:"email-3",label:"Please hesitate image",start:5.7,duration:1.866667,src:`${n}/email-scene-03.jpg`,note:"Punchline phrasing stays readable while zooming."},{id:"email-4",label:"Literal trenches image",start:7.566667,duration:1.9,src:`${n}/email-scene-04.jpg`,note:"Another screenshot escalation."},{id:"email-5",label:"Leave me alone image",start:9.466667,duration:1.866666,src:`${n}/email-scene-05.jpg`,note:"Last email-copy beat before the UI payoff."},{id:"tip",label:"Leave a tip image",start:11.333333,duration:1.5,src:`${n}/email-scene-06.jpg`,note:"Final UI screenshot payoff."}];return[{id:`${t.id}-face`,label:"Face reaction hook",kind:"video",mode:"both",start:0,duration:1.733333,track:0,z:0,viralNote:"Live reaction hook before the email screenshots.",src:t.media.src,playbackStart:0},...r.map(o=>({...e,id:`${t.id}-${o.id}`,label:o.label,start:o.start,duration:o.duration,src:o.src,viralNote:o.note})),{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 the face scene and image beats.",src:t.media.src,playbackStart:0,volume:1,muted:!1},{id:`${t.id}-caption`,label:"gen z caption",kind:"caption",mode:"publish",start:0,duration:1.733333,track:2,z:8,viralNote:"Editable first-scene label that establishes the meme target.",text:"gen z",color:"#fff0a8",background:"#000000",textBackgroundStyle:"plain",fontFamily:"TikTok Sans",fontWeight:700,fontSize:25,radius:0,x:35,y:45.5,width:30,height:6}]}function QK(t){if(t.media.type!=="video")return[];let e=[0,3.733333,6,8.3,10.866667,13.133333,15.133333,17.366667,19.166667,21.8,24.1],n={kind:"caption",mode:"publish",track:2,z:8,viralNote:"Editable source caption extracted from the reference video.",color:"#ffffff",background:"#000000",textBackgroundStyle:"outline",fontFamily:"Montserrat",fontWeight:600,fontSize:24,radius:0,x:12,width:76,height:8},r=[{text:`I was a 10/10
|
|
517
|
+
daughter until...`,y:46},{text:`9/10 I started asking
|
|
518
|
+
questions`,y:42},{text:`8/10 I started using my
|
|
519
|
+
money to travel`,y:49},{text:`7/10 I started to detach
|
|
520
|
+
from their religion`,y:34},{text:`6/10 when I didn't agree
|
|
521
|
+
with them politically`,y:34},{text:`5/10 when I was true
|
|
522
|
+
to myself`,y:35},{text:`4/10 when I told
|
|
523
|
+
them no`,y:34},{text:`3/10 when I followed
|
|
524
|
+
my heart`,y:34},{text:`2/10 when I spoke up
|
|
525
|
+
for myself`,y:43},{text:`1/10 when I chose
|
|
526
|
+
myself`,y:22}];return[...c1(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 ZK(t){if(t.media.type!=="video")return[];let e=BU(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 u1(t){return t.id==="slides"?WK():t.id==="simple-video"?Mm.filter(e=>e.mode==="both"||e.mode==="publish"):t.id==="hard-video"?KK(t):t.id==="medium-easy-video"?JK(t):t.id==="medium-video-loop-split"?XK(t):t.id==="medium-video"?QK(t):ZK(t)}function PU(t){return u1(t).reduce((e,n)=>Math.max(e,n.start+n.duration),t.duration)}function tX(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(Pd(r,o))throw new Error(`Track collision: ${r.id} overlaps ${o.id} on track ${r.track}.`)}}function zU(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function Pe(t){return zU(String(t))}function Yt(t){return Number(t.toFixed(3)).toString()}function Em(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 eX(t){let e=[`id="${Pe(t.id)}"`,`data-hf-id="${Pe(t.id)}"`,`data-layer-mode="${Pe(t.mode)}"`,`data-layer-kind="${Pe(t.kind)}"`,`data-viral-note="${Pe(t.viralNote)}"`,`data-start="${Yt(t.start)}"`,`data-duration="${Yt(t.duration)}"`,`data-track-index="${t.track}"`,`data-label="${Pe(t.label)}"`];return(t.kind==="text"||t.kind==="caption"||t.kind==="shape")&&e.push(`data-text-background-style="${Pe(t.textBackgroundStyle??"highlight-solid")}"`,`data-text-background-color="${Pe(t.background??"#000000")}"`,`data-font-family="${Pe(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="${Yt(t.playbackStart)}"`,`data-playback-start="${Yt(t.playbackStart)}"`),e.join(" ")}function nX(t){let e=eX(t);if(t.kind==="video")return t.playbackStart!==void 0?`<div ${e} data-vf-timeline-proxy="video" data-src="${Pe(t.src??"")}" style="${Pe(Em({...t,x:0,y:0,width:1,height:1}))};display:none;pointer-events:none;"></div>`:`<video ${e} src="${Pe(t.src??"")}" muted playsinline preload="auto" style="${Pe(Em(t))}"></video>`;if(t.kind==="audio")return`<audio ${e} src="${Pe(t.src??"")}" data-timeline-role="music" data-volume="${Yt(t.volume??1)}" ${t.muted?"muted":""} preload="metadata"></audio>`;if(t.kind==="image")return`<img ${e} src="${Pe(t.src??"")}" alt="" style="${Pe(Em(t))}" />`;if(t.customHtml)return`<div ${e} style="${Pe(Em(t))}">${t.customHtml}</div>`;let n=t.text??t.label,r=LU(t.textBackgroundStyle??"highlight-solid",t.color??"#ffffff",t.background??"#000000",t.fontFamily??"TikTok Sans",t.fontWeight??Os(t.fontFamily??"TikTok Sans")),o=UU(t.textBackgroundStyle??"highlight-solid");return`<div ${e} style="${Pe(Em(t))}"><span data-vf-text-lines="true" style="${Pe(o)}"><span data-vf-text-inline="true" style="${Pe(r)}">${zU(n)}</span></span></div>`}function rX(t,e){return t==="shape"&&e?"HTML":t}function oX(t,e){return t==="shape"&&e?"HTML":t.slice(0,3).toUpperCase()}function iX(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="${Pe(t.media.src)}" muted playsinline preload="auto" style="${Pe(r)}"></video>`}function FU(){return`<script>
|
|
527
|
+
(() => {
|
|
528
|
+
const root = document.querySelector("[data-composition-id]");
|
|
529
|
+
let duration = Number(root?.getAttribute("data-duration") || 0);
|
|
530
|
+
let time = 0;
|
|
531
|
+
let playing = false;
|
|
532
|
+
let playbackRate = 1;
|
|
533
|
+
let previewMuted = false;
|
|
534
|
+
let raf = 0;
|
|
535
|
+
let last = 0;
|
|
536
|
+
const backingVideo = document.querySelector("[data-vf-playback-source]");
|
|
537
|
+
const initialMuted = new WeakMap();
|
|
538
|
+
if (backingVideo instanceof HTMLMediaElement) {
|
|
539
|
+
initialMuted.set(backingVideo, backingVideo.muted || backingVideo.hasAttribute("muted"));
|
|
540
|
+
}
|
|
541
|
+
let clips = [];
|
|
542
|
+
let activeVideoProxyKey = null;
|
|
543
|
+
let activeVideoProxyNode = null;
|
|
544
|
+
let hasVideoProxies = false;
|
|
545
|
+
const activeMedia = new WeakSet();
|
|
546
|
+
const mediaStateKeys = new WeakMap();
|
|
547
|
+
const visibilityStates = new WeakMap();
|
|
548
|
+
|
|
549
|
+
function clampTime(nextTime) {
|
|
550
|
+
const safe = Number(nextTime);
|
|
551
|
+
if (!Number.isFinite(safe)) return 0;
|
|
552
|
+
return Math.max(0, Math.min(duration, safe));
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function readNumberAttr(node, names, fallback = 0) {
|
|
556
|
+
for (const name of names) {
|
|
557
|
+
const raw = node.getAttribute(name);
|
|
558
|
+
if (raw !== null) {
|
|
559
|
+
const value = Number(raw);
|
|
560
|
+
return Number.isFinite(value) ? value : fallback;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
return fallback;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
function readTiming(clip) {
|
|
567
|
+
const start = readNumberAttr(clip, ["data-start"], 0);
|
|
568
|
+
const clipDuration = readNumberAttr(clip, ["data-duration"], 0);
|
|
569
|
+
const mediaStart = readNumberAttr(clip, ["data-playback-start", "data-media-start"], 0);
|
|
570
|
+
return { start, duration: clipDuration, end: start + clipDuration, mediaStart };
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
function refreshClips() {
|
|
574
|
+
// The parent editor can live-swap the composition DOM (undo/redo). Re-read
|
|
575
|
+
// everything derivable from the document so a swap never leaves the player
|
|
576
|
+
// clamped to a stale duration or a stale authored-mute state.
|
|
577
|
+
duration = Number(root?.getAttribute("data-duration") || 0);
|
|
578
|
+
time = clampTime(time);
|
|
579
|
+
clips = Array.from(document.querySelectorAll("[data-start]")).filter((node) => node !== root);
|
|
580
|
+
for (const clip of clips) {
|
|
581
|
+
if (clip instanceof HTMLMediaElement) {
|
|
582
|
+
initialMuted.set(clip, clip.hasAttribute("muted"));
|
|
583
|
+
}
|
|
584
|
+
if (clip instanceof HTMLMediaElement) {
|
|
585
|
+
clip.preload = "auto";
|
|
586
|
+
if (clip.readyState === 0) {
|
|
587
|
+
try { clip.load(); } catch {}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
if (backingVideo instanceof HTMLMediaElement) {
|
|
592
|
+
initialMuted.set(backingVideo, backingVideo.hasAttribute("muted"));
|
|
593
|
+
backingVideo.preload = "auto";
|
|
594
|
+
if (backingVideo.readyState === 0) {
|
|
595
|
+
try { backingVideo.load(); } catch {}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
activeVideoProxyKey = null;
|
|
599
|
+
activeVideoProxyNode = null;
|
|
600
|
+
hasVideoProxies = clips.some((clip) => clip instanceof Element && clip.getAttribute("data-vf-timeline-proxy") === "video");
|
|
601
|
+
apply(time, { forceSeek: true });
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
function applyMediaState(clip) {
|
|
605
|
+
const volume = Number(clip.getAttribute("data-volume") || 1);
|
|
606
|
+
const nextMuted = previewMuted || initialMuted.get(clip) === true;
|
|
607
|
+
const stateKey = playbackRate + "|" + volume + "|" + nextMuted;
|
|
608
|
+
if (mediaStateKeys.get(clip) === stateKey) return;
|
|
609
|
+
mediaStateKeys.set(clip, stateKey);
|
|
610
|
+
if (Number.isFinite(volume)) clip.volume = Math.max(0, Math.min(1, volume));
|
|
611
|
+
clip.muted = nextMuted;
|
|
612
|
+
try { clip.playbackRate = playbackRate; } catch {}
|
|
613
|
+
try { clip.defaultPlaybackRate = playbackRate; } catch {}
|
|
614
|
+
try {
|
|
615
|
+
if ("preservesPitch" in clip) clip.preservesPitch = true;
|
|
616
|
+
if ("mozPreservesPitch" in clip) clip.mozPreservesPitch = true;
|
|
617
|
+
if ("webkitPreservesPitch" in clip) clip.webkitPreservesPitch = true;
|
|
618
|
+
} catch {}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
function setVisibility(node, active) {
|
|
622
|
+
const next = active ? "visible" : "hidden";
|
|
623
|
+
if (visibilityStates.get(node) === next) return;
|
|
624
|
+
visibilityStates.set(node, next);
|
|
625
|
+
node.style.visibility = next;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
function setPlaybackRate(nextRate) {
|
|
629
|
+
const next = Number(nextRate);
|
|
630
|
+
playbackRate = Number.isFinite(next) && next > 0 ? Math.max(0.05, Math.min(8, next)) : 1;
|
|
631
|
+
for (const clip of clips) {
|
|
632
|
+
if (clip instanceof HTMLMediaElement) applyMediaState(clip);
|
|
633
|
+
}
|
|
634
|
+
if (backingVideo instanceof HTMLMediaElement) applyMediaState(backingVideo);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
function setMuted(nextMuted) {
|
|
638
|
+
previewMuted = Boolean(nextMuted);
|
|
639
|
+
for (const clip of clips) {
|
|
640
|
+
if (clip instanceof HTMLMediaElement) applyMediaState(clip);
|
|
641
|
+
}
|
|
642
|
+
if (backingVideo instanceof HTMLMediaElement) applyMediaState(backingVideo);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
function clipKey(clip) {
|
|
646
|
+
return clip.getAttribute("data-hf-id") || clip.id || clip.getAttribute("data-label") || "";
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
function ensurePlaying(media) {
|
|
650
|
+
if (!playing) {
|
|
651
|
+
if (!media.paused) media.pause();
|
|
652
|
+
activeMedia.delete(media);
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
if (!activeMedia.has(media) || media.paused) {
|
|
656
|
+
activeMedia.add(media);
|
|
657
|
+
void media.play().catch(() => {});
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
function pauseInactiveMedia(media) {
|
|
662
|
+
activeMedia.delete(media);
|
|
663
|
+
if (!media.paused) media.pause();
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
function seekMedia(media, target, forceSeek, driftLimit) {
|
|
667
|
+
if (!Number.isFinite(target)) return;
|
|
668
|
+
if (forceSeek || Math.abs(media.currentTime - target) > driftLimit) {
|
|
669
|
+
try { media.currentTime = Math.max(0, target); } catch {}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
function deriveTimelineTimeFromBackingVideo() {
|
|
674
|
+
if (!(backingVideo instanceof HTMLVideoElement)) return null;
|
|
675
|
+
if (activeVideoProxyNode instanceof Element && !activeVideoProxyNode.isConnected) {
|
|
676
|
+
activeVideoProxyNode = null;
|
|
677
|
+
activeVideoProxyKey = null;
|
|
678
|
+
refreshClips();
|
|
679
|
+
}
|
|
680
|
+
if (activeVideoProxyNode instanceof Element) {
|
|
681
|
+
const timing = readTiming(activeVideoProxyNode);
|
|
682
|
+
const mapped = timing.start + (backingVideo.currentTime - timing.mediaStart);
|
|
683
|
+
if (Number.isFinite(mapped)) return clampTime(mapped);
|
|
684
|
+
}
|
|
685
|
+
return clampTime(backingVideo.currentTime);
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
function apply(nextTime, options = {}) {
|
|
689
|
+
const forceSeek = Boolean(options.forceSeek);
|
|
690
|
+
const fromClock = Boolean(options.fromClock);
|
|
691
|
+
time = clampTime(nextTime);
|
|
692
|
+
let activeVideoProxy = null;
|
|
693
|
+
for (const clip of clips) {
|
|
694
|
+
const timing = readTiming(clip);
|
|
695
|
+
const active = time >= timing.start && time < timing.end;
|
|
696
|
+
if (clip instanceof HTMLElement && !(clip instanceof HTMLAudioElement)) {
|
|
697
|
+
if (clip.getAttribute("data-vf-timeline-proxy") === "video") {
|
|
698
|
+
if (active) activeVideoProxy = clip;
|
|
699
|
+
} else {
|
|
700
|
+
setVisibility(clip, active);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
if (clip instanceof HTMLMediaElement) {
|
|
704
|
+
applyMediaState(clip);
|
|
705
|
+
if (active) {
|
|
706
|
+
const target = Math.max(0, timing.mediaStart + time - timing.start);
|
|
707
|
+
const enteringClip = !activeMedia.has(clip);
|
|
708
|
+
seekMedia(clip, target, forceSeek || enteringClip, playing ? 0.75 : 0.08);
|
|
709
|
+
if (playing) {
|
|
710
|
+
ensurePlaying(clip);
|
|
711
|
+
} else {
|
|
712
|
+
pauseInactiveMedia(clip);
|
|
713
|
+
}
|
|
714
|
+
} else {
|
|
715
|
+
pauseInactiveMedia(clip);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
if (backingVideo instanceof HTMLVideoElement) {
|
|
720
|
+
applyMediaState(backingVideo);
|
|
721
|
+
const shouldShowBackingVideo = !hasVideoProxies || Boolean(activeVideoProxy);
|
|
722
|
+
backingVideo.style.visibility = shouldShowBackingVideo ? "visible" : "hidden";
|
|
723
|
+
if (activeVideoProxy) {
|
|
724
|
+
const nextProxyKey = clipKey(activeVideoProxy);
|
|
725
|
+
const proxyChanged = nextProxyKey !== activeVideoProxyKey;
|
|
726
|
+
activeVideoProxyKey = nextProxyKey;
|
|
727
|
+
activeVideoProxyNode = activeVideoProxy;
|
|
728
|
+
const timing = readTiming(activeVideoProxy);
|
|
729
|
+
const target = Math.max(0, timing.mediaStart + time - timing.start);
|
|
730
|
+
const driftLimit = playing ? (fromClock ? 0.75 : 2.0) : 0.08;
|
|
731
|
+
const drifting = !backingVideo.seeking && Math.abs(backingVideo.currentTime - target) > driftLimit;
|
|
732
|
+
if (forceSeek || proxyChanged || !playing || drifting) {
|
|
733
|
+
seekMedia(backingVideo, target, true, 0.08);
|
|
734
|
+
}
|
|
735
|
+
} else {
|
|
736
|
+
activeVideoProxyKey = null;
|
|
737
|
+
activeVideoProxyNode = null;
|
|
738
|
+
if (!hasVideoProxies && !fromClock) seekMedia(backingVideo, time, forceSeek, playing ? 1.25 : 0.08);
|
|
739
|
+
}
|
|
740
|
+
if (playing && shouldShowBackingVideo) {
|
|
741
|
+
ensurePlaying(backingVideo);
|
|
742
|
+
} else {
|
|
743
|
+
pauseInactiveMedia(backingVideo);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
function tick(now) {
|
|
749
|
+
if (!playing) return;
|
|
750
|
+
if (!last) last = now;
|
|
751
|
+
const delta = ((now - last) / 1000) * playbackRate;
|
|
752
|
+
const next = time + delta;
|
|
753
|
+
last = now;
|
|
754
|
+
apply(next >= duration ? duration : next, { fromClock: true });
|
|
755
|
+
if (time >= duration) {
|
|
756
|
+
playing = false;
|
|
757
|
+
for (const clip of clips) {
|
|
758
|
+
if (clip instanceof HTMLMediaElement) pauseInactiveMedia(clip);
|
|
759
|
+
}
|
|
760
|
+
if (backingVideo instanceof HTMLMediaElement) pauseInactiveMedia(backingVideo);
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
raf = requestAnimationFrame(tick);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
window.__player = {
|
|
767
|
+
play() {
|
|
768
|
+
if (playing) return;
|
|
769
|
+
if (time >= duration) time = 0;
|
|
770
|
+
playing = true;
|
|
771
|
+
last = 0;
|
|
772
|
+
apply(time, { forceSeek: true });
|
|
773
|
+
cancelAnimationFrame(raf);
|
|
774
|
+
raf = requestAnimationFrame(tick);
|
|
775
|
+
},
|
|
776
|
+
pause() {
|
|
777
|
+
playing = false;
|
|
778
|
+
cancelAnimationFrame(raf);
|
|
779
|
+
for (const clip of clips) {
|
|
780
|
+
if (clip instanceof HTMLMediaElement) pauseInactiveMedia(clip);
|
|
781
|
+
}
|
|
782
|
+
if (backingVideo instanceof HTMLMediaElement) pauseInactiveMedia(backingVideo);
|
|
783
|
+
},
|
|
784
|
+
seek(nextTime, options = {}) {
|
|
785
|
+
const shouldKeepPlaying = playing || options.keepPlaying === true;
|
|
786
|
+
playing = shouldKeepPlaying;
|
|
787
|
+
if (!shouldKeepPlaying) cancelAnimationFrame(raf);
|
|
788
|
+
apply(nextTime, { forceSeek: true });
|
|
789
|
+
if (shouldKeepPlaying) {
|
|
790
|
+
last = 0;
|
|
791
|
+
cancelAnimationFrame(raf);
|
|
792
|
+
raf = requestAnimationFrame(tick);
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
getTime() {
|
|
796
|
+
return time;
|
|
797
|
+
},
|
|
798
|
+
getDuration() {
|
|
799
|
+
return duration;
|
|
800
|
+
},
|
|
801
|
+
isPlaying() {
|
|
802
|
+
return playing;
|
|
803
|
+
},
|
|
804
|
+
setPlaybackRate,
|
|
805
|
+
getPlaybackRate() {
|
|
806
|
+
return playbackRate;
|
|
807
|
+
},
|
|
808
|
+
setMuted,
|
|
809
|
+
refreshClips
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
refreshClips();
|
|
813
|
+
if (backingVideo instanceof HTMLMediaElement) {
|
|
814
|
+
backingVideo.addEventListener("loadedmetadata", () => {
|
|
815
|
+
if (!playing) apply(time, { forceSeek: true });
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
window.addEventListener("message", (event) => {
|
|
820
|
+
const data = event.data || {};
|
|
821
|
+
if (data.type !== "control" && data.source !== "hf-parent") return;
|
|
822
|
+
if (data.action === "play") {
|
|
823
|
+
window.__player.play();
|
|
824
|
+
}
|
|
825
|
+
if (data.action === "pause" || data.action === "stop-media") {
|
|
826
|
+
window.__player.pause();
|
|
827
|
+
}
|
|
828
|
+
if (data.action === "seek") {
|
|
829
|
+
const nextTime = Number.isFinite(Number(data.time))
|
|
830
|
+
? Number(data.time)
|
|
831
|
+
: Number.isFinite(Number(data.frame))
|
|
832
|
+
? Number(data.frame) / 30
|
|
833
|
+
: Number.isFinite(Number(data.payload?.time))
|
|
834
|
+
? Number(data.payload.time)
|
|
835
|
+
: time;
|
|
836
|
+
window.__player.seek(nextTime);
|
|
837
|
+
}
|
|
838
|
+
if (data.action === "set-playback-rate") {
|
|
839
|
+
setPlaybackRate(data.playbackRate ?? data.payload?.playbackRate);
|
|
840
|
+
}
|
|
841
|
+
if (data.action === "set-muted") {
|
|
842
|
+
setMuted(data.muted ?? data.payload?.muted);
|
|
843
|
+
}
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
function selectTargetFromEvent(event) {
|
|
847
|
+
const handle = event.target instanceof Element
|
|
848
|
+
? event.target.closest("[data-vf-frame-handle]")
|
|
849
|
+
: null;
|
|
850
|
+
const handleTargetId = handle?.getAttribute("data-vf-target-id") || null;
|
|
851
|
+
if (handleTargetId) {
|
|
852
|
+
return document.querySelector("[data-hf-id='" + CSS.escape(handleTargetId) + "'], #" + CSS.escape(handleTargetId));
|
|
853
|
+
}
|
|
854
|
+
return event.target instanceof Element
|
|
855
|
+
? event.target.closest("[data-start]")
|
|
856
|
+
: null;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
function postSelectedLayer(event) {
|
|
860
|
+
const target = selectTargetFromEvent(event);
|
|
861
|
+
const rawId = target?.getAttribute("data-hf-id") || target?.id || null;
|
|
862
|
+
const id = rawId === "source-video" ? null : rawId;
|
|
863
|
+
window.parent?.postMessage({
|
|
864
|
+
source: "vidfarm-composition",
|
|
865
|
+
action: "select-layer",
|
|
866
|
+
id
|
|
867
|
+
}, "*");
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
function postPreviewContextMenu(event) {
|
|
871
|
+
event.preventDefault();
|
|
872
|
+
const root = document.querySelector("[data-composition-id]");
|
|
873
|
+
const rect = root instanceof HTMLElement ? root.getBoundingClientRect() : null;
|
|
874
|
+
const target = selectTargetFromEvent(event);
|
|
875
|
+
const rawId = target?.getAttribute("data-hf-id") || target?.id || null;
|
|
876
|
+
const id = rawId === "source-video" ? null : rawId;
|
|
877
|
+
const x = rect ? ((event.clientX - rect.left) / Math.max(1, rect.width)) * 100 : 12;
|
|
878
|
+
const y = rect ? ((event.clientY - rect.top) / Math.max(1, rect.height)) * 100 : 70;
|
|
879
|
+
window.parent?.postMessage({
|
|
880
|
+
source: "vidfarm-composition",
|
|
881
|
+
action: "preview-context-menu",
|
|
882
|
+
id,
|
|
883
|
+
clientX: event.clientX,
|
|
884
|
+
clientY: event.clientY,
|
|
885
|
+
time,
|
|
886
|
+
frame: {
|
|
887
|
+
x: Math.max(0, Math.min(95, x)),
|
|
888
|
+
y: Math.max(0, Math.min(95, y)),
|
|
889
|
+
width: 42,
|
|
890
|
+
height: 12
|
|
891
|
+
}
|
|
892
|
+
}, "*");
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
function frameFromNode(node) {
|
|
896
|
+
return {
|
|
897
|
+
x: Number.parseFloat(node.style.left || "0") || 0,
|
|
898
|
+
y: Number.parseFloat(node.style.top || "0") || 0,
|
|
899
|
+
width: Number.parseFloat(node.style.width || "100") || 100,
|
|
900
|
+
height: Number.parseFloat(node.style.height || "100") || 100,
|
|
901
|
+
// NaN (not 18) when the wrapper has no inline font-size \u2014 see frameFromNode
|
|
902
|
+
// in composition-runtime.ts. Prevents a plain MOVE from collapsing
|
|
903
|
+
// span-sized text to 18px; apply/stage paths all guard Number.isFinite.
|
|
904
|
+
fontSize: Number.parseFloat(node.style.fontSize)
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
function isVisualFrameTarget(node) {
|
|
909
|
+
if (!(node instanceof HTMLElement) || node instanceof HTMLAudioElement) return false;
|
|
910
|
+
const id = node.getAttribute("data-hf-id") || node.id || "";
|
|
911
|
+
return id !== "source-video";
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
function isTextFrameTarget(node) {
|
|
915
|
+
return node instanceof HTMLElement &&
|
|
916
|
+
!(node instanceof HTMLAudioElement) &&
|
|
917
|
+
!(node instanceof HTMLVideoElement) &&
|
|
918
|
+
!(node instanceof HTMLImageElement);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
function syncRuntimeFrameControls(node) {
|
|
922
|
+
if (!isVisualFrameTarget(node)) return;
|
|
923
|
+
const root = document.querySelector("[data-composition-id]");
|
|
924
|
+
if (!(root instanceof HTMLElement)) return;
|
|
925
|
+
const targetId = node.getAttribute("data-hf-id") || node.id || "";
|
|
926
|
+
if (!targetId) return;
|
|
927
|
+
let ring = document.querySelector("[data-vf-selection-ring='true']");
|
|
928
|
+
if (!(ring instanceof HTMLElement)) {
|
|
929
|
+
ring = document.createElement("div");
|
|
930
|
+
ring.setAttribute("data-vf-selection-ring", "true");
|
|
931
|
+
root.append(ring);
|
|
932
|
+
}
|
|
933
|
+
ring.style.display = "block";
|
|
934
|
+
ring.style.position = "absolute";
|
|
935
|
+
ring.style.left = node.style.left || "0%";
|
|
936
|
+
ring.style.top = node.style.top || "0%";
|
|
937
|
+
ring.style.width = node.style.width || "100%";
|
|
938
|
+
ring.style.height = node.style.height || "100%";
|
|
939
|
+
ring.style.borderRadius = node.style.borderRadius || "0";
|
|
940
|
+
ring.style.zIndex = "9999";
|
|
941
|
+
ring.style.pointerEvents = "auto";
|
|
942
|
+
ring.style.cursor = "grab";
|
|
943
|
+
ring.style.border = "1px dashed #F2CD46";
|
|
944
|
+
ring.style.boxShadow = "0 0 0 2px #118df2";
|
|
945
|
+
ring.setAttribute("data-vf-frame-handle", "move");
|
|
946
|
+
ring.setAttribute("data-vf-target-id", targetId);
|
|
947
|
+
for (const handle of Array.from(ring.querySelectorAll("[data-vf-frame-handle]"))) {
|
|
948
|
+
if (handle !== ring) handle.remove();
|
|
949
|
+
}
|
|
950
|
+
for (const [mode, cssText] of [
|
|
951
|
+
["top-left", "left:-7px;top:-7px;cursor:nwse-resize;"],
|
|
952
|
+
["top", "top:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize;"],
|
|
953
|
+
["top-right", "right:-7px;top:-7px;cursor:nesw-resize;"],
|
|
954
|
+
["right", "right:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize;"],
|
|
955
|
+
["bottom-right", "right:-7px;bottom:-7px;cursor:nwse-resize;"],
|
|
956
|
+
["bottom", "bottom:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize;"],
|
|
957
|
+
["bottom-left", "left:-7px;bottom:-7px;cursor:nesw-resize;"],
|
|
958
|
+
["left", "left:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize;"]
|
|
959
|
+
]) {
|
|
960
|
+
const handle = document.createElement("span");
|
|
961
|
+
handle.setAttribute("data-vf-frame-handle", mode);
|
|
962
|
+
handle.setAttribute("data-vf-target-id", targetId);
|
|
963
|
+
handle.style.cssText = [
|
|
964
|
+
"position:absolute",
|
|
965
|
+
"display:block",
|
|
966
|
+
"width:14px",
|
|
967
|
+
"height:14px",
|
|
968
|
+
"box-sizing:border-box",
|
|
969
|
+
"border-radius:999px",
|
|
970
|
+
"border:2px solid #0b0d0a",
|
|
971
|
+
"background:#F2CD46",
|
|
972
|
+
"box-shadow:0 0 0 2px rgba(242,205,70,0.32),0 1px 4px rgba(0,0,0,0.38)",
|
|
973
|
+
"pointer-events:auto",
|
|
974
|
+
"touch-action:none",
|
|
975
|
+
cssText
|
|
976
|
+
].join(";");
|
|
977
|
+
ring.append(handle);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
function applyFrameToNode(node, frame) {
|
|
982
|
+
node.style.left = frame.x + "%";
|
|
983
|
+
node.style.top = frame.y + "%";
|
|
984
|
+
node.style.width = frame.width + "%";
|
|
985
|
+
node.style.height = frame.height + "%";
|
|
986
|
+
if (Number.isFinite(frame.fontSize)) {
|
|
987
|
+
node.style.fontSize = frame.fontSize + "px";
|
|
988
|
+
}
|
|
989
|
+
syncRuntimeFrameControls(node);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
function postFrameDraft(node, phase) {
|
|
993
|
+
const id = node.getAttribute("data-hf-id") || node.id || null;
|
|
994
|
+
if (!id) return;
|
|
995
|
+
window.parent?.postMessage({
|
|
996
|
+
source: "vidfarm-composition",
|
|
997
|
+
action: "visual-frame-draft",
|
|
998
|
+
phase,
|
|
999
|
+
id,
|
|
1000
|
+
frame: frameFromNode(node)
|
|
1001
|
+
}, "*");
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
let visualFrameDrag = null;
|
|
1005
|
+
|
|
1006
|
+
function beginVisualFrameDrag(event) {
|
|
1007
|
+
if (event.button !== 0) return;
|
|
1008
|
+
const handle = event.target instanceof Element
|
|
1009
|
+
? event.target.closest("[data-vf-frame-handle]")
|
|
1010
|
+
: null;
|
|
1011
|
+
const handleTargetId = handle?.getAttribute("data-vf-target-id") || null;
|
|
1012
|
+
const target = handleTargetId
|
|
1013
|
+
? document.querySelector("[data-hf-id='" + CSS.escape(handleTargetId) + "'], #" + CSS.escape(handleTargetId))
|
|
1014
|
+
: event.target instanceof Element
|
|
1015
|
+
? event.target.closest("[data-start]")
|
|
1016
|
+
: null;
|
|
1017
|
+
if (!isVisualFrameTarget(target)) return;
|
|
1018
|
+
const root = document.querySelector("[data-composition-id]");
|
|
1019
|
+
if (!(root instanceof HTMLElement)) return;
|
|
1020
|
+
const rootRect = root.getBoundingClientRect();
|
|
1021
|
+
event.preventDefault();
|
|
1022
|
+
event.stopPropagation();
|
|
1023
|
+
postSelectedLayer(event);
|
|
1024
|
+
visualFrameDrag = {
|
|
1025
|
+
node: target,
|
|
1026
|
+
mode: handle?.getAttribute("data-vf-frame-handle") || "move",
|
|
1027
|
+
startX: event.clientX,
|
|
1028
|
+
startY: event.clientY,
|
|
1029
|
+
rootWidth: Math.max(1, rootRect.width),
|
|
1030
|
+
rootHeight: Math.max(1, rootRect.height),
|
|
1031
|
+
frame: frameFromNode(target),
|
|
1032
|
+
moved: false
|
|
1033
|
+
};
|
|
1034
|
+
syncRuntimeFrameControls(target);
|
|
1035
|
+
target.style.cursor = "grabbing";
|
|
1036
|
+
postFrameDraft(target, "start");
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
function updateVisualFrameDrag(event) {
|
|
1040
|
+
if (!visualFrameDrag) return;
|
|
1041
|
+
const drag = visualFrameDrag;
|
|
1042
|
+
const dx = ((event.clientX - drag.startX) / drag.rootWidth) * 100;
|
|
1043
|
+
const dy = ((event.clientY - drag.startY) / drag.rootHeight) * 100;
|
|
1044
|
+
if (!drag.moved && Math.hypot(event.clientX - drag.startX, event.clientY - drag.startY) < 2) return;
|
|
1045
|
+
drag.moved = true;
|
|
1046
|
+
event.preventDefault();
|
|
1047
|
+
const next = { ...drag.frame };
|
|
1048
|
+
if (drag.mode === "move") {
|
|
1049
|
+
next.x = Math.max(0, Math.min(100 - drag.frame.width, drag.frame.x + dx));
|
|
1050
|
+
next.y = Math.max(0, Math.min(100 - drag.frame.height, drag.frame.y + dy));
|
|
1051
|
+
}
|
|
1052
|
+
if (drag.mode === "left" || drag.mode === "top-left" || drag.mode === "bottom-left") {
|
|
1053
|
+
const nextX = Math.max(0, Math.min(drag.frame.x + drag.frame.width - 1, drag.frame.x + dx));
|
|
1054
|
+
next.x = nextX;
|
|
1055
|
+
next.width = Math.max(1, Math.min(100 - nextX, drag.frame.width + (drag.frame.x - nextX)));
|
|
1056
|
+
}
|
|
1057
|
+
if (drag.mode === "right" || drag.mode === "top-right" || drag.mode === "bottom-right") {
|
|
1058
|
+
next.width = Math.max(1, Math.min(100 - drag.frame.x, drag.frame.width + dx));
|
|
1059
|
+
}
|
|
1060
|
+
if (drag.mode === "top" || drag.mode === "top-left" || drag.mode === "top-right") {
|
|
1061
|
+
const nextY = Math.max(0, Math.min(drag.frame.y + drag.frame.height - 1, drag.frame.y + dy));
|
|
1062
|
+
next.y = nextY;
|
|
1063
|
+
next.height = Math.max(1, Math.min(100 - nextY, drag.frame.height + (drag.frame.y - nextY)));
|
|
1064
|
+
}
|
|
1065
|
+
if (drag.mode === "bottom" || drag.mode === "bottom-left" || drag.mode === "bottom-right") {
|
|
1066
|
+
next.height = Math.max(1, Math.min(100 - drag.frame.y, drag.frame.height + dy));
|
|
1067
|
+
}
|
|
1068
|
+
if (
|
|
1069
|
+
isTextFrameTarget(drag.node) &&
|
|
1070
|
+
["top-left", "top-right", "bottom-left", "bottom-right"].includes(drag.mode)
|
|
1071
|
+
) {
|
|
1072
|
+
const widthScale = next.width / Math.max(1, drag.frame.width);
|
|
1073
|
+
const heightScale = next.height / Math.max(1, drag.frame.height);
|
|
1074
|
+
const scale = Math.sqrt(Math.max(0.05, widthScale * heightScale));
|
|
1075
|
+
next.fontSize = Math.max(8, Math.min(180, (drag.frame.fontSize || 18) * scale));
|
|
1076
|
+
}
|
|
1077
|
+
applyFrameToNode(drag.node, next);
|
|
1078
|
+
postFrameDraft(drag.node, "move");
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
function endVisualFrameDrag() {
|
|
1082
|
+
if (!visualFrameDrag) return;
|
|
1083
|
+
visualFrameDrag.node.style.cursor = "";
|
|
1084
|
+
postFrameDraft(visualFrameDrag.node, visualFrameDrag.moved ? "end" : "tap");
|
|
1085
|
+
visualFrameDrag = null;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
function hoverVisualFrameTarget(event) {
|
|
1089
|
+
const handle = event.target instanceof Element
|
|
1090
|
+
? event.target.closest("[data-vf-frame-handle]")
|
|
1091
|
+
: null;
|
|
1092
|
+
const handleTargetId = handle?.getAttribute("data-vf-target-id") || null;
|
|
1093
|
+
const target = handleTargetId
|
|
1094
|
+
? document.querySelector("[data-hf-id='" + CSS.escape(handleTargetId) + "'], #" + CSS.escape(handleTargetId))
|
|
1095
|
+
: event.target instanceof Element
|
|
1096
|
+
? event.target.closest("[data-start]")
|
|
1097
|
+
: null;
|
|
1098
|
+
if (!isVisualFrameTarget(target)) return;
|
|
1099
|
+
target.style.cursor = "grab";
|
|
1100
|
+
syncRuntimeFrameControls(target);
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
document.addEventListener("pointerover", hoverVisualFrameTarget, true);
|
|
1104
|
+
document.addEventListener("pointerdown", beginVisualFrameDrag, true);
|
|
1105
|
+
document.addEventListener("pointermove", updateVisualFrameDrag, { passive: false });
|
|
1106
|
+
document.addEventListener("pointerup", endVisualFrameDrag);
|
|
1107
|
+
document.addEventListener("pointercancel", endVisualFrameDrag);
|
|
1108
|
+
document.addEventListener("pointerdown", postSelectedLayer);
|
|
1109
|
+
document.addEventListener("click", postSelectedLayer);
|
|
1110
|
+
document.addEventListener("contextmenu", postPreviewContextMenu, true);
|
|
1111
|
+
|
|
1112
|
+
apply(0);
|
|
1113
|
+
})();
|
|
1114
|
+
<\/script>`}function aX(t){if(/window\.__player\s*=/.test(t))return t;let e=FU();return/<\/body>/i.test(t)?t.replace(/<\/body>/i,`${e}
|
|
1115
|
+
</body>`):`${t}
|
|
1116
|
+
${e}`}function HU(t=Om[0]){let e=u1(t);tX(e);let n=PU(t),r=t.width,o=t.height;return`<!doctype html>
|
|
1117
|
+
<html>
|
|
1118
|
+
<head>
|
|
1119
|
+
<meta charset="UTF-8" />
|
|
1120
|
+
<base href="/" />
|
|
1121
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
1122
|
+
<style>
|
|
1123
|
+
${GK}
|
|
1124
|
+
html, body { width:100%; height:100%; margin:0; overflow:hidden; background:#050604; }
|
|
1125
|
+
[data-composition-id] { position:relative; width:100vw; height:100vh; overflow:hidden; background:#050604; }
|
|
1126
|
+
[data-vf-selected="true"] {
|
|
1127
|
+
outline: 2px solid #118df2 !important;
|
|
1128
|
+
outline-offset: 3px !important;
|
|
1129
|
+
box-shadow: 0 0 0 1px #ffffff, 0 0 0 7px rgba(17, 141, 242, 0.20) !important;
|
|
1130
|
+
}
|
|
1131
|
+
audio { display:none; }
|
|
1132
|
+
</style>
|
|
1133
|
+
</head>
|
|
1134
|
+
<body>
|
|
1135
|
+
<div data-composition-id="${Pe(t.id)}" data-source-video="${Pe(t.title)}" data-width="${r}" data-height="${o}" data-duration="${Yt(n)}">
|
|
1136
|
+
${iX(t,e)}
|
|
1137
|
+
${e.map(nX).join(`
|
|
1138
|
+
`)}
|
|
1139
|
+
</div>
|
|
1140
|
+
${FU()}
|
|
1141
|
+
</body>
|
|
1142
|
+
</html>`}function Mt(t){return t.key??t.id}function d1(t){return Array.from(new Set(t.filter(e=>!!e)))}function sX(t){let e=[];for(let n of d1([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 K_(t){return`<!doctype html>
|
|
1143
|
+
${t.documentElement.outerHTML}`}function ee(t){return!!(t&&typeof t=="object"&&t.nodeType===1&&"style"in t)}function GU(t,e){return ee(t)&&t.tagName.toLowerCase()===e.toLowerCase()}function Zo(t,e,n){let r=new DOMParser().parseFromString(t,"text/html"),o=Bn(r,e);return ee(o)?(n(o),K_(r)):t}function wm(t,e,n){try{let r=t?.contentDocument,o=r?Bn(r,e):null;return ee(o)?(n(o),!0):!1}catch{return!1}}function Qx(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(!ee(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(!ee(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)&&!GU(l,"audio")&&(l.style.zIndex=String(c)),i+=1}return i}catch{return 0}}var uU=new WeakSet;function lX(t){return t.hasAttribute("data-vf-selection-ring")||t.hasAttribute("data-vf-frame-handle")}function dU(t){return t.hasAttribute("data-vf-playback-source")?"@playback-source":t.getAttribute("data-hf-id")||t.id||null}function $U(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 cX(t,e){$U(t,e),t.innerHTML!==e.innerHTML&&(t.innerHTML=e.innerHTML)}function fU(t,e){try{let n=t?.contentDocument,r=n?.querySelector("[data-composition-id]");if(!n||!ee(r))return!1;let i=new DOMParser().parseFromString(e,"text/html").querySelector("[data-composition-id]");if(!ee(i))return!1;let a=r.querySelector("[data-vf-playback-source]"),s=i.querySelector("[data-vf-playback-source]");if(!!a!=!!s)return!1;$U(r,i);let l=new Set,c=new Map;for(let m of Array.from(r.children)){if(lX(m)){l.add(m);continue}let _=dU(m);_!==null&&ee(m)&&!c.has(_)&&c.set(_,m)}let d=new Set,u=[];for(let m of Array.from(i.children)){if(!ee(m))continue;let _=dU(m),v=_!==null?c.get(_):void 0;v&&!d.has(v)&&v.tagName===m.tagName?(d.add(v),cX(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 pU(t,e){try{let n=t?.contentDocument;return n?(n.open(),n.write(e),n.close(),!0):!1}catch{return!1}}function Tm(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 mU(t){let e=X_(t),n=e.querySelector("[data-composition-id]"),r=[];for(let i of Array.from(e.querySelectorAll("[data-start]")))i===n||!ee(i)||r.push(i);let o=n?Number(n.getAttribute("data-duration")||0):0;return{nodes:r,duration:o}}function gU(t){return d1([t.getAttribute("data-hf-id")??void 0,t.id||void 0])}function hU(t){return d1([t.key,t.hfId,t.domId,t.id])}function Zx(t,e,n){let r=t.getState(),o=r.elements,i=mU(e),a=mU(n),s=new Set(i.nodes.flatMap(gU)),l=new Set,c=[];for(let u of a.nodes){let p=gU(u);if(p.length===0)continue;let f=Tm(u,["data-start"])??0,m=Tm(u,["data-duration"])??0,_=Tm(u,["data-track-index"])??0,v=Tm(u,["data-playback-start","data-media-start"]),h=Tm(u,["data-volume"]),b=o.findIndex((S,E)=>!l.has(E)&&hU(S).some(R=>p.includes(R)));if(b>=0){l.add(b);let S=o[b],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;hU(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(){ee(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||GU(s,"audio")?(a(),!1):(!ee(i)&&ee(o)&&(i=r.createElement("div"),i.setAttribute("data-vf-selection-ring","true"),o.append(i)),ee(i)&&MX(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 Pd(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 uX(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 t1(t){return Array.from(new Set(t.map(e=>e.track))).sort((e,n)=>n-e)}function yU(t,e,n){let r=new Set([Mt(e),e.hfId,e.domId,e.id].filter(o=>!!o));return t.filter(o=>![Mt(o),o.hfId,o.domId,o.id].some(a=>a&&r.has(a))).filter(o=>!n||Y_(n,o)!=="track-placeholder").map(o=>({start:o.start,duration:o.duration,track:o.track}))}function Dm(t){return Number.isFinite(t.duration)&&t.duration>0}function e1(t,e){return Dm(t)?e.some(n=>Dm(n)&&Pd(t,n)):!1}function dX(t,e,n,r,o){if(!Number.isFinite(n)||n<=0)return Math.max(0,r);let a=t.filter(f=>f.track===e&&Dm(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 _=Ut(r,f.lo,Math.max(f.lo,m)),v=Math.abs(_-r);v<p-.001&&(u=_,p=v)}return u}function Um(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=>ee(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||Pd({...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=sX(e);for(let r of n){if(r===e.selector&&e.selectorIndex!==void 0){let i=t.querySelectorAll(r).item(e.selectorIndex);if(ee(i))return i;continue}let o=t.querySelector(r);if(ee(o))return o}return null}function bU(t,e){return Bn(t,e)?.getAttribute("data-vf-group")||null}function _U(t,e,n){return e?Array.from(t.querySelectorAll(`[data-vf-group="${CSS.escape(e)}"]`)).filter(r=>ee(r)&&r.hasAttribute("data-start")):[n]}function fX(t,e,n){let r=new Set(e.map(Ci)),o=Array.from(t.querySelectorAll("[data-start]")).filter(a=>ee(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))&&Pd(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(Pd(l,d))throw new Error(`Track collision: ${s} overlaps ${c} on track ${l.track}.`)}}function pX(t){let e=Array.from(t.querySelectorAll("[data-start]")).filter(r=>{if(!ee(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(Pd(i,Ql(e[d]))){a=!0;break}if(!a)continue;let s=new Set,l=Ci(o);l&&s.add(l);let c=Um(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 Io(t,e){let n=new DOMParser().parseFromString(t,"text/html");e(n);let r=pX(n);return{html:K_(n),resolvedCollisions:r}}function jU(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 mX(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 b=Number.parseInt(h,10);Number.isFinite(b)&&(s=b)}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 vU=null,n1=null;function X_(t){if(vU===t&&n1)return n1;let e=new DOMParser().parseFromString(t,"text/html");return vU=t,n1=e,e}function J_(t,e){return Bn(X_(t),e)}function Qo(t,e,n){let r=t?.getPropertyValue(e)??"",o=Number.parseFloat(r);return Number.isFinite(o)?o:n}function SU(t,e){let n=J_(t,e),r=f1(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:q_(o?.style.fontFamily||n?.style.fontFamily),fontWeight:qK(o?.style.fontWeight||n?.style.fontWeight,Os(q_(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:YK(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:gX(n?.style.objectFit),objectPosition:hX(n?.style.objectPosition),slug:n?.getAttribute("data-hf-slug")??"",note:n?.getAttribute("data-hf-note")??""}}function Q_(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,64)}function gX(t){let e=(t??"").trim().toLowerCase();return e==="contain"||e==="fill"||e==="none"||e==="scale-down"?e:"cover"}function hX(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 qU(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",Yt(o)),r.setAttribute("data-duration",Yt(i)),r.setAttribute("data-end",Yt(o+i)),r.setAttribute("data-track-index",String(a)),n.playbackStart!==void 0){let s=Yt(n.playbackStart);r.setAttribute("data-media-start",s),r.setAttribute("data-playback-start",s)}}function VU(t,e,n){return Io(t,r=>qU(r,e,n))}function r1(t,e){return Io(t,n=>{for(let r of e)qU(n,r.element,r.updates)})}function f1(t){return Mm.find(e=>e.id===t.hfId||e.id===t.domId||e.id===t.id)}function Y_(t,e){return J_(t,e)?.getAttribute("data-layer-kind")||null}function YU(t,e){return J_(t,e)?.getAttribute("data-layer-format")||null}function EU(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 z_(t){try{let e=Cs(t);return e?.refreshClips?.(),!!e?.refreshClips}catch{return!1}}function TU(t,e,n){try{t?.contentWindow?.postMessage({source:"hf-parent",type:"control",action:e,...n},"*")}catch{}}var yX=(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(O=>O.isPlaying),f=u(O=>O.currentTime),m=u(O=>O.duration),_=u(O=>O.zoomMode),v=u(O=>O.manualZoomPercent),h=u(O=>O.setZoomMode),b=u(O=>O.setManualZoomPercent),S=m>0?m:xm,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 P(O){h("manual"),b(Math.max(25,Math.min(400,O)))}function U(){let O=cU(R);if(O===null){C(Ms(f));return}i(Math.max(0,Math.min(S,O)))}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:O=>{let N=O.target.value;C(N);let W=cU(N);W!==null&&i(Math.max(0,Math.min(S,W)))},onBlur:()=>{L(!1),U()},onKeyDown:O=>{O.key==="Enter"&&O.currentTarget.blur(),O.key==="Escape"&&(C(Ms(f)),O.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:O=>i(Number(O.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:O=>r(O.target.value),onBlur:O=>o(Number(O.target.value)),onKeyDown:O=>{O.key==="Enter"&&O.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:O=>P(Number(O.target.value))}),(0,g.jsx)("b",{children:"%"})]})]})]})}),bX=(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),b=(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",P=!!(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(X){b.current?.contains(X.target)||i()}function W(X){X.key==="Escape"&&i()}return window.addEventListener("pointerdown",N),window.addEventListener("keydown",W),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",W)}},[i]);function O({children:N,disabled:W,danger:X,onClick:pt}){return(0,g.jsx)("button",{type:"button",disabled:W,className:`timeline-menu-item ${X?"danger":""}`,onClick:()=>{W||(pt(),i())},children:N})}return(0,g.jsx)("div",{ref:b,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:V_(h)})]}),(0,g.jsx)(O,{disabled:!P,onClick:()=>e.element&&s(e.element,h),children:"Split at playhead"}),(0,g.jsx)(O,{disabled:!L,onClick:()=>L&&l(I,"above"),children:"New layer above"}),(0,g.jsx)(O,{disabled:!L,onClick:()=>L&&l(I,"below"),children:"New layer below"}),(0,g.jsx)(O,{onClick:()=>c({time:h,track:null}),children:"Insert Text"}),(0,g.jsx)(O,{onClick:()=>d({time:h,track:null}),children:"Insert Media"}),(0,g.jsx)(O,{onClick:()=>u({time:h,track:null}),children:"Upload Media\u2026"}),(0,g.jsx)(O,{onClick:()=>p(h),children:"Copy Timestamp"}),(0,g.jsx)(O,{onClick:()=>f({time:h,track:I??null}),children:"Copy Coordinates"}),r&&(0,g.jsx)(O,{onClick:m,children:"Group selected"}),o&&(0,g.jsx)(O,{onClick:_,children:"Ungroup"}),(0,g.jsx)(O,{disabled:!U,danger:!0,onClick:()=>e.element&&v(e.element),children:"Delete layer"})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(O,{onClick:()=>a(e.time),children:["Seek to ",V_(e.time)]}),(0,g.jsx)(O,{disabled:!L,onClick:()=>L&&l(I,"above"),children:"New layer above"}),(0,g.jsx)(O,{disabled:!L,onClick:()=>L&&l(I,"below"),children:"New layer below"}),(0,g.jsx)(O,{onClick:()=>c({time:e.time,track:null}),children:"Insert Text"}),(0,g.jsx)(O,{onClick:()=>d({time:e.time,track:null}),children:"Insert Media"}),(0,g.jsx)(O,{onClick:()=>u({time:e.time,track:null}),children:"Upload Media\u2026"}),(0,g.jsx)(O,{onClick:()=>p(e.time),children:"Copy Timestamp"}),(0,g.jsx)(O,{onClick:()=>f({time:e.time,track:I??null}),children:"Copy Coordinates"})]})})});function _X({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 vX({state:t,onClose:e}){let n=FK(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)(Nm,{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 SX({action:t,composition:e=Om[0],onPublish:n,publishDisabled:r=!1,publishLabel:o="Publish",templateId:i=null,forkId:a=null,publishVersion:s=null,originalUrl:l=null,songName:c=null,songUrl:d=null,onOpenShare:u,onOpenDecompose:p,onOpenHistory:f,decomposeDismissed:m=!1,decomposeBusy:_=!1,onResumeDecompose:v}){let h=e.viralDna,b=h.promotions??[],[S,E]=(0,A.useState)(!1),R=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!S)return;let I=P=>{R.current&&(R.current.contains(P.target)||E(!1))},L=P=>{P.key==="Escape"&&E(!1)};return document.addEventListener("mousedown",I),document.addEventListener("keydown",L),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",L)}},[S]);let C=[{label:"New decompose\u2026",handler:p,disabled:!p},{label:"History\u2026",handler:f,disabled:!f||!a,hint:a?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)(xX,{templateId:i,forkId:a,publishVersion:s,originalUrl:l,songName:c,songUrl:d,trendTagline:h.trendTagline??null}),(0,g.jsxs)("div",{className:"panel-menu-wrap",ref:R,children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button panel-menu-button","aria-haspopup":"menu","aria-expanded":S,"aria-label":"More actions",title:"More actions",onClick:()=>E(I=>!I),children:"\u22EF"}),S&&(0,g.jsx)("div",{className:"panel-menu-popover",role:"menu",children:C.map(I=>(0,g.jsx)("button",{type:"button",role:"menuitem",className:"panel-menu-item",disabled:I.disabled,title:I.hint,onClick:()=>{E(!1),I.handler?.()},children:I.label},I.label))})]}),(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",disabled:r,"aria-busy":r?"true":void 0,onClick:n,children:[o==="Rendering"&&(0,g.jsx)(Nm,{label:"Rendering"}),o]})]})]}),t,m&&v&&(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:v,disabled:_,"aria-busy":_?"true":void 0,children:[_&&(0,g.jsx)(Nm,{label:"Decomposing"}),_?"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:h.hook})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Retention"}),(0,g.jsx)("p",{children:h.retention})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Payoff"}),(0,g.jsx)("p",{children:h.payoff})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Preserve"}),(0,g.jsx)("ul",{children:h.preserve.map(I=>(0,g.jsx)("li",{children:I},I))})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Avoid"}),(0,g.jsx)("ul",{children:h.avoid.map(I=>(0,g.jsx)("li",{children:I},I))})]}),b.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:b.map(I=>(0,g.jsx)("li",{children:I},I))})]})]})}function EX({value:t,onChange:e}){let n=q_(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(q_(r.target.value)),children:CU.map(r=>(0,g.jsx)("option",{value:r,style:{fontFamily:`${Jl(r)}, 'TikTok Sans'`,fontWeight:Os(r)},children:VK(r)},r))}),(0,g.jsx)("span",{"aria-hidden":"true",children:"v"})]})}function TX({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:MU.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"?DU(n,.34):o.id==="fullwidth"?NU:"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 wX({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 o1(t,e){return{...e,start:t.start,duration:t.duration,track:t.track}}function wU(t,e){return e?{...t,...e.updates}:t}function s1(t,e){let n=Bn(X_(t),e);return n?{...e,...Ql(n)}:e}function F_(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.start===e.start&&t.duration===e.duration&&t.track===e.track}function xU(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","start","duration","track"])t[r]!==e[r]&&(n[r]=t[r]);return n}function H_({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 xX({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)(H_,{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)(H_,{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)(H_,{value:e??""})]}),(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"version"}),(0,g.jsx)(H_,{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 AX({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)(Nm,{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)(Nm,{label:"Decomposing"}),e?"Decomposing\u2026":t==="redo"?"Re-decompose":"Decompose"]})]})]})]})})}function IX({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 kX({forkId:t,currentVersion:e,onClose:n,onReverted:r}){let[o,i]=(0,A.useState)(null),[a,s]=(0,A.useState)(null),[l,c]=(0,A.useState)(null);(0,A.useEffect)(()=>{let p=!0;return fetch(`/api/v1/compositions/${encodeURIComponent(t)}/versions?limit=100`).then(f=>f.ok?f.json():null).then(f=>{if(!p)return;if(!f){s("Could not load versions");return}let _=(Array.isArray(f.versions)?f.versions:[]).map(v=>({version:Number(v.version),createdAt:typeof v.created_at=="string"?v.created_at:null,message:typeof v.message=="string"?v.message:null,reason:typeof v.reason=="string"?v.reason:null})).filter(v=>Number.isFinite(v.version));_.sort((v,h)=>h.version-v.version),i(_)}).catch(f=>p&&s(f instanceof Error?f.message:String(f))),()=>{p=!1}},[t]);let d=p=>{if(typeof window>"u")return;let f=`/api/v1/compositions/${encodeURIComponent(t)}/versions/${p}/composition.html`;window.open(f,"_blank","noopener,noreferrer")},u=(0,A.useCallback)(async p=>{c(p),s(null);try{let f=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/versions/${p}/composition.html`);if(!f.ok)throw new Error(`Load HTML failed (${f.status})`);let m=await f.text(),_=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/versions/${p}/composition.json`),v=_.ok?await _.text():null,h=await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/composition.html`,{method:"PUT",headers:{"content-type":"text/html"},body:m});if(!h.ok){let b=await h.json().catch(()=>({}));throw new Error(b?.error||`Save HTML failed (${h.status})`)}v&&await fetch(`/api/v1/compositions/${encodeURIComponent(t)}/composition.json`,{method:"PATCH",headers:{"content-type":"application/json"},body:v}).catch(()=>{}),r()}catch(f){s(f instanceof Error?f.message:String(f)),c(null)}},[t,r]);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. View any past cut in a new tab, or revert this working copy to it."}),o===null&&!a&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Loading versions\u2026"}),a&&(0,g.jsx)("p",{className:"decompose-modal-error",children:a}),o!==null&&o.length===0&&!a&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"No published versions yet. Publish once to create v1."}),o&&o.length>0&&(0,g.jsx)("ul",{className:"history-list",children:o.map(p=>{let f=e!==null&&p.version===e;return(0,g.jsxs)("li",{className:`history-row${f?" history-row--current":""}`,children:[(0,g.jsxs)("div",{className:"history-row-head",children:[(0,g.jsxs)("span",{className:"history-version",children:["v",p.version,f&&" (current)"]}),p.createdAt&&(0,g.jsx)("span",{className:"history-date",children:new Date(p.createdAt).toLocaleString()})]}),p.message&&(0,g.jsx)("div",{className:"history-message",children:p.message}),p.reason&&(0,g.jsxs)("div",{className:"history-reason",children:["reason: ",p.reason]}),(0,g.jsxs)("div",{className:"history-actions",children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>d(p.version),children:"View in new tab"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button primary",disabled:l!==null||f,onClick:()=>void u(p.version),children:l===p.version?"Reverting\u2026":"Revert to this"})]})]},p.version)})}),(0,g.jsx)("div",{className:"decompose-modal-actions",children:(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:n,disabled:l!==null,children:"Close"})})]})})}function RX({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 G_({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 NX(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)),(r.isAudio||r.isVideoElement)&&(e.muted?t.setAttribute("muted",""):t.removeAttribute("muted"),t.setAttribute("data-volume",Yt(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),OU(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`,W_(t,e.text,e.textBackgroundStyle,e.color,e.background,e.fontFamily,e.fontWeight))}function $_(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)),(r.isAudio||r.isVideoElement)&&("muted"in o&&(e.muted?t.setAttribute("muted",""):t.removeAttribute("muted")),"volume"in o&&t.setAttribute("data-volume",Yt(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),OU(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",W_(t,e.text,e.textBackgroundStyle,e.color,e.background,e.fontFamily,e.fontWeight))}function CX(t){return t?t.tag!=="audio"&&t.tag!=="video"&&t.tag!=="img"&&t.tag!=="image":!1}function p1(t){return!t||t.tag==="audio"?!1:(t.hfId||t.domId||t.id||t.key)!=="source-video"}function WU(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 l1(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 MX(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=p1(n),o=e.getAttribute("data-hf-id")||e.id||Mt(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 OX=(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||!p1(e)){c(null);return}let v=i(),h=o.current,b=v?.contentDocument,S=b?.querySelector("[data-composition-id]"),E=b?Bn(b,e):null;if(!v||!h||!ee(S)||!ee(E)){c(null);return}let R=v.getBoundingClientRect(),C=h.getBoundingClientRect(),I=r??WU(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();wm(h,e,R=>l1(R,v));let b=o.current;if(!h||!b)return;let S=h.getBoundingClientRect(),E=b.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 b=i(),S=b?.getBoundingClientRect().width??1,E=b?.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 b=(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=Ut(h.draft.x+b,0,100-h.draft.width),E.y=Ut(h.draft.y+S,0,100-h.draft.height)),h.mode==="left"||h.mode==="top-left"||h.mode==="bottom-left"){let R=Ut(h.draft.x+b,0,h.draft.x+h.draft.width-1);E.x=R,E.width=Ut(h.draft.width+(h.draft.x-R),1,100-R)}if((h.mode==="right"||h.mode==="top-right"||h.mode==="bottom-right")&&(E.width=Ut(h.draft.width+b,1,100-h.draft.x)),h.mode==="top"||h.mode==="top-left"||h.mode==="top-right"){let R=Ut(h.draft.y+S,0,h.draft.y+h.draft.height-1);E.y=R,E.height=Ut(h.draft.height+(h.draft.y-R),1,100-R)}if((h.mode==="bottom"||h.mode==="bottom-left"||h.mode==="bottom-right")&&(E.height=Ut(h.draft.height+S,1,100-h.draft.y)),CX(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}),DX=(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:b,onPublish:S,publishDisabled:E,publishLabel:R,templateId:C,forkId:I,publishVersion:L,originalUrl:P,songName:U,songUrl:O,onOpenShare:N,onOpenDecompose:W,onOpenHistory:X,decomposeDismissed:pt=!1,decomposeBusy:et=!1,onResumeDecompose:lt}){let H=n?Mt(n):null,ct=n?SU(r,n):null,Y=n?s1(r,n):null,dt=Y&&ct?o1(Y,ct):null,[K,yt]=(0,A.useState)(dt),[Jt,He]=(0,A.useState)(H),[Rn,yn]=(0,A.useState)(!1);(0,A.useEffect)(()=>{let $=dt?{...dt,...u?.updates,...p}:null;yt($),He(H);let jt=!F_($,dt);yn(!1),l({dirty:jt,commit:jt&&$?()=>We($):null})},[H,r,u,p,l]);let Q=(0,A.useRef)(null);if((0,A.useEffect)(()=>{Q.current=n&&H&&Jt===H&&K&&!F_(K,dt)?{key:H,commit:()=>Fd(K)}:null}),(0,A.useEffect)(()=>{let $=H;return()=>{let jt=Q.current;Q.current=null,jt&&$&&jt.key===$&&jt.commit()}},[H]),!n)return(0,g.jsx)(SX,{composition:e,onPublish:S,publishDisabled:E,publishLabel:R,templateId:C,forkId:I,publishVersion:L,originalUrl:P,songName:U,songUrl:O,onOpenShare:N,onOpenDecompose:W,onOpenHistory:X,decomposeDismissed:pt,decomposeBusy:et,onResumeDecompose:lt});let ut=Y??n,Bt=f1(ut),ne=Y_(r,ut)??Bt?.kind,Zt=YU(r,ut),ft=ut.tag==="audio"||ne==="audio",te=ut.tag==="video"||ne==="video",me=ut.tag==="img"||ut.tag==="image"||ne==="image",ze=ft||te||me,Ge=ut.tag==="video",bn=ft||Ge,Xn=Zt==="html"||ne==="shape"&&!!Bt?.customHtml,st=!ft,Ct=!ze&&!Xn,St=ct??SU(r,ut),ot=K??o1(ut,St),_t=!F_(ot,dt),gt=ot.volume;function Et($,jt){let Ir={isAudio:ft,isMedia:ze,isTextLike:Ct,isVisual:st,isVideoElement:Ge};a(ut,kr=>{$_(kr,$,ut,Ir,jt)})}function mt($){let jt={...K??o1(ut,St),...$};if(("start"in $||"duration"in $||"track"in $)&&!c(ut,{start:jt.start,duration:jt.duration,track:jt.track}))return;if("x"in $||"y"in $||"width"in $||"height"in $){let Ne={x:Ut(jt.x,0,Math.max(0,100-jt.width)),y:Ut(jt.y,0,Math.max(0,100-jt.height)),width:Ut(jt.width,1,100-jt.x),height:Ut(jt.height,1,100-jt.y)};jt.x=Ne.x,jt.y=Ne.y,jt.width=Ne.width,jt.height=Ne.height,d(ut,Ne)}("src"in $||"volume"in $||"muted"in $||"x"in $||"y"in $||"width"in $||"height"in $||"fontFamily"in $||"fontWeight"in $||"fontSize"in $||"textBackgroundStyle"in $||"background"in $||"color"in $||"text"in $||"italic"in $||"underline"in $||"radius"in $)&&Et(jt,$);let kr=!F_(jt,dt);yt(jt),l({dirty:kr,commit:kr?()=>We(jt):null})}function Qe($){i(ut,$)}function We($){let jt={isAudio:ft,isMedia:ze,isTextLike:Ct,isVisual:st,isVideoElement:Ge},Ir=xU($,dt),kr=$.start!==ut.start||$.duration!==ut.duration||$.track!==ut.track;try{if(kr){let{html:Ne}=VU(r,ut,{start:$.start,duration:$.duration,track:$.track});o(Zo(Ne,ut,Z_=>{$_(Z_,$,ut,jt,Ir)})),H&&f(H),H&&m(H);return}Qe(Ne=>{$_(Ne,$,ut,jt,Ir)}),H&&f(H),H&&m(H)}catch(Ne){Ar("editor.inspector-update-rejected",Ne instanceof Error?Ne.message:Ne)}}function Bm(){_t&&We(ot)}function Fd($){if(Jt!==H)return;let jt={isAudio:ft,isMedia:ze,isTextLike:Ct,isVisual:st,isVideoElement:Ge},Ir=xU($,dt),kr=["start","duration","track","x","y","width","height"];Number.isFinite(p?.fontSize)&&kr.push("fontSize");for(let Ne of kr)delete Ir[Ne];if(Object.keys(Ir).length!==0)try{Qe(Ne=>{$_(Ne,$,ut,jt,Ir)})}catch(Ne){Ar("editor.inspector-switch-commit-rejected",Ne instanceof Error?Ne.message:Ne)}}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:ut.tag}),_t?(0,g.jsxs)("div",{className:"panel-action-pair",children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>{if(dt){let $={isAudio:ft,isMedia:ze,isTextLike:Ct,isVisual:st,isVideoElement:Ge};a(ut,jt=>{NX(jt,dt,ut,$)})}yt(dt),H&&v(H),_(ut),l({dirty:!1,commit:null})},children:"Cancel"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button primary",onClick:()=>{Bm(),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:ut.label??ut.id}),(0,g.jsx)("p",{children:Bt?.viralNote??"Native timeline element."})]}),(0,g.jsxs)("article",{className:"inspector-identity",children:[(0,g.jsx)(RX,{id:ut.hfId??ut.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:ot.slug,onChange:$=>mt({slug:Q_($.target.value)})}),(0,g.jsx)("input",{className:"inspector-identity-input",type:"text",placeholder:"note \u2014 viral DNA reference",value:ot.note,onChange:$=>mt({note:$.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)(G_,{min:0,max:Math.max(0,b-ot.duration),value:ot.start,onCommit:$=>mt({start:$})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"End"}),(0,g.jsx)(G_,{min:.05,max:b,value:ot.start+ot.duration,onCommit:$=>mt({duration:Math.max(.05,$-ot.start)})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Dur"}),(0,g.jsx)(G_,{min:.05,max:Math.max(.05,b-ot.start),value:ot.duration,onCommit:$=>mt({duration:Math.max(.05,$)})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Layer"}),(0,g.jsx)(G_,{min:0,step:1,value:ot.track,onCommit:$=>mt({track:Math.max(0,Math.round($))})})]})]})]}),bn&&(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:ot.muted,onChange:$=>mt({muted:$.target.checked})})]}),(0,g.jsxs)("label",{className:"volume-row",children:[(0,g.jsxs)("span",{children:["Volume ",Math.round(gt*100),"%"]}),(0,g.jsx)("input",{type:"range",min:"0",max:"1",step:"0.01",value:gt,onChange:$=>mt({volume:Number($.target.value)})})]})]}),ze&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:ft?"Replace audio":te?"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:ot.src,onChange:$=>mt({src:$.target.value})})]}),!ft&&(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:ot.objectFit,onChange:$=>mt({objectFit:$.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:ot.objectPosition,onChange:$=>mt({objectPosition:$.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"})]})]})]})]}),Ct&&(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)(wX,{value:ot.text,onChange:$=>mt({text:$}),onCommit:()=>Fd(ot)})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Font"}),(0,g.jsx)(EX,{value:ot.fontFamily,onChange:$=>mt({fontFamily:$,fontWeight:ot.fontWeight>=600?Os($):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:ot.fontSize,onChange:$=>mt({fontSize:Number($.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:ot.fontWeight>=600,onChange:$=>mt({fontWeight:$.target.checked?Os(ot.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:ot.italic,onChange:$=>mt({italic:$.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:ot.underline,onChange:$=>mt({underline:$.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:ot.color.startsWith("#")?ot.color:"#ffffff",onChange:$=>mt({color:$.target.value})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Effect color"}),(0,g.jsx)("input",{type:"color",value:ot.background.startsWith("#")?ot.background:"#000000",onChange:$=>mt({background:$.target.value})})]})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Background"}),(0,g.jsx)(TX,{value:ot.textBackgroundStyle,color:ot.color,background:ot.background,onChange:$=>mt({textBackgroundStyle:$})})]})]}),st&&(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:ot.x,onChange:$=>mt({x:Number($.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:ot.y,onChange:$=>mt({y:Number($.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:ot.width,onChange:$=>mt({width:Number($.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:ot.height,onChange:$=>mt({height:Number($.target.value)})})]}),Ct&&(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:ot.radius,onChange:$=>mt({radius:Number($.target.value)})})]})})]})]}),(0,g.jsx)("div",{className:"inspector-danger-zone",children:Rn?(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:()=>yn(!1),children:"Cancel"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button danger",onClick:()=>{h(ut),s()},children:"Delete"})]}):(0,g.jsx)("button",{type:"button",className:"inspector-delete-button",disabled:ut.hfId==="source-video",onClick:()=>yn(!0),children:"Delete layer"})})]})}),Am={current:null},Im={current:null},km={current:[]};function LX(t){if(Im.current){Im.current.onExportComplete(t);return}km.current.some(n=>n.url===t.url&&n.renderId===t.renderId)||km.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 UX(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(`
|
|
1144
|
+
|
|
1145
|
+
`);o=s.pop()??"";for(let l of s)for(let c of l.split(`
|
|
1146
|
+
`)){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 KU(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 BX(t){let n=Lm()?.vidfarmApiKey??null;if(!n)throw new Error("Sign in required to upload media from your computer.");let r=await KU({file:t,apiKey:n});return{url:r.viewUrl,contentType:r.contentType,fileName:r.fileName}}function PX(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 zX(t){return t.replace(/\/$/,"")}function AU(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 FX({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)([]),b=(0,A.useRef)(Kl("thread")),S=(0,A.useRef)(null),E=(0,A.useRef)(null),R=(0,A.useRef)(0),C=t?.vidfarmApiKey??null,I=t?.editorChatApiUrl?.trim()||"/api/v1/editor-chat",L=zX(I),P=t?.compositionId??e.templateId;(0,A.useEffect)(()=>{if(!C)return;let Q=!1;return(async()=>{try{let ut=new URLSearchParams({template_id:P??"",include_messages:"true",limit:"50"}),Bt=await fetch(`${L}/threads?${ut.toString()}`,{headers:{"vidfarm-api-key":C}});if(!Bt.ok)return;let ne=await Bt.json().catch(()=>null);if(Q||!Array.isArray(ne?.threads))return;let Zt=ne.threads.filter(ft=>!!ft&&typeof ft=="object").map(ft=>({id:String(ft.id??""),title:String(ft.title??"Chat"),templateId:String(ft.templateId??P),updatedAt:String(ft.updatedAt??""),lastMessageAt:typeof ft.lastMessageAt=="string"?ft.lastMessageAt:null,messageCount:typeof ft.messageCount=="number"?ft.messageCount:0,messages:Array.isArray(ft.messages)?ft.messages:[]})).filter(ft=>ft.id);if(Q)return;if(h(Zt),Zt.length>0){let ft=Zt[0];b.current=ft.id,r(AU(ft.messages))}}catch{}})(),()=>{Q=!0}},[C,L,P]);let U=(0,A.useCallback)(Q=>{b.current=Q.id,r(AU(Q.messages)),_(!1),c(null)},[]),O=(0,A.useCallback)(()=>{b.current=Kl("thread"),r([]),_(!1),c(null)},[]);(0,A.useEffect)(()=>{let Q=S.current;Q&&(Q.scrollTop=Q.scrollHeight)},[n]),(0,A.useEffect)(()=>{let Q={onExportComplete:ut=>{r(Bt=>{if(Bt.some(te=>te.role==="assistant"&&te.status==="complete"&&typeof te.text=="string"&&te.text.includes(ut.url)))return Bt;let Zt=ut.title?`"${ut.title}" `:"",ft={id:Kl("assistant"),role:"assistant",text:`Render ${Zt}finished. Rendered MP4: ${ut.url}
|
|
1147
|
+
|
|
1148
|
+
Say "approve it" to publish this MP4 as an approved post.`,toolExchanges:[],status:"complete"};return[...Bt,ft]})}};if(Im.current=Q,km.current.length>0){let ut=km.current.slice();km.current=[];for(let Bt of ut)Q.onExportComplete(Bt)}return()=>{Im.current===Q&&(Im.current=null)}},[]);let N=(0,A.useCallback)((Q,ut)=>{r(Bt=>Bt.map(ne=>ne.id===Q?ut(ne):ne))},[]),W=(0,A.useCallback)(async Q=>{if(!C||Q.length===0)return;let ut=Q.map(Bt=>({id:Kl("user").replace("user-","att-"),fileName:Bt.name,contentType:Bt.type||"application/octet-stream",viewUrl:"",sizeBytes:Bt.size,status:"uploading"}));u(Bt=>[...Bt,...ut]);for(let Bt=0;Bt<Q.length;Bt+=1){let ne=Q[Bt],Zt=ut[Bt];try{let ft=await KU({file:ne,apiKey:C});u(te=>te.map(me=>me.id===Zt.id?{...ft,status:"ready"}:me))}catch(ft){let te=ft instanceof Error?ft.message:String(ft);u(me=>me.map(ze=>ze.id===Zt.id?{...ze,status:"error",error:te}:ze))}}},[C]),X=(0,A.useCallback)(()=>{E.current?.click()},[]),pt=(0,A.useCallback)(Q=>{let ut=Q.target.files?Array.from(Q.target.files):[];Q.target.value="",ut.length>0&&W(ut)},[W]),et=(0,A.useCallback)(Q=>{u(ut=>ut.filter(Bt=>Bt.id!==Q))},[]),lt=(0,A.useCallback)(Q=>{if(!C)return;let ut=Q.clipboardData?.items?Array.from(Q.clipboardData.items):[],Bt=[];for(let ne of ut)if(ne.kind==="file"){let Zt=ne.getAsFile();Zt&&Bt.push(Zt)}Bt.length>0&&(Q.preventDefault(),W(Bt))},[C,W]),H=(0,A.useCallback)(Q=>{C&&Q.dataTransfer?.types?.includes("Files")&&(Q.preventDefault(),R.current+=1,f(!0))},[C]),ct=(0,A.useCallback)(Q=>{C&&Q.dataTransfer?.types?.includes("Files")&&(Q.preventDefault(),Q.dataTransfer.dropEffect="copy")},[C]),Y=(0,A.useCallback)(Q=>{C&&(Q.preventDefault(),R.current=Math.max(0,R.current-1),R.current===0&&f(!1))},[C]),dt=(0,A.useCallback)(Q=>{if(!C)return;Q.preventDefault(),R.current=0,f(!1);let ut=Q.dataTransfer?.files?Array.from(Q.dataTransfer.files):[];ut.length>0&&W(ut)},[C,W]),K=(0,A.useCallback)(async()=>{let Q=o.trim(),ut=d.filter(gt=>gt.status==="ready");if(d.filter(gt=>gt.status==="uploading").length>0){c("Waiting for uploads to finish...");return}if(!Q&&ut.length===0||a)return;if(!C){c("Sign in required to chat.");return}let ne=ut.map(({status:gt,error:Et,...mt})=>mt),Zt={id:Kl("user"),role:"user",text:Q,attachments:ne,toolExchanges:[],status:"complete"},ft={id:Kl("assistant"),role:"assistant",text:"",toolExchanges:[],status:"pending"},te=n;r(gt=>[...gt,Zt,ft]),i(""),u(gt=>gt.filter(Et=>Et.status!=="ready")),s(!0),c("Sending...");let me=t?.compositionId??e.id,ze=t?.slugId??e.id,Ge=t?.title??e.title,bn=e.summary??"",Xn=Am.current?.getSnapshot(),st=ne.length>0?[`
|
|
1149
|
+
|
|
1150
|
+
<attachments>`,...ne.map(gt=>`- ${gt.fileName} (${gt.contentType}): ${gt.viewUrl}`),"</attachments>"].join(`
|
|
1151
|
+
`):"",Ct=Xn?`${Q}${st}
|
|
1152
|
+
|
|
1153
|
+
<editor_context>
|
|
1154
|
+
${JSON.stringify(Xn,null,2)}
|
|
1155
|
+
</editor_context>`:`${Q}${st}`,St=gt=>{let Et=[];gt.text.trim()&&Et.push({type:"text",text:gt.text});for(let mt of gt.attachments??[])Et.push({type:"file",data:mt.viewUrl,mediaType:mt.contentType});return Et},ot=[...te.filter(gt=>gt.text.trim().length>0||(gt.attachments?.length??0)>0).map(gt=>({role:gt.role,content:St(gt)})),{role:"user",content:[{type:"text",text:Ct},...ne.map(gt=>({type:"file",data:gt.viewUrl,mediaType:gt.contentType}))]}],_t={template:{page:"docs",tracerId:null,tracers:[],defaultRequestTracer:null,templateId:me,templateSlug:ze,templateTitle:Ge,templateDescription:bn,docsRoutes:[]},messages:ot,thread_id:b.current,thread_template_id:me,thread_title:Ge,thread_tracers:[],user_message:{id:Zt.id,role:"user",text:Ct,attachments:ne.map(gt=>({id:gt.id,fileName:gt.fileName,contentType:gt.contentType,viewUrl:gt.viewUrl}))},assistant_message:{id:ft.id}};try{let gt=await fetch(I,{method:"POST",headers:{"content-type":"application/json","vidfarm-api-key":C},body:JSON.stringify(_t)});if(!gt.ok){let Et=await gt.text().catch(()=>gt.statusText);throw new Error(Et||`HTTP ${gt.status}`)}N(ft.id,Et=>({...Et,status:"streaming"})),await UX(gt,{onDelta:Et=>{N(ft.id,mt=>({...mt,text:mt.text+Et}))},onStatus:Et=>c(Et),onToolCall:Et=>{N(ft.id,mt=>({...mt,toolExchanges:[...mt.toolExchanges,{toolCallId:Et.toolCallId,toolName:Et.toolName,args:Et.args,status:"pending"}]}))},onToolResult:Et=>{let mt=null;if(Et.toolName==="editor_action"){let Qe=aJ(Et.result);if(Qe&&Am.current)try{mt=Am.current.applyAction(Qe)}catch(We){mt={ok:!1,error:We instanceof Error?We.message:String(We)}}else Qe&&(mt={ok:!1,error:"Editor not ready to apply action."})}N(ft.id,Qe=>({...Qe,toolExchanges:Qe.toolExchanges.map(We=>We.toolCallId===Et.toolCallId?{...We,result:Et.result,status:"complete",appliedSummary:mt?.ok?mt.summary:void 0,appliedError:mt&&!mt.ok?mt.error:void 0}:We)}))},onError:Et=>{N(ft.id,mt=>({...mt,status:"error",error:Et}))}}),N(ft.id,Et=>Et.status==="error"?Et:{...Et,status:"complete"}),c(null)}catch(gt){let Et=gt instanceof Error?gt.message:String(gt);N(ft.id,mt=>({...mt,status:"error",error:Et})),c(`Error: ${Et}`)}finally{s(!1)}},[C,t,e,o,a,n,d,N]),yt=(0,A.useCallback)(Q=>{Q.preventDefault(),K()},[K]),Jt=(0,A.useCallback)(Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),K())},[K]),He=d.filter(Q=>Q.status==="uploading").length,Rn=d.filter(Q=>Q.status==="ready").length,yn=!!C&&!a&&He===0&&(o.trim().length>0||Rn>0);return(0,g.jsxs)("aside",{className:`chat-workspace${p?" chat-workspace--drag":""}`,"aria-label":"Creative chat",onDragEnter:H,onDragOver:ct,onDragLeave:Y,onDrop:dt,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:()=>_(Q=>!Q),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:O,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(Q=>(0,g.jsx)("li",{children:(0,g.jsxs)("button",{type:"button",className:"chat-thread-history-item","data-active":Q.id===b.current?"true":"false",onClick:()=>U(Q),children:[(0,g.jsx)("span",{className:"chat-thread-history-title",children:Q.title||"Untitled chat"}),(0,g.jsxs)("span",{className:"chat-thread-history-meta",children:[Q.messageCount," message",Q.messageCount===1?"":"s"]})]})},Q.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(Q=>(0,g.jsx)($X,{message:Q},Q.id)),l&&!m&&(0,g.jsx)("div",{className:"chat-status",children:l})]}),(0,g.jsxs)("form",{className:"chat-composer",onSubmit:yt,hidden:m,children:[d.length>0&&(0,g.jsx)("div",{className:"chat-composer-attachments",children:d.map(Q=>(0,g.jsx)(HX,{attachment:Q,onRemove:()=>et(Q.id)},Q.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:Q=>i(Q.target.value),onKeyDown:Jt,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:X,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:!yn,"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:pt}),p&&(0,g.jsx)("div",{className:"chat-composer-drop-hint","aria-hidden":"true",children:"Drop files to attach"})]})]})}function HX({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 XU(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function i1(t){let e=XU(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 GX(t){let e=t.replace(/\r\n/g,`
|
|
1156
|
+
`).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>${XU(l)}</code></pre>`}let i=o.split(`
|
|
1157
|
+
`);return i.every(l=>/^[-*]\s+/.test(l.trim()))?`<ul>${i.map(c=>c.trim().replace(/^[-*]\s+/,"")).map(c=>`<li>${i1(c)}</li>`).join("")}</ul>`:i.every(l=>/^\d+\.\s+/.test(l.trim()))?`<ol>${i.map(c=>c.trim().replace(/^\d+\.\s+/,"")).map(c=>`<li>${i1(c)}</li>`).join("")}</ol>`:`<p>${i.map(l=>i1(l.trim())).join("<br />")}</p>`}).filter(Boolean).join(""):""}function $X({message:t}){let e=t.text.trim().length>0,n=e?GX(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)(jX,{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 jX({exchange:t}){let e=t.args?qX(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:sJ(t.result)})]})}function qX(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 JU(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||Mt(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 VX(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 YX(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 WX(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,b=h?.style,S=h?.getAttribute("data-layer-kind")??void 0,E=h?.getAttribute("data-vf-timeline-proxy")==="video",R=Y=>{if(!Y)return;let dt=Y.match(/(-?\d+(?:\.\d+)?)\s*%/);return dt?Number(dt[1]):void 0},C=R(b?.left),I=R(b?.top),L=R(b?.width),P=R(b?.height),U=E||C!==void 0&&I!==void 0&&L!==void 0&&P!==void 0&&C<=.5&&I<=.5&&L>=99.5&&P>=99.5,O=h?.getAttribute("src")??void 0,N=h?.getAttribute("data-volume"),W=N&&Number.isFinite(Number(N))?Number(N):void 0,X=b?.color||void 0,pt=b?.background||void 0,et=h?.getAttribute("data-hf-id")??v.hfId??v.id,lt=h?.getAttribute("data-hf-slug")??void 0,H=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:Mt(v),element_id:et??void 0,slug:lt,note:H,label:v.label,kind:S,tag:v.tag,is_timeline_proxy:E||void 0,is_full_canvas:U||void 0,src:O,start:v.start,duration:v.duration,track:v.track,playback_start:v.playbackStart,x:C,y:I,width:L,height:P,volume:W,color:X,background:pt}}),s=t.composition.width,l=t.composition.height,c=Number.isFinite(t.activeCompositionDuration)?t.activeCompositionDuration:0,d=YX(i,c),u=[];if(n)for(let v of Array.from(n.querySelectorAll("[data-vf-gen-media]"))){if(!ee(v))continue;let h=v.getAttribute("data-vf-gen-media"),b=h==="image"?"image":h==="video"?"video":null;if(!b)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:b,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=jU(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:VX(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 IU(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 KX(t,e,n);if(t.action_type==="generate_layer")return XX(t,e,n);if(t.action_type==="group_layers")return oJ(t,e,n);if(t.action_type==="ungroup_layers")return iJ(t,e,n);let r=t.layer_key;if(!r)return{ok:!1,error:`layer_key required for ${t.action_type}.`};let o=JU(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=Q_(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}=Io(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=Um(d,{start:a,duration:s,track:l},new Set(c?[c]:[]));u!==l&&(i.track=u)}try{let{html:a,resolvedCollisions:s}=VU(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 tJ(t,e,n,o);if(t.action_type==="set_layer_style")return eJ(t,e,n,o);if(t.action_type==="duplicate_layer")return nJ(t,e,n,o);if(t.action_type==="split_layer")return rJ(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 KX(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=Ut(t.x??d.x,0,100),p=Ut(t.y??d.y,0,100),f=Ut(t.width??d.width,0,100),m=Ut(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)}`,b=t.label?.trim()||(r==="text"?"New text":r==="html"?"Custom HTML":`New ${r}`);try{let{html:S,resolvedCollisions:E}=Io(n,R=>{let C=R.querySelector("[data-composition-id]");if(!ee(C))throw new Error("Composition root not found.");let I=Array.from(R.querySelectorAll("[data-start]")).filter(X=>ee(X)),L=t.track,P=I.reduce((X,pt)=>{let et=Number(pt.getAttribute("data-track-index")??0);return Number.isFinite(et)?Math.max(X,et+1):X},0),U=Number.isFinite(L)&&L!==void 0?Math.max(0,Math.floor(L)):P,O=Um(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 W=r==="text"?"caption":r;if(N.setAttribute("data-layer-kind",W),N.setAttribute("data-viral-note",`AI inserted ${r} layer.`),N.setAttribute("data-start",Yt(a)),N.setAttribute("data-duration",Yt(c)),N.setAttribute("data-end",Yt(a+c)),N.setAttribute("data-track-index",String(O)),N.setAttribute("data-label",b),N.classList.add("clip"),t.slug){let X=Q_(t.slug);X&&N.setAttribute("data-hf-slug",X)}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(O),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 pt=Yt(t.playback_start??0);N.setAttribute("data-media-start",pt),N.setAttribute("data-playback-start",pt),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);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 X=Yt(t.playback_start);N.setAttribute("data-media-start",X),N.setAttribute("data-playback-start",X)}}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",W_(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 kU="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 XX(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 W=(t.replace_layer_key||t.layer_key||"").trim();if(!W)return{ok:!1,error:"generate_layer intent=replace_layer requires replace_layer_key (the layer to replace)."};let X=JU(e,n,W);if(!X)return{ok:!1,error:`generate_layer: layer to replace not found: ${W}`};f=X;let pt=new DOMParser().parseFromString(n,"text/html"),et=Bn(pt,X),lt=et?et.getAttribute("data-vf-timeline-proxy")!==null||et.getAttribute("data-vf-full-canvas")==="true"||et.style.width==="100%"&&et.style.height==="100%":!1;if(a===void 0&&(a=X.start),s===void 0&&(s=X.duration>0?X.duration:void 0),l===void 0&&(l=X.track),lt)c=0,d=0,u=100,p=100;else if(et){let H=ct=>{let Y=Number.parseFloat(ct);return Number.isFinite(Y)?Y:void 0};c===void 0&&(c=H(et.style.left)),d===void 0&&(d=H(et.style.top)),u===void 0&&(u=H(et.style.width)),p===void 0&&(p=H(et.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}`,b=e.activeCompositionDuration>0?e.activeCompositionDuration:0,S=a??0,E=Math.max(0,b>0?Math.min(b-.1,S):S),R=b>0?Math.max(.1,b-E):4,C=s??Math.min(r==="video"?t.gen_duration??4:4,R),I=Math.max(.1,b>0?Math.min(C,R):C),L=Ut(c??0,0,100),P=Ut(d??0,0,100),U=Ut(u??100,0,100),O=Ut(p??100,0,100),N=o.length>140?`${o.slice(0,137)}\u2026`:o;try{let{html:W,resolvedCollisions:X}=Io(n,et=>{let lt=et.querySelector("[data-composition-id]");if(!ee(lt))throw new Error("Composition root not found.");if(f){let yt=Bn(et,f);yt?.parentNode&&yt.parentNode.removeChild(yt)}let H=l,ct=Array.from(et.querySelectorAll("[data-start]")).reduce((yt,Jt)=>{let He=Number(Jt.getAttribute("data-track-index")??0);return Number.isFinite(He)?Math.max(yt,He+1):yt},0),Y=Number.isFinite(H)&&H!==void 0?Math.max(0,Math.floor(H)):ct,dt=Um(et,{start:E,duration:I,track:Y},new Set([h])),K=r==="video"?et.createElement("video"):et.createElement("img");if(K.id=h,K.setAttribute("data-hf-id",h),K.setAttribute("data-layer-mode","publish"),K.setAttribute("data-layer-kind",r),K.setAttribute("data-viral-note",`AI generating ${r}: ${N}`),K.setAttribute("data-start",Yt(E)),K.setAttribute("data-duration",Yt(I)),K.setAttribute("data-end",Yt(E+I)),K.setAttribute("data-track-index",String(dt)),K.setAttribute("data-label",`Generating ${r}\u2026`),K.classList.add("clip"),t.slug){let yt=Q_(t.slug);yt&&K.setAttribute("data-hf-slug",yt)}K.setAttribute("data-vf-gen","1"),K.setAttribute("data-vf-gen-media",r),K.setAttribute("data-vf-gen-status","submitting"),K.setAttribute("data-vf-gen-prompt",N),K.style.position="absolute",K.style.left=`${L}%`,K.style.top=`${P}%`,K.style.width=`${U}%`,K.style.height=`${O}%`,K.style.zIndex=String(dt),K.style.overflow="hidden",K.style.objectFit=t.object_fit??"cover",K.style.background="#0c0f0a",r==="video"?(K.setAttribute("poster",kU),K.setAttribute("playsinline",""),K.setAttribute("preload","auto"),K.setAttribute("muted",""),K.setAttribute("data-volume","1"),K.setAttribute("data-media-start","0"),K.setAttribute("data-playback-start","0")):K.setAttribute("src",kU),lt.append(K)});e.patchCompositionHtml(W),JX({deps:e,genId:h,mediaType:r,prompt:o,action:t});let pt=i==="replace_layer"?`replacing ${m}`:`at ${E.toFixed(2)}s`;return{ok:!0,summary:Zl(`Started ${r} generation (${pt}). A placeholder is on the timeline as ${v}; it will swap to the finished media automatically. Watch editor_context.pending_generations.`,X)}}catch(W){return{ok:!1,error:W instanceof Error?W.message:String(W)}}}function Rm(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 ee(a)?(n(a),t.patchCompositionHtml(K_(i)),!0):!1}async function JX(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})`;Rm(e,n,h=>{h.setAttribute("data-vf-gen-status","error"),h.setAttribute("data-vf-gen-error",v.slice(0,200))});return}Rm(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){Rm(e,n,_=>{_.setAttribute("data-vf-gen-status","error"),_.setAttribute("data-vf-gen-error",(m instanceof Error?m.message:String(m)).slice(0,200))})}}function QX(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 ZX(t,e,n){return Rm(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 tJ(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=Yt(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}`))});return o.length===0?{ok:!1,error:"set_layer_media needs at least one of src, volume, muted, playback_start, object_fit, or object_position."}: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 eJ(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 nJ(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}=Io(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",Yt(t.start)),t.duration!==void 0&&u.setAttribute("data-duration",Yt(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,_=Um(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 rJ(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=Yt(p+d),m=s.getAttribute("data-layer-kind")??"layer";s.setAttribute("data-duration",Yt(d));let _=s.cloneNode(!0);_.id=i,_.setAttribute("data-hf-id",i),_.setAttribute("data-start",Yt(o)),_.setAttribute("data-duration",Yt(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 oJ(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=>Mt(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}=Io(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 iJ(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=>Mt(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}=Io(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)}"]`)))ee(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 aJ(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"),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 sJ(t){try{return JSON.stringify(t,null,2)}catch{return String(t)}}function lJ({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;It("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;Ao("preview.video.error",{id:t.id,currentSrc:o.currentSrc,errorCode:o.error?.code,errorMessage:o.error?.message})}})})})}function cJ({onEdit:t}){return(0,g.jsx)("div",{className:"preview-feed","aria-label":"Preview output",children:Om.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:()=>{It("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)(lJ,{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:u1(e).map(r=>(0,g.jsxs)("article",{className:"markdown-layer-row",children:[(0,g.jsx)("span",{children:rX(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:[V_(r.start)," - ",V_(r.start+r.duration)]})]},r.id))})]})]})]})]},e.id)})})}function uJ({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)(()=>HU(e),[e]),u=(0,A.useRef)(null);(0,A.useEffect)(()=>{let f=!0;return It("editor.studio-import-start"),j_().then(m=>{It("editor.studio-import-success",{exports:Object.keys(m).sort()}),f&&r(m)}).catch(m=>{Ao("editor.studio-import-error",m instanceof Error?m.stack:m),f&&i(m instanceof Error?m.message:String(m))}),()=>{f=!1,It("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)(dJ,{studio:n,onPreview:t,composition:e,initialCompositionHtml:l,forkId:a,ensureFork:p,replaceForkId:s})}function dJ({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=PU(n),[m,_]=(0,A.useState)(()=>r),v=(0,A.useMemo)(()=>{let y=jU(m);return y?{...n,viralDna:y}:n},[n,m]),h=(0,A.useRef)(m),[b,S]=(0,A.useState)(0),[E,R]=(0,A.useState)(!0),[C,I]=(0,A.useState)("1"),[L,P]=(0,A.useState)(null),[U,O]=(0,A.useState)(null),N=(0,A.useRef)(null),W=(0,A.useRef)(null),[X,pt]=(0,A.useState)(null),[et,lt]=(0,A.useState)(()=>new Map),[H,ct]=(0,A.useState)(()=>new Map),[Y,dt]=(0,A.useState)(null),[K,yt]=(0,A.useState)(null),[Jt,He]=(0,A.useState)(!1),[Rn,yn]=(0,A.useState)(!1),[Q,ut]=(0,A.useState)(null);(0,A.useEffect)(()=>{if(!o){ut(null);return}let y=!0;return fetch(`/api/v1/compositions/${encodeURIComponent(o)}`).then(T=>T.ok?T.json():null).then(T=>{if(!y||!T)return;let x=Number(T.latest_version);Number.isFinite(x)&&ut(x)}).catch(()=>{}),()=>{y=!1}},[o,Y?.version]);let[Bt,ne]=(0,A.useState)(0),[Zt,ft]=(0,A.useState)(!1),te=(0,A.useRef)(null),me=(0,A.useRef)(null),ze=(0,A.useRef)(null),Ge=(0,A.useRef)(null),bn=(0,A.useRef)(null),Xn=(0,A.useRef)(null),st=(0,A.useRef)(0),Ct=(0,A.useRef)(0),St=(0,A.useRef)(-1),ot=(0,A.useRef)(null),_t=(0,A.useRef)(!1),gt=(0,A.useRef)([]),Et=(0,A.useRef)([]),mt=(0,A.useRef)(null),Qe=(0,A.useRef)({timing:()=>{},visual:()=>{},flushAll:()=>{}}),We=(0,A.useRef)(null),Bm=(0,A.useRef)(!1),Fd=(0,A.useRef)(!1),$=(0,A.useRef)(null),jt=(0,A.useRef)({active:!1,pendingBody:null,pendingRevBump:!1});(0,A.useEffect)(()=>{let y=`comp:${n.id}`;$.current!==y&&mX(m)&&($.current=y,yt({mode:"initial",dismissed:!1,busy:!1,finished:!1,error:null,scenesCreated:null,ghostcutStatus:null,ghostcutProgress:null,userPrompt:""}))},[n.id,m]);let Ir=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||Ir.current===o)return;Ir.current=o;let y=!1;return(async()=>{let T=Date.now(),x=900*1e3;for(await new Promise(k=>setTimeout(k,3e3));!y&&Date.now()-T<x;){try{let k=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/ghostcut-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),D=await k.json().catch(()=>({}));if(!k.ok||D?.ok===!1){await new Promise(G=>setTimeout(G,8e3));continue}let M=D.status??"none";if(M==="none"||M==="failed")return;if(M==="pending"&&yt(G=>G&&{...G,ghostcutStatus:"pending"}),M==="done"){D.swap_applied&&typeof window<"u"&&window.location.reload();return}}catch{}await new Promise(k=>setTimeout(k,2e4))}})(),()=>{y=!0,Ir.current=null}},[o]);let kr=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||kr.current===o)return;kr.current=o;let y=!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)&&(f0.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 D=await T();if(!(D==="none"||D==="done"||D==="failed"))for(;!y&&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({})}),G=await M.json().catch(()=>({}));if(!M.ok||G?.ok===!1){await new Promise(it=>setTimeout(it,6e3));continue}await T();let q=G.status??"none";if(q==="none"||q==="done"||q==="failed")return}catch{}await new Promise(M=>setTimeout(M,4e3))}})(),()=>{y=!0,kr.current=null}},[o]);let Ne=(0,A.useCallback)(async()=>{yt(k=>k&&{...k,busy:!0,error:null});let y=K?.userPrompt?.trim()??"",T=async k=>{let D=await fetch(`/api/v1/compositions/${encodeURIComponent(k)}/auto-decompose`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(y?{user_prompt:y}:{})}),M=await D.json().catch(()=>({}));return{response:D,data:M}},x=async k=>{let D=Date.now(),M=600*1e3;for(;Date.now()-D<M;){await new Promise(G=>setTimeout(G,2e4));try{let G=await fetch(`/api/v1/compositions/${encodeURIComponent(k)}/ghostcut-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),q=await G.json().catch(()=>({}));if(!G.ok||q?.ok===!1)continue;let it=q.status??"none",J=typeof q.progress=="number"?q.progress:null;if(yt(vt=>vt&&{...vt,ghostcutStatus:it,ghostcutProgress:J}),it==="done"||it==="failed"||it==="none")return}catch{}}};try{let k=o??await i(),{response:D,data:M}=await T(k);if(D.status===404||/fork not found/i.test(M?.error||"")){let J=await fetch("/api/v1/compositions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:n.id,title:n.title})}),vt=await J.json().catch(()=>({}));if(!J.ok||!vt?.fork_id)throw new Error(vt?.error||`Fork creation failed (${J.status})`);if(k=vt.fork_id,a(k),typeof window<"u"){let Tt=new URL(window.location.href);Tt.searchParams.set("fork",k),window.history.replaceState(null,"",Tt)}({response:D,data:M}=await T(k))}if(!D.ok||!M?.ok)throw new Error(M?.error||`Decompose failed (${D.status})`);let q=typeof M.scene_count=="number"&&Number.isFinite(M.scene_count)?M.scene_count:null,it=M.ghostcut_pending?"pending":"none";yt(J=>J&&{...J,busy:!1,finished:!0,error:null,scenesCreated:q,ghostcutStatus:it,ghostcutProgress:null}),M.ghostcut_pending&&x(k)}catch(k){let D=k instanceof Error?k.message:String(k);yt(M=>M&&{...M,busy:!1,error:D})}},[i,o,n.id,n.title,a,K?.userPrompt]),Z_=(0,A.useCallback)(()=>{yt(null),typeof window<"u"&&window.location.reload()},[]),t6=(0,A.useCallback)(()=>{yt(null)},[]),e6=(0,A.useCallback)(()=>{yt(y=>y&&{...y,dismissed:!0})},[]),n6=(0,A.useCallback)(()=>{yt(y=>y&&{...y,dismissed:!1})},[]),r6=(0,A.useCallback)(async()=>{try{o||await i()}catch{}yt({mode:"redo",dismissed:!1,busy:!1,finished:!1,error:null,scenesCreated:null,ghostcutStatus:null,ghostcutProgress:null,userPrompt:""})},[i,o]),o6=(0,A.useCallback)(async()=>{if(!o)try{await i()}catch{}He(!0)},[i,o]),i6=(0,A.useCallback)(()=>{o&&yn(!0)},[o]),a6=(0,A.useCallback)(()=>{yn(!1),typeof window<"u"&&window.location.reload()},[]),g1=o?`/composition/current.html?fork=${encodeURIComponent(o)}&rev=${b}`:`/composition/current.html?composition=${encodeURIComponent(n.id)}&rev=${b}`,{iframeRef:Pm,onIframeLoad:s6,resetPlayer:h1}=p(),tc=u(y=>y.selectedElementId),t0=u(y=>y.selectedElementIds),ec=u(y=>y.elements),y1=u(y=>y.timelineReady),l6=u(y=>y.isPlaying),ko=(0,A.useMemo)(()=>ec.map(y=>{let T=Mt(y);return wU(y,et.get(T))}),[ec,et]),b1=(0,A.useMemo)(()=>t1(ko),[ko]),e0=b1.length>0&&y1,[c6,u6]=(0,A.useState)(0),[d6,f6]=(0,A.useState)(0);(0,A.useEffect)(()=>{if(!e0)return;let y=ze.current?.querySelector('[aria-label="Timeline"]'),T=y?.firstElementChild instanceof HTMLElement?y.firstElementChild:null;if(!T)return;let x=()=>{u6(T.scrollTop),f6(T.scrollLeft)};return x(),T.addEventListener("scroll",x,{passive:!0}),()=>T.removeEventListener("scroll",x)},[e0]);let _n=ko.find(y=>Mt(y)===tc)??null,p6=_n?et.get(Mt(_n)):void 0,_1=_n?H.get(Mt(_n))?.frame:void 0,m6=Bt>=0&>.current.length>0,g6=Bt>=0&&Et.current.length>0,nc=Y?.phase==="starting"||Y?.phase==="running",h6=nc?"Rendering":"Render",zm=(0,A.useMemo)(()=>new Set([...tc?[tc]:[],...Array.from(t0)]),[tc,t0]),y6=(0,A.useMemo)(()=>{if(zm.size===0)return!1;let y=X_(m);return ec.some(T=>zm.has(Mt(T))&&bU(y,T))},[m,ec,zm]),vn=(0,A.useCallback)(()=>{cancelAnimationFrame(st.current),st.current=0,Ct.current=0,St.current=-1},[]);(0,A.useEffect)(()=>{if(!Bm.current){Bm.current=!0;return}h1(),vn(),R(!0),I("1"),P(null),O(null),lt(new Map),ct(new Map),dt(null),ft(!1),gt.current=[],Et.current=[],mt.current=null,ot.current=null,_t.current=!1,Ge.current=null,bn.current=null;let y=HU(n);h.current=y,_(y),S(T=>T+1),ne(T=>T+1)},[n.id,n,h1,vn]);let rc=(0,A.useCallback)(()=>{ne(y=>y+1)},[]),oc=(0,A.useCallback)(()=>{let y=u.getState();return{html:h.current,time:y.currentTime,selectedElementId:y.selectedElementId,selectedElementIds:Array.from(y.selectedElementIds)}},[u]),or=(0,A.useCallback)(y=>{let T=gt.current,x=Date.now(),k=mt.current;mt.current=y?{key:y,at:x}:null;let D=oc();!!!(y&&k&&k.key===y&&x-k.at<1200&&T.length>0)&&T[T.length-1]?.html!==D.html&&(gt.current=[...T.slice(-49),D]),Et.current=[],rc()},[rc,oc]),Rt=(0,A.useCallback)(()=>{let y=d(Xn.current);return y?(Pm.current=y,y):Pm.current},[Pm,d]),v1=(0,A.useCallback)(y=>{if(!y)return Rt();for(let T of Array.from(document.querySelectorAll("iframe")))if(T.contentWindow===y)return T;return Rt()},[Rt]),S1=(0,A.useCallback)((y,T)=>{let x=Rt()?.getBoundingClientRect(),k=me.current?.getBoundingClientRect(),D=x&&x.width>1&&x.height>1?x:k;if(!D)return{x:12,y:70,width:42,height:12};let M=(y-D.left)/Math.max(1,D.width)*100,G=(T-D.top)/Math.max(1,D.height)*100,q=Ut(M,0,95),it=Ut(G,0,95);return{x:q,y:it,width:Ut(42,1,100-q),height:Ut(12,1,100-it)}},[Rt]),Fm=(0,A.useCallback)(y=>{P(null),O(y)},[]),b6=(0,A.useCallback)(y=>{let T=y.target;if(T instanceof Element&&T.closest("button,input,textarea,select,a"))return;y.preventDefault(),y.stopPropagation();let x=u.getState();x.clearSelectedElementIds(),x.setSelectedElementId(null),Fm({x:y.clientX,y:y.clientY,time:x.currentTime,frame:S1(y.clientX,y.clientY),elementId:null}),It("editor.preview-stage-context-menu",{x:y.clientX,y:y.clientY,time:x.currentTime})},[S1,Fm,u]),_6=(0,A.useCallback)(y=>{if(y.button!==0)return;let T=y.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(),O(null),It("editor.preview-blank-unselect")},[u]),n0=(0,A.useCallback)(()=>{let y=Cs(Rt());if(!y)return;let T=y.getTime(),x=y.getDuration(),k=x>0&&T>=x,D=y.isPlaying()&&!k,M=performance.now();if((!D||M-Ct.current>=66||Math.abs(T-St.current)>=.25)&&(Ct.current=M,St.current=T,u.getState().setCurrentTime(T)),!D){u.getState().setIsPlaying(!1),vn();return}st.current=requestAnimationFrame(n0)},[Rt,vn]),ic=(0,A.useCallback)(()=>{vn(),st.current=requestAnimationFrame(n0)},[vn,n0]),Hd=(0,A.useCallback)(y=>{let T=EU(y);I(String(Number(T.toFixed(2))));let x=Rt(),k=Cs(x);return k?.setPlaybackRate?.(T),u.getState().audioMuted||(k?.setMuted?.(!1),TU(x,"set-muted",{muted:!1})),TU(x,"set-playback-rate",{playbackRate:T}),T},[Rt]),Rr=(0,A.useCallback)(y=>{let T=Rt(),x=Cs(T),k=u.getState(),D=x?.getDuration()||u.getState().duration||f,M=Math.max(0,Math.min(D,Number.isFinite(y)?y:0)),G=!!(x?.isPlaying()||k.isPlaying);if(vn(),x){x.seek(M);let q=x.getTime();c.notify(q),k.setCurrentTime(q),k.setIsPlaying(!!x.isPlaying())}else c.notify(M),k.setCurrentTime(M),k.requestSeek(M);return G&&x?.isPlaying()&&ic(),!0},[f,Rt,c,ic,vn,u]),Hm=(0,A.useCallback)(y=>!(y instanceof Element)||y.closest("button,input,textarea,select,a")||y.closest("[data-clip]")?!1:!!y.closest('[aria-label="Timeline"]'),[]),Sa=(0,A.useCallback)((y,T)=>{let x=ze.current?.querySelector('[aria-label="Timeline"]'),k=x?.firstElementChild instanceof HTMLElement?x.firstElementChild:null,D=u.getState().duration||f;if(!k||D<=0)return null;let M=k.getBoundingClientRect(),q=Math.max(1,k.scrollWidth-aU)/D,it=y-M.left+k.scrollLeft-aU;if(it<0)return null;let J=Math.max(0,Math.min(D,it/q)),vt=T-M.top+k.scrollTop-sU,Tt=bn.current?.rowOrder??t1(ko),rt=Math.floor(vt/lU),re=T-M.top,Ke=Tt.length>0&&re>=0&&re<=sU,Ze=Ke?Math.max(...Tt)+1:rt>=0&&rt<Tt.length?Tt[rt]:null,mc=Ze===null?null:ko.find(No=>No.track===Ze&&J>=No.start&&J<=No.start+No.duration)??null;return{time:J,track:Ze,syntheticTrack:Ke,element:mc,scrollLeft:k.scrollLeft,pixelsPerSecond:q}},[f,ko,u]),E1=(0,A.useCallback)((y,T)=>{let x=Sa(y,0);if(!x)return!1;let{time:k,scrollLeft:D,pixelsPerSecond:M}=x;return Rr(k),It("editor.timeline-capture-seek",{source:T,time:k,clientX:y,scrollLeft:D,pixelsPerSecond:M}),!0},[Rr,Sa]),v6=(0,A.useCallback)(y=>{if(y.button!==0||y.shiftKey||y.metaKey||y.ctrlKey||y.altKey){Ge.current=null;return}Ge.current={clientX:y.clientX,clientY:y.clientY,button:y.button,startedOnTimeline:Hm(y.target)}},[Hm]),S6=(0,A.useCallback)(y=>{let T=Ge.current;Ge.current=null,!(!T||T.button!==0||!T.startedOnTimeline||!Hm(y.target)||Math.hypot(y.clientX-T.clientX,y.clientY-T.clientY)>5)&&E1(y.clientX,"click-capture")},[Hm,E1]),E6=(0,A.useCallback)(y=>{let T=y.target;if(!(T instanceof Element)||!T.closest('[aria-label="Timeline"]'))return;y.preventDefault(),y.stopPropagation();let x=Sa(y.clientX,y.clientY);if(!x)return;let k=u.getState();if(x.element){let D=Mt(x.element);new Set([...k.selectedElementId?[k.selectedElementId]:[],...Array.from(k.selectedElementIds)]).has(D)||(k.clearSelectedElementIds(),k.setSelectedElementId(D))}else k.clearSelectedElementIds(),k.setSelectedElementId(null);P({x:y.clientX,y:y.clientY,time:x.time,track:x.syntheticTrack?null:x.track,element:x.element}),O(null)},[Sa,u]),Gm=(0,A.useCallback)(y=>{Ni(Rt(),y)},[Rt]),T1=(0,A.useCallback)(()=>te.current?.querySelector(".dna-panel")?.scrollTop??0,[]),w1=(0,A.useCallback)(y=>{requestAnimationFrame(()=>{let T=te.current?.querySelector(".dna-panel");T&&(T.scrollTop=y)})},[]),ac=(0,A.useCallback)(()=>{let y=u.getState(),T=Cs(Rt());return{time:T?.getTime()??y.currentTime,selectedElementId:y.selectedElementId,selectedElementIds:Array.from(y.selectedElementIds),zoomMode:y.zoomMode,manualZoomPercent:y.manualZoomPercent,rightPanelScrollTop:T1(),playbackRate:EU(Number(C)),wasPlaying:!!(T?.isPlaying()||y.isPlaying)}},[Rt,T1,C,u]),T6=(0,A.useCallback)(()=>{let y=ot.current;if(!y){Gm(_n);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(Rt());if(y.wasPlaying&&!M&&T<30){T+=1,requestAnimationFrame(x);return}ot.current=null,I(String(Number(y.playbackRate.toFixed(2)))),k.setZoomMode(y.zoomMode),k.setManualZoomPercent(y.manualZoomPercent),k.setPlaybackRate(y.playbackRate),k.clearSelectedElementIds();for(let q of y.selectedElementIds)k.toggleSelectedElementId(q);k.setSelectedElementId(y.selectedElementId);let G=y.selectedElementId?k.elements.find(q=>Mt(q)===y.selectedElementId)??null:null;Ni(Rt(),G),w1(y.rightPanelScrollTop),Hd(y.playbackRate),Rr(y.time),y.wasPlaying&&M?(M.play(),k.setIsPlaying(!0),ic()):k.setIsPlaying(!1),It("editor.restore-after-reload",{time:y.time,selectedElementId:y.selectedElementId,selectedCount:y.selectedElementIds.length,zoomMode:y.zoomMode,manualZoomPercent:y.manualZoomPercent,rightPanelScrollTop:y.rightPanelScrollTop})};requestAnimationFrame(x)},[Hd,Rr,Rt,w1,_n,ic,Gm,u]);(0,A.useEffect)(()=>()=>vn(),[vn]),(0,A.useEffect)(()=>{h.current=m},[m]),(0,A.useEffect)(()=>{Gm(_n)},[_n,Gm]),(0,A.useEffect)(()=>{let y=T=>{let x=T.data;if(!x||x.source!=="vidfarm-composition")return;let k=u.getState();if(x.action==="preview-context-menu"){let M=v1(T.source),G=M?.getBoundingClientRect(),q=M?.contentWindow?.innerWidth||G?.width||1,it=M?.contentWindow?.innerHeight||G?.height||1,J=(G?.width??1)/Math.max(1,q),vt=(G?.height??1)/Math.max(1,it),Tt=(G?.left??0)+Number(x.clientX??0)*J,rt=(G?.top??0)+Number(x.clientY??0)*vt,re={x:Number(x.frame?.x??12),y:Number(x.frame?.y??70),width:Number(x.frame?.width??42),height:Number(x.frame?.height??12)},Ke={x:Ut(re.x,0,95),y:Ut(re.y,0,95),width:Ut(re.width,1,100-Ut(re.x,0,95)),height:Ut(re.height,1,100-Ut(re.y,0,95))};Fm({x:Tt,y:rt,time:Number.isFinite(Number(x.time))?Number(x.time):k.currentTime,frame:Ke,elementId:x.id??null}),It("editor.preview-context-menu",{id:x.id??null,time:Number(x.time),frame:Ke});return}if(x.action!=="select-layer")return;if(k.clearSelectedElementIds(),!x.id){k.setSelectedElementId(null),O(null),It("editor.canvas-empty-select");return}let D=k.elements.find(M=>M.hfId===x.id||M.domId===x.id||M.id===x.id||M.key===x.id);k.setSelectedElementId(D?Mt(D):null),O(null),It("editor.canvas-layer-select",{id:x.id,elementKey:D?Mt(D):null})};return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[v1,Fm,u]);let r0=(0,A.useCallback)(()=>{let y=jt.current;if(y.active)return;if(y.pendingBody===null){y.pendingRevBump&&(y.pendingRevBump=!1,S(x=>x+1),requestAnimationFrame(()=>R(!0)));return}let T=y.pendingBody;y.pendingBody=null,y.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{y.active=!1,r0()}})()},[i]),sc=(0,A.useCallback)((y,T)=>{let x=jt.current;x.pendingBody=Xl(y),T.bumpRev&&(x.pendingRevBump=!0),r0()},[r0]),Kr=(0,A.useCallback)((y,T)=>{It("editor.composition-persist",{bytes:y.length,mode:T}),sc(y,{bumpRev:!1})},[sc]),lc=(0,A.useCallback)((y,T)=>{y=Xl(y);let x={...ac(),...T};_t.current&&(x.wasPlaying=!0,_t.current=!1),ot.current=x,h.current=y,_(y),vn(),u.getState().reset(),R(!1),It("editor.composition-publish",{bytes:y.length}),sc(y,{bumpRev:!0})},[ac,sc,vn,u]),Ro=(0,A.useCallback)(y=>{or(),lc(y)},[lc,or]),x1=(0,A.useCallback)((y,T)=>{or(),lc(y,{selectedElementId:T,selectedElementIds:[]})},[lc,or]),mJ=(0,A.useCallback)((y,T)=>{y=Xl(y),or(),h.current=y,_(y);let x=Rt(),k=Qx(x,y),D=u.getState(),M=D.selectedElementId?D.elements.find(G=>Mt(G)===D.selectedElementId)??null:null;Ni(x,M),Kr(y,"soft"),T!==void 0&&Rr(T),It("editor.timeline-timing-soft-patch",{bytes:y.length,patchedCount:k,seekTime:T})},[Rr,Rt,Kr,or,u]),w6=(0,A.useCallback)((y,T)=>{let x=h.current,k=Zo(x,y,T);if(k===x){It("editor.live-patch-skipped-missing",{elementKey:Mt(y)});return}or(`live:${Mt(y)}`),h.current=k,_(k);let D=Rt(),M=wm(D,y,T);Ni(D,y),It("editor.live-patch",{elementKey:Mt(y),hfId:y.hfId,domId:y.domId,tag:y.tag,hasIframe:!!D,patched:M}),M?Kr(k,"soft"):lc(k)},[Rt,Kr,lc,or]),x6=(0,A.useCallback)((y,T)=>{let x=Rt(),k=wm(x,y,T);Ni(x,y),It("editor.live-preview-patch",{elementKey:Mt(y),patched:k})},[Rt]),$m=(0,A.useCallback)(y=>{let T=h.current;h.current=y.html,_(y.html);let x=Rt(),k=fU(x,y.html),D=k?z_(x):!1;Zx(u,T,y.html),Kr(y.html,"soft");let M=u.getState(),G=new Set(M.elements.map(J=>Mt(J))),q=y.selectedElementId&&G.has(y.selectedElementId)?y.selectedElementId:null,it=y.selectedElementIds.filter(J=>G.has(J));if(k&&D){M.clearSelectedElementIds();for(let vt of it)M.toggleSelectedElementId(vt);M.setSelectedElementId(q);let J=q?M.elements.find(vt=>Mt(vt)===q)??null:null;Ni(x,J),Rr(y.time),It("editor.history-live-swap",{bytes:y.html.length});return}if(ot.current={...ac(),time:y.time,selectedElementId:q,selectedElementIds:it},vn(),pU(x,y.html)){It("editor.history-document-write",{bytes:y.html.length});return}sc(y.html,{bumpRev:!0}),It("editor.history-reload-fallback",{bytes:y.html.length})},[ac,Rr,sc,Rt,Kr,vn,u]),o0=(0,A.useCallback)(y=>{let T=Rt(),x=T?.contentDocument??null,k=x?K_(x):h.current;h.current=y,_(y);let D=fU(T,y),M=D?z_(T):!1;if(Zx(u,k,y),D&&M){Rr(u.getState().currentTime),It("editor.dev-reload-live-swap",{bytes:y.length});return}if(ot.current={...ac()},vn(),pU(T,aX(y))){It("editor.dev-reload-document-write",{bytes:y.length});return}Ar("editor.dev-reload-apply-failed",{bytes:y.length})},[ac,Rr,Rt,vn,u]);(0,A.useEffect)(()=>{if(!o||!Lm()?.liveReload)return;let y=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(D=>D.ok?D.text():null).then(D=>{D!=null&&o0(Xl(D))}).catch(D=>Ar("editor.live-reload-fetch-failed",D instanceof Error?D.message:String(D)))};return y.addEventListener("reload",T),y.onerror=()=>Ar("editor.live-reload-sse-error"),()=>{y.removeEventListener("reload",T),y.close()}},[o0,o]);let Gd=(0,A.useCallback)(()=>{Qe.current.flushAll();let y=gt.current.pop();y&&(Et.current=[oc(),...Et.current.slice(0,49)],mt.current=null,rc(),$m(y))},[$m,rc,oc]),cc=(0,A.useCallback)(()=>{Qe.current.flushAll();let y=Et.current.shift();y&&(gt.current=[...gt.current.slice(-49),oc()],mt.current=null,rc(),$m(y))},[$m,rc,oc]),i0=(0,A.useRef)({undo:()=>{},redo:()=>{}});(0,A.useEffect)(()=>{i0.current={undo:Gd,redo:cc}},[cc,Gd]);let A6=(0,A.useCallback)(()=>{let y=Rt()?.contentDocument;!y||uU.has(y)||(uU.add(y),y.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?i0.current.redo():i0.current.undo())},!0))},[Rt]),I6=(0,A.useCallback)(y=>{We.current=y.commit,ft(y.dirty)},[]),a0=(0,A.useCallback)(y=>{ct(T=>{if(!T.has(y))return T;let x=new Map(T);return x.delete(y),x})},[]),k6=(0,A.useCallback)(y=>{let T=Mt(y),x=J_(h.current,y);if(x){let k=WU(x);wm(Rt(),y,D=>l1(D,k)),Ni(Rt(),y)}a0(T)},[a0,Rt]),jm=(0,A.useCallback)((y,T)=>{let x=Mt(y),k={x:Ut(T.x,0,Math.max(0,100-T.width)),y:Ut(T.y,0,Math.max(0,100-T.height)),width:Ut(T.width,1,100-T.x),height:Ut(T.height,1,100-T.y),...Number.isFinite(T.fontSize)?{fontSize:Math.max(8,Math.min(180,Number(T.fontSize)))}:{}};ct(D=>{let M=new Map(D);return M.set(x,{element:y,frame:k}),M}),Ni(Rt(),y),ft(!0)},[Rt]),R6=(0,A.useCallback)(()=>{window.setTimeout(()=>Qe.current.visual(),0)},[]),uc=(0,A.useCallback)(()=>{let y=Array.from(H.values());if(y.length===0)return!1;or();let T=h.current;for(let x of y)T=Zo(T,x.element,k=>l1(k,x.frame));return h.current=T,_(T),ct(new Map),Kr(T,"soft"),Ni(Rt(),_n),It("editor.visual-frame-drafts-commit",{count:y.length}),!0},[Rt,Kr,or,_n,H]);(0,A.useEffect)(()=>{let y=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(),D=k.elements.find(q=>q.hfId===x.id||q.domId===x.id||q.id===x.id||q.key===x.id);if(!D||!p1(D))return;let M=Number(x.frame.fontSize),G={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}:{}};[G.x,G.y,G.width,G.height].every(Number.isFinite)&&(k.clearSelectedElementIds(),k.setSelectedElementId(Mt(D)),jm(D,G),x.phase==="end"&&window.setTimeout(()=>Qe.current.visual(),0),It("editor.iframe-visual-frame-draft",{elementKey:Mt(D),phase:x.phase,frame:G}))};return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[jm,u]);let A1=(0,A.useCallback)(y=>{let T=Array.from(et.entries()).filter(([x])=>x!==y).map(([,x])=>x);return T.length===0?h.current:r1(h.current,T).html},[et]),s0=(0,A.useCallback)(y=>{lt(T=>{if(!T.has(y))return T;let x=new Map(T);return x.delete(y),x})},[]),N6=(0,A.useCallback)(y=>{let T=et.get(y);if(T){let x=s1(h.current,T.element);u.getState().updateElement(y,{start:x.start,duration:x.duration,track:x.track,playbackStart:x.playbackStart})}s0(y)},[s0,et,u]),Mi=(0,A.useCallback)((y,T,x)=>{let k=Mt(y),D=s1(h.current,y),G={...et.get(k)?.updates??{},...T};if(!x?.bypassCollisionGuard){let Tt={start:G.start??D.start,duration:G.duration??D.duration,track:G.track??D.track},rt=yU(u.getState().elements,y,h.current),re={start:D.start,duration:D.duration,track:D.track};if(e1(Tt,rt)&&!e1(re,rt))return Ar("editor.timeline-stage-collision-rejected",{elementKey:k,proposed:Tt}),!1}let q=h.current;try{let Tt=Array.from(et.entries()).filter(([rt])=>rt!==k).map(([,rt])=>rt);q=r1(h.current,[...Tt,{element:D,updates:G}]).html}catch(Tt){return Ar("editor.timeline-stage-rejected",Tt instanceof Error?Tt.message:Tt),!1}let it=u.getState();it.setSelectedElementId(k),it.updateElement(k,T),lt(Tt=>{let rt=new Map(Tt);return rt.set(k,{element:D,updates:G}),rt});let J=Rt(),vt=Qx(J,q);return Ni(J,{...D,...G}),It("editor.timeline-stage-applied",{elementKey:k,updates:G,patchedCount:vt}),!0},[Rt,et,u]),dc=(0,A.useCallback)((y=new Set)=>{let T=Array.from(et.entries()).filter(([it])=>!y.has(it));if(T.length===0)return;or();let x=h.current,{html:k,resolvedCollisions:D}=r1(x,T.map(([,it])=>it)),M=Xl(k);lt(it=>{let J=new Map(it);for(let[vt]of T)J.delete(vt);return J}),h.current=M,_(M),u.getState().elements.length>0&&Zx(u,x,M);let G=Rt(),q=Qx(G,M);z_(G),Kr(M,"soft"),It("editor.timeline-timing-commit",{count:T.length,patchedCount:q,resolvedCollisions:D})},[Rt,Kr,or,et,u]),qm=(0,A.useCallback)(()=>{let y=!1;Zt&&We.current&&(We.current(),We.current=null,ft(!1),y=!0);let T=_n?Mt(_n):null;return et.size>0&&dc(y&&T?new Set([T]):new Set),H.size>0&&uc(),h.current},[dc,uc,Zt,_n,et.size,H.size]);(0,A.useEffect)(()=>{Qe.current={timing:()=>dc(),visual:()=>uc(),flushAll:()=>{qm()}}},[qm,dc,uc]);let l0=(0,A.useCallback)(async()=>{if(nc)return;let y=n.title;dt({phase:"starting",title:y,status:"STARTING",progress:0,framesRendered:0,totalFrames:null,lambdasInvoked:0,cost:"$0.0000"});try{let T=qm(),x=await i(),k=await fetch(`/api/v1/compositions/${encodeURIComponent(x)}/render`,{method:"POST",headers:{"content-type":"application/json; charset=utf-8"},body:JSON.stringify({title:y,html:T})}),D=await k.json().catch(()=>({}));if(!k.ok||D.ok===!1)throw new Error(D.error||`Publish failed with ${k.status}`);It("editor.publish-started",{forkId:x,renderId:D.renderId}),dt(iU(D,y))}catch(T){Ao("editor.publish-start-error",T instanceof Error?T.stack:T),dt({phase:"failed",title:y,status:"FAILED",progress:0,error:T instanceof Error?T.message:String(T)})}},[qm,n.title,i,nc]);(0,A.useEffect)(()=>{if(Y?.phase!=="running"||!Y.renderId||!o)return;let y=o,T=!1,x=0,k=0,D=async()=>{try{let M=await fetch(`/api/v1/compositions/${encodeURIComponent(y)}/renders/${encodeURIComponent(Y.renderId||"")}`),G=await M.json().catch(()=>({}));if(T)return;if(!M.ok||G.ok===!1)throw new Error(G.error||`Publish progress failed with ${M.status}`);x=0,dt(iU(G,n.title))}catch(M){if(T)return;if(Ao("editor.publish-poll-error",M instanceof Error?M.stack:M),x+=1,x<5){k=window.setTimeout(()=>{D()},4500);return}dt(G=>({...G??{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(()=>{D()},4500),()=>{T=!0,window.clearTimeout(k)}},[n.title,o,Y]);let C6=(0,A.useCallback)(()=>{let y=Rt(),T=Cs(y);if(!T)return;if(T.isPlaying()||u.getState().isPlaying){T.pause(),u.getState().setCurrentTime(T.getTime()),u.getState().setIsPlaying(!1),vn();return}(Zt||et.size>0||H.size>0)&&(_t.current=!0);let k=!1;Zt&&We.current&&(We.current(),We.current=null,ft(!1),k=!0);let D=_n?Mt(_n):null;et.size>0&&dc(k&&D?new Set([D]):new Set),H.size>0&&uc(),_t.current&&(_t.current=!1);let M=Hd(Number(C));T.getTime()>=T.getDuration()&&T.seek(0),T.setPlaybackRate?.(M),T.play(),u.getState().setIsPlaying(!0),ic()},[Hd,uc,dc,Rt,Zt,_n,C,ic,vn,et.size,u,H.size]),M6=(0,A.useCallback)((y,T)=>{try{let x=new DOMParser().parseFromString(A1(),"text/html"),k=Bn(x,y);if(!k)return;let D=k.getAttribute("data-vf-group"),M=_U(x,D,k),G=Ql(k),q=T.start-G.start,it=T.track-G.track,J=new Map;for(let vt of M){let Tt=Ci(vt);if(!Tt)continue;let rt=Ql(vt);J.set(Tt,{start:Math.max(0,rt.start+q),duration:rt.duration,track:Math.max(0,rt.track+it)})}fX(x,M,J);for(let vt of M){let Tt=Ci(vt),rt=Tt?J.get(Tt):null;if(!Tt||!rt)continue;let re=ec.find(Ze=>Mt(Ze)===Tt||Ze.hfId===Tt||Ze.domId===Tt||Ze.id===Tt)??(Tt===Ci(k)?y:null);if(!re)continue;if(!Mi(re,{start:rt.start,track:rt.track},{bypassCollisionGuard:!0}))throw new Error("Timeline move could not be staged.")}window.setTimeout(()=>Qe.current.timing(),0)}catch(x){return Ar("editor.timeline-move-rejected",x instanceof Error?x.message:x),Promise.reject(x)}},[ec,A1,Mi]),O6=(0,A.useCallback)((y,T)=>{try{if(!Mi(y,T))throw new Error("Timeline resize could not be staged.");window.setTimeout(()=>Qe.current.timing(),0)}catch(x){return Ar("editor.timeline-resize-rejected",x instanceof Error?x.message:x),Promise.reject(x)}},[Mi]),c0=(0,A.useCallback)((y,T,x)=>{if(x.button!==0||x.shiftKey||x.metaKey||x.ctrlKey)return;if(x.altKey){x.preventDefault(),x.stopPropagation();return}let k=Mt(y),D=wU(y,et.get(k)),M=Sa(x.clientX,x.clientY);if(!M)return;x.preventDefault(),x.stopPropagation();let G=u.getState();G.clearSelectedElementIds(),G.setSelectedElementId(k),Ge.current=null;let q=uX(ko.filter(it=>Y_(h.current,it)!=="track-placeholder"));bn.current={element:D,mode:T,originClientX:x.clientX,originClientY:x.clientY,originPointerTime:M.time,originStart:D.start,originDuration:D.duration,originTrack:D.track,originPlaybackStart:D.playbackStart,moved:!1,rowOrder:t1(ko),laneAudioFlags:q},It("editor.manual-timeline-drag-start",{elementKey:k,mode:T,start:D.start,duration:D.duration,track:D.track})},[ko,Sa,et,u]);(0,A.useEffect)(()=>{function y(x){let k=bn.current;if(!k)return;let D=Math.hypot(x.clientX-k.originClientX,x.clientY-k.originClientY);if(!k.moved&&D<2)return;k.moved=!0,x.preventDefault();let M=Sa(x.clientX,x.clientY);if(!M)return;let G=M.time-k.originPointerTime,q=k.originStart+k.originDuration,it=yU(u.getState().elements,k.element,h.current),J=!1,vt=!1;if(k.mode==="move"){let Tt=Ut(k.originStart+G,0,Math.max(0,f-k.originDuration)),rt=M.track??k.originTrack,re=it.reduce((No,Co)=>Math.max(No,Co.track),-1),Ke=M.syntheticTrack?Math.min(rt,Math.max(re+1,k.originTrack)):rt,Ze=k.element.tag==="audio",mc=k.laneAudioFlags.get(Ke);if(!M.syntheticTrack&&Ke!==k.originTrack&&mc!==void 0&&mc!==Ze)vt=!0;else{let No={start:Tt,duration:k.originDuration,track:Ke},Co=e1(No,it)?dX(it,Ke,k.originDuration,Tt,f):Tt;Co===null?vt=!0:J=Mi(k.element,{start:Co,track:Ke})}}else if(k.mode==="trim-start"){let Tt=it.reduce((No,Co)=>Dm(Co)&&Co.track===k.originTrack&&Co.start+Co.duration<=k.originStart+.001?Math.max(No,Co.start+Co.duration):No,0),rt=Math.max(0,q-.05),re=Math.min(Tt,rt),Ke=Ut(k.originStart+G,re,rt),Ze=Ke-k.originStart,mc=k.originPlaybackStart===void 0?void 0:Math.max(0,k.originPlaybackStart+Ze);J=Mi(k.element,{start:Ke,duration:Math.max(.05,q-Ke),playbackStart:mc})}else{let Tt=it.reduce((Ke,Ze)=>Dm(Ze)&&Ze.track===k.originTrack&&Ze.start>=q-.001?Math.min(Ke,Ze.start):Ke,f),rt=Math.max(k.originStart+.05,Tt),re=Ut(q+G,k.originStart+.05,rt);J=Mi(k.element,{duration:Math.max(.05,re-k.originStart)})}vt?It("editor.manual-timeline-drag-lane-full",{elementKey:Mt(k.element),mode:k.mode,track:M.track??k.originTrack}):J||Ar("editor.manual-timeline-drag-rejected",{elementKey:Mt(k.element),mode:k.mode})}function T(){let x=bn.current;x&&(It("editor.manual-timeline-drag-end",{elementKey:Mt(x.element),mode:x.mode,moved:x.moved}),bn.current=null,x.moved&&window.setTimeout(()=>Qe.current.timing(),0))}return window.addEventListener("pointermove",y,{passive:!1}),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T),()=>{window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T)}},[f,Sa,Mi,u]);let I1=(0,A.useCallback)((y,T)=>{let x=Zo(m,y,k=>{let D=Number(k.getAttribute("data-start")??y.start),M=Number(k.getAttribute("data-duration")??y.duration),G=D+M;if(T<=D||T>=G)return;let q=T-D,it=G-T,J=k.cloneNode(!0),vt=`element_split_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,Tt=Number(k.getAttribute("data-playback-start")??k.getAttribute("data-media-start")??y.playbackStart??0),rt=k.getAttribute("data-layer-kind")||f1(y)?.kind||(y.tag==="audio"?"audio":y.tag==="video"?"video":"layer"),re=Yt(Tt+q);k.setAttribute("data-duration",Yt(q)),k.setAttribute("data-layer-kind",rt),J.id=vt,J.setAttribute("data-hf-id",vt),J.setAttribute("data-start",Yt(T)),J.setAttribute("data-duration",Yt(it)),J.setAttribute("data-media-start",re),J.setAttribute("data-playback-start",re),J.setAttribute("data-layer-kind",rt),J.setAttribute("data-label",`${y.label??y.id} split`),k.after(J)});Ro(x)},[m,Ro]),D6=(0,A.useCallback)((y,T)=>{let x=Math.max(0,T==="above"?y+1:y),{html:k}=Io(m,D=>{for(let it of Array.from(D.querySelectorAll("[data-start]"))){if(!ee(it))continue;let J=Number(it.getAttribute("data-track-index")??0);J>=x&&it.setAttribute("data-track-index",String(J+1))}let M=D.querySelector("[data-composition-id]");if(!ee(M))return;let G=`element_track_${x}_${Date.now().toString(36)}`,q=D.createElement("div");q.id=G,q.setAttribute("data-hf-id",G),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;",M.append(q)});Ro(k),It("editor.timeline-layer-inserted",{anchorTrack:y,placement:T,insertAt:x})},[m,Ro,u]),Vm=(0,A.useCallback)((y,T)=>{We.current?.();let x=`element_${y}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,k=u.getState().currentTime,D=Math.max(0,Math.min(f-.5,Number.isFinite(T.time)?T.time:k)),M=Math.max(.5,Math.min(4,f-D)),G=T.frame??{x:12,y:y==="text"?68:18,width:y==="text"?76:54,height:y==="text"?12:32},{html:q}=Io(h.current,it=>{let J=it.querySelector("[data-composition-id]");if(!ee(J))return;let Tt=Array.from(it.querySelectorAll("[data-start]")).filter(re=>ee(re)).reduce((re,Ke)=>{let Ze=Number(Ke.getAttribute("data-track-index")??0);return Number.isFinite(Ze)?Math.max(re,Ze+1):re},0),rt=y==="media"?it.createElement("video"):it.createElement("div");rt.id=x,rt.setAttribute("data-hf-id",x),rt.setAttribute("data-layer-mode","publish"),rt.setAttribute("data-layer-kind",y==="media"?"video":"caption"),rt.setAttribute("data-viral-note",y==="media"?"Inserted media layer.":"Inserted caption layer."),rt.setAttribute("data-start",Yt(D)),rt.setAttribute("data-duration",Yt(M)),rt.setAttribute("data-track-index",String(Tt)),rt.setAttribute("data-label",y==="media"?"New media":"New text"),y==="text"&&(rt.setAttribute("data-text-background-style","plain"),rt.setAttribute("data-text-background-color","#000000"),rt.setAttribute("data-font-family","Montserrat")),rt.style.position="absolute",rt.style.left=`${Ut(G.x,0,95)}%`,rt.style.top=`${Ut(G.y,0,95)}%`,rt.style.width=`${Ut(G.width,1,100-Ut(G.x,0,95))}%`,rt.style.height=`${Ut(G.height,1,100-Ut(G.y,0,95))}%`,rt.style.zIndex=String(100+Tt),rt.style.overflow="hidden",y==="media"&&rt instanceof HTMLVideoElement?(rt.setAttribute("src",Cm),rt.setAttribute("playsinline",""),rt.setAttribute("muted",""),rt.setAttribute("preload","auto"),rt.setAttribute("data-media-start","0"),rt.setAttribute("data-playback-start","0"),rt.style.objectFit="cover",rt.style.background="#050604"):(rt.style.display="flex",rt.style.alignItems="center",rt.style.justifyContent="center",rt.style.padding="3px",rt.style.boxSizing="border-box",rt.style.textAlign="center",rt.style.color="#ffffff",rt.style.background="transparent",rt.style.fontFamily="Montserrat, 'TikTok Sans', sans-serif",rt.style.fontWeight="600",rt.style.fontSize="22px",rt.style.lineHeight="1.2",rt.style.textTransform="none",W_(rt,"New text","plain","#ffffff","#000000","Montserrat",600)),J.append(rt)});x1(q,x),P(null),O(null),It("editor.layer-inserted",{id:x,kind:y,start:D,duration:M})},[f,x1,u]),u0=(0,A.useCallback)(()=>{let y=u.getState(),T=new Set([...y.selectedElementId?[y.selectedElementId]:[],...Array.from(y.selectedElementIds)]),x=y.elements.filter(M=>T.has(Mt(M)));if(x.length<2)return;let k=`vf-group-${Date.now().toString(36)}`,{html:D}=Io(m,M=>{for(let G of x){let q=Bn(M,G);q&&(q.setAttribute("data-vf-group",k),q.setAttribute("data-vf-group-label","Vidfarm group"))}});Ro(D),It("editor.group-created",{groupId:k,count:x.length})},[m,Ro,u]),d0=(0,A.useCallback)(()=>{let y=u.getState(),T=new Set([...y.selectedElementId?[y.selectedElementId]:[],...Array.from(y.selectedElementIds)]);if(T.size===0)return;let{html:x}=Io(m,k=>{let D=new Set;for(let M of y.elements){if(!T.has(Mt(M)))continue;let G=bU(k,M);G&&D.add(G)}for(let M of D)for(let G of _U(k,M,k.body))G.removeAttribute("data-vf-group"),G.removeAttribute("data-vf-group-label")});Ro(x),It("editor.group-removed")},[m,Ro,u]),$d=(0,A.useCallback)(y=>{if(y.hfId==="source-video")return;or();let T=Zo(h.current,y,it=>it.remove());h.current=T,_(T);let x=Rt(),k=wm(x,y,it=>{it instanceof HTMLMediaElement&&it.pause(),it.remove()}),D=z_(x),M=new Set([Mt(y),y.hfId,y.domId,y.id].filter(it=>!!it)),G=u.getState();G.setElements(G.elements.filter(it=>![Mt(it),it.hfId,it.domId,it.id].some(vt=>vt&&M.has(vt)))),G.clearSelectedElementIds(),G.setSelectedElementId(null),lt(it=>{let J=new Map(it);for(let vt of M)J.delete(vt);return J}),ct(it=>{let J=new Map(it);for(let vt of M)J.delete(vt);return J}),Kr(T,"soft");let q=Cs(x);if(q){let it=q.getTime();q.seek(it),G.setCurrentTime(q.getTime()),G.setIsPlaying(q.isPlaying())}It("editor.layer-delete-soft",{elementKey:Mt(y),patched:k,refreshed:D}),(!k||!D)&&S(it=>it+1)},[Rt,Kr,or,S,u]);(0,A.useEffect)(()=>{let y=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?cc():Gd();return}if((T.metaKey||T.ctrlKey)&&!T.altKey&&!T.shiftKey&&T.key.toLowerCase()==="y"){T.preventDefault(),cc();return}if((T.metaKey||T.ctrlKey)&&T.key.toLowerCase()==="g"){T.preventDefault(),T.shiftKey?d0():u0();return}if(T.key==="Delete"||T.key==="Backspace"){let k=u.getState(),D=new Set([...k.selectedElementId?[k.selectedElementId]:[],...Array.from(k.selectedElementIds)]);if(D.size===0)return;let M=k.elements.filter(G=>D.has(Mt(G)));if(M.length===0)return;T.preventDefault();for(let G of M)G.hfId!=="source-video"&&$d(G)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[$d,u0,cc,Gd,d0,u]);let fc=(0,A.useCallback)((y,T)=>{navigator.clipboard?.writeText(y).then(()=>{It("editor.clipboard-copy",{label:T,value:y})}).catch(x=>{Ar("editor.clipboard-copy-failed",{label:T,error:x instanceof Error?x.message:x})})},[]),k1=(0,A.useCallback)(y=>{fc(Ms(y),"timestamp")},[fc]),L6=(0,A.useCallback)(y=>{fc(`time=${Ms(y.time)} track=${y.track??"none"}`,"timeline-coordinates")},[fc]),U6=(0,A.useCallback)(y=>{fc(`x=${Yt(y.x)} y=${Yt(y.y)} width=${Yt(y.width)} height=${Yt(y.height)}`,"preview-coordinates")},[fc]),B6=(0,A.useMemo)(()=>new Map(Mm.map(y=>[y.id,y])),[Mm]),P6=(0,A.useCallback)(()=>{let y=u.getState();y.setSelectedElementId(null),y.clearSelectedElementIds()},[u]);function z6(y,T){let x=B6.get(y.hfId??y.domId??y.id),k=Y_(h.current,y),D=YU(h.current,y),M=k??x?.kind??(y.tag==="audio"?"audio":y.tag==="video"?"video":"layer"),G=y.label??x?.label??y.id,q=Mt(y),it=t0.has(q);return(0,g.jsxs)("div",{"data-clip":"true",className:`native-clip-label ${it?"multi-selected":""}`,onPointerDown:J=>{(J.shiftKey||J.metaKey||J.ctrlKey)&&J.stopPropagation()},onClick:J=>{if(!(J.shiftKey||J.metaKey||J.ctrlKey))return;J.preventDefault(),J.stopPropagation();let vt=u.getState();vt.selectedElementId?(vt.selectedElementId,vt.toggleSelectedElementId(q)):vt.setSelectedElementId(q),It("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:J=>c0(y,"trim-start",J),onClick:J=>{J.preventDefault(),J.stopPropagation()}}),(0,g.jsx)("span",{className:"native-clip-drag-hit","aria-label":"Move clip",onPointerDown:J=>c0(y,"move",J),onClick:J=>{J.preventDefault(),J.stopPropagation()}}),(0,g.jsx)("span",{className:"native-clip-trim-hit end","aria-label":"Trim clip end",onPointerDown:J=>c0(y,"trim-end",J),onClick:J=>{J.preventDefault(),J.stopPropagation()}}),(0,g.jsx)("span",{className:`native-clip-thumb ${M}`,children:oX(M,D==="html"?"html":x?.customHtml)}),(0,g.jsx)("strong",{style:{color:T.label},children:G}),(0,g.jsxs)("small",{children:["L",y.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}),f0=(0,A.useRef)(null),p0=(0,A.useRef)(nc);p0.current=nc;let m0=(0,A.useRef)(l0);m0.current=l0,(0,A.useEffect)(()=>{if(Y){if(Y.phase==="succeeded"&&Y.outputUrl){let y=ti.current,T={url:Y.outputUrl,title:Y.title??null,renderId:Y.renderId??null};ti.current={url:Y.outputUrl,title:Y.title??null,status:Y.status??"SUCCEEDED",renderId:Y.renderId??null},(y.url!==T.url||y.renderId!==T.renderId)&&LX(T);return}ti.current={...ti.current,status:Y.status??ti.current.status}}},[Y]);let R1=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||R1.current===o)return;R1.current=o;let y=!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),D=(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,G)=>G.version-M.version).slice(0,5);for(let M of D){if(y)return;let G=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/renders/${encodeURIComponent(M.renderJobId)}`);if(!G.ok)continue;let q=await G.json().catch(()=>({}));if(y)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??M.renderJobId};return}}}catch{}})(),()=>{y=!0}},[o,n.title]);let pc=(0,A.useRef)({compositionHtmlRef:h,patchCompositionHtml:Ro,draftedElements:ko,selectedElementId:tc,composition:n,activeCompositionDuration:f,startExport:()=>{m0.current()},isExportInFlight:()=>p0.current,getLastExport:()=>ti.current,getCast:()=>f0.current});(0,A.useEffect)(()=>{pc.current={compositionHtmlRef:h,patchCompositionHtml:Ro,draftedElements:ko,selectedElementId:tc,composition:n,activeCompositionDuration:f,startExport:()=>{m0.current()},isExportInFlight:()=>p0.current,getLastExport:()=>ti.current,getCast:()=>f0.current}}),(0,A.useEffect)(()=>(Am.current={getSnapshot:()=>WX(pc.current),applyAction:y=>IU(y,pc.current)},()=>{Am.current=null}),[]),(0,A.useEffect)(()=>{let y=!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"),D=Array.from(k.querySelectorAll('[data-vf-gen-status="generating"][data-vf-gen-job]'));for(let M of D){if(y)return;let G=M.getAttribute("data-hf-id")||M.id,q=M.getAttribute("data-vf-gen-job");if(!(!G||!q))try{let it=await fetch(`/api/v1/user/me/jobs/${encodeURIComponent(q)}`);if(!it.ok)continue;let J=await it.json().catch(()=>null);if(!J)continue;let vt=QX(J);if(vt){ZX(pc.current,G,vt);continue}let Tt=typeof J.status=="string"?J.status:"";if(Tt==="failed"||Tt==="cancelled"){let rt=typeof J.error=="string"&&J.error?J.error:`generation ${Tt}`;Rm(pc.current,G,re=>{re.setAttribute("data-vf-gen-status","error"),re.setAttribute("data-vf-gen-error",rt.slice(0,200))})}}catch{}}};return(async()=>{for(;!y;){if(await new Promise(x=>setTimeout(x,6e3)),y)return;await T()}})(),()=>{y=!0}},[]);let F6=(0,A.useCallback)((y,T)=>{Ar("editor.timeline-edit-blocked",{elementKey:Mt(y),intent:T,tag:y.tag,timingSource:y.timingSource,timelineLocked:y.timelineLocked})},[]),H6=(0,A.useCallback)(y=>{let T=u.getState();T.setSelectedElementId(y?Mt(y):null),T.clearSelectedElementIds()},[u]),G6=(0,A.useCallback)(()=>P(null),[]),$6=(0,A.useCallback)(()=>O(null),[]),j6=(0,A.useCallback)(()=>dt(null),[]),N1=(0,A.useCallback)(y=>Vm("text",y),[Vm]),C1=(0,A.useCallback)(y=>Vm("media",y),[Vm]),M1=(0,A.useCallback)(y=>{W.current={time:Number.isFinite(y.time)?y.time:u.getState().currentTime,frame:y.frame};let T=N.current;T&&(T.value="",T.click())},[u]),q6=(0,A.useCallback)(async y=>{let T=y.target.files?.[0]??null;if(y.target.value="",!T)return;let x=W.current??{time:u.getState().currentTime};W.current=null;let k=PX(T);if(!k){pt(`Unsupported file type: ${T.type||T.name}`),window.setTimeout(()=>pt(null),4e3);return}We.current?.(),pt(`Uploading ${T.name}\u2026`);try{let{url:D}=await BX(T),M=`element_${k}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,G=x.frame,q={action_type:"add_layer",kind:k,src:D,start:x.time,layer_key:M,label:T.name,note:"Uploaded from computer"};if(k!=="audio"){let vt=G??{x:12,y:18,width:54,height:32};q.x=vt.x,q.y=vt.y,q.width=vt.width,q.height=vt.height}let it=IU(q,pc.current);if(!it.ok){pt(it.error??"Could not add the uploaded media."),window.setTimeout(()=>pt(null),5e3);return}let J=u.getState();J.setSelectedElementId(M),J.clearSelectedElementIds(),pt(null)}catch(D){pt(D instanceof Error?D.message:"Upload failed."),window.setTimeout(()=>pt(null),5e3)}},[u]),V6=(0,g.jsxs)("div",{className:"preview-pane",children:[(0,g.jsxs)("div",{className:"player-stage",ref:me,onPointerDown:_6,onContextMenu:b6,children:[(0,g.jsxs)("div",{className:`source-watermark source-titlebar ${l6?"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:y=>{Xn.current=y,Pm.current=d(y)},directUrl:g1,onLoad:()=>{s6(),T6(),A6(),Lm()?.liveReload&&o&&!Fd.current&&(Fd.current=!0,o0(h.current))},portrait:!0,suppressLoadingOverlay:!0},g1):(0,g.jsx)("section",{className:"editor-loading-shell","aria-label":"Composition loading",children:(0,g.jsx)("span",{children:"Loading composition"})}),(0,g.jsx)(OX,{selected:_n,html:m,visualFrameDraft:_1,stageRef:me,getIframe:Rt,onStageFrame:jm,onCommitDrag:R6})]}),(0,g.jsx)(yX,{disabled:!y1,speedDraft:C,onSpeedDraftChange:I,onCommitSpeed:Hd,onSeek:Rr,onTogglePlay:C6,onUndo:Gd,onRedo:cc,canUndo:m6,canRedo:g6,usePlayerStore:u})]});return(0,g.jsxs)("section",{className:"studio-shell","aria-label":"Video editor output",children:[K&&!K.dismissed&&(0,g.jsx)(AX,{mode:K.mode,busy:K.busy,finished:K.finished,error:K.error,scenesCreated:K.scenesCreated,ghostcutStatus:K.ghostcutStatus,ghostcutProgress:K.ghostcutProgress,userPrompt:K.userPrompt,onUserPromptChange:y=>yt(T=>T&&{...T,userPrompt:y}),onDecompose:Ne,onFinish:Z_,onCancel:K.mode==="redo"?t6:void 0,onDismiss:K.mode==="initial"?e6:void 0}),Jt&&o&&(0,g.jsx)(IX,{forkId:o,onClose:()=>He(!1)}),Rn&&o&&(0,g.jsx)(kX,{forkId:o,currentVersion:Q,onClose:()=>yn(!1),onReverted:a6}),(0,g.jsxs)("section",{className:"studio-main",ref:te,children:[V6,(0,g.jsx)(DX,{composition:v,selected:_n,html:m,onPatchHtml:Ro,onPatchLiveElement:w6,onPreviewLiveElement:x6,onUnselect:P6,onDraftStateChange:I6,onStageTimelineDraft:Mi,onStageVisualFrameDraft:jm,timelineDraft:p6,visualFrameDraft:_1,onClearTimelineDraft:s0,onClearVisualFrameDraft:a0,onDiscardVisualFrameDraft:k6,onDiscardTimelineDraft:N6,onDelete:$d,maxDuration:f,onPublish:l0,publishDisabled:nc,publishLabel:h6,templateId:n.templateId??null,forkId:o,publishVersion:Y?.version??Q,originalUrl:n.originalUrl??null,songName:n.songName??null,songUrl:n.songUrl??null,onOpenShare:o6,onOpenDecompose:r6,onOpenHistory:i6,decomposeDismissed:!!K?.dismissed,decomposeBusy:!!K?.busy,onResumeDecompose:n6})]}),(0,g.jsxs)("section",{className:"native-timeline",ref:ze,onPointerDownCapture:v6,onClickCapture:S6,onContextMenuCapture:E6,children:[(0,g.jsx)(l,{onSeek:Rr,onMoveElement:M6,onResizeElement:O6,onBlockedEditAttempt:F6,onSplitElement:I1,onDeleteElement:$d,onSelectElement:H6,renderClipContent:z6,theme:HK}),e0&&(0,g.jsx)("div",{className:"timeline-layer-numbers","aria-hidden":"true",style:{left:-d6},children:b1.map((y,T)=>(0,g.jsxs)("span",{className:"timeline-layer-number",style:{top:T*lU+2-c6},children:["L",y]},y))}),L&&(0,g.jsx)(bX,{state:L,usePlayerStore:u,canGroup:zm.size>=2,canUngroup:y6,onClose:G6,onSeek:Rr,onSplit:I1,onInsertLayer:D6,onInsertText:N1,onInsertMedia:C1,onUploadMedia:M1,onCopyTimestamp:k1,onCopyCoordinates:L6,onGroup:u0,onUngroup:d0,onDelete:$d})]}),U&&(0,g.jsx)(_X,{state:U,onClose:$6,onInsertText:N1,onInsertMedia:C1,onUploadMedia:M1,onCopyTimestamp:k1,onCopyCoordinates:U6}),(0,g.jsx)("input",{ref:N,type:"file",accept:"video/*,image/*,audio/*",style:{display:"none"},onChange:q6}),X&&(0,g.jsx)("div",{className:"editor-upload-toast",role:"status",children:X}),Y&&(0,g.jsx)(vX,{state:Y,onClose:j6})]})}function Lm(){if(typeof window>"u")return null;let t=window.__HF_BOOT__;if(t&&typeof t=="object"&&!Array.isArray(t))return RU(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 RU(n)}catch{}}return null}function RU(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,initialThreadId:typeof t.initialThreadId=="string"?t.initialThreadId:null,liveReload:t.liveReload===!0}:null}function fJ(t){if(!t)return Om[0];let e=Om.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 QU({boot:t}={}){let e=(0,A.useMemo)(()=>fJ(t),[t]),n=!!t,[r,o]=(0,A.useState)(n?"edit":"preview"),[i,a]=(0,A.useState)(e);(0,A.useEffect)(()=>{let l=$K(),c=n?()=>{}:jK();return()=>{l(),c()}},[n]),(0,A.useEffect)(()=>{It("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)(cJ,{onEdit:l=>{a(l),It("app.mode-change-request",{from:"preview",to:"edit",id:l.id}),o("edit")}})}):(0,g.jsx)(uJ,{composition:i,onPreview:()=>{if(n){It("app.mode-change-request",{from:"edit",to:"discover",boot:!0}),typeof window<"u"&&(window.location.href="/discover");return}It("app.mode-change-request",{from:"edit",to:"preview"}),o("preview")}},i.id);return(0,g.jsxs)("main",{className:"vidfarm-workbench",children:[(0,g.jsx)(FX,{boot:t??null,composition:i}),(0,g.jsx)("section",{className:"editor-output",children:(0,g.jsx)(a1,{children:s})})]})}var Ds=Xr(Wm(),1);oU();It("boot.entry-loaded");var m1=document.getElementById("root");if(!m1){Ao("boot.root-missing");let t=new Error("Missing #root element");throw ta(t),t}var zd=Lm();It("boot.config-resolved",zd??{source:"none"});zd?.templateId&&Vu.setTag("hyperframes.template_id",zd.templateId);zd?.compositionId&&Vu.setTag("hyperframes.composition_id",zd.compositionId);function pJ(){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{It("boot.render-start",{rootChildren:m1.childNodes.length}),(0,ZU.createRoot)(m1).render((0,Ds.jsx)(Vu.ErrorBoundary,{fallback:(0,Ds.jsx)(pJ,{}),onError:t=>Ao("boot.render-error",t instanceof Error?t.stack:t),children:(0,Ds.jsx)(QU,{boot:zd})})),It("boot.render-called")}catch(t){throw Ao("boot.render-error",t instanceof Error?t.stack:t),ta(t),t}
|
|
1158
|
+
/*! Bundled license information:
|
|
1159
|
+
|
|
1160
|
+
scheduler/cjs/scheduler.production.js:
|
|
1161
|
+
(**
|
|
1162
|
+
* @license React
|
|
1163
|
+
* scheduler.production.js
|
|
1164
|
+
*
|
|
1165
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1166
|
+
*
|
|
1167
|
+
* This source code is licensed under the MIT license found in the
|
|
1168
|
+
* LICENSE file in the root directory of this source tree.
|
|
1169
|
+
*)
|
|
1170
|
+
|
|
1171
|
+
react-dom/cjs/react-dom-client.production.js:
|
|
1172
|
+
(**
|
|
1173
|
+
* @license React
|
|
1174
|
+
* react-dom-client.production.js
|
|
1175
|
+
*
|
|
1176
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1177
|
+
*
|
|
1178
|
+
* This source code is licensed under the MIT license found in the
|
|
1179
|
+
* LICENSE file in the root directory of this source tree.
|
|
1180
|
+
*)
|
|
1181
|
+
|
|
1182
|
+
@sentry/core/build/esm/utils/env.js:
|
|
1183
|
+
(*! __SENTRY_SDK_SOURCE__ *)
|
|
1184
|
+
*/
|