@mevdragon/vidfarm-devcli 0.5.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +3 -3
  2. package/SKILL.director.md +28 -7
  3. package/SKILL.platform.md +9 -5
  4. package/demo/README.md +28 -0
  5. package/demo/dist/app.css +1 -0
  6. package/demo/dist/app.js +1184 -0
  7. package/demo/dist/chunks/chunk-DXB73IDG.js +1 -0
  8. package/demo/dist/chunks/chunk-S7OWAJDS.js +36 -0
  9. package/demo/dist/chunks/chunk-VTIBZ6AN.js +1 -0
  10. package/demo/dist/chunks/dist-ADSJKBVE.js +332 -0
  11. package/demo/dist/chunks/domEditingLayers-VZMLL4AP-SGHWPND4.js +1 -0
  12. package/demo/dist/chunks/hyperframes-player-XB65TCD6.js +425 -0
  13. package/demo/dist/chunks/lib-XAQ37YOE.js +1 -0
  14. package/demo/dist/chunks/src-TJ2QYA4U.js +207 -0
  15. package/demo/dist/favicon.ico +0 -0
  16. package/demo/dist/icons/timeline/audio.svg +7 -0
  17. package/demo/dist/icons/timeline/captions.svg +5 -0
  18. package/demo/dist/icons/timeline/composition.svg +12 -0
  19. package/demo/dist/icons/timeline/image.svg +18 -0
  20. package/demo/dist/icons/timeline/music.svg +10 -0
  21. package/demo/dist/icons/timeline/text.svg +3 -0
  22. package/demo/dist/index.html +15 -0
  23. package/dist/src/account-pages-legacy.js +9396 -0
  24. package/dist/src/account-pages.js +61 -0
  25. package/dist/src/app.js +14663 -0
  26. package/dist/src/cli.js +60 -97
  27. package/dist/src/composition-runtime.js +613 -0
  28. package/dist/src/config.js +173 -0
  29. package/dist/src/context.js +447 -0
  30. package/dist/src/dev-app-legacy.js +739 -0
  31. package/dist/src/dev-app.js +6 -0
  32. package/dist/src/domain.js +2 -0
  33. package/dist/src/editor-chat-history.js +82 -0
  34. package/dist/src/editor-chat.js +449 -0
  35. package/dist/src/editor-dark-theme.js +1128 -0
  36. package/dist/src/frontend/debug.js +71 -0
  37. package/dist/src/frontend/flockposter-cache-store.js +124 -0
  38. package/dist/src/frontend/homepage-client.js +182 -0
  39. package/dist/src/frontend/homepage-shared.js +4 -0
  40. package/dist/src/frontend/homepage-store.js +28 -0
  41. package/dist/src/frontend/homepage-view.js +547 -0
  42. package/dist/src/frontend/page-runtime-client.js +132 -0
  43. package/dist/src/frontend/page-runtime-store.js +9 -0
  44. package/dist/src/frontend/sentry.js +42 -0
  45. package/dist/src/frontend/template-editor-chat.js +3960 -0
  46. package/dist/src/help-page.js +346 -0
  47. package/dist/src/homepage.js +1235 -0
  48. package/dist/src/hyperframes/composition.js +180 -0
  49. package/dist/src/index.js +16 -0
  50. package/dist/src/instrument.js +30 -0
  51. package/dist/src/lib/crypto.js +45 -0
  52. package/dist/src/lib/dev-log.js +54 -0
  53. package/dist/src/lib/display-name.js +11 -0
  54. package/dist/src/lib/ids.js +24 -0
  55. package/dist/src/lib/images.js +19 -0
  56. package/dist/src/lib/json.js +15 -0
  57. package/dist/src/lib/package-root.js +47 -0
  58. package/dist/src/lib/template-paths.js +28 -0
  59. package/dist/src/lib/time.js +7 -0
  60. package/dist/src/lib/url-clean.js +85 -0
  61. package/dist/src/page-runtime.js +2 -0
  62. package/dist/src/page-shell.js +1381 -0
  63. package/dist/src/primitive-context.js +357 -0
  64. package/dist/src/primitive-registry.js +2561 -0
  65. package/dist/src/primitive-sdk.js +4 -0
  66. package/dist/src/primitives/hyperframes-media.js +108 -0
  67. package/dist/src/react-page-shell.js +35 -0
  68. package/dist/src/ready-post-schedule-component.js +1540 -0
  69. package/dist/src/registry.js +296 -0
  70. package/dist/src/runtime.js +35 -0
  71. package/dist/src/services/api-call-history.js +249 -0
  72. package/dist/src/services/auth.js +152 -0
  73. package/dist/src/services/billing-pricing.js +39 -0
  74. package/dist/src/services/billing.js +228 -0
  75. package/dist/src/services/cast.js +127 -0
  76. package/dist/src/services/chat-threads.js +92 -0
  77. package/dist/src/services/composition-sanitize.js +124 -0
  78. package/dist/src/services/composition-watch.js +79 -0
  79. package/dist/src/services/fork-access.js +93 -0
  80. package/dist/src/services/fork-manifest.js +42 -0
  81. package/dist/src/services/ghostcut.js +179 -0
  82. package/dist/src/services/hyperframes.js +2307 -0
  83. package/dist/src/services/job-capacity.js +14 -0
  84. package/dist/src/services/job-logs.js +197 -0
  85. package/dist/src/services/jobs.js +136 -0
  86. package/dist/src/services/local-dynamo.js +0 -0
  87. package/dist/src/services/media-processing.js +766 -0
  88. package/dist/src/services/primitive-media-lambda.js +280 -0
  89. package/dist/src/services/providers.js +2926 -0
  90. package/dist/src/services/rate-limits.js +262 -0
  91. package/dist/src/services/serverless-auth.js +382 -0
  92. package/dist/src/services/serverless-jobs.js +1082 -0
  93. package/dist/src/services/serverless-provider-keys.js +409 -0
  94. package/dist/src/services/serverless-records.js +1385 -0
  95. package/dist/src/services/serverless-template-configs.js +75 -0
  96. package/dist/src/services/storage.js +383 -0
  97. package/dist/src/services/template-certification.js +413 -0
  98. package/dist/src/services/template-loader.js +99 -0
  99. package/dist/src/services/template-runtime-bundles.js +217 -0
  100. package/dist/src/services/template-sources.js +1017 -0
  101. package/dist/src/services/upstream.js +248 -0
  102. package/dist/src/services/video-normalization.js +2 -0
  103. package/dist/src/services/webhooks.js +62 -0
  104. package/dist/src/template-editor-pages.js +2576 -0
  105. package/dist/src/template-editor-shell.js +2840 -0
  106. package/dist/src/template-sdk.js +4 -0
  107. package/dist/src/worker.js +17 -0
  108. package/package.json +6 -4
  109. package/public/assets/homepage-app.js +54 -0
  110. package/public/assets/homepage-client-app.js +80 -0
  111. package/public/assets/page-runtime-client-app.js +94 -0
  112. package/src/assets/SELLING_AWARENESS_STAGES.md +579 -0
  113. package/src/assets/SELLING_WITH_HOOKS.md +377 -0
  114. package/src/assets/SELLING_WITH_VSLS.md +606 -0
  115. package/src/assets/favicon.ico +0 -0
  116. package/src/assets/logo-vidfarm.png +0 -0
@@ -0,0 +1,1184 @@
1
+ import{a as Ea,b as W6,c as Jm}from"./chunks/chunk-S7OWAJDS.js";import{c as Xm,d as y0,e as Wr}from"./chunks/chunk-DXB73IDG.js";var HO=Xm(Pe=>{"use strict";function ET(t,e){var n=t.length;t.push(e);t:for(;0<n;){var r=n-1>>>1,o=t[r];if(0<mb(o,e))t[r]=e,t[n]=o,n=r;else break t}}function Ti(t){return t.length===0?null:t[0]}function hb(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>mb(s,n))l<o&&0>mb(c,s)?(t[r]=c,t[l]=n,r=l):(t[r]=s,t[a]=n,r=a);else if(l<o&&0>mb(c,n))t[r]=c,t[l]=n,r=l;else break t}}return e}function mb(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}Pe.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(MO=performance,Pe.unstable_now=function(){return MO.now()}):(_T=Date,OO=_T.now(),Pe.unstable_now=function(){return _T.now()-OO});var MO,_T,OO,ea=[],os=[],fY=1,po=null,Xn=3,TT=!1,xp=!1,Ap=!1,wT=!1,UO=typeof setTimeout=="function"?setTimeout:null,BO=typeof clearTimeout=="function"?clearTimeout:null,DO=typeof setImmediate<"u"?setImmediate:null;function gb(t){for(var e=Ti(os);e!==null;){if(e.callback===null)hb(os);else if(e.startTime<=t)hb(os),e.sortIndex=e.expirationTime,ET(ea,e);else break;e=Ti(os)}}function xT(t){if(Ap=!1,gb(t),!xp)if(Ti(ea)!==null)xp=!0,Ku||(Ku=!0,Wu());else{var e=Ti(os);e!==null&&AT(xT,e.startTime-t)}}var Ku=!1,Ip=-1,PO=5,zO=-1;function FO(){return wT?!0:!(Pe.unstable_now()-zO<PO)}function vT(){if(wT=!1,Ku){var t=Pe.unstable_now();zO=t;var e=!0;try{t:{xp=!1,Ap&&(Ap=!1,BO(Ip),Ip=-1),TT=!0;var n=Xn;try{e:{for(gb(t),po=Ti(ea);po!==null&&!(po.expirationTime>t&&FO());){var r=po.callback;if(typeof r=="function"){po.callback=null,Xn=po.priorityLevel;var o=r(po.expirationTime<=t);if(t=Pe.unstable_now(),typeof o=="function"){po.callback=o,gb(t),e=!0;break e}po===Ti(ea)&&hb(ea),gb(t)}else hb(ea);po=Ti(ea)}if(po!==null)e=!0;else{var i=Ti(os);i!==null&&AT(xT,i.startTime-t),e=!1}}break t}finally{po=null,Xn=n,TT=!1}e=void 0}}finally{e?Wu():Ku=!1}}}var Wu;typeof DO=="function"?Wu=function(){DO(vT)}:typeof MessageChannel<"u"?(ST=new MessageChannel,LO=ST.port2,ST.port1.onmessage=vT,Wu=function(){LO.postMessage(null)}):Wu=function(){UO(vT,0)};var ST,LO;function AT(t,e){Ip=UO(function(){t(Pe.unstable_now())},e)}Pe.unstable_IdlePriority=5;Pe.unstable_ImmediatePriority=1;Pe.unstable_LowPriority=4;Pe.unstable_NormalPriority=3;Pe.unstable_Profiling=null;Pe.unstable_UserBlockingPriority=2;Pe.unstable_cancelCallback=function(t){t.callback=null};Pe.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"):PO=0<t?Math.floor(1e3/t):5};Pe.unstable_getCurrentPriorityLevel=function(){return Xn};Pe.unstable_next=function(t){switch(Xn){case 1:case 2:case 3:var e=3;break;default:e=Xn}var n=Xn;Xn=e;try{return t()}finally{Xn=n}};Pe.unstable_requestPaint=function(){wT=!0};Pe.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=Xn;Xn=t;try{return e()}finally{Xn=n}};Pe.unstable_scheduleCallback=function(t,e,n){var r=Pe.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:fY++,callback:e,priorityLevel:t,startTime:n,expirationTime:o,sortIndex:-1},n>r?(t.sortIndex=n,ET(os,t),Ti(ea)===null&&t===Ti(os)&&(Ap?(BO(Ip),Ip=-1):Ap=!0,AT(xT,n-r))):(t.sortIndex=o,ET(ea,t),xp||TT||(xp=!0,Ku||(Ku=!0,Wu()))),t};Pe.unstable_shouldYield=FO;Pe.unstable_wrapCallback=function(t){var e=Xn;return function(){var n=Xn;Xn=e;try{return t.apply(this,arguments)}finally{Xn=n}}}});var $O=Xm((Nvt,GO)=>{"use strict";GO.exports=HO()});var eU=Xm(H_=>{"use strict";var yn=$O(),gL=Ea(),pY=W6();function G(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 hL(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function pm(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function yL(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 bL(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 jO(t){if(pm(t)!==t)throw Error(G(188))}function mY(t){var e=t.alternate;if(!e){if(e=pm(t),e===null)throw Error(G(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 jO(o),t;if(i===r)return jO(o),e;i=i.sibling}throw Error(G(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(G(189))}}if(n.alternate!==r)throw Error(G(190))}if(n.tag!==3)throw Error(G(188));return n.stateNode.current===n?t:e}function _L(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=_L(t),e!==null)return e;t=t.sibling}return null}var Ne=Object.assign,gY=Symbol.for("react.element"),yb=Symbol.for("react.transitional.element"),Lp=Symbol.for("react.portal"),ed=Symbol.for("react.fragment"),vL=Symbol.for("react.strict_mode"),aw=Symbol.for("react.profiler"),SL=Symbol.for("react.consumer"),ca=Symbol.for("react.context"),ex=Symbol.for("react.forward_ref"),sw=Symbol.for("react.suspense"),lw=Symbol.for("react.suspense_list"),nx=Symbol.for("react.memo"),is=Symbol.for("react.lazy");Symbol.for("react.scope");var cw=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var hY=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var qO=Symbol.iterator;function kp(t){return t===null||typeof t!="object"?null:(t=qO&&t[qO]||t["@@iterator"],typeof t=="function"?t:null)}var yY=Symbol.for("react.client.reference");function uw(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===yY?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ed:return"Fragment";case aw:return"Profiler";case vL:return"StrictMode";case sw:return"Suspense";case lw:return"SuspenseList";case cw:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Lp:return"Portal";case ca:return t.displayName||"Context";case SL:return(t._context.displayName||"Context")+".Consumer";case ex:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case nx:return e=t.displayName||null,e!==null?e:uw(t.type)||"Memo";case is:e=t._payload,t=t._init;try{return uw(t(e))}catch{}}return null}var Up=Array.isArray,At=gL.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=pY.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Dl={pending:!1,data:null,method:null,action:null},dw=[],nd=-1;function ki(t){return{current:t}}function Rn(t){0>nd||(t.current=dw[nd],dw[nd]=null,nd--)}function xe(t,e){nd++,dw[nd]=t.current,t.current=e}var Ii=ki(null),Zp=ki(null),hs=ki(null),Xb=ki(null);function Jb(t,e){switch(xe(hs,e),xe(Zp,t),xe(Ii,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?QD(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=QD(e),t=H3(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Rn(Ii),xe(Ii,t)}function vd(){Rn(Ii),Rn(Zp),Rn(hs)}function fw(t){t.memoizedState!==null&&xe(Xb,t);var e=Ii.current,n=H3(e,t.type);e!==n&&(xe(Zp,t),xe(Ii,n))}function Qb(t){Zp.current===t&&(Rn(Ii),Rn(Zp)),Xb.current===t&&(Rn(Xb),um._currentValue=Dl)}var IT,VO;function Nl(t){if(IT===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);IT=e&&e[1]||"",VO=-1<n.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+IT+t+VO}var kT=!1;function RT(t,e){if(!t||kT)return"";kT=!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{kT=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Nl(n):""}function bY(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 RT(t.type,!1);case 11:return RT(t.type.render,!1);case 1:return RT(t.type,!0);case 31:return Nl("Activity");default:return""}}function YO(t){try{var e="",n=null;do e+=bY(t,n),n=t,t=t.return;while(t);return e}catch(r){return`
7
+ Error generating stack: `+r.message+`
8
+ `+r.stack}}var pw=Object.prototype.hasOwnProperty,rx=yn.unstable_scheduleCallback,NT=yn.unstable_cancelCallback,_Y=yn.unstable_shouldYield,vY=yn.unstable_requestPaint,Hr=yn.unstable_now,SY=yn.unstable_getCurrentPriorityLevel,EL=yn.unstable_ImmediatePriority,TL=yn.unstable_UserBlockingPriority,Zb=yn.unstable_NormalPriority,EY=yn.unstable_LowPriority,wL=yn.unstable_IdlePriority,TY=yn.log,wY=yn.unstable_setDisableYieldValue,mm=null,Gr=null;function ds(t){if(typeof TY=="function"&&wY(t),Gr&&typeof Gr.setStrictMode=="function")try{Gr.setStrictMode(mm,t)}catch{}}var $r=Math.clz32?Math.clz32:IY,xY=Math.log,AY=Math.LN2;function IY(t){return t>>>=0,t===0?32:31-(xY(t)/AY|0)|0}var bb=256,_b=262144,vb=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 x_(t,e,n){var r=t.pendingLanes;if(r===0)return 0;var o=0,i=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var s=r&134217727;return s!==0?(r=s&~i,r!==0?o=Cl(r):(a&=s,a!==0?o=Cl(a):n||(n=s&~t,n!==0&&(o=Cl(n))))):(s=r&~i,s!==0?o=Cl(s):a!==0?o=Cl(a):n||(n=r&~t,n!==0&&(o=Cl(n)))),o===0?0:e!==0&&e!==o&&(e&i)===0&&(i=o&-o,n=e&-e,i>=n||i===32&&(n&4194048)!==0)?e:o}function gm(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function kY(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 xL(){var t=vb;return vb<<=1,(vb&62914560)===0&&(vb=4194304),t}function CT(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function hm(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function RY(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-$r(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&&AL(t,r,0),i!==0&&o===0&&t.tag!==0&&(t.suspendedLanes|=i&~(a&~e))}function AL(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var r=31-$r(e);t.entangledLanes|=e,t.entanglements[r]=t.entanglements[r]|1073741824|n&261930}function IL(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-$r(n),o=1<<r;o&e|t[r]&e&&(t[r]|=e),n&=~o}}function kL(t,e){var n=e&-e;return n=(n&42)!==0?1:ox(n),(n&(t.suspendedLanes|e))!==0?0:n}function ox(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 ix(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function RL(){var t=ce.p;return t!==0?t:(t=window.event,t===void 0?32:Q3(t.type))}function WO(t,e){var n=ce.p;try{return ce.p=t,e()}finally{ce.p=n}}var Rs=Math.random().toString(36).slice(2),On="__reactFiber$"+Rs,wr="__reactProps$"+Rs,Cd="__reactContainer$"+Rs,mw="__reactEvents$"+Rs,NY="__reactListeners$"+Rs,CY="__reactHandles$"+Rs,KO="__reactResources$"+Rs,ym="__reactMarker$"+Rs;function ax(t){delete t[On],delete t[wr],delete t[mw],delete t[NY],delete t[CY]}function rd(t){var e=t[On];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Cd]||n[On]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=rL(t);t!==null;){if(n=t[On])return n;t=rL(t)}return e}t=n,n=t.parentNode}return null}function Md(t){if(t=t[On]||t[Cd]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Bp(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(G(33))}function pd(t){var e=t[KO];return e||(e=t[KO]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function kn(t){t[ym]=!0}var NL=new Set,CL={};function jl(t,e){Sd(t,e),Sd(t+"Capture",e)}function Sd(t,e){for(CL[t]=e,t=0;t<e.length;t++)NL.add(e[t])}var MY=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]*$"),XO={},JO={};function OY(t){return pw.call(JO,t)?!0:pw.call(XO,t)?!1:MY.test(t)?JO[t]=!0:(XO[t]=!0,!1)}function Lb(t,e,n){if(OY(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 Sb(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 go(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ML(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function DY(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 gw(t){if(!t._valueTracker){var e=ML(t)?"checked":"value";t._valueTracker=DY(t,e,""+t[e])}}function OL(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=ML(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function t_(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 LY=/[\n"\\]/g;function bo(t){return t.replace(LY,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function hw(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=""+go(e)):t.value!==""+go(e)&&(t.value=""+go(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?yw(t,a,go(e)):n!=null?yw(t,a,go(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=""+go(s):t.removeAttribute("name")}function DL(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)){gw(t);return}n=n!=null?""+go(n):"",e=e!=null?""+go(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),gw(t)}function yw(t,e,n){e==="number"&&t_(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function md(t,e,n,r){if(t=t.options,e){e={};for(var o=0;o<n.length;o++)e["$"+n[o]]=!0;for(n=0;n<t.length;n++)o=e.hasOwnProperty("$"+t[n].value),t[n].selected!==o&&(t[n].selected=o),o&&r&&(t[n].defaultSelected=!0)}else{for(n=""+go(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 LL(t,e,n){if(e!=null&&(e=""+go(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+go(n):""}function UL(t,e,n,r){if(e==null){if(r!=null){if(n!=null)throw Error(G(92));if(Up(r)){if(1<r.length)throw Error(G(93));r=r[0]}n=r}n==null&&(n=""),e=n}n=go(e),t.defaultValue=n,r=t.textContent,r===n&&r!==""&&r!==null&&(t.value=r),gw(t)}function Ed(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var UY=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 QO(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||UY.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function BL(t,e,n){if(e!=null&&typeof e!="object")throw Error(G(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&&QO(t,o,r)}else for(var i in e)e.hasOwnProperty(i)&&QO(t,i,e[i])}function sx(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 BY=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"]]),PY=/^[\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 Ub(t){return PY.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ua(){}var bw=null;function lx(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var od=null,gd=null;function ZO(t){var e=Md(t);if(e&&(t=e.stateNode)){var n=t[wr]||null;t:switch(t=e.stateNode,e.type){case"input":if(hw(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="'+bo(""+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(G(90));hw(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&&OL(r)}break t;case"textarea":LL(t,n.value,n.defaultValue);break t;case"select":e=n.value,e!=null&&md(t,!!n.multiple,e,!1)}}}var MT=!1;function PL(t,e,n){if(MT)return t(e,n);MT=!0;try{var r=t(e);return r}finally{if(MT=!1,(od!==null||gd!==null)&&(B_(),od&&(e=od,t=gd,gd=od=null,ZO(e),t)))for(e=0;e<t.length;e++)ZO(t[e])}}function tm(t,e){var n=t.stateNode;if(n===null)return null;var r=n[wr]||null;if(r===null)return null;n=r[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break t;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(G(231,e,typeof n));return n}var ga=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_w=!1;if(ga)try{Xu={},Object.defineProperty(Xu,"passive",{get:function(){_w=!0}}),window.addEventListener("test",Xu,Xu),window.removeEventListener("test",Xu,Xu)}catch{_w=!1}var Xu,fs=null,cx=null,Bb=null;function zL(){if(Bb)return Bb;var t,e=cx,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 Bb=o.slice(t,1<r?1-r:void 0)}function Pb(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 Eb(){return!0}function tD(){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)?Eb:tD,this.isPropagationStopped=tD,this}return Ne(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Eb)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Eb)},persist:function(){},isPersistent:Eb}),e}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},A_=xr(ql),bm=Ne({},ql,{view:0,detail:0}),zY=xr(bm),OT,DT,Rp,I_=Ne({},bm,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ux,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Rp&&(Rp&&t.type==="mousemove"?(OT=t.screenX-Rp.screenX,DT=t.screenY-Rp.screenY):DT=OT=0,Rp=t),OT)},movementY:function(t){return"movementY"in t?t.movementY:DT}}),eD=xr(I_),FY=Ne({},I_,{dataTransfer:0}),HY=xr(FY),GY=Ne({},bm,{relatedTarget:0}),LT=xr(GY),$Y=Ne({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),jY=xr($Y),qY=Ne({},ql,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),VY=xr(qY),YY=Ne({},ql,{data:0}),nD=xr(YY),WY={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},KY={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"},XY={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function JY(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=XY[t])?!!e[t]:!1}function ux(){return JY}var QY=Ne({},bm,{key:function(t){if(t.key){var e=WY[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Pb(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?KY[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ux,charCode:function(t){return t.type==="keypress"?Pb(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Pb(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ZY=xr(QY),tW=Ne({},I_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rD=xr(tW),eW=Ne({},bm,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ux}),nW=xr(eW),rW=Ne({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),oW=xr(rW),iW=Ne({},I_,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),aW=xr(iW),sW=Ne({},ql,{newState:0,oldState:0}),lW=xr(sW),cW=[9,13,27,32],dx=ga&&"CompositionEvent"in window,Fp=null;ga&&"documentMode"in document&&(Fp=document.documentMode);var uW=ga&&"TextEvent"in window&&!Fp,FL=ga&&(!dx||Fp&&8<Fp&&11>=Fp),oD=" ",iD=!1;function HL(t,e){switch(t){case"keyup":return cW.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function GL(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var id=!1;function dW(t,e){switch(t){case"compositionend":return GL(e);case"keypress":return e.which!==32?null:(iD=!0,oD);case"textInput":return t=e.data,t===oD&&iD?null:t;default:return null}}function fW(t,e){if(id)return t==="compositionend"||!dx&&HL(t,e)?(t=zL(),Bb=cx=fs=null,id=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return FL&&e.locale!=="ko"?null:e.data;default:return null}}var pW={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 aD(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!pW[t.type]:e==="textarea"}function $L(t,e,n,r){od?gd?gd.push(r):gd=[r]:od=r,e=b_(e,"onChange"),0<e.length&&(n=new A_("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Hp=null,em=null;function mW(t){P3(t,0)}function k_(t){var e=Bp(t);if(OL(e))return t}function sD(t,e){if(t==="change")return e}var jL=!1;ga&&(ga?(wb="oninput"in document,wb||(UT=document.createElement("div"),UT.setAttribute("oninput","return;"),wb=typeof UT.oninput=="function"),Tb=wb):Tb=!1,jL=Tb&&(!document.documentMode||9<document.documentMode));var Tb,wb,UT;function lD(){Hp&&(Hp.detachEvent("onpropertychange",qL),em=Hp=null)}function qL(t){if(t.propertyName==="value"&&k_(em)){var e=[];$L(e,em,t,lx(t)),PL(mW,e)}}function gW(t,e,n){t==="focusin"?(lD(),Hp=e,em=n,Hp.attachEvent("onpropertychange",qL)):t==="focusout"&&lD()}function hW(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return k_(em)}function yW(t,e){if(t==="click")return k_(e)}function bW(t,e){if(t==="input"||t==="change")return k_(e)}function _W(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var qr=typeof Object.is=="function"?Object.is:_W;function nm(t,e){if(qr(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(!pw.call(e,o)||!qr(t[o],e[o]))return!1}return!0}function cD(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function uD(t,e){var n=cD(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=cD(n)}}function VL(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?VL(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function YL(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=t_(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=t_(t.document)}return e}function fx(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 vW=ga&&"documentMode"in document&&11>=document.documentMode,ad=null,vw=null,Gp=null,Sw=!1;function dD(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sw||ad==null||ad!==t_(r)||(r=ad,"selectionStart"in r&&fx(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Gp&&nm(Gp,r)||(Gp=r,r=b_(vw,"onSelect"),0<r.length&&(e=new A_("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=ad)))}function Rl(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var sd={animationend:Rl("Animation","AnimationEnd"),animationiteration:Rl("Animation","AnimationIteration"),animationstart:Rl("Animation","AnimationStart"),transitionrun:Rl("Transition","TransitionRun"),transitionstart:Rl("Transition","TransitionStart"),transitioncancel:Rl("Transition","TransitionCancel"),transitionend:Rl("Transition","TransitionEnd")},BT={},WL={};ga&&(WL=document.createElement("div").style,"AnimationEvent"in window||(delete sd.animationend.animation,delete sd.animationiteration.animation,delete sd.animationstart.animation),"TransitionEvent"in window||delete sd.transitionend.transition);function Vl(t){if(BT[t])return BT[t];if(!sd[t])return t;var e=sd[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in WL)return BT[t]=e[n];return t}var KL=Vl("animationend"),XL=Vl("animationiteration"),JL=Vl("animationstart"),SW=Vl("transitionrun"),EW=Vl("transitionstart"),TW=Vl("transitioncancel"),QL=Vl("transitionend"),ZL=new Map,Ew="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(" ");Ew.push("scrollEnd");function Jo(t,e){ZL.set(t,e),jl(e,[t])}var e_=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)},mo=[],ld=0,px=0;function R_(){for(var t=ld,e=px=ld=0;e<t;){var n=mo[e];mo[e++]=null;var r=mo[e];mo[e++]=null;var o=mo[e];mo[e++]=null;var i=mo[e];if(mo[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&&t5(n,o,i)}}function N_(t,e,n,r){mo[ld++]=t,mo[ld++]=e,mo[ld++]=n,mo[ld++]=r,px|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function mx(t,e,n,r){return N_(t,e,n,r),n_(t)}function Yl(t,e){return N_(t,null,null,e),n_(t)}function t5(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-$r(n),t=i.hiddenUpdates,r=t[o],r===null?t[o]=[e]:r.push(e),e.lane=n|536870912),i):null}function n_(t){if(50<Jp)throw Jp=0,$w=null,Error(G(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var cd={};function wW(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 zr(t,e,n,r){return new wW(t,e,n,r)}function gx(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fa(t,e){var n=t.alternate;return n===null?(n=zr(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 e5(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 zb(t,e,n,r,o,i){var a=0;if(r=t,typeof t=="function")gx(t)&&(a=1);else if(typeof t=="string")a=IK(t,n,Ii.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case cw:return t=zr(31,n,e,o),t.elementType=cw,t.lanes=i,t;case ed:return Ll(n.children,o,i,e);case vL:a=8,o|=24;break;case aw:return t=zr(12,n,e,o|2),t.elementType=aw,t.lanes=i,t;case sw:return t=zr(13,n,e,o),t.elementType=sw,t.lanes=i,t;case lw:return t=zr(19,n,e,o),t.elementType=lw,t.lanes=i,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ca:a=10;break t;case SL:a=9;break t;case ex:a=11;break t;case nx:a=14;break t;case is:a=16,r=null;break t}a=29,n=Error(G(130,t===null?"null":typeof t,"")),r=null}return e=zr(a,n,e,o),e.elementType=t,e.type=r,e.lanes=i,e}function Ll(t,e,n,r){return t=zr(7,t,r,e),t.lanes=n,t}function PT(t,e,n){return t=zr(6,t,null,e),t.lanes=n,t}function n5(t){var e=zr(18,null,null,0);return e.stateNode=t,e}function zT(t,e,n){return e=zr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var fD=new WeakMap;function _o(t,e){if(typeof t=="object"&&t!==null){var n=fD.get(t);return n!==void 0?n:(e={value:t,source:e,stack:YO(e)},fD.set(t,e),e)}return{value:t,source:e,stack:YO(e)}}var ud=[],dd=0,r_=null,rm=0,ho=[],yo=0,xs=null,wi=1,xi="";function sa(t,e){ud[dd++]=rm,ud[dd++]=r_,r_=t,rm=e}function r5(t,e,n){ho[yo++]=wi,ho[yo++]=xi,ho[yo++]=xs,xs=t;var r=wi;t=xi;var o=32-$r(r)-1;r&=~(1<<o),n+=1;var i=32-$r(e)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,wi=1<<32-$r(e)+o|n<<o|r,xi=i+t}else wi=1<<i|n<<o|r,xi=t}function hx(t){t.return!==null&&(sa(t,1),r5(t,1,0))}function yx(t){for(;t===r_;)r_=ud[--dd],ud[dd]=null,rm=ud[--dd],ud[dd]=null;for(;t===xs;)xs=ho[--yo],ho[yo]=null,xi=ho[--yo],ho[yo]=null,wi=ho[--yo],ho[yo]=null}function o5(t,e){ho[yo++]=wi,ho[yo++]=xi,ho[yo++]=xs,wi=e.id,xi=e.overflow,xs=t}var Dn=null,Re=null,Zt=!1,ys=null,vo=!1,Tw=Error(G(519));function As(t){var e=Error(G(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw om(_o(e,t)),Tw}function pD(t){var e=t.stateNode,n=t.type,r=t.memoizedProps;switch(e[On]=t,e[wr]=r,n){case"dialog":Yt("cancel",e),Yt("close",e);break;case"iframe":case"object":case"embed":Yt("load",e);break;case"video":case"audio":for(n=0;n<lm.length;n++)Yt(lm[n],e);break;case"source":Yt("error",e);break;case"img":case"image":case"link":Yt("error",e),Yt("load",e);break;case"details":Yt("toggle",e);break;case"input":Yt("invalid",e),DL(e,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Yt("invalid",e);break;case"textarea":Yt("invalid",e),UL(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||F3(e.textContent,n)?(r.popover!=null&&(Yt("beforetoggle",e),Yt("toggle",e)),r.onScroll!=null&&Yt("scroll",e),r.onScrollEnd!=null&&Yt("scrollend",e),r.onClick!=null&&(e.onclick=ua),e=!0):e=!1,e||As(t,!0)}function mD(t){for(Dn=t.return;Dn;)switch(Dn.tag){case 5:case 31:case 13:vo=!1;return;case 27:case 3:vo=!0;return;default:Dn=Dn.return}}function Ju(t){if(t!==Dn)return!1;if(!Zt)return mD(t),Zt=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Ww(t.type,t.memoizedProps)),n=!n),n&&Re&&As(t),mD(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(G(317));Re=nL(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(G(317));Re=nL(t)}else e===27?(e=Re,Ns(t.type)?(t=Qw,Qw=null,Re=t):Re=e):Re=Dn?Eo(t.stateNode.nextSibling):null;return!0}function zl(){Re=Dn=null,Zt=!1}function FT(){var t=ys;return t!==null&&(Er===null?Er=t:Er.push.apply(Er,t),ys=null),t}function om(t){ys===null?ys=[t]:ys.push(t)}var ww=ki(null),Wl=null,da=null;function ss(t,e,n){xe(ww,e._currentValue),e._currentValue=n}function pa(t){t._currentValue=ww.current,Rn(ww)}function xw(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 Aw(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),xw(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(G(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),xw(a,n,t),a=null}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}}function Od(t,e,n,r){t=null;for(var o=e,i=!1;o!==null;){if(!i){if((o.flags&524288)!==0)i=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var a=o.alternate;if(a===null)throw Error(G(387));if(a=a.memoizedProps,a!==null){var s=o.type;qr(o.pendingProps.value,a.value)||(t!==null?t.push(s):t=[s])}}else if(o===Xb.current){if(a=o.alternate,a===null)throw Error(G(387));a.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(t!==null?t.push(um):t=[um])}o=o.return}t!==null&&Aw(e,t,n,r),e.flags|=262144}function o_(t){for(t=t.firstContext;t!==null;){if(!qr(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 i5(Wl,t)}function xb(t,e){return Wl===null&&Fl(t),i5(t,e)}function i5(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},da===null){if(t===null)throw Error(G(308));da=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else da=da.next=e;return n}var xW=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()})}},AW=yn.unstable_scheduleCallback,IW=yn.unstable_NormalPriority,sn={$$typeof:ca,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bx(){return{controller:new xW,data:new Map,refCount:0}}function _m(t){t.refCount--,t.refCount===0&&AW(IW,function(){t.controller.abort()})}var $p=null,Iw=0,Td=0,hd=null;function kW(t,e){if($p===null){var n=$p=[];Iw=0,Td=$x(),hd={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Iw++,e.then(gD,gD),e}function gD(){if(--Iw===0&&$p!==null){hd!==null&&(hd.status="fulfilled");var t=$p;$p=null,Td=0,hd=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function RW(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 hD=At.S;At.S=function(t,e){_3=Hr(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&kW(t,e),hD!==null&&hD(t,e)};var Ul=ki(null);function _x(){var t=Ul.current;return t!==null?t:Se.pooledCache}function Fb(t,e){e===null?xe(Ul,Ul.current):xe(Ul,e.pool)}function a5(){var t=_x();return t===null?null:{parent:sn._currentValue,pool:t}}var Dd=Error(G(460)),vx=Error(G(474)),C_=Error(G(542)),i_={then:function(){}};function yD(t){return t=t.status,t==="fulfilled"||t==="rejected"}function s5(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,_D(t),t;default:if(typeof e.status=="string")e.then(ua,ua);else{if(t=Se,t!==null&&100<t.shellSuspendCounter)throw Error(G(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,_D(t),t}throw Bl=e,Dd}}function Ml(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Bl=n,Dd):n}}var Bl=null;function bD(){if(Bl===null)throw Error(G(459));var t=Bl;return Bl=null,t}function _D(t){if(t===Dd||t===C_)throw Error(G(483))}var yd=null,im=0;function Ab(t){var e=im;return im+=1,yd===null&&(yd=[]),s5(yd,t,e)}function Np(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Ib(t,e){throw e.$$typeof===gY?Error(G(525)):(t=Object.prototype.toString.call(e),Error(G(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function l5(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=PT(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===ed?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),Np(b,S),b.return=h,b):(b=zb(S.type,S.key,S.props,null,h.mode,E),Np(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=zT(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=PT(""+b,h.mode,S),b.return=h,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case yb:return S=zb(b.type,b.key,b.props,null,h.mode,S),Np(S,b),S.return=h,S;case Lp:return b=zT(b,h.mode,S),b.return=h,b;case is:return b=Ml(b),u(h,b,S)}if(Up(b)||kp(b))return b=Ll(b,h.mode,S,null),b.return=h,b;if(typeof b.then=="function")return u(h,Ab(b),S);if(b.$$typeof===ca)return u(h,xb(h,b),S);Ib(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 yb:return S.key===R?l(h,b,S,E):null;case Lp:return S.key===R?c(h,b,S,E):null;case is:return S=Ml(S),p(h,b,S,E)}if(Up(S)||kp(S))return R!==null?null:d(h,b,S,E,null);if(typeof S.then=="function")return p(h,b,Ab(S),E);if(S.$$typeof===ca)return p(h,b,xb(h,S),E);Ib(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 yb:return h=h.get(E.key===null?S:E.key)||null,l(b,h,E,R);case Lp: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(Up(E)||kp(E))return h=h.get(S)||null,d(b,h,E,R,null);if(typeof E.then=="function")return f(h,b,S,Ab(E),R);if(E.$$typeof===ca)return f(h,b,S,xb(b,E),R);Ib(b,E)}return null}function m(h,b,S,E){for(var R=null,C=null,I=b,D=b=0,z=null;I!==null&&D<S.length;D++){I.index>D?(z=I,I=null):z=I.sibling;var U=p(h,I,S[D],E);if(U===null){I===null&&(I=z);break}t&&I&&U.alternate===null&&e(h,I),b=i(U,b,D),C===null?R=U:C.sibling=U,C=U,I=z}if(D===S.length)return n(h,I),Zt&&sa(h,D),R;if(I===null){for(;D<S.length;D++)I=u(h,S[D],E),I!==null&&(b=i(I,b,D),C===null?R=I:C.sibling=I,C=I);return Zt&&sa(h,D),R}for(I=r(I);D<S.length;D++)z=f(I,h,D,S[D],E),z!==null&&(t&&z.alternate!==null&&I.delete(z.key===null?D:z.key),b=i(z,b,D),C===null?R=z:C.sibling=z,C=z);return t&&I.forEach(function(O){return e(h,O)}),Zt&&sa(h,D),R}function _(h,b,S,E){if(S==null)throw Error(G(151));for(var R=null,C=null,I=b,D=b=0,z=null,U=S.next();I!==null&&!U.done;D++,U=S.next()){I.index>D?(z=I,I=null):z=I.sibling;var O=p(h,I,U.value,E);if(O===null){I===null&&(I=z);break}t&&I&&O.alternate===null&&e(h,I),b=i(O,b,D),C===null?R=O:C.sibling=O,C=O,I=z}if(U.done)return n(h,I),Zt&&sa(h,D),R;if(I===null){for(;!U.done;D++,U=S.next())U=u(h,U.value,E),U!==null&&(b=i(U,b,D),C===null?R=U:C.sibling=U,C=U);return Zt&&sa(h,D),R}for(I=r(I);!U.done;D++,U=S.next())U=f(I,h,D,U.value,E),U!==null&&(t&&U.alternate!==null&&I.delete(U.key===null?D:U.key),b=i(U,b,D),C===null?R=U:C.sibling=U,C=U);return t&&I.forEach(function(N){return e(h,N)}),Zt&&sa(h,D),R}function v(h,b,S,E){if(typeof S=="object"&&S!==null&&S.type===ed&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case yb:t:{for(var R=S.key;b!==null;){if(b.key===R){if(R=S.type,R===ed){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),Np(E,S),E.return=h,h=E;break t}n(h,b);break}else e(h,b);b=b.sibling}S.type===ed?(E=Ll(S.props.children,h.mode,E,S.key),E.return=h,h=E):(E=zb(S.type,S.key,S.props,null,h.mode,E),Np(E,S),E.return=h,h=E)}return a(h);case Lp:t:{for(R=S.key;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=zT(S,h.mode,E),E.return=h,h=E}return a(h);case is:return S=Ml(S),v(h,b,S,E)}if(Up(S))return m(h,b,S,E);if(kp(S)){if(R=kp(S),typeof R!="function")throw Error(G(150));return S=R.call(S),_(h,b,S,E)}if(typeof S.then=="function")return v(h,b,Ab(S),E);if(S.$$typeof===ca)return v(h,b,xb(h,S),E);Ib(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=PT(S,h.mode,E),E.return=h,h=E),a(h)):n(h,b)}return function(h,b,S,E){try{im=0;var R=v(h,b,S,E);return yd=null,R}catch(I){if(I===Dd||I===C_)throw I;var C=zr(29,I,null,h.mode);return C.lanes=E,C.return=h,C}finally{}}}var Hl=l5(!0),c5=l5(!1),as=!1;function Sx(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kw(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,(le&2)!==0){var o=r.pending;return o===null?e.next=e:(e.next=o.next,o.next=e),r.pending=e,e=n_(t),t5(t,null,n),e}return N_(t,r,e,n),n_(t)}function jp(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,IL(t,n)}}function HT(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 Rw=!1;function qp(){if(Rw){var t=hd;if(t!==null)throw t}}function Vp(t,e,n,r){Rw=!1;var o=t.updateQueue;as=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?i=c:a.next=c,a=l;var d=t.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==a&&(s===null?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l))}if(i!==null){var u=o.baseState;a=0,d=c=l=null,s=i;do{var p=s.lane&-536870913,f=p!==s.lane;if(f?(Jt&p)===p:(r&p)===p){p!==0&&p===Td&&(Rw=!0),d!==null&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});t:{var m=t,_=s;p=e;var v=n;switch(_.tag){case 1:if(m=_.payload,typeof m=="function"){u=m.call(v,u,p);break t}u=m;break t;case 3:m.flags=m.flags&-65537|128;case 0:if(m=_.payload,p=typeof m=="function"?m.call(v,u,p):m,p==null)break t;u=Ne({},u,p);break t;case 2:as=!0}}p=s.callback,p!==null&&(t.flags|=64,f&&(t.flags|=8192),f=o.callbacks,f===null?o.callbacks=[p]:f.push(p))}else f={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(c=d=f,l=u):d=d.next=f,a|=p;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;f=s,s=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);d===null&&(l=u),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=d,i===null&&(o.shared.lanes=0),ks|=a,t.lanes=a,t.memoizedState=u}}function u5(t,e){if(typeof t!="function")throw Error(G(191,t));t.call(e)}function d5(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)u5(n[t],e)}var wd=ki(null),a_=ki(0);function vD(t,e){t=_a,xe(a_,t),xe(wd,e),_a=t|e.baseLanes}function Nw(){xe(a_,_a),xe(wd,wd.current)}function Ex(){_a=a_.current,Rn(wd),Rn(a_)}var Vr=ki(null),So=null;function ls(t){var e=t.alternate;xe(Ke,Ke.current&1),xe(Vr,t),So===null&&(e===null||wd.current!==null||e.memoizedState!==null)&&(So=t)}function Cw(t){xe(Ke,Ke.current),xe(Vr,t),So===null&&(So=t)}function f5(t){t.tag===22?(xe(Ke,Ke.current),xe(Vr,t),So===null&&(So=t)):cs(t)}function cs(){xe(Ke,Ke.current),xe(Vr,Vr.current)}function Pr(t){Rn(Vr),So===t&&(So=null),Rn(Ke)}var Ke=ki(0);function s_(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Xw(n)||Jw(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var ha=0,zt=null,ge=null,on=null,l_=!1,bd=!1,Gl=!1,c_=0,am=0,_d=null,NW=0;function Ve(){throw Error(G(321))}function Tx(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!qr(t[n],e[n]))return!1;return!0}function wx(t,e,n,r,o,i){return ha=i,zt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,At.H=t===null||t.memoizedState===null?$5:Lx,Gl=!1,i=n(r,o),Gl=!1,bd&&(i=m5(e,n,r,o)),p5(t),i}function p5(t){At.H=sm;var e=ge!==null&&ge.next!==null;if(ha=0,on=ge=zt=null,l_=!1,am=0,_d=null,e)throw Error(G(300));t===null||ln||(t=t.dependencies,t!==null&&o_(t)&&(ln=!0))}function m5(t,e,n,r){zt=t;var o=0;do{if(bd&&(_d=null),am=0,bd=!1,25<=o)throw Error(G(301));if(o+=1,on=ge=null,t.updateQueue!=null){var i=t.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}At.H=j5,i=e(n,r)}while(bd);return i}function CW(){var t=At.H,e=t.useState()[0];return e=typeof e.then=="function"?vm(e):e,t=t.useState()[0],(ge!==null?ge.memoizedState:null)!==t&&(zt.flags|=1024),e}function xx(){var t=c_!==0;return c_=0,t}function Ax(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function Ix(t){if(l_){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}l_=!1}ha=0,on=ge=zt=null,bd=!1,am=c_=0,_d=null}function rr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?zt.memoizedState=on=t:on=on.next=t,on}function Xe(){if(ge===null){var t=zt.alternate;t=t!==null?t.memoizedState:null}else t=ge.next;var e=on===null?zt.memoizedState:on.next;if(e!==null)on=e,ge=t;else{if(t===null)throw zt.alternate===null?Error(G(467)):Error(G(310));ge=t,t={memoizedState:ge.memoizedState,baseState:ge.baseState,baseQueue:ge.baseQueue,queue:ge.queue,next:null},on===null?zt.memoizedState=on=t:on=on.next=t}return on}function M_(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vm(t){var e=am;return am+=1,_d===null&&(_d=[]),t=s5(_d,t,e),e=zt,(on===null?e.memoizedState:on.next)===null&&(e=e.alternate,At.H=e===null||e.memoizedState===null?$5:Lx),t}function O_(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return vm(t);if(t.$$typeof===ca)return Ln(t)}throw Error(G(438,String(t)))}function kx(t){var e=null,n=zt.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var r=zt.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(e={data:r.data.map(function(o){return o.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=M_(),zt.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),r=0;r<t;r++)n[r]=hY;return e.index++,n}function ya(t,e){return typeof e=="function"?e(t):e}function Hb(t){var e=Xe();return Rx(e,ge,t)}function Rx(t,e,n){var r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=n;var o=t.baseQueue,i=r.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}e.baseQueue=o=i,r.pending=null}if(i=t.baseState,o===null)t.memoizedState=i;else{e=o.next;var s=a=null,l=null,c=e,d=!1;do{var u=c.lane&-536870913;if(u!==c.lane?(Jt&u)===u:(ha&u)===u){var p=c.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),u===Td&&(d=!0);else if((ha&p)===p){c=c.next,p===Td&&(d=!0);continue}else u={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=u,a=i):l=l.next=u,zt.lanes|=p,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,zt.lanes|=u,ks|=u;c=c.next}while(c!==null&&c!==e);if(l===null?a=i:l.next=s,!qr(i,t.memoizedState)&&(ln=!0,d&&(n=hd,n!==null)))throw n;t.memoizedState=i,t.baseState=a,t.baseQueue=l,r.lastRenderedState=i}return o===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function GT(t){var e=Xe(),n=e.queue;if(n===null)throw Error(G(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);qr(i,e.memoizedState)||(ln=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function g5(t,e,n){var r=zt,o=Xe(),i=Zt;if(i){if(n===void 0)throw Error(G(407));n=n()}else n=e();var a=!qr((ge||o).memoizedState,n);if(a&&(o.memoizedState=n,ln=!0),o=o.queue,Nx(b5.bind(null,r,o,t),[t]),o.getSnapshot!==e||a||on!==null&&on.memoizedState.tag&1){if(r.flags|=2048,xd(9,{destroy:void 0},y5.bind(null,r,o,n,e),null),Se===null)throw Error(G(349));i||(ha&127)!==0||h5(r,e,n)}return n}function h5(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=zt.updateQueue,e===null?(e=M_(),zt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function y5(t,e,n,r){e.value=n,e.getSnapshot=r,_5(e)&&v5(t)}function b5(t,e,n){return n(function(){_5(e)&&v5(t)})}function _5(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!qr(t,n)}catch{return!0}}function v5(t){var e=Yl(t,2);e!==null&&Tr(e,t,2)}function Mw(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 S5(t,e,n,r){return t.baseState=n,Rx(t,ge,typeof r=="function"?r:ya)}function MW(t,e,n,r,o){if(L_(t))throw Error(G(485));if(t=e.action,t!==null){var i={payload:o,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){i.listeners.push(a)}};At.T!==null?n(!0):i.isTransition=!1,r(i),n=e.pending,n===null?(i.next=e.pending=i,E5(e,i)):(i.next=n.next,e.pending=n.next=i)}}function E5(t,e){var n=e.action,r=e.payload,o=t.state;if(e.isTransition){var i=At.T,a={};At.T=a;try{var s=n(o,r),l=At.S;l!==null&&l(a,s),SD(t,e,s)}catch(c){Ow(t,e,c)}finally{i!==null&&a.types!==null&&(i.types=a.types),At.T=i}}else try{i=n(o,r),SD(t,e,i)}catch(c){Ow(t,e,c)}}function SD(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){ED(t,e,r)},function(r){return Ow(t,e,r)}):ED(t,e,n)}function ED(t,e,n){e.status="fulfilled",e.value=n,T5(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,E5(t,n)))}function Ow(t,e,n){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do e.status="rejected",e.reason=n,T5(e),e=e.next;while(e!==r)}t.action=null}function T5(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function w5(t,e){return e}function TD(t,e){if(Zt){var n=Se.formState;if(n!==null){t:{var r=zt;if(Zt){if(Re){e:{for(var o=Re,i=vo;o.nodeType!==8;){if(!i){o=null;break e}if(o=Eo(o.nextSibling),o===null){o=null;break e}}i=o.data,o=i==="F!"||i==="F"?o:null}if(o){Re=Eo(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:w5,lastRenderedState:e},n.queue=r,n=F5.bind(null,zt,r),r.dispatch=n,r=Mw(!1),i=Dx.bind(null,zt,!1,r.queue),r=rr(),o={state:e,dispatch:null,action:t,pending:null},r.queue=o,n=MW.bind(null,zt,o,i,n),o.dispatch=n,r.memoizedState=t,[e,n,!1]}function wD(t){var e=Xe();return x5(e,ge,t)}function x5(t,e,n){if(e=Rx(t,e,w5)[0],t=Hb(ya)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var r=vm(e)}catch(a){throw a===Dd?C_:a}else r=e;e=Xe();var o=e.queue,i=o.dispatch;return n!==e.memoizedState&&(zt.flags|=2048,xd(9,{destroy:void 0},OW.bind(null,o,n),null)),[r,i,t]}function OW(t,e){t.action=e}function xD(t){var e=Xe(),n=ge;if(n!==null)return x5(e,n,t);Xe(),e=e.memoizedState,n=Xe();var r=n.queue.dispatch;return n.memoizedState=t,[e,r,!1]}function xd(t,e,n,r){return t={tag:t,create:n,deps:r,inst:e,next:null},e=zt.updateQueue,e===null&&(e=M_(),zt.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t),t}function A5(){return Xe().memoizedState}function Gb(t,e,n,r){var o=rr();zt.flags|=t,o.memoizedState=xd(1|e,{destroy:void 0},n,r===void 0?null:r)}function D_(t,e,n,r){var o=Xe();r=r===void 0?null:r;var i=o.memoizedState.inst;ge!==null&&r!==null&&Tx(r,ge.memoizedState.deps)?o.memoizedState=xd(e,i,n,r):(zt.flags|=t,o.memoizedState=xd(1|e,i,n,r))}function AD(t,e){Gb(8390656,8,t,e)}function Nx(t,e){D_(2048,8,t,e)}function DW(t){zt.flags|=4;var e=zt.updateQueue;if(e===null)e=M_(),zt.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function I5(t){var e=Xe().memoizedState;return DW({ref:e,nextImpl:t}),function(){if((le&2)!==0)throw Error(G(440));return e.impl.apply(void 0,arguments)}}function k5(t,e){return D_(4,2,t,e)}function R5(t,e){return D_(4,4,t,e)}function N5(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 C5(t,e,n){n=n!=null?n.concat([t]):null,D_(4,4,N5.bind(null,e,t),n)}function Cx(){}function M5(t,e){var n=Xe();e=e===void 0?null:e;var r=n.memoizedState;return e!==null&&Tx(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function O5(t,e){var n=Xe();e=e===void 0?null:e;var r=n.memoizedState;if(e!==null&&Tx(e,r[1]))return r[0];if(r=t(),Gl){ds(!0);try{t()}finally{ds(!1)}}return n.memoizedState=[r,e],r}function Mx(t,e,n){return n===void 0||(ha&1073741824)!==0&&(Jt&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=S3(),zt.lanes|=t,ks|=t,n)}function D5(t,e,n,r){return qr(n,e)?n:wd.current!==null?(t=Mx(t,n,r),qr(t,e)||(ln=!0),t):(ha&42)===0||(ha&1073741824)!==0&&(Jt&261930)===0?(ln=!0,t.memoizedState=n):(t=S3(),zt.lanes|=t,ks|=t,e)}function L5(t,e,n,r,o){var i=ce.p;ce.p=i!==0&&8>i?i:8;var a=At.T,s={};At.T=s,Dx(t,!1,e,n);try{var l=o(),c=At.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var d=RW(l,r);Yp(t,e,d,jr(t))}else Yp(t,e,r,jr(t))}catch(u){Yp(t,e,{then:function(){},status:"rejected",reason:u},jr())}finally{ce.p=i,a!==null&&s.types!==null&&(a.types=s.types),At.T=a}}function LW(){}function Dw(t,e,n,r){if(t.tag!==5)throw Error(G(476));var o=U5(t).queue;L5(t,o,e,Dl,n===null?LW:function(){return B5(t),n(r)})}function U5(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 B5(t){var e=U5(t);e.next===null&&(e=t.alternate.memoizedState),Yp(t,e.next.queue,{},jr())}function Ox(){return Ln(um)}function P5(){return Xe().memoizedState}function z5(){return Xe().memoizedState}function UW(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=jr();t=bs(n);var r=_s(e,t,n);r!==null&&(Tr(r,e,n),jp(r,e,n)),e={cache:bx()},t.payload=e;return}e=e.return}}function BW(t,e,n){var r=jr();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},L_(t)?H5(e,n):(n=mx(t,e,n,r),n!==null&&(Tr(n,t,r),G5(n,e,r)))}function F5(t,e,n){var r=jr();Yp(t,e,n,r)}function Yp(t,e,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(L_(t))H5(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,qr(s,a))return N_(t,e,o,0),Se===null&&R_(),!1}catch{}finally{}if(n=mx(t,e,o,r),n!==null)return Tr(n,t,r),G5(n,e,r),!0}return!1}function Dx(t,e,n,r){if(r={lane:2,revertLane:$x(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},L_(t)){if(e)throw Error(G(479))}else e=mx(t,n,r,2),e!==null&&Tr(e,t,2)}function L_(t){var e=t.alternate;return t===zt||e!==null&&e===zt}function H5(t,e){bd=l_=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function G5(t,e,n){if((n&4194048)!==0){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,IL(t,n)}}var sm={readContext:Ln,use:O_,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useLayoutEffect:Ve,useInsertionEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useSyncExternalStore:Ve,useId:Ve,useHostTransitionStatus:Ve,useFormState:Ve,useActionState:Ve,useOptimistic:Ve,useMemoCache:Ve,useCacheRefresh:Ve};sm.useEffectEvent=Ve;var $5={readContext:Ln,use:O_,useCallback:function(t,e){return rr().memoizedState=[t,e===void 0?null:e],t},useContext:Ln,useEffect:AD,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Gb(4194308,4,N5.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Gb(4194308,4,t,e)},useInsertionEffect:function(t,e){Gb(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=BW.bind(null,zt,t),[r.memoizedState,t]},useRef:function(t){var e=rr();return t={current:t},e.memoizedState=t},useState:function(t){t=Mw(t);var e=t.queue,n=F5.bind(null,zt,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Cx,useDeferredValue:function(t,e){var n=rr();return Mx(n,t,e)},useTransition:function(){var t=Mw(!1);return t=L5.bind(null,zt,t.queue,!0,!1),rr().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var r=zt,o=rr();if(Zt){if(n===void 0)throw Error(G(407));n=n()}else{if(n=e(),Se===null)throw Error(G(349));(Jt&127)!==0||h5(r,e,n)}o.memoizedState=n;var i={value:n,getSnapshot:e};return o.queue=i,AD(b5.bind(null,r,i,t),[t]),r.flags|=2048,xd(9,{destroy:void 0},y5.bind(null,r,i,n,e),null),n},useId:function(){var t=rr(),e=Se.identifierPrefix;if(Zt){var n=xi,r=wi;n=(r&~(1<<32-$r(r)-1)).toString(32)+n,e="_"+e+"R_"+n,n=c_++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=NW++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Ox,useFormState:TD,useActionState:TD,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=Dx.bind(null,zt,!0,n),n.dispatch=e,[t,e]},useMemoCache:kx,useCacheRefresh:function(){return rr().memoizedState=UW.bind(null,zt)},useEffectEvent:function(t){var e=rr(),n={impl:t};return e.memoizedState=n,function(){if((le&2)!==0)throw Error(G(440));return n.impl.apply(void 0,arguments)}}},Lx={readContext:Ln,use:O_,useCallback:M5,useContext:Ln,useEffect:Nx,useImperativeHandle:C5,useInsertionEffect:k5,useLayoutEffect:R5,useMemo:O5,useReducer:Hb,useRef:A5,useState:function(){return Hb(ya)},useDebugValue:Cx,useDeferredValue:function(t,e){var n=Xe();return D5(n,ge.memoizedState,t,e)},useTransition:function(){var t=Hb(ya)[0],e=Xe().memoizedState;return[typeof t=="boolean"?t:vm(t),e]},useSyncExternalStore:g5,useId:P5,useHostTransitionStatus:Ox,useFormState:wD,useActionState:wD,useOptimistic:function(t,e){var n=Xe();return S5(n,ge,t,e)},useMemoCache:kx,useCacheRefresh:z5};Lx.useEffectEvent=I5;var j5={readContext:Ln,use:O_,useCallback:M5,useContext:Ln,useEffect:Nx,useImperativeHandle:C5,useInsertionEffect:k5,useLayoutEffect:R5,useMemo:O5,useReducer:GT,useRef:A5,useState:function(){return GT(ya)},useDebugValue:Cx,useDeferredValue:function(t,e){var n=Xe();return ge===null?Mx(n,t,e):D5(n,ge.memoizedState,t,e)},useTransition:function(){var t=GT(ya)[0],e=Xe().memoizedState;return[typeof t=="boolean"?t:vm(t),e]},useSyncExternalStore:g5,useId:P5,useHostTransitionStatus:Ox,useFormState:xD,useActionState:xD,useOptimistic:function(t,e){var n=Xe();return ge!==null?S5(n,ge,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:kx,useCacheRefresh:z5};j5.useEffectEvent=I5;function $T(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Ne({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Lw={enqueueSetState:function(t,e,n){t=t._reactInternals;var r=jr(),o=bs(r);o.payload=e,n!=null&&(o.callback=n),e=_s(t,o,r),e!==null&&(Tr(e,t,r),jp(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=jr(),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),jp(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=jr(),r=bs(n);r.tag=2,e!=null&&(r.callback=e),e=_s(t,r,n),e!==null&&(Tr(e,t,n),jp(e,t,n))}};function ID(t,e,n,r,o,i,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,a):e.prototype&&e.prototype.isPureReactComponent?!nm(n,r)||!nm(o,i):!0}function kD(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&&Lw.enqueueReplaceState(e,e.state,null)}function $l(t,e){var n=e;if("ref"in e){n={};for(var r in e)r!=="ref"&&(n[r]=e[r])}if(t=t.defaultProps){n===e&&(n=Ne({},n));for(var o in t)n[o]===void 0&&(n[o]=t[o])}return n}function q5(t){e_(t)}function V5(t){console.error(t)}function Y5(t){e_(t)}function u_(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(r){setTimeout(function(){throw r})}}function RD(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 Uw(t,e,n){return n=bs(n),n.tag=3,n.payload={element:null},n.callback=function(){u_(t,e)},n}function W5(t){return t=bs(t),t.tag=3,t}function K5(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(){RD(e,n,r)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){RD(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 PW(t,e,n,r,o){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(e=n.alternate,e!==null&&Od(e,n,o,!0),n=Vr.current,n!==null){switch(n.tag){case 31:case 13:return So===null?g_():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===i_?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([r]):e.add(r),tw(t,r,o)),!1;case 22:return n.flags|=65536,r===i_?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)),tw(t,r,o)),!1}throw Error(G(435,n.tag))}return tw(t,r,o),g_(),!1}if(Zt)return e=Vr.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=o,r!==Tw&&(t=Error(G(422),{cause:r}),om(_o(t,n)))):(r!==Tw&&(e=Error(G(423),{cause:r}),om(_o(e,n))),t=t.current.alternate,t.flags|=65536,o&=-o,t.lanes|=o,r=_o(r,n),o=Uw(t.stateNode,r,o),HT(t,o),Ye!==4&&(Ye=2)),!1;var i=Error(G(520),{cause:r});if(i=_o(i,n),Xp===null?Xp=[i]:Xp.push(i),Ye!==4&&(Ye=2),e===null)return!0;r=_o(r,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=o&-o,n.lanes|=t,t=Uw(n.stateNode,r,t),HT(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=W5(o),K5(o,t,n,r),HT(n,o),!1}n=n.return}while(n!==null);return!1}var Ux=Error(G(461)),ln=!1;function Mn(t,e,n,r){e.child=t===null?c5(e,null,n,r):Hl(e,t.child,n,r)}function ND(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=wx(t,e,n,a,i,o),s=xx(),t!==null&&!ln?(Ax(t,e,o),ba(t,e,o)):(Zt&&s&&hx(e),e.flags|=1,Mn(t,e,r,o),e.child)}function CD(t,e,n,r,o){if(t===null){var i=n.type;return typeof i=="function"&&!gx(i)&&i.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=i,X5(t,e,i,r,o)):(t=zb(n.type,null,r,e,e.mode,o),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!Bx(t,o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:nm,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 X5(t,e,n,r,o){if(t!==null){var i=t.memoizedProps;if(nm(i,r)&&t.ref===e.ref)if(ln=!1,e.pendingProps=r=i,Bx(t,o))(t.flags&131072)!==0&&(ln=!0);else return e.lanes=t.lanes,ba(t,e,o)}return Bw(t,e,n,r,o)}function J5(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 MD(t,e,i,n,r)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Fb(e,i!==null?i.cachePool:null),i!==null?vD(e,i):Nw(),f5(e);else return r=e.lanes=536870912,MD(t,e,i!==null?i.baseLanes|n:n,n,r)}else i!==null?(Fb(e,i.cachePool),vD(e,i),cs(e),e.memoizedState=null):(t!==null&&Fb(e,null),Nw(),cs(e));return Mn(t,e,o,n),e.child}function Pp(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function MD(t,e,n,r,o){var i=_x();return i=i===null?null:{parent:sn._currentValue,pool:i},e.memoizedState={baseLanes:n,cachePool:i},t!==null&&Fb(e,null),Nw(),f5(e),t!==null&&Od(t,e,r,!0),e.childLanes=o,null}function $b(t,e){return e=d_({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function OD(t,e,n){return Hl(e,t.child,null,n),t=$b(e,e.pendingProps),t.flags|=2,Pr(e),e.memoizedState=null,t}function zW(t,e,n){var r=e.pendingProps,o=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(Zt){if(r.mode==="hidden")return t=$b(e,r),e.lanes=536870912,Pp(null,t);if(Cw(e),(t=Re)?(t=$3(t,vo),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=n5(t),n.return=e,e.child=n,Dn=e,Re=null)):t=null,t===null)throw As(e);return e.lanes=536870912,null}return $b(e,r)}var i=t.memoizedState;if(i!==null){var a=i.dehydrated;if(Cw(e),o)if(e.flags&256)e.flags&=-257,e=OD(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(G(558));else if(ln||Od(t,e,n,!1),o=(n&t.childLanes)!==0,ln||o){if(r=Se,r!==null&&(a=kL(r,n),a!==0&&a!==i.retryLane))throw i.retryLane=a,Yl(t,a),Tr(r,t,a),Ux;g_(),e=OD(t,e,n)}else t=i.treeContext,Re=Eo(a.nextSibling),Dn=e,Zt=!0,ys=null,vo=!1,t!==null&&o5(e,t),e=$b(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 jb(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(G(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Bw(t,e,n,r,o){return Fl(e),n=wx(t,e,n,r,void 0,o),r=xx(),t!==null&&!ln?(Ax(t,e,o),ba(t,e,o)):(Zt&&r&&hx(e),e.flags|=1,Mn(t,e,n,o),e.child)}function DD(t,e,n,r,o,i){return Fl(e),e.updateQueue=null,n=m5(e,r,n,o),p5(t),r=xx(),t!==null&&!ln?(Ax(t,e,i),ba(t,e,i)):(Zt&&r&&hx(e),e.flags|=1,Mn(t,e,n,i),e.child)}function LD(t,e,n,r,o){if(Fl(e),e.stateNode===null){var i=cd,a=n.contextType;typeof a=="object"&&a!==null&&(i=Ln(a)),i=new n(r,i),e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Lw,e.stateNode=i,i._reactInternals=e,i=e.stateNode,i.props=r,i.state=e.memoizedState,i.refs={},Sx(e),a=n.contextType,i.context=typeof a=="object"&&a!==null?Ln(a):cd,i.state=e.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&($T(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&&Lw.enqueueReplaceState(i,i.state,null),Vp(e,r,i,o),qp(),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308),r=!0}else if(t===null){i=e.stateNode;var s=e.memoizedProps,l=$l(n,s);i.props=l;var c=i.context,d=n.contextType;a=cd,typeof d=="object"&&d!==null&&(a=Ln(d));var u=n.getDerivedStateFromProps;d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function",s=e.pendingProps!==s,d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s||c!==a)&&kD(e,i,r,a),as=!1;var p=e.memoizedState;i.state=p,Vp(e,r,i,o),qp(),c=e.memoizedState,s||p!==c||as?(typeof u=="function"&&($T(e,n,u,r),c=e.memoizedState),(l=as||ID(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,kw(t,e),a=e.memoizedProps,d=$l(n,a),i.props=d,u=e.pendingProps,p=i.context,c=n.contextType,l=cd,typeof c=="object"&&c!==null&&(l=Ln(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==u||p!==l)&&kD(e,i,r,l),as=!1,p=e.memoizedState,i.state=p,Vp(e,r,i,o),qp();var f=e.memoizedState;a!==u||p!==f||as||t!==null&&t.dependencies!==null&&o_(t.dependencies)?(typeof s=="function"&&($T(e,n,s,r),f=e.memoizedState),(d=as||ID(e,n,d,r,p,f,l)||t!==null&&t.dependencies!==null&&o_(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,jb(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 UD(t,e,n,r){return zl(),e.flags|=256,Mn(t,e,n,r),e.child}var jT={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qT(t){return{baseLanes:t,cachePool:a5()}}function VT(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Fr),t}function Q5(t,e,n){var r=e.pendingProps,o=!1,i=(e.flags&128)!==0,a;if((a=i)||(a=t!==null&&t.memoizedState===null?!1:(Ke.current&2)!==0),a&&(o=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(Zt){if(o?ls(e):cs(e),(t=Re)?(t=$3(t,vo),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=n5(t),n.return=e,e.child=n,Dn=e,Re=null)):t=null,t===null)throw As(e);return Jw(t)?e.lanes=32:e.lanes=536870912,null}var s=r.children;return r=r.fallback,o?(cs(e),o=e.mode,s=d_({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=qT(n),r.childLanes=VT(t,a,n),e.memoizedState=jT,Pp(null,r)):(ls(e),Pw(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=YT(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=d_({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=qT(n),r.childLanes=VT(t,a,n),e.memoizedState=jT,e=Pp(null,r));else if(ls(e),Jw(s)){if(a=s.nextSibling&&s.nextSibling.dataset,a)var c=a.dgst;a=c,r=Error(G(419)),r.stack="",r.digest=a,om({value:r,source:null,stack:null}),e=YT(t,e,n)}else if(ln||Od(t,e,n,!1),a=(n&t.childLanes)!==0,ln||a){if(a=Se,a!==null&&(r=kL(a,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Yl(t,r),Tr(a,t,r),Ux;Xw(s)||g_(),e=YT(t,e,n)}else Xw(s)?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Re=Eo(s.nextSibling),Dn=e,Zt=!0,ys=null,vo=!1,t!==null&&o5(e,t),e=Pw(e,r.children),e.flags|=4096);return e}return o?(cs(e),s=r.fallback,o=e.mode,l=t.child,c=l.sibling,r=fa(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=fa(c,s):(s=Ll(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,Pp(null,r),r=e.child,s=t.child.memoizedState,s===null?s=qT(n):(o=s.cachePool,o!==null?(l=sn._currentValue,o=o.parent!==l?{parent:l,pool:l}:o):o=a5(),s={baseLanes:s.baseLanes|n,cachePool:o}),r.memoizedState=s,r.childLanes=VT(t,a,n),e.memoizedState=jT,Pp(t.child,r)):(ls(e),n=t.child,t=n.sibling,n=fa(n,{mode:"visible",children:r.children}),n.return=e,n.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=n,e.memoizedState=null,n)}function Pw(t,e){return e=d_({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function d_(t,e){return t=zr(22,t,null,e),t.lanes=0,t}function YT(t,e,n){return Hl(e,t.child,null,n),t=Pw(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function BD(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),xw(t.return,e,n)}function WT(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 Z5(t,e,n){var r=e.pendingProps,o=r.revealOrder,i=r.tail;r=r.children;var a=Ke.current,s=(a&2)!==0;if(s?(a=a&1|2,e.flags|=128):a&=1,xe(Ke,a),Mn(t,e,r,n),r=Zt?rm:0,!s&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&BD(t,n,e);else if(t.tag===19)BD(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&&s_(t)===null&&(o=n),n=n.sibling;n=o,n===null?(o=e.child,e.child=null):(o=n.sibling,n.sibling=null),WT(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&&s_(t)===null){e.child=o;break}t=o.sibling,o.sibling=n,n=o,o=t}WT(e,!0,n,null,i,r);break;case"together":WT(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(Od(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(G(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 Bx(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&o_(t)))}function FW(t,e,n){switch(e.tag){case 3:Jb(e,e.stateNode.containerInfo),ss(e,sn,t.memoizedState.cache),zl();break;case 27:case 5:fw(e);break;case 4:Jb(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,Cw(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?Q5(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||(Od(t,e,n,!1),r=(n&e.childLanes)!==0),o){if(r)return Z5(t,e,n);e.flags|=128}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),xe(Ke,Ke.current),r)break;return null;case 22:return e.lanes=0,J5(t,e,n,e.pendingProps);case 24:ss(e,sn,t.memoizedState.cache)}return ba(t,e,n)}function t3(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ln=!0;else{if(!Bx(t,n)&&(e.flags&128)===0)return ln=!1,FW(t,e,n);ln=(t.flags&131072)!==0}else ln=!1,Zt&&(e.flags&1048576)!==0&&r5(e,rm,e.index);switch(e.lanes=0,e.tag){case 16:t:{var r=e.pendingProps;if(t=Ml(e.elementType),e.type=t,typeof t=="function")gx(t)?(r=$l(t,r),e.tag=1,e=LD(null,e,t,r,n)):(e.tag=0,e=Bw(null,e,t,r,n));else{if(t!=null){var o=t.$$typeof;if(o===ex){e.tag=11,e=ND(null,e,t,r,n);break t}else if(o===nx){e.tag=14,e=CD(null,e,t,r,n);break t}}throw e=uw(t)||t,Error(G(306,e,""))}}return e;case 0:return Bw(t,e,e.type,e.pendingProps,n);case 1:return r=e.type,o=$l(r,e.pendingProps),LD(t,e,r,o,n);case 3:t:{if(Jb(e,e.stateNode.containerInfo),t===null)throw Error(G(387));r=e.pendingProps;var i=e.memoizedState;o=i.element,kw(t,e),Vp(e,r,null,n);var a=e.memoizedState;if(r=a.cache,ss(e,sn,r),r!==i.cache&&Aw(e,[sn],n,!0),qp(),r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){e=UD(t,e,r,n);break t}else if(r!==o){o=_o(Error(G(424)),e),om(o),e=UD(t,e,r,n);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Re=Eo(t.firstChild),Dn=e,Zt=!0,ys=null,vo=!0,n=c5(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 jb(t,e),t===null?(n=iL(e.type,null,e.pendingProps,null))?e.memoizedState=n:Zt||(n=e.type,t=e.pendingProps,r=__(hs.current).createElement(n),r[On]=e,r[wr]=t,Un(r,n,t),kn(r),e.stateNode=r):e.memoizedState=iL(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return fw(e),t===null&&Zt&&(r=e.stateNode=j3(e.type,e.pendingProps,hs.current),Dn=e,vo=!0,o=Re,Ns(e.type)?(Qw=o,Re=Eo(r.firstChild)):Re=o),Mn(t,e,e.pendingProps.children,n),jb(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Zt&&((o=r=Re)&&(r=mK(r,e.type,e.pendingProps,vo),r!==null?(e.stateNode=r,Dn=e,Re=Eo(r.firstChild),vo=!1,o=!0):o=!1),o||As(e)),fw(e),o=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,r=i.children,Ww(o,i)?r=null:a!==null&&Ww(o,a)&&(e.flags|=32),e.memoizedState!==null&&(o=wx(t,e,CW,null,null,n),um._currentValue=o),jb(t,e),Mn(t,e,r,n),e.child;case 6:return t===null&&Zt&&((t=n=Re)&&(n=gK(n,e.pendingProps,vo),n!==null?(e.stateNode=n,Dn=e,Re=null,t=!0):t=!1),t||As(e)),null;case 13:return Q5(t,e,n);case 4:return Jb(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 ND(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 CD(t,e,e.type,e.pendingProps,n);case 15:return X5(t,e,e.type,e.pendingProps,n);case 19:return Z5(t,e,n);case 31:return zW(t,e,n);case 22:return J5(t,e,n,e.pendingProps);case 24:return Fl(e),r=Ln(sn),t===null?(o=_x(),o===null&&(o=Se,i=bx(),o.pooledCache=i,i.refCount++,i!==null&&(o.pooledCacheLanes|=n),o=i),e.memoizedState={parent:r,cache:o},Sx(e),ss(e,sn,o)):((t.lanes&n)!==0&&(kw(t,e),Vp(e,null,null,n),qp()),o=t.memoizedState,i=e.memoizedState,o.parent!==r?(o={parent:r,cache:r},e.memoizedState=o,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=o),ss(e,sn,r)):(r=i.cache,ss(e,sn,r),r!==o.cache&&Aw(e,[sn],n,!0))),Mn(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(G(156,e.tag))}function ra(t){t.flags|=4}function KT(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(w3())t.flags|=8192;else throw Bl=i_,vx}else t.flags&=-16777217}function PD(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Y3(e))if(w3())t.flags|=8192;else throw Bl=i_,vx}function kb(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?xL():536870912,t.lanes|=e,Ad|=e)}function Cp(t,e){if(!Zt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function ke(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 HW(t,e,n){var r=e.pendingProps;switch(yx(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ke(e),null;case 1:return ke(e),null;case 3:return n=e.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),pa(sn),vd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Ju(e)?ra(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,FT())),ke(e),null;case 26:var o=e.type,i=e.memoizedState;return t===null?(ra(e),i!==null?(ke(e),PD(e,i)):(ke(e),KT(e,o,null,r,n))):i?i!==t.memoizedState?(ra(e),ke(e),PD(e,i)):(ke(e),e.flags&=-16777217):(t=t.memoizedProps,t!==r&&ra(e),ke(e),KT(e,o,t,r,n)),null;case 27:if(Qb(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(G(166));return ke(e),null}t=Ii.current,Ju(e)?pD(e,t):(t=j3(o,r,n),e.stateNode=t,ra(e))}return ke(e),null;case 5:if(Qb(e),o=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==r&&ra(e);else{if(!r){if(e.stateNode===null)throw Error(G(166));return ke(e),null}if(i=Ii.current,Ju(e))pD(e,i);else{var a=__(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 ke(e),KT(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(G(166));if(t=hs.current,Ju(e)){if(t=e.stateNode,n=e.memoizedProps,r=null,o=Dn,o!==null)switch(o.tag){case 27:case 5:r=o.memoizedProps}t[On]=e,t=!!(t.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||F3(t.nodeValue,n)),t||As(e,!0)}else t=__(t).createTextNode(r),t[On]=e,e.stateNode=t}return ke(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(r=Ju(e),n!==null){if(t===null){if(!r)throw Error(G(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(G(557));t[On]=e}else zl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ke(e),t=!1}else n=FT(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(Pr(e),e):(Pr(e),null);if((e.flags&128)!==0)throw Error(G(558))}return ke(e),null;case 13:if(r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(o=Ju(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(G(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(G(317));o[On]=e}else zl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ke(e),o=!1}else o=FT(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),o=!0;if(!o)return e.flags&256?(Pr(e),e):(Pr(e),null)}return Pr(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),kb(e,e.updateQueue),ke(e),null);case 4:return vd(),t===null&&jx(e.stateNode.containerInfo),ke(e),null;case 10:return pa(e.type),ke(e),null;case 19:if(Rn(Ke),r=e.memoizedState,r===null)return ke(e),null;if(o=(e.flags&128)!==0,i=r.rendering,i===null)if(o)Cp(r,!1);else{if(Ye!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(i=s_(t),i!==null){for(e.flags|=128,Cp(r,!1),t=i.updateQueue,e.updateQueue=t,kb(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)e5(n,t),n=n.sibling;return xe(Ke,Ke.current&1|2),Zt&&sa(e,r.treeForkCount),e.child}t=t.sibling}r.tail!==null&&Hr()>p_&&(e.flags|=128,o=!0,Cp(r,!1),e.lanes=4194304)}else{if(!o)if(t=s_(i),t!==null){if(e.flags|=128,o=!0,t=t.updateQueue,e.updateQueue=t,kb(e,t),Cp(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Zt)return ke(e),null}else 2*Hr()-r.renderingStartTime>p_&&n!==536870912&&(e.flags|=128,o=!0,Cp(r,!1),e.lanes=4194304);r.isBackwards?(i.sibling=e.child,e.child=i):(t=r.last,t!==null?t.sibling=i:e.child=i,r.last=i)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=Hr(),t.sibling=null,n=Ke.current,xe(Ke,o?n&1|2:n&1),Zt&&sa(e,r.treeForkCount),t):(ke(e),null);case 22:case 23:return Pr(e),Ex(),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&&(ke(e),e.subtreeFlags&6&&(e.flags|=8192)):ke(e),n=e.updateQueue,n!==null&&kb(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),r=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),r!==n&&(e.flags|=2048),t!==null&&Rn(Ul),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),pa(sn),ke(e),null;case 25:return null;case 30:return null}throw Error(G(156,e.tag))}function GW(t,e){switch(yx(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return pa(sn),vd(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Qb(e),null;case 31:if(e.memoizedState!==null){if(Pr(e),e.alternate===null)throw Error(G(340));zl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Pr(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(G(340));zl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Rn(Ke),null;case 4:return vd(),null;case 10:return pa(e.type),null;case 22:case 23:return Pr(e),Ex(),t!==null&&Rn(Ul),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return pa(sn),null;case 25:return null;default:return null}}function e3(t,e){switch(yx(e),e.tag){case 3:pa(sn),vd();break;case 26:case 27:case 5:Qb(e);break;case 4:vd();break;case 31:e.memoizedState!==null&&Pr(e);break;case 13:Pr(e);break;case 19:Rn(Ke);break;case 10:pa(e.type);break;case 22:case 23:Pr(e),Ex(),t!==null&&Rn(Ul);break;case 24:pa(sn)}}function Sm(t,e){try{var n=e.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var o=r.next;n=o;do{if((n.tag&t)===t){r=void 0;var i=n.create,a=n.inst;r=i(),a.destroy=r}n=n.next}while(n!==o)}}catch(s){fe(e,e.return,s)}}function 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){fe(o,l,d)}}}r=r.next}while(r!==i)}}catch(d){fe(e,e.return,d)}}function n3(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{d5(e,n)}catch(r){fe(t,t.return,r)}}}function r3(t,e,n){n.props=$l(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(r){fe(t,e,r)}}function Wp(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof n=="function"?t.refCleanup=n(r):n.current=r}}catch(o){fe(t,e,o)}}function Ai(t,e){var n=t.ref,r=t.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(o){fe(t,e,o)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){fe(t,e,o)}else n.current=null}function o3(t){var e=t.type,n=t.memoizedProps,r=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break t;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(o){fe(t,t.return,o)}}function XT(t,e,n){try{var r=t.stateNode;lK(r,t.type,n,e),r[wr]=e}catch(o){fe(t,t.return,o)}}function i3(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ns(t.type)||t.tag===4}function JT(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||i3(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 zw(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(zw(t,e,n),t=t.sibling;t!==null;)zw(t,e,n),t=t.sibling}function f_(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(f_(t,e,n),t=t.sibling;t!==null;)f_(t,e,n),t=t.sibling}function a3(t){var e=t.stateNode,n=t.memoizedProps;try{for(var r=t.type,o=e.attributes;o.length;)e.removeAttributeNode(o[0]);Un(e,r,n),e[On]=t,e[wr]=n}catch(i){fe(t,t.return,i)}}var la=!1,an=!1,QT=!1,zD=typeof WeakSet=="function"?WeakSet:Set,In=null;function $W(t,e){if(t=t.containerInfo,Vw=T_,t=YL(t),fx(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(Yw={focusedElem:t,selectionRange:n},T_=!1,In=e;In!==null;)if(e=In,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,In=t;else for(;In!==null;){switch(e=In,i=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)o=t[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&i!==null){t=void 0,n=e,o=i.memoizedProps,i=i.memoizedState,r=n.stateNode;try{var m=$l(n.type,o);t=r.getSnapshotBeforeUpdate(m,i),r.__reactInternalSnapshotBeforeUpdate=t}catch(_){fe(n,n.return,_)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Kw(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Kw(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(G(163))}if(t=e.sibling,t!==null){t.return=e.return,In=t;break}In=e.return}}function s3(t,e,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ia(t,n),r&4&&Sm(5,n);break;case 1:if(ia(t,n),r&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(a){fe(n,n.return,a)}else{var o=$l(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(o,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){fe(n,n.return,a)}}r&64&&n3(n),r&512&&Wp(n,n.return);break;case 3:if(ia(t,n),r&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{d5(t,e)}catch(a){fe(n,n.return,a)}}break;case 27:e===null&&r&4&&a3(n);case 26:case 5:ia(t,n),e===null&&r&4&&o3(n),r&512&&Wp(n,n.return);break;case 12:ia(t,n);break;case 31:ia(t,n),r&4&&u3(t,n);break;case 13:ia(t,n),r&4&&d3(t,n),r&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=QW.bind(null,n),hK(t,n))));break;case 22:if(r=n.memoizedState!==null||la,!r){e=e!==null&&e.memoizedState!==null||an,o=la;var i=an;la=r,(an=e)&&!i?aa(t,n,(n.subtreeFlags&8772)!==0):ia(t,n),la=o,an=i}break;case 30:break;default:ia(t,n)}}function l3(t){var e=t.alternate;e!==null&&(t.alternate=null,l3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&ax(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ze=null,Sr=!1;function oa(t,e,n){for(n=n.child;n!==null;)c3(t,e,n),n=n.sibling}function c3(t,e,n){if(Gr&&typeof Gr.onCommitFiberUnmount=="function")try{Gr.onCommitFiberUnmount(mm,n)}catch{}switch(n.tag){case 26:an||Ai(n,e),oa(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:an||Ai(n,e);var r=ze,o=Sr;Ns(n.type)&&(ze=n.stateNode,Sr=!1),oa(t,e,n),Qp(n.stateNode),ze=r,Sr=o;break;case 5:an||Ai(n,e);case 6:if(r=ze,o=Sr,ze=null,oa(t,e,n),ze=r,Sr=o,ze!==null)if(Sr)try{(ze.nodeType===9?ze.body:ze.nodeName==="HTML"?ze.ownerDocument.body:ze).removeChild(n.stateNode)}catch(i){fe(n,e,i)}else try{ze.removeChild(n.stateNode)}catch(i){fe(n,e,i)}break;case 18:ze!==null&&(Sr?(t=ze,tL(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Nd(t)):tL(ze,n.stateNode));break;case 4:r=ze,o=Sr,ze=n.stateNode.containerInfo,Sr=!0,oa(t,e,n),ze=r,Sr=o;break;case 0:case 11:case 14:case 15:Is(2,n,e),an||Is(4,n,e),oa(t,e,n);break;case 1:an||(Ai(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"&&r3(n,e,r)),oa(t,e,n);break;case 21:oa(t,e,n);break;case 22:an=(r=an)||n.memoizedState!==null,oa(t,e,n),an=r;break;default:oa(t,e,n)}}function u3(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Nd(t)}catch(n){fe(e,e.return,n)}}}function d3(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Nd(t)}catch(n){fe(e,e.return,n)}}function jW(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new zD),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new zD),e;default:throw Error(G(435,t.tag))}}function Rb(t,e){var n=jW(t);e.forEach(function(r){if(!n.has(r)){n.add(r);var o=ZW.bind(null,t,r);r.then(o,o)}})}function _r(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r],i=t,a=e,s=a;t:for(;s!==null;){switch(s.tag){case 27:if(Ns(s.type)){ze=s.stateNode,Sr=!1;break t}break;case 5:ze=s.stateNode,Sr=!1;break t;case 3:case 4:ze=s.stateNode.containerInfo,Sr=!0;break t}s=s.return}if(ze===null)throw Error(G(160));c3(i,a,o),ze=null,Sr=!1,i=o.alternate,i!==null&&(i.return=null),o.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)f3(e,t),e=e.sibling}var Xo=null;function f3(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),Sm(3,t),Is(5,t,t.return));break;case 1:_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),r&64&&la&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var o=Xo;if(_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),r&4){var i=n!==null?n.memoizedState:null;if(r=t.memoizedState,n===null)if(r===null)if(t.stateNode===null){t:{r=t.type,n=t.memoizedProps,o=o.ownerDocument||o;e:switch(r){case"title":i=o.getElementsByTagName("title")[0],(!i||i[ym]||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,kn(i),r=i;break t;case"link":var a=sL("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=sL("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(G(468,r))}i[On]=t,kn(i),r=i}t.stateNode=r}else lL(o,t.type,t.stateNode);else t.stateNode=aL(o,r,t.memoizedProps);else i!==r?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,r===null?lL(o,t.type,t.stateNode):aL(o,r,t.memoizedProps)):r===null&&t.stateNode!==null&&XT(t,t.memoizedProps,n.memoizedProps)}break;case 27:_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),n!==null&&r&4&&XT(t,t.memoizedProps,n.memoizedProps);break;case 5:if(_r(e,t),vr(t),r&512&&(an||n===null||Ai(n,n.return)),t.flags&32){o=t.stateNode;try{Ed(o,"")}catch(m){fe(t,t.return,m)}}r&4&&t.stateNode!=null&&(o=t.memoizedProps,XT(t,o,n!==null?n.memoizedProps:o)),r&1024&&(QT=!0);break;case 6:if(_r(e,t),vr(t),r&4){if(t.stateNode===null)throw Error(G(162));r=t.memoizedProps,n=t.stateNode;try{n.nodeValue=r}catch(m){fe(t,t.return,m)}}break;case 3:if(Yb=null,o=Xo,Xo=v_(e.containerInfo),_r(e,t),Xo=o,vr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Nd(e.containerInfo)}catch(m){fe(t,t.return,m)}QT&&(QT=!1,p3(t));break;case 4:r=Xo,Xo=v_(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,Rb(t,r)));break;case 13:_r(e,t),vr(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(U_=Hr()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Rb(t,r)));break;case 22:o=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=la,d=an;if(la=c||o,an=d||l,_r(e,t),an=d,la=c,vr(t),r&8192)t:for(e=t.stateNode,e._visibility=o?e._visibility&-2:e._visibility|1,o&&(n===null||l||la||an||Ol(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(i=l.stateNode,o)a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{s=l.stateNode;var u=l.memoizedProps.style,p=u!=null&&u.hasOwnProperty("display")?u.display:null;s.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(m){fe(l,l.return,m)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=o?"":l.memoizedProps}catch(m){fe(l,l.return,m)}}}else if(e.tag===18){if(n===null){l=e;try{var f=l.stateNode;o?eL(f,!0):eL(l.stateNode,!1)}catch(m){fe(l,l.return,m)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}r&4&&(r=t.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Rb(t,n))));break;case 19:_r(e,t),vr(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Rb(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(i3(r)){n=r;break}r=r.return}if(n==null)throw Error(G(160));switch(n.tag){case 27:var o=n.stateNode,i=JT(t);f_(t,i,o);break;case 5:var a=n.stateNode;n.flags&32&&(Ed(a,""),n.flags&=-33);var s=JT(t);f_(t,s,a);break;case 3:case 4:var l=n.stateNode.containerInfo,c=JT(t);zw(t,c,l);break;default:throw Error(G(161))}}catch(d){fe(t,t.return,d)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function p3(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;p3(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;)s3(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"&&r3(e,e.return,n),Ol(e);break;case 27:Qp(e.stateNode);case 26:case 5:Ai(e,e.return),Ol(e);break;case 22:e.memoizedState===null&&Ol(e);break;case 30:Ol(e);break;default:Ol(e)}t=t.sibling}}function aa(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var r=e.alternate,o=t,i=e,a=i.flags;switch(i.tag){case 0:case 11:case 15:aa(o,i,n),Sm(4,i);break;case 1:if(aa(o,i,n),r=i,o=r.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(c){fe(r,r.return,c)}if(r=i,o=r.updateQueue,o!==null){var s=r.stateNode;try{var l=o.shared.hiddenCallbacks;if(l!==null)for(o.shared.hiddenCallbacks=null,o=0;o<l.length;o++)u5(l[o],s)}catch(c){fe(r,r.return,c)}}n&&a&64&&n3(i),Wp(i,i.return);break;case 27:a3(i);case 26:case 5:aa(o,i,n),n&&r===null&&a&4&&o3(i),Wp(i,i.return);break;case 12:aa(o,i,n);break;case 31:aa(o,i,n),n&&a&4&&u3(o,i);break;case 13:aa(o,i,n),n&&a&4&&d3(o,i);break;case 22:i.memoizedState===null&&aa(o,i,n),Wp(i,i.return);break;case 30:break;default:aa(o,i,n)}e=e.sibling}}function Px(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&_m(n))}function zx(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&_m(t))}function Ko(t,e,n,r){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)m3(t,e,n,r),e=e.sibling}function m3(t,e,n,r){var o=e.flags;switch(e.tag){case 0:case 11:case 15:Ko(t,e,n,r),o&2048&&Sm(9,e);break;case 1:Ko(t,e,n,r);break;case 3:Ko(t,e,n,r),o&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&_m(t)));break;case 12:if(o&2048){Ko(t,e,n,r),t=e.stateNode;try{var i=e.memoizedProps,a=i.id,s=i.onPostCommit;typeof s=="function"&&s(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){fe(e,e.return,l)}}else Ko(t,e,n,r);break;case 31:Ko(t,e,n,r);break;case 13:Ko(t,e,n,r);break;case 23:break;case 22:i=e.stateNode,a=e.alternate,e.memoizedState!==null?i._visibility&2?Ko(t,e,n,r):Kp(t,e):i._visibility&2?Ko(t,e,n,r):(i._visibility|=2,Zu(t,e,n,r,(e.subtreeFlags&10256)!==0||!1)),o&2048&&Px(a,e);break;case 24:Ko(t,e,n,r),o&2048&&zx(e.alternate,e);break;default:Ko(t,e,n,r)}}function Zu(t,e,n,r,o){for(o=o&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var i=t,a=e,s=n,l=r,c=a.flags;switch(a.tag){case 0:case 11:case 15:Zu(i,a,s,l,o),Sm(8,a);break;case 23:break;case 22:var d=a.stateNode;a.memoizedState!==null?d._visibility&2?Zu(i,a,s,l,o):Kp(i,a):(d._visibility|=2,Zu(i,a,s,l,o)),o&&c&2048&&Px(a.alternate,a);break;case 24:Zu(i,a,s,l,o),o&&c&2048&&zx(a.alternate,a);break;default:Zu(i,a,s,l,o)}e=e.sibling}}function Kp(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,r=e,o=r.flags;switch(r.tag){case 22:Kp(n,r),o&2048&&Px(r.alternate,r);break;case 24:Kp(n,r),o&2048&&zx(r.alternate,r);break;default:Kp(n,r)}e=e.sibling}}var zp=8192;function Qu(t,e,n){if(t.subtreeFlags&zp)for(t=t.child;t!==null;)g3(t,e,n),t=t.sibling}function g3(t,e,n){switch(t.tag){case 26:Qu(t,e,n),t.flags&zp&&t.memoizedState!==null&&kK(n,Xo,t.memoizedState,t.memoizedProps);break;case 5:Qu(t,e,n);break;case 3:case 4:var r=Xo;Xo=v_(t.stateNode.containerInfo),Qu(t,e,n),Xo=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=zp,zp=16777216,Qu(t,e,n),zp=r):Qu(t,e,n));break;default:Qu(t,e,n)}}function h3(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Mp(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var r=e[n];In=r,b3(r,t)}h3(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)y3(t),t=t.sibling}function y3(t){switch(t.tag){case 0:case 11:case 15:Mp(t),t.flags&2048&&Is(9,t,t.return);break;case 3:Mp(t);break;case 12:Mp(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,qb(t)):Mp(t);break;default:Mp(t)}}function qb(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];In=r,b3(r,t)}h3(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Is(8,e,e.return),qb(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,qb(e));break;default:qb(e)}t=t.sibling}}function b3(t,e){for(;In!==null;){var n=In;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:_m(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,In=r;else t:for(n=t;In!==null;){r=In;var o=r.sibling,i=r.return;if(l3(r),r===n){In=null;break t}if(o!==null){o.return=i,In=o;break t}In=i}}}var qW={getCacheForType:function(t){var e=Ln(sn),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return Ln(sn).controller.signal}},VW=typeof WeakMap=="function"?WeakMap:Map,le=0,Se=null,Wt=null,Jt=0,de=0,Br=null,ps=!1,Ld=!1,Fx=!1,_a=0,Ye=0,ks=0,Pl=0,Hx=0,Fr=0,Ad=0,Xp=null,Er=null,Fw=!1,U_=0,_3=0,p_=1/0,m_=null,vs=null,hn=0,Ss=null,Id=null,ma=0,Hw=0,Gw=null,v3=null,Jp=0,$w=null;function jr(){return(le&2)!==0&&Jt!==0?Jt&-Jt:At.T!==null?$x():RL()}function S3(){if(Fr===0)if((Jt&536870912)===0||Zt){var t=_b;_b<<=1,(_b&3932160)===0&&(_b=262144),Fr=t}else Fr=536870912;return t=Vr.current,t!==null&&(t.flags|=32),Fr}function Tr(t,e,n){(t===Se&&(de===2||de===9)||t.cancelPendingCommit!==null)&&(kd(t,0),ms(t,Jt,Fr,!1)),hm(t,n),((le&2)===0||t!==Se)&&(t===Se&&((le&2)===0&&(Pl|=n),Ye===4&&ms(t,Jt,Fr,!1)),Ri(t))}function E3(t,e,n){if((le&6)!==0)throw Error(G(327));var r=!n&&(e&127)===0&&(e&t.expiredLanes)===0||gm(t,e),o=r?KW(t,e):ZT(t,e,!0),i=r;do{if(o===0){Ld&&!r&&ms(t,e,0,!1);break}else{if(n=t.current.alternate,i&&!YW(n)){o=ZT(t,e,!1),i=!1;continue}if(o===2){if(i=e,t.errorRecoveryDisabledLanes&i)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;t:{var s=t;o=Xp;var l=s.current.memoizedState.isDehydrated;if(l&&(kd(s,a).flags|=256),a=ZT(s,a,!1),a!==2){if(Fx&&!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){kd(t,0),ms(t,e,0,!0);break}t:{switch(r=t,i=o,i){case 0:case 1:throw Error(G(345));case 4:if((e&4194048)!==e)break;case 6:ms(r,e,Fr,!ps);break t;case 2:Er=null;break;case 3:case 5:break;default:throw Error(G(329))}if((e&62914560)===e&&(o=U_+300-Hr(),10<o)){if(ms(r,e,Fr,!ps),x_(r,0,!0)!==0)break t;ma=e,r.timeoutHandle=G3(FD.bind(null,r,n,Er,m_,Fw,e,Fr,Pl,Ad,ps,i,"Throttled",-0,0),o);break t}FD(r,n,Er,m_,Fw,e,Fr,Pl,Ad,ps,i,null,-0,0)}}break}while(!0);Ri(t)}function FD(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},g3(e,i,u);var m=(i&62914560)===i?U_-Hr():(i&4194048)===i?_3-Hr():0;if(m=RK(u,m),m!==null){ma=i,t.cancelPendingCommit=m(GD.bind(null,t,e,i,n,r,o,a,s,l,d,u,null,p,f)),ms(t,i,a,!c);return}}GD(t,e,i,n,r,o,a,s,l)}function YW(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(!qr(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&=~Hx,e&=~Pl,t.suspendedLanes|=e,t.pingedLanes&=~e,r&&(t.warmLanes|=e),r=t.expirationTimes;for(var o=e;0<o;){var i=31-$r(o),a=1<<i;r[i]=-1,o&=~a}n!==0&&AL(t,n,e)}function B_(){return(le&6)===0?(Em(0,!1),!1):!0}function Gx(){if(Wt!==null){if(de===0)var t=Wt.return;else t=Wt,da=Wl=null,Ix(t),yd=null,im=0,t=Wt;for(;t!==null;)e3(t.alternate,t),t=t.return;Wt=null}}function kd(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,dK(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),ma=0,Gx(),Se=t,Wt=n=fa(t.current,null),Jt=e,de=0,Br=null,ps=!1,Ld=gm(t,e),Fx=!1,Ad=Fr=Hx=Pl=ks=Ye=0,Er=Xp=null,Fw=!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-$r(r),i=1<<o;e|=t[o],r&=~i}return _a=e,R_(),n}function T3(t,e){zt=null,At.H=sm,e===Dd||e===C_?(e=bD(),de=3):e===vx?(e=bD(),de=4):de=e===Ux?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Br=e,Wt===null&&(Ye=1,u_(t,_o(e,t.current)))}function w3(){var t=Vr.current;return t===null?!0:(Jt&4194048)===Jt?So===null:(Jt&62914560)===Jt||(Jt&536870912)!==0?t===So:!1}function x3(){var t=At.H;return At.H=sm,t===null?sm:t}function A3(){var t=At.A;return At.A=qW,t}function g_(){Ye=4,ps||(Jt&4194048)!==Jt&&Vr.current!==null||(Ld=!0),(ks&134217727)===0&&(Pl&134217727)===0||Se===null||ms(Se,Jt,Fr,!1)}function ZT(t,e,n){var r=le;le|=2;var o=x3(),i=A3();(Se!==t||Jt!==e)&&(m_=null,kd(t,e)),e=!1;var a=Ye;t:do try{if(de!==0&&Wt!==null){var s=Wt,l=Br;switch(de){case 8:Gx(),a=6;break t;case 3:case 2:case 9:case 6:Vr.current===null&&(e=!0);var c=de;if(de=0,Br=null,fd(t,s,l,c),n&&Ld){a=0;break t}break;default:c=de,de=0,Br=null,fd(t,s,l,c)}}WW(),a=Ye;break}catch(d){T3(t,d)}while(!0);return e&&t.shellSuspendCounter++,da=Wl=null,le=r,At.H=o,At.A=i,Wt===null&&(Se=null,Jt=0,R_()),a}function WW(){for(;Wt!==null;)I3(Wt)}function KW(t,e){var n=le;le|=2;var r=x3(),o=A3();Se!==t||Jt!==e?(m_=null,p_=Hr()+500,kd(t,e)):Ld=gm(t,e);t:do try{if(de!==0&&Wt!==null){e=Wt;var i=Br;e:switch(de){case 1:de=0,Br=null,fd(t,e,i,1);break;case 2:case 9:if(yD(i)){de=0,Br=null,HD(e);break}e=function(){de!==2&&de!==9||Se!==t||(de=7),Ri(t)},i.then(e,e);break t;case 3:de=7;break t;case 4:de=5;break t;case 7:yD(i)?(de=0,Br=null,HD(e)):(de=0,Br=null,fd(t,e,i,7));break;case 5:var a=null;switch(Wt.tag){case 26:a=Wt.memoizedState;case 5:case 27:var s=Wt;if(a?Y3(a):s.stateNode.complete){de=0,Br=null;var l=s.sibling;if(l!==null)Wt=l;else{var c=s.return;c!==null?(Wt=c,P_(c)):Wt=null}break e}}de=0,Br=null,fd(t,e,i,5);break;case 6:de=0,Br=null,fd(t,e,i,6);break;case 8:Gx(),Ye=6;break t;default:throw Error(G(462))}}XW();break}catch(d){T3(t,d)}while(!0);return da=Wl=null,At.H=r,At.A=o,le=n,Wt!==null?0:(Se=null,Jt=0,R_(),Ye)}function XW(){for(;Wt!==null&&!_Y();)I3(Wt)}function I3(t){var e=t3(t.alternate,t,_a);t.memoizedProps=t.pendingProps,e===null?P_(t):Wt=e}function HD(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=DD(n,e,e.pendingProps,e.type,void 0,Jt);break;case 11:e=DD(n,e,e.pendingProps,e.type.render,e.ref,Jt);break;case 5:Ix(e);default:e3(n,e),e=Wt=e5(e,_a),e=t3(n,e,_a)}t.memoizedProps=t.pendingProps,e===null?P_(t):Wt=e}function fd(t,e,n,r){da=Wl=null,Ix(e),yd=null,im=0;var o=e.return;try{if(PW(t,o,e,n,Jt)){Ye=1,u_(t,_o(n,t.current)),Wt=null;return}}catch(i){if(o!==null)throw Wt=o,i;Ye=1,u_(t,_o(n,t.current)),Wt=null;return}e.flags&32768?(Zt||r===1?t=!0:Ld||(Jt&536870912)!==0?t=!1:(ps=t=!0,(r===2||r===9||r===3||r===6)&&(r=Vr.current,r!==null&&r.tag===13&&(r.flags|=16384))),k3(e,t)):P_(e)}function P_(t){var e=t;do{if((e.flags&32768)!==0){k3(e,ps);return}t=e.return;var n=HW(e.alternate,e,_a);if(n!==null){Wt=n;return}if(e=e.sibling,e!==null){Wt=e;return}Wt=e=t}while(e!==null);Ye===0&&(Ye=5)}function k3(t,e){do{var n=GW(t.alternate,t);if(n!==null){n.flags&=32767,Wt=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Wt=t;return}Wt=t=n}while(t!==null);Ye=6,Wt=null}function GD(t,e,n,r,o,i,a,s,l){t.cancelPendingCommit=null;do z_();while(hn!==0);if((le&6)!==0)throw Error(G(327));if(e!==null){if(e===t.current)throw Error(G(177));if(i=e.lanes|e.childLanes,i|=px,RY(t,n,i,a,s,l),t===Se&&(Wt=Se=null,Jt=0),Id=e,Ss=t,ma=n,Hw=i,Gw=o,v3=r,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,tK(Zb,function(){return O3(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||r){r=At.T,At.T=null,o=ce.p,ce.p=2,a=le,le|=4;try{$W(t,e,n)}finally{le=a,ce.p=o,At.T=r}}hn=1,R3(),N3(),C3()}}function R3(){if(hn===1){hn=0;var t=Ss,e=Id,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=At.T,At.T=null;var r=ce.p;ce.p=2;var o=le;le|=4;try{f3(e,t);var i=Yw,a=YL(t.containerInfo),s=i.focusedElem,l=i.selectionRange;if(a!==s&&s&&s.ownerDocument&&VL(s.ownerDocument.documentElement,s)){if(l!==null&&fx(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=uD(s,_),b=uD(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}}T_=!!Vw,Yw=Vw=null}finally{le=o,ce.p=r,At.T=n}}t.current=e,hn=2}}function N3(){if(hn===2){hn=0;var t=Ss,e=Id,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=At.T,At.T=null;var r=ce.p;ce.p=2;var o=le;le|=4;try{s3(t,e.alternate,e)}finally{le=o,ce.p=r,At.T=n}}hn=3}}function C3(){if(hn===4||hn===3){hn=0,vY();var t=Ss,e=Id,n=ma,r=v3;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?hn=5:(hn=0,Id=Ss=null,M3(t,t.pendingLanes));var o=t.pendingLanes;if(o===0&&(vs=null),ix(n),e=e.stateNode,Gr&&typeof Gr.onCommitFiberRoot=="function")try{Gr.onCommitFiberRoot(mm,e,void 0,(e.current.flags&128)===128)}catch{}if(r!==null){e=At.T,o=ce.p,ce.p=2,At.T=null;try{for(var i=t.onRecoverableError,a=0;a<r.length;a++){var s=r[a];i(s.value,{componentStack:s.stack})}}finally{At.T=e,ce.p=o}}(ma&3)!==0&&z_(),Ri(t),o=t.pendingLanes,(n&261930)!==0&&(o&42)!==0?t===$w?Jp++:(Jp=0,$w=t):Jp=0,Em(0,!1)}}function M3(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,_m(e)))}function z_(){return R3(),N3(),C3(),O3()}function O3(){if(hn!==5)return!1;var t=Ss,e=Hw;Hw=0;var n=ix(ma),r=At.T,o=ce.p;try{ce.p=32>n?32:n,At.T=null,n=Gw,Gw=null;var i=Ss,a=ma;if(hn=0,Id=Ss=null,ma=0,(le&6)!==0)throw Error(G(331));var s=le;if(le|=4,y3(i.current),m3(i,i.current,a,n),le=s,Em(0,!1),Gr&&typeof Gr.onPostCommitFiberRoot=="function")try{Gr.onPostCommitFiberRoot(mm,i)}catch{}return!0}finally{ce.p=o,At.T=r,M3(t,e)}}function $D(t,e,n){e=_o(n,e),e=Uw(t.stateNode,e,2),t=_s(t,e,2),t!==null&&(hm(t,2),Ri(t))}function fe(t,e,n){if(t.tag===3)$D(t,t,n);else for(;e!==null;){if(e.tag===3){$D(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=_o(n,t),n=W5(2),r=_s(e,n,2),r!==null&&(K5(n,r,e,t),hm(r,2),Ri(r));break}}e=e.return}}function tw(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new VW;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)||(Fx=!0,o.add(n),t=JW.bind(null,t,e,n),e.then(t,t))}function JW(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Se===t&&(Jt&n)===n&&(Ye===4||Ye===3&&(Jt&62914560)===Jt&&300>Hr()-U_?(le&2)===0&&kd(t,0):Hx|=n,Ad===Jt&&(Ad=0)),Ri(t)}function D3(t,e){e===0&&(e=xL()),t=Yl(t,e),t!==null&&(hm(t,e),Ri(t))}function QW(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),D3(t,n)}function ZW(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(G(314))}r!==null&&r.delete(e),D3(t,n)}function tK(t,e){return rx(t,e)}var h_=null,td=null,jw=!1,y_=!1,ew=!1,gs=0;function Ri(t){t!==td&&t.next===null&&(td===null?h_=td=t:td=td.next=t),y_=!0,jw||(jw=!0,nK())}function Em(t,e){if(!ew&&y_){ew=!0;do for(var n=!1,r=h_;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-$r(42|t)+1)-1,i&=o&~(a&~s),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,jD(r,i))}else i=Jt,i=x_(r,r===Se?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||gm(r,i)||(n=!0,jD(r,i));r=r.next}while(n);ew=!1}}function eK(){L3()}function L3(){y_=jw=!1;var t=0;gs!==0&&uK()&&(t=gs);for(var e=Hr(),n=null,r=h_;r!==null;){var o=r.next,i=U3(r,e);i===0?(r.next=null,n===null?h_=o:n.next=o,o===null&&(td=n)):(n=r,(t!==0||(i&3)!==0)&&(y_=!0)),r=o}hn!==0&&hn!==5||Em(t,!1),gs!==0&&(gs=0)}function U3(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,o=t.expirationTimes,i=t.pendingLanes&-62914561;0<i;){var a=31-$r(i),s=1<<a,l=o[a];l===-1?((s&n)===0||(s&r)!==0)&&(o[a]=kY(s,e)):l<=e&&(t.expiredLanes|=s),i&=~s}if(e=Se,n=Jt,n=x_(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,n===0||t===e&&(de===2||de===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&NT(r),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||gm(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(r!==null&&NT(r),ix(n)){case 2:case 8:n=TL;break;case 32:n=Zb;break;case 268435456:n=wL;break;default:n=Zb}return r=B3.bind(null,t),n=rx(n,r),t.callbackPriority=e,t.callbackNode=n,e}return r!==null&&r!==null&&NT(r),t.callbackPriority=2,t.callbackNode=null,2}function B3(t,e){if(hn!==0&&hn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(z_()&&t.callbackNode!==n)return null;var r=Jt;return r=x_(t,t===Se?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(E3(t,r,e),U3(t,Hr()),t.callbackNode!=null&&t.callbackNode===n?B3.bind(null,t):null)}function jD(t,e){if(z_())return null;E3(t,e,!0)}function nK(){fK(function(){(le&6)!==0?rx(EL,eK):L3()})}function $x(){if(gs===0){var t=Td;t===0&&(t=bb,bb<<=1,(bb&261888)===0&&(bb=256)),gs=t}return gs}function qD(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ub(""+t)}function VD(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 rK(t,e,n,r,o){if(e==="submit"&&n&&n.stateNode===o){var i=qD((o[wr]||null).action),a=r.submitter;a&&(e=(e=a[wr]||null)?qD(e.formAction):a.getAttribute("formAction"),e!==null&&(i=e,a=null));var s=new A_("action","action",null,r,o);t.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(gs!==0){var l=a?VD(o,a):new FormData(o);Dw(n,{pending:!0,data:l,method:o.method,action:i},null,l)}}else typeof i=="function"&&(s.preventDefault(),l=a?VD(o,a):new FormData(o),Dw(n,{pending:!0,data:l,method:o.method,action:i},i,l))},currentTarget:o}]})}}for(Nb=0;Nb<Ew.length;Nb++)Cb=Ew[Nb],YD=Cb.toLowerCase(),WD=Cb[0].toUpperCase()+Cb.slice(1),Jo(YD,"on"+WD);var Cb,YD,WD,Nb;Jo(KL,"onAnimationEnd");Jo(XL,"onAnimationIteration");Jo(JL,"onAnimationStart");Jo("dblclick","onDoubleClick");Jo("focusin","onFocus");Jo("focusout","onBlur");Jo(SW,"onTransitionRun");Jo(EW,"onTransitionStart");Jo(TW,"onTransitionCancel");Jo(QL,"onTransitionEnd");Sd("onMouseEnter",["mouseout","mouseover"]);Sd("onMouseLeave",["mouseout","mouseover"]);Sd("onPointerEnter",["pointerout","pointerover"]);Sd("onPointerLeave",["pointerout","pointerover"]);jl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));jl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));jl("onBeforeInput",["compositionend","keypress","textInput","paste"]);jl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));jl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));jl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lm="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(lm));function P3(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){e_(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){e_(d)}o.currentTarget=null,i=l}}}}function Yt(t,e){var n=e[mw];n===void 0&&(n=e[mw]=new Set);var r=t+"__bubble";n.has(r)||(z3(e,t,2,!1),n.add(r))}function nw(t,e,n){var r=0;e&&(r|=4),z3(n,t,r,e)}var Mb="_reactListening"+Math.random().toString(36).slice(2);function jx(t){if(!t[Mb]){t[Mb]=!0,NL.forEach(function(n){n!=="selectionchange"&&(oK.has(n)||nw(n,!1,t),nw(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Mb]||(e[Mb]=!0,nw("selectionchange",!1,e))}}function z3(t,e,n,r){switch(Q3(e)){case 2:var o=MK;break;case 8:o=OK;break;default:o=Wx}n=o.bind(null,e,n,t),o=void 0,!_w||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 rw(t,e,n,r,o){var i=r;if((e&1)===0&&(e&2)===0&&r!==null)t:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===o)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===o)return;a=a.return}for(;s!==null;){if(a=rd(s),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){r=i=a;continue t}s=s.parentNode}}r=r.return}PL(function(){var c=i,d=lx(n),u=[];t:{var p=ZL.get(t);if(p!==void 0){var f=A_,m=t;switch(t){case"keypress":if(Pb(n)===0)break t;case"keydown":case"keyup":f=ZY;break;case"focusin":m="focus",f=LT;break;case"focusout":m="blur",f=LT;break;case"beforeblur":case"afterblur":f=LT;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=eD;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=HY;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=nW;break;case KL:case XL:case JL:f=jY;break;case QL:f=oW;break;case"scroll":case"scrollend":f=zY;break;case"wheel":f=aW;break;case"copy":case"cut":case"paste":f=VY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=rD;break;case"toggle":case"beforetoggle":f=lW}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=tm(b,h),E!=null&&_.push(cm(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!==bw&&(m=n.relatedTarget||n.fromElement)&&(rd(m)||m[Cd]))break t;if((f||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,f?(m=n.relatedTarget||n.toElement,f=c,m=m?rd(m):null,m!==null&&(v=pm(m),_=m.tag,m!==v||_!==5&&_!==27&&_!==6)&&(m=null)):(f=null,m=c),f!==m)){if(_=eD,E="onMouseLeave",h="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(_=rD,E="onPointerLeave",h="onPointerEnter",b="pointer"),v=f==null?p:Bp(f),S=m==null?p:Bp(m),p=new _(E,b+"leave",f,n,d),p.target=v,p.relatedTarget=S,E=null,rd(d)===c&&(_=new _(h,b+"enter",m,n,d),_.target=S,_.relatedTarget=v,E=_),v=E,f&&m)e:{for(_=iK,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&&KD(u,p,f,_,!1),m!==null&&v!==null&&KD(u,v,m,_,!0)}}t:{if(p=c?Bp(c):window,f=p.nodeName&&p.nodeName.toLowerCase(),f==="select"||f==="input"&&p.type==="file")var C=sD;else if(aD(p))if(jL)C=bW;else{C=hW;var I=gW}else f=p.nodeName,!f||f.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?c&&sx(c.elementType)&&(C=sD):C=yW;if(C&&(C=C(t,c))){$L(u,C,n,d);break t}I&&I(t,p,c),t==="focusout"&&c&&p.type==="number"&&c.memoizedProps.value!=null&&yw(p,"number",p.value)}switch(I=c?Bp(c):window,t){case"focusin":(aD(I)||I.contentEditable==="true")&&(ad=I,vw=c,Gp=null);break;case"focusout":Gp=vw=ad=null;break;case"mousedown":Sw=!0;break;case"contextmenu":case"mouseup":case"dragend":Sw=!1,dD(u,n,d);break;case"selectionchange":if(vW)break;case"keydown":case"keyup":dD(u,n,d)}var D;if(dx)t:{switch(t){case"compositionstart":var z="onCompositionStart";break t;case"compositionend":z="onCompositionEnd";break t;case"compositionupdate":z="onCompositionUpdate";break t}z=void 0}else id?HL(t,n)&&(z="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(z="onCompositionStart");z&&(FL&&n.locale!=="ko"&&(id||z!=="onCompositionStart"?z==="onCompositionEnd"&&id&&(D=zL()):(fs=d,cx="value"in fs?fs.value:fs.textContent,id=!0)),I=b_(c,z),0<I.length&&(z=new nD(z,t,null,n,d),u.push({event:z,listeners:I}),D?z.data=D:(D=GL(n),D!==null&&(z.data=D)))),(D=uW?dW(t,n):fW(t,n))&&(z=b_(c,"onBeforeInput"),0<z.length&&(I=new nD("onBeforeInput","beforeinput",null,n,d),u.push({event:I,listeners:z}),I.data=D)),rK(u,t,c,n,d)}P3(u,e)})}function cm(t,e,n){return{instance:t,listener:e,currentTarget:n}}function b_(t,e){for(var n=e+"Capture",r=[];t!==null;){var o=t,i=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||i===null||(o=tm(t,n),o!=null&&r.unshift(cm(t,o,i)),o=tm(t,e),o!=null&&r.push(cm(t,o,i))),t.tag===3)return r;t=t.return}return[]}function iK(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function KD(t,e,n,r,o){for(var i=e._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||c===null||(l=c,o?(c=tm(n,i),c!=null&&a.unshift(cm(n,c,l))):o||(c=tm(n,i),c!=null&&a.push(cm(n,c,l)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var aK=/\r\n?/g,sK=/\u0000|\uFFFD/g;function XD(t){return(typeof t=="string"?t:""+t).replace(aK,`
9
+ `).replace(sK,"")}function F3(t,e){return e=XD(e),XD(t)===e}function me(t,e,n,r,o,i){switch(n){case"children":typeof r=="string"?e==="body"||e==="textarea"&&r===""||Ed(t,r):(typeof r=="number"||typeof r=="bigint")&&e!=="body"&&Ed(t,""+r);break;case"className":Sb(t,"class",r);break;case"tabIndex":Sb(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Sb(t,n,r);break;case"style":BL(t,r,i);break;case"data":if(e!=="object"){Sb(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=Ub(""+r),t.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(e!=="input"&&me(t,e,"name",o.name,o,null),me(t,e,"formEncType",o.formEncType,o,null),me(t,e,"formMethod",o.formMethod,o,null),me(t,e,"formTarget",o.formTarget,o,null)):(me(t,e,"encType",o.encType,o,null),me(t,e,"method",o.method,o,null),me(t,e,"target",o.target,o,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(n);break}r=Ub(""+r),t.setAttribute(n,r);break;case"onClick":r!=null&&(t.onclick=ua);break;case"onScroll":r!=null&&Yt("scroll",t);break;case"onScrollEnd":r!=null&&Yt("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(G(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(G(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=Ub(""+r),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(n,""+r):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":r===!0?t.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(n,r):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(n,r):t.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(n):t.setAttribute(n,r);break;case"popover":Yt("beforetoggle",t),Yt("toggle",t),Lb(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":Lb(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=BY.get(n)||n,Lb(t,n,r))}}function qw(t,e,n,r,o,i){switch(n){case"style":BL(t,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(G(61));if(n=r.__html,n!=null){if(o.children!=null)throw Error(G(60));t.innerHTML=n}}break;case"children":typeof r=="string"?Ed(t,r):(typeof r=="number"||typeof r=="bigint")&&Ed(t,""+r);break;case"onScroll":r!=null&&Yt("scroll",t);break;case"onScrollEnd":r!=null&&Yt("scrollend",t);break;case"onClick":r!=null&&(t.onclick=ua);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!CL.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,""):Lb(t,n,r)}}}function Un(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Yt("error",t),Yt("load",t);var r=!1,o=!1,i;for(i in n)if(n.hasOwnProperty(i)){var a=n[i];if(a!=null)switch(i){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(G(137,e));default:me(t,e,i,a,n,null)}}o&&me(t,e,"srcSet",n.srcSet,n,null),r&&me(t,e,"src",n.src,n,null);return;case"input":Yt("invalid",t);var s=i=a=o=null,l=null,c=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case"name":o=d;break;case"type":a=d;break;case"checked":l=d;break;case"defaultChecked":c=d;break;case"value":i=d;break;case"defaultValue":s=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(G(137,e));break;default:me(t,e,r,d,n,null)}}DL(t,i,s,l,c,a,o,!1);return;case"select":Yt("invalid",t),r=a=i=null;for(o in n)if(n.hasOwnProperty(o)&&(s=n[o],s!=null))switch(o){case"value":i=s;break;case"defaultValue":a=s;break;case"multiple":r=s;default:me(t,e,o,s,n,null)}e=i,n=a,t.multiple=!!r,e!=null?md(t,!!r,e,!1):n!=null&&md(t,!!r,n,!0);return;case"textarea":Yt("invalid",t),i=o=r=null;for(a in n)if(n.hasOwnProperty(a)&&(s=n[a],s!=null))switch(a){case"value":r=s;break;case"defaultValue":o=s;break;case"children":i=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(G(91));break;default:me(t,e,a,s,n,null)}UL(t,r,o,i);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":t.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:me(t,e,l,r,n,null)}return;case"dialog":Yt("beforetoggle",t),Yt("toggle",t),Yt("cancel",t),Yt("close",t);break;case"iframe":case"object":Yt("load",t);break;case"video":case"audio":for(r=0;r<lm.length;r++)Yt(lm[r],t);break;case"image":Yt("error",t),Yt("load",t);break;case"details":Yt("toggle",t);break;case"embed":case"source":case"link":Yt("error",t),Yt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(r=n[c],r!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(G(137,e));default:me(t,e,c,r,n,null)}return;default:if(sx(e)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&qw(t,e,d,r,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(r=n[s],r!=null&&me(t,e,s,r,n,null))}function lK(t,e,n,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,i=null,a=null,s=null,l=null,c=null,d=null;for(f in n){var u=n[f];if(n.hasOwnProperty(f)&&u!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":l=u;default:r.hasOwnProperty(f)||me(t,e,f,null,r,u)}}for(var p in r){var f=r[p];if(u=n[p],r.hasOwnProperty(p)&&(f!=null||u!=null))switch(p){case"type":i=f;break;case"name":o=f;break;case"checked":c=f;break;case"defaultChecked":d=f;break;case"value":a=f;break;case"defaultValue":s=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(G(137,e));break;default:f!==u&&me(t,e,p,f,r,u)}}hw(t,a,s,l,c,d,i,o);return;case"select":f=a=s=p=null;for(i in n)if(l=n[i],n.hasOwnProperty(i)&&l!=null)switch(i){case"value":break;case"multiple":f=l;default:r.hasOwnProperty(i)||me(t,e,i,null,r,l)}for(o in r)if(i=r[o],l=n[o],r.hasOwnProperty(o)&&(i!=null||l!=null))switch(o){case"value":p=i;break;case"defaultValue":s=i;break;case"multiple":a=i;default:i!==l&&me(t,e,o,i,r,l)}e=s,n=a,r=f,p!=null?md(t,!!n,p,!1):!!r!=!!n&&(e!=null?md(t,!!n,e,!0):md(t,!!n,n?[]:"",!1));return;case"textarea":f=p=null;for(s in n)if(o=n[s],n.hasOwnProperty(s)&&o!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:me(t,e,s,null,r,o)}for(a in r)if(o=r[a],i=n[a],r.hasOwnProperty(a)&&(o!=null||i!=null))switch(a){case"value":p=o;break;case"defaultValue":f=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(G(91));break;default:o!==i&&me(t,e,a,o,r,i)}LL(t,p,f);return;case"option":for(var m in n)if(p=n[m],n.hasOwnProperty(m)&&p!=null&&!r.hasOwnProperty(m))switch(m){case"selected":t.selected=!1;break;default:me(t,e,m,null,r,p)}for(l in r)if(p=r[l],f=n[l],r.hasOwnProperty(l)&&p!==f&&(p!=null||f!=null))switch(l){case"selected":t.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:me(t,e,l,p,r,f)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!=null&&!r.hasOwnProperty(_)&&me(t,e,_,null,r,p);for(c in r)if(p=r[c],f=n[c],r.hasOwnProperty(c)&&p!==f&&(p!=null||f!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(G(137,e));break;default:me(t,e,c,p,r,f)}return;default:if(sx(e)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!==void 0&&!r.hasOwnProperty(v)&&qw(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||qw(t,e,d,p,r,f);return}}for(var h in n)p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h)&&me(t,e,h,null,r,p);for(u in r)p=r[u],f=n[u],!r.hasOwnProperty(u)||p===f||p==null&&f==null||me(t,e,u,p,r,f)}function JD(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cK(){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&&JD(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&&JD(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 Vw=null,Yw=null;function __(t){return t.nodeType===9?t:t.ownerDocument}function QD(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 H3(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 Ww(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 ow=null;function uK(){var t=window.event;return t&&t.type==="popstate"?t===ow?!1:(ow=t,!0):(ow=null,!1)}var G3=typeof setTimeout=="function"?setTimeout:void 0,dK=typeof clearTimeout=="function"?clearTimeout:void 0,ZD=typeof Promise=="function"?Promise:void 0,fK=typeof queueMicrotask=="function"?queueMicrotask:typeof ZD<"u"?function(t){return ZD.resolve(null).then(t).catch(pK)}:G3;function pK(t){setTimeout(function(){throw t})}function Ns(t){return t==="head"}function tL(t,e){var n=e,r=0;do{var o=n.nextSibling;if(t.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(r===0){t.removeChild(o),Nd(e);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Qp(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,Qp(n);for(var i=n.firstChild;i;){var a=i.nextSibling,s=i.nodeName;i[ym]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=a}}else n==="body"&&Qp(t.ownerDocument.body);n=o}while(n);Nd(e)}function eL(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 Kw(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":Kw(n),ax(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function mK(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[ym])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=Eo(t.nextSibling),t===null)break}return null}function gK(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Eo(t.nextSibling),t===null))return null;return t}function $3(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Eo(t.nextSibling),t===null))return null;return t}function Xw(t){return t.data==="$?"||t.data==="$~"}function Jw(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function hK(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 Eo(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 Qw=null;function nL(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return Eo(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function rL(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 j3(t,e,n){switch(e=__(n),t){case"html":if(t=e.documentElement,!t)throw Error(G(452));return t;case"head":if(t=e.head,!t)throw Error(G(453));return t;case"body":if(t=e.body,!t)throw Error(G(454));return t;default:throw Error(G(451))}}function Qp(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);ax(t)}var To=new Map,oL=new Set;function v_(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var va=ce.d;ce.d={f:yK,r:bK,D:_K,C:vK,L:SK,m:EK,X:wK,S:TK,M:xK};function yK(){var t=va.f(),e=B_();return t||e}function bK(t){var e=Md(t);e!==null&&e.tag===5&&e.type==="form"?B5(e):va.r(t)}var Ud=typeof document>"u"?null:document;function q3(t,e,n){var r=Ud;if(r&&typeof e=="string"&&e){var o=bo(e);o='link[rel="'+t+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),oL.has(o)||(oL.add(o),t={rel:t,crossOrigin:n,href:e},r.querySelector(o)===null&&(e=r.createElement("link"),Un(e,"link",t),kn(e),r.head.appendChild(e)))}}function _K(t){va.D(t),q3("dns-prefetch",t,null)}function vK(t,e){va.C(t,e),q3("preconnect",t,e)}function SK(t,e,n){va.L(t,e,n);var r=Ud;if(r&&t&&e){var o='link[rel="preload"][as="'+bo(e)+'"]';e==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+bo(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+bo(n.imageSizes)+'"]')):o+='[href="'+bo(t)+'"]';var i=o;switch(e){case"style":i=Rd(t);break;case"script":i=Bd(t)}To.has(i)||(t=Ne({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),To.set(i,t),r.querySelector(o)!==null||e==="style"&&r.querySelector(Tm(i))||e==="script"&&r.querySelector(wm(i))||(e=r.createElement("link"),Un(e,"link",t),kn(e),r.head.appendChild(e)))}}function EK(t,e){va.m(t,e);var n=Ud;if(n&&t){var r=e&&typeof e.as=="string"?e.as:"script",o='link[rel="modulepreload"][as="'+bo(r)+'"][href="'+bo(t)+'"]',i=o;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Bd(t)}if(!To.has(i)&&(t=Ne({rel:"modulepreload",href:t},e),To.set(i,t),n.querySelector(o)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wm(i)))return}r=n.createElement("link"),Un(r,"link",t),kn(r),n.head.appendChild(r)}}}function TK(t,e,n){va.S(t,e,n);var r=Ud;if(r&&t){var o=pd(r).hoistableStyles,i=Rd(t);e=e||"default";var a=o.get(i);if(!a){var s={loading:0,preload:null};if(a=r.querySelector(Tm(i)))s.loading=5;else{t=Ne({rel:"stylesheet",href:t,"data-precedence":e},n),(n=To.get(i))&&qx(t,n);var l=a=r.createElement("link");kn(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,Vb(a,e,r)}a={type:"stylesheet",instance:a,count:1,state:s},o.set(i,a)}}}function wK(t,e){va.X(t,e);var n=Ud;if(n&&t){var r=pd(n).hoistableScripts,o=Bd(t),i=r.get(o);i||(i=n.querySelector(wm(o)),i||(t=Ne({src:t,async:!0},e),(e=To.get(o))&&Vx(t,e),i=n.createElement("script"),kn(i),Un(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}}function xK(t,e){va.M(t,e);var n=Ud;if(n&&t){var r=pd(n).hoistableScripts,o=Bd(t),i=r.get(o);i||(i=n.querySelector(wm(o)),i||(t=Ne({src:t,async:!0,type:"module"},e),(e=To.get(o))&&Vx(t,e),i=n.createElement("script"),kn(i),Un(i,"link",t),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(o,i))}}function iL(t,e,n,r){var o=(o=hs.current)?v_(o):null;if(!o)throw Error(G(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Rd(n.href),n=pd(o).hoistableStyles,r=n.get(e),r||(r={type:"style",instance:null,count:0,state:null},n.set(e,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Rd(n.href);var i=pd(o).hoistableStyles,a=i.get(t);if(a||(o=o.ownerDocument||o,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(t,a),(i=o.querySelector(Tm(t)))&&!i._p&&(a.instance=i,a.state.loading=5),To.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},To.set(t,n),i||AK(o,t,n,a.state))),e&&r===null)throw Error(G(528,""));return a}if(e&&r!==null)throw Error(G(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Bd(n),n=pd(o).hoistableScripts,r=n.get(e),r||(r={type:"script",instance:null,count:0,state:null},n.set(e,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(G(444,t))}}function Rd(t){return'href="'+bo(t)+'"'}function Tm(t){return'link[rel="stylesheet"]['+t+"]"}function V3(t){return Ne({},t,{"data-precedence":t.precedence,precedence:null})}function AK(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),kn(e),t.head.appendChild(e))}function Bd(t){return'[src="'+bo(t)+'"]'}function wm(t){return"script[async]"+t}function aL(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var r=t.querySelector('style[data-href~="'+bo(n.href)+'"]');if(r)return e.instance=r,kn(r),r;var o=Ne({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),kn(r),Un(r,"style",o),Vb(r,n.precedence,t),e.instance=r;case"stylesheet":o=Rd(n.href);var i=t.querySelector(Tm(o));if(i)return e.state.loading|=4,e.instance=i,kn(i),i;r=V3(n),(o=To.get(o))&&qx(r,o),i=(t.ownerDocument||t).createElement("link"),kn(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,Vb(i,n.precedence,t),e.instance=i;case"script":return i=Bd(n.src),(o=t.querySelector(wm(i)))?(e.instance=o,kn(o),o):(r=n,(o=To.get(i))&&(r=Ne({},n),Vx(r,o)),t=t.ownerDocument||t,o=t.createElement("script"),kn(o),Un(o,"link",r),t.head.appendChild(o),e.instance=o);case"void":return null;default:throw Error(G(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(r=e.instance,e.state.loading|=4,Vb(r,n.precedence,t));return e.instance}function Vb(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 qx(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Vx(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Yb=null;function sL(t,e,n){if(Yb===null){var r=new Map,o=Yb=new Map;o.set(n,r)}else o=Yb,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[ym]||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 lL(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function IK(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 Y3(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function kK(t,e,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=Rd(r.href),i=e.querySelector(Tm(o));if(i){e=i._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=S_.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=i,kn(i);return}i=e.ownerDocument||e,r=V3(r),(o=To.get(o))&&qx(r,o),i=i.createElement("link"),kn(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=S_.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var iw=0;function RK(t,e){return t.stylesheets&&t.count===0&&Wb(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var r=setTimeout(function(){if(t.stylesheets&&Wb(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4+e);0<t.imgBytes&&iw===0&&(iw=62500*cK());var o=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Wb(t,t.stylesheets),t.unsuspend)){var i=t.unsuspend;t.unsuspend=null,i()}},(t.imgBytes>iw?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(o)}}:null}function S_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wb(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var E_=null;function Wb(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,E_=new Map,e.forEach(NK,t),E_=null,S_.call(t))}function NK(t,e){if(!(e.state.loading&4)){var n=E_.get(t);if(n)var r=n.get(null);else{n=new Map,E_.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=S_.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),i?i.parentNode.insertBefore(o,i.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(o,t.firstChild)),e.state.loading|=4}}var um={$$typeof:ca,Provider:null,Consumer:null,_currentValue:Dl,_currentValue2:Dl,_threadCount:0};function CK(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=CT(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=CT(0),this.hiddenUpdates=CT(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 W3(t,e,n,r,o,i,a,s,l,c,d,u){return t=new CK(t,e,n,a,l,c,d,u,s),e=1,i===!0&&(e|=24),i=zr(3,null,null,e),t.current=i,i.stateNode=t,e=bx(),e.refCount++,t.pooledCache=e,e.refCount++,i.memoizedState={element:r,isDehydrated:n,cache:e},Sx(i),t}function K3(t){return t?(t=cd,t):cd}function X3(t,e,n,r,o,i){o=K3(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),jp(n,t,e))}function cL(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Yx(t,e){cL(t,e),(t=t.alternate)&&cL(t,e)}function J3(t){if(t.tag===13||t.tag===31){var e=Yl(t,67108864);e!==null&&Tr(e,t,67108864),Yx(t,67108864)}}function uL(t){if(t.tag===13||t.tag===31){var e=jr();e=ox(e);var n=Yl(t,e);n!==null&&Tr(n,t,e),Yx(t,e)}}var T_=!0;function MK(t,e,n,r){var o=At.T;At.T=null;var i=ce.p;try{ce.p=2,Wx(t,e,n,r)}finally{ce.p=i,At.T=o}}function OK(t,e,n,r){var o=At.T;At.T=null;var i=ce.p;try{ce.p=8,Wx(t,e,n,r)}finally{ce.p=i,At.T=o}}function Wx(t,e,n,r){if(T_){var o=Zw(r);if(o===null)rw(t,e,r,w_,n),dL(t,r);else if(LK(o,t,e,n,r))r.stopPropagation();else if(dL(t,r),e&4&&-1<DK.indexOf(t)){for(;o!==null;){var i=Md(o);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var a=Cl(i.pendingLanes);if(a!==0){var s=i;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-$r(a);s.entanglements[1]|=l,a&=~l}Ri(i),(le&6)===0&&(p_=Hr()+500,Em(0,!1))}}break;case 31:case 13:s=Yl(i,2),s!==null&&Tr(s,i,2),B_(),Yx(i,2)}if(i=Zw(r),i===null&&rw(t,e,r,w_,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else rw(t,e,r,null,n)}}function Zw(t){return t=lx(t),Kx(t)}var w_=null;function Kx(t){if(w_=null,t=rd(t),t!==null){var e=pm(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=yL(e),t!==null)return t;t=null}else if(n===31){if(t=bL(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 w_=t,null}function Q3(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(SY()){case EL:return 2;case TL:return 8;case Zb:case EY:return 32;case wL:return 268435456;default:return 32}default:return 32}}var tx=!1,Es=null,Ts=null,ws=null,dm=new Map,fm=new Map,us=[],DK="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 dL(t,e){switch(t){case"focusin":case"focusout":Es=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":ws=null;break;case"pointerover":case"pointerout":dm.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":fm.delete(e.pointerId)}}function Op(t,e,n,r,o,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},e!==null&&(e=Md(e),e!==null&&J3(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,o!==null&&e.indexOf(o)===-1&&e.push(o),t)}function LK(t,e,n,r,o){switch(e){case"focusin":return Es=Op(Es,t,e,n,r,o),!0;case"dragenter":return Ts=Op(Ts,t,e,n,r,o),!0;case"mouseover":return ws=Op(ws,t,e,n,r,o),!0;case"pointerover":var i=o.pointerId;return dm.set(i,Op(dm.get(i)||null,t,e,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,fm.set(i,Op(fm.get(i)||null,t,e,n,r,o)),!0}return!1}function Z3(t){var e=rd(t.target);if(e!==null){var n=pm(e);if(n!==null){if(e=n.tag,e===13){if(e=yL(n),e!==null){t.blockedOn=e,WO(t.priority,function(){uL(n)});return}}else if(e===31){if(e=bL(n),e!==null){t.blockedOn=e,WO(t.priority,function(){uL(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 Kb(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Zw(t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);bw=r,n.target.dispatchEvent(r),bw=null}else return e=Md(n),e!==null&&J3(e),t.blockedOn=n,!1;e.shift()}return!0}function fL(t,e,n){Kb(t)&&n.delete(e)}function UK(){tx=!1,Es!==null&&Kb(Es)&&(Es=null),Ts!==null&&Kb(Ts)&&(Ts=null),ws!==null&&Kb(ws)&&(ws=null),dm.forEach(fL),fm.forEach(fL)}function Ob(t,e){t.blockedOn===e&&(t.blockedOn=null,tx||(tx=!0,yn.unstable_scheduleCallback(yn.unstable_NormalPriority,UK)))}var Db=null;function pL(t){Db!==t&&(Db=t,yn.unstable_scheduleCallback(yn.unstable_NormalPriority,function(){Db===t&&(Db=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(Kx(r||n)===null)continue;break}var i=Md(n);i!==null&&(t.splice(e,3),e-=3,Dw(i,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function Nd(t){function e(l){return Ob(l,t)}Es!==null&&Ob(Es,t),Ts!==null&&Ob(Ts,t),ws!==null&&Ob(ws,t),dm.forEach(e),fm.forEach(e);for(var n=0;n<us.length;n++){var r=us[n];r.blockedOn===t&&(r.blockedOn=null)}for(;0<us.length&&(n=us[0],n.blockedOn===null);)Z3(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||pL(n);else if(a){var s=null;if(i&&i.hasAttribute("formAction")){if(o=i,a=i[wr]||null)s=a.formAction;else if(Kx(o)!==null)continue}else s=a.action;typeof s=="function"?n[r+1]=s:(n.splice(r,3),r-=3),pL(n)}}}function tU(){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 Xx(t){this._internalRoot=t}F_.prototype.render=Xx.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(G(409));var n=e.current,r=jr();X3(n,r,t,e,null,null)};F_.prototype.unmount=Xx.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;X3(t.current,2,null,t,null,null),B_(),e[Cd]=null}};function F_(t){this._internalRoot=t}F_.prototype.unstable_scheduleHydration=function(t){if(t){var e=RL();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&&Z3(t)}};var mL=gL.version;if(mL!=="19.2.7")throw Error(G(527,mL,"19.2.7"));ce.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(G(188)):(t=Object.keys(t).join(","),Error(G(268,t)));return t=mY(e),t=t!==null?_L(t):null,t=t===null?null:t.stateNode,t};var BK={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:At,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Dp=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Dp.isDisabled&&Dp.supportsFiber))try{mm=Dp.inject(BK),Gr=Dp}catch{}var Dp;H_.createRoot=function(t,e){if(!hL(t))throw Error(G(299));var n=!1,r="",o=q5,i=V5,a=Y5;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=W3(t,1,!1,null,null,n,r,null,o,i,a,tU),t[Cd]=e.current,jx(t),new Xx(e)};H_.hydrateRoot=function(t,e,n){if(!hL(t))throw Error(G(299));var r=!1,o="",i=q5,a=V5,s=Y5,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=W3(t,1,!0,e,n??null,r,o,l,i,a,s,tU),e.context=K3(null),n=e.current,r=jr(),r=ox(r),o=bs(r),o.callback=null,_s(n,o,r),n=r,e.current.lanes=n,hm(e,n),Ri(e),t[Cd]=e.current,jx(t),new F_(e)};H_.version="19.2.7"});var oU=Xm((Mvt,rU)=>{"use strict";function nU(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nU)}catch(t){console.error(t)}}nU(),rU.exports=eU()});var Yu={};y0(Yu,{BrowserClient:()=>fu,ErrorBoundary:()=>_p,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>Fc,OpenFeatureIntegrationHook:()=>cb,Profiler:()=>Pu,SDK_VERSION:()=>ir,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>ht,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>at,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>ni,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>Mt,Scope:()=>$n,WINDOW:()=>q,addBreadcrumb:()=>wn,addEventProcessor:()=>Uc,addIntegration:()=>Xs,bindScopeToEmitter:()=>V0,breadcrumbsIntegration:()=>py,browserApiErrorsIntegration:()=>my,browserProfilingIntegration:()=>sM,browserSessionIntegration:()=>gy,browserTracingIntegration:()=>Ur,buildLaunchDarklyFlagUsedHandler:()=>uM,captureConsoleIntegration:()=>wv,captureEvent:()=>Jr,captureException:()=>Et,captureFeedback:()=>jc,captureMessage:()=>Da,captureReactException:()=>bp,captureSession:()=>Ua,chromeStackLineParser:()=>jS,close:()=>Jg,consoleLoggingIntegration:()=>Dv,contextLinesIntegration:()=>XN,continueTrace:()=>Pg,createConsolaReporter:()=>Uv,createLangChainCallbackHandler:()=>eu,createReduxEnhancer:()=>OM,createTransport:()=>kf,createUserFeedbackEnvelope:()=>LN,cultureContextIntegration:()=>hy,dedupeIntegration:()=>Lf,defaultRequestInstrumentationOptions:()=>gp,defaultStackLineParsers:()=>VS,defaultStackParser:()=>dy,diagnoseSdkConnectivity:()=>gM,elementTimingIntegration:()=>CS,endSession:()=>Bc,eventFiltersIntegration:()=>ch,eventFromException:()=>Xh,eventFromMessage:()=>Jh,exceptionFromError:()=>uu,extraErrorDataIntegration:()=>xv,featureFlagsIntegration:()=>Nv,feedbackAsyncIntegration:()=>nN,feedbackIntegration:()=>gS,feedbackSyncIntegration:()=>gS,fetchStreamPerformanceIntegration:()=>nb,flush:()=>Xg,forceLoad:()=>HN,functionToStringIntegration:()=>Of,geckoStackLineParser:()=>qS,getActiveSpan:()=>Ot,getClient:()=>P,getCurrentScope:()=>rt,getDefaultIntegrations:()=>KS,getFeedback:()=>GR,getGlobalScope:()=>lr,getIsolationScope:()=>Pt,getReplay:()=>d2,getRootSpan:()=>Bt,getSpanDescendants:()=>ii,getSpanStatusFromHttpCode:()=>Tg,getTraceData:()=>el,globalHandlersIntegration:()=>yy,graphqlClientIntegration:()=>tC,growthbookIntegration:()=>pM,httpClientIntegration:()=>VN,httpContextIntegration:()=>by,inboundFiltersIntegration:()=>Df,init:()=>ub,instrumentAnthropicAiClient:()=>jv,instrumentCreateReactAgent:()=>Kv,instrumentGoogleGenAIClient:()=>Vv,instrumentLangChainEmbeddings:()=>Jv,instrumentLangGraph:()=>Xv,instrumentOpenAiClient:()=>Hv,instrumentOutgoingRequests:()=>eb,instrumentSupabaseClient:()=>gh,isBotUserAgent:()=>XE,isEnabled:()=>Lc,isInitialized:()=>Qg,lastEventId:()=>Dc,launchDarklyIntegration:()=>cM,lazyLoadIntegration:()=>Wh,linkedErrorsIntegration:()=>_y,logger:()=>bh,makeBrowserOfflineTransport:()=>$2,makeFetchTransport:()=>Su,makeMultiplexedTransport:()=>hv,metrics:()=>Fa,moduleMetadataIntegration:()=>Tv,normalizeStringifyValue:()=>Tu,onLoad:()=>GN,openFeatureIntegration:()=>dM,opera10StackLineParser:()=>MN,opera11StackLineParser:()=>ON,parameterize:()=>sh,reactErrorHandler:()=>EM,reactRouterBrowserTracingIntegration:()=>xO,reactRouterV3BrowserTracingIntegration:()=>LM,reactRouterV4BrowserTracingIntegration:()=>zM,reactRouterV5BrowserTracingIntegration:()=>FM,reactRouterV6BrowserTracingIntegration:()=>gO,reactRouterV7BrowserTracingIntegration:()=>vO,registerSpanErrorInstrumentation:()=>mf,registerWebWorker:()=>bM,replayCanvasIntegration:()=>A2,replayIntegration:()=>Xy,reportPageLoaded:()=>F2,reportingObserverIntegration:()=>jN,rewriteFramesIntegration:()=>Av,sendFeedback:()=>sS,setActiveSpanInBrowser:()=>H2,setAttribute:()=>Yg,setAttributes:()=>Vg,setContext:()=>La,setConversationId:()=>Kg,setCurrentClient:()=>ah,setExtra:()=>jg,setExtras:()=>$g,setHttpStatus:()=>ri,setMeasurement:()=>qs,setTag:()=>Oc,setTags:()=>qg,setUser:()=>Wg,showReportDialog:()=>Qf,spanStreamingIntegration:()=>G2,spanToBaggageHeader:()=>Og,spanToJSON:()=>et,spanToTraceHeader:()=>Ic,spotlightBrowserIntegration:()=>lM,startBrowserTracingNavigationSpan:()=>Wo,startBrowserTracingPageLoadSpan:()=>Yo,startInactiveSpan:()=>Ae,startNewTrace:()=>Sf,startSession:()=>Ks,startSpan:()=>nn,startSpanManual:()=>qn,statsigIntegration:()=>mM,supabaseIntegration:()=>Iv,suppressTracing:()=>Nc,tanstackRouterBrowserTracingIntegration:()=>BM,thirdPartyErrorFilterIntegration:()=>Rv,uiProfiler:()=>NN,unleashIntegration:()=>fM,updateSpanName:()=>Cg,useProfiler:()=>CM,viewHierarchyIntegration:()=>eC,webVitalsIntegration:()=>rb,webWorkerIntegration:()=>yM,winjsStackLineParser:()=>CN,withActiveSpan:()=>Xr,withErrorBoundary:()=>MM,withIsolationScope:()=>rf,withProfiler:()=>NM,withScope:()=>Oe,withSentryReactRouterV6Routing:()=>_O,withSentryReactRouterV7Routing:()=>SO,withSentryRouting:()=>$M,withStreamedSpan:()=>H0,wrapCreateBrowserRouter:()=>IO,wrapCreateBrowserRouterV6:()=>yO,wrapCreateBrowserRouterV7:()=>EO,wrapCreateMemoryRouter:()=>kO,wrapCreateMemoryRouterV6:()=>bO,wrapCreateMemoryRouterV7:()=>TO,wrapReactRouterRouting:()=>AO,wrapUseRoutes:()=>RO,wrapUseRoutesV6:()=>hO,wrapUseRoutesV7:()=>wO,zodErrorsIntegration:()=>kv});var H=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var tt=globalThis;var ir="10.63.0";function Jn(){return Ta(tt),tt}function Ta(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||ir,e[ir]=e[ir]||{}}function Mo(t,e,n=tt){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[ir]=r[ir]||{};return o[t]||(o[t]=e())}var wa=["debug","info","warn","error","log","assert","trace"],K6="Sentry Logger ",Ls={};function fn(t){if(!("console"in tt))return t();let e=tt.console,n={},r=Object.keys(Ls);r.forEach(o=>{let i=Ls[o];n[o]=e[o],e[o]=i});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function X6(){_0().enabled=!0}function J6(){_0().enabled=!1}function L1(){return _0().enabled}function Q6(...t){b0("log",...t)}function Z6(...t){b0("warn",...t)}function tB(...t){b0("error",...t)}function b0(t,...e){H&&L1()&&fn(()=>{tt.console[t](`${K6}[${t}]:`,...e)})}function _0(){return H?Mo("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var w={enable:X6,disable:J6,isEnabled:L1,log:Q6,warn:Z6,error:tB};var U1=/\(error: (.*)\)/,B1=/captureMessage|captureException/;function Yd(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let i=[],a=n.split(`
10
+ `);for(let s=r;s<a.length;s++){let l=a[s];l.length>1024&&(l=l.slice(0,1024));let c=U1.test(l)?l.replace(U1,"$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 S0(i.slice(o))}}function Zm(t){return Array.isArray(t)?Yd(...t):t}function S0(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(Qm(e).function||"")&&e.pop(),e.reverse(),B1.test(Qm(e).function||"")&&(e.pop(),B1.test(Qm(e).function||"")&&e.pop()),e.slice(0,50).map(n=>({...n,filename:n.filename||Qm(e).filename,function:n.function||"?"}))}function Qm(t){return t[t.length-1]||{}}var v0="<anonymous>";function Qn(t){try{return!t||typeof t!="function"?v0:t.name||v0}catch{return v0}}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 P1(t){let e=t?.startsWith("file://")?t.slice(7):t;return e?.match(/\/[A-Z]:/)&&(e=e.slice(1)),e}var Wd={},z1={};function zn(t,e){return Wd[t]=Wd[t]||[],Wd[t].push(e),()=>{let n=Wd[t];if(n){let r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}function Fn(t,e){if(!z1[t]){z1[t]=!0;try{e()}catch(n){H&&w.error(`Error while instrumenting ${t}`,n)}}}function Qe(t,e){let n=t&&Wd[t];if(n)for(let r of n)try{r(e)}catch(o){H&&w.error(`Error while triggering instrumentation handler.
11
+ Type: ${t}
12
+ Name: ${Qn(r)}
13
+ Error:`,o)}}var E0=null;function Kd(t){let e="error";zn(e,t),Fn(e,eB)}function eB(){E0=tt.onerror,tt.onerror=function(t,e,n,r,o){return Qe("error",{column:r,error:o,line:n,msg:t,url:e}),E0?E0.apply(this,arguments):!1},tt.onerror.__SENTRY_INSTRUMENTED__=!0}var T0=null;function Xd(t){let e="unhandledrejection";zn(e,t),Fn(e,nB)}function nB(){T0=tt.onunhandledrejection,tt.onunhandledrejection=function(t){return Qe("unhandledrejection",t),T0?T0.apply(this,arguments):!0},tt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var F1=Object.prototype.toString;function pn(t){switch(F1.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Oo(t,Error)}}function hc(t,e){return F1.call(t)===`[object ${e}]`}function yc(t){return hc(t,"ErrorEvent")}function Jd(t){return hc(t,"DOMError")}function tg(t){return hc(t,"DOMException")}function mn(t){return hc(t,"String")}function ei(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function Ze(t){return t===null||ei(t)||typeof t!="object"&&typeof t!="function"}function he(t){return hc(t,"Object")}function xa(t){return typeof Event<"u"&&Oo(t,Event)}function eg(t){return hc(t,"RegExp")}function Nn(t){return!!(t?.then&&typeof t.then=="function")}function Oo(t,e){try{return t instanceof e}catch{return!1}}function Qd(t){return typeof Request<"u"&&Oo(t,Request)}function ye(t,e,n){if(!(e in t))return;let r=t[e];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Zd(o,r);try{t[e]=o}catch{H&&w.log(`Failed to replace method "${e}" in object`,t)}}function Gt(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{H&&w.log(`Failed to add non-enumerable property "${String(e)}" to object`,t)}}function Zd(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,Gt(t,"__sentry_original__",e)}catch{}}function Aa(t){return t.__sentry_original__}function tf(t){if(pn(t))return{message:t.message,name:t.name,stack:t.stack,...H1(t)};if(xa(t)){let{type:e,target:n,currentTarget:r,detail:o}=t;return{type:e,target:n,currentTarget:r,...o?{detail:o}:{},...H1(t)}}return t}function H1(t){return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}function ng(t){let e=Object.keys(tf(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}var bc;function Bs(t){if(bc!==void 0)return bc?bc(t):t();let e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=tt;return e in n&&typeof n[e]=="function"?(bc=n[e],bc(t)):(bc=null,t())}function ar(){return Bs(()=>Math.random())}function Hn(){return Bs(()=>Date.now())}var G1=Symbol.for("sentry.skipNormalization"),$1=Symbol.for("sentry.overrideNormalizationDepth");function w0(t){Gt(t,G1,!0)}function x0(t,e){Gt(t,$1,e)}function j1(t){return!!t[G1]}function q1(t){let e=t[$1];return typeof e=="number"?e:void 0}var A0;function _c(t){A0=t}function ue(t,e=100,n=1/0){try{return I0("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ef(t,e=3,n=100*1024){let r=ue(t,e);return iB(r)>n?ef(t,e-1,n):r}function I0(t,e,n=1/0,r=1/0,o=aB()){let[i,a]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let s=k0(t,e);if(!s.startsWith("[object "))return s;if(j1(e))return e;let l=q1(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 I0("",m,c-1,r,o)}catch{}let u=Array.isArray(e)?[]:{},p=0,f=tf(e);for(let m in f){if(!Object.prototype.hasOwnProperty.call(f,m))continue;if(p>=r){u[m]="[MaxProperties ~]";break}let _=f[m];u[m]=I0(m,_,c-1,r,o),p++}return a(e),u}function k0(t,e){try{if(A0){let r=A0(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 ${rB(e)}]`}catch(n){return`**non-serializable** (${n})`}}function rB(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function oB(t){return~-encodeURI(t).split(/%..|./).length}function iB(t){return oB(JSON.stringify(t))}function aB(){let t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Do(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function vc(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let o=Math.max(e-60,0);o<5&&(o=0);let i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function Ia(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let o=t[r];Ze(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(k0(void 0,o))}return n.join(e)}function ka(t,e,n=!1){return mn(t)?eg(e)?e.test(t):mn(e)?n?t===e:t.includes(e):typeof e=="function"?e(t):!1:!1}function tn(t,e=[],n=!1){for(let r of e)if(ka(t,r,n))return!0;return!1}function sB(){let t=tt;return t.crypto||t.msCrypto}var R0;function lB(){return ar()*16}function ae(t=sB()){try{if(t?.randomUUID)return Bs(()=>t.randomUUID()).replace(/-/g,"")}catch{}return R0||(R0="10000000100040008000"+1e11),R0.replace(/[018]/g,e=>(e^(lB()&15)>>e/4).toString(16))}function V1(t){return t.exception?.values?.[0]}function Lo(t){let{message:e,event_id:n}=t;if(e)return e;let r=V1(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Ps(t,e,n){let r=t.exception=t.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function En(t,e){let n=V1(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 rg(t,e,n=5){if(e.lineno===void 0)return;let r=t.length,o=Math.max(Math.min(r-1,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,o-n),o).map(a=>vc(a,0));let i=Math.min(r-1,o);e.context_line=vc(t[i],e.colno||0),e.post_context=t.slice(Math.min(o+1,r),o+1+n).map(a=>vc(a,0))}function nf(t){if(N0(t))return!0;try{Gt(t,"__sentry_captured__",!0)}catch{}return!1}function N0(t){try{return t.__sentry_captured__}catch{}}var W1=1e3;function sr(){return Hn()/W1}function cB(){let{performance:t}=tt;if(!t?.now||!t.timeOrigin)return sr;let e=t.timeOrigin;return()=>(e+Bs(()=>t.now()))/W1}var Y1;function Ct(){return(Y1??(Y1=cB()))()}var C0=null;function uB(){let{performance:t}=tt;if(!t?.now)return;let e=3e5,n=Bs(()=>t.now()),r=Hn(),o=t.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<e)return o;let i=t.timing?.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<e?i:r-n}function ne(){return C0===null&&(C0=uB()),C0}function K1(t){let e=Ct(),n={sid:ae(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>dB(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||Ct(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:ae()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function X1(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Oi(t,n)}function dB(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function Ra(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;let r={...t};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=Ra(r[o],e[o],n-1));return r}function Cn(){return ae()}function Gn(){return ae().substring(16)}function og(t){try{let e=tt.WeakRef;if(typeof e=="function")return new e(t)}catch{}return t}function ig(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}var M0="_sentrySpan";function Zn(t,e){e?Gt(t,M0,og(e)):delete t[M0]}function Uo(t){return ig(t[M0])}var fB=100,$n=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Cn(),sampleRand:ar()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Zn(e,Uo(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Oi(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,r=n instanceof t?n.getScopeData():he(n)?e:void 0,{tags:o,attributes:i,extra:a,user:s,contexts:l,level:c,fingerprint:d=[],propagationContext:u,conversationId:p}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...l},s&&Object.keys(s).length&&(this._user=s),c&&(this._level=c),d.length&&(this._fingerprint=d),u&&(this._propagationContext=u),p&&(this._conversationId=p),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Zn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Cn(),sampleRand:ar()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:fB;if(r<=0)return this;let o={timestamp:sr(),...e,message:e.message?Do(e.message,2048):e.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Uo(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Ra(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||ae();if(!this._client)return H&&w.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureMessage(e,n,r){let o=r?.event_id||ae();if(!this._client)return H&&w.warn("No client configured on scope - will not capture message!"),o;let i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:i,...r,event_id:o},this),o}captureEvent(e,n){let r=e.event_id||n?.event_id||ae();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(H&&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 J1(){return Mo("defaultCurrentScope",()=>new $n)}function Q1(){return Mo("defaultIsolationScope",()=>new $n)}var Z1=t=>t instanceof Promise&&!t[tA],tA=Symbol("chained PromiseLike"),ag=(t,e,n)=>{let r=t.then(o=>(e(o),o),o=>{throw n(o),o});return Z1(r)&&Z1(t)?r:pB(t,r)},pB=(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,{[tA]:!0}),e};var O0=class{constructor(e,n){let r;e?r=e:r=new $n;let o;n?o=n:o=new $n,this._stack=[{scope:r}],this._isolationScope=o}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(o){throw this._popScope(),o}return Nn(r)?ag(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Sc(){let t=Jn(),e=Ta(t);return e.stack=e.stack||new O0(J1(),Q1())}function mB(t){return Sc().withScope(t)}function gB(t,e){let n=Sc();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function eA(t){return Sc().withScope(()=>t(Sc().getIsolationScope()))}function nA(){return{withIsolationScope:eA,withScope:mB,withSetScope:gB,withSetIsolationScope:(t,e)=>eA(e),getCurrentScope:()=>Sc().getScope(),getIsolationScope:()=>Sc().getIsolationScope()}}function Kr(t){let e=Ta(t);return e.acs?e.acs:nA()}function hB(t){return typeof t=="object"&&t!=null&&!Array.isArray(t)&&Object.keys(t).includes("value")}function yB(t,e){let{value:n,unit:r}=hB(t)?t:{value:t,unit:void 0},o=bB(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=yB(o,e);i&&(n[r]=i)}return n}function D0(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+=rA(o[0])*o.length:Ze(o)?e+=rA(o):e+=100}return e}function rA(t){return typeof t=="string"?t.length*2:typeof t=="boolean"?4:typeof t=="number"?8:0}function bB(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 oA;function L0(){return oA?.()}function sg(){return oA!==void 0}function rt(){let t=Jn();return Kr(t).getCurrentScope()}function Pt(){let t=Jn();return Kr(t).getIsolationScope()}function lr(){return Mo("globalScope",()=>new $n)}function Oe(...t){let e=Jn(),n=Kr(e);if(t.length===2){let[r,o]=t;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(t[0])}function rf(...t){let e=Jn(),n=Kr(e);if(t.length===2){let[r,o]=t;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(t[0])}function P(){return rt().getClient()}function Ec(t){let e=L0();if(e)return{trace_id:e.traceId,span_id:e.spanId};let n=t.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:i}=n,a={trace_id:r,span_id:i||Gn()};return o&&(a.parent_span_id=o),a}var Mt="sentry.source",ni="sentry.sample_rate",Tc="sentry.previous_trace_sample_rate",ht="sentry.op",at="sentry.origin",lg="sentry.status.message",Li="sentry.idle_span_finish_reason",Bo="sentry.measurement_unit",Po="sentry.measurement_value",cg="sentry.release",ug="sentry.environment",dg="sentry.segment.name",fg="sentry.segment.id",pg="sentry.sdk.name",mg="sentry.sdk.version",gg="sentry.sdk.integrations",hg="user.id",yg="user.email",bg="user.ip_address",_g="user.name",zs="sentry.custom_span_name",Fs="sentry.profile_id",jn="sentry.exclusive_time";var vg="http.request.method",wc="url.full",Sg="sentry.link.type",Eg="gen_ai.conversation.id";function Tg(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=Tg(e);n.message!=="unknown_error"&&t.setStatus(n)}var iA="_sentryScope",aA="_sentryIsolationScope",_B=Symbol.for("sentry.otelSourceInference");function Na(t,e,n){t&&(Gt(t,aA,og(n)),Gt(t,iA,e))}function oi(t){let e=t;return{scope:e[iA],isolationScope:ig(e[aA])}}function sA(t){return t[_B]===!0}var of="sentry-";var vB=8192;function xc(t){let e=SB(t);if(!e)return;let n=Object.entries(e).reduce((r,[o,i])=>{if(o.startsWith(of)){let a=o.slice(of.length);r[a]=i}return r},{});if(Object.keys(n).length>0)return n}function wg(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,o])=>(o&&(n[`${of}${r}`]=o),n),{});return EB(e)}function SB(t){if(!(!t||!mn(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=lA(n);return Object.entries(r).forEach(([o,i])=>{e[o]=i}),e},{}):lA(t)}function lA(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 EB(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>vB?(H&&w.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):a},"")}var TB=/^o(\d+)\./,wB=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function xB(t){return t==="http"||t==="https"}function en(t,e=!1){let{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:l}=t;return`${s}://${l}${e&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${a}`}function xg(t){let e=wB.exec(t);if(!e){fn(()=>{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 cA({host:i,pass:o,path:l,projectId:c,port:a,protocol:n,publicKey:r})}function cA(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function AB(t){if(!H)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+$/)?xB(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 IB(t){return t.match(TB)?.[1]}function Ag(t){let e=t.getOptions(),{host:n}=t.getDsn()||{},r;return e.orgId?r=String(e.orgId):n&&(r=IB(n)),r}function af(t){let e=typeof t=="string"?xg(t):cA(t);if(!(!e||!AB(e)))return e}function kr(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var Ig=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function uA(t){if(!t)return;let e=t.match(Ig);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function sf(t,e){let n=uA(t),r=xc(e);if(!n?.traceId)return{traceId:Cn(),sampleRand:ar()};let o=kB(n,r);r&&(r.sample_rand=o.toString());let{traceId:i,parentSpanId:a,parentSampled:s}=n;return{traceId:i,parentSpanId:a,sampled:s,dsc:r||{},sampleRand:o}}function lf(t=Cn(),e=Gn(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function cf(t=Cn(),e=Gn(),n){return`00-${t}-${e}-${n?"01":"00"}`}function kB(t,e){let n=kr(e?.sample_rand);if(n!==void 0)return n;let r=kr(e?.sample_rate);return r&&t?.parentSampled!==void 0?t.parentSampled?ar()*r:r+ar()*(1-r):ar()}function U0(t,e){let n=Ag(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 kg=0,df=1,dA=!1;function mA(t){let{spanId:e,traceId:n}=t.spanContext(),{data:r,op:o,parent_span_id:i,status:a,origin:s,links:l}=et(t);return{parent_span_id:i,span_id:e,trace_id:n,data:r,op:o,status:a,origin:s,links:l}}function Ac(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),o=r?e:et(t).parent_span_id,i=oi(t).scope,a=r?i?.getPropagationContext().propagationSpanId||Gn():e;return{parent_span_id:o,span_id:a,trace_id:n}}function Ic(t){let{traceId:e,spanId:n}=t.spanContext(),r=Tn(t);return lf(e,n,r)}function gA(t){let{traceId:e,spanId:n}=t.spanContext(),r=Tn(t);return cf(e,n,r)}function ff(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...o},attributes:i})=>({span_id:e,trace_id:n,sampled:r===df,attributes:i,...o}))}function P0(t){if(t?.length)return t.map(({context:{spanId:e,traceId:n,traceFlags:r},attributes:o})=>({span_id:e,trace_id:n,sampled:r===df,attributes:o}))}function cr(t){return typeof t=="number"?fA(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?fA(t.getTime()):Ct()}function fA(t){return t>9999999999?t/1e3:t}function et(t){if(bA(t))return t.getSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(yA(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:hA(t),start_timestamp:cr(o),timestamp:cr(a)||void 0,status:pf(s),op:r[ht],origin:r[at],links:ff(l)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function Ca(t){if(bA(t))return t.getStreamedSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(yA(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:hA(t),start_timestamp:cr(o),end_timestamp:cr(a),is_segment:t===Gs(t),status:Ng(s),attributes:z0(r,s),links:P0(l)}}return{span_id:e,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:t===Gs(t)}}function hA(t){return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0}function Rg(t){return{...t,attributes:Di(t.attributes),links:t.links?.map(e=>({...e,attributes:Di(e.attributes)}))}}function yA(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function bA(t){return typeof t.getSpanJSON=="function"}function Tn(t){let{traceFlags:e}=t.spanContext();return e===df}function pf(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"internal_error"}function Ng(t){return!t||t.code===1||t.code===0||t.message==="cancelled"?"ok":"error"}function z0(t,e){let n=Ng(e)==="error"?e?.message:void 0;return{...n&&{[lg]:n},...t}}var Hs="_sentryChildSpans",B0="_sentryRootSpan";function kc(t,e){let n=t[B0]||t;Gt(e,B0,n),t[Hs]?t[Hs].add(e):Gt(t,Hs,new Set([e]))}function _A(t,e){t[Hs]&&t[Hs].delete(e)}function ii(t){let e=new Set;function n(r){if(!e.has(r)&&Tn(r)){e.add(r);let o=r[Hs]?Array.from(r[Hs]):[];for(let i of o)n(i)}}return n(t),Array.from(e)}var Bt=Gs;function Gs(t){return t[B0]||t}function Ot(){let t=Jn(),e=Kr(t);return e.getActiveSpan?e.getActiveSpan():Uo(rt())}function $s(){dA||(fn(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),dA=!0)}function Cg(t,e){t.updateName(e),t.setAttributes({[Mt]:"custom",[zs]:e})}var vA=!1;function mf(){if(vA)return;function t(){let e=Ot(),n=e&&Bt(e);if(n){let r="internal_error";H&&w.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}vA=!0,Kd(t),Xd(t)}function De(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||P()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function SA(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(NB(n)){if(t.description&&ka(t.description,n))return H&&SA(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])=>RB(t.attributes?.[s],l)):!0;if(o&&i&&a)return H&&SA(t),!0}return!1}function RB(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 EA(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 NB(t){return typeof t=="string"||t instanceof RegExp}var TA=Symbol.for("sentry.nonRecordingSpan"),ur=class{constructor(e={}){this._traceId=e.traceId||Cn(),this._spanId=e.spanId||Gn(),this.dropReason=e.dropReason,Gt(this,TA,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:kg}}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[TA]===!0}var zo="production";var wA="_frozenDsc";function F0(t,e){Gt(t,wA,e)}function Mg(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:Ag(e)};return e.emit("createDsc",o),o}function Bi(t,e){let n=e.getPropagationContext();return n.dsc||Mg(n.traceId,t)}function $e(t){let e=P();if(!e)return{};let n=Bt(t),r=et(n),o=r.data,i=n.spanContext().traceState,a=i?.get("sentry.sample_rate")??o[ni]??o[Tc];function s(m){return(typeof a=="number"||typeof a=="string")&&(m.sample_rate=`${a}`),m}let l=n[wA];if(l)return s(l);if(ai(n)&&!De(e.getOptions())){let m=oi(n).scope;if(m)return s({...Bi(e,m)})}let c=i?.get("sentry.dsc"),d=c&&xc(c);if(d)return s(d);let u=Mg(t.spanContext().traceId,e),p=o[Mt]??o["sentry.span.source"],f=r.description;return p!=="url"&&f&&(u.transaction=f),De()&&(u.sampled=String(Tn(n)),u.sample_rand=i?.get("sentry.sample_rand")??oi(n).scope?.getPropagationContext().sampleRand.toString()),s(u),e.emit("createDsc",u,n),u}function Og(t){let e=$e(t);return wg(e)}function H0(t){return Gt(t,"_streamed",!0),t}function Pi(t){return!!t&&typeof t=="function"&&"_streamed"in t&&!!t._streamed}function Le(t,e=[]){return[t,e]}function gf(t,e){let[n,r]=t;return[n,[...r,e]]}function dr(t,e){let n=t[1];for(let r of n){let o=r[0].type;if(e(r,o))return!0}return!1}function js(t,e){return dr(t,(n,r)=>e.includes(r))}function Dg(t){let e=Ta(tt);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function CB(t){let e=Ta(tt);return e.decodePolyfill?e.decodePolyfill(t):new TextDecoder().decode(t)}function zi(t){let[e,n]=t,r=JSON.stringify(e);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[Dg(r),i]:r.push(typeof i=="string"?Dg(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(ue(s))}o(l)}}return typeof r=="string"?r:MB(r)}function MB(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 Lg(t){let e=typeof t=="string"?Dg(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(CB(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 Ug(t){return[{type:"span"},t]}function Bg(t){let e=typeof t.data=="string"?Dg(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var xA={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 OB(t){return t in xA}function hf(t){return OB(t)?xA[t]:t}function Fo(t){if(!t?.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function Rc(t,e,n,r){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date(Hn()).toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:en(r)},...o&&{trace:o}}}function DB(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 AA(t,e,n,r){let o=Fo(n),i={sent_at:new Date(Hn()).toISOString(),...o&&{sdk:o},...!!r&&e&&{dsn:en(e)}},a="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Le(i,[a])}function IA(t,e,n,r){let o=Fo(n),i=t.type&&t.type!=="replay_event"?t.type:"event";DB(t,n?.sdk);let a=Rc(t,o,r,e);return delete t.sdkProcessingMetadata,Le(a,[[{type:i},t]])}function kA(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(Hn()).toISOString(),...n(r)&&{trace:r},...!!i&&o&&{dsn:en(o)}},{beforeSendSpan:s,ignoreSpans:l}=e?.getOptions()||{},c=l?.length?t.filter(f=>{let m=et(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=et(f),_=Pi(s)?m:s(m);return _||($s(),m)}:et,p=[];for(let f of c){let m=u(f);m&&p.push(Ug(m))}return Le(a,p)}function RA(t){if(!H)return;let{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=et(t),{spanId:o}=t.spanContext(),i=Tn(t),a=Bt(t),s=a===t,l=`[Tracing] Starting ${i?"sampled":"unsampled"} ${s?"root ":""}span`,c=[`op: ${n}`,`name: ${e}`,`ID: ${o}`];if(r&&c.push(`parent ID: ${r}`),!s){let{op:d,description:u}=et(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 NA(t){if(!H)return;let{description:e="< unknown name >",op:n="< unknown op >"}=et(t),{spanId:r}=t.spanContext(),i=Bt(t)===t,a=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${e}" with ID ${r}`;w.log(a)}function qs(t,e,n,r=Ot()){let o=r&&Bt(r);o&&(H&&w.log(`[Measurement] Setting measurement on root span: ${t} = ${e} ${n}`),o.addEvent(t,{[Po]:e,[Bo]:n}))}function yf(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 CA=1e3,Ma=class{constructor(e={}){this._traceId=e.traceId||Cn(),this._spanId=e.spanId||Gn(),this._startTime=e.startTimestamp||Ct(),this._links=e.links,this._attributes={},this.setAttributes({[at]:"manual",[ht]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,n){}spanContext(){let{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?df:kg}}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,sA(this)||this.setAttribute(Mt,"custom"),this}end(e){this._endTime||(this._endTime=cr(e),NA(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ht],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:pf(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[at],profile_id:this._attributes[Fs],exclusive_time:this._attributes[jn],measurements:yf(this._events),is_segment:this._isStandaloneSpan&&Bt(this)===this||void 0,segment_id:this._isStandaloneSpan?Bt(this).spanContext().spanId:void 0,links:ff(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===Bt(this),status:Ng(this._status),attributes:z0(this._attributes,this._status),links:P0(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){H&&w.log("[Tracing] Adding an event to span:",e);let o=MA(n)?n:r||Ct(),i=MA(n)?{}:n||{},a={name:e,time:cr(o),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=P();if(e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Bt(this)))return;if(this._isStandaloneSpan){this._sampled?UB(kA([this],e)):(H&&w.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}else if(e&&je(e)){e.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(oi(this).scope||rt()).captureEvent(r)}_convertSpanToTransaction(){if(!OA(et(this)))return;this._name||(H&&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&&!LB(u)).map(u=>et(u)).filter(OA),a=this._attributes[Mt];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:mA(this)},spans:i.length>CA?i.sort((u,p)=>u.start_timestamp-p.start_timestamp).slice(0,CA):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=yf(this._events);return c&&Object.keys(c).length&&(H&&w.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),l.measurements=c),l}};function MA(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function OA(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function LB(t){return t instanceof Ma&&t.isStandaloneSpan()}function UB(t){let e=P();if(!e)return;let n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function bf(t,e,n=()=>{},r=()=>{}){let o;try{o=t()}catch(i){throw e(i),n(),i}return BB(o,e,n,r)}function BB(t,e,n,r){return Nn(t)?ag(t,o=>{n(),r(o)},o=>{e(o),n()}):(n(),r(t),t)}function DA(t,e,n){if(!De(t))return[!1];let r,o;typeof t.tracesSampler=="function"?(o=t.tracesSampler({...e,inheritOrSampleWith:s=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):s}),r=!0):e.parentSampled!==void 0?o=e.parentSampled:typeof t.tracesSampleRate<"u"&&(o=t.tracesSampleRate,r=!0);let i=kr(o);if(i===void 0)return H&&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 H&&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||H&&w.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[a,i,r]}var _f="__SENTRY_SUPPRESS_TRACING__";function nn(t,e){let n=Vs();if(n.startSpan)return n.startSpan(t,e);let r=j0(t),{forceTransaction:o,parentSpan:i,scope:a}=t,s=a?.clone();return Oe(s,()=>UA(i)(()=>{let c=rt(),d=q0(c,i),u=P(),f=t.onlyIfParent&&!d?G0(c,u):$0({parentSpan:d,spanArguments:r,forceTransaction:o,scope:c});return(!BA(f)||!d)&&Zn(c,f),bf(()=>e(f),()=>{let{status:m}=et(f);f.isRecording()&&(!m||m==="ok")&&f.setStatus({code:2,message:"internal_error"})},()=>{f.end()})}))}function qn(t,e){let n=Vs();if(n.startSpanManual)return n.startSpanManual(t,e);let r=j0(t),{forceTransaction:o,parentSpan:i,scope:a}=t,s=a?.clone();return Oe(s,()=>UA(i)(()=>{let c=rt(),d=q0(c,i),p=t.onlyIfParent&&!d?G0(c,P()):$0({parentSpan:d,spanArguments:r,forceTransaction:o,scope:c});return(!BA(p)||!d)&&Zn(c,p),bf(()=>e(p,()=>p.end()),()=>{let{status:f}=et(p);p.isRecording()&&(!f||f==="ok")&&p.setStatus({code:2,message:"internal_error"})})}))}function Ae(t){let e=Vs();if(e.startInactiveSpan)return e.startInactiveSpan(t);let n=j0(t),{forceTransaction:r,parentSpan:o}=t;return(t.scope?a=>Oe(t.scope,a):o!==void 0?a=>Xr(o,a):a=>a())(()=>{let a=rt(),s=q0(a,o),l=P();return t.onlyIfParent&&!s?G0(a,l):$0({parentSpan:s,spanArguments:n,forceTransaction:r,scope:a})})}var Pg=(t,e)=>{let n=Jn(),r=Kr(n);if(r.continueTrace)return r.continueTrace(t,e);let{sentryTrace:o,baggage:i}=t,a=P(),s=xc(i);return a&&!U0(a,s?.org_id)?Sf(e):Oe(l=>{let c=sf(o,i);return l.setPropagationContext(c),Zn(l,void 0),e()})};function Xr(t,e){let n=Vs();return n.withActiveSpan?n.withActiveSpan(t,e):Oe(r=>(Zn(r,t||void 0),e(r)))}function Nc(t){let e=Vs();return e.suppressTracing?e.suppressTracing(t):Oe(n=>{n.setSDKProcessingMetadata({[_f]:!0});let r=t();return n.setSDKProcessingMetadata({[_f]:void 0}),r})}function vf(t=rt()){let e=Vs();return e.isTracingSuppressed?e.isTracingSuppressed(t):t.getScopeData().sdkProcessingMetadata[_f]===!0}function Sf(t){let e=Vs();return e.startNewTrace?e.startNewTrace(t):Oe(n=>(n.setPropagationContext({traceId:Cn(),sampleRand:ar()}),H&&w.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),Xr(null,t)))}function G0(t,e){e?.recordDroppedEvent("no_parent_span","span");let n=new ur({traceId:t.getPropagationContext().traceId});return Na(n,t,Pt()),n}function $0({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){let o=Pt();if(!De()){let s={...o.getPropagationContext(),...r.getPropagationContext()},l=t?t.spanContext().traceId:s.traceId,c=new ur({traceId:l});return t&&!n&&kc(t,c),Na(c,r,o),c}let i=P();if(zB(i,e)){vf(r)||i?.recordDroppedEvent("ignored","span");let s=new ur({dropReason:"ignored",traceId:t?.spanContext().traceId??r.getPropagationContext().traceId});return Na(s,r,o),s}let a;if(t&&!n)a=PB(t,r,e,o),kc(t,a);else if(t){let s=$e(t),{traceId:l,spanId:c}=t.spanContext(),d=Tn(t);a=LA({traceId:l,parentSpanId:c,...e},r,o,d),F0(a,s)}else{let{traceId:s,dsc:l,parentSpanId:c,sampled:d}={...o.getPropagationContext(),...r.getPropagationContext()};a=LA({traceId:s,parentSpanId:c,...e},r,o,d),l&&F0(a,l)}return RA(a),a}function j0(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 Kr(t)}function LA(t,e,n,r){let o=P(),i=o?.getOptions()||{},{name:a=""}=t,s={spanAttributes:{...t.attributes},spanName:a,parentSampled:r};o?.emit("beforeSampling",s,{decision:!1});let l=s.parentSampled??r,c=s.spanAttributes,d=e.getPropagationContext(),u=vf(e),[p,f,m]=u?[!1]:DA(i,{name:a,parentSampled:l,attributes:c,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:kr(d.dsc?.sample_rate)},d.sampleRand),_=new Ma({...t,attributes:{[Mt]:"custom",[ni]:f!==void 0&&m?f:void 0,...c},sampled:p});return!p&&o&&!u&&(H&&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 PB(t,e,n,r){let{spanId:o,traceId:i}=t.spanContext(),a=vf(e),s=a?!1:Tn(t),l=s?new Ma({...n,parentSpanId:o,traceId:i,sampled:s}):new ur({traceId:i});kc(t,l),Na(l,e,r);let c=P();return c&&(je(c)&&ai(l)&&(ai(t)&&t.dropReason?(l.dropReason=t.dropReason,c.recordDroppedEvent(t.dropReason,"span")):a||(l.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span"))),c.emit("spanStart",l),n.endTimestamp&&(c.emit("spanEnd",l),c.emit("afterSpanEnd",l))),l}function q0(t,e){if(e)return e;if(e===null)return;let n=Uo(t);if(!n)return;let r=P();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Bt(n):n}function UA(t){return t!==void 0?e=>Xr(t,e):e=>e()}function zB(t,e){let n=t?.getOptions().ignoreSpans;return!t||!je(t)||!n?.length?!1:Ui({description:e.name||"",op:e.attributes?.[ht]||e.op,attributes:e.attributes},n)}function BA(t){return ai(t)&&t.dropReason==="ignored"}var Cc={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},FB="heartbeatFailed",HB="idleTimeout",GB="finalTimeout",$B="externalFinish";function zg(t,e={}){let n=new Map,r=!1,o,i=$B,a=!e.disableAutoFinish,s=[],{idleTimeout:l=Cc.idleTimeout,finalTimeout:c=Cc.finalTimeout,childSpanTimeout:d=Cc.childSpanTimeout,beforeSpanEnd:u,trimIdleSpanEndTimestamp:p=!0}=e,f=P(),m=rt();if(!f||!De()){let I=new ur({traceId:m.getPropagationContext().traceId});return Na(I,m,Pt()),I}let _=Ot(),v=jB(t);v.end=new Proxy(v.end,{apply(I,D,z){if(u&&u(v),ai(D))return;let[U,...O]=z,N=U||Ct(),B=cr(N),V=ii(v).filter(F=>F!==v),st=et(v);if(!V.length||!p)return C(B),Reflect.apply(I,D,[B,...O]);let nt=f.getOptions().ignoreSpans,lt=V?.reduce((F,gt)=>{let Q=et(gt);return!Q.timestamp||nt&&Ui({description:Q.description,op:Q.op,attributes:Q.data},nt)?F:F?Math.max(F,Q.timestamp):Q.timestamp},void 0),X=st.start_timestamp,ct=Math.min(X?X+c/1e3:1/0,Math.max(X||-1/0,Math.min(B,lt||1/0)));return C(ct),Reflect.apply(I,D,[ct,...O])}});function h(){o&&(clearTimeout(o),o=void 0)}function b(I){h(),o=setTimeout(()=>{!r&&n.size===0&&a&&(i=HB,v.end(I))},l)}function S(I){o=setTimeout(()=>{!r&&a&&(i=FB,v.end(I))},d)}function E(I){h(),n.set(I,!0);let D=Ct();S(D+d/1e3)}function R(I){if(n.has(I)&&n.delete(I),n.size===0){let D=Ct();b(D+l/1e3)}}function C(I){r=!0,n.clear(),s.forEach(V=>V()),Zn(m,_);let D=et(v),{start_timestamp:z}=D;if(!z)return;D.data[Li]||v.setAttribute(Li,i);let O=D.status;(!O||O==="unknown")&&v.setStatus({code:1}),w.log(`[Tracing] Idle span "${D.op}" finished`);let N=ii(v).filter(V=>V!==v),B=0;N.forEach(V=>{V.isRecording()&&(V.setStatus({code:2,message:"cancelled"}),V.end(I),H&&w.log("[Tracing] Cancelling span since span ended early",JSON.stringify(V,void 0,2)));let st=et(V),{timestamp:nt=0,start_timestamp:lt=0}=st,X=lt<=I,ct=(c+l)/1e3,F=nt-lt<=ct;if(H){let gt=JSON.stringify(V,void 0,2);X?F||w.log("[Tracing] Discarding span since it finished after idle span final timeout",gt):w.log("[Tracing] Discarding span since it happened after idle span was finished",gt)}(!F||!X)&&(_A(v,V),B++)}),B>0&&v.setAttribute("sentry.idle_span_discarded_spans",B)}return s.push(f.on("spanStart",I=>{if(r||I===v||et(I).timestamp||I instanceof Ma&&I.isStandaloneSpan())return;ii(v).includes(I)&&E(I.spanContext().spanId)})),s.push(f.on("spanEnd",I=>{r||R(I.spanContext().spanId)})),s.push(f.on("idleSpanEnableAutoFinish",I=>{I===v&&(a=!0,b(),n.size&&S())})),e.disableAutoFinish||b(),setTimeout(()=>{r||(v.setStatus({code:2,message:"deadline_exceeded"}),i=GB,v.end())},c),v}function jB(t){let e=Ae(t);return Zn(rt(),e),H&&w.log("[Tracing] Started span is an idle span"),e}var qB=["addListener","on","once","prependListener","prependOnceListener","addEventListener"],VB=["removeListener","off","removeEventListener"],PA=Symbol("SentryScopeBoundListeners"),Mc;function YB(t){return Mc!==void 0&&(t===Mc||t.listener===Mc)}function V0(t,e=rt()){let n=t;if(Fg(n))return t;Y0(n);for(let r of qB)typeof n[r]=="function"&&(n[r]=KB(n,n[r],e));for(let r of VB)typeof n[r]=="function"&&(n[r]=XB(n,n[r]));return typeof n.removeAllListeners=="function"&&(n.removeAllListeners=JB(n,n.removeAllListeners)),t}function WB(t,e){return function(...n){return Oe(e,()=>t.apply(this,n))}}function zA(t){return typeof t=="function"}function KB(t,e,n){return function(...r){let o=r[0],i=r[1],a=r.slice(2);if(!zA(i)||YB(i))return e.apply(this,r);let s=Fg(t)||Y0(t),l=s.get(o);l||(l=new WeakMap,s.set(o,l));let c=l.get(i);c||(c=WB(i,n),l.set(i,c));let d=Mc;Mc=c;try{return e.call(this,o,c,...a)}finally{Mc=d}}}function XB(t,e){return function(...n){let r=n[0],o=n[1],i=n.slice(2),a=zA(o)?Fg(t)?.get(r)?.get(o):void 0;return a?e.call(this,r,a,...i):e.apply(this,n)}}function JB(t,e){return function(...n){let r=Fg(t);if(r)if(n.length===0)Y0(t);else{let o=n[0];r.delete(o)}return e.apply(this,n)}}function Y0(t){let e=new Map;return t[PA]=e,e}function Fg(t){return t[PA]}function HA(t,e){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=e;QB(t,e),r&&e4(t,r),n4(t,n),ZB(t,o),t4(t,i)}function FA(t,e){let{extra:n,tags:r,attributes:o,user:i,contexts:a,level:s,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:d,eventProcessors:u,attachments:p,propagationContext:f,transactionName:m,span:_}=e;Ef(t,"extra",n),Ef(t,"tags",r),Ef(t,"attributes",o),Ef(t,"user",i),Ef(t,"contexts",a),t.sdkProcessingMetadata=Ra(t.sdkProcessingMetadata,l,2),s&&(t.level=s),m&&(t.transactionName=m),_&&(t.span=_),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),d.length&&(t.fingerprint=[...t.fingerprint,...d]),u.length&&(t.eventProcessors=[...t.eventProcessors,...u]),p.length&&(t.attachments=[...t.attachments,...p]),t.propagationContext={...t.propagationContext,...f}}function Ef(t,e,n){t[e]=Ra(t[e],n,1)}function si(t,e){let n=lr().getScopeData();return t&&FA(n,t.getScopeData()),e&&FA(n,e.getScopeData()),n}function QB(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 ZB(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function t4(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function e4(t,e){t.contexts={trace:Ac(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:$e(e),...t.sdkProcessingMetadata};let n=Bt(e),r=et(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function n4(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 GA(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 Hg(t,e){let n=Ca(t),r=Gs(t),o=Ca(r),{isolationScope:i,scope:a}=oi(t),s=si(i,a);i4(n,o,e,s);let l=t.kind;e.emit("preprocessSpan",n,{spanKind:l}),n.is_segment&&(r4(n,s),o4(n,e),e.emit("processSegmentSpan",n)),e.emit("processSpan",n);let{beforeSendSpan:c}=e.getOptions(),d=c&&Pi(c)?a4(n,c):n,u=d.attributes?.[Mt];return u&&Rr(d,{"sentry.span.source":u}),{...Rg(d),_segmentSpan:r}}function r4(t,e){let n=GA(e.contexts);Rr(t,n)}function Rr(t,e){let n=t.attributes??(t.attributes={});Object.entries(e).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}function o4(t,e){let n=e.getIntegrationNames();n.length&&Rr(t,{[gg]:n})}function i4(t,e,n,r){let o=n.getSdkMetadata(),{release:i,environment:a}=n.getOptions();Rr(t,{[cg]:i,[ug]:a||zo,[dg]:e.name,[fg]:e.span_id,[pg]:o?.sdk?.name,[mg]:o?.sdk?.version,[hg]:r.user?.id,[yg]:r.user?.email,[bg]:r.user?.ip_address,[_g]:r.user?.username,...r.attributes})}function a4(t,e){let n=e(t);return n||($s(),t)}var W0=0,$A=1,jA=2;function li(t){return new Tf(e=>{e(t)})}function Ys(t){return new Tf((e,n)=>{n(t)})}var Tf=class t{constructor(e){this._state=W0,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===W0)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===$A&&n[1](this._value),this._state===jA&&n[2](this._value),n[0]=!0)})}_runExecutor(e){let n=(i,a)=>{if(this._state===W0){if(Nn(a)){a.then(r,o);return}this._state=i,this._value=a,this._executeHandlers()}},r=i=>{n($A,i)},o=i=>{n(jA,i)};try{e(r,o)}catch(i){o(i)}}};function qA(t,e,n,r=0){try{let o=K0(e,n,t,r);return Nn(o)?o:li(o)}catch(o){return Ys(o)}}function K0(t,e,n,r){let o=n[r];if(!t||!o)return t;let i=o({...t},e);return H&&i===null&&w.log(`Event processor "${o.id||"?"}" dropped event`),Nn(i)?i.then(a=>K0(a,e,n,r+1)):K0(i,e,n,r+1)}var Ws,VA,YA,Oa;function Gg(t){let e=tt._sentryDebugIds,n=tt._debugIds;if(!e&&!n)return{};let r=e?Object.keys(e):[],o=n?Object.keys(n):[];if(Oa&&r.length===VA&&o.length===YA)return Oa;VA=r.length,YA=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 X0(t,e){let n=Gg(t);if(!n)return[];let r=[];for(let o of e){let i=P1(o);i&&n[i]&&r.push({type:"sourcemap",code_file:o,debug_id:n[i]})}return r}function wf(t,e,n,r,o,i){let{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=t,l={...e,event_id:e.event_id||n.event_id||ae(),timestamp:e.timestamp||sr()},c=n.integrations||t.integrations.map(h=>h.name);s4(l,t),u4(l,c),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&l4(l,t.stackParser);let d=f4(r,n.captureContext);n.mechanism&&En(l,n.mechanism);let u=o?o.getEventProcessors():[],p=si(i,d),f=[...n.attachments||[],...p.attachments];f.length&&(n.attachments=f),HA(l,p);let m=[...u,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?li(l):qA(m,l,n)).then(h=>(h&&c4(h),typeof a=="number"&&a>0?d4(h,a,s):h))}function s4(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 l4(t,e){let n=Gg(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function c4(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 u4(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function d4(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:ue(o.data,e,n)}}))},...t.user&&{user:ue(t.user,e,n)},...t.contexts&&{contexts:ue(t.contexts,e,n)},...t.extra&&{extra:ue(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=ue(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>({...o,...o.data&&{data:ue(o.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=ue(t.contexts.flags,3,n)),r}function f4(t,e){if(!e)return t;let n=t?t.clone():new $n;return n.update(e),n}function WA(t){if(t)return p4(t)?{captureContext:t}:g4(t)?{captureContext:t}:t}function p4(t){return t instanceof $n||typeof t=="function"}var m4=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function g4(t){return Object.keys(t).some(e=>m4.includes(e))}function Et(t,e){return rt().captureException(t,WA(e))}function Da(t,e){let n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return rt().captureMessage(t,n,r)}function Jr(t,e){return rt().captureEvent(t,e)}function La(t,e){Pt().setContext(t,e)}function $g(t){Pt().setExtras(t)}function jg(t,e){Pt().setExtra(t,e)}function qg(t){Pt().setTags(t)}function Oc(t,e){Pt().setTag(t,e)}function Vg(t){Pt().setAttributes(t)}function Yg(t,e){Pt().setAttribute(t,e)}function Wg(t){Pt().setUser(t)}function Kg(t){Pt().setConversationId(t)}function Dc(){return Pt().lastEventId()}async function Xg(t){let e=P();return e?e.flush(t):(H&&w.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Jg(t){let e=P();return e?e.close(t):(H&&w.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function Qg(){return!!P()}function Lc(){let t=P();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function Uc(t){Pt().addEventProcessor(t)}function Ks(t){let e=Pt(),{user:n}=si(e,rt()),{userAgent:r}=tt.navigator||{},o=K1({user:n,...r&&{userAgent:r},...t}),i=e.getSession();return i?.status==="ok"&&Oi(i,{status:"exited"}),Bc(),e.setSession(o),o}function Bc(){let t=Pt(),n=rt().getSession()||t.getSession();n&&X1(n),KA(),t.setSession()}function KA(){let t=Pt(),e=P(),n=t.getSession();n&&e&&e.captureSession(n)}function Ua(t=!1){if(t){Bc();return}KA()}function Ba(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}var XA="7";function JA(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function h4(t){return`${JA(t)}${t.projectId}/envelope/`}function y4(t,e){let n={sentry_version:XA};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function xf(t,e,n){return e||`${h4(t)}?${y4(t,n)}`}function J0(t,e){let n=af(t);if(!n)return"";let r=`${JA(n)}embed/error-page/`,o=`dsn=${en(n)}`;for(let i in e)if(i!=="dsn"&&i!=="onClose")if(i==="user"){let a=e.user;if(!a)continue;a.name&&(o+=`&name=${encodeURIComponent(a.name)}`),a.email&&(o+=`&email=${encodeURIComponent(a.email)}`)}else o+=`&${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`;return`${r}?${o}`}var Zg=[];function b4(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 th(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 b4(r)}function QA(t,e){let n={};return e.forEach(r=>{r?.beforeSetup&&r.beforeSetup(t)}),e.forEach(r=>{r&&Z0(t,r,n)}),n}function Q0(t,e){for(let n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function Z0(t,e,n){if(n[e.name]){H&&w.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!Zg.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),Zg.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))}),H&&w.log(`Integration installed: ${e.name}`)}function Xs(t){let e=P();if(!e){H&&w.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`);return}e.addIntegration(t)}var _4="sentry.timestamp.sequence",tv=0,ev;function eh(t){let e=Math.floor(t*1e3);ev!==void 0&&e!==ev&&(tv=0);let n=tv;return tv++,ev=e,{key:_4,value:{value:n,type:"integer"}}}function nh(t,e){return e?Oe(e,()=>{let n=Ot(),r=n?Ac(n):Ec(e);return[n?$e(n):Bi(t,e),r]}):[void 0,void 0]}var ZA={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function nv(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function rv(){return"npm"}function tI(){return!nv()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Vn(){return typeof window<"u"&&(!tI()||v4())}function v4(){return tt.process?.type==="renderer"}function S4(t,e){let n=e?"auto":"never";return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function eI(t,e,n,r,o){let i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=en(r)),Le(i,[S4(t,o)])}var E4=100;function ci(t,e,n,r=!0){n&&(!t[e]||r)&&(t[e]=n)}function nI(t,e){let n=iv(),r=rI(t);r===void 0?n.set(t,[e]):r.length>=E4?(Js(t,r),n.set(t,[e])):n.set(t,[...r,e])}function Pa(t,e=rt(),n=nI){let r=e?.getClient()??P();if(!r){H&&w.warn("No client available to capture log.");return}let{release:o,environment:i,enableLogs:a=!1,beforeSendLog:s}=r.getOptions();if(!a){H&&w.warn("logging option not enabled, log will not be captured.");return}let[,l]=nh(r,e),c={...t.attributes},{user:{id:d,email:u,username:p},attributes:f={}}=si(Pt(),e);ci(c,"user.id",d,!1),ci(c,"user.email",u,!1),ci(c,"user.name",p,!1),ci(c,"sentry.release",o),ci(c,"sentry.environment",i);let{name:m,version:_}=r.getSdkMetadata()?.sdk??{};ci(c,"sentry.sdk.name",m),ci(c,"sentry.sdk.version",_);let v=r.getIntegrationByName("Replay"),h=v?.getReplayId(!0);ci(c,"sentry.replay_id",h),h&&v?.getRecordingMode()==="buffer"&&ci(c,"sentry._internal.replay_is_buffering",!0);let b=t.message;if(ei(b)){let{__sentry_template_string__:B,__sentry_template_values__:V=[]}=b;V?.length&&(c["sentry.message.template"]=B),V.forEach((st,nt)=>{c[`sentry.message.parameter.${nt}`]=st})}let S=Uo(e);ci(c,"sentry.trace.parent_span_id",S?.spanContext().spanId);let E={...t,attributes:c};r.emit("beforeCaptureLog",E);let R=s?fn(()=>s(E)):E;if(!R){r.recordDroppedEvent("before_send","log_item",1),H&&w.warn("beforeSendLog returned null, log will not be captured.");return}let{level:C,message:I,attributes:D={},severityNumber:z}=R,U=Ct(),O=eh(U),N={timestamp:U,level:C,body:ov(String(I)),trace_id:l?.trace_id,severity_number:z??ZA[C],attributes:T4({...Di(f),...Di(D,!0),[O.key]:O.value})};n(r,N),r.emit("afterCaptureLog",R)}function Js(t,e){let n=e??rI(t)??[];if(n.length===0)return;let r=t.getOptions(),o=eI(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);iv().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(o)}function rI(t){return iv().get(t)}function iv(){return Mo("clientToLogBufferMap",()=>new WeakMap)}function T4(t){let e={};for(let[n,r]of Object.entries(t)){let o=ov(n);r.type==="string"?e[o]={...r,value:ov(r.value)}:e[o]=r}return e}function ov(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 w4(t,e){let n=e?"auto":"never";return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function oI(t,e,n,r,o){let i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=en(r)),Le(i,[w4(t,o)])}var x4=1e3;function Fi(t,e,n,r=!0){n&&(r||!(e in t))&&(t[e]=n)}function iI(t,e){let n=sv(),r=aI(t);r===void 0?n.set(t,[e]):r.length>=x4?(Pc(t,r),n.set(t,[e])):n.set(t,[...r,e])}function A4(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 I4(t,e,n,r){let[,o]=nh(e,n),i=Uo(n),a=i?i.spanContext().traceId:o?.trace_id,s=i?i.spanContext().spanId:void 0,l=Ct(),c=eh(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 av(t,e){let n=e?.scope??rt(),r=e?.captureSerializedMetric??iI,o=n?.getClient()??P();if(!o){H&&w.warn("No client available to capture metric.");return}let{_experiments:i,enableMetrics:a,beforeSendMetric:s}=o.getOptions();if(!(a??i?.enableMetrics??!0)){H&&w.warn("metrics option not enabled, metric will not be captured.");return}let{user:c,attributes:d}=si(Pt(),n),u=A4(t,o,c);o.emit("processMetric",u);let p=s||i?.beforeSendMetric,f=p?p(u):u;if(!f){H&&w.log("`beforeSendMetric` returned `null`, will not send metric.");return}let m=I4(f,o,n,d);H&&w.log("[Metric]",m),r(o,m),o.emit("afterCaptureMetric",f)}function Pc(t,e){let n=e??aI(t)??[];if(n.length===0)return;let r=t.getOptions(),o=oI(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);sv().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(o)}function aI(t){return sv().get(t)}function sv(){return Mo("clientToMetricBufferMap",()=>new WeakMap)}function sI(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 Rg(e)}function lI(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(sI(i)):r.push(i);if(n.length===0)return;t.spans=r;let o=e.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}var zc=Symbol.for("SentryBufferFullError");function Qs(t=100){let e=new Set;function n(){return e.size<t}function r(a){e.delete(a)}function o(a){if(!n())return Ys(zc);let s=a();return e.add(s),s.then(()=>r(s),()=>r(s)),s}function i(a){if(!e.size)return li(!0);let s=Promise.allSettled(Array.from(e)).then(()=>!0);if(!a)return s;let l=[s,new Promise(c=>Ba(setTimeout(()=>c(!1),a)))];return Promise.race(l)}return{get $(){return Array.from(e)},add:o,drain:i}}var cI=60*1e3;function rh(t,e=Hn()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?cI:r-e}function uI(t,e){return t[e]||t.all||0}function Af(t,e,n=Hn()){return uI(t,e)>n}function If(t,{statusCode:e,headers:n},r=Hn()){let o={...t},i=n?.["x-sentry-rate-limits"],a=n?.["retry-after"];if(i)for(let s of i.trim().split(",")){let[l,c,,,d]=s.split(":",5),u=parseInt(l,10),p=(isNaN(u)?60:u)*1e3;if(!c)o.all=r+p;else for(let f of c.split(";"))f==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[f]=r+p):o[f]=r+p}else a?o.all=r+rh(a,r):e===429&&(o.all=r+60*1e3);return o}var lv=64;function kf(t,e,n=Qs(t.bufferSize||lv)){let r={},o=a=>n.drain(a);function i(a){let s=[];if(dr(a,(u,p)=>{let f=hf(p);Af(r,f)?t.recordDroppedEvent("ratelimit_backoff",f):s.push(u)}),s.length===0)return Promise.resolve({});let l=Le(a[0],s),c=u=>{if(js(l,["client_report"])){H&&w.warn(`Dropping client report. Will not send outcomes (reason: ${u}).`);return}dr(l,(p,f)=>{t.recordDroppedEvent(u,hf(f))})},d=()=>e({body:zi(l)}).then(u=>u.statusCode===413?(H&&w.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),u):(H&&u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&w.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),r=If(r,u),u),u=>{throw c("network_error"),H&&w.error("Encountered error running transport request:",u),u});return n.add(d).then(u=>u,u=>{if(u===zc)return H&&w.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw u})}return{send:i,flush:o}}function dI(t,e,n){let r=[{type:"client_report"},{timestamp:n||sr(),discarded_events:t}];return Le(e?{dsn:e}:{},[r])}function oh(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 fI(t){let{trace_id:e,parent_span_id:n,span_id:r,status:o,origin:i,data:a,op:s}=t.contexts?.trace??{};return{data:a??{},description:t.transaction,op:s,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:o,timestamp:t.timestamp,trace_id:e??"",origin:i,profile_id:a?.[Fs],exclusive_time:a?.[jn],measurements:t.measurements,is_segment:!0}}function pI(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[Fs]:t.profile_id},...t.exclusive_time&&{[jn]:t.exclusive_time}}}},measurements:t.measurements}}var Zs="[Filtered]",Rf=["forwarded","-ip","remote-","via","-user"],cv=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],mI=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function gI(t){return t===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:Rf},httpHeaders:{request:{deny:Rf},response:{deny:Rf}},httpBodies:[],queryParams:{deny:Rf},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:7}}var k4={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 hI(t){let e=t.dataCollection!=null?k4:gI(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 yI="Not capturing exception because it's already been captured.",bI="Discarded session because of missing or non-string release",wI=Symbol.for("SentryInternalError"),xI=Symbol.for("SentryDoNotSendEventError"),R4=5e3;function ih(t){return{message:t,[wI]:!0}}function uv(t){return{message:t,[xI]:!0}}function _I(t){return!!t&&typeof t=="object"&&wI in t}function vI(t){return!!t&&typeof t=="object"&&xI in t}function SI(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??R4;c>0&&(s=!0,a=Ba(setTimeout(()=>{o(t)},c)))}}),t.on("flush",()=>{o(t)})}var Nf=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Qs(e.transportOptions?.bufferSize??lv),this._dataCollection=hI(e),e.dsn?this._dsn=af(e.dsn):H&&w.warn("No DSN provided, client will not send events."),this._dsn){let r=xf(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&SI(this,"afterCaptureLog","flushLogs",O4,Js),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&SI(this,"afterCaptureMetric","flushMetrics",M4,Pc)}captureException(e,n,r){let o=ae();if(nf(e))return H&&w.log(yI),o;let i={event_id:o,...n};return this._process(()=>this.eventFromException(e,i).then(a=>this._captureEvent(a,i,r)).then(a=>a),"error"),i.event_id}captureMessage(e,n,r,o){let i={event_id:ae(),...r},a=ei(e)?e:String(e),s=Ze(e),l=s?this.eventFromMessage(a,n,i):this.eventFromException(e,i);return this._process(()=>l.then(c=>this._captureEvent(c,i,o)),s?"unknown":"error"),i.event_id}captureEvent(e,n,r){let o=ae();if(n?.originalException&&nf(n.originalException))return H&&w.log(yI),o;let i={event_id:o,...n},a=e.sdkProcessingMetadata||{},s=a.capturedSpanScope,l=a.capturedSpanIsolationScope,c=EI(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),Z0(this,e,this._integrations),n||Q0(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=lI(e,this),o=IA(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=gf(o,Bg(i));r&&(o=gf(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",e,i))}sendSession(e){let{release:n,environment:r=zo}=this._options;if("aggregates"in e){let i=e.attrs||{};if(!i.release&&!n){H&&w.warn(bI);return}i.release=i.release||n,i.environment=i.environment||r,e.attrs=i}else{if(!e.release&&!n){H&&w.warn(bI);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);let o=AA(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}`;H&&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 H&&w.error("Error while sending envelope:",n),{}}return H&&w.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=QA(this,e),Q0(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",o=!1,i=n.exception?.values;if(i){o=!0,r=!1;for(let l of i)if(l.mechanism?.handled===!1){r=!0;break}}let a=e.status==="ok";(a&&e.errors===0||a&&r)&&(Oi(e,{...r&&{status:"crashed"},errors:e.errors||Number(o||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let n=0;for(;!e||n<e;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,o){let i=this.getOptions(),a=this.getIntegrationNames();return!n.integrations&&a.length&&(n.integrations=a),this.emit("preprocessEvent",e,n),e.type||o.setLastEventId(e.event_id||n.event_id),wf(i,e,n,r,this,o).then(s=>{if(s===null)return s;this.emit("postprocessEvent",s,n),s.contexts={trace:{...s.contexts?.trace,...Ec(r)},...s.contexts};let l=Bi(this,r);return s.sdkProcessingMetadata={dynamicSamplingContext:l,...s.sdkProcessingMetadata},s})}_captureEvent(e,n={},r=rt(),o=Pt()){return H&&dv(e)&&w.log(`Captured error event \`${oh(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,o).then(i=>i.event_id,i=>{H&&(vI(i)?w.log(i.message):_I(i)?w.warn(i.message):w.warn(i))})}_processEvent(e,n,r,o){let i=this.getOptions(),{sampleRate:a}=i,s=AI(e),l=dv(e),d=`before send for type \`${e.type||"error"}\``,u=typeof a>"u"?void 0:kr(a);if(l&&typeof u=="number"&&ar()>u)return this.recordDroppedEvent("sample_rate","error"),Ys(uv(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let p=EI(e.type);return this._prepareEvent(e,n,r,o).then(f=>{if(f===null)throw this.recordDroppedEvent("event_processor",p),uv("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return f;let _=C4(this,i,f,n);return N4(_,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 uv(`${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 vI(f)||_I(f)?f:(this.captureException(f,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:f}),ih(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
18
+ Reason: ${f}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===zc&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[o,i]=n.split(":");return{reason:o,category:i,quantity:r}})}_flushOutcomes(){H&&w.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){H&&w.log("No outcomes to send");return}if(!this._dsn){H&&w.log("No dsn provided, will not send outcomes");return}H&&w.log("Sending outcomes:",e);let n=dI(e,this._options.tunnel&&en(this._dsn));this.sendEnvelope(n)}};function EI(t){return t==="replay_event"?"replay":t||"error"}function N4(t,e){let n=`${e} must return \`null\` or a valid event.`;if(Nn(t))return t.then(r=>{if(!he(r)&&r!==null)throw ih(n);return r},r=>{throw ih(`${e} rejected with ${r}`)});if(!he(t)&&t!==null)throw ih(n);return t}function C4(t,e,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:a}=e,s=!Pi(e.beforeSendSpan)&&e.beforeSendSpan,l=n;if(dv(l)&&o)return o(l,r);if(AI(l)){if(s||a){let c=fI(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,pI(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)){EA(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 dv(t){return t.type===void 0}function AI(t){return t.type==="transaction"}function M4(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+II(t.attributes)}function O4(t){let e=0;return t.message&&(e+=t.message.length*2),e+II(t.attributes)}function II(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*TI(n[0]):Ze(n)?e+=TI(n):e+=100}),e}function TI(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function fv(t,e){e.debug===!0&&(H?w.enable():fn(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),rt().update(e.initialScope);let r=new t(e);return ah(r),r.init(),r}function ah(t){rt().setClient(t)}var pv=100,mv=5e3,D4=36e5;function gv(t){function e(...n){H&&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=mv,a;function s(u,p,f){return js(u,["client_report"])?!1:n.shouldStore?n.shouldStore(u,p,f):!0}function l(u){a&&clearTimeout(a),a=Ba(setTimeout(async()=>{a=void 0;let p=await o.shift();p&&(e("Attempting to send previously queued event"),p[0].sent_at=new Date(Hn()).toISOString(),d(p,!0).catch(f=>{e("Failed to retry sending",f)}))},u))}function c(){a||(l(i),i=Math.min(i*2,D4))}async function d(u,p=!1){if(!p&&js(u,["replay_event","replay_recording"]))return await o.push(u),l(pv),{};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=pv;if(f){if(f.headers?.["retry-after"])m=rh(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=mv,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=mv,l(pv)),r.flush(u))}}}var Fc="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function kI(t,e){let n;return dr(t,(r,o)=>(e.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function L4(t,e){return n=>{let r=t(n);return{...r,send:async o=>{let i=kI(o,["event","transaction","profile","replay_event"]);return i&&(i.release=e),r.send(o)}}}}function U4(t,e){return Le(e?{...t[0],dsn:e}:t[0],t[1])}function hv(t,e){return n=>{let r=t(n),o=new Map,i=e||(c=>{let d=c.getEvent();return d?.extra?.[Fc]&&Array.isArray(d.extra[Fc])?d.extra[Fc]:[]});function a(c,d){let u=d?`${c}:${d}`:c,p=o.get(u);if(!p){let f=xg(c);if(!f)return;let m=xf(f,n.tunnel);p=d?L4(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 kI(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(U4(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 yv(t,e){return e.some(n=>t.includes(n))}function za(t,e,n){if(e===!1)return{};let r=n!=null?[...cv,...n]:cv,o={};if(e===!0){for(let a of Object.keys(t))o[a]=yv(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=yv(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(yv(s,r))o[a]=Zs;else{let l=i.some(c=>s.includes(c));o[a]=l?t[a]:Zs}}return o}function RI(t){let e={},n=0;for(;n<t.length;){let r=t.indexOf("=",n);if(r===-1)break;let o=t.indexOf(";",n);if(o===-1)o=t.length;else if(o<r){n=t.lastIndexOf(";",r-1)+1;continue}let i=t.slice(n,r).trim();if(e[i]===void 0){let a=t.slice(r+1,o).trim();a.charCodeAt(0)===34&&(a=a.slice(1,-1));try{e[i]=a.indexOf("%")!==-1?decodeURIComponent(a):a}catch{e[i]=a}}n=o+1}return e}function Cf(t,e){if(e===!1)return{};try{let n=RI(t);return Object.keys(n).length===0?{}:za(n,e,mI)}catch{return Zs}}var B4="thismessage:/";function tl(t){return"isRelative"in t}function ui(t,e){let n=t.indexOf("://")<=0&&t.indexOf("//")!==0,r=e??(n?B4:void 0);try{if("canParse"in URL&&!URL.canParse(t,r))return;let o=new URL(t,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function Hc(t){if(tl(t))return t.pathname;let e=new URL(t);return e.search="",e.hash="",["80","443"].includes(e.port)&&(e.port=""),e.password&&(e.password="%filtered%"),e.username&&(e.username="%filtered%"),e.toString()}function Qr(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Gc(t){return t.split(/[?#]/,1)[0]}function Yn(t,e=!0){if(t.startsWith("data:")){let n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=t.includes(";base64,"),i=t.indexOf(","),a="";if(e&&i!==-1){let s=t.slice(i+1);a=s.length>10?`${s.slice(0,10)}... [truncated]`:s}return`data:${r}${o?",base64":""}${a?`,${a}`:""}`}return t}function $c(t,e){let n=e?.getDsn(),r=e?.getOptions().tunnel;return z4(t,n)||P4(t,r)}function P4(t,e){return e?NI(t)===NI(e):!1}function z4(t,e){let n=ui(t);return!n||tl(n)||!e?!1:F4(n.hostname,e.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function F4(t,e){return t===e||e.length>0&&t.endsWith(`.${e}`)}function NI(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function sh(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 bv=sh;function _v(t){"aggregates"in t?t.attrs?.ip_address===void 0&&(t.attrs={...t.attrs,ip_address:"{{auto}}"}):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function Mf(t,e,n=[e],r="npm"){let o=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${e}`,o.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:ir})),o.version=ir)}function el(t={}){let e=t.client||P();if(!Lc()||!e)return{};let n=Jn(),r=Kr(n);if(r.getTraceData)return r.getTraceData(t);let o=t.scope||rt(),i=t.span||Ot(),a=ai(i)&&!De(e.getOptions());if(!i&&sg())return{};let s=i&&!a?Ic(i):H4(o),l=i?$e(i):Bi(e,o),c=wg(l);if(!Ig.test(s))return w.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let u={"sentry-trace":s,baggage:c};return t.propagateTraceparent&&(u.traceparent=i&&!a?gA(i):G4(o)),u}function H4(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return lf(e,r,n)}function G4(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return cf(e,r,n)}function vv(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 $4=100;function wn(t,e){let n=P(),r=Pt();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=$4}=n.getOptions();if(i<=0)return;let s={timestamp:sr(),...t},l=o?fn(()=>o(s,e)):s;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,e),r.addBreadcrumb(l,i))}var CI,j4="FunctionToString",MI=new WeakMap,q4=(()=>({name:j4,setupOnce(){CI=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=Aa(this),n=MI.has(P())&&e!==void 0?e:this;return CI.apply(n,t)}}catch{}},setup(t){MI.set(t,!0)}})),Of=q4;var V4=[/^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$/],Y4="EventFilters",ch=(t={})=>{let e;return{name:Y4,setup(n){let r=n.getOptions();e=OI(t,r)},processEvent(n,r,o){if(!e){let i=o.getOptions();e=OI(t,i)}return W4(n,e)?null:n}}},Df=((t={})=>({...ch(t),name:"InboundFilters"}));function OI(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:V4],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function W4(t,e){if(t.type){if(t.type==="transaction"&&X4(t,e.ignoreTransactions))return H&&w.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
19
+ Event: ${Lo(t)}`),!0}else{if(K4(t,e.ignoreErrors))return H&&w.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
20
+ Event: ${Lo(t)}`),!0;if(tP(t))return H&&w.warn(`Event dropped due to not having an error message, error type or stacktrace.
21
+ Event: ${Lo(t)}`),!0;if(J4(t,e.denyUrls))return H&&w.warn(`Event dropped due to being matched by \`denyUrls\` option.
22
+ Event: ${Lo(t)}.
23
+ Url: ${lh(t)}`),!0;if(!Q4(t,e.allowUrls))return H&&w.warn(`Event dropped due to not being matched by \`allowUrls\` option.
24
+ Event: ${Lo(t)}.
25
+ Url: ${lh(t)}`),!0}return!1}function K4(t,e){return e?.length?oh(t).some(n=>tn(n,e)):!1}function X4(t,e){if(!e?.length)return!1;let n=t.transaction;return n?tn(n,e):!1}function J4(t,e){if(!e?.length)return!1;let n=lh(t);return n?tn(n,e):!1}function Q4(t,e){if(!e?.length)return!0;let n=lh(t);return n?tn(n,e):!0}function Z4(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 lh(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Z4(n):null}catch{return H&&w.error(`Cannot extract url for event ${Lo(t)}`),null}}function tP(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function Ev(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=Sv(t,e,r,i.originalException,n,o.exception.values,a,0))}function Sv(t,e,n,r,o,i,a,s){if(i.length>=n+1)return i;let l=[...i];if(Oo(r[o],Error)){DI(a,s,r);let c=t(e,r[o]),d=l.length;LI(c,o,d,s),l=Sv(t,e,n,r[o],o,[c,...l],c,d)}return UI(r)&&r.errors.forEach((c,d)=>{if(Oo(c,Error)){DI(a,s,r);let u=t(e,c),p=l.length;LI(u,`errors[${d}]`,p,s),l=Sv(t,e,n,c,o,[u,...l],u,p)}}),l}function UI(t){return Array.isArray(t.errors)}function DI(t,e,n){t.mechanism={handled:!0,type:"auto.core.linked_errors",...UI(n)&&{is_exception_group:!0},...t.mechanism,exception_id:e}}function LI(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function eP(t){return pn(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function uh(t){return eP(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}var PI=new Map,BI=new Set;function nP(t){if(tt._sentryModuleMetadata)for(let e of Object.keys(tt._sentryModuleMetadata)){let n=tt._sentryModuleMetadata[e];if(BI.has(e))continue;BI.add(e);let r=t(e);for(let o of r.reverse())if(o.filename){PI.set(o.filename,n);break}}}function rP(t,e){return nP(t),PI.get(e)}function dh(t,e){e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(r=>{if(!r.filename||r.module_metadata)return;let o=rP(t,r.filename);o&&(r.module_metadata=o)})})}function fh(t){t.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(n=>{delete n.module_metadata})})}var Tv=()=>({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&&(fh(o),n[1]=o)}})}),t.on("applyFrameMetadata",e=>{if(e.type)return;let n=t.getOptions().stackParser;dh(n,e)})}});var zI=new Set([]);function nl(t){let e="console",n=zn(e,t);return Fn(e,oP),n}function oP(){"console"in tt&&wa.forEach(function(t){t in tt.console&&ye(tt.console,t,function(e){return Ls[t]=e,function(...n){let r=n[0],o=Ls[t],i=zI.size&&typeof r=="string"&&tn(r,zI);i||Qe("console",{args:n,level:t}),(!i||H&&w.isEnabled())&&o?.apply(tt.console,n)}})})}function Hi(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var iP="CaptureConsole",aP=((t={})=>{let e=t.levels||wa,n=t.handled??!0;return{name:iP,setup(r){"console"in tt&&nl(({args:o,level:i})=>{P()!==r||!e.includes(i)||sP(o,i,n)})}}}),wv=aP;function sP(t,e,n){let r=Hi(e),o=new Error,i={level:Hi(e),extra:{arguments:t}};Oe(a=>{if(a.addEventProcessor(c=>(c.logger="console",En(c,{handled:n,type:"auto.core.capture_console"}),c)),e==="assert"){if(!t[0]){let c=`Assertion failed: ${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){Et(s,i);return}let l=Ia(t," ");a.captureMessage(l,r,{captureContext:i,syntheticException:o})})}var lP="Dedupe",cP=(()=>{let t;return{name:lP,processEvent(e){if(e.type)return e;try{if(uP(e,t))return H&&w.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}}),Lf=cP;function uP(t,e){return e?!!(dP(t,e)||fP(t,e)):!1}function dP(t,e){let n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!GI(t,e)||!HI(t,e))}function fP(t,e){let n=FI(e),r=FI(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!GI(t,e)||!HI(t,e))}function HI(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 GI(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 FI(t){return t.exception?.values?.[0]}var pP="ExtraErrorData",mP=((t={})=>{let{depth:e=3,captureErrorCause:n=!0}=t;return{name:pP,processEvent(r,o,i){let{maxValueLength:a}=i.getOptions();return gP(r,o,e,n,a)}}}),xv=mP;function gP(t,e={},n,r,o){if(!e.originalException||!pn(e.originalException))return t;let i=e.originalException.name||e.originalException.constructor.name,a=$I(e.originalException,r,o);if(a){let s={...t.contexts},l=ue(a,n);return he(l)&&(w0(l),s[i]=l),{...t,contexts:s}}return t}function $I(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]=pn(a)||typeof a=="string"?n?Do(`${a}`,n):`${a}`:a}if(e&&t.cause!==void 0)if(pn(t.cause)){let i=t.cause.name||t.cause.constructor.name;o.cause={[i]:$I(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]=pn(s)?s.toString():s}}return o}catch(r){H&&w.error("Unable to extract extra data from the Error object:",r)}return null}function hP(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 yP=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function bP(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=yP.exec(e);return n?n.slice(1):[]}function jI(...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=hP(e.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+e||"."}function qI(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 VI(t,e){t=jI(t).slice(1),e=jI(e).slice(1);let n=qI(t.split("/")),r=qI(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 YI(t,e){let n=bP(t)[2]||"";return e&&n.slice(e.length*-1)===e&&(n=n.slice(0,n.length-e.length)),n}var _P="RewriteFrames",Av=(t={})=>{let e=t.root,n=t.prefix||"app:///",r="window"in tt&&!!tt.window,o=t.iteratee||vP({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:_P,processEvent(s){let l=s;return s.exception&&Array.isArray(s.exception.values)&&(l=i(l)),l}}};function vP({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?VI(e,a):YI(a);r.filename=`${n}${s}`}return r}}var SP=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],EP=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],TP={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"},KI=["select","insert","upsert","update","delete"];function ph(t){try{t.__SENTRY_INSTRUMENTED__=!0}catch{}}function mh(t){try{return t.__SENTRY_INSTRUMENTED__}catch{return!1}}function XI(t,e){if(Object.keys(e).length>0)return e;if(Array.isArray(t)&&t.length>0)return t}function wP(t,e){return XI(t,e)!==void 0}function xP(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 AP(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&&TP[n]||"filter",`${o}(${t}, ${r.join(".")})`}function WI(t,e=!1){return new Proxy(t,{apply(n,r,o){return nn({name:`auth ${e?"(admin) ":""}${t.name}`,attributes:{[at]:"auto.db.supabase",[ht]:"db","db.system":"postgresql","db.operation":`auth.${e?"admin.":""}${t.name}`}},i=>Reflect.apply(n,r,o).then(a=>(a&&typeof a=="object"&&"error"in a&&a.error?(i.setStatus({code:2}),Et(a.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):i.setStatus({code:1}),i.end(),a)).catch(a=>{throw i.setStatus({code:2}),i.end(),Et(a,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),a}).then(...o))}})}function IP(t){let e=t.auth;if(!(!e||mh(t.auth))){for(let n of SP){let r=e[n];r&&typeof t.auth[n]=="function"&&(t.auth[n]=WI(r))}for(let n of EP){let r=e.admin[n];r&&typeof t.auth.admin[n]=="function"&&(t.auth.admin[n]=WI(r,!0))}ph(t.auth)}}function kP(t,e){mh(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 NP(a,e),i}}),ph(t.prototype.from))}function RP(t,e){mh(t.prototype.then)||(t.prototype.then=new Proxy(t.prototype.then,{apply(n,r,o){let i=KI,a=r,s=xP(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(AP(E,R));let u=Object.create(null);if(he(a.body))for(let[E,R]of Object.entries(a.body))u[E]=R;let p=P(),f=e.sendOperationData??p?.getDataCollectionOptions().userInfo===!0,m=XI(a.body,u),_=s==="select"?"":`${s}${wP(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",[ht]:"db"};return d.length&&f&&(S["db.query"]=d),m!==void 0&&f&&(S["db.body"]=m),nn({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 D=new Error(R.error.message);R.error.code&&(D.code=R.error.code),R.error.details&&(D.details=R.error.details);let z={};d.length&&f&&(z.query=d),m!==void 0&&f&&(z.body=m),Et(D,U=>(U.addEventProcessor(O=>(En(O,{handled:!1,type:"auto.db.supabase.postgres"}),O)),U.setContext("supabase",z),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),wn(C),R},R=>{throw E&&(ri(E,500),E.end()),R}).then(...o))}}),ph(t.prototype.then))}function NP(t,e){for(let n of KI)mh(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 H&&w.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),RP(s,e),a}}),ph(t.prototype[n]))}var gh=(t,e={})=>{if(!t){H&&w.warn("Supabase integration was not installed because no Supabase client was provided.");return}let n=t.constructor===Function?t:t.constructor;kP(n,e),IP(t)},CP="Supabase",MP=((t,e)=>({setupOnce(){gh(t,e)},name:CP})),Iv=t=>MP(t.supabaseClient,{sendOperationData:t.sendOperationData});var OP=10,DP="ZodErrors";function LP(t){return pn(t)&&t.name==="ZodError"&&Array.isArray(t.issues)}function UP(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 BP(t){return t.map(e=>typeof e=="number"?"<array>":e).join(".")}function PP(t){let e=new Set;for(let r of t.issues){let o=BP(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 zP(t,e=!1,n,r){if(!n.exception?.values||!r.originalException||!LP(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(e?r.originalException.issues:r.originalException.issues.slice(0,t)).map(UP);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:PP(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 FP=((t={})=>{let e=t.limit??OP;return{name:DP,processEvent(n,r){return zP(e,t.saveZodIssuesAsAttachment,n,r)}}}),kv=FP;var Rv=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&&(fh(i),r[1]=i)}})}),e.on("applyFrameMetadata",n=>{if(n.type)return;let r=e.getOptions().stackParser;dh(r,n)})},preprocessEvent(e){t.ignoreSentryInternalFrames&&(tt._sentryWrappedDepth??0)>0&&(e.sdkProcessingMetadata={...e.sdkProcessingMetadata,insideSentryWrapped:!0})},processEvent(e){let n=t.ignoreSentryInternalFrames?e.sdkProcessingMetadata?.insideSentryWrapped===!0&&e.exception?.values?.length===1:!1,r=GP(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 HP(t,e,n){if(e!==0)return!1;if(n&&$P(t)||t.function==="sentryWrapped")return!0;if(!t.context_line||!t.filename||!t.filename.includes("sentry")||!t.filename.includes("helpers")||!t.context_line.includes(qP))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(jP))return!0}return!1}function GP(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||!HP(o,i,!!n)).map(o=>o.module_metadata?Object.keys(o.module_metadata).filter(i=>i.startsWith(JI)).map(i=>i.slice(JI.length)):[])}function $P(t){return!t.context_line&&!t.pre_context&&!!t.function&&t.function.length<=2}var JI="_sentryBundlerPluginAppKey:",jP="Attempt to invoke user-land function",qP="fn.apply(this, wrappedArguments)";var QI=100,ZI=10,hh="flag.evaluation.";function Nr(t){if(t.type)return t;let n=rt().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(t.contexts===void 0&&(t.contexts={}),t.contexts.flags={values:[...r]}),t}function fr(t,e,n=QI){let r=rt().getScopeData().contexts;r.flags||(r.flags={values:[]});let o=r.flags.values;VP(o,t,e,n)}function VP(t,e,n,r){if(typeof n!="boolean")return;if(t.length>r){H&&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=ZI){if(typeof e!="boolean")return;let r=Ot();if(!r)return;let o=et(r).data;if(`${hh}${t}`in o){r.setAttribute(`${hh}${t}`,e);return}Object.keys(o).filter(a=>a.startsWith(hh)).length<n&&r.setAttribute(`${hh}${t}`,e)}var Nv=()=>({name:"FeatureFlags",processEvent(t,e,n){return Nr(t)},addFeatureFlag(t,e){fr(t,e),pr(t,e)}});var Cv=({growthbookClass:t})=>({name:"GrowthBook",setupOnce(){let e=t.prototype;typeof e.isOn=="function"&&ye(e,"isOn",tk),typeof e.getFeatureValue=="function"&&ye(e,"getFeatureValue",tk)},processEvent(e,n,r){return Nr(e)}});function tk(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 YP="ConversationId",WP=(()=>({name:YP,setup(t){t.on("spanStart",e=>{let n=rt().getScopeData(),r=Pt().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:a,description:s}=et(e);if(!i?.startsWith("gen_ai.")&&!a["ai.operationId"]&&!s?.startsWith("ai."))return;e.setAttribute(Eg,o)}})}})),Mv=WP;function Ov(t,e,n,r,o){if(!t.fetchData)return;let{method:i,url:a}=t.fetchData,s=De()&&e(a);if(t.endTimestamp){let m=t.fetchData.__span;if(!m)return;let _=r[m];_&&(s&&(XP(_,t),KP(_,t,o)),delete r[m]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},d=P(),p=!!Ot()||!!d&&je(d),f=s&&p?Ae(ZP(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=nk(m,_,De()&&p?f:void 0,c);v&&(t.args[1]=_,_.headers=v)}if(d){let m={input:t.args,response:t.response,startTimestamp:t.startTimestamp,endTimestamp:t.endTimestamp};d.emit("beforeOutgoingRequestSpan",f,m)}return f}function KP(t,e,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(t,{headers:e.response?.headers,error:e.error})}function nk(t,e,n,r){let o=el({span:n,propagateTraceparent:r}),i=o["sentry-trace"],a=o.baggage,s=o.traceparent;if(!i)return;let l=e.headers||(Qd(t)?t.headers:void 0);if(l)if(JP(l)){let c=new Headers(l);if(c.get("sentry-trace")||c.set("sentry-trace",i),r&&s&&!c.get("traceparent")&&c.set("traceparent",s),a){let d=c.get("baggage");d?yh(d)||c.set("baggage",`${d},${a}`):c.set("baggage",a)}return c}else if(QP(l)){let c=[...l];c.find(u=>u[0]==="sentry-trace")||c.push(["sentry-trace",i]),r&&s&&!c.find(u=>u[0]==="traceparent")&&c.push(["traceparent",s]);let d=l.find(u=>u[0]==="baggage"&&typeof u[1]=="string"&&yh(u[1]));return a&&!d&&c.push(["baggage",a]),c}else{let c="sentry-trace"in l?l["sentry-trace"]:void 0,d="traceparent"in l?l.traceparent:void 0,u="baggage"in l?l.baggage:void 0,p=u?Array.isArray(u)?[...u]:[u]:[],f=u&&(Array.isArray(u)?u.find(_=>yh(_)):yh(u));a&&!f&&p.push(a);let m=Object.assign({},l,{"sentry-trace":c??i,baggage:p.length>0?p.join(","):void 0});return r&&s&&!d&&(m.traceparent=s),m}else return{...o}}function XP(t,e){if(e.response){ri(t,e.response.status);let n=e.response?.headers?.get("content-length");if(n){let r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:2,message:"internal_error"});t.end()}function yh(t){return typeof t!="string"?!1:t.split(",").some(e=>e.trim().startsWith(of))}function JP(t){return typeof Headers<"u"&&Oo(t,Headers)}function QP(t){return Array.isArray(t)?t.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string"):!1}function ZP(t,e,n){if(t.startsWith("data:")){let i=Yn(t);return{name:`${e} ${i}`,attributes:ek(t,void 0,e,n)}}let r=ui(t),o=r?Hc(r):t;return{name:`${e} ${o}`,attributes:ek(t,r,e,n)}}function ek(t,e,n,r){let o={url:Yn(t),type:"fetch","http.method":n,[at]:r,[ht]:"http.client"};return e&&(tl(e)||(o["http.url"]=Yn(e.href),o["server.address"]=e.host),e.search&&(o["http.query"]=e.search),e.hash&&(o["http.fragment"]=e.hash)),o}function jc(t,e={},n=rt()){let{message:r,name:o,email:i,url:a,source:s,associatedEventId:l,tags:c}=t,d={contexts:{feedback:{contact_email:i,name:o,message:r,url:a,source:s,associated_event_id:l}},type:"feedback",level:"info",tags:c},u=n?.getClient()||P();return u&&u.emit("beforeSendFeedback",d,e),n.captureEvent(d,e)}var bh={};y0(bh,{debug:()=>e8,error:()=>o8,fatal:()=>i8,fmt:()=>bv,info:()=>n8,trace:()=>t8,warn:()=>r8});function qc(t,e,n,r,o){Pa({level:t,message:e,attributes:n,severityNumber:o},r)}function t8(t,e,{scope:n}={}){qc("trace",t,e,n)}function e8(t,e,{scope:n}={}){qc("debug",t,e,n)}function n8(t,e,{scope:n}={}){qc("info",t,e,n)}function r8(t,e,{scope:n}={}){qc("warn",t,e,n)}function o8(t,e,{scope:n}={}){qc("error",t,e,n)}function i8(t,e,{scope:n}={}){qc("fatal",t,e,n)}function Vc(t,e,n){return"util"in tt&&typeof tt.util.format=="function"?tt.util.format(...t):a8(t,e,n)}function a8(t,e,n){return t.map(r=>Ze(r)?String(r):JSON.stringify(ue(r,e,n))).join(" ")}function _h(t){return/%[sdifocO]/.test(t)}function vh(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 s8="ConsoleLogs",rk={[at]:"auto.log.console"},l8=((t={})=>{let e=t.levels||wa;return{name:s8,setup(n){let{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=n.getOptions();if(!r){H&&w.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let a=nl(({args:s,level:l})=>{if(P()!==n||!e.includes(l))return;let c=s[0],d=s.slice(1);if(l==="assert"){if(!c){let f=d.length>0?`Assertion failed: ${Vc(d,o,i)}`:"Assertion failed";Pa({level:"error",message:f,attributes:rk})}return}let u=l==="log",p={...rk};if(he(c)){Object.assign(p,ue(c,o,i));let f=typeof s[1]=="string"?2:1;s.slice(f).forEach((_,v)=>{p[`sentry.message.parameter.${v}`]=ue(_,o,i)})}else if(d.length>0&&typeof c=="string"&&!_h(c)){let m=vh(c,d);for(let[_,v]of Object.entries(m))p[_]=_.startsWith("sentry.message.parameter.")?ue(v,o,i):v}Pa({level:u?"info":l,message:Vc(s,o,i),severityNumber:u?10:void 0,attributes:p})});n.registerCleanup(a)}}}),Dv=l8;var Fa={};y0(Fa,{count:()=>c8,distribution:()=>d8,gauge:()=>u8});function Lv(t,e,n,r){av({type:t,name:e,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function c8(t,e=1,n){Lv("counter",t,e,n)}function u8(t,e,n){Lv("gauge",t,e,n)}function d8(t,e,n){Lv("distribution",t,e,n)}var f8=["trace","debug","info","warn","error","fatal"];function Uv(t={}){let e=new Set(t.levels??f8),n=t.client;return{log(r){let{type:o,level:i,message:a,args:s,tag:l,date:c,...d}=r,u=n||P();if(!u)return;let p=g8(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]=ue(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=y8(h8(s,f,m),f,m);v?.attributes&&Object.assign(_,v.attributes),Pa({level:p,message:v?.message||a||s&&Vc(s,f,m)||"",attributes:_})}}}var p8={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"},m8={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function g8(t,e){if(t==="verbose")return"debug";if(t==="silent")return"trace";if(t){let n=p8[t];if(n)return n}if(typeof e=="number"){let n=m8[e];if(n)return n}return"info"}function h8(t,e,n){if(!t?.length)return{message:""};let r=Vc(t,e,n),o=t[0];if(he(o)){let i=typeof t[1]=="string"?2:1,a=t.slice(i);return{message:r,attributes:o,messageParameters:a}}else{let i=t.slice(1),a=i.length>0&&typeof o=="string"&&!_h(o);return{message:r,messageTemplate:a?o:void 0,messageParameters:a?i:void 0}}}function y8(t,e,n){let{message:r,attributes:o,messageTemplate:i,messageParameters:a}=t,s={};if(i&&a){let l=vh(i,a);for(let[c,d]of Object.entries(l))s[c]=c.startsWith("sentry.message.parameter.")?ue(d,e,n):d}else a&&a.length>0&&a.forEach((l,c)=>{s[`sentry.message.parameter.${c}`]=ue(l,e,n)});return{message:r,attributes:{...ue(o,e,n),...s}}}var ok="gen_ai.prompt",di="gen_ai.system",Ie="gen_ai.request.model",Yc="gen_ai.request.stream",Ha="gen_ai.request.temperature",Wc="gen_ai.request.max_tokens",Ga="gen_ai.request.frequency_penalty",Kc="gen_ai.request.presence_penalty",$a="gen_ai.request.top_p",Sh="gen_ai.request.top_k",Eh="gen_ai.request.encoding_format",Th="gen_ai.request.dimensions",fi="gen_ai.response.finish_reasons",Zr="gen_ai.response.model",ja="gen_ai.response.id",ik="gen_ai.response.stop_reason",to="gen_ai.usage.input_tokens",eo="gen_ai.usage.output_tokens",Cr="gen_ai.usage.total_tokens",gn="gen_ai.operation.name",no="sentry.sdk_meta.gen_ai.input.messages.original_length",Ho="gen_ai.input.messages";var pi="gen_ai.system_instructions",Wn="gen_ai.response.text",mi="gen_ai.request.available_tools",ak="gen_ai.response.streaming",mr="gen_ai.response.tool_calls",rl="gen_ai.agent.name",sk="gen_ai.pipeline.name",Uf="gen_ai.conversation.id",lk="gen_ai.usage.cache_creation_input_tokens",ck="gen_ai.usage.cache_read_input_tokens";var uk="gen_ai.invoke_agent",Xc="gen_ai.embeddings.input",Bv="gen_ai.embeddings",Pv="gen_ai.execute_tool",wh="gen_ai.tool.name",dk="gen_ai.tool.call.id",fk="gen_ai.tool.type",xh="gen_ai.tool.input",Ah="gen_ai.tool.output",pk="gen_ai.tool.description";function qa(t){return!t||typeof t!="object"?!1:_8(t)||gk(t)||b8(t)||hk(t)||yk(t)||v8(t)||S8(t)||E8(t)||T8(t)||w8(t)||x8(t)||A8(t)}function b8(t){return"image_url"in t?typeof t.image_url=="string"?t.image_url.startsWith("data:"):mk(t):!1}function mk(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 _8(t){return"type"in t&&typeof t.type=="string"&&"source"in t&&qa(t.source)}function gk(t){return"inlineData"in t&&!!t.inlineData&&typeof t.inlineData=="object"&&"data"in t.inlineData&&typeof t.inlineData.data=="string"}function hk(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 yk(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 v8(t){return"media_type"in t&&typeof t.media_type=="string"&&"data"in t}function S8(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 E8(t){return"type"in t&&t.type==="image"&&"image"in t&&typeof t.image=="string"&&!t.image.startsWith("http://")&&!t.image.startsWith("https://")}function T8(t){return"type"in t&&(t.type==="blob"||t.type==="base64")}function w8(t){return"b64_json"in t}function x8(t){return"type"in t&&"result"in t&&t.type==="image_generation"}function A8(t){return"uri"in t&&typeof t.uri=="string"&&t.uri.startsWith("data:")}var Bf="[Blob substitute]",I8=["image_url","data","content","b64_json","result","uri","image"];function ol(t){let e={...t};qa(e.source)&&(e.source=ol(e.source)),gk(t)&&(e.inlineData={...t.inlineData,data:Bf}),mk(t)&&(e.image_url={...t.image_url,url:Bf}),hk(t)&&(e.input_audio={...t.input_audio,data:Bf}),yk(t)&&(e.file={...t.file,file_data:Bf});for(let n of I8)typeof e[n]=="string"&&(e[n]=Bf);return e}var _k=2e4,Ih=t=>new TextEncoder().encode(t).length,Fv=t=>Ih(JSON.stringify(t));function kh(t,e){if(Ih(t)<=e)return t;let n=0,r=t.length,o="";for(;n<=r;){let i=Math.floor((n+r)/2),a=t.slice(0,i);Ih(a)<=e?(o=a,n=i+1):r=i-1}return o}function k8(t){return typeof t=="string"?t:"text"in t&&typeof t.text=="string"?t.text:""}function bk(t,e){return typeof t=="string"?e:{...t,text:e}}function R8(t){return t!==null&&typeof t=="object"&&"content"in t&&typeof t.content=="string"}function vk(t){return t!==null&&typeof t=="object"&&"content"in t&&Array.isArray(t.content)}function Sk(t){return t!==null&&typeof t=="object"&&"parts"in t&&Array.isArray(t.parts)&&t.parts.length>0}function N8(t,e){let n={...t,content:""},r=Fv(n),o=e-r;if(o<=0)return[];let i=kh(t.content,o);return[{...t,content:i}]}function C8(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 M8(t,e){let{key:n,items:r}=C8(t);if(n===null||r.length===0)return[];let o=r.map(l=>bk(l,"")),i=Fv({...t,[n]:o}),a=e-i;if(a<=0)return[];let s=[];for(let l of r){let c=k8(l),d=Ih(c);if(d<=a)s.push(l),a-=d;else if(s.length===0){let u=kh(c,a);u&&s.push(bk(l,u));break}else break}return s.length<=0?[]:[{...t,[n]:s}]}function O8(t,e){if(!t)return[];if(typeof t=="string"){let n=kh(t,e);return n?[n]:[]}return typeof t!="object"?[]:R8(t)?N8(t,e):vk(t)||Sk(t)?M8(t,e):[]}function zv(t){return t.map(n=>{let r;return n&&typeof n=="object"&&(vk(n)?r={...n,content:zv(n.content)}:"content"in n&&qa(n.content)&&(r={...n,content:ol(n.content)}),Sk(n)&&(r={...r??n,parts:zv(n.parts)}),qa(r)?r=ol(r):qa(n)&&(r=ol(n))),r??n})}function D8(t,e){if(!Array.isArray(t)||t.length===0)return t;let n=e-2,r=t[t.length-1],o=zv([r]),i=o[0];return Fv(i)<=n?o:O8(i,n)}function Ek(t){return D8(t,_k)}function Tk(t){return kh(t,_k)}function Mr(t){let e=P()?.getDataCollectionOptions().genAI;return{...t,recordInputs:t?.recordInputs??e?.inputs??!1,recordOutputs:t?.recordOutputs??e?.outputs??!1}}function gr(t){if(t!==void 0)return t;let e=P();return e?!je(e)&&e.getOptions().streamGenAiSpans===!1:!0}function Jc(t,e){return t?`${t}.${e}`:e}function wk(t,e,n,r,o){if(e!==void 0&&t.setAttributes({[to]:e}),n!==void 0&&t.setAttributes({[eo]: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({[Cr]:i})}}function il(t,e,n){if(!t.isRecording())return;let r={[ak]:!0};e.responseId&&(r[ja]=e.responseId),e.responseModel&&(r[Zr]=e.responseModel),e.promptTokens!==void 0&&(r[to]=e.promptTokens),e.completionTokens!==void 0&&(r[eo]=e.completionTokens),e.totalTokens!==void 0?r[Cr]=e.totalTokens:(e.promptTokens!==void 0||e.completionTokens!==void 0||e.cacheCreationInputTokens!==void 0||e.cacheReadInputTokens!==void 0)&&(r[Cr]=(e.promptTokens??0)+(e.completionTokens??0)+(e.cacheCreationInputTokens??0)+(e.cacheReadInputTokens??0)),e.finishReasons.length&&(r[fi]=JSON.stringify(e.finishReasons)),n&&e.responseTexts.length&&(r[Wn]=e.responseTexts.join("")),n&&e.toolCalls.length&&(r[mr]=JSON.stringify(e.toolCalls)),t.setAttributes(r),t.end()}function Go(t){return typeof t=="string"?t:JSON.stringify(t)}function $o(t){if(typeof t=="string")return Tk(t);if(Array.isArray(t)){let e=Ek(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 L8(t,e,n){let r=t.catch(a=>{throw Et(a,{mechanism:{handled:!1,type:n}}),a}),o=await e,i=await r;return i&&typeof i=="object"&&"data"in i?{...i,data:o}:o}function Qc(t,e,n){return Nn(t)?new Proxy(t,{get(r,o){let a=o in Promise.prototype||o===Symbol.toStringTag?e:r,s=Reflect.get(a,o);return o==="withResponse"&&typeof s=="function"?function(){let c=s.call(r);return L8(c,e,n)}:typeof s=="function"?s.bind(a):s}}):e}var xk={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},U8=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],Ak=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...U8];function Ik(t){return t!==null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.startsWith("response.")}function kk(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion.chunk"}function Rk(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[Zr]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[Uf]=r.id),r.usage&&typeof r.usage=="object"){let i=r.usage,a=i.prompt_tokens??i.input_tokens;typeof a=="number"&&(o[to]=a);let s=i.completion_tokens??i.output_tokens;typeof s=="number"&&(o[eo]=s),typeof i.total_tokens=="number"&&(o[Cr]=i.total_tokens)}if(Array.isArray(r.choices)){let i=r.choices,a=i.map(s=>s.finish_reason).filter(s=>typeof s=="string");if(a.length>0&&(o[fi]=JSON.stringify(a)),n){let s=i.map(c=>c.message?.content||"");o[Wn]=JSON.stringify(s);let l=i.map(c=>c.message?.tool_calls).filter(c=>Array.isArray(c)&&c.length>0).flat();l.length>0&&(o[mr]=JSON.stringify(l))}}if(typeof r.status=="string"&&(o[fi]||(o[fi]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!o[Wn]&&(o[Wn]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!o[mr])){let i=r.output.filter(a=>a?.type==="function_call");i.length>0&&(o[mr]=JSON.stringify(i))}t.setAttributes(o)}function B8(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 Nk(t){let e={[Ie]:t.model??"unknown"};"temperature"in t&&(e[Ha]=t.temperature),"top_p"in t&&(e[$a]=t.top_p),"frequency_penalty"in t&&(e[Ga]=t.frequency_penalty),"presence_penalty"in t&&(e[Kc]=t.presence_penalty),"stream"in t&&(e[Yc]=t.stream),"encoding_format"in t&&(e[Eh]=t.encoding_format),"dimensions"in t&&(e[Th]=t.dimensions);let n=B8(t);return n&&(e[Uf]=n),e}function P8(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 z8(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&&P8(r.delta.tool_calls,e)),r.finish_reason&&e.finishReasons.push(r.finish_reason)}function F8(t,e,n,r){if(!(t&&typeof t=="object")){e.eventTypes.push("unknown:non-object");return}if(t instanceof Error){r.setStatus({code:2,message:"internal_error"}),Et(t,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in t))return;let o=t;if(!Ak.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*Ck(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)kk(o)?z8(o,r,n):Ik(o)&&F8(o,r,n,e),yield o}finally{let o=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];il(e,{...r,toolCalls:o},n)}}function H8(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){H&&w.error("Failed to serialize OpenAI tools:",i);return}}function G8(t,e){let n={[di]:"openai",[gn]:e,[at]:"auto.ai.openai"};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let r=t[0],o=H8(r);o&&(n[mi]=o),Object.assign(n,Nk(r))}else n[Ie]="unknown";return n}function Mk(t,e,n,r){if(n==="embeddings"&&"input"in e){let s=e.input;if(s==null||typeof s=="string"&&s.length===0||Array.isArray(s)&&s.length===0)return;t.setAttribute(Xc,typeof s=="string"?s:JSON.stringify(s));return}let o="input"in e?e.input:"messages"in e?e.messages:void 0;if(!o||Array.isArray(o)&&o.length===0)return;let{systemInstructions:i,filteredMessages:a}=gi(o);i&&t.setAttribute(pi,i),t.setAttribute(Ho,r?$o(a):Go(a)),Array.isArray(a)?t.setAttribute(no,a.length):t.setAttribute(no,1)}function $8(t,e,n,r,o){return function(...a){let s=n.operation||"unknown",l=G8(a,s),c=l[Ie]||"unknown",d=a[0],u=d&&typeof d=="object"&&d.stream===!0,p={name:`${s} ${c}`,op:`gen_ai.${s}`,attributes:l};if(u){let _,v=qn(p,h=>(_=t.apply(r,a),o.recordInputs&&d&&Mk(h,d,s,gr(o.enableTruncation)),(async()=>{try{let b=await _;return Ck(b,h,o.recordOutputs??!1)}catch(b){throw h.setStatus({code:2,message:"internal_error"}),Et(b,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:e}}}),h.end(),b}})()));return Qc(_,v,"auto.ai.openai")}let f,m=nn(p,_=>(f=t.apply(r,a),o.recordInputs&&d&&Mk(_,d,s,gr(o.enableTruncation)),f.then(v=>(Rk(_,v,o.recordOutputs),v),v=>{throw Et(v,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:e}}}),v})));return Qc(f,m,"auto.ai.openai")}}function Ok(t,e="",n){return new Proxy(t,{get(r,o){let i=r[o],a=Jc(e,String(o)),s=xk[a];return typeof i=="function"&&s?$8(i,a,s,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?Ok(i,a,n):i}})}function Hv(t,e){return Ok(t,"",Mr(e))}var Dk={"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 Lk(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),[no]:i})}var j8={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 Gv(t){return t&&j8[t]||"internal_error"}function Uk(t,e){e.error&&(t.setStatus({code:2,message:Gv(e.error.type)}),Et(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function Bk(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 q8(t,e){return"type"in t&&typeof t.type=="string"&&t.type==="error"?(e.setStatus({code:2,message:Gv(t.error?.type)}),Et(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function V8(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 Y8(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 W8(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 K8(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 Pk(t,e,n,r){!(t&&typeof t=="object")||q8(t,r)||(V8(t,e),Y8(t,e),W8(t,e,n),K8(t,e))}async function*zk(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)Pk(o,r,n,e),yield o}finally{il(e,r,n)}}function Fk(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=>{Pk(o,r,n,e)}),t.on("message",()=>{il(e,r,n)}),t.on("error",o=>{Et(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end())}),t}function X8(t,e,n){let r={[di]:"anthropic",[gn]: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[Ie]=o.model??"unknown","temperature"in o&&(r[Ha]=o.temperature),"top_p"in o&&(r[$a]=o.top_p),"stream"in o&&(r[Yc]=o.stream),"top_k"in o&&(r[Sh]=o.top_k),"frequency_penalty"in o&&(r[Ga]=o.frequency_penalty),"max_tokens"in o&&(r[Wc]=o.max_tokens)}else e==="models.retrieve"||e==="models.get"?r[Ie]=t[0]:r[Ie]="unknown";return r}function $v(t,e,n){let r=Bk(e);Lk(t,r,n),"prompt"in e&&t.setAttributes({[ok]:JSON.stringify(e.prompt)})}function J8(t,e){if("content"in e&&Array.isArray(e.content)){t.setAttributes({[Wn]:e.content.map(r=>r.text).filter(r=>!!r).join("")});let n=[];for(let r of e.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&t.setAttributes({[mr]:JSON.stringify(n)})}"completion"in e&&t.setAttributes({[Wn]:e.completion}),"input_tokens"in e&&t.setAttributes({[Wn]:JSON.stringify(e.input_tokens)})}function Q8(t,e){"id"in e&&"model"in e&&(t.setAttributes({[ja]:e.id,[Zr]:e.model}),"usage"in e&&e.usage&&wk(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.cache_creation_input_tokens,e.usage.cache_read_input_tokens))}function Z8(t,e,n){if(!(!e||typeof e!="object")){if("type"in e&&e.type==="error"){Uk(t,e);return}n&&J8(t,e),Q8(t,e)}}function Hk(t,e,n){throw Et(t,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),e.isRecording()&&(e.setStatus({code:2,message:"internal_error"}),e.end()),t}function tz(t,e,n,r,o,i,a,s,l,c,d){let u=o[Ie]??"unknown",p={name:`${i} ${u}`,op:`gen_ai.${i}`,attributes:o};if(c&&!d){let f,m=qn(p,_=>(f=t.apply(n,r),l.recordInputs&&s&&$v(_,s,gr(l.enableTruncation)),(async()=>{try{let v=await f;return zk(v,_,l.recordOutputs??!1)}catch(v){return Hk(v,_,a)}})()));return Qc(f,m,"auto.ai.anthropic")}else return qn(p,f=>{try{l.recordInputs&&s&&$v(f,s,gr(l.enableTruncation));let m=e.apply(n,r);return Fk(m,f,l.recordOutputs??!1)}catch(m){return Hk(m,f,a)}})}function ez(t,e,n,r,o){return new Proxy(t,{apply(i,a,s){let l=n.operation||"unknown",c=X8(s,e,l),d=c[Ie]??"unknown",u=typeof s[0]=="object"?s[0]:void 0,p=!!u?.stream,f=n.streaming===!0;if(p||f)return tz(t,i,r,s,c,l,e,u,o,p,f);let m,_=nn({name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:c},v=>(m=i.apply(r,s),o.recordInputs&&u&&$v(v,u,gr(o.enableTruncation)),m.then(h=>(Z8(v,h,o.recordOutputs),h),h=>{throw Et(h,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:e}}}),h})));return Qc(m,_,"auto.ai.anthropic")}})}function Gk(t,e="",n){return new Proxy(t,{get(r,o){let i=r[o],a=Jc(e,String(o)),s=Dk[a];return typeof i=="function"&&s?ez(i,a,s,r,n):typeof i=="function"?i.bind(r):i&&typeof i=="object"?Gk(i,a,n):i}})}function jv(t,e){return Gk(t,"",Mr(e))}var $k={"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}},jk="google_genai";function nz(t,e){let n=t?.promptFeedback;if(n?.blockReason){let r=n.blockReasonMessage??n.blockReason;return e.setStatus({code:2,message:"internal_error"}),Et(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function rz(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 oz(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 iz(t,e,n,r){!t||nz(t,r)||(rz(t,e),oz(t,e,n))}async function*qk(t,e,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let o of t)iz(o,r,n,e),yield o}finally{il(e,r,n)}}function Zc(t,e="user"){return typeof t=="string"?[{role:e,content:t}]:Array.isArray(t)?t.flatMap(n=>Zc(n,e)):typeof t!="object"||!t?[]:"role"in t&&typeof t.role=="string"?[t]:"parts"in t?[{...t,role:e}]:[{role:e,content:t}]}function Vk(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 az(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[Sh]=t.topK),"maxOutputTokens"in t&&typeof t.maxOutputTokens=="number"&&(e[Wc]=t.maxOutputTokens),"frequencyPenalty"in t&&typeof t.frequencyPenalty=="number"&&(e[Ga]=t.frequencyPenalty),"presencePenalty"in t&&typeof t.presencePenalty=="number"&&(e[Kc]=t.presencePenalty),e}function sz(t,e,n){let r={[di]:jk,[gn]:t,[at]:"auto.ai.google_genai"};if(e){if(r[Ie]=Vk(e,n),"config"in e&&typeof e.config=="object"&&e.config){let o=e.config;if(Object.assign(r,az(o)),"tools"in o&&Array.isArray(o.tools)){let i=o.tools.flatMap(a=>a.functionDeclarations);r[mi]=JSON.stringify(i)}}}else r[Ie]=Vk({},n);return r}function Yk(t,e,n,r){if(n){let i=e.contents;i!=null&&t.setAttribute(Xc,typeof i=="string"?i:JSON.stringify(i));return}let o=[];if("config"in e&&e.config&&typeof e.config=="object"&&"systemInstruction"in e.config&&e.config.systemInstruction&&o.push(...Zc(e.config.systemInstruction,"system")),"history"in e&&o.push(...Zc(e.history,"user")),"contents"in e&&o.push(...Zc(e.contents,"user")),"message"in e&&o.push(...Zc(e.message,"user")),Array.isArray(o)&&o.length){let{systemInstructions:i,filteredMessages:a}=gi(o);i&&t.setAttribute(pi,i);let s=Array.isArray(a)?a.length:0;t.setAttributes({[no]:s,[Ho]:r?$o(a):Go(a)})}}function lz(t,e,n){if(!(!e||typeof e!="object")){if(e.modelVersion&&t.setAttribute(Zr,e.modelVersion),e.usageMetadata&&typeof e.usageMetadata=="object"){let r=e.usageMetadata;typeof r.promptTokenCount=="number"&&t.setAttributes({[to]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&t.setAttributes({[eo]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&t.setAttributes({[Cr]:r.totalTokenCount})}if(n&&Array.isArray(e.candidates)&&e.candidates.length>0){let r=e.candidates.map(o=>o.content?.parts&&Array.isArray(o.content.parts)?o.content.parts.map(i=>typeof i.text=="string"?i.text:"").filter(i=>i.length>0).join(""):"").filter(o=>o.length>0);r.length>0&&t.setAttributes({[Wn]:r.join("")})}if(n&&e.functionCalls){let r=e.functionCalls;Array.isArray(r)&&r.length>0&&t.setAttributes({[mr]:JSON.stringify(r)})}}}function cz(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=sz(c,d,r),p=u[Ie]??"unknown";return n.streaming?qn({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:u},async f=>{try{o.recordInputs&&d&&Yk(f,d,i,gr(o.enableTruncation));let m=await a.apply(r,l);return qk(m,f,!!o.recordOutputs)}catch(m){throw f.setStatus({code:2,message:"internal_error"}),Et(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}}),f.end(),m}}):nn({name:`${c} ${p}`,op:`gen_ai.${c}`,attributes:u},f=>(o.recordInputs&&d&&Yk(f,d,i,gr(o.enableTruncation)),bf(()=>a.apply(r,l),m=>{Et(m,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:e}}})},()=>{},m=>{i||lz(f,m,o.recordOutputs)})))}})}function qv(t,e="",n){return new Proxy(t,{get:(r,o,i)=>{let a=Reflect.get(r,o,i),s=Jc(e,String(o)),l=$k[s];if(typeof a=="function"&&l){let c=l.operation?cz(a,s,l,r,n):a.bind(r);return l.proxyResultPath?function(...d){let u=c(...d);return u&&typeof u=="object"?qv(u,l.proxyResultPath,n):u}:c}return typeof a=="function"?a.bind(r):a&&typeof a=="object"?qv(a,s,n):a}})}function Vv(t,e){return qv(t,"",Mr(e))}var Gi="auto.ai.langchain",Wk={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var ro=(t,e,n)=>{n!=null&&(t[e]=n)},Or=(t,e,n)=>{let r=Number(n);Number.isNaN(r)||(t[e]=r)};function al(t){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function tu(t){if(Array.isArray(t))try{let e=t.map(n=>n&&typeof n=="object"&&qa(n)?ol(n):n);return JSON.stringify(e)}catch{return String(t)}return al(t)}function Pf(t){let e=t.toLowerCase();return Wk[e]??e}function Kk(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 Yv(t){if(!(!t||Array.isArray(t)))return t.invocation_params}function zf(t){return t.map(e=>{let n=e._getType;if(typeof n=="function"){let o=n.call(e);return{role:Pf(o),content:tu(e.content)}}if(e.lc===1&&e.kwargs){let o=e.id,i=Array.isArray(o)&&o.length>0?o[o.length-1]:"",a=typeof i=="string"?Kk(i):"user";return{role:Pf(a),content:tu(e.kwargs?.content)}}if(e.type){let o=String(e.type).toLowerCase();return{role:Pf(o),content:tu(e.content)}}if(e.role)return{role:Pf(String(e.role)),content:tu(e.content)};let r=e.constructor?.name;return r&&r!=="Object"?{role:Pf(Kk(r)),content:tu(e.content)}:{role:"user",content:tu(e.content)}})}function uz(t,e,n){let r={},o="kwargs"in t?t.kwargs:void 0,i=e?.temperature??n?.ls_temperature??o?.temperature;Or(r,Ha,i);let a=e?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Or(r,Wc,a);let s=e?.top_p??o?.top_p;Or(r,$a,s);let l=e?.frequency_penalty;Or(r,Ga,l);let c=e?.presence_penalty;return Or(r,Kc,c),e&&"stream"in e&&ro(r,Yc,!!e.stream),r}function Jk(t,e,n,r,o){return{[di]:al(t??"langchain"),[gn]:"chat",[Ie]:al(e),[at]:Gi,...uz(n,r,o)}}function Qk(t,e,n,r,o,i){let a=i?.ls_provider,s=o?.model??i?.ls_model_name??"unknown",l=Jk(a,s,t,o,i);if(n&&Array.isArray(e)&&e.length>0){ro(l,no,e.length);let c=e.map(d=>({role:"user",content:d}));ro(l,Ho,r?$o(c):Go(c))}return l}function Zk(t,e,n,r,o,i){let a=i?.ls_provider??t.id?.[2],s=o?.model??i?.ls_model_name??"unknown",l=Jk(a,s,t,o,i);if(n&&Array.isArray(e)&&e.length>0){let c=zf(e.flat()),{systemInstructions:d,filteredMessages:u}=gi(c);d&&ro(l,pi,d);let p=Array.isArray(u)?u.length:0;ro(l,no,p),ro(l,Ho,r?$o(u):Go(u))}return l}function dz(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&&ro(e,mr,al(n))}function fz(t,e){if(!t)return;let n=t.tokenUsage,r=t.usage;if(n)Or(e,to,n.promptTokens),Or(e,eo,n.completionTokens),Or(e,Cr,n.totalTokens);else if(r){Or(e,to,r.input_tokens),Or(e,eo,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&&Or(e,Cr,a),r.cache_creation_input_tokens!==void 0&&Or(e,lk,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Or(e,ck,r.cache_read_input_tokens)}}function tR(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&&ro(n,fi,al(c)),dz(t.generations,n),e){let d=t.generations.flat().map(u=>u.text??u.message?.content).filter(u=>typeof u=="string");d.length>0&&ro(n,Wn,al(d))}}fz(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&&ro(n,Zr,a);let s=r?.id??i?.id;s&&ro(n,ja,s);let l=r?.stop_reason??i?.response_metadata?.finish_reason;return l&&ro(n,ik,al(l)),n}function Rh(t){let e={},n=t?.lc_agent_name;return typeof n=="string"&&(e[rl]=n),e}function eR(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 pz(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.addHandler=="function"&&typeof e.copy=="function"}function mz(t){return typeof t=="object"&&t?.name==="SentryCallbackHandler"}function Xk(t){return t.some(mz)}function nR(t,e){if(!t)return[e];if(pz(t)){if(Xk(t.handlers??[]))return t;let r=t.copy();return r.addHandler(e,!0),r}let n=Array.isArray(t)?t:[t];return Xk(n)?t:[...n,e]}function eu(t={}){let{recordInputs:e,recordOutputs:n}=Mr(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 _=Yv(p),v=Qk(s,l,e,r,_,f),h=v[Ie],b=v[gn];qn({name:`${b} ${h}`,op:"gen_ai.chat",attributes:{...Rh(f),...v,[ht]:"gen_ai.chat"}},S=>(o.set(c,S),S))},handleChatModelStart(s,l,c,d,u,p,f,m){let _=Yv(p),v=Zk(s,l,e,r,_,f),h=eR(u);h&&(v[mi]=h);let b=v[Ie],S=v[gn];qn({name:`${S} ${b}`,op:"gen_ai.chat",attributes:{...Rh(f),...v,[ht]:"gen_ai.chat"}},E=>(o.set(c,E),E))},handleLLMEnd(s,l,c,d,u){let p=o.get(l);if(p?.isRecording()){let f=tR(s,n);f&&p.setAttributes(f),i(l)}},handleLLMError(s,l){let c=o.get(l);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),i(l)),Et(s,{mechanism:{handled:!1,type:`${Gi}.llm_error_handler`}})},handleChainStart(s,l,c,d,u,p,f,m){if(p?.__sentry_langgraph__)return;let _=m||s.name||"unknown_chain",v={[at]:"auto.ai.langchain","langchain.chain.name":_};e&&(v["langchain.chain.inputs"]=JSON.stringify(l)),qn({name:`chain ${_}`,op:"gen_ai.invoke_agent",attributes:{...v,[ht]:"gen_ai.invoke_agent"}},h=>(o.set(c,h),h))},handleChainEnd(s,l){let c=o.get(l);c?.isRecording()&&(n&&c.setAttributes({"langchain.chain.outputs":JSON.stringify(s)}),i(l))},handleChainError(s,l){let c=o.get(l);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),i(l)),Et(s,{mechanism:{handled:!1,type:`${Gi}.chain_error_handler`}})},handleToolStart(s,l,c,d,u,p,f){if(p?.__sentry_langgraph__)return;let m=f||s.name||"unknown_tool",_={...Rh(p),[at]:Gi,[gn]:"execute_tool",[wh]:m};e&&(_[xh]=l),qn({name:`execute_tool ${m}`,op:"gen_ai.execute_tool",attributes:{..._,[ht]:"gen_ai.execute_tool"}},v=>(o.set(c,v),v))},handleToolEnd(s,l){let c=o.get(l);if(c?.isRecording()){if(n){let d=s,u=d&&typeof d=="object"&&"content"in d?d.content:s;c.setAttributes({[Ah]:typeof u=="string"?u:JSON.stringify(u)})}i(l)}},handleToolError(s,l){let c=o.get(l);c?.isRecording()&&(c.setStatus({code:2,message:"internal_error"}),i(l)),Et(s,{mechanism:{handled:!1,type:`${Gi}.tool_error_handler`}})},copy(){return a},toJSON(){return{lc:1,type:"not_implemented",id:a.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:a.lc_id}}};return a}var Ff="auto.ai.langgraph";function rR(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 oR(t){let e=t[0];return typeof e=="object"&&e&&"name"in e&&typeof e.name=="string"?e.name:null}function iR(t,e,n){let r="__sentry_tool_wrapped__";for(let o of t){if(!o||typeof o!="object")continue;let i=o,a=i.invoke;if(typeof a!="function"||Object.prototype.hasOwnProperty.call(i,r))continue;let s=typeof i.name=="string"?i.name:"unknown_tool",l=typeof i.description=="string"?i.description:void 0,c=new Proxy(a,{apply(d,u,p){let f={[at]:Ff,[ht]:Pv,[gn]:"execute_tool",[wh]:s,[fk]:"function"},_=p[1]?.metadata?.lc_agent_name??n;typeof _=="string"&&(f[rl]=_),l&&(f[pk]=l);let v=p[0];if(typeof v=="object"&&v&&("id"in v&&typeof v.id=="string"&&(f[dk]=v.id),e.recordInputs)){let h="args"in v&&typeof v.args=="object"?v.args:v;try{f[xh]=JSON.stringify(h)}catch{}}return nn({op:Pv,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(Ah,typeof E=="string"?E:JSON.stringify(E))}catch{}return b}catch(b){throw h.setStatus({code:2,message:"internal_error"}),Et(b,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),b}})}});i.invoke=c,Object.defineProperty(i,r,{value:!0,enumerable:!1})}return t}function gz(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 hz(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 yz(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(Zr,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&t.setAttribute(fi,[r.finish_reason])}}function aR(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 sR(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=gz(a);s&&t.setAttribute(mr,JSON.stringify(s));let l=zf(a);t.setAttribute(Wn,JSON.stringify(l));let c=0,d=0,u=0;for(let p of a){let f=hz(p);c+=f.inputTokens,d+=f.outputTokens,u+=f.totalTokens,yz(t,p)}c>0&&t.setAttribute(to,c),d>0&&t.setAttribute(eo,d),u>0&&t.setAttribute(Cr,u)}var Wv=!1,Nh="__sentry_patched__";function lR(t,e){if(Object.prototype.hasOwnProperty.call(t,Nh))return t;let n=eu(e),r=new Proxy(t,{apply(o,i,a){return Wv?Reflect.apply(o,i,a):nn({op:"gen_ai.create_agent",name:"create_agent",attributes:{[at]:Ff,[ht]:"gen_ai.create_agent",[gn]:"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=cR(d.bind(l),l,c,e,void 0,n)),l}catch(l){throw s.setStatus({code:2,message:"internal_error"}),Et(l,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),l}})}});return Object.defineProperty(r,Nh,{value:!0,enumerable:!1}),r}function cR(t,e,n,r,o,i){return new Proxy(t,{apply(a,s,l){let c=o?.modelName??o?.model;return nn({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[at]:Ff,[ht]:uk,[gn]:"invoke_agent"}},async d=>{try{let u=n?.name;u&&typeof u=="string"&&(d.setAttribute(sk,u),d.setAttribute(rl,u),d.updateName(`invoke_agent ${u}`)),c&&d.setAttribute(Ie,c);let m=(l.length>1?l[1]:void 0)?.configurable?.thread_id;if(m&&typeof m=="string"&&d.setAttribute(Uf,m),i){let E=l[1]??{};l[1]=E;let R=E.metadata??{};E.metadata={...R,__sentry_langgraph__:!0,...typeof u=="string"?{lc_agent_name:u}:{}},E.callbacks=nR(E.callbacks,i)}let _=aR(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=zf(b),{systemInstructions:R,filteredMessages:C}=gi(E);R&&d.setAttribute(pi,R);let I=gr(r.enableTruncation),D=Array.isArray(C)?C.length:0;d.setAttributes({[Ho]:I?$o(C):Go(C),[no]:D})}let S=await Reflect.apply(a,s,l);return h&&sR(d,b??null,S),S}catch(u){throw d.setStatus({code:2,message:"internal_error"}),Et(u,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),u}})}})}function Kv(t,e){if(Object.prototype.hasOwnProperty.call(t,Nh))return t;let n=Mr(e),r=eu(n),o=new Proxy(t,{apply(i,a,s){let l=rR(s),c=oR(s),d=s[0];d&&Array.isArray(d.tools)&&d.tools.length>0&&iR(d.tools,n,c??void 0),Wv=!0;let u;try{u=Reflect.apply(i,a,s)}finally{Wv=!1}let p=u.invoke;if(p&&typeof p=="function"){let f={};c&&(f.name=c),u.invoke=cR(p.bind(u),u,f,n,l,r)}return u}});return Object.defineProperty(o,Nh,{value:!0,enumerable:!1}),o}function Xv(t,e){return t.compile=lR(t.compile,Mr(e)),t}function uR(t,e,n){let r=n.getOptions(),o=n.getDsn(),i=r.tunnel,a=Fo(r._metadata),s={sent_at:new Date(Hn()).toISOString(),...bz(e)&&{trace:e},...a&&{sdk:a},...!!i&&o&&{dsn:en(o)}},l=n.getDataCollectionOptions().userInfo?"auto":"never",c=[{type:"span",item_count:t.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Vn()&&{ingest_settings:{infer_ip:l,infer_user_agent:l}},items:t}];return Le(s,[c])}function bz(t){return!!t.trace_id&&!!t.public_key}function dR(t){let e=156;if(e+=t.name.length*2,e+=D0(t.attributes),t.links&&t.links.length>0){let r=t.links[0]?.attributes,o=100+(r?D0(r):0);e+=o*t.links.length}return e}var fR=1e3,_z=5e6,Hf=class{constructor(e,n){this._traceBuckets=new Map,this._client=e;let{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:i}=n??{};this._maxSpanLimit=r&&r>0&&r<=fR?r:fR,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=i&&i>0?i:_z,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+=dR(e),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(H&&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){H&&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=uR(a,i,this._client);H&&w.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(s).then(null,l=>{H&&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 Ch(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var nu=tt;function Mh(){return"history"in nu&&!!nu.history}function vz(){if(!("fetch"in nu))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ru(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function ou(){if(typeof EdgeRuntime=="string")return!0;if(!vz())return!1;if(ru(nu.fetch))return!0;let t=!1,e=nu.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow?.fetch&&(t=ru(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){H&&w.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function Oh(){return"ReportingObserver"in nu}function hi(t,e){let n="fetch",r=zn(n,t);return Fn(n,()=>mR(void 0,e)),r}function Lh(t){let e="fetch-body-resolved",n=zn(e,t);return Fn(e,()=>mR(Ez)),n}function mR(t,e=!1){e&&!ou()||ye(tt,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:a}=Tz(r),s={args:r,fetchData:{method:i,url:a},startTimestamp:Ct()*1e3,virtualError:o,headers:wz(r)};return t||Qe("fetch",{...s}),n.apply(tt,r).then(async l=>(t?t(l):Qe("fetch",{...s,endTimestamp:Ct()*1e3,response:l}),l),l=>{Qe("fetch",{...s,endTimestamp:Ct()*1e3,error:l}),pn(l)&&l.stack===void 0&&(l.stack=o.stack,Gt(l,"framesToPop",1));let d=P()?.getOptions().enhanceFetchErrorMessages??"always";if(d!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{let f=new URL(s.fetchData.url).host;d==="always"?l.message=`${l.message} (${f})`:Gt(l,"__sentry_fetch_url_host__",f)}catch{}throw l})}})}async function Sz(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 Ez(t){let e;try{e=t.clone()}catch{return}Sz(e,()=>{Qe("fetch-body-resolved",{endTimestamp:Ct()*1e3,response:t})})}function Dh(t,e){return!!t&&typeof t=="object"&&!!t[e]}function pR(t){return typeof t=="string"?t:t?Dh(t,"url")?t.url:t.toString?t.toString():"":""}function Tz(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:pR(n),method:Dh(r,"method")?String(r.method).toUpperCase():Qd(n)&&Dh(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:pR(e),method:Dh(e,"method")?String(e.method).toUpperCase():"GET"}}function wz(t){let[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Qd(e))return new Headers(e.headers)}catch{}}var gR=tt;function Kn(){try{return gR.document.location.href}catch{return""}}function Va(t,e=5){if(!gR.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 xz(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 Az(t){let e=t??{},n={[at]:Gi,[ht]:Bv,[gn]:"embeddings",[Ie]:e.model??"unknown"};return n[di]=xz(e),"dimensions"in e&&(n[Th]=e.dimensions),"encodingFormat"in e&&(n[Eh]=e.encodingFormat),n}function hR(t,e={}){let{recordInputs:n}=Mr(e);return new Proxy(t,{apply(r,o,i){let a=Az(o),s=a[Ie]||"unknown";if(n){let l=i[0];l!=null&&(a[Xc]=typeof l=="string"?l:JSON.stringify(l))}return nn({name:`embeddings ${s}`,op:Bv,attributes:a},()=>Reflect.apply(r,o,i).then(void 0,l=>{throw Et(l,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),l}))}})}function Jv(t,e){let n=t;return typeof n.embedQuery=="function"&&(n.embedQuery=hR(n.embedQuery,e)),typeof n.embedDocuments=="function"&&(n.embedDocuments=hR(n.embedDocuments,e)),t}var jo=tt,be=jo.document,Gf=jo.navigator,LR="Report a Bug",Kz="Cancel",Xz="Send Bug Report",Jz="Confirm",Qz="Report a Bug",Zz="your.email@example.org",tF="Email",eF="What's the bug? What did you expect?",nF="Description",rF="Your Name",oF="Name",iF="Thank you for your report!",aF="(required)",sF="Add a screenshot",lF="Remove screenshot",cF="Highlight",uF="Hide",dF="Remove",UR="Unable to submit feedback with empty message",BR="No client setup, cannot send feedback.",PR="Unable to determine if Feedback was correctly sent.",zR="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",FR="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",fF="widget",pF="api",mF=5e3,gF={ERROR_EMPTY_MESSAGE:UR,ERROR_NO_CLIENT:BR,ERROR_TIMEOUT:PR,ERROR_FORBIDDEN:zR,ERROR_GENERIC:FR};function zh(t,e){return e?.[t]??gF[t]}function yR(t,e){return new Error(zh(t,e))}var sS=(t,e={includeReplay:!0})=>{let n=e.errorMessages;if(!t.message)throw yR("ERROR_EMPTY_MESSAGE",n);let r=P();if(!r)throw yR("ERROR_NO_CLIENT",n);t.tags&&Object.keys(t.tags).length&&rt().setTags(t.tags);let o=jc({source:pF,url:Kn(),...t},e);return new Promise((i,a)=>{let s=setTimeout(()=>{l(),a(zh("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(zh("ERROR_FORBIDDEN",n)):a(zh("ERROR_GENERIC",n))})})},Fh=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function hF(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(Gf.userAgent)||/Macintosh/i.test(Gf.userAgent)&&Gf.maxTouchPoints&&Gf.maxTouchPoints>1||!isSecureContext)}function Uh(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 yF(t){let e=be.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 Dr(t,e){return Object.entries(e).forEach(([n,r])=>{t.setAttributeNS(null,n,r)}),t}var iu=20,bF="http://www.w3.org/2000/svg";function _F(){let t=s=>jo.document.createElementNS(bF,s),e=Dr(t("svg"),{width:`${iu}`,height:`${iu}`,viewBox:`0 0 ${iu} ${iu}`,fill:"var(--actor-color, var(--foreground))"}),n=Dr(t("g"),{clipPath:"url(#clip0_57_80)"}),r=Dr(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=Dr(t("clipPath"),{id:"clip0_57_80"}),a=Dr(t("rect"),{width:`${iu}`,height:`${iu}`,fill:"white"});return i.appendChild(a),o.appendChild(i),e.appendChild(o).appendChild(i).appendChild(a),e}function vF({triggerLabel:t,triggerAriaLabel:e,shadow:n,styleNonce:r}){let o=be.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=e||t||LR,o.appendChild(_F()),t){let a=be.createElement("span");a.appendChild(be.createTextNode(t)),o.appendChild(a)}let i=yF(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 HR="rgba(88, 74, 192, 1)",SF={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:HR,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%)"},bR={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:HR,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 _R(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 vR({colorScheme:t,themeDark:e,themeLight:n,styleNonce:r}){let o=be.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
+ ${_R(t==="dark"?{...bR,...e}:{...SF,...n})}
104
+ }
105
+
106
+ ${t==="system"?`
107
+ @media (prefers-color-scheme: dark) {
108
+ :host {
109
+ color-scheme: only dark;
110
+
111
+ ${_R({...bR,...e})}
112
+ }
113
+ }`:""}
114
+ `,r&&o.setAttribute("nonce",r),o}var Vh=({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=sF,cancelButtonLabel:E=Kz,confirmButtonLabel:R=Jz,emailLabel:C=tF,emailPlaceholder:I=Zz,formTitle:D=Qz,isRequiredLabel:z=aF,messageLabel:U=nF,messagePlaceholder:O=eF,nameLabel:N=oF,namePlaceholder:B=rF,removeScreenshotButtonLabel:V=lF,submitButtonLabel:st=Xz,successMessageText:nt=iF,triggerLabel:lt=LR,triggerAriaLabel:X="",highlightToolText:ct=cF,hideToolText:F=uF,removeHighlightText:gt=dF,errorEmptyMessageText:Q=UR,errorNoClientText:dt=BR,errorTimeoutText:Xt=PR,errorForbiddenText:Ce=zR,errorGenericText:bn=FR,onFormOpen:Pn,onFormClose:Z,onSubmitSuccess:Vt,onSubmitError:Lt,onFormSubmitted:ft}={})=>{let te={id:o,autoInject:i,showBranding:a,isEmailRequired:s,isNameRequired:l,showEmail:c,showName:d,enableScreenshot:u,useSentryUser:p,tags:f,styleNonce:m,scriptNonce:_,colorScheme:v,themeDark:b,themeLight:h,triggerLabel:lt,triggerAriaLabel:X,cancelButtonLabel:E,submitButtonLabel:st,confirmButtonLabel:R,formTitle:D,emailLabel:C,emailPlaceholder:I,messageLabel:U,messagePlaceholder:O,nameLabel:N,namePlaceholder:B,successMessageText:nt,isRequiredLabel:z,addScreenshotButtonLabel:S,removeScreenshotButtonLabel:V,highlightToolText:ct,hideToolText:F,removeHighlightText:gt,errorEmptyMessageText:Q,errorNoClientText:dt,errorTimeoutText:Xt,errorForbiddenText:Ce,errorGenericText:bn,onFormClose:Z,onFormOpen:Pn,onSubmitError:Lt,onSubmitSuccess:Vt,onFormSubmitted:ft},mt=null,oe=null,Qt=[],cn=ut=>{if(!mt){let Ft=be.createElement("div");Ft.id=String(ut.id),be.body.appendChild(Ft),mt=Ft.attachShadow({mode:"open"}),oe=vR(ut),mt.appendChild(oe)}return mt},_n=async ut=>{let Ft=ut.enableScreenshot&&hF(),bt,It;try{bt=(e?e():await t("feedbackModalIntegration",_))(),Xs(bt)}catch{throw Fh&&w.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{let Ht=Ft?n?n():await t("feedbackScreenshotIntegration",_):void 0;Ht&&(It=Ht(),Xs(It))}catch{Fh&&w.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}let yt={ERROR_EMPTY_MESSAGE:ut.errorEmptyMessageText,ERROR_NO_CLIENT:ut.errorNoClientText,ERROR_TIMEOUT:ut.errorTimeoutText,ERROR_FORBIDDEN:ut.errorForbiddenText,ERROR_GENERIC:ut.errorGenericText},K=(Ht,dn)=>sS(Ht,{includeReplay:!0,...dn,errorMessages:yt}),vt=bt.createDialog({options:{...ut,onFormClose:()=>{vt?.close(),ut.onFormClose?.()},onFormSubmitted:()=>{vt?.close(),ut.onFormSubmitted?.()}},screenshotIntegration:It,sendFeedback:K,shadow:cn(ut)});return vt},He=(ut,Ft={})=>{let bt=Uh(te,Ft),It=typeof ut=="string"?be.querySelector(ut):typeof ut.addEventListener=="function"?ut:null;if(!It)throw Fh&&w.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let yt=null,K=async()=>{yt||(yt=await _n({...bt,onFormSubmitted:()=>{yt?.removeFromDom(),bt.onFormSubmitted?.()}})),yt.appendToDom(),yt.open()};It.addEventListener("click",K);let vt=()=>{Qt=Qt.filter(Ht=>Ht!==vt),yt?.removeFromDom(),yt=null,It.removeEventListener("click",K)};return Qt.push(vt),vt},un=(ut={})=>{let Ft=Uh(te,ut),bt=cn(Ft),It=vF({triggerLabel:Ft.triggerLabel,triggerAriaLabel:Ft.triggerAriaLabel,shadow:bt,styleNonce:m});return He(It.el,{...Ft,onFormOpen(){It.hide()},onFormClose(){It.show()},onFormSubmitted(){It.show()}}),It};return{name:"Feedback",setupOnce(){!Vn()||!te.autoInject||(be.readyState==="loading"?be.addEventListener("DOMContentLoaded",()=>un().appendToDom()):un().appendToDom())},attachTo:He,createWidget(ut={}){let Ft=un(Uh(te,ut));return Ft.appendToDom(),Ft},async createForm(ut={}){return _n(Uh(te,ut))},setTheme(ut){if(te.colorScheme=ut,mt){let Ft=vR(te);oe?mt.replaceChild(Ft,oe):mt.prepend(Ft),oe=Ft}},remove(){mt&&(mt.parentElement?.remove(),mt=null,oe=null),Qt.forEach(ut=>ut()),Qt=[]}}});function GR(){return P()?.getIntegrationByName("Feedback")}var Yh,ve,$R,sl,SR,jR,rS,$f={},lS=[],EF=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,cS=Array.isArray;function Wa(t,e){for(var n in e)t[n]=e[n];return t}function qR(t){var e=t.parentNode;e&&e.removeChild(t)}function qt(t,e,n){var r,o,i,a={};for(i in e)i=="key"?r=e[i]:i=="ref"?o=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?Yh.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 Hh(t,a,r,o,null)}function Hh(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??++$R,__i:-1,__u:0};return o==null&&ve.vnode!=null&&ve.vnode(i),i}function jf(t){return t.children}function Gh(t,e){this.props=t,this.context=e}function su(t,e){if(e==null)return t.__?su(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?su(t):null}function TF(t,e,n){var r,o=t.__v,i=o.__e,a=t.__P;if(a)return(r=Wa({},o)).__v=o.__v+1,ve.vnode&&ve.vnode(r),uS(a,r,o,t.__n,a.ownerSVGElement!==void 0,32&o.__u?[i]:null,e,i??su(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&VR(r),r}function VR(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 VR(t)}}function ER(t){(!t.__d&&(t.__d=!0)&&sl.push(t)&&!qh.__r++||SR!==ve.debounceRendering)&&((SR=ve.debounceRendering)||jR)(qh)}function qh(){var t,e,n,r=[],o=[];for(sl.sort(rS);t=sl.shift();)t.__d&&(n=sl.length,e=TF(t,r,o)||e,n===0||sl.length>n?(oS(r,e,o),o.length=r.length=0,e=void 0,sl.sort(rS)):e&&ve.__c&&ve.__c(e,lS));e&&oS(r,e,o),qh.__r=0}function YR(t,e,n,r,o,i,a,s,l,c,d){var u,p,f,m,_,v=r&&r.__k||lS,h=e.length;for(n.__d=l,wF(n,e,v),l=n.__d,u=0;u<h;u++)(f=n.__k[u])!=null&&typeof f!="boolean"&&typeof f!="function"&&(p=f.__i===-1?$f:v[f.__i]||$f,f.__i=u,uS(t,f,p,o,i,a,s,l,c,d),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&dS(p.ref,null,f),d.push(f.ref,f.__c||m,f)),_==null&&m!=null&&(_=m),65536&f.__u||p.__k===f.__k?l=WR(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 wF(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?Hh(null,o,null,null,o):cS(o)?Hh(jf,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Hh(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=t,o.__b=t.__b+1,s=xF(o,n,a=r+u,d),o.__i=s,i=null,s!==-1&&(d--,(i=n[s])&&(i.__u|=131072)),i==null||i.__v===null?(s==-1&&u--,typeof o.type!="function"&&(o.__u|=65536)):s!==a&&(s===a+1?u++:s>a?d>l-a?u+=s-a:u--:u=s<a&&s==a-1?s-a:0,s!==r+u&&(o.__u|=65536))):(i=n[r])&&i.key==null&&i.__e&&(i.__e==t.__d&&(t.__d=su(i)),iS(i,i,!1),n[r]=null,d--);if(d)for(r=0;r<c;r++)(i=n[r])!=null&&(131072&i.__u)==0&&(i.__e==t.__d&&(t.__d=su(i)),iS(i,i))}function WR(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=WR(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 xF(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 TR(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||EF.test(e)?n:n+"px"}function Bh(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||TR(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||TR(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?xR:wR,i)):t.removeEventListener(e,i?xR:wR,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 wR(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(ve.event?ve.event(t):t)}}function xR(t){if(this.l)return this.l[t.type+!0](ve.event?ve.event(t):t)}function uS(t,e,n,r,o,i,a,s,l,c){var d,u,p,f,m,_,v,h,b,S,E,R,C,I,D,z=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(d=ve.__b)&&d(e);t:if(typeof z=="function")try{if(h=e.props,b=(d=z.contextType)&&r[d.__c],S=d?b?b.props.value:d.__:r,n.__c?v=(u=e.__c=n.__c).__=u.__E:("prototype"in z&&z.prototype.render?e.__c=u=new z(h,S):(e.__c=u=new Gh(h,S),u.constructor=z,u.render=IF),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),z.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Wa({},u.__s)),Wa(u.__s,z.getDerivedStateFromProps(h,u.__s))),f=u.props,m=u.state,u.__v=e,p)z.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(z.getDerivedStateFromProps==null&&h!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(h,S),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(h,u.__s,S)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(u.props=h,u.state=u.__s,u.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(U){U&&(U.__=e)}),E=0;E<u._sb.length;E++)u.__h.push(u._sb[E]);u._sb=[],u.__h.length&&a.push(u);break t}u.componentWillUpdate!=null&&u.componentWillUpdate(h,u.__s,S),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,m,_)})}if(u.context=S,u.props=h,u.__P=t,u.__e=!1,R=ve.__r,C=0,"prototype"in z&&z.prototype.render){for(u.state=u.__s,u.__d=!1,R&&R(e),d=u.render(u.props,u.state,u.context),I=0;I<u._sb.length;I++)u.__h.push(u._sb[I]);u._sb=[]}else do u.__d=!1,R&&R(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++C<25);u.state=u.__s,u.getChildContext!=null&&(r=Wa(Wa({},r),u.getChildContext())),p||u.getSnapshotBeforeUpdate==null||(_=u.getSnapshotBeforeUpdate(f,m)),YR(t,cS(D=d!=null&&d.type===jf&&d.key==null?d.props.children:d)?D:[D],e,n,r,o,i,a,s,l,c),u.base=e.__e,e.__u&=-161,u.__h.length&&a.push(u),v&&(u.__E=u.__=null)}catch(U){e.__v=null,l||i!=null?(e.__e=s,e.__u|=l?160:32,i[i.indexOf(s)]=null):(e.__e=n.__e,e.__k=n.__k),ve.__e(U,e,n)}else i==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=AF(n.__e,e,n,r,o,i,a,l,c);(d=ve.diffed)&&d(e)}function oS(t,e,n){for(var r=0;r<n.length;r++)dS(n[r],n[++r],n[++r]);ve.__c&&ve.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(i){i.call(o)})}catch(i){ve.__e(i,o.__v)}})}function AF(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&&Yh.call(t.childNodes),v=n.props||$f,!s&&i!=null)for(v={},c=0;c<t.attributes.length;c++)v[(f=t.attributes[c]).name]=f.value;for(c in v)f=v[c],c=="children"||(c=="dangerouslySetInnerHTML"?u=f:c==="key"||c in h||Bh(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||Bh(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=""),YR(t,cS(p)?p:[p],e,n,r,o&&b!=="foreignObject",i,a,i?i[0]:n.__k&&su(n,0),s,l),i!=null)for(c=i.length;c--;)i[c]!=null&&qR(i[c]);s||(c="value",m!==void 0&&(m!==t[c]||b==="progress"&&!m||b==="option"&&m!==v[c])&&Bh(t,c,m,v[c],!1),c="checked",_!==void 0&&_!==t[c]&&Bh(t,c,_,v[c],!1))}return t}function dS(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){ve.__e(r,n)}}function iS(t,e,n){var r,o;if(ve.unmount&&ve.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||dS(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){ve.__e(i,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&iS(r[o],e,n||typeof t.type!="function");n||t.__e==null||qR(t.__e),t.__=t.__e=t.__d=void 0}function IF(t,e,n){return this.constructor(t,n)}function kF(t,e,n){var r,o,i,a;ve.__&&ve.__(t,e),o=(r=!1)?null:e.__k,i=[],a=[],uS(e,t=e.__k=qt(jf,null,[t]),o||$f,$f,e.ownerSVGElement!==void 0,o?null:e.firstChild?Yh.call(e.childNodes):null,i,o?o.__e:e.firstChild,r,a),t.__d=void 0,oS(i,t,a)}Yh=lS.slice,ve={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(s){t=s}throw t}},$R=0,Gh.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),ER(this))},Gh.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ER(this))},Gh.prototype.render=jf,sl=[],jR=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rS=function(t,e){return t.__v.__b-e.__v.__b},qh.__r=0;var $i,_e,Qv,AR,lu=0,KR=[],$h=[],Ge=ve,IR=Ge.__b,kR=Ge.__r,RR=Ge.diffed,NR=Ge.__c,CR=Ge.unmount,MR=Ge.__;function cl(t,e){Ge.__h&&Ge.__h(_e,t,lu||e),lu=0;var n=_e.__H||(_e.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:$h}),n.__[t]}function ll(t){return lu=1,XR(QR,t)}function XR(t,e,n){var r=cl($i++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):QR(void 0,e),function(s){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,s);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=_e,!_e.u)){var o=function(s,l,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(p){return!!p.__c});if(d.every(function(p){return!p.__N}))return!i||i.call(this,s,l,c);var u=!1;return d.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(u=!0)}}),!(!u&&r.__c.props===s)&&(!i||i.call(this,s,l,c))};_e.u=!0;var i=_e.shouldComponentUpdate,a=_e.componentWillUpdate;_e.componentWillUpdate=function(s,l,c){if(this.__e){var d=i;i=void 0,o(s,l,c),i=d}a&&a.call(this,s,l,c)},_e.shouldComponentUpdate=o}return r.__N||r.__}function RF(t,e){var n=cl($i++,3);!Ge.__s&&fS(n.__H,e)&&(n.__=t,n.i=e,_e.__H.__h.push(n))}function JR(t,e){var n=cl($i++,4);!Ge.__s&&fS(n.__H,e)&&(n.__=t,n.i=e,_e.__h.push(n))}function NF(t){return lu=5,qf(function(){return{current:t}},[])}function CF(t,e,n){lu=6,JR(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},n==null?n:n.concat(t))}function qf(t,e){var n=cl($i++,7);return fS(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function au(t,e){return lu=8,qf(function(){return t},e)}function MF(t){var e=_e.context[t.__c],n=cl($i++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(_e)),e.props.value):t.__}function OF(t,e){Ge.useDebugValue&&Ge.useDebugValue(e?e(t):t)}function DF(t){var e=cl($i++,10),n=ll();return e.__=t,_e.componentDidCatch||(_e.componentDidCatch=function(r,o){e.__&&e.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function LF(){var t=cl($i++,11);if(!t.__){for(var e=_e.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function UF(){for(var t;t=KR.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(jh),t.__H.__h.forEach(aS),t.__H.__h=[]}catch(e){t.__H.__h=[],Ge.__e(e,t.__v)}}Ge.__b=function(t){_e=null,IR&&IR(t)},Ge.__=function(t,e){e.__k&&e.__k.__m&&(t.__m=e.__k.__m),MR&&MR(t,e)},Ge.__r=function(t){kR&&kR(t),$i=0;var e=(_e=t.__c).__H;e&&(Qv===_e?(e.__h=[],_e.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=$h,n.__N=n.i=void 0})):(e.__h.forEach(jh),e.__h.forEach(aS),e.__h=[],$i=0)),Qv=_e},Ge.diffed=function(t){RR&&RR(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(KR.push(e)!==1&&AR===Ge.requestAnimationFrame||((AR=Ge.requestAnimationFrame)||BF)(UF)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==$h&&(n.__=n.__V),n.i=void 0,n.__V=$h})),Qv=_e=null},Ge.__c=function(t,e){e.some(function(n){try{n.__h.forEach(jh),n.__h=n.__h.filter(function(r){return!r.__||aS(r)})}catch(r){e.some(function(o){o.__h&&(o.__h=[])}),e=[],Ge.__e(r,n.__v)}}),NR&&NR(t,e)},Ge.unmount=function(t){CR&&CR(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{jh(r)}catch(o){e=o}}),n.__H=void 0,e&&Ge.__e(e,n.__v))};var OR=typeof requestAnimationFrame=="function";function BF(t){var e,n=function(){clearTimeout(r),OR&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);OR&&(e=requestAnimationFrame(n))}function jh(t){var e=_e,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),_e=e}function aS(t){var e=_e;t.__c=t.__(),_e=e}function fS(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function QR(t,e){return typeof e=="function"?e(t):e}var PF=Object.defineProperty({__proto__:null,useCallback:au,useContext:MF,useDebugValue:OF,useEffect:RF,useErrorBoundary:DF,useId:LF,useImperativeHandle:CF,useLayoutEffect:JR,useMemo:qf,useReducer:XR,useRef:NF,useState:ll},Symbol.toStringTag,{value:"Module"}),zF="http://www.w3.org/2000/svg";function FF(){let t=r=>be.createElementNS(zF,r),e=Dr(t("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Dr(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 HF({options:t}){let e=qf(()=>({__html:FF().outerHTML}),[]);return qt("h2",{class:"dialog__header"},qt("span",{class:"dialog__title"},t.formTitle),t.showBranding?qt("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:e}):null)}function GF(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 Zv(t,e){let n=t.get(e);return typeof n=="string"?n.trim():""}function $F({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,[D,z]=ll(!1),[U,O]=ll(null),[N,B]=ll(!1),V=c?.input,[st,nt]=ll(null),lt=au(F=>{nt(F),B(!1)},[]),X=au(F=>{let gt=GF(F,{emailLabel:m,isEmailRequired:v,isNameRequired:h,messageLabel:b,nameLabel:E});return gt.length>0?O(`Please enter in the following required fields: ${gt.join(", ")}`):O(null),gt.length===0},[m,v,h,b,E]),ct=au(async F=>{z(!0);try{if(F.preventDefault(),!(F.target instanceof HTMLFormElement))return;let gt=new FormData(F.target),Q=await(c&&N?c.value():void 0),dt={name:Zv(gt,"name"),email:Zv(gt,"email"),message:Zv(gt,"message"),attachments:Q?[Q]:void 0};if(!X(dt))return;try{let Xt=await o({name:dt.name,email:dt.email,message:dt.message,source:fF,tags:d},{attachments:dt.attachments});i(dt,Xt)}catch(Xt){Fh&&w.error(Xt);let Ce=Xt instanceof Error?Xt:new Error(String(Xt));O(Ce.message),a(Ce)}}finally{z(!1)}},[c&&N,i,a]);return qt("form",{class:"form",onSubmit:ct},V&&N?qt(V,{onError:lt}):null,qt("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:D},qt("div",{class:"form__top"},U?qt("div",{class:"form__error-container"},U):null,l?qt("label",{for:"name",class:"form__label"},qt(tS,{label:E,isRequiredLabel:I,isRequired:h}),qt("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:R,required:h,type:"text"})):qt("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),s?qt("label",{for:"email",class:"form__label"},qt(tS,{label:m,isRequiredLabel:I,isRequired:v}),qt("input",{class:"form__input",defaultValue:e,id:"email",name:"email",placeholder:_,required:v,type:"email"})):qt("input",{"aria-hidden":!0,value:e,name:"email",type:"hidden"}),qt("label",{for:"message",class:"form__label"},qt(tS,{label:b,isRequiredLabel:I,isRequired:!0}),qt("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:S,required:!0,rows:5})),V?qt("label",{for:"screenshot",class:"form__label"},qt("button",{class:"btn btn--default",disabled:D,type:"button",onClick:()=>{nt(null),B(F=>!F)}},N?p:u),st?qt("div",{class:"form__error-container"},st.message):null):null),qt("div",{class:"btn-group"},qt("button",{class:"btn btn--primary",disabled:D,type:"submit"},C),qt("button",{class:"btn btn--default",disabled:D,type:"button",onClick:r},f))))}function tS({label:t,isRequired:e,isRequiredLabel:n}){return qt("span",{class:"form__label__text"},t,e&&qt("span",{class:"form__label__text--required"},n))}var Ph=16,DR=17,jF="http://www.w3.org/2000/svg";function qF(){let t=l=>jo.document.createElementNS(jF,l),e=Dr(t("svg"),{width:`${Ph}`,height:`${DR}`,viewBox:`0 0 ${Ph} ${DR}`,fill:"inherit"}),n=Dr(t("g"),{clipPath:"url(#clip0_57_156)"}),r=Dr(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=Dr(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=Dr(t("clipPath"),{id:"clip0_57_156"}),s=Dr(t("rect"),{width:`${Ph}`,height:`${Ph}`,fill:"white",transform:"translate(0 0.5)"});return a.appendChild(s),i.appendChild(a),e.appendChild(i).appendChild(a).appendChild(s),e}function VF({open:t,onFormSubmitted:e,...n}){let r=n.options,o=qf(()=>({__html:qF().outerHTML}),[]),[i,a]=ll(null),s=au(()=>{i&&(clearTimeout(i),a(null)),e()},[i]),l=au((c,d)=>{n.onSubmitSuccess(c,d),a(setTimeout(()=>{e(),a(null)},mF))},[e]);return qt(jf,null,i?qt("div",{class:"success__position",onClick:s},qt("div",{class:"success__content"},r.successMessageText,qt("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):qt("dialog",{class:"dialog",onClick:r.onFormClose,open:t},qt("div",{class:"dialog__position"},qt("div",{class:"dialog__content",onClick:c=>{c.stopPropagation()}},qt(HF,{options:r}),qt($F,{...n,onSubmitSuccess:l})))))}var YF=`
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
+ `,WF=`
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
+ `,KF=`
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
+ `,XF=`
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
+ `,JF=`
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 QF(t){let e=be.createElement("style");return e.textContent=`
395
+ :host {
396
+ --dialog-inset: var(--inset);
397
+ }
398
+
399
+ ${YF}
400
+ ${WF}
401
+ ${KF}
402
+ ${XF}
403
+ ${JF}
404
+ `,t&&e.setAttribute("nonce",t),e}function ZF(){let t=rt().getUser(),e=Pt().getUser(),n=lr().getUser();return t&&Object.keys(t).length?t:e&&Object.keys(e).length?e:n}var ZR=(()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:t,screenshotIntegration:e,sendFeedback:n,shadow:r})=>{let o=r,i=t.useSentryUser,a=ZF(),s=be.createElement("div"),l=QF(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(),be.body.style.overflow=c},open(){p(!0),t.onFormOpen?.(),P()?.emit("openFeedbackWidget"),c=be.body.style.overflow,be.body.style.overflow="hidden"},close(){p(!1),be.body.style.overflow=c}},u=e?.createInput({h:qt,hooks:PF,dialog:d,options:t}),p=f=>{kF(qt(VF,{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 tH({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 eH(t){let e=be.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 nH({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 rH({hooks:t}){function e(){let[n,r]=t.useState(jo.devicePixelRatio??1);return t.useEffect(()=>{let o=()=>{r(jo.devicePixelRatio)},i=matchMedia(`(resolution: ${jo.devicePixelRatio}dppx)`);return i.addEventListener("change",o),()=>{i.removeEventListener("change",o)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:i,onError:a}){let s=e();t.useEffect(()=>{(async()=>{r();let c=await Gf.mediaDevices.getDisplayMedia({video:{width:jo.innerWidth*s,height:jo.innerHeight*s},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=be.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 oH(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 eS(t,e){Ya(t,{alpha:!0},(n,r)=>{r.drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height)})}function nS(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=>{oH(i,o,e)})})}function iH({h:t,hooks:e,outputBuffer:n,dialog:r,options:o}){let i=rH({hooks:e}),a=nH({h:t}),s=tH({h:t}),l={__html:eH(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=be.getElementById(o.id);if(!N)return"white";let B=getComputedStyle(N);return B.getPropertyValue("--button-primary-background")||B.getPropertyValue("--accent-background")},[o.id]);e.useLayoutEffect(()=>{let N=()=>{let B=v.current;B&&(Ya(u.canvas,{alpha:!1},V=>{let st=Math.min(B.clientWidth/V.width,B.clientHeight/V.height);R(st)}),(B.clientHeight===0||B.clientWidth===0)&&setTimeout(N,0))};return N(),jo.addEventListener("resize",N),()=>{jo.removeEventListener("resize",N)}},[u]);let I=e.useCallback((N,B)=>{Ya(N,{alpha:!0},(V,st)=>{st.scale(B,B),V.width=u.canvas.width,V.height=u.canvas.height})},[u]);e.useEffect(()=>{I(h.current,u.dpi),eS(h.current,u.canvas)},[u]),e.useEffect(()=>{I(b.current,u.dpi),Ya(b.current,{alpha:!0},(N,B)=>{B.clearRect(0,0,N.width,N.height)}),nS(b.current,C,m)},[m,C]),e.useEffect(()=>{I(n,u.dpi),eS(n,u.canvas),Ya(be.createElement("canvas"),{alpha:!0},(N,B)=>{B.scale(u.dpi,u.dpi),N.width=u.canvas.width,N.height=u.canvas.height,nS(N,C,m),eS(n,N)})},[m,u,C]);let D=N=>{if(!p||!S.current)return;let B=S.current.getBoundingClientRect(),V={type:p,x:N.offsetX/E,y:N.offsetY/E},st=(X,ct)=>{let F=(ct.clientX-B.x)/E,gt=(ct.clientY-B.y)/E;return{type:X.type,x:Math.min(X.x,F),y:Math.min(X.y,gt),w:Math.abs(F-X.x),h:Math.abs(gt-X.y)}},nt=X=>{Ya(b.current,{alpha:!0},(ct,F)=>{F.clearRect(0,0,ct.width,ct.height)}),nS(b.current,C,[...m,st(V,X)])},lt=X=>{let ct=st(V,X);ct.w*E>=1&&ct.h*E>=1&&_(F=>[...F,ct]),be.removeEventListener("mousemove",nt),be.removeEventListener("mouseup",lt)};be.addEventListener("mousemove",nt),be.addEventListener("mouseup",lt)},z=e.useCallback(N=>B=>{B.preventDefault(),B.stopPropagation(),_(V=>{let st=[...V];return st.splice(N,1),st})},[]),U={width:`${u.canvas.width*E}px`,height:`${u.canvas.height*E}px`},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:D,style:U},m.map((N,B)=>t("div",{key:B,class:"editor__rect",style:{top:`${N.y*E}px`,left:`${N.x*E}px`,width:`${N.w*E}px`,height:`${N.h*E}px`}},t("button",{"aria-label":o.removeHighlightText,onClick:z(B),onMouseDown: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(be.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 tN=(()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:t,hooks:e,dialog:n,options:r})=>{let o=be.createElement("canvas");return{input:iH({h:t,hooks:e,outputBuffer:o,dialog:n,options:r}),value:async()=>{let i=await new Promise(a=>{o.toBlob(a,"image/png")});if(i)return{data:new Uint8Array(await i.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}));var q=tt,pS=0;function mS(){return pS>0}function aH(){pS++,setTimeout(()=>{pS--})}function ul(t,e={}){function n(o){return typeof o=="function"}if(!n(t))return t;try{if(Object.prototype.hasOwnProperty.call(t,"__sentry_wrapped__")){let i=t.__sentry_wrapped__;return typeof i=="function"?i:t}if(Aa(t))return t}catch{return t}let r=function(...o){tt._sentryWrappedDepth=(tt._sentryWrappedDepth||0)+1;try{let i=o.map(a=>ul(a,e));return t.apply(this,i)}catch(i){throw aH(),Oe(a=>{a.addEventProcessor(s=>(e.mechanism&&(Ps(s,void 0,void 0),En(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),Et(i)}),i}finally{tt._sentryWrappedDepth=(tt._sentryWrappedDepth||0)-1}};try{for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch{}Zd(r,t),Gt(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function cu(){let t=Kn(),{referrer:e}=q.document||{},{userAgent:n}=q.navigator||{},r={...e&&{Referer:e},...n&&{"User-Agent":n}};return{url:t,headers:r}}var sH=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],lH={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function cH(t){return lH[t]||t.replace("Integration","").toLowerCase()}var eN=q;async function Wh(t,e){let n=sH.includes(t)?cH(t):void 0,r=eN.Sentry=eN.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=uH(n),a=q.document.createElement("script");a.src=i,a.crossOrigin="anonymous",a.referrerPolicy="strict-origin",e&&a.setAttribute("nonce",e);let s=new Promise((u,p)=>{a.addEventListener("load",()=>u()),a.addEventListener("error",p)}),l=q.document.currentScript,c=q.document.body||q.document.head||l?.parentElement;if(c)c.appendChild(a);else throw new Error(`Could not find parent element to insert lazy-loaded ${t} script`);try{await s}catch{throw new Error(`Error when loading integration: ${t}`)}let d=r[t];if(typeof d!="function")throw new Error(`Could not load integration: ${t}`);return d}function uH(t){let n=P()?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${ir}/${t}.min.js`,n).toString()}var nN=Vh({lazyLoadIntegration:Wh});var gS=Vh({getModalIntegration:()=>ZR,getScreenshotIntegration:()=>tN});function uu(t,e){let n=Kh(t,e),r={type:gH(e),value:hH(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function dH(t,e,n,r){let i=P()?.getOptions().normalizeDepth,a=_H(e),s={__serialized__:ef(e,i)};if(a)return{exception:{values:[uu(t,a)]},extra:s};let l={exception:{values:[{type:xa(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:yH(e,{isUnhandledRejection:r})}]},extra:s};if(n){let c=Kh(t,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function hS(t,e){return{exception:{values:[uu(t,e)]}}}function Kh(t,e){let n=e.stacktrace||e.stack||"",r=pH(e),o=mH(e);try{return t(n,r,o)}catch{}return[]}var fH=/Minified React error #\d+;/i;function pH(t){return t&&fH.test(t.message)?1:0}function mH(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function rN(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function gH(t){let e=t?.name;return!e&&rN(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function hH(t){let e=t?.message;return rN(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?uh(e.error):uh(t):"No error message"}function Xh(t,e,n,r){let o=n?.syntheticException||void 0,i=du(t,e,o,r);return En(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),li(i)}function Jh(t,e,n="info",r,o){let i=r?.syntheticException||void 0,a=yS(t,e,i,o);return a.level=n,r?.event_id&&(a.event_id=r.event_id),li(a)}function du(t,e,n,r,o){let i;if(yc(e)&&e.error)return hS(t,e.error);if(Jd(e)||tg(e)){let a=e;if("stack"in e){i=hS(t,e);let s=i.exception?.values?.[0];if(r&&n&&s&&!s.stacktrace){let l=Kh(t,n);l.length&&(s.stacktrace={frames:l},En(i,{synthetic:!0}))}}else{let s=a.name||(Jd(a)?"DOMError":"DOMException"),l=a.message?`${s}: ${a.message}`:s;i=yS(t,l,n,r),Ps(i,l)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return pn(e)?hS(t,e):he(e)||xa(e)?(i=dH(t,e,n,o),En(i,{synthetic:!0}),i):(i=yS(t,e,n,r),Ps(i,`${e}`,void 0),En(i,{synthetic:!0}),i)}function yS(t,e,n,r){let o={};if(r&&n){let i=Kh(t,n);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]}),En(o,{synthetic:!0})}if(ei(e)){let{__sentry_template_string__:i,__sentry_template_values__:a}=e;return o.logentry={message:i,params:a},o}return o.message=e,o}function yH(t,{isUnhandledRejection:e}){let n=ng(t),r=e?"promise rejection":"exception";return yc(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:xa(t)?`Event \`${bH(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function bH(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function _H(t){return Object.values(t).find(e=>e instanceof Error)}var fu=class extends Nf{constructor(e){let n=vH(e),r=q.SENTRY_SDK_SOURCE||rv();Mf(n,"browser",["browser"],r),super(n);let{userInfo:o}=this.getDataCollectionOptions();n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:o?"auto":"never",...n._metadata.sdk.settings});let{sendClientReports:i,enableLogs:a,_experiments:s,enableMetrics:l}=this._options,c=l??s?.enableMetrics??!0;q.document&&(i||a||c)&&q.document.addEventListener("visibilitychange",()=>{q.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),a&&Js(this),c&&Pc(this))}),o&&this.on("beforeSendSession",_v)}eventFromException(e,n){return Xh(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Jh(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 vH(t){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:q.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...t}}var xn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var pt=tt;var SH=(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=SH(e.value,n),t(e)))}};var ji=(t=!0)=>{let e=pt.performance?.getEntriesByType?.("navigation")[0];if(!t||e&&e.responseStart>0&&e.responseStart<performance.now())return e};var io=()=>ji()?.activationStart??0;function ao(t,e,n){pt.document&&pt.addEventListener(t,e,n)}function dl(t,e,n){pt.document&&pt.removeEventListener(t,e,n)}var pu=-1,oN=new Set,EH=()=>pt.document?.visibilityState==="hidden"&&!pt.document?.prerendering?0:1/0,Qh=t=>{if(TH(t)&&pu>-1){if(t.type==="visibilitychange"||t.type==="pagehide")for(let e of oN)e();isFinite(pu)||(pu=t.type==="visibilitychange"?t.timeStamp:0,dl("prerenderingchange",Qh,!0))}},bi=()=>{if(pt.document&&pu<0){let t=io();pu=(pt.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>t)[0]?.startTime)??EH(),ao("visibilitychange",Qh,!0),ao("pagehide",Qh,!0),ao("prerenderingchange",Qh,!0)}return{get firstHiddenTime(){return pu},onHidden(t){oN.add(t)}}};function TH(t){return t.type==="pagehide"||pt.document?.visibilityState==="hidden"}var iN=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var _i=(t,e=-1)=>{let n=ji(),r="navigate";return n&&(pt.document?.prerendering||io()>0?r="prerender":pt.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:iN(),navigationType:r}};var bS=new WeakMap;function mu(t,e){try{return bS.get(t)||bS.set(t,new e),bS.get(t)}catch{return new e}}var Zh=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 so=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{e(o.getEntries())})});return r.observe({type:t,buffered:!0,...n}),r}}catch{}};var gu=t=>{let e=!1;return()=>{e||(t(),e=!0)}};var Ka=t=>{pt.document?.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()};var wH=[1800,3e3],aN=(t,e={})=>{Ka(()=>{let n=bi(),r=_i("FCP"),o,a=so("paint",s=>{for(let l of s)l.name==="first-contentful-paint"&&(a.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-io(),0),r.entries.push(l),o(!0)))});a&&(o=yi(t,r,wH,e.reportAllChanges))})};var xH=[.1,.25],sN=(t,e={})=>{aN(gu(()=>{let n=_i("CLS",0),r,o=bi(),i=mu(e,Zh),a=l=>{for(let c of l)i._processEntry(c);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},s=so("layout-shift",a);s&&(r=yi(t,n,xH,e.reportAllChanges),o.onHidden(()=>{a(s.takeRecords()),r(!0)}),pt?.setTimeout?.(r))}))};var lN=0,_S=1/0,ty=0,AH=t=>{t.forEach(e=>{e.interactionId&&(_S=Math.min(_S,e.interactionId),ty=Math.max(ty,e.interactionId),lN=ty?(ty-_S)/7+1:0)})},vS,SS=()=>vS?lN:performance.interactionCount||0,cN=()=>{"interactionCount"in performance||vS||(vS=so("event",AH,{type:"event",buffered:!0,durationThreshold:0}))};var ES=10,uN=0,IH=()=>SS()-uN,ey=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){uN=SS(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(IH()/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<ES||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>ES){let o=this._longestInteractionList.splice(ES);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var fl=t=>{let e=pt.requestIdleCallback||pt.setTimeout;pt.document?.visibilityState==="hidden"?t():(t=gu(t),ao("visibilitychange",t,{once:!0,capture:!0}),ao("pagehide",t,{once:!0,capture:!0}),e(()=>{t(),dl("visibilitychange",t,{capture:!0}),dl("pagehide",t,{capture:!0})}))};var kH=[200,500],RH=40,dN=(t,e={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=bi();Ka(()=>{cN();let r=_i("INP"),o,i=mu(e,ey),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=so("event",a,{durationThreshold:e.durationThreshold??RH});o=yi(t,r,kH,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{a(s.takeRecords()),o(!0)}))})};var ny=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}};var NH=[2500,4e3],fN=(t,e={})=>{Ka(()=>{let n=bi(),r=_i("LCP"),o,i=mu(e,ny),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-io(),0),r.entries=[c],o())},s=so("largest-contentful-paint",a);if(s){o=yi(t,r,NH,e.reportAllChanges);let l=gu(()=>{a(s.takeRecords()),s.disconnect(),o(!0)}),c=d=>{d.isTrusted&&(fl(l),dl(d.type,c,{capture:!0}))};for(let d of["keydown","click","visibilitychange"])ao(d,c,{capture:!0})}})};var CH=[800,1800],TS=t=>{pt.document?.prerendering?Ka(()=>TS(t)):pt.document?.readyState!=="complete"?addEventListener("load",()=>TS(t),!0):setTimeout(t)},pN=(t,e={})=>{let n=_i("TTFB"),r=yi(t,n,CH,e.reportAllChanges);TS(()=>{let o=ji();o&&(n.value=Math.max(o.responseStart-io(),0),n.entries=[o],r(!0))})};var Vf={},ry={},mN,gN,hN,yN;function qi(t,e=!1){return oy("cls",t,MH,mN,e)}function Vi(t,e=!1){return oy("lcp",t,OH,gN,e)}function wS(t){return oy("ttfb",t,DH,hN)}function pl(t){return oy("inp",t,LH,yN)}function hr(t,e){return bN(t,e),ry[t]||(UH(t),ry[t]=!0),_N(t,e)}function Yf(t,e){let n=Vf[t];if(n?.length)for(let r of n)try{r(e)}catch(o){xn&&w.error(`Error while triggering instrumentation handler.
497
+ Type: ${t}
498
+ Name: ${Qn(r)}
499
+ Error:`,o)}}function MH(){return sN(t=>{Yf("cls",{metric:t}),mN=t},{reportAllChanges:!0})}function OH(){return fN(t=>{Yf("lcp",{metric:t}),gN=t},{reportAllChanges:!0})}function DH(){return pN(t=>{Yf("ttfb",{metric:t}),hN=t})}function LH(){return dN(t=>{Yf("inp",{metric:t}),yN=t})}function oy(t,e,n,r,o=!1){bN(t,e);let i;return ry[t]||(i=n(),ry[t]=!0),r&&e({metric:r}),_N(t,e,o?i:void 0)}function UH(t){let e={};t==="event"&&(e.durationThreshold=0),so(t,n=>{Yf(t,{entries:n})},e)}function bN(t,e){Vf[t]=Vf[t]||[],Vf[t].push(e)}function _N(t,e,n){return()=>{n&&n();let r=Vf[t];if(!r)return;let o=r.indexOf(e);o!==-1&&r.splice(o,1)}}function vN(t){return"duration"in t}var BH=80,ml={};try{typeof Node<"u"&&(ml.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element<"u"&&(ml.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,ml.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,ml.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,ml.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<"u"&&(ml.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function Xa(t,e,n){let r=ml[e];if(r)try{return r.call(t,n)}catch{}let o=t[e];return typeof o=="function"?o.call(t,n):o}function pe(t,e={}){if(!t)return"<unknown>";try{let n=t,r=5,o=[],i=0,a=0,s=" > ",l=s.length,c,d=Array.isArray(e)?e:e.keyAttrs,u=!Array.isArray(e)&&e.maxStringLength||BH;for(;n&&i++<r&&(c=PH(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 PH(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&&mn(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 SN=t=>{let e=n=>{(n.type==="pagehide"||pt.document?.visibilityState==="hidden")&&t(n)};ao("visibilitychange",e,{capture:!0,once:!0}),ao("pagehide",e,{capture:!0,once:!0})};function iy(t){return typeof t=="number"&&isFinite(t)}function Yi(t,e,n,{...r}){let o=et(t).start_timestamp;return o&&o>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),Xr(t,()=>{let i=Ae({startTime:e,...r});return i&&i.end(n),i})}function hu(t){let e=P();if(!e)return;let{name:n,transaction:r,attributes:o,startTime:i}=t,{release:a,environment:s}=e.getOptions(),{userInfo:l}=e.getDataCollectionOptions(),d=e.getIntegrationByName("Replay")?.getReplayId(),u=rt(),p=u.getUser(),f=p!==void 0?p.email||p.id||p.ip_address:void 0,m;try{m=u.getScopeData().contexts.profile.profile_id}catch{}let _={release:a,environment:s,user:f||void 0,profile_id:m||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":pt.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return Ae({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function lo(){return pt.addEventListener&&pt.performance}function se(t){return t/1e3}function EN(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}SN(()=>{o("pagehide")});let i=t.on("beforeStartNavigationSpan",(s,l)=>{l?.isRedirect||(o("navigation"),i(),a())}),a=t.on("afterStartPageLoadSpan",s=>{n=s,a()})}function TN(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)=>{zH(e,n,i,o),r()})}function zH(t,e,n,r){xn&&w.log(`Sending CLS span (${t})`);let o=e?se((ne()||0)+e.startTime):Ct(),i=rt().getScopeData().transactionName,a=e?pe(e.sources[0]?.node):"Layout shift",s={[at]:"auto.http.browser.cls",[ht]:"ui.webvital.cls",[jn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e?.sources&&e.sources.forEach((c,d)=>{s[`cls.source.${d+1}`]=pe(c.node)});let l=hu({name:a,transaction:i,attributes:s,startTime:o});l&&(l.addEvent("cls",{[Bo]:"",[Po]:t}),l.end(o))}var FH=6e4;function yl(t){return t!=null&&t>0&&t<=FH}function wN(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)=>{HH(e,n,i,o),r()})}function HH(t,e,n,r){if(!yl(t))return;xn&&w.log(`Sending LCP span (${t})`);let o=se((ne()||0)+(e?.startTime||0)),i=rt().getScopeData().transactionName,a=e?pe(e.element):"Largest contentful paint",s={[at]:"auto.http.browser.lcp",[ht]:"ui.webvital.lcp",[jn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e&&(e.element&&(s["lcp.element"]=pe(e.element)),e.id&&(s["lcp.id"]=e.id),e.url&&(s["lcp.url"]=e.url),e.loadTime!=null&&(s["lcp.loadTime"]=e.loadTime),e.renderTime!=null&&(s["lcp.renderTime"]=e.renderTime),e.size!=null&&(s["lcp.size"]=e.size));let l=hu({name:a,transaction:i,attributes:s,startTime:o});l&&(l.addEvent("lcp",{[Bo]:"millisecond",[Po]:t}),l.end(o))}function co(t){return t&&((ne()||performance.timeOrigin)+t)/1e3}function Wf(t){let e={};if(t.nextHopProtocol!=null){let{name:n,version:r}=EN(t.nextHopProtocol);e["network.protocol.version"]=r,e["network.protocol.name"]=n}return ne()||lo()?.timeOrigin?GH({...e,"http.request.redirect_start":co(t.redirectStart),"http.request.redirect_end":co(t.redirectEnd),"http.request.worker_start":co(t.workerStart),"http.request.fetch_start":co(t.fetchStart),"http.request.domain_lookup_start":co(t.domainLookupStart),"http.request.domain_lookup_end":co(t.domainLookupEnd),"http.request.connect_start":co(t.connectStart),"http.request.secure_connection_start":co(t.secureConnectionStart),"http.request.connection_end":co(t.connectEnd),"http.request.request_start":co(t.requestStart),"http.request.response_start":co(t.responseStart),"http.request.response_end":co(t.responseEnd),"http.request.time_to_first_byte":t.responseStart!=null?t.responseStart/1e3:void 0}):e}function GH(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!=null))}var $H=2147483647,xN=0,br={},yr,sy;function xS({recordClsStandaloneSpans:t,recordLcpStandaloneSpans:e,client:n}){let r=lo();if(r&&ne()){r.mark&&pt.performance.mark("sentry-tracing-init");let o=e?wN(n):e===!1?qH():void 0,i=t?TN(n):t===!1?jH():void 0,a=VH(),s=YH();return()=>{a(),s(),o?.(),i?.()}}return()=>{}}function AS(){hr("longtask",({entries:t})=>{let e=Ot();if(!e)return;let{op:n,start_timestamp:r}=et(e);for(let o of t){let i=se(ne()+o.startTime),a=se(o.duration);n==="navigation"&&r&&i<r||Yi(e,i,i+a,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[at]:"auto.ui.browser.metrics"}})}})}function IS(){new PerformanceObserver(e=>{let n=Ot();if(n)for(let r of e.getEntries()){if(!r.scripts[0])continue;let o=se(ne()+r.startTime),{start_timestamp:i,op:a}=et(n);if(a==="navigation"&&i&&o<i)continue;let s=se(r.duration),l={[at]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:d,invokerType:u,sourceURL:p,sourceFunctionName:f,sourceCharPosition:m}=c;l["browser.script.invoker"]=d,l["browser.script.invoker_type"]=u,p&&(l["code.filepath"]=p),f&&(l["code.function"]=f),m!==-1&&(l["browser.script.source_char_position"]=m),Yi(n,o,o+s,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function kS(){hr("event",({entries:t})=>{let e=Ot();if(e){for(let n of t)if(n.name==="click"){let r=se(ne()+n.startTime),o=se(n.duration),i={name:pe(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[at]:"auto.ui.browser.metrics"}},a=Va(n.target);a&&(i.attributes["ui.component_name"]=a),Yi(e,r,r+o,i)}}})}function jH(){return qi(({metric:t})=>{let e=t.entries[t.entries.length-1];e&&(br.cls={value:t.value,unit:""},sy=e)},!0)}function qH(){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 VH(){return wS(({metric:t})=>{t.entries[t.entries.length-1]&&(br.ttfb={value:t.value,unit:"millisecond"})})}function YH(){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 RS(t,e){let n=lo(),r=ne();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:a}=e,s=se(r),l=n.getEntries(),{op:c,start_timestamp:d}=et(t);l.slice(xN).forEach(u=>{let p=se(u.startTime),f=se(Math.max(0,u.duration));if(!(c==="navigation"&&d&&s+p<d))switch(u.entryType){case"navigation":{JH(t,u,s);break}case"mark":case"paint":case"measure":{KH(t,u,p,f,s,i);break}case"resource":{t7(t,u,u.name,p,f,s,a);break}}}),xN=Math.max(l.length-1,0),e7(t,o)}function NS(t,e){let n=ne();if(!lo()?.getEntries||!n){AN();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:o,recordLcpOnPageloadSpan:i}=e,a=se(n);if(et(t).op==="pageload"){if(o7(br),r){let s=(l,c,d)=>{let u=d??`browser.web_vital.${l}.value`;t.setAttribute(u,c),xn&&w.log("Setting web vital attribute",{[u]:c},"on pageload span")};["ttfb","fp","fcp"].forEach(l=>{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)}),n7(t,e);t.setAttribute(r?"browser.performance.time_origin":"performance.timeOrigin",a),t.setAttribute(r?"browser.performance.navigation.activation_start":"performance.activationStart",io())}AN()}function AN(){yr=void 0,sy=void 0,br={}}function WH(t){if(t?.entryType==="measure")try{return t.detail.devtools.track==="Components \u269B"}catch{return}}function KH(t,e,n,r,o,i){if(WH(e)||["mark","measure"].includes(e.entryType)&&tn(e.name,i))return;let a=ji(!1),s=se(a?a.requestStart:0),l=o+Math.max(n,s),c=o+n,d=c+r,u={[at]:"auto.resource.browser.metrics"};l!==c&&(u["sentry.browser.measure_happened_before_request"]=!0,u["sentry.browser.measure_start_time"]=l),XH(u,e),l<=d&&Yi(t,l,d,{name:e.name,op:e.entryType,attributes:u})}function XH(t,e){try{let n=e.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&Ze(o))t[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{t[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(Ze(n)){t["sentry.browser.measure.detail"]=n;return}try{t["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function JH(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{ay(t,e,r,n)}),ay(t,e,"secureConnection",n,"TLS/SSL"),ay(t,e,"fetch",n,"cache"),ay(t,e,"domainLookup",n,"DNS"),ZH(t,e,n)}function ay(t,e,n,r,o=n){let i=QH(n),a=e[i],s=e[`${n}Start`];!s||!a||Yi(t,r+se(s),r+se(a),{op:`browser.${o}`,name:e.name,attributes:{[at]:"auto.ui.browser.metrics",...n==="redirect"&&e.redirectCount!=null?{"http.redirect_count":e.redirectCount}:{}}})}function QH(t){return t==="secureConnection"?"connectEnd":t==="fetch"?"domainLookupStart":`${t}End`}function ZH(t,e,n){let r=n+se(e.requestStart),o=n+se(e.responseEnd),i=n+se(e.responseStart);e.responseEnd&&(Yi(t,r,o,{op:"browser.request",name:e.name,attributes:{[at]:"auto.ui.browser.metrics"}}),Yi(t,i,o,{op:"browser.response",name:e.name,attributes:{[at]:"auto.ui.browser.metrics"}}))}function t7(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=Qr(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(pt.location.origin),l[wc]=n,r7(e,l,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);let d={...l,...Wf(e)},u=i+r,p=u+o;Yi(t,u,p,{name:n.replace(pt.location.origin,""),op:s,attributes:d})}function e7(t,e){let n=pt.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&t.setAttribute(e?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&t.setAttribute(e?"network.connection.type":"connectionType",r.type),iy(r.rtt)&&(e?t.setAttribute("network.connection.rtt",r.rtt):et(t).op==="pageload"&&qs("connection.rtt",r.rtt,"millisecond"))),iy(n.deviceMemory)&&(e?t.setAttribute("device.memory.estimated_capacity",n.deviceMemory):t.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),iy(n.hardwareConcurrency)&&(e?t.setAttribute("device.processor_count",n.hardwareConcurrency):t.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function n7(t,e){yr&&e.recordLcpOnPageloadSpan&&(yr.element&&t.setAttribute("lcp.element",pe(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)),sy?.sources&&e.recordClsOnPageloadSpan&&sy.sources.forEach((n,r)=>t.setAttribute(`cls.source.${r+1}`,pe(n.node)))}function r7(t,e,n){n.forEach(([r,o])=>{let i=t[r];i!=null&&(typeof i=="number"&&i<$H||typeof i=="string")&&(e[o]=i)})}function o7(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 i7="ElementTiming",a7=(()=>({name:i7,setup(){!lo()||!ne()||hr("element",({entries:e})=>{for(let n of e){let r=n;if(!r.identifier)continue;let o=r.identifier,i=r.name,a=r.renderTime,s=r.loadTime,l={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":o};i&&(l["ui.element.paint_type"]=i),r.id&&(l["ui.element.id"]=r.id),r.element&&(l["ui.element.type"]=r.element.tagName.toLowerCase()),r.url&&(l["ui.element.url"]=r.url),r.naturalWidth&&(l["ui.element.width"]=r.naturalWidth),r.naturalHeight&&(l["ui.element.height"]=r.naturalHeight),a>0&&Fa.distribution("ui.element.render_time",a,{unit:"millisecond",attributes:l}),s>0&&Fa.distribution("ui.element.load_time",s,{unit:"millisecond",attributes:l})}})}})),CS=a7;var MS=[],Kf=new Map,yu=new Map,OS=60;function DS(){if(lo()&&ne()){let e=s7();return()=>{e()}}return()=>{}}var bu={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 s7(){return pl(l7)}var l7=({metric:t})=>{if(t.value==null)return;let e=se(t.value);if(e>OS)return;let n=t.entries.find(m=>m.duration===t.value&&bu[m.name]);if(!n)return;let{interactionId:r}=n,o=bu[n.name],i=se(ne()+n.startTime),a=Ot(),s=a?Bt(a):void 0,l=r!=null?Kf.get(r):void 0,c=l?.span||s,d=c?et(c).description:rt().getScopeData().transactionName,u=l?.elementName||pe(n.target),p={[at]:"auto.http.browser.inp",[ht]:`ui.interaction.${o}`,[jn]:n.duration},f=hu({name:u,transaction:d,attributes:p,startTime:i});f&&(f.addEvent("inp",{[Bo]:"millisecond",[Po]:t.value}),f.end(i+e))};function IN(t){return t!=null?Kf.get(t):void 0}function LS(){let t=Object.keys(bu);Vn()&&t.forEach(o=>{pt.addEventListener(o,e,{capture:!0,passive:!0})});function e(o){let i=o.target;if(!i)return;let a=pe(i),s=Math.round(o.timeStamp);if(yu.set(s,a),yu.size>50){let l=yu.keys().next().value;l!==void 0&&yu.delete(l)}}function n(o){let i=Math.round(o.startTime),a=yu.get(i);if(!a)for(let s=-5;s<=5;s++){let l=yu.get(i+s);if(l){a=l;break}}return a||"<unknown>"}let r=({entries:o})=>{let i=Ot(),a=i&&Bt(i);o.forEach(s=>{if(!vN(s))return;let l=s.interactionId;if(l==null||Kf.has(l))return;let c=s.target?pe(s.target):n(s);if(MS.length>10){let d=MS.shift();Kf.delete(d)}MS.push(l),Kf.set(l,{span:a,elementName:c})})};hr("event",r),hr("first-input",r)}function US(t){let{name:e,op:n,origin:r,metricName:o,value:i,attributes:a,parentSpan:s,reportEvent:l,startTime:c,endTime:d}=t,u=rt().getScopeData().transactionName,p={[at]:r,[ht]:n,[jn]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":u,"user_agent.original":pt.navigator?.userAgent,...a};s&&Ca(s).attributes?.[ht]==="pageload"&&(p["sentry.pageload.span_id"]=s.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let f=Ae({name:e,attributes:p,startTime:c,parentSpan:s});f&&f.end(d??c)}function BS(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)=>{c7(e,n,a,o),r()})}function c7(t,e,n,r){if(!yl(t))return;xn&&w.log(`Sending LCP span (${t})`);let o=ne()||0,i=se(o),a=se(o+(e?.startTime||0)),s=e?pe(e.element):"Largest contentful paint",l={};e?.element&&(l["browser.web_vital.lcp.element"]=pe(e.element)),e?.id&&(l["browser.web_vital.lcp.id"]=e.id),e?.url&&(l["browser.web_vital.lcp.url"]=e.url),e?.loadTime!=null&&(l["browser.web_vital.lcp.load_time"]=e.loadTime),e?.renderTime!=null&&(l["browser.web_vital.lcp.render_time"]=e.renderTime),e?.size!=null&&(l["browser.web_vital.lcp.size"]=e.size),US({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 PS(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)=>{u7(e,n,a,o),r()})}function u7(t,e,n,r){xn&&w.log(`Sending CLS span (${t})`);let o=e?se((ne()||0)+e.startTime):Ct(),i=e?pe(e.sources[0]?.node):"Layout shift",a={};e?.sources&&e.sources.forEach((s,l)=>{a[`browser.web_vital.cls.source.${l+1}`]=pe(s.node)}),US({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:t,attributes:a,parentSpan:n,reportEvent:r,startTime:o})}function zS(){if(!lo()||!ne())return;pl(({metric:n})=>{if(n.value==null||se(n.value)>OS)return;let o=n.entries.find(i=>i.duration===n.value&&bu[i.name]);o&&d7(n.value,o)})}function d7(t,e){xn&&w.log(`Sending INP span (${t})`);let n=se(ne()+e.startTime),r=se(t),o=bu[e.name],i=IN(e.interactionId),a=Ot(),s=a?Bt(a):void 0,l=i?.span||s,c=l?Ca(l).name:rt().getScopeData().transactionName,d=i?.elementName||pe(e.target);US({name:d,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:t,attributes:{[jn]:e.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var f7=1e3,kN,FS,HS;function Xf(t){zn("dom",t),Fn("dom",p7)}function p7(){if(!pt.document)return;let t=Qe.bind(null,"dom"),e=RN(t,!0);pt.document.addEventListener("click",e,!1),pt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let o=pt[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(ye(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=RN(t);d.handler=u,i.call(this,a,u,l)}d.refCount++}catch{}return i.call(this,a,s,l)}}),ye(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 m7(t){if(t.type!==FS)return!1;try{if(!t.target||t.target._sentryId!==HS)return!1}catch{}return!0}function g7(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function RN(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;let r=h7(n);if(g7(n.type,r))return;Gt(n,"_sentryCaptured",!0),r&&!r._sentryId&&Gt(r,"_sentryId",ae());let o=n.type==="keypress"?"input":n.type;m7(n)||(t({event:n,name:o,global:e}),FS=n.type,HS=r?r._sentryId:void 0),clearTimeout(kN),kN=pt.setTimeout(()=>{HS=void 0,FS=void 0},f7)}}function h7(t){try{return t.target}catch{return null}}var ly;function Wi(t){let e="history";zn(e,t),Fn(e,y7)}function y7(){if(pt.addEventListener("popstate",()=>{let e=pt.location.href,n=ly;if(ly=e,n===e)return;Qe("history",{from:n,to:e})}),!Mh())return;function t(e){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=ly,i=b7(String(r));if(ly=i,o===i)return e.apply(this,n);Qe("history",{from:o,to:i})}return e.apply(this,n)}}ye(pt.history,"pushState",t),ye(pt.history,"replaceState",t)}function b7(t){try{return new URL(t,pt.location.origin).toString()}catch{return t}}var cy={};function _u(t){let e=cy[t];if(e)return e;let n=pt[t];if(ru(n))return cy[t]=n.bind(pt);let r=pt.document;if(r&&typeof r.createElement=="function")try{let o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);let i=o.contentWindow;i?.[t]&&(n=i[t]),r.head.removeChild(o)}catch(o){xn&&w.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return n&&(cy[t]=n.bind(pt))}function GS(t){cy[t]=void 0}function bl(...t){return _u("setTimeout")(...t)}var tr="__sentry_xhr_v3__";function _l(t){zn("xhr",t),Fn("xhr",_7)}function _7(){if(!pt.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){let o=new Error,i=Ct()*1e3,a=mn(r[0])?r[0].toUpperCase():void 0,s=v7(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:Ct()*1e3,startTimestamp:i,xhr:n,virtualError:o};Qe("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,d,u){return l(),c.apply(d,u)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,d,u){let[p,f]=u,m=d[tr];return m&&mn(p)&&mn(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:Ct()*1e3,xhr:n};return Qe("xhr",i),e.apply(n,r)}})}function v7(t){if(mn(t))return t;try{return t.toString()}catch{}}var S7=Symbol.for("sentry__originalRequestBody");function uy(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[uy(t)];if(!t)return[void 0]}catch(n){return xn&&e.error(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return xn&&e.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function vu(t=[]){if(t.length>=2&&t[1]&&typeof t[1]=="object"&&"body"in t[1])return t[1].body;if(t.length>=1&&t[0]instanceof Request){let n=t[0][S7];return n!==void 0?n:void 0}}function Jf(t){let e;try{e=t.getAllResponseHeaders()}catch(n){return xn&&w.error(n,"Failed to get xhr response headers",t),{}}return e?e.split(`\r
500
+ `).reduce((n,r)=>{let[o,i]=r.split(": ");return i&&(n[o.toLowerCase()]=i),n},{}):{}}function $S(t){if(typeof Element>"u")return!1;try{return t instanceof Element}catch{return!1}}var E7=40;function Su(t,e=_u("fetch")){let n=0,r=0;async function o(i){let a=i.body.length;n+=a,r++;let s={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{let l=await e(t.url,s);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw GS("fetch"),l}finally{n-=a,r--}}return kf(t,o,Qs(t.bufferSize||E7))}var W=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function T7(){let t=P();if(!t){W&&w.warn("No Sentry client available, profiling is not started");return}if(!t.getIntegrationByName("BrowserProfiling")){W&&w.warn("BrowserProfiling integration is not available");return}t.emit("startUIProfiler")}function w7(){let t=P();if(!t){W&&w.warn("No Sentry client available, profiling is not started");return}if(!t.getIntegrationByName("BrowserProfiling")){W&&w.warn("ProfilingIntegration is not available");return}t.emit("stopUIProfiler")}var NN={startProfiler:T7,stopProfiler:w7};var x7=10,A7=20,I7=30,k7=40,R7=50;function Eu(t,e,n,r){let o={filename:t,function:e==="<anonymous>"?"?":e,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}var N7=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,C7=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,M7=/\((\S*)(?::(\d+))(?::(\d+))\)/,O7=/at (.+?) ?\(data:(.+?),/,D7=t=>{let e=t.match(O7);if(e)return{filename:`<data:${e[2]}>`,function:e[1]};let n=N7.exec(t);if(n){let[,o,i,a]=n;return Eu(o,"?",+i,+a)}let r=C7.exec(t);if(r){if(r[2]?.indexOf("eval")===0){let s=M7.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[i,a]=DN(r[1]||"?",r[2]);return Eu(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},jS=[I7,D7],L7=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,U7=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,B7=t=>{let e=L7.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=U7.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]=DN(o,r),Eu(r,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},qS=[R7,B7],P7=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,z7=t=>{let e=P7.exec(t);return e?Eu(e[2],e[1]||"?",+e[3],e[4]?+e[4]:void 0):void 0},CN=[k7,z7],F7=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,H7=t=>{let e=F7.exec(t);return e?Eu(e[2],e[3]||"?",+e[1]):void 0},MN=[x7,H7],G7=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,$7=t=>{let e=G7.exec(t);return e?Eu(e[5],e[3]||e[4]||"?",+e[1],+e[2]):void 0},ON=[A7,$7],VS=[jS,qS],dy=Yd(...VS),DN=(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 LN(t,{metadata:e,tunnel:n,dsn:r}){let o={event_id:t.event_id,sent_at:new Date().toISOString(),...e?.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:en(r)}},i=j7(t);return Le(o,[i])}function j7(t){return[{type:"user_report"},t]}var fy=1024,q7="Breadcrumbs",V7=((t={})=>{let e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:q7,setup(n){e.console&&nl(K7(n)),e.dom&&Xf(W7(n,e.dom)),e.xhr&&_l(X7(n)),e.fetch&&hi(J7(n)),e.history&&Wi(Q7(n)),e.sentry&&n.on("beforeSendEvent",Y7(n))}}}),py=V7;function Y7(t){return function(n){P()===t&&wn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Lo(n)},{event:n})}}function W7(t,e){return function(r){if(P()!==t)return;let o,i,a=typeof e=="object"?e.serializeAttribute:void 0,s=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;s&&s>fy&&(W&&w.warn(`\`dom.maxStringLength\` cannot exceed ${fy}, but a value of ${s} was configured. Sentry will use ${fy} instead.`),s=fy),typeof a=="string"&&(a=[a]);try{let c=r.event,d=Z7(c)?c.target:c;o=pe(d,{keyAttrs:a,maxStringLength:s}),i=Va(d)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${r.name}`,message:o};i&&(l.data={"ui.component_name":i}),wn(l,{event:r.event,name:r.name,global:r.global})}}function K7(t){return function(n){if(P()!==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;wn(r,{input:n.args,level:n.level})}}function X7(t){return function(n){if(P()!==t)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[tr];if(!r||!o||!i)return;let{method:a,url:s,status_code:l,body:c}=i,d={method:a,url:s,status_code:l},u={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},p={category:"xhr",data:d,type:"http",level:Ch(l)};t.emit("beforeOutgoingRequestBreadcrumb",p,u),wn(p,u)}}function J7(t){return function(n){if(P()!==t)return;let{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){let i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},a={category:"fetch",data:n.fetchData,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",a,i),wn(a,i)}else{let i=n.response,a={...n.fetchData,status_code:i?.status},s={input:n.args,response:i,startTimestamp:r,endTimestamp:o},l={category:"fetch",data:a,type:"http",level:Ch(a.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",l,s),wn(l,s)}}}function Q7(t){return function(n){if(P()!==t)return;let r=n.from,o=n.to,i=Qr(q.location.href),a=r?Qr(r):void 0,s=Qr(o);a?.path||(a=i),i.protocol===s.protocol&&i.host===s.host&&(o=s.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),wn({category:"navigation",data:{from:r,to:o}})}}function Z7(t){return!!t&&!!t.target}var t9="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(","),e9="BrowserApiErrors",n9=((t={})=>{let e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...t};return{name:e9,setupOnce(){e.setTimeout&&ye(q,"setTimeout",UN),e.setInterval&&ye(q,"setInterval",UN),e.requestAnimationFrame&&ye(q,"requestAnimationFrame",r9),e.XMLHttpRequest&&"XMLHttpRequest"in q&&ye(XMLHttpRequest.prototype,"send",o9);let n=e.eventTarget;n&&(Array.isArray(n)?n:t9).forEach(o=>i9(o,e))}}}),my=n9;function UN(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 r9(t){return function(e){return t.apply(this,[ul(e,{mechanism:{data:{handler:Qn(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function o9(t){return function(...e){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&ye(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 i9(t,e){let r=q[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(ye(r,"addEventListener",function(o){return function(i,a,s){try{a9(a)&&(a.handleEvent=ul(a.handleEvent,{mechanism:{data:{handler:Qn(a),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return e.unregisterOriginalCallbacks&&s9(this,i,a),o.apply(this,[i,ul(a,{mechanism:{data:{handler:Qn(a),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),s])}}),ye(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 a9(t){return typeof t.handleEvent=="function"}function s9(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}var gy=(t={})=>{let e=t.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof q.document>"u"){W&&w.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Ks({ignoreDuration:!0});let n=!1;fl(()=>{n||(Ua(),n=!0)});let r=Pt(),o=r.getUser();r.addScopeListener(i=>{let a=i.getUser();(o?.id!==a?.id||o?.ip_address!==a?.ip_address)&&(o=a,n&&Ua())}),e==="route"&&Wi(({from:i,to:a})=>{i!==a&&(Ks({ignoreDuration:!0}),Ua(),n=!0)})}}};var l9="CultureContext",c9=(()=>({name:l9,preprocessEvent(t){let e=BN();e&&(t.contexts={...t.contexts,culture:{...e,...t.contexts?.culture}})},processSegmentSpan(t){let e=BN();e&&Rr(t,{"culture.locale":e.locale,"culture.timezone":e.timezone,"culture.calendar":e.calendar})}})),hy=c9;function BN(){try{let t=q.Intl;if(!t)return;let e=t.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone,calendar:e.calendar}}catch{return}}var u9="GlobalHandlers",d9=((t={})=>{let e={onerror:!0,onunhandledrejection:!0,...t};return{name:u9,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(f9(n),PN("onerror")),e.onunhandledrejection&&(p9(n),PN("onunhandledrejection"))}}}),yy=d9;function f9(t){Kd(e=>{let{stackParser:n,attachStacktrace:r}=zN();if(P()!==t||mS())return;let{msg:o,url:i,line:a,column:s,error:l}=e,c=m9(du(n,l||o,void 0,r,!1),i,a,s);c.level="error",Jr(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function p9(t){Xd(e=>{let{stackParser:n,attachStacktrace:r}=zN();if(P()!==t||mS())return;let o=YS(e),i=Ze(o)?WS(o):du(n,o,void 0,r,!0);i.level="error",Jr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function YS(t){if(Ze(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function WS(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function m9(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:g9(e)??Kn(),function:"?",in_app:!0}),t}function PN(t){W&&w.log(`Global Handler attached: ${t}`)}function zN(){return P()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function g9(t){if(!(!mn(t)||t.length===0))return t.startsWith("data:")?`<${Yn(t,!1)}>`:t}var by=()=>({name:"HttpContext",preprocessEvent(t){if(!q.navigator&&!q.location&&!q.document)return;let e=cu(),n={...e.headers,...t.request?.headers};t.request={...e,...t.request,headers:n}},processSegmentSpan(t){let e=t.attributes?.[ht];if(!q.navigator&&!q.location&&!q.document)return;let n=cu();Rr(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 h9="cause",y9=5,b9="LinkedErrors",_9=((t={})=>{let e=t.limit||y9,n=t.key||h9;return{name:b9,preprocessEvent(r,o,i){let a=i.getOptions();Ev(uu,a.stackParser,n,e,r,o)}}}),_y=_9;var v9=/^HTML(\w*)Element$/;function Tu(t){if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if($S(t)){let e=S9(t);if(v9.test(e))return`[HTMLElement: ${pe(t)}]`}}function S9(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function FN(){return E9()?(W&&fn(()=>{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 E9(){if(typeof q.window>"u")return!1;let t=q;if(t.nw||!(t.chrome||t.browser)?.runtime?.id)return!1;let n=Kn();return!(q===q.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function KS(t){return[Df(),Of(),Mv(),my(),py(),yy(),_y(),Lf(),by(),hy(),gy()]}function XS(t={}){let e=!t.skipBrowserExtensionCheck&&FN(),n=t.defaultIntegrations==null?KS():t.defaultIntegrations,r={...t,enabled:e?!1:t.enabled,stackParser:Zm(t.stackParser||dy),integrations:th({integrations:t.integrations,defaultIntegrations:n}),transport:t.transport||Su};return _c(Tu),fv(fu,r)}function HN(){}function GN(t){t()}function Qf(t={}){let e=q.document,n=e?.head||e?.body;if(!n){W&&w.error("[showReportDialog] Global document not defined");return}let r=rt(),i=P()?.getDsn();if(!i){W&&w.error("[showReportDialog] DSN not configured");return}let a={...t,user:{...r.getUser(),...t.user},eventId:t.eventId||Dc()},s=q.document.createElement("script");s.async=!0,s.crossOrigin="anonymous",s.src=J0(i,a);let{onLoad:l,onClose:c}=a;if(l&&(s.onload=l),c){let d=u=>{if(u.data==="__sentry_reportdialog_closed__")try{c()}finally{q.removeEventListener("message",d)}};q.addEventListener("message",d)}n.appendChild(s)}var T9=tt,w9="ReportingObserver",$N=new WeakMap,x9=((t={})=>{let e=t.types||["crash","deprecation","intervention"];function n(r){if($N.has(P()))for(let o of r)Oe(i=>{i.setExtra("url",o.url);let a=`ReportingObserver [${o.type}]`,s="No details available";if(o.body){let l={};for(let c in o.body)l[c]=o.body[c];if(i.setExtra("body",l),o.type==="crash"){let c=o.body;s=[c.crashId||"",c.reason||""].join(" ").trim()||s}else s=o.body.message||s}Da(`${a}: ${s}`)})}return{name:w9,setupOnce(){if(!Oh())return;new T9.ReportingObserver(n,{buffered:!0,types:e}).observe()},setup(r){$N.set(r,!0)}}}),jN=x9;var A9="HttpClient",I9=((t={})=>{let e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...t};return{name:A9,setup(n){D9(n,e),L9(n,e)}}}),VN=I9;function k9(t,e,n,r,o){if(YN(t,n.status,n.url)){let i=U9(e,r),a,s,l,c,d=KN();if(d.requestHeaders!==!1&&(a=za(qN(i.headers),d.requestHeaders)),d.responseHeaders!==!1&&(s=za(qN(n.headers),d.responseHeaders)),d.cookies!==!1){let p=i.headers.get("Cookie")||void 0;if(p){let m=Cf(p,d.cookies);typeof m=="object"&&(l=m)}let f=n.headers.get("Set-Cookie")||void 0;if(f){let m=Cf(f,d.cookies);typeof m=="object"&&(c=m)}}let u=WN({url:i.url,method:i.method,status:n.status,requestHeaders:a,responseHeaders:s,requestCookies:l,responseCookies:c,error:o,type:"fetch"});Jr(u)}}function R9(t,e,n,r,o){if(YN(t,e.status,e.responseURL)){let i,a,s,l=KN();if(l.cookies!==!1)try{let d=e.getResponseHeader("Set-Cookie")||e.getResponseHeader("set-cookie")||void 0;if(d){let u=Cf(d,l.cookies);typeof u=="object"&&(a=u)}}catch{}if(l.responseHeaders!==!1)try{s=za(C9(e),l.responseHeaders)}catch{}l.requestHeaders!==!1&&(i=za(r,l.requestHeaders));let c=WN({url:e.responseURL,method:n,status:e.status,requestHeaders:i,responseHeaders:s,responseCookies:a,error:o,type:"xhr"});Jr(c)}}function N9(t){if(t){let e=t["Content-Length"]||t["content-length"];if(e)return parseInt(e,10)}}function qN(t){let e={};return t.forEach((n,r)=>{e[r]=n}),e}function C9(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 M9(t,e){return t.some(n=>typeof n=="string"?e.includes(n):n.test(e))}function O9(t,e){return t.some(n=>typeof n=="number"?n===e:e>=n[0]&&e<=n[1])}function D9(t,e){ou()&&hi(n=>{if(P()!==t)return;let{response:r,args:o,error:i,virtualError:a}=n,[s,l]=o;r&&k9(e,s,r,l,i||a)},!1)}function L9(t,e){"XMLHttpRequest"in tt&&_l(n=>{if(P()!==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{R9(e,i,s,l,r||o)}catch(c){W&&w.warn("Error while extracting response event form XHR response",c)}})}function YN(t,e,n){return O9(t.failedRequestStatusCodes,e)&&M9(t.failedRequestTargets,n)&&!$c(n,P())}function WN(t){let e=P(),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:N9(t.responseHeaders)}}};return En(i,{type:`auto.http.client.${t.type}`,handled:!1}),i}function U9(t,e){return!e&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,e)}function KN(){let t=P();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 JS=tt,B9=7,P9="ContextLines",z9=((t={})=>({name:P9,processEvent(e,n,r){let o=t.frameContextLines??r?.getDataCollectionOptions().frameContextLines??B9;return F9(e,o)}})),XN=z9;function F9(t,e){let n=JS.document,r=JS.location&&Gc(JS.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=>H9(c,a,r,e)))}),t}function H9(t,e,n,r){return t.filename!==n||!t.lineno||!e.length||rg(e,t,r),t}var G9="GraphQLClient",$9=(t=>({name:G9,setup(e){j9(e,t),q9(e,t)}}));function j9(t,e){t.on("beforeOutgoingRequestSpan",(n,r)=>{let i=et(n).data||{};if(!(i[ht]==="http.client"))return;let l=i[wc]||i["http.url"]||i.url,c=i[vg]||i["http.method"];if(!mn(l)||!mn(c))return;let{endpoints:d}=e,u=tn(l,d),p=QN(r);if(u&&p){let f=ZN(p);if(f){let m=JN(f);n.updateName(`${c} ${l} (${m})`),Sy(f)&&n.setAttribute("graphql.document",f.query),Ey(f)&&(n.setAttribute("graphql.persisted_query.hash.sha256",f.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",f.extensions.persistedQuery.version))}}})}function q9(t,e){t.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{let{category:o,type:i,data:a}=n;if(i==="http"&&(o==="fetch"||o==="xhr")){let d=a?.url,{endpoints:u}=e,p=tn(d,u),f=QN(r);if(p&&a&&f){let m=ZN(f);if(!a.graphql&&m){let _=JN(m);a["graphql.operation"]=_,Sy(m)&&(a["graphql.document"]=m.query),Ey(m)&&(a["graphql.persisted_query.hash.sha256"]=m.extensions.persistedQuery.sha256Hash,a["graphql.persisted_query.version"]=m.extensions.persistedQuery.version)}}}})}function JN(t){if(Ey(t))return`persisted ${t.operationName}`;if(Sy(t)){let{query:e,operationName:n}=t,{operationName:r=n,operationType:o}=V9(e);return r?`${o} ${r}`:`${o}`}return"unknown"}function QN(t){let e="xhr"in t,n;if(e){let r=t.xhr[tr];n=r&&vl(r.body)[0]}else{let r=vu(t.input);n=vl(r)[0]}return n}function V9(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 vy(t){return typeof t=="object"&&t!==null}function Sy(t){return vy(t)&&typeof t.query=="string"}function Ey(t){return vy(t)&&typeof t.operationName=="string"&&vy(t.extensions)&&vy(t.extensions.persistedQuery)&&typeof t.extensions.persistedQuery.sha256Hash=="string"&&typeof t.extensions.persistedQuery.version=="number"}function ZN(t){try{let e=JSON.parse(t);return Sy(e)||Ey(e)?e:void 0}catch{return}}var tC=$9;var eC=(t={})=>{let e=["script"];function n(r,o,i=0){if(!r)return;let a="shadowRoot"in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(let s of a){if(!(s instanceof HTMLElement))continue;let l=Va(s,1)||void 0,c=s.tagName.toLowerCase();if(e.includes(c))continue;let d=t.onElement?.({element:s,componentName:l,tagName:c,depth:i})||{};if(d==="skip")continue;if(d==="children"){n(s,o,i+1);continue}let{x:u,y:p,width:f,height:m}=s.getBoundingClientRect(),_={identifier:s.id||void 0,type:l||c,visible:!0,alpha:1,height:m,width:f,x:u,y:p,...d},v=[];_.children=v,n(s,_.children,i+1),o.push(_)}}return{name:"ViewHierarchy",processEvent:(r,o)=>{if(r.type!==void 0||t.shouldAttach?.(r,o)===!1)return r;let i={rendering_system:"DOM",positioning:"absolute",windows:[]};n(t.rootElement?.()||q.document.body,i.windows);let a={filename:"view-hierarchy.json",attachmentType:"event.view_hierarchy",contentType:"application/json",data:JSON.stringify(i)};return o.attachments=o.attachments||[],o.attachments.push(a),r}}};var we=tt,IE="sentryReplaySession",Y9="replay_event",kE="Unable to send Replay",W9=3e5,K9=9e5,X9=5e3,J9=5500,Q9=6e4,Z9=5e3,tG=3,nC=15e4,Ty=5e3,eG=3e3,nG=300,RE=2e7,rG=4999,oG=5e4,rC=36e5,iG=Object.defineProperty,aG=(t,e,n)=>e in t?iG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oC=(t,e,n)=>aG(t,typeof e!="symbol"?e+"":e,n),rn=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(rn||{});function sG(t){return t.nodeType===t.ELEMENT_NODE}function ep(t){return t?.host?.shadowRoot===t}function np(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function lG(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 cG(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 ky(t){try{let e=t.rules||t.cssRules;return e?lG(Array.from(e,kC).join("")):null}catch{return null}}function uG(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 kC(t){let e;if(fG(t))try{e=ky(t.styleSheet)||cG(t)}catch{}else if(pG(t)){let n=t.cssText,r=t.selectorText.includes(":"),o=typeof t.style.all=="string"&&t.style.all;if(o&&(n=uG(t)),r&&(n=dG(n)),r||o)return n}return e||t.cssText}function dG(t){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function fG(t){return"styleSheet"in t}function pG(t){return"selectorText"in t}var Ry=class{constructor(){oC(this,"idNodeMap",new Map),oC(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 mG(){return new Ry}function $y({maskInputOptions:t,tagName:e,type:n}){return e==="OPTION"&&(e="SELECT"),!!(t[e.toLowerCase()]||n&&t[n]||n==="password"||e==="INPUT"&&!n&&t.text)}function op({isMasked:t,element:e,value:n,maskInputFn:r}){let o=n||"";return t?(r&&(o=r(o,e)),"*".repeat(o.length)):o}function Cu(t){return t.toLowerCase()}function rE(t){return t.toUpperCase()}var iC="__rrweb_original__";function gG(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=iC in i?i[iC]: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 NE(t){let e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Cu(e):null}function Ny(t,e,n){return e==="INPUT"&&(n==="radio"||n==="checkbox")?t.getAttribute("value")||"":t.value}function RC(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 aC={};function NC(t){let e=aC[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 aC[t]=r.bind(window)}function oE(...t){return NC("setTimeout")(...t)}function CC(...t){return NC("clearTimeout")(...t)}function MC(t){try{return t.contentDocument}catch{}}function hG(t){try{return t.contentWindow}catch{}}var yG=1,bG=new RegExp("[^a-z0-9-_:]"),ip=-2;function CE(){return yG++}function _G(t){if(t instanceof HTMLFormElement)return"form";let e=Cu(t.tagName);return bG.test(e)?"div":e}function vG(t){let e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var wu,sC,SG=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,EG=/^(?:[a-z+]+:)?\/\//i,TG=/^www\..*/i,wG=/^(data:)([^,]*),(.*)/i;function xG(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 Cy(t,e){return(t||"").replace(SG,(n,r,o,i,a,s)=>{let l=o||a||s,c=r||i||"";if(!l)return n;if(EG.test(l)||TG.test(l))return`url(${c}${l}${c})`;if(wG.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${vG(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 AG=/^[^ \t\n\r\u000c]+/,IG=/^[, \t\n\r\u000c]+/;function kG(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(IG),!(n>=e.length);){let i=r(AG);if(i.slice(-1)===",")i=Iu(t,i.substring(0,i.length-1)),o.push(i);else{let a="";i=Iu(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 lC=new WeakMap;function Iu(t,e){return!e||e.trim()===""?e:jy(t,e)}function RG(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function jy(t,e){let n=lC.get(t);if(n||(n=t.createElement("a"),lC.set(t,n)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return n.setAttribute("href",e),n.href}function OC(t,e,n,r,o,i,a){if(!r)return r;if(n==="src"||n==="href"&&!(e==="use"&&r[0]==="#"))return Iu(t,r);if(n==="xlink:href"&&r[0]!=="#")return Iu(t,r);if(n==="background"&&(e==="table"||e==="td"||e==="th"))return Iu(t,r);if(n==="srcset")return kG(t,r);if(n==="style"){let s=Cy(r,jy(t));return a&&a.size>0&&(s=xG(s,a)),s}else if(e==="object"&&n==="data")return Iu(t,r);return typeof i=="function"?i(n,r,o):r}function DC(t,e,n){return(t==="video"||t==="audio")&&e==="autoplay"}function NG(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 CG(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 ku(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(CG(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}function Mu(t,e,n,r,o,i){try{let a=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(a===null)return!1;if(a.tagName==="INPUT"){let c=a.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let s=-1,l=-1;if(i){if(l=Sl(a,ku(r,o)),l<0)return!0;s=Sl(a,ku(e,n),l>=0?l:1/0)}else{if(s=Sl(a,ku(e,n)),s<0)return!1;l=Sl(a,ku(r,o),s>=0?s:1/0)}return s>=0?l>=0?s<=l:!0:l>=0?!1:!!i}catch{}return!!i}function MG(t,e,n){let r=hG(t);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let s=oE(()=>{o||(e(),o=!0)},n);t.addEventListener("load",()=>{CC(s),o=!0,e()});return}let a="about:blank";if(r.location.href!==a||t.src===a||t.src==="")return oE(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}function OG(t,e,n){let r=!1,o;try{o=t.sheet}catch{o=null}if(o)return;let i=oE(()=>{r||(e(),r=!0)},n);t.addEventListener("load",()=>{CC(i),r=!0,e()})}function DG(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=LG(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:rn.Document,childNodes:[],compatMode:t.compatMode}:{type:rn.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:rn.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:I};case t.ELEMENT_NODE:return BG(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 UG(t,{doc:n,maskAllText:s,maskTextClass:c,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:p,maskTextFn:_,maskInputOptions:m,maskInputFn:v,rootId:I});case t.CDATA_SECTION_NODE:return{type:rn.CDATA,textContent:"",rootId:I};case t.COMMENT_NODE:return{type:rn.Comment,textContent:t.textContent||"",rootId:I};default:return!1}}function LG(t,e){if(!e.hasNode(t))return;let n=e.getId(t);return n===1?void 0:n}function UG(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=ky(t.parentNode.sheet))}catch(h){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${h}`,t)}p=Cy(p,jy(e.doc))}m&&(p="SCRIPT_PLACEHOLDER");let v=Mu(t,r,i,o,a,n);if(!f&&!m&&!_&&p&&v&&(p=s?s(p,t.parentElement):p.replace(/[\S]/g,"*")),_&&p&&(l.textarea||v)&&(p=c?c(p,t.parentNode):p.replace(/[\S]/g,"*")),u==="OPTION"&&p){let h=$y({type:null,tagName:u,maskInputOptions:l});p=op({isMasked:Mu(t,r,i,o,a,h),element:t,value:p,maskInputFn:c})}return{type:rn.Text,textContent:p||"",isStyle:f,rootId:d}}function BG(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=NG(t,r,o,i),C=_G(t),I={},D=t.attributes.length;for(let U=0;U<D;U++){let O=t.attributes[U];O.name&&!DC(C,O.name,O.value)&&(I[O.name]=OC(n,C,Cu(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=ky(U)),O&&(I.rel=null,I.href=null,I.crossorigin=null,I._cssText=Cy(O,U.href))}if(C==="style"&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){let U=ky(t.sheet);U&&(I._cssText=Cy(U,jy(n)))}if(C==="input"||C==="textarea"||C==="select"||C==="option"){let U=t,O=NE(U),N=Ny(U,rE(C),O),B=U.checked;if(O!=="submit"&&O!=="button"&&N){let V=Mu(U,v,b,h,S,$y({type:O,tagName:rE(C),maskInputOptions:s}));I.value=op({isMasked:V,element:U,value:N,maskInputFn:c})}B&&(I.checked=B)}if(C==="option"&&(t.selected&&!s.select?I.selected=!0:delete I.selected),C==="canvas"&&p){if(t.__context==="2d")gG(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){wu||(wu=n.createElement("canvas"),sC=wu.getContext("2d"));let U=t,O=U.currentSrc||U.getAttribute("src")||"<unknown-src>",N=U.crossOrigin,B=()=>{U.removeEventListener("load",B);try{wu.width=U.naturalWidth,wu.height=U.naturalHeight,sC.drawImage(U,0,0),I.rr_dataURL=wu.toDataURL(d.type,d.quality)}catch(V){if(U.crossOrigin!=="anonymous"){U.crossOrigin="anonymous",U.complete&&U.naturalWidth!==0?B():U.addEventListener("load",B);return}else console.warn(`Cannot inline img src=${O}! Error: ${V}`)}U.crossOrigin==="anonymous"&&(N?I.crossOrigin=N:U.removeAttribute("crossorigin"))};U.complete&&U.naturalWidth!==0?B():U.addEventListener("load",B)}if((C==="audio"||C==="video")&&(I.rr_mediaState=t.paused?"paused":"played",I.rr_mediaCurrentTime=t.currentTime),m||(t.scrollLeft&&(I.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(I.rr_scrollTop=t.scrollTop)),R){let{width:U,height:O}=t.getBoundingClientRect();I={class:I.class,rr_width:`${U}px`,rr_height:`${O}px`}}C==="iframe"&&!f(I.src)&&(!R&&!MC(t)&&(I.rr_src=I.src),delete I.src);let z;try{customElements.get(C)&&(z=!0)}catch{}return{type:rn.Element,tagName:C,attributes:I,childNodes:[],isSVG:RG(t)||void 0,needBlock:R,rootId:_,isCustom:z}}function Te(t){return t==null?"":t.toLowerCase()}function PG(t,e){if(e.comment&&t.type===rn.Comment)return!0;if(t.type===rn.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&RC(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(Te(t.attributes.name).match(/^msapplication-tile(image|color)$/)||Te(t.attributes.name)==="application-name"||Te(t.attributes.rel)==="icon"||Te(t.attributes.rel)==="apple-touch-icon"||Te(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&Te(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Te(t.attributes.property).match(/^(og|twitter|fb):/)||Te(t.attributes.name).match(/^(og|twitter):/)||Te(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(Te(t.attributes.name)==="robots"||Te(t.attributes.name)==="googlebot"||Te(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(Te(t.attributes.name)==="author"||Te(t.attributes.name)==="generator"||Te(t.attributes.name)==="framework"||Te(t.attributes.name)==="publisher"||Te(t.attributes.name)==="progid"||Te(t.attributes.property).match(/^article:/)||Te(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(Te(t.attributes.name)==="google-site-verification"||Te(t.attributes.name)==="yandex-verification"||Te(t.attributes.name)==="csrf-token"||Te(t.attributes.name)==="p:domain_verify"||Te(t.attributes.name)==="verify-v1"||Te(t.attributes.name)==="verification"||Te(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ru(t,e){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:p=!1,inlineStylesheet:f=!0,maskInputOptions:m={},maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:b,dataURLOptions:S={},inlineImages:E=!1,recordCanvas:R=!1,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:D=5e3,onBlockedImageLoad:z,onStylesheetLoad:U,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:B=!1,ignoreCSSAttributes:V}=e,{preserveWhiteSpace:st=!0}=e,nt=DG(t,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:s,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,dataURLOptions:S,inlineImages:E,recordCanvas:R,keepIframeSrcFn:N,newlyAddedElement:B,ignoreCSSAttributes:V});if(!nt)return console.warn(t,"not serialized"),null;let lt;r.hasNode(t)?lt=r.getId(t):PG(nt,b)||!st&&nt.type===rn.Text&&!nt.isStyle&&!nt.textContent.trim().length?lt=ip:lt=CE();let X=Object.assign(nt,{id:lt});if(r.add(t,X),lt===ip)return null;C&&C(t);let ct=!p;if(X.type===rn.Element){ct=ct&&!X.needBlock;let F=t.shadowRoot;F&&np(F)&&(X.isShadowHost=!0)}if((X.type===rn.Document||X.type===rn.Element)&&ct){b.headWhitespace&&X.type===rn.Element&&X.tagName==="head"&&(st=!1);let F={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:s,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:p,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:b,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:st,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:D,onBlockedImageLoad:z,onStylesheetLoad:U,stylesheetLoadTimeout:O,keepIframeSrcFn:N,ignoreCSSAttributes:V},gt=t.childNodes?Array.from(t.childNodes):[];for(let Q of gt){let dt=Ru(Q,F);dt&&X.childNodes.push(dt)}if(sG(t)&&t.shadowRoot)for(let Q of Array.from(t.shadowRoot.childNodes)){let dt=Ru(Q,F);dt&&(np(t.shadowRoot)&&(dt.isShadow=!0),X.childNodes.push(dt))}}if(t.parentNode&&ep(t.parentNode)&&np(t.parentNode)&&(X.isShadow=!0),X.type===rn.Element&&X.tagName==="iframe"&&!X.needBlock&&MG(t,()=>{let F=MC(t);if(F&&I){let gt=Ru(F,{doc:F,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:b,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:st,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:D,onStylesheetLoad:U,stylesheetLoadTimeout:O,keepIframeSrcFn:N,ignoreCSSAttributes:V});gt&&I(t,gt)}},D),X.type===rn.Element&&X.tagName==="img"&&!t.complete&&X.needBlock){let F=t,gt=()=>{if(F.isConnected&&!F.complete&&z)try{let Q=F.getBoundingClientRect();Q.width>0&&Q.height>0&&z(F,X,Q)}catch{}F.removeEventListener("load",gt)};F.isConnected&&F.addEventListener("load",gt)}return X.type===rn.Element&&X.tagName==="link"&&typeof X.attributes.rel=="string"&&(X.attributes.rel==="stylesheet"||X.attributes.rel==="preload"&&typeof X.attributes.href=="string"&&RC(X.attributes.href)==="css")&&OG(t,()=>{if(U){let F=Ru(t,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions:b,dataURLOptions:S,inlineImages:E,recordCanvas:R,preserveWhiteSpace:st,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:D,onStylesheetLoad:U,stylesheetLoadTimeout:O,keepIframeSrcFn:N,ignoreCSSAttributes:V});F&&U(t,F)}},O),X.type===rn.Element&&delete X.needBlock,X}function zG(t,e){let{mirror:n=new Ry,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:D,onStylesheetLoad:z,stylesheetLoadTimeout:U,keepIframeSrcFn:O=()=>!1,ignoreCSSAttributes:N=new Set([])}=e||{};return Ru(t,{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:a,maskTextClass:s,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:u,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:_,maskTextFn:v,maskInputFn:h,slimDOMOptions: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:D,onStylesheetLoad:z,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 xu=`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.`,cC={map:{},getId(){return console.error(xu),-1},getNode(){return console.error(xu),null},removeNodeFromMap(){console.error(xu)},has(){return console.error(xu),!1},reset(){console.error(xu)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(cC=new Proxy(cC,{get(t,e,n){return e==="map"&&console.error(xu),Reflect.get(t,e,n)}}));function ap(t,e,n={}){let r=null,o=0;return function(...i){let a=Date.now();!o&&n.leading===!1&&(o=a);let s=e-(a-o),l=this;s<=0||s>e?(r&&(qG(r),r=null),o=a,t.apply(l,i)):!r&&n.trailing!==!1&&(r=qy(()=>{o=n.leading===!1?0:Date.now(),r=null,t.apply(l,i)},s))}}function LC(t,e,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(a){qy(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>LC(t,e,i||{},!0)}function ME(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 My=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(My=()=>new Date().getTime());function UC(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 BC(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function PC(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zC(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function Lr(t,e,n,r,o){if(!t)return!1;let i=zC(t);if(!i)return!1;let a=ku(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,ku(null,r))),s>-1&&l<0?!0:s<l)}function FG(t,e){return e.getId(t)!==-1}function QS(t,e){return e.getId(t)===ip}function FC(t,e){if(ep(t))return!1;let n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?FC(t.parentNode,e):!0:!0}function iE(t){return!!t.changedTouches}function HG(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 HC(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function GC(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function aE(t){return!!t?.shadowRoot}var sE=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 $C(t){let e=null;return t.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(e=t.getRootNode().host),e}function GG(t){let e=t,n;for(;n=$C(e);)e=n;return e}function $G(t){let e=t.ownerDocument;if(!e)return!1;let n=GG(t);return e.contains(n)}function jC(t){let e=t.ownerDocument;return e?e.contains(t)||$G(t):!1}var uC={};function OE(t){let e=uC[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 uC[t]=r.bind(window)}function jG(...t){return OE("requestAnimationFrame")(...t)}function qy(...t){return OE("setTimeout")(...t)}function qG(...t){return OE("clearTimeout")(...t)}var $t=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))($t||{}),Rt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Rt||{}),er=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(er||{}),Ki=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Ki||{}),Au=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Au||{}),rp;function VG(t){rp=t}function YG(){rp=void 0}var ee=t=>rp?((...n)=>{try{return t(...n)}catch(r){if(rp&&rp(r)===!0)return()=>{};throw r}}):t,dC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",WG=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Zf=0;Zf<dC.length;Zf++)WG[dC.charCodeAt(Zf)]=Zf;var Zf,Oy=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function DE(t){try{return t.contentDocument}catch{}}function sp(t){try{return t.contentWindow}catch{}}var lE=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 fC(t){return"__ln"in t}var cE=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&&fC(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&&fC(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--)}},pC=(t,e)=>`${t}@${e}`,uE=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 cE,o=l=>{let c=l,d=ip;for(;d===ip;)c=c&&c.nextSibling,d=c&&this.mirror.getId(c);return d},i=l=>{if(!l.parentNode||!jC(l))return;let c=ep(l.parentNode)?this.mirror.getId($C(l)):this.mirror.getId(l.parentNode),d=o(l);if(c===-1||d===-1)return r.addNode(l);let u=Ru(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{HC(p,this.mirror)&&!Lr(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),GC(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),aE(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,f)=>{if(Lr(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,f);let m=sp(p);m&&this.canvasManager.addWindow(m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,f)=>{this.stylesheetManager.attachLinkElement(p,f)},onBlockedImageLoad:(p,f,{width:m,height:_})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:f.id,attributes:{style:{width:`${m}px`,height:`${_}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});u&&(e.push({parentId:c,nextId:d,node:u}),n.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)mC(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(let l of this.addedSet)!gC(this.droppedSet,l)&&!mC(this.removes,l,this.mirror)||gC(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(!QS(e.target,this.mirror))switch(e.type){case"characterData":{let n=e.target.textContent;!Lr(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Mu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,zC(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=NE(n),s=n.tagName;o=Ny(n,s,a);let l=$y({maskInputOptions:this.maskInputOptions,tagName:s,type:a}),c=Mu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=op({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(Lr(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(!DE(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"),!DC(n.tagName,r)&&(i.attributes[r]=OC(this.doc,Cu(n.tagName),Cu(r),o,n,this.maskAttributeFn),r==="style")){let a=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(let s of Array.from(n.style)){let l=n.style.getPropertyValue(s),c=n.style.getPropertyPriority(s);l!==(a?.getPropertyValue(s)||"")||c!==(a?.getPropertyPriority(s)||"")?c===""?i.styleDiff[s]=l:i.styleDiff[s]=[l,c]:i._unchangedStyles[s]=[l,c]}if(a)for(let s of Array.from(a))n.style.getPropertyValue(s)===""&&(i.styleDiff[s]=!1)}break}case"childList":{if(Lr(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=ep(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Lr(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||QS(n,this.mirror)||!FG(n,this.mirror)||(this.addedSet.has(n)?(dE(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||FC(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[pC(r,o)]?dE(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:ep(e.target)&&np(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(QS(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[pC(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Lr(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(r=>this.genAdds(r)),aE(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 lE(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 dE(t,e){t.delete(e),e.childNodes?.forEach(n=>dE(t,n))}function mC(t,e,n){return t.length===0?!1:KG(t,e,n)}function KG(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 gC(t,e){return t.size===0?!1:qC(t,e)}function qC(t,e){let{parentNode:n}=e;return n?t.has(n)?!0:qC(t,n):!1}var Nu=[];function fp(t){try{if("composedPath"in t){let e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function VC(t,e){let n=new uE;Nu.push(n),n.init(t);let r=window.MutationObserver||window.__rrMutationObserver,o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);let i=new r(ee(a=>{t.onMutation&&t.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function XG({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};let o=typeof e.mousemove=="number"?e.mousemove:50,i=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,a=[],s,l=ap(ee(u=>{let p=Date.now()-s;t(a.map(f=>(f.timeOffset-=p,f)),u),a=[],s=null}),i),c=ee(ap(ee(u=>{let p=fp(u),{clientX:f,clientY:m}=iE(u)?u.changedTouches[0]:u;s||(s=My()),a.push({x:f,y:m,id:r.getId(p),timeOffset:My()-s}),l(typeof DragEvent<"u"&&u instanceof DragEvent?Rt.Drag:u instanceof MouseEvent?Rt.MouseMove:Rt.TouchMove)}),o,{trailing:!1})),d=[nr("mousemove",c,n),nr("touchmove",c,n),nr("drag",c,n)];return ee(()=>{d.forEach(u=>u())})}function JG({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};let s=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,l=[],c=null,d=u=>p=>{let f=fp(p);if(Lr(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 iE(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=iE(p)?p.changedTouches[0]:p;if(!v)return;let h=n.getId(f),{clientX:b,clientY:S}=v;ee(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=Cu(u),f=d(u);if(window.PointerEvent)switch(er[u]){case er.MouseDown:case er.MouseUp:p=p.replace("mouse","pointer");break;case er.TouchStart:case er.TouchEnd:return}l.push(nr(p,f,e))}),ee(()=>{l.forEach(u=>u())})}function YC({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:a}){let s=ee(ap(ee(l=>{let c=fp(l);if(!c||Lr(c,r,o,i,!0))return;let d=n.getId(c);if(c===e&&e.defaultView){let u=UC(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 QG({viewportResizeCb:t},{win:e}){let n=-1,r=-1,o=ee(ap(ee(()=>{let i=BC(),a=PC();(n!==i||r!==a)&&(t({width:Number(a),height:Number(i)}),n=i,r=a)}),200));return nr("resize",o,e)}var ZG=["INPUT","TEXTAREA","SELECT"],hC=new WeakMap;function t$({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 D=fp(I),z=I.isTrusted,U=D&&rE(D.tagName);if(U==="OPTION"&&(D=D.parentElement),!D||!U||ZG.indexOf(U)<0||Lr(D,r,o,i,!0))return;let O=D;if(O.classList.contains(a)||s&&O.matches(s))return;let N=NE(D),B=Ny(O,U,N),V=!1,st=$y({maskInputOptions:l,tagName:U,type:N}),nt=Mu(D,p,m,f,_,st);(N==="radio"||N==="checkbox")&&(V=D.checked),B=op({isMasked:nt,element:D,value:B,maskInputFn:c}),h(D,u?{text:B,isChecked:V,userTriggered:z}:{text:B,isChecked:V});let lt=D.name;N==="radio"&&lt&&V&&e.querySelectorAll(`input[type="radio"][name="${lt}"]`).forEach(X=>{if(X!==D){let ct=op({isMasked:nt,element:X,value:Ny(X,U,N),maskInputFn:c});h(X,u?{text:ct,isChecked:!V,userTriggered:!1}:{text:ct,isChecked:!V})}})}function h(I,D){let z=hC.get(I);if(!z||z.text!==D.text||z.isChecked!==D.isChecked){hC.set(I,D);let U=n.getId(I);ee(t)({...D,id:U})}}let S=(d.input==="last"?["change"]:["input","change"]).map(I=>nr(I,ee(v),e)),E=e.defaultView;if(!E)return()=>{S.forEach(I=>I())};let R=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),C=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return R&&R.set&&S.push(...C.map(I=>LC(I[0],I[1],{set(){ee(v)({target:this,isTrusted:!1})}},!1,E))),ee(()=>{S.forEach(I=>I())})}function Dy(t){let e=[];function n(r,o){if(wy("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||wy("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||wy("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||wy("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 e$({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:ee((d,u,p)=>{let[f,m]=p,{id:_,styleId:v}=Ja(u,e,n.styleMirror);return(_&&_!==-1||v&&v!==-1)&&t({id:_,styleId:v,adds:[{rule:f,index:m}]}),d.apply(u,p)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:ee((d,u,p)=>{let[f]=p,{id:m,styleId:_}=Ja(u,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,removes:[{index:f}]}),d.apply(u,p)})});let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:ee((d,u,p)=>{let[f]=p,{id:m,styleId:_}=Ja(u,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,replace:f}),d.apply(u,p)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:ee((d,u,p)=>{let[f]=p,{id:m,styleId:_}=Ja(u,e,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&t({id:m,styleId:_,replaceSync:f}),d.apply(u,p)})}));let l={};xy("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(xy("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),xy("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),xy("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(l).forEach(([d,u])=>{c[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=new Proxy(c[d].insertRule,{apply:ee((p,f,m)=>{let[_,v]=m,{id:h,styleId:b}=Ja(f.parentStyleSheet,e,n.styleMirror);return(h&&h!==-1||b&&b!==-1)&&t({id:h,styleId:b,adds:[{rule:_,index:[...Dy(f),v||0]}]}),p.apply(f,m)})}),u.prototype.deleteRule=new Proxy(c[d].deleteRule,{apply:ee((p,f,m)=>{let[_]=m,{id:v,styleId:h}=Ja(f.parentStyleSheet,e,n.styleMirror);return(v&&v!==-1||h&&h!==-1)&&t({id:v,styleId:h,removes:[{index:[...Dy(f),_]}]}),p.apply(f,m)})})}),ee(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(l).forEach(([d,u])=>{u.prototype.insertRule=c[d].insertRule,u.prototype.deleteRule=c[d].deleteRule})})}function WC({mirror:t,stylesheetManager:e},n){let r=null;n.nodeName==="#document"?r=t.getId(n):r=t.getId(n.host);let o=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(a){let s=i.set?.call(this,a);if(r!==null&&r!==-1)try{e.adoptStyleSheets(a,r)}catch{}return s}}),ee(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function n$({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:ee((s,l,c)=>{let[d,u,p]=c;if(n.has(d))return i.apply(l,[d,u,p]);let{id:f,styleId:m}=Ja(l.parentRule?.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&t({id:f,styleId:m,set:{property:d,value:u,priority:p},index:Dy(l.parentRule)}),s.apply(l,c)})});let a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:ee((s,l,c)=>{let[d]=c;if(n.has(d))return a.apply(l,[d]);let{id:u,styleId:p}=Ja(l.parentRule?.parentStyleSheet,e,r.styleMirror);return(u&&u!==-1||p&&p!==-1)&&t({id:u,styleId:p,remove:{property:d},index:Dy(l.parentRule)}),s.apply(l,c)})}),ee(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a})}function r$({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:a}){let s=ee(c=>ap(ee(d=>{let u=fp(d);if(!u||Lr(u,e,n,r,!0))return;let{currentTime:p,volume:f,muted:m,playbackRate:_}=u;t({type:c,id:o.getId(u),currentTime:p,volume:f,muted:m,playbackRate:_})}),i.media||500)),l=[nr("play",s(Au.Play),a),nr("pause",s(Au.Pause),a),nr("seeked",s(Au.Seeked),a),nr("volumechange",s(Au.VolumeChange),a),nr("ratechange",s(Au.RateChange),a)];return ee(()=>{l.forEach(c=>c())})}function o$({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=ME(e.fonts,"add",function(s){return function(l){return qy(ee(()=>{let c=o.get(l);c&&(t(c),o.delete(l))}),0),s.apply(this,[l])}});return r.push(()=>{n.FontFace=i}),r.push(a),ee(()=>{r.forEach(s=>s())})}function i$(t){let{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:a}=t,s=!0,l=ee(()=>{let c=e.getSelection();if(!c||s&&c?.isCollapsed)return;s=c.isCollapsed||!1;let d=[],u=c.rangeCount||0;for(let p=0;p<u;p++){let f=c.getRangeAt(p),{startContainer:m,startOffset:_,endContainer:v,endOffset:h}=f;Lr(m,r,o,i,!0)||Lr(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 a$({doc:t,customElementCb:e}){let n=t.defaultView;return!n||!n.customElements?()=>{}:ME(n.customElements,"define",function(o){return function(i,a,s){try{e({define:{name:i}})}catch{}return o.apply(this,[i,a,s])}})}function s$(t,e={}){let n=t.doc.defaultView;if(!n)return()=>{};let r;t.recordDOM&&(r=VC(t,t.doc));let o=XG(t),i=JG(t),a=YC(t),s=QG(t,{win:n}),l=t$(t),c=r$(t),d=()=>{},u=()=>{},p=()=>{},f=()=>{};t.recordDOM&&(d=e$(t,{win:n}),u=WC(t,t.doc),p=n$(t,{win:n}),t.collectFonts&&(f=o$(t)));let m=i$(t),_=a$(t),v=[];for(let h of t.plugins)v.push(h.observer(h.callback,n,h.options));return ee(()=>{Nu.forEach(h=>h.reset()),r?.disconnect(),o(),i(),a(),s(),l(),c(),d(),u(),p(),f(),m(),_(),v.forEach(h=>h())})}function wy(t){return typeof window[t]<"u"}function xy(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var lp=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,n,r,o){let i=r||this.getIdToRemoteIdMap(e),a=o||this.getRemoteIdToIdMap(e),s=i.get(n);return s||(s=this.generateIdFn(),i.set(n,s),a.set(s,n)),s}getIds(e,n){let r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return n.map(i=>this.getId(e,i,r,o))}getRemoteId(e,n,r){let o=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(e,n){let r=this.getRemoteIdToIdMap(e);return n.map(o=>this.getRemoteId(e,o,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}},fE=class{constructor(){this.crossOriginIframeMirror=new lp(CE),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},pE=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new lp(CE),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new lp(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);let n=sp(e);n&&this.crossOriginIframeMap.set(n,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&sp(e)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(e);let r=DE(e);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(e){let n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;let o=this.crossOriginIframeMap.get(e.source);if(!o)return;let i=this.transformCrossOriginEvent(o,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(e,n){switch(n.type){case $t.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);let r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:$t.IncrementalSnapshot,data:{source:Rt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $t.Meta:case $t.Load:case $t.DomContentLoaded:return!1;case $t.Plugin:return n;case $t.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case $t.IncrementalSnapshot:switch(n.data.source){case Rt.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);let o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Rt.Drag:case Rt.TouchMove:case Rt.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),n;case Rt.ViewportResize:return!1;case Rt.MediaInteraction:case Rt.MouseInteraction:case Rt.Scroll:case Rt.CanvasMutation:case Rt.Input:return this.replaceIds(n.data,e,["id"]),n;case Rt.StyleSheetRule:case Rt.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case Rt.Font:return n;case Rt.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),n;case Rt.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,e,["styleId"])}),n}}return!1}replace(e,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=e.getIds(r,n[i]):n[i]=e.getId(r,n[i]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==rn.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},mE=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},gE=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!np(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let r=VC({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(YC({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),qy(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(WC({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){let n=DE(e),r=sp(e);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(e,n){let r=this;this.restoreHandlers.push(ME(e.prototype,"attachShadow",function(o){return function(i){let a=o.call(this,i);return this.shadowRoot&&jC(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()}},hE=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new sE,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:kC(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){}},yE=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,jG(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}},qe,Ly;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=mG();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:D={},mousemoveWait:z,recordDOM:U=!0,recordCanvas:O=!1,recordCrossOriginIframes:N=!1,recordAfter:B=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:V=!1,collectFonts:st=!1,inlineImages:nt=!1,plugins:lt,keepIframeSrcFn:X=()=>!1,ignoreCSSAttributes:ct=new Set([]),errorHandler:F,onMutation:gt,getCanvasManager:Q}=t;VG(F);let dt=N?window.parent===window:!0,Xt=!1;if(!dt)try{window.parent.document&&(Xt=!1)}catch{Xt=!0}if(dt&&!e)throw new Error("emit function is required");if(!dt&&!Xt)return()=>{};z!==void 0&&I.mousemove===void 0&&(I.mousemove=z),qo.reset();let Ce=_===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:v!==void 0?v:{},bn=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||{};HG();let Pn,Z=0,Vt=ut=>{for(let Ft of lt||[])Ft.eventProcessor&&(ut=Ft.eventProcessor(ut));return C&&!Xt&&(ut=C(ut)),ut};qe=(ut,Ft)=>{let bt=ut;if(bt.timestamp=My(),Nu[0]?.isFrozen()&&bt.type!==$t.FullSnapshot&&!(bt.type===$t.IncrementalSnapshot&&bt.data.source===Rt.Mutation)&&Nu.forEach(It=>It.unfreeze()),dt)e?.(Vt(bt),Ft);else if(Xt){let It={type:"rrweb",event:Vt(bt),origin:window.location.origin,isCheckout:Ft};window.parent.postMessage(It,"*")}if(bt.type===$t.FullSnapshot)Pn=bt,Z=0;else if(bt.type===$t.IncrementalSnapshot){if(bt.data.source===Rt.Mutation&&bt.data.isAttachIframe)return;Z++;let It=r&&Z>=r,yt=n&&Pn&&bt.timestamp-Pn.timestamp>n;(It||yt)&&un(!0)}};let Lt=ut=>{qe({type:$t.IncrementalSnapshot,data:{source:Rt.Mutation,...ut}})},ft=ut=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.Scroll,...ut}}),te=ut=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.CanvasMutation,...ut}}),mt=ut=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.AdoptedStyleSheet,...ut}}),oe=new hE({mutationCb:Lt,adoptedStyleSheetCb:mt}),Qt=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new fE:new pE({mirror:qo,mutationCb:Lt,stylesheetManager:oe,recordCrossOriginIframes:N,wrappedEmit:qe});for(let ut of lt||[])ut.getMirror&&ut.getMirror({nodeMirror:qo,crossOriginIframeMirror:Qt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Qt.crossOriginIframeStyleMirror});let cn=new yE,_n=c$(Q,{mirror:qo,win:window,mutationCb:ut=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.CanvasMutation,...ut}}),recordCanvas:O,blockClass:o,blockSelector:i,unblockSelector:a,maxCanvasSize:R,sampling:I.canvas,dataURLOptions:D,errorHandler:F}),He=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new mE:new gE({mutationCb:Lt,scrollCb:ft,bypassOptions:{onMutation:gt,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskInputOptions:Ce,dataURLOptions:D,maskAttributeFn:b,maskTextFn:E,maskInputFn:S,recordCanvas:O,inlineImages:nt,sampling:I,slimDOMOptions:bn,iframeManager:Qt,stylesheetManager:oe,canvasManager:_n,keepIframeSrcFn:X,processedNodeManager:cn,ignoreCSSAttributes:ct},mirror:qo}),un=(ut=!1)=>{if(!U)return;qe({type:$t.Meta,data:{href:window.location.href,width:PC(),height:BC()}},ut),oe.reset(),He.init(),Nu.forEach(bt=>bt.lock());let Ft=zG(document,{mirror:qo,blockClass:o,blockSelector:i,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,inlineStylesheet:m,maskAllInputs:Ce,maskAttributeFn:b,maskInputFn:S,maskTextFn:E,slimDOM:bn,dataURLOptions:D,recordCanvas:O,inlineImages:nt,onSerialize:bt=>{HC(bt,qo)&&Qt.addIframe(bt),GC(bt,qo)&&oe.trackLinkElement(bt),aE(bt)&&He.addShadowRoot(bt.shadowRoot,document)},onIframeLoad:(bt,It)=>{Qt.attachIframe(bt,It);let yt=sp(bt);yt&&_n.addWindow(yt),He.observeAttachShadow(bt)},onStylesheetLoad:(bt,It)=>{oe.attachLinkElement(bt,It)},onBlockedImageLoad:(bt,It,{width:yt,height:K})=>{Lt({adds:[],removes:[],texts:[],attributes:[{id:It.id,attributes:{style:{width:`${yt}px`,height:`${K}px`}}}]})},keepIframeSrcFn:X,ignoreCSSAttributes:ct});if(!Ft)return console.warn("Failed to snapshot the document");qe({type:$t.FullSnapshot,data:{node:Ft,initialOffset:UC(window)}}),Nu.forEach(bt=>bt.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&oe.adoptStyleSheets(document.adoptedStyleSheets,qo.getId(document))};Ly=un;try{let ut=[],Ft=It=>ee(s$)({onMutation:gt,mutationCb:Lt,mousemoveCb:(yt,K)=>qe({type:$t.IncrementalSnapshot,data:{source:K,positions:yt}}),mouseInteractionCb:yt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.MouseInteraction,...yt}}),scrollCb:ft,viewportResizeCb:yt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.ViewportResize,...yt}}),inputCb:yt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.Input,...yt}}),mediaInteractionCb:yt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.MediaInteraction,...yt}}),styleSheetRuleCb:yt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.StyleSheetRule,...yt}}),styleDeclarationCb:yt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.StyleDeclaration,...yt}}),canvasMutationCb:te,fontCb:yt=>qe({type:$t.IncrementalSnapshot,data:{source:Rt.Font,...yt}}),selectionCb:yt=>{qe({type:$t.IncrementalSnapshot,data:{source:Rt.Selection,...yt}})},customElementCb:yt=>{qe({type:$t.IncrementalSnapshot,data:{source:Rt.CustomElement,...yt}})},blockClass:o,ignoreClass:s,ignoreSelector:l,maskAllText:c,maskTextClass:d,unmaskTextClass:u,maskTextSelector:p,unmaskTextSelector:f,maskInputOptions:Ce,inlineStylesheet:m,sampling:I,recordDOM:U,recordCanvas:O,inlineImages:nt,userTriggeredOnInput:V,collectFonts:st,doc:It,maskAttributeFn:b,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:X,blockSelector:i,unblockSelector:a,slimDOMOptions:bn,dataURLOptions:D,mirror:qo,iframeManager:Qt,stylesheetManager:oe,shadowDomManager:He,processedNodeManager:cn,canvasManager:_n,ignoreCSSAttributes:ct,plugins:lt?.filter(yt=>yt.observer)?.map(yt=>({observer:yt.observer,options:yt.options,callback:K=>qe({type:$t.Plugin,data:{plugin:yt.name,payload:K}})}))||[]},{});Qt.addLoadListener(It=>{try{ut.push(Ft(It.contentDocument))}catch(yt){console.warn(yt)}});let bt=()=>{un(),ut.push(Ft(document))};return document.readyState==="interactive"||document.readyState==="complete"?bt():(ut.push(nr("DOMContentLoaded",()=>{qe({type:$t.DomContentLoaded,data:{}}),B==="DOMContentLoaded"&&bt()})),ut.push(nr("load",()=>{qe({type:$t.Load,data:{}}),B==="load"&&bt()},window))),()=>{ut.forEach(It=>It()),cn.destroy(),Ly=void 0,YG()}}catch(ut){console.warn(ut)}}function l$(t){if(!Ly)throw new Error("please take full snapshot after start recording");Ly(t)}Vo.mirror=qo;Vo.takeFullSnapshot=l$;function c$(t,e){try{return t?t(e):new Oy}catch{return console.warn("Unable to initialize CanvasManager"),new Oy}}var yC;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(yC||(yC={}));var u$=3,d$=5;function LE(t){return t>9999999999?t:t*1e3}function ZS(t){return t>9999999999?t/1e3:t}function pp(t,e){e.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate(()=>(t.throttledAddEvent({type:$t.Custom,timestamp:(e.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:ue(e,10,1e3)}}),e.category==="console")))}var f$="button,a";function KC(t){return t.closest(f$)||t}function XC(t){let e=JC(t);return!e||!(e instanceof Element)?e:KC(e)}function JC(t){return p$(t)?t.target:t}function p$(t){return typeof t=="object"&&!!t&&"target"in t}var Qa;function m$(t){return Qa||(Qa=[],g$()),Qa.push(t),()=>{let e=Qa?Qa.indexOf(t):-1;e>-1&&Qa.splice(e,1)}}function g$(){ye(we,"open",function(t){return function(...e){if(Qa)try{Qa.forEach(n=>n())}catch{}return t.apply(we,e)}})}var h$=new Set([Rt.Mutation,Rt.StyleSheetRule,Rt.StyleDeclaration,Rt.AdoptedStyleSheet,Rt.CanvasMutation,Rt.Selection,Rt.MediaInteraction]);function y$(t,e,n){t.handleClick(e,n)}var bE=class{constructor(e,n,r=pp){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){let e=m$(()=>{this._lastMutation=bC()});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(_$(n,this._ignoreSelector)||!v$(e))return;let r={timestamp:ZS(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=ZS(e)}registerScroll(e=Date.now()){this._lastScroll=ZS(e)}registerClick(e){let n=KC(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=bC();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&e.push(r)});for(let r of e){let o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let n=this._replay,r=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,o=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!r&&!o,{clickCount:a,clickBreadcrumb:s}=e;if(i){let l=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,c=l<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.slowClickDetected",data:{...s.data,url:we.location.href,route:n.getCurrentRoute(),timeAfterClickMs:l,endReason:c,clickCount:a||1}};this._addBreadcrumbEvent(n,d);return}if(a>1){let l={type:"default",message:s.message,timestamp:s.timestamp,category:"ui.multiClick",data:{...s.data,url:we.location.href,route:n.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=bl(()=>this._checkClicks(),1e3)}},b$=["A","BUTTON","INPUT"];function _$(t,e){return!!(!b$.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 v$(t){return!!(t.data&&typeof t.data.nodeId=="number"&&t.timestamp)}function bC(){return Date.now()/1e3}function S$(t,e){try{if(!E$(e))return;let{source:n}=e.data;if(h$.has(n)&&t.registerMutation(e.timestamp),n===Rt.Scroll&&t.registerScroll(e.timestamp),T$(e)){let{type:r,id:o}=e.data,i=Vo.mirror.getNode(o);i instanceof HTMLElement&&r===er.Click&&t.registerClick(i)}}catch{}}function E$(t){return t.type===u$}function T$(t){return t.data.source===Rt.MouseInteraction}function vi(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var Vy=(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))(Vy||{}),w$=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function x$(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(w$.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),e[r]=t[n]}return e}var A$=t=>e=>{if(!t.isEnabled())return;let n=I$(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&&y$(t.clickDetector,n,XC(e.event)),pp(t,n)};function QC(t,e){let n=Vo.mirror.getId(t),r=n&&Vo.mirror.getNode(n),o=r&&Vo.mirror.getMeta(r),i=o&&R$(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===Vy.Text&&a.textContent).filter(Boolean).map(a=>a.trim()).join(""),attributes:x$(i.attributes)}}:{}}}function I$(t){let{target:e,message:n}=k$(t);return vi({category:`ui.${t.name}`,...QC(e,n)})}function k$(t){let e=t.name==="click",n,r=null;try{r=e?XC(t.event):JC(t.event),n=pe(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function R$(t){return t.type===Vy.Element}function N$(t,e){if(!t.isEnabled())return;t.updateUserActivity();let n=C$(e);n&&pp(t,n)}function C$(t){let{metaKey:e,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:a}=t;if(!a||M$(a)||!i)return null;let s=e||r||o,l=i.length===1;if(!s&&l)return null;let c=pe(a,{maxStringLength:200})||"<unknown>",d=QC(a,c);return vi({category:"ui.keyDown",message:c,data:{...d.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function M$(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable}var O$={resource:P$,paint:U$,navigation:B$};function tE(t,e){return({metric:n})=>void e.replayPerformanceEntries.push(t(n))}function D$(t){return t.map(L$).filter(Boolean)}function L$(t){let e=O$[t.entryType];return e?e(t):null}function Ou(t){return((ne()||we.performance.timeOrigin)+t)/1e3}function U$(t){let{duration:e,entryType:n,name:r,startTime:o}=t,i=Ou(o);return{type:n,name:r,start:i,end:i+e,data:void 0}}function B$(t){let{entryType:e,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:a,domContentLoadedEventStart:s,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:d,loadEventEnd:u,redirectCount:p,startTime:f,transferSize:m,type:_}=t;return o===0?null:{type:`${e}.${_}`,start:Ou(f),end:Ou(i),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:a,duration:o,domInteractive:c,domContentLoadedEventStart:s,domContentLoadedEventEnd:l,loadEventStart:d,loadEventEnd:u,domComplete:i,redirectCount:p}}}function P$(t){let{entryType:e,initiatorType:n,name:r,responseEnd:o,startTime:i,decodedBodySize:a,encodedBodySize:s,responseStatus:l,transferSize:c}=t;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${e}.${n}`,start:Ou(i),end:Ou(o),name:r,data:{size:c,statusCode:l,decodedBodySize:a,encodedBodySize:s}}}function z$(t){let e=t.entries[t.entries.length-1],n=e?.element?[e.element]:void 0;return UE(t,"largest-contentful-paint",n)}function F$(t){return t.sources!==void 0}function H$(t){let e=[],n=[];for(let r of t.entries)if(F$(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 UE(t,"cumulative-layout-shift",n,e)}function G$(t){let e=t.entries[t.entries.length-1],n=e?.target?[e.target]:void 0;return UE(t,"interaction-to-next-paint",n)}function UE(t,e,n,r){let o=t.value,i=t.rating,a=Ou(o);return{type:"web-vital",name:e,start:a,end:a,data:{value:o,size:o,rating:i,nodeIds:n?n.map(s=>Vo.mirror.getId(s)):void 0,attributions:r}}}function $$(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(tE(z$,t)),qi(tE(H$,t)),pl(tE(G$,t))),()=>{r.forEach(o=>o())}}var Tt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,j$='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 q$(){let t=new Blob([j$]);return URL.createObjectURL(t)}var _C=["log","warn","error"],Iy="[Replay] ";function eE(t,e="info"){wn({category:"console",data:{logger:"replay"},level:e,message:`${Iy}${t}`},{level:e})}function V$(){let t=!1,e=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{t=!!r.captureExceptions,e=!!r.traceInternals}};return Tt?(_C.forEach(r=>{n[r]=(...o)=>{w[r](Iy,...o),e&&eE(o.join(""),Hi(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),w.error(Iy,r),t?Et(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):e&&eE(r,"error")},n.infoTick=(...r)=>{w.log(Iy,...r),e&&setTimeout(()=>eE(r[0]),0)}):_C.forEach(r=>{n[r]=()=>{}}),n}var wt=V$(),cp=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${RE}.`)}},Uy=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>RE)throw new cp;this.events.push(e)}finish(){return new Promise(e=>{let n=this.events;this.clear(),e(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(let{timestamp:n}of this.events)(e===null||n<e)&&(e=n);return e===null?e:LE(e)}},_E=class{constructor(e){this._onMessage=({data:n})=>{let r=n;if(typeof r.id!="number")return;let o=this._pending.get(r.id);if(!(!o||o.method!==r.method)){if(this._pending.delete(r.id),!r.success){Tt&&wt.error("Error in compression worker: ",r.response),o.reject(new Error("Error in compression worker"));return}o.resolve(r.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((e,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?e():(Tt&&wt.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{Tt&&wt.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){Tt&&wt.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(e=>e.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(e,n){let r=this._getAndIncrementId();return new Promise((o,i)=>{this._pending.set(r,{method:e,resolve:o,reject:i});try{this._worker.postMessage({id:r,method:e,arg:n})}catch(a){this._pending.delete(r),i(a)}})}_getAndIncrementId(){return this._id++}},vE=class{constructor(e){this._worker=new _E(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=LE(e.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(e);return this._totalSize+=r.length,this._totalSize>RE?Promise.reject(new cp):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{Tt&&wt.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){let e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}},SE=class{constructor(e){this._fallback=new Uy,this._compression=new vE(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){Tt&&wt.exception(e,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(let i of e)o.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(i){Tt&&wt.exception(i,"Failed to add events when switching buffers.")}}};function Y$({useCompression:t,workerUrl:e}){if(t&&window.Worker){let n=W$(e);if(n)return n}return Tt&&wt.log("Using simple buffer"),new Uy}function W$(t){try{let e=t||K$();if(!e)return;Tt&&wt.log(`Using compression worker${t?` from ${t}`:""}`);let n=new Worker(e);return new SE(n)}catch(e){Tt&&wt.exception(e,"Failed to create compression worker")}}function K$(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?q$():""}function BE(){try{return"sessionStorage"in we&&!!we.sessionStorage}catch{return!1}}function X$(t){J$(),t.session=void 0}function J$(){if(BE())try{we.sessionStorage.removeItem(IE)}catch{}}function ZC(t){return t===void 0?!1:Math.random()<t}function Yy(t){if(BE())try{we.sessionStorage.setItem(IE,JSON.stringify(t))}catch{}}function t2(t){let e=Date.now(),n=t.id||ae(),r=t.started||e,o=t.lastActivity||e,i=t.segmentId||0,a=t.sampled,s=t.previousSessionId,l=t.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:i,sampled:a,previousSessionId:s,dirty:l}}function Q$(t,e){return ZC(t)?"session":e?"buffer":!1}function vC({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){let o=Q$(t,e),i=t2({sampled:o,previousSessionId:r});return n&&Yy(i),i}function Z$(){if(!BE())return null;try{let t=we.sessionStorage.getItem(IE);if(!t)return null;let e=JSON.parse(t);return Tt&&wt.infoTick("Loading existing session"),t2(e)}catch{return null}}function EE(t,e,n=+new Date){return t===null||e===void 0||e<0?!0:e===0?!1:t+e<=n}function tj(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return EE(t.started,e,r)||EE(t.lastActivity,n,r)}function By(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!(!tj(t,{sessionIdleExpire:e,maxReplayDuration:n})||t.sampled==="buffer"&&t.segmentId===0)}function nE({sessionIdleExpire:t,maxReplayDuration:e,previousSessionId:n},r){let o=r.stickySession&&Z$();return o?By(o,{sessionIdleExpire:t,maxReplayDuration:e})?(Tt&&wt.infoTick("Session in sessionStorage is expired, creating new one..."),vC(r,{previousSessionId:o.id})):o:(Tt&&wt.infoTick("Creating new session"),vC(r,{previousSessionId:n}))}function ej(t){return t.type===$t.Custom}function PE(t,e,n){return n2(t,e)?(e2(t,e,n),!0):!1}function nj(t,e,n){return n2(t,e)?e2(t,e,n):Promise.resolve(null)}async function e2(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=rj(e,i.beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(i){let a=i&&i instanceof cp,s=a?"eventBufferOverflow":"eventBufferError",l=P();if(l){let c=a?"buffer_overflow":"internal_sdk_error";l.recordDroppedEvent(c,"replay")}if(a&&o)return r.clear(),r.waitForCheckout=!0,null;t.handleException(i),await t.stop({reason:s})}}function n2(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;let n=LE(e.timestamp);return n+t.timeouts.sessionIdlePause<Date.now()?!1:n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration?(Tt&&wt.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function rj(t,e){try{if(typeof e=="function"&&ej(t))return e(t)}catch(n){return Tt&&wt.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return t}var oj=100;function r2(t,e){let n=t.getContext();n.traceIds.size<oj&&n.traceIds.add(e)}function ij(t){return e=>{if(!t.isEnabled()||!Tn(e))return;let n=e.spanContext().traceId;n&&r2(t,n)}}function zE(t){return!t.type}function TE(t){return t.type==="transaction"}function aj(t){return t.type==="replay_event"}function SC(t){return t.type==="feedback"}function sj(t){return(e,n)=>{if(!t.isEnabled()||!zE(e)&&!TE(e))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(TE(e)){lj(t,e);return}cj(t,e)}}}function lj(t,e){let n=e.contexts?.trace?.trace_id;n&&r2(t,n)}function cj(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 uj(t){return e=>{!t.isEnabled()||!zE(e)||dj(t,e)}}function dj(t,e){let n=e.exception?.values?.[0]?.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){let r=vi({category:"replay.hydrate-error",data:{url:Kn()}});pp(t,r)}}function fj(t){let e=P();e&&e.on("beforeAddBreadcrumb",n=>pj(t,n))}function pj(t,e){if(!t.isEnabled()||!o2(e))return;let n=mj(e);n&&pp(t,n)}function mj(t){return!o2(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui.")?null:t.category==="console"?gj(t):vi(t)}function gj(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>Ty?(n=!0,`${o.slice(0,Ty)}\u2026`):o;if(typeof o=="object")try{let i=ue(o,7);return JSON.stringify(i).length>Ty?(n=!0,`${JSON.stringify(i,null,2).slice(0,Ty)}\u2026`):i}catch{}return o});return vi({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function o2(t){return!!t.category}function hj(t,e){return t.type||!t.exception?.values?.length?!1:!!e.originalException?.__rrweb__}function Py(){let t=rt().getPropagationContext().dsc;t&&delete t.replay_id;let e=Ot();if(e){let n=$e(e);delete n.replay_id}}function EC(t){let e=rt().getPropagationContext().dsc;e&&(e.replay_id=t);let n=Ot();if(n){let r=$e(n);r.replay_id=t}}function yj(t,e){t.triggerUserActivity(),t.addUpdate(()=>e.timestamp?(t.throttledAddEvent({type:$t.Custom,timestamp:e.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:e.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1):!0)}function bj(t,e){return t.recordingMode!=="buffer"||e.message===kE||!e.exception||e.type?!1:ZC(t.getOptions().errorSampleRate)}function _j(t){return Object.assign((e,n)=>{if(t.session&&By(t.session,{maxReplayDuration:t.getOptions().maxReplayDuration,sessionIdleExpire:t.timeouts.sessionIdleExpire})&&Py(),!t.isEnabled()||t.isPaused())return e;if(aj(e))return delete e.breadcrumbs,e;if(!zE(e)&&!TE(e)&&!SC(e))return e;if(!t.checkAndHandleExpiredSession())return Py(),e;if(SC(e))return t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),yj(t,e),e;if(hj(e,n)&&!t.getOptions()._experiments.captureExceptions)return Tt&&wt.log("Ignoring error from rrweb internals",e),null;let o=bj(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&&Yy(a)}return e},{id:"Replay"})}function Wy(t,e){return e.map(({type:n,start:r,end:o,name:i,data:a})=>{let s=t.throttledAddEvent({type:$t.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:o,data:a}}});return typeof s=="string"?Promise.resolve(null):s})}function vj(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 Sj(t){return e=>{if(!t.isEnabled())return;let n=vj(e);n!==null&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate(()=>(Wy(t,[n]),!1)))}}function Ej(t,e){return Tt&&t.getOptions()._experiments.traceInternals?!1:$c(e,P())}function i2(t,e){t.isEnabled()&&e!==null&&(Ej(t,e.name)||t.addUpdate(()=>(Wy(t,[e]),!0)))}function Ky(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=uy(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch{}}function a2(t){if(!t)return;let e=parseInt(t,10);return isNaN(e)?void 0:e}function zy(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 s2(t,e){if(!e)return null;let{startTimestamp:n,endTimestamp:r,url:o,method:i,statusCode:a,request:s,response:l}=e;return{type:t,start:n/1e3,end:r/1e3,name:o,data:{method:i,statusCode:a,request:s,response:l}}}function up(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function Za(t,e,n){if(!e&&Object.keys(t).length===0)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};let r={headers:t,size:e},{body:o,warnings:i}=Tj(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function wE(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 Tj(t){if(!t||typeof t!="string")return{body:t};let e=t.length>nC,n=wj(t);if(e){let r=t.slice(0,nC);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 wj(t){let e=t[0],n=t[t.length-1];return e==="["&&n==="]"||e==="{"&&n==="}"}function Fy(t,e){let n=xj(t);return tn(n,e)}function xj(t,e=we.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(we.location.origin))return t;let n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;let r=n.href;return!t.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function Aj(t,e,n){try{let r=await kj(t,e,n),o=s2("resource.fetch",r);i2(n.replay,o)}catch(r){Tt&&wt.exception(r,"Failed to capture fetch breadcrumb")}}function Ij(t,e){let{input:n,response:r}=e,o=n?vu(n):void 0,i=Ky(o),a=r?a2(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 kj(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=Fy(a,n.networkDetailAllowUrls)&&!Fy(a,n.networkDetailDenyUrls),p=u?Rj(n,e.input,c):up(c),f=await Nj(u,n,e.response,d);return{startTimestamp:o,endTimestamp:i,url:a,method:s,statusCode:l,request:p,response:f}}function Rj({networkCaptureBodies:t,networkRequestHeaders:e},n,r){let o=n?Oj(n,e):{};if(!t)return Za(o,r,void 0);let i=vu(n),[a,s]=vl(i,wt),l=Za(o,r,a);return s?zy(l,s):l}async function Nj(t,{networkCaptureBodies:e,networkResponseHeaders:n},r,o){if(!t&&o!==void 0)return up(o);let i=r?l2(r.headers,n):{};if(!r||!e&&o!==void 0)return Za(i,o,void 0);let[a,s]=await Mj(r),l=Cj(a,{networkCaptureBodies:e,responseBodySize:o,captureDetails:t,headers:i});return s?zy(l,s):l}function Cj(t,{networkCaptureBodies:e,responseBodySize:n,captureDetails:r,headers:o}){try{let i=t?.length&&n===void 0?Ky(t):n;return r?e?Za(o,i,t):Za(o,i,void 0):up(i)}catch(i){return Tt&&wt.exception(i,"Failed to serialize response body"),Za(o,n,void 0)}}async function Mj(t){let e=Dj(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{return[await Lj(e)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(Tt&&wt.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(Tt&&wt.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function l2(t,e){let n={};return e.forEach(r=>{t.get(r)&&(n[r]=t.get(r))}),n}function Oj(t,e){return t.length===1&&typeof t[0]!="string"?TC(t[0],e):t.length===2?TC(t[1],e):{}}function TC(t,e){if(!t)return{};let n=t.headers;return n?n instanceof Headers?l2(n,e):Array.isArray(n)?{}:wE(n,e):{}}function Dj(t){try{return t.clone()}catch(e){Tt&&wt.exception(e,"Failed to clone response body")}}function Lj(t){return new Promise((e,n)=>{let r=bl(()=>n(new Error("Timeout while trying to read response body")),500);Uj(t).then(o=>e(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function Uj(t){return await t.text()}async function Bj(t,e,n){try{let r=zj(t,e,n),o=s2("resource.xhr",r);i2(n.replay,o)}catch(r){Tt&&wt.exception(r,"Failed to capture xhr breadcrumb")}}function Pj(t,e){let{xhr:n,input:r}=e;if(!n)return;let o=Ky(r),i=n.getResponseHeader("content-length")?a2(n.getResponseHeader("content-length")):Gj(n.response,n.responseType);o!==void 0&&(t.data.request_body_size=o),i!==void 0&&(t.data.response_body_size=i)}function zj(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||!Fy(l,n.networkDetailAllowUrls)||Fy(l,n.networkDetailDenyUrls)){let C=up(u),I=up(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:d,request:C,response:I}}let f=s[tr],m=f?wE(f.request_headers,n.networkRequestHeaders):{},_=wE(Jf(s),n.networkResponseHeaders),[v,h]=n.networkCaptureBodies?vl(a,wt):[void 0],[b,S]=n.networkCaptureBodies?Fj(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?zy(E,h):E,response:S?zy(R,S):R}}function Fj(t){let e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return Hj(t.response,t.responseType)}catch(n){e.push(n)}return Tt&&wt.warn("Failed to get xhr response body",...e),[void 0]}function Hj(t,e){try{if(typeof t=="string")return[t];if(t instanceof Document)return[t.body.outerHTML];if(e==="json"&&t&&typeof t=="object")return[JSON.stringify(t)];if(!t)return[void 0]}catch(n){return Tt&&wt.exception(n,"Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return Tt&&wt.log("Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Gj(t,e){try{let n=e==="json"&&t&&typeof t=="object"?JSON.stringify(t):t;return Ky(n)}catch{return}}function $j(t){let e=P();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:a}=t.getOptions(),s={replay:t,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:a};e&&e.on("beforeAddBreadcrumb",(l,c)=>jj(s,l,c))}catch{}}function jj(t,e,n){if(e.data)try{qj(e)&&Yj(n)&&(Pj(e,n),Bj(e,n,t)),Vj(e)&&Wj(n)&&(Ij(e,n),Aj(e,n,t))}catch(r){Tt&&wt.exception(r,"Error when enriching network breadcrumb")}}function qj(t){return t.category==="xhr"}function Vj(t){return t.category==="fetch"}function Yj(t){return t?.xhr}function Wj(t){return t?.input!==void 0}function Kj(t){let e=P();Xf(A$(t)),Wi(Sj(t)),fj(t),$j(t);let n=_j(t);Uc(n),e&&(e.on("beforeSendEvent",uj(t)),e.on("afterSendEvent",sj(t)),e.on("createDsc",r=>{let o=t.getSessionId();o&&t.isEnabled()&&t.recordingMode==="session"&&t.checkAndHandleExpiredSession()&&(r.replay_id=o)}),e.on("afterSegmentSpanEnd",ij(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 Xj(t){try{return Promise.all(Wy(t,[Jj(we.performance.memory)]))}catch{return[]}}function Jj(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 Qj(t,e,n){return vv(t,e,{...n,setTimeoutImpl:bl})}var Ay=tt.navigator;function Zj(){return/iPhone|iPad|iPod/i.test(Ay?.userAgent??"")||/Macintosh/i.test(Ay?.userAgent??"")&&Ay?.maxTouchPoints&&Ay?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function tq(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession()){Tt&&wt.warn("Received replay event after session expired.");return}let o=r||!e;e=!0,eq(n),t.clickDetector&&S$(t.clickDetector,n),t.addUpdate(()=>{if(t.recordingMode==="buffer"&&o&&t.setInitialState(),!PE(t,n,o))return!0;if(!o)return!1;let i=t.session;if(rq(t,o),t.recordingMode==="buffer"&&i&&t.eventBuffer&&!i.dirty){let a=t.eventBuffer.getEarliestTimestamp();a&&(Tt&&wt.log(`Updating session start time to earliest event in buffer to ${new Date(a)}`),i.started=a,t.getOptions().stickySession&&Yy(i))}return i?.previousSessionId||t.recordingMode==="session"&&t.flush(),!0})}}function eq(t){let e=t.data;if(!(t.type!==$t.IncrementalSnapshot||!e||typeof e!="object"||!("source"in e)||e.source!==Rt.Mutation||!("attributes"in e)||!Array.isArray(e.attributes)))for(let n of e.attributes){let r=Vo.mirror.getNode(n.id),o=r&&Vo.mirror.getMeta(r);if(o?.type===Vy.Element)for(let[i,a]of Object.entries(n.attributes))a===null?delete o.attributes[i]:o.attributes[i]=a}}function nq(t){let e=t.getOptions();return{type:$t.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:t.isRecordingCanvas(),sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:t.eventBuffer?t.eventBuffer.type==="worker":!1,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}function rq(t,e){!e||t.session?.segmentId!==0||PE(t,nq(t),!1)}function oq(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function iq(t,e,n,r){return Le(Rc(t,Fo(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:typeof e=="string"?new TextEncoder().encode(e).length:e.length},e]])}function aq({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 sq({client:t,scope:e,replayId:n,event:r}){let o=typeof t._integrations=="object"&&t._integrations!==null&&!Array.isArray(t._integrations)?Object.keys(t._integrations):void 0,i={event_id:n,integrations:o};t.emit("preprocessEvent",r,i);let a=await wf(t.getOptions(),r,i,e,t,Pt());if(!a)return null;t.emit("postprocessEvent",a,i),a.platform=a.platform||"javascript";let s=t.getSdkMetadata(),{name:l,version:c,settings:d}=s?.sdk||{};return a.sdk={...a.sdk,name:l||"sentry.javascript.unknown",version:c||"0.0.0",settings:d},a}async function lq({recordingData:t,replayId:e,segmentId:n,eventContext:r,timestamp:o,session:i}){let a=aq({recordingData:t,headers:{segment_id:n}}),{urls:s,errorIds:l,traceIds:c,initialTimestamp:d}=r,u=P(),p=rt(),f=u?.getTransport(),m=u?.getDsn();if(!u||!f||!m||!i.sampled)return Promise.resolve({});let _={type:Y9,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 sq({scope:p,client:u,replayId:e,event:_});if(!v)return u.recordDroppedEvent("event_processor","replay"),Tt&&wt.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete v.sdkProcessingMetadata;let h=iq(v,a,m,u.getOptions().tunnel),b;try{b=await f.send(h)}catch(E){let R=new Error(kE);try{R.cause=E}catch{}throw R}let S=If({},b);if(Af(S,"replay"))throw new dp(S);if(typeof b.statusCode=="number"&&(b.statusCode<200||b.statusCode>=300))throw new Hy(b.statusCode);return b}var Hy=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},dp=class extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}},Gy=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function c2(t,e={count:0,interval:Z9}){let{recordingData:n,onError:r}=t;if(n.length)try{return await lq(t),!0}catch(o){if(o instanceof Hy||o instanceof dp)throw o;if(La("Replays",{_retryCount:e.count}),r&&r(o),e.count>=tG){let i=new Error(`${kE} - max retries exceeded`);try{i.cause=o}catch{}throw i}return e.interval*=++e.count,new Promise((i,a)=>{bl(async()=>{try{await c2(t,e),i(!0)}catch(s){a(s)}},e.interval)})}}var u2="__THROTTLED",cq="__SKIPPED";function uq(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?cq:u2}a=!1;let c=r.get(l)||0;return r.set(l,c+1),t(...s)}}var xE=class{constructor({options:e,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:W9,sessionIdleExpire:K9},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=Qj(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=uq((a,s)=>nj(this,a,s),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(eG,r),timeout:r,scrollTimeout:nG,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new bE(this,i)),Tt){let a=e._experiments;wt.setConfig({captureExceptions:!!a.captureExceptions,traceInternals:!!a.traceInternals})}this._handleVisibilityChange=()=>{we.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let a=vi({category:"ui.blur"});this._doChangeToBackgroundTasks(a)},this._handleWindowFocus=()=>{let a=vi({category:"ui.focus"});this._doChangeToForegroundTasks(a)},this._handleKeyboardEvent=a=>{N$(this,a)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){Tt&&wt.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(e),!this.session){Tt&&wt.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",Tt&&wt.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){Tt&&wt.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){Tt&&wt.log("Buffering is in progress, call `flush()` to save the replay");return}Tt&&wt.infoTick("Starting replay in session mode"),this._updateUserActivity();let e=nE({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){Tt&&wt.log("Buffering is in progress, call `flush()` to save the replay");return}Tt&&wt.infoTick("Starting replay in buffer mode");let e=nE({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:Q9}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:tq(this),...Zj(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:n}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";let r=n??"manual";P()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{Tt&&wt.log(`Stopping Replay triggered by ${r}`),Py(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,X$(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Tt&&wt.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Tt&&wt.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();Tt&&wt.log("Converting buffer to session"),await this.flushImmediate();let r=this.stopRecording();!e||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),EC(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&&EE(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${we.location.pathname}${we.location.hash}${we.location.search}`,n=`${we.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(e,n){let r=this._throttledAddEvent(e,n);if(r===u2){let o=vi({category:"replay.throttled"});this.addUpdate(()=>!PE(this,{type:d$,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let e=this.lastActiveSpan||Ot(),n=e&&Bt(e),o=(n&&et(n).data||{})[Mt];if(!(!n||!o||!["route","custom"].includes(o)))return et(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Y$({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&P()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&EC(this.session.id)}_initializeSessionForSampling(e){let n=this._options.errorSampleRate>0,r=nE({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 By(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(e.id))}_addListeners(){try{we.document.addEventListener("visibilitychange",this._handleVisibilityChange),we.addEventListener("blur",this._handleWindowBlur),we.addEventListener("focus",this._handleWindowFocus),we.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Kj(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=$$(this)}_removeListeners(){try{we.document.removeEventListener("visibilitychange",this._handleVisibilityChange),we.removeEventListener("blur",this._handleWindowBlur),we.removeEventListener("focus",this._handleWindowFocus),we.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(!this.session)return;if(By(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Py();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}_doChangeToForegroundTasks(e){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){Tt&&wt.log("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:$t.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=D$(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(Wy(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:n}=this;if(!e||!n||this._requiresManualStart||e.segmentId)return;let r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){Tt&&wt.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await Xj(this),!!this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Gy;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await c2({replayId:e,recordingData:i,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:a=>this.handleException(a)})}catch(n){this.handleException(n),this.stop({reason:"sendError"});let r=P();if(r){let o;n instanceof dp?o="ratelimit_backoff":n instanceof Gy?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){Tt&&wt.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;let n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();let i=o<this._options.minReplayDuration,a=o>this._options.maxReplayDuration+5e3;if(i||a){Tt&&wt.log(`Session duration (${Math.floor(o/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}let s=this.eventBuffer;s&&this.session.segmentId===0&&!s.hasCheckout&&Tt&&wt.log("Flushing initial segment without checkout.");let l=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(c){this.handleException(c)}finally{this._flushLock=void 0,l&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Yy(this.session)}_onMutationHandler(e){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&e.some(s=>{let l=oq(s.target),c=n.join(",");return l?.matches(c)}))return!1;let r=e.length,o=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,a=o&&r>o;if(r>i||a){let s=vi({category:"replay.mutations",data:{count:r,limit:a}});this._createCustomBreadcrumb(s)}return a?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function tp(t,e){return[...t,...e].join(",")}function dq({mask:t,unmask:e,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],a=tp(t,[".sentry-mask","[data-sentry-mask]"]),s=tp(e,[]);return{maskTextSelector:a,unmaskTextSelector:s,blockSelector:tp(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:tp(r,[]),ignoreSelector:tp(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function fq({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 wC='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',pq=["content-length","content-type","accept"],mq=Symbol.for("sentry__originalRequestBody"),xC=!1,AC=!1;function gq(){if(typeof Request>"u"||AC)return;let t=Request;try{let e=function(n,r){let o=new t(n,r);return r?.body!=null&&(o[mq]=r.body),o};e.prototype=t.prototype,tt.Request=e,AC=!0}catch{}}var Xy=(t=>new AE(t)),AE=class{constructor({flushMinDelay:e=X9,flushMaxDelay:n=J9,minReplayDuration:r=rG,maxReplayDuration:o=rC,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:D=[],unblock:z=[],ignore:U=[],maskFn:O,beforeAddRecordingEvent:N,beforeErrorSampling:B,onError:V,attachRawBodyFromRequest:st=!1}={}){this.name="Replay";let nt=dq({mask:R,unmask:I,block:D,unblock:z,ignore:U});if(this._recordingOptions={maskAllInputs:d,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:O,maskInputFn:O,maskAttributeFn:(lt,X,ct)=>fq({maskAttributes:C,maskAllText:c,privacyOptions:nt,key:lt,value:X,el:ct}),...nt,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:lt=>{try{lt.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!l.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:n,minReplayDuration:Math.min(r,oG),maxReplayDuration:Math.min(o,rC),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:IC(S),networkResponseHeaders:IC(E),beforeAddRecordingEvent:N,beforeErrorSampling:B,onError:V,attachRawBodyFromRequest:st,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${wC}`:wC,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Vn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return xC}set _isInitialized(e){xC=e}afterAllSetup(e){!Vn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&gq(),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&&(Rr(e,{"sentry.replay_id":n}),this.getRecordingMode()==="buffer"&&Rr(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let n=hq(this._initialOptions,e);this._replay=new xE({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let n=e.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function hq(t,e){let n=e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...t},o=kr(n.replaysSessionSampleRate),i=kr(n.replaysOnErrorSampleRate);return o==null&&i==null&&fn(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function IC(t){return[...pq,...t.map(e=>e.toLowerCase())]}function d2(){return P()?.getIntegrationByName("Replay")}var yq=Object.defineProperty,bq=(t,e,n)=>e in t?yq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,f2=(t,e,n)=>bq(t,typeof e!="symbol"?e+"":e,n),HE=class{constructor(){f2(this,"idNodeMap",new Map),f2(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 _q(){return new HE}function vq(t,e){for(let n=t.classList.length;n--;){let r=t.classList[n];if(e.test(r))return!0}return!1}function GE(t,e,n=1/0,r=0){return!t||t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:GE(t.parentNode,e,n,r+1)}function p2(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(vq(r,t))return!0}return!!(e&&r.matches(e))}catch{return!1}}}var Du=`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.`,m2={map:{},getId(){return console.error(Du),-1},getNode(){return console.error(Du),null},removeNodeFromMap(){console.error(Du)},has(){return console.error(Du),!1},reset(){console.error(Du)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(m2=new Proxy(m2,{get(t,e,n){return e==="map"&&console.error(Du),Reflect.get(t,e,n)}}));function jE(t,e,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(a){E2(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>jE(t,e,i||{},!0)}function qE(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 Sq(t){if(!t)return null;try{return t.nodeType===t.ELEMENT_NODE?t:t.parentElement}catch{return null}}function tb(t,e,n,r,o){if(!t)return!1;let i=Sq(t);if(!i)return!1;let a=p2(e,n);if(!o){let c=r&&i.matches(r);return a(i)&&!c}let s=GE(i,a),l=-1;return s<0?!1:(r&&(l=GE(i,p2(null,r))),s>-1&&l<0?!0:s<l)}var g2={};function S2(t){let e=g2[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 g2[t]=r.bind(window)}function El(...t){return S2("requestAnimationFrame")(...t)}function E2(...t){return S2("setTimeout")(...t)}var Uu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Uu||{}),Qy;function Eq(t){Qy=t}var FE=t=>Qy?((...n)=>{try{return t(...n)}catch(r){if(Qy&&Qy(r)===!0)return()=>{};throw r}}):t,Lu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tq=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(mp=0;mp<Lu.length;mp++)Tq[Lu.charCodeAt(mp)]=mp;var mp,wq=function(t){var e=new Uint8Array(t),n,r=e.length,o="";for(n=0;n<r;n+=3)o+=Lu[e[n]>>2],o+=Lu[(e[n]&3)<<4|e[n+1]>>4],o+=Lu[(e[n+1]&15)<<2|e[n+2]>>6],o+=Lu[e[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},h2=new Map;function xq(t,e){let n=h2.get(t);return n||(n=new Map,h2.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}var T2=(t,e,n)=>{if(!t||!(x2(t,e)||typeof t=="object"))return;let r=t.constructor.name,o=xq(n,r),i=o.indexOf(t);return i===-1&&(i=o.length,o.push(t)),i};function Zy(t,e,n){if(t instanceof Array)return t.map(r=>Zy(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=wq(t);return{rr_type:r,base64:o}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Zy(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:[Zy(t.data,e,n),t.width,t.height]};if(x2(t,e)||typeof t=="object"){let r=t.constructor.name,o=T2(t,e,n);return{rr_type:r,index:o}}}}return t}var w2=(t,e,n)=>t.map(r=>Zy(r,e,n)),x2=(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 Aq(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=qE(e.CanvasRenderingContext2D.prototype,s,function(c){return function(...d){return tb(this.canvas,n,r,o,!0)||E2(()=>{let u=w2(d,e,this);t(this.canvas,{type:Uu["2D"],property:s,args:u})},0),c.apply(this,d)}});i.push(l)}catch{let l=jE(e.CanvasRenderingContext2D.prototype,s,{set(c){t(this.canvas,{type:Uu["2D"],property:s,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(s=>s())}}function Iq(t){return t==="experimental-webgl"?"webgl":t}function y2(t,e,n,r,o){let i=[];try{let a=qE(t.HTMLCanvasElement.prototype,"getContext",function(s){return function(l,...c){if(!tb(this,e,n,r,!0)){let d=Iq(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 b2(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=qE(t,d,function(p){return function(...f){let m=p.apply(this,f);if(T2(m,s,this),"tagName"in this.canvas&&!tb(this.canvas,r,o,i,!0)){let _=w2(f,s,this),v={type:e,property:d,args:_};n(this.canvas,v)}return m}});l.push(u)}catch{let u=jE(t,d,{set(p){n(this.canvas,{type:e,property:d,args:[p],setter:!0})}});l.push(u)}return l}function kq(t,e,n,r,o,i){let a=[];return a.push(...b2(e.WebGLRenderingContext.prototype,Uu.WebGL,t,n,r,o,i,e)),typeof e.WebGL2RenderingContext<"u"&&a.push(...b2(e.WebGL2RenderingContext.prototype,Uu.WebGL2,t,n,r,o,i,e)),()=>{a.forEach(s=>s())}}var Rq='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 Nq(){let t=new Blob([Rq]);return URL.createObjectURL(t)}var $E=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&&Eq(a),(i&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&FE(()=>{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}FE(()=>{if(a&&n==="all"&&this.initCanvasMutationObserver(e,r,o,i),a&&typeof n=="number"){let l=y2(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(Nq());return e.onmessage=n=>{let r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;let{base64:i,type:a,width:s,height:l}=r;this.mutationCb({id:o,type:Uu["2D"],commands:[{property:"clearRect",args:[0,0,s,l]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:a}]},0,0,s,l]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;let n=r=>{this.takeSnapshot(r,!1),e=El(n)};e=El(n),this.restoreHandlers.push(()=>{e&&cancelAnimationFrame(e)})}initCanvasMutationObserver(e,n,r,o){let i=y2(e,n,r,o,!1),a=Aq(this.processMutation.bind(this),e,n,r,o),s=kq(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=>{tb(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=>{FE(()=>{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)}_q();var _2;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(_2||(_2={}));var v2={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}}},Cq="ReplayCanvas",Jy=1280,Mq=((t={})=>{let[e,n]=t.maxCanvasSize||[],r={quality:t.quality||"medium",enableManualSnapshot:t.enableManualSnapshot,maxCanvasSize:[e?Math.min(e,Jy):Jy,n?Math.min(n,Jy):Jy]},o,i,a=new Promise(s=>i=s);return{name:Cq,getOptions(){let{quality:s,enableManualSnapshot:l,maxCanvasSize:c}=r;return{enableManualSnapshot:l,recordCanvas:!0,getCanvasManager:d=>{let u=new $E({...d,enableManualSnapshot:l,maxCanvasSize:c,errorHandler:p=>{try{typeof p=="object"&&(p.__rrweb__=!0)}catch{}}});return o=u,i(u),u},...v2[s]||v2.medium}},async snapshot(s,l){(o||await a).snapshot(s,l)}}}),A2=Mq;function I2(t){return t.split(",").some(e=>e.trim().startsWith("sentry-"))}function VE(t){try{return new URL(t,q.location.origin).href}catch{return}}function k2(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function YE(t){try{return new Headers(t)}catch{return}}var gp={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function eb(t,e){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:s,onRequestSpanEnd:l}={...gp,...e},c=typeof o=="function"?o:f=>!0,d=f=>Dq(f,a),u={},p=t.getOptions().propagateTraceparent;n&&hi(f=>{let m=Ov(f,c,d,u,{propagateTraceparent:p,onRequestSpanEnd:l});if(m){let _=VE(f.fetchData.url),v=_?Qr(_).host:void 0,h=_?Yn(_):void 0;m.setAttributes({"http.url":h,"url.full":h,"server.address":v}),i&&R2(m,t),s?.(m,{headers:f.headers})}}),r&&_l(f=>{let m=Lq(f,c,d,u,p,l);m&&(i&&R2(m,t),s?.(m,{headers:YE(f.xhr.__sentry_xhr_v3__?.request_headers)}))})}var Oq=300;function R2(t,e){let{url:n}=et(t).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(je(e)){let i=t.end.bind(t);t.end=a=>{let s=a??Ct(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(s),clearTimeout(d))};r=c;let d=setTimeout(c,Oq)}}let o=hr("resource",({entries:i})=>{i.forEach(a=>{k2(a)&&a.name.endsWith(n)&&(t.setAttributes(Wf(a)),r())})})}function Dq(t,e){let n=Kn();if(n){let r,o;try{r=new URL(t,n),o=new URL(n).origin}catch{return!1}let i=r.origin===o;return e?tn(r.toString(),e)||i&&tn(r.pathname,e):i}else{let r=!!t.match(/^\/(?!\/)/);return e?tn(t,e):r}}function Lq(t,e,n,r,o,i){let a=t.xhr,s=a?.[tr];if(!a||a.__sentry_own_request__||!s)return;let{url:l,method:c}=s,d=De()&&e(l);if(t.endTimestamp){let S=a.__sentry_xhr_span_id__;if(!S)return;let E=r[S];E&&(d&&s.status_code!==void 0&&(ri(E,s.status_code),E.end(),i?.(E,{headers:YE(Jf(a)),error:t.error})),delete r[S]);return}let u=VE(l),p=u?Qr(u):Qr(l),f=u?Yn(u):void 0,m=Yn(Gc(l)),_=P(),h=!!Ot()||!!_&&je(_),b=d&&h?Ae({name:`${c} ${m}`,attributes:{url:Yn(l),type:"xhr","http.method":c,"http.url":f,"url.full":f,"server.address":p?.host,[at]:"auto.http.browser",[ht]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new ur;return d&&!h&&_?.recordDroppedEvent("no_parent_span","span"),a.__sentry_xhr_span_id__=b.spanContext().spanId,r[a.__sentry_xhr_span_id__]=b,n(l)&&Uq(a,De()&&h?b:void 0,o),_&&_.emit("beforeOutgoingRequestSpan",b,t),b}function Uq(t,e,n){let{"sentry-trace":r,baggage:o,traceparent:i}=el({span:e,propagateTraceparent:n});r&&Bq(t,r,o,i)}function Bq(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||!I2(i))&&t.setRequestHeader("baggage",n)}}catch{}}var N2=new WeakMap,C2=new WeakMap,Pq=9e4,zq=["text/event-stream","application/x-ndjson","application/stream+json"],nb=()=>({name:"FetchStreamPerformance",setup(){Lh(t=>{if(t.response){let e=N2.get(t.response);if(e&&t.endTimestamp){e.end(t.endTimestamp);let n=C2.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")||!zq.some(l=>e.startsWith(l)))return;let n=t.fetchData?.url||"",r=t.fetchData?.method||"GET",o=ui(n),i=n.startsWith("data:")?Yn(n):o?Hc(o):n,a=Ae({name:`${r} ${i}`,startTime:t.endTimestamp,attributes:{url:Yn(n),"http.method":r,type:"fetch",[ht]:"http.client.stream",[at]:"auto.http.browser.stream"}});N2.set(t.response,a);let s=setTimeout(()=>{a.isRecording()&&a.end()},Pq);C2.set(t.response,s)}})}});var WE="WebVitals",rb=(t={})=>{let e=new Set(t.ignore??[]);return{name:WE,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=xS({recordClsStandaloneSpans:a,recordLcpStandaloneSpans:s,client:n}),c=new WeakSet;n.on("afterStartPageLoadSpan",d=>{c.add(d)}),n.on("spanEnd",d=>{c.delete(d)&&(l(),NS(d,{recordClsOnPageloadSpan:a===!1,recordLcpOnPageloadSpan:s===!1,spanStreamingEnabled:r}))}),r?(e.has("lcp")||BS(n),e.has("cls")||PS(n),e.has("inp")||zS()):e.has("inp")||DS()},afterAllSetup(){e.has("inp")||LS()}}};function M2(){q.document?q.document.addEventListener("visibilitychange",()=>{let t=Ot();if(!t)return;let e=Bt(t);if(q.document.hidden&&e){let n="cancelled",{op:r,status:o}=et(e);W&&w.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||e.setStatus({code:2,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):W&&w.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Fq=3600,O2="sentry_previous_trace",Hq="sentry.previous_trace";function D2(t,{linkPreviousTrace:e,consistentTraceSampling:n}){let r=e==="session-storage",o=r?jq():void 0;t.on("spanStart",a=>{if(Bt(a)!==a)return;let s=rt().getPropagationContext();o=Gq(o,a,s),r&&$q(o)});let i=!0;n&&t.on("beforeSampling",a=>{if(!o)return;let s=rt(),l=s.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}s.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(KE(o.spanContext))},sampleRand:o.sampleRand}),a.parentSampled=KE(o.spanContext),a.parentSampleRate=o.sampleRate,a.spanAttributes={...a.spanAttributes,[Tc]:o.sampleRate}})}function Gq(t,e,n){let r=et(e);function o(){try{let s=Number(r.data?.[ni]??n.dsc?.sample_rate);return Number.isNaN(s)?0:s}catch{return 0}}let i={spanContext:e.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!t)return i;let a=t.spanContext;return a.traceId===r.trace_id?t:(Date.now()/1e3-t.startTimestamp<=Fq&&(W&&w.log(`Adding previous_trace \`${JSON.stringify(a)}\` link to span \`${JSON.stringify({op:r.op,...e.spanContext()})}\``),e.addLink({context:a,attributes:{[Sg]:"previous_trace"}}),e.setAttribute(Hq,`${a.traceId}-${a.spanId}-${KE(a)?1:0}`)),i)}function $q(t){try{q.sessionStorage.setItem(O2,JSON.stringify(t))}catch(e){W&&w.warn("Could not store previous trace in sessionStorage",e)}}function jq(){try{let t=q.sessionStorage?.getItem(O2);return JSON.parse(t)}catch{return}}function KE(t){return t.traceFlags===1}var qq="BrowserTracing",Vq=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function XE(){let t=q.navigator;return t?.userAgent?Vq.test(t.userAgent):!1}var Yq={...Cc,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...gp},Ur=((t={})=>{"enableElementTiming"in t&&fn(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let e={name:void 0,source:void 0},n=q.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:a,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:d,finalTimeout:u,childSpanTimeout:p,markBackgroundSpan:f,traceFetch:m,traceXHR:_,trackFetchStreamPerformance:v,shouldCreateSpanForRequest:h,enableHTTPTimings:b,ignoreResourceSpans:S,ignorePerformanceApiSpans:E,instrumentPageLoad:R,instrumentNavigation:C,detectRedirects:I,linkPreviousTrace:D,consistentTraceSampling:z,enableReportPageLoaded:U,onRequestSpanStart:O,onRequestSpanEnd:N}={...Yq,...t},B=XE(),V,st;function nt(lt,X,ct=!0){let F=X.op==="pageload",gt=X.name,Q=c?c(X):X,dt=Q.attributes||{};if(gt!==Q.name&&(dt[Mt]="custom",Q.attributes=dt),!ct){let bn=sr();Ae({...Q,startTime:bn}).end(bn);return}e.name=Q.name,e.source=dt[Mt];let Xt=zg(Q,{idleTimeout:d,finalTimeout:u,childSpanTimeout:p,disableAutoFinish:F,beforeSpanEnd:bn=>{RS(bn,{ignoreResourceSpans:S,ignorePerformanceApiSpans:E,spanStreamingEnabled:je(lt)}),B2(lt,void 0);let Pn=rt(),Z=Pn.getPropagationContext();Pn.setPropagationContext({...Z,traceId:Xt.spanContext().traceId,sampled:Tn(Xt),dsc:$e(bn)}),F&&(st=void 0)},trimIdleSpanEndTimestamp:!U});F&&U&&(st=Xt),B2(lt,Xt);function Ce(){n&&["interactive","complete"].includes(n.readyState)&&(lt.emit("idleSpanEnableAutoFinish",Xt),n.removeEventListener("readystatechange",Ce))}F&&!U&&n&&(n.addEventListener("readystatechange",Ce),Ce())}return{name:qq,setup(lt){if(B){W&&w.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(mf(),i&&tt.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?IS():o&&AS(),a&&kS(),I&&n){let ct=()=>{V=Ct()};addEventListener("click",ct,{capture:!0}),addEventListener("keydown",ct,{capture:!0,passive:!0})}function X(){let ct=hp(lt);ct&&!et(ct).timestamp&&(W&&w.log(`[Tracing] Finishing current active span with op: ${et(ct).op}`),ct.setAttribute(Li,"cancelled"),ct.end())}lt.on("startNavigationSpan",(ct,F)=>{if(P()!==lt)return;if(F?.isRedirect){W&&w.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),nt(lt,{op:"navigation.redirect",...ct},!1);return}V=void 0,X(),Pt().setPropagationContext({traceId:Cn(),sampleRand:Math.random(),propagationSpanId:De()?void 0:Gn()});let gt=rt();gt.setPropagationContext({traceId:Cn(),sampleRand:Math.random(),propagationSpanId:De()?void 0:Gn()}),gt.setSDKProcessingMetadata({normalizedRequest:void 0}),nt(lt,{op:"navigation",...ct,parentSpan:null,forceTransaction:!0})}),lt.on("startPageLoadSpan",(ct,F={})=>{if(P()!==lt)return;X();let gt=F.sentryTrace||L2("sentry-trace")||U2("sentry-trace"),Q=F.baggage||L2("baggage")||U2("baggage"),dt=sf(gt,Q),Xt=rt();Xt.setPropagationContext(dt),De()||(Xt.getPropagationContext().propagationSpanId=Gn()),Xt.setSDKProcessingMetadata({normalizedRequest:cu()}),nt(lt,{op:"pageload",...ct})}),lt.on("endPageloadSpan",()=>{U&&st&&(st.setAttribute(Li,"reportPageLoaded"),st.end())})},afterAllSetup(lt){if(B)return;lt.addIntegration&&!lt.getIntegrationByName?.(WE)&&lt.addIntegration(rb({ignore:r?[]:["inp"],_experiments:{enableStandaloneClsSpans:s,enableStandaloneLcpSpans:l}}));let X=Kn();if(D!=="off"&&D2(lt,{linkPreviousTrace:D,consistentTraceSampling:z}),q.location){if(R){let ct=ne();Yo(lt,{name:q.location.pathname,startTime:ct?ct/1e3:void 0,attributes:{[Mt]:"url",[at]:"auto.pageload.browser"}})}C&&Wi(({to:ct,from:F})=>{if(F===void 0&&X?.indexOf(ct)!==-1){X=void 0;return}X=void 0;let gt=ui(ct),Q=hp(lt),dt=Q&&I&&Kq(Q,V);Wo(lt,{name:gt?.pathname||q.location.pathname,attributes:{[Mt]:"url",[at]:"auto.navigation.browser"}},{url:ct,isRedirect:dt})})}f&&M2(),a&&Wq(lt,d,u,p,e),eb(lt,{traceFetch:m,traceXHR:_,tracePropagationTargets:lt.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:h,enableHTTPTimings:b,onRequestSpanStart:O,onRequestSpanEnd:N}),v&&lt.addIntegration(nb())}}});function Yo(t,e,n){t.emit("startPageLoadSpan",e,n),rt().setTransactionName(e.name);let r=hp(t);return r&&t.emit("afterStartPageLoadSpan",r),r}function Wo(t,e,n){let{url:r,isRedirect:o}=n||{};t.emit("beforeStartNavigationSpan",e,{isRedirect:o}),t.emit("startNavigationSpan",e,{isRedirect:o});let i=rt();return i.setTransactionName(e.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...cu(),url:r}}),hp(t)}function L2(t){return q.document?.querySelector(`meta[name=${t}]`)?.getAttribute("content")||void 0}function U2(t){return q.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===t)?.description}function Wq(t,e,n,r,o){let i=q.document,a,s=()=>{let l="ui.action.click",c=hp(t);if(c){let d=et(c).op;if(["navigation","pageload"].includes(d)){W&&w.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(a&&(a.setAttribute(Li,"interactionInterrupted"),a.end(),a=void 0),!o.name){W&&w.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}a=zg({name:o.name,op:l,attributes:{[Mt]:o.source||"url"}},{idleTimeout:e,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",s,{capture:!0})}var z2="_sentry_idleSpan";function hp(t){return t[z2]}function B2(t,e){Gt(t,z2,e)}var P2=1.5;function Kq(t,e){let n=et(t),r=sr(),o=n.start_timestamp;return!(r-o>P2||e&&r-e<=P2)}function F2(t=P()){t?.emit("endPageloadSpan")}function H2(t){let e=Ot();if(e===t)return;let n=rt();t.end=new Proxy(t.end,{apply(r,o,i){return Zn(n,e),Reflect.apply(r,o,i)}}),Zn(n,t)}var G2=()=>({name:"SpanStreaming",beforeSetup(t){let e=t.getOptions();e.traceLifecycle||(W&&w.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),e.traceLifecycle="stream")},setup(t){let e="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=t.getOptions();if(!je(t)){r.traceLifecycle="static",W&&w.warn(`${e} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!Pi(o)){r.traceLifecycle="static",W&&w.warn(`${e} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let i=new Hf(t);t.on("afterSpanEnd",a=>{Tn(a)&&i.add(Hg(a,t))}),t.on("afterSegmentSpanEnd",a=>{let s=a.spanContext().traceId;setTimeout(()=>{i.flush(s)},500)})}});function Bu(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Xq(t,e){let n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);let r=Bu(n);return o=>r.then(i=>o(i.transaction(e,"readwrite").objectStore(e)))}function JE(t){return Bu(t.getAllKeys())}function Jq(t,e,n){return t(r=>JE(r).then(o=>{if(!(o.length>=n))return r.put(e,Math.max(...o,0)+1),Bu(r.transaction)}))}function Qq(t,e,n){return t(r=>JE(r).then(o=>{if(!(o.length>=n))return r.put(e,Math.min(...o,0)-1),Bu(r.transaction)}))}function Zq(t){return t(e=>JE(e).then(n=>{let r=n[0];if(r!=null)return Bu(e.get(r)).then(o=>(e.delete(r),Bu(e.transaction).then(()=>o)))}))}function tV(t){let e;function n(){return e==null&&(e=Xq(t.dbName||"sentry-offline",t.storeName||"queue")),e}return{push:async r=>{try{let o=zi(r);await Jq(n(),o,t.maxQueueSize||30)}catch{}},unshift:async r=>{try{let o=zi(r);await Qq(n(),o,t.maxQueueSize||30)}catch{}},shift:async()=>{try{let r=await Zq(n());if(r)return Lg(r)}catch{}}}}function eV(t){return e=>{let n=t({...e,createStore:tV});return q.addEventListener("online",async r=>{await n.flush()}),n}}function $2(t=Su){return eV(gv(t))}var j2=1e6,nV="window"in tt&&tt.window===tt&&typeof importScripts>"u",wl=String(0),ZE=nV?"main":"worker",ob=q.navigator,V2="",Y2="",W2="",QE=ob?.userAgent||"",K2="",rV=ob?.language||ob?.languages?.[0]||"";function oV(t){return typeof t=="object"&&t!==null&&"getHighEntropyValues"in t}var q2=ob?.userAgentData;oV(q2)&&q2.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(t=>{if(V2=t.platform||"",W2=t.architecture||"",K2=t.model||"",Y2=t.platformVersion||"",t.fullVersionList?.length){let e=t.fullVersionList[t.fullVersionList.length-1];QE=`${e.brand} ${e.version}`}}).catch(t=>{});function iV(t){return!("thread_metadata"in t)}function aV(t){return iV(t)?uV(t):t}function sV(t){let e=t.contexts?.trace?.trace_id;return typeof e=="string"&&e.length!==32&&W&&w.log(`[Profiling] Invalid traceId: ${e} on profiled event`),typeof e!="string"?"":e}function lV(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=sV(r),i=aV(n),a=e||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:Ct()*1e3),s=typeof r.timestamp=="number"?r.timestamp*1e3:Ct()*1e3;return{event_id:t,timestamp:new Date(a).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||zo,runtime:{name:"javascript",version:q.navigator.userAgent},os:{name:V2,version:Y2,build_number:QE},device:{locale:rV,model:K2,manufacturer:QE,architecture:W2,is_emulator:!1},debug_meta:{images:tM(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||ae(),trace_id:o,active_thread_id:wl,relative_start_ns:"0",relative_end_ns:((s-a)*1e6).toFixed(0)}]}}function X2(t,e,n){if(t==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${t} instead.`);let r=cV(t),o=e.getOptions(),i=e.getSdkMetadata?.()?.sdk;return{chunk_id:ae(),client_sdk:{name:i?.name??"sentry.javascript.browser",version:i?.version??"0.0.0"},profiler_id:n||ae(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:tM(t.resources)},profile:r}}function J2(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 cV(t){let e=[];for(let s=0;s<t.frames.length;s++){let l=t.frames[s];l&&(e[s]={function:l.name,abs_path:typeof l.resourceId=="number"?t.resources[l.resourceId]:void 0,lineno:l.line,colno:l.column})}let n=[];for(let s=0;s<t.stacks.length;s++){let l=t.stacks[s];if(!l)continue;let c=[],d=l;for(;d;)c.push(d.frameId),d=d.parentId===void 0?void 0:t.stacks[d.parentId];n[s]=c}let r=ne(),o=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,i=o-(r||o),a=[];for(let s=0;s<t.samples.length;s++){let l=t.samples[s];if(!l)continue;let c=(o+(l.timestamp-i))/1e3;a[s]={stack_id:l.stackId??0,thread_id:wl,timestamp:c}}return{frames:e,stacks:n,samples:a,thread_metadata:{[wl]:{name:ZE}}}}function ib(t){return et(t).op==="pageload"}function uV(t){let e,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[wl]:{name:ZE}}},o=t.samples[0];if(!o)return r;let i=o.timestamp,a=ne(),s=typeof performance.timeOrigin=="number"?performance.timeOrigin:a||0,l=s-(a||s);return t.samples.forEach((c,d)=>{if(c.stackId===void 0){e===void 0&&(e=n,r.stacks[e]=[],n++),r.samples[d]={elapsed_since_start_ns:((c.timestamp+l-i)*j2).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)*j2).toFixed(0),stack_id:n,thread_id:wl};r.stacks[n]=p,r.samples[d]=f,n++}),r}function Q2(t,e){if(!e.length)return t;for(let n of e)t[1].push([{type:"profile"},n]);return t}function Z2(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 tM(t){let r=P()?.getOptions()?.stackParser;return r?X0(r,t):[]}function eM(t){return typeof t!="number"&&typeof t!="boolean"||typeof t=="number"&&isNaN(t)?(W&&w.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t===!0||t===!1?!0:t<0||t>1?(W&&w.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}function dV(t){return t.samples.length<2?(W&&w.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):t.frames.length?!0:(W&&w.log("[Profiling] Discarding profile because it contains no frames"),!1)}var tT=!1,eT=3e4;function fV(t){return typeof t=="function"}function ab(){let t=q.Profiler;if(!fV(t)){W&&w.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}let e=10,n=Math.floor(eT/e);try{return new t({sampleInterval:e,maxBufferSize:n})}catch{W&&(w.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),w.log("[Profiling] Disabling profiling for current user session.")),tT=!0}}function nT(t){if(tT)return W&&w.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!t.isRecording())return W&&w.log("[Profiling] Discarding profile because root span was not sampled."),!1;let n=P()?.getOptions();if(!n)return W&&w.log("[Profiling] Profiling disabled, no options found."),!1;let r=n.profilesSampleRate;return eM(r)?r?(r===!0?!0:Math.random()<r)?!0:(W&&w.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(W&&w.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(W&&w.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function nM(t){if(tT)return W&&w.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if(t.profileLifecycle!=="trace"&&t.profileLifecycle!=="manual")return W&&w.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let e=t.profileSessionSampleRate;return eM(e)?e?Math.random()<=e:(W&&w.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(W&&w.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function yp(t){return typeof t.profilesSampleRate<"u"}function rM(t,e,n,r){return dV(n)?lV(t,e,n,r):null}var Tl=new Map;function oM(){return Tl.size}function iM(t){let e=Tl.get(t);return e&&Tl.delete(t),e}function aM(t,e){if(Tl.set(t,e),Tl.size>30){let n=Tl.keys().next().value;n!==void 0&&Tl.delete(n)}}var sb=new WeakSet;function xl(t){t.setAttribute("thread.id",wl),t.setAttribute("thread.name",ZE)}function rT(t){let e;ib(t)&&(e=Ct()*1e3);let n=ab();if(!n)return;W&&w.log(`[Profiling] started profiling span: ${et(t).description}`);let r=ae(),o=null;rt().setContext("profile",{profile_id:r,start_timestamp:e}),sb.add(t),xl(t);async function i(){if(t&&n){if(o){W&&w.log("[Profiling] profile for:",et(t).description,"already exists, returning early");return}return n.stop().then(c=>{if(a&&(q.clearTimeout(a),a=void 0),W&&w.log(`[Profiling] stopped profiling of span: ${et(t).description}`),!c){W&&w.log(`[Profiling] profiler returned null profile for: ${et(t).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=c,aM(r,c)}).catch(c=>{W&&w.log("[Profiling] error while stopping profiler:",c)})}}let a=q.setTimeout(()=>{W&&w.log("[Profiling] max profile duration elapsed, stopping profiling for:",et(t).description),i()},eT),s=t.end.bind(t);function l(){return t?(i().then(()=>{s()},()=>{s()}),t):s()}t.end=l}var pV=6e4,mV=3e5,lb=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=nM(e.getOptions());W&&w.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||W&&w.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=ae(),this._client=e,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(e),e.on("spanStart",o=>{this._isRunning&&xl(o)})}start(){if(this._lifecycleMode==="trace"){W&&w.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){W&&w.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){W&&w.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){W&&w.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){W&&w.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(e){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;let n=e.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);let r=this._activeRootSpanIds.size;r===1&&(W&&w.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling()),this._isRunning&&xl(e)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,W&&w.log("[Profiling] Started profiling with profiler ID:",this._profilerId),lr().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){W&&w.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(e=>{W&&w.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)}),this._lifecycleMode==="manual"&&lr().setContext("profile",{}))}_setupTraceLifecycleListeners(e){e.on("spanStart",n=>{if(!this._sessionSampled){W&&w.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==Bt(n))return;if(!n.isRecording()){W&&w.log("[Profiling] Discarding profile because root span was not sampled.");return}let r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);let o=this._activeRootSpanIds.size;o===1&&(W&&w.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${o}).`),this._beginProfiling())}),e.on("spanEnd",n=>{if(!this._sessionSampled)return;let r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);let o=this._activeRootSpanIds.size;W&&w.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${o}).`),o===0&&(this._collectCurrentChunk().catch(i=>{W&&w.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",i)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,lr().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(e=>clearTimeout(e)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(e){this._activeRootSpanIds.add(e);let n=setTimeout(()=>this._onRootSpanTimeout(e),mV);this._rootSpanTimeouts.set(e,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let e=ab();if(!e){W&&w.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=e}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{W&&w.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",e)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},pV))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(W&&w.log(`[Profiling] Reached 5-minute timeout for root span ${e}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(e),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){let e=this._profiler;if(this._profiler=void 0,!!e)try{let n=await e.stop(),r=X2(n,this._client,this._profilerId),o=J2(r);if("reason"in o){W&&w.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),W&&w.log("[Profiling] Collected browser profile chunk.")}catch(n){W&&w.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(e){let n=this._client,r=Fo(n.getSdkMetadata?.()),o=n.getDsn(),i=n.getOptions().tunnel,a=Le({event_id:ae(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&o&&{dsn:en(o)}},[[{type:"profile_chunk",platform:"javascript"},e]]);n.sendEnvelope(a).then(null,s=>{W&&w.error("Error while sending profile chunk envelope:",s)})}};var gV="BrowserProfiling",hV=(()=>({name:gV,setup(t){let e=t.getOptions(),n=new lb;if(!yp(e)&&!e.profileLifecycle&&(e.profileLifecycle="manual"),yp(e)&&!e.profilesSampleRate){W&&w.log("[Profiling] Profiling disabled, no profiling options found.");return}let r=Ot(),o=r&&Bt(r);if(yp(e)&&e.profileSessionSampleRate!==void 0&&W&&w.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),yp(e))o&&ib(o)&&nT(o)&&rT(o),t.on("spanStart",i=>{let a=Bt(i);i===a?nT(i)&&rT(i):sb.has(a)&&xl(i)}),t.on("beforeEnvelope",i=>{if(!oM())return;let a=Z2(i);if(!a.length)return;let s=[];for(let l of a){let c=l?.contexts,d=c?.profile?.profile_id,u=c?.profile?.start_timestamp;if(typeof d!="string"){W&&w.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!d){W&&w.log("[Profiling] cannot find profile for a span without a profile context");continue}c?.profile&&delete c.profile;let p=iM(d);if(!p){W&&w.log(`[Profiling] Could not retrieve profile for span: ${d}`);continue}let f=rM(d,u,p,l);f&&s.push(f)}Q2(i,s)});else{let i=e.profileLifecycle;if(t.on("startUIProfiler",()=>n.start()),t.on("stopUIProfiler",()=>n.stop()),i==="manual")n.initialize(t);else if(i==="trace"){if(!De(e)){W&&w.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(t),o&&n.notifyRootSpanActive(o),q.setTimeout(()=>{let a=Ot(),s=a&&Bt(a);s&&n.notifyRootSpanActive(s)},0)}}}})),sM=hV;var yV="SpotlightBrowser",bV=[{op:"ui.interaction.click",name:"#sentry-spotlight"}],_V=((t={})=>{let e=t.sidecarUrl||"http://localhost:8969/stream";return{name:yV,setup:()=>{W&&w.log("Using Sidecar URL",e)},beforeSetup(n){let r=n.getOptions();r.ignoreSpans=[...r.ignoreSpans||[],...bV]},afterAllSetup:n=>{vV(n,e)}}});function vV(t,e){let n=_u("fetch"),r=0;t.on("beforeEnvelope",o=>{if(r>3){w.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(e,{method:"POST",body:zi(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(i=>{i.status>=200&&i.status<400&&(r=0)},i=>{r++,w.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",i)})})}var lM=_V;var cM=()=>({name:"LaunchDarkly",processEvent(t,e,n){return Nr(t)}});function uM(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(t,e,n)=>{fr(t,e.value),pr(t,e.value)}}}var dM=()=>({name:"OpenFeature",processEvent(t,e,n){return Nr(t)}}),cb=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 fM=({featureFlagClientClass:t})=>({name:"Unleash",setupOnce(){let e=t.prototype;ye(e,"isEnabled",SV)},processEvent(e,n,r){return Nr(e)}});function SV(t){return function(...e){let n=e[0],r=t.apply(this,e);return typeof n=="string"&&typeof r=="boolean"?(fr(n,r),pr(n,r)):W&&w.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var pM=(({growthbookClass:t})=>Cv({growthbookClass:t}));var mM=({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 Nr(e)}});async function gM(){let t=P();if(!t)return"no-client-active";if(!t.getDsn())return"no-dsn-configured";let r=t.getOptions().tunnel||"https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";try{await Nc(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}var EV="WebWorker",yM=({worker:t})=>({name:EV,setupOnce:()=>{(Array.isArray(t)?t:[t]).forEach(e=>hM(e))},addWorker:e=>hM(e)});function hM(t){t.addEventListener("message",e=>{if(wV(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(W&&w.log("Sentry debugId web worker message received",e.data),q._sentryDebugIds={...e.data._sentryDebugIds,...q._sentryDebugIds}),e.data._sentryModuleMetadata&&(W&&w.log("Sentry module metadata web worker message received",e.data),q._sentryModuleMetadata={...e.data._sentryModuleMetadata,...q._sentryModuleMetadata}),e.data._sentryWasmImages){W&&w.log("Sentry WASM images web worker message received",e.data);let n=q._sentryWasmImages||[],r=e.data._sentryWasmImages.filter(o=>he(o)&&typeof o.code_file=="string"&&!n.some(i=>i.code_file===o.code_file));q._sentryWasmImages=[...n,...r]}e.data._sentryWorkerError&&(W&&w.log("Sentry worker rejection message received",e.data._sentryWorkerError),TV(e.data._sentryWorkerError))}})}function TV(t){let e=P();if(!e)return;let n=e.getOptions().stackParser,r=e.getOptions().attachStacktrace,o=t.reason,i=Ze(o)?WS(o):du(n,o,void 0,r,!0);i.level="error",t.filename&&(i.contexts={...i.contexts,worker:{filename:t.filename}}),Jr(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),W&&w.log("Captured worker unhandled rejection",o)}function bM({self:t}){t.postMessage({_sentryMessage:!0,_sentryDebugIds:t._sentryDebugIds??void 0,_sentryModuleMetadata:t._sentryModuleMetadata??void 0}),t.addEventListener("unhandledrejection",e=>{let r={reason:YS(e),filename:t.location?.href};t.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),W&&w.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),W&&w.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function wV(t){if(!he(t)||t._sentryMessage!==!0)return!1;let e="_sentryDebugIds"in t,n="_sentryModuleMetadata"in t,r="_sentryWorkerError"in t,o="_sentryWasmImages"in t;return!(!e&&!n&&!r&&!o||e&&!(he(t._sentryDebugIds)||t._sentryDebugIds===void 0)||n&&!(he(t._sentryModuleMetadata)||t._sentryModuleMetadata===void 0)||r&&!he(t._sentryWorkerError)||o&&(!Array.isArray(t._sentryWasmImages)||!t._sentryWasmImages.every(i=>he(i)&&typeof i.code_file=="string")))}var vM=Wr(Ea(),1);function _M(t){return he(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function ub(t){let e={...t};Mf(e,"react"),La("react",{version:vM.version});let n=XS(e);return _c(xV),n}function xV(t){return _M(t)?"[SyntheticEvent]":Tu(t)}var SM=Wr(Ea(),1);function AV(t){let e=t.match(/^([^.]+)/);return e!==null&&parseInt(e[0])>=17}function IV(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 bp(t,{componentStack:e},n){if(AV(SM.version)&&pn(t)&&e){let r=new Error(t.message);r.name=`React ErrorBoundary ${t.name}`,r.stack=e,IV(t,r)}return Et(t,n)}function EM(t){return(e,n)=>{let r=!!t,o=bp(e,n,{mechanism:{handled:r,type:"auto.function.react.error_handler"}});r&&t(e,n,o)}}var Ji=Wr(Ea(),1);var oT="ui.react.render",TM="ui.react.update",iT="ui.react.mount";var kV={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},RV={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},NV={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},kM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},CV=Symbol.for("react.forward_ref"),RM=Symbol.for("react.memo");function MV(t){return typeof t=="object"&&t!==null&&t.$$typeof===RM}var aT={};aT[CV]=NV;aT[RM]=kM;function wM(t){if(MV(t))return kM;let e=t.$$typeof;return e&&aT[e]||kV}var OV=Object.defineProperty.bind(Object),DV=Object.getOwnPropertyNames.bind(Object),xM=Object.getOwnPropertySymbols?.bind(Object),AM=Object.getOwnPropertyDescriptor.bind(Object),LV=Object.getPrototypeOf.bind(Object),IM=Object.prototype;function Xi(t,e,n){if(typeof e!="string"){if(IM){let a=LV(e);a&&a!==IM&&Xi(t,a)}let r=DV(e);xM&&(r=r.concat(xM(e)));let o=wM(t),i=wM(e);for(let a of r)if(!RV[a]&&!i?.[a]&&!o?.[a]&&!AM(t,a)){let s=AM(e,a);if(s)try{OV(t,a,s)}catch{}}}return t}var UV="unknown",Pu=class extends Ji.Component{constructor(e){super(e);let{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=Ae({name:`<${n}>`,onlyIfParent:!0,op:iT,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=Ct();this._updateSpan=Xr(this._mountSpan,()=>Ae({name:`<${this.props.name}>`,onlyIfParent:!0,op:TM,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=Ct(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){let o=et(this._mountSpan).timestamp;Xr(this._mountSpan,()=>{let i=Ae({onlyIfParent:!0,name:`<${n}>`,op:oT,startTime:o,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":n}});i&&i.end(e)})}}render(){return this.props.children}};Object.assign(Pu,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});function NM(t,e){let n=e?.name||t.displayName||t.name||UV,r=o=>Ji.createElement(Pu,{...e,name:n,updateProps:o},Ji.createElement(t,{...o}));return r.displayName=`profiler(${n})`,Xi(r,t),r}function CM(t,e={disabled:!1,hasRenderSpan:!0}){let[n]=Ji.useState(()=>{if(!e?.disabled)return Ae({name:`<${t}>`,onlyIfParent:!0,op:iT,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":t}})});Ji.useEffect(()=>(n&&n.end(),()=>{if(n&&e.hasRenderSpan){let r=et(n).timestamp,o=Ct(),i=Ae({name:`<${t}>`,onlyIfParent:!0,op:oT,startTime:r,attributes:{[at]:"auto.ui.react.profiler","ui.component_name":t}});i&&i.end(o)}}),[])}var Si=Wr(Ea(),1);var Be=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var BV="unknown",sT={componentStack:null,error:null,eventId:null},_p=class extends Si.Component{constructor(e){super(e),this.state=sT,this._openFallbackReportDialog=!0;let n=P();n&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Qf({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:a,dialogOptions:s}=this.props;Oe(l=>{o&&o(l,e,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,d=bp(e,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(e,r,d),a&&(this._lastEventId=d,this._openFallbackReportDialog&&Qf({...s,eventId:d})),this.setState({error:e,componentStack:r,eventId:d})})}componentDidMount(){let{onMount:e}=this.props;e&&e()}componentWillUnmount(){let{error:e,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===sT?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(sT)}render(){let{fallback:e,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;let o=typeof e=="function"?Si.createElement(e,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):e;return Si.isValidElement(o)?o:(e&&Be&&w.warn("fallback did not produce a valid ReactElement"),null)}};function MM(t,e){let n=t.displayName||t.name||BV,r=Si.memo(o=>Si.createElement(_p,{...e},Si.createElement(t,{...o})));return r.displayName=`errorBoundary(${n})`,Xi(r,t),r}var PV="redux.action",zV="info",FV={attachReduxState:!0,actionTransformer:t=>t,stateTransformer:t=>t||null};function OM(t){let e={...FV,...t};return n=>(r,o)=>{e.attachReduxState&&lr().addEventProcessor((s,l)=>{try{s.type===void 0&&s.contexts.state.state.type==="redux"&&(l.attachments=[...l.attachments||[],{filename:"redux_state.json",data:JSON.stringify(s.contexts.state.state.value)}])}catch{}return s});function i(s){return(l,c)=>{let d=s(l,c),u=rt(),p=e.actionTransformer(c);typeof p<"u"&&p!==null&&wn({category:PV,data:p,type:zV});let f=e.stateTransformer(d);if(typeof f<"u"&&f!==null){let h=P()?.getOptions()?.normalizeDepth||3,b={state:{type:"redux",value:f}};x0(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 LM(t){let e=Ur({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,match:o,instrumentPageLoad:i=!0,instrumentNavigation:a=!0}=t;return{...e,afterAllSetup(s){e.afterAllSetup(s),i&&q.location&&DM(r,q.location,o,(l,c="url")=>{Yo(s,{name:l,attributes:{[ht]:"pageload",[at]:"auto.pageload.react.reactrouter_v3",[Mt]:c}})}),a&&n.listen&&n.listen(l=>{(l.action==="PUSH"||l.action==="POP")&&DM(r,l,o,(c,d="url")=>{Wo(s,{name:c,attributes:{[ht]:"navigation",[at]:"auto.navigation.react.reactrouter_v3",[Mt]:d}})})})}}}function DM(t,e,n,r){let o=e.pathname;n({location:e,routes:t},(i,a,s)=>{if(i||!s)return r(o);let l=HV(s.routes||[]);return l.length===0||l==="/*"?r(o):(o=l,r(o,"route"))})}function HV(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 BM(t,e={}){let n=t,r=Ur({...e,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:o=!0,instrumentNavigation:i=!0}=e;return{...r,afterAllSetup(a){r.afterAllSetup(a);let s=q.location;if(o&&s){let l=n.matchRoutes(s.pathname,n.options.parseSearch(s.search),{preload:!1,throwOnError:!1}),c=l[l.length-1],d=c?.routeId!=="__root__"?c:void 0;Yo(a,{name:d?d.routeId:s.pathname,attributes:{[ht]:"pageload",[at]:"auto.pageload.react.tanstack_router",[Mt]:d?"route":"url",...UM(d)}})}i&&n.subscribe("onBeforeNavigate",l=>{if(!l.fromLocation||l.toLocation.state===l.fromLocation.state)return;let c=n.matchRoutes(l.toLocation.pathname,l.toLocation.search,{preload:!1,throwOnError:!1}),d=c[c.length-1],u=d?.routeId!=="__root__"?d:void 0,p=q.location,f=Wo(a,{name:u?u.routeId:p.pathname,attributes:{[ht]:"navigation",[at]:"auto.navigation.react.tanstack_router",[Mt]: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(Mt,"route"),f.setAttributes(UM(b)))}})})}}}function UM(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 PM=Wr(Ea(),1);function zM(t){let e=Ur({...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),HM(s,i,a,n,"reactrouter_v4",r,o)}}}function FM(t){let e=Ur({...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),HM(s,i,a,n,"reactrouter_v5",r,o)}}}function HM(t,e,n,r,o,i=[],a){function s(){if(r.location)return r.location.pathname;if(q.location)return q.location.pathname}function l(c){if(i.length===0||!a)return[c,"url"];let d=GM(i,c,a);for(let u of d)if(u.match.isExact)return[u.match.path,"route"];return[c,"url"]}if(e){let c=s();if(c){let[d,u]=l(c);Yo(t,{name:d,attributes:{[ht]:"pageload",[at]:`auto.pageload.react.${o}`,[Mt]:u}})}}n&&r.listen&&r.listen((c,d)=>{if(d&&(d==="PUSH"||d==="POP")){let[u,p]=l(c.pathname);Wo(t,{name:u,attributes:{[ht]:"navigation",[at]:`auto.navigation.react.${o}`,[Mt]:p}})}})}function GM(t,e,n,r=[]){return t.some(o=>{let i=o.path?n(e,o):r.length?r[r.length-1].match:GV(e);return i&&(r.push({route:o,match:i}),o.routes&&GM(o.routes,e,n,r)),!!i}),r}function GV(t){return{path:"/",url:"/",params:{},isExact:t==="/"}}function $M(t){let e=t.displayName||t.name,n=r=>{if(r?.computedMatch?.isExact){let o=r.computedMatch.path,i=$V();rt().setTransactionName(o),i&&(i.updateName(o),i.setAttribute(Mt,"route"))}return PM.createElement(t,{...r})};return n.displayName=`sentryRoute(${e})`,Xi(n,t),n}function $V(){let t=Ot(),e=t&&Bt(t);if(!e)return;let n=et(e).op;return n==="navigation"||n==="pageload"?e:void 0}var Ei=Wr(Ea(),1);function zu(t,e){if(!e||e==="/"||!t.toLowerCase().startsWith(e.toLowerCase()))return t;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?t:t.slice(n)||"/"}var jM=new WeakMap;function WM(t,e,n){if(!t||!e?.length)return null;let r=n?zu(t,n):t,o=jM.get(e);o||(o=KV(e),jM.set(e,o),Be&&w.log("[React Router] Sorted route manifest by specificity:",o.length,"patterns"));for(let i of o)if(jV(r,i))return Be&&w.log("[React Router] Matched pathname",r,"to pattern",i),i;return Be&&w.log("[React Router] No manifest match found for pathname:",r),null}function jV(t,e){if(e==="/")return t==="/"||t==="";let n=VM(t),r=VM(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(!qM(n[a],s))return!1;return!0}if(n.length!==r.length)return!1;for(let[i,a]of r.entries())if(!qM(n[i],a))return!1;return!0}function qM(t,e){return t===void 0||e===void 0?!1:KM.test(e)?!0:t===e}function VM(t){return t.split("/").filter(Boolean)}var KM=/^:[\w-]+$/,qV=10,VV=3,YV=1,WV=-2;function YM(t){let e=t.split("/"),n=e.length;e.includes("*")&&(n+=WV);for(let r of e)r!=="*"&&(KM.test(r)?n+=VV:r===""?n+=YV:n+=qV);return n}function KV(t){return[...t].sort((e,n)=>{let r=YM(e);return YM(n)-r})}var lT,Al=!1,ts=[],XV=10;function ZM(t,e){let n={};return ts.length>=XV&&(Be&&w.warn("[React Router] Navigation context stack overflow - removing oldest context"),ts.shift()),ts.push({token:n,targetPath:t,span:e}),n}function tO(t){ts[ts.length-1]?.token===t&&ts.pop()}function cT(){let t=ts.length;return t>0?ts[t-1]??null:null}function eO(t,e=!1){lT=t,Al=e}function JV(t){return ZV(t.route.path||"")}function QV(t){return t.params["*"]||""}function ZV(t){return t[t.length-1]==="*"?t.slice(0,-1):t}function Fu(t){return t[t.length-1]==="/"?t.slice(0,-1):t}function nO(t){return t.endsWith("*")}function Qi(t){return t.includes("/*")||t.endsWith("*")}function XM(t,e){return nO(t)&&!!e.route.children?.length||!1}function tY(t){return!!(!t.children&&t.element&&t.path?.endsWith("/*"))}function eY(t,e,n){let r=t&&t.length>0?t:Al?zu(e,n):e,o=r.slice(-2)==="/*"?r.slice(0,-2):r;return o.length>1&&o[o.length-1]==="/"&&(o=o.slice(0,-1)),[o,"route"]}function JM(t){return t.split(/\\?\//).filter(e=>e.length>0&&e!==",").length}function db(t){return t[0]==="/"?t:`/${t}`}function rO(t,e){let n=lT(t,e);if(!n||n.length===0)return"";for(let r of n)if(r.route.path&&r.route.path!=="*"){let o=JV(r),i=zu(e.pathname,db(r.pathnameBase));return e.pathname===i?Fu(i):Fu(Fu(o||"")+db(rO(t.filter(a=>a!==r.route),{pathname:i})))}return""}function nY(t,e){let n=lT(e,t);if(n){for(let r of n)if(tY(r.route)&&QV(r))return!0}return!1}function QM(t,e){return Al?zu(t.pathname,e):t.pathname||""}function rY(t,e,n,r=""){if(!t||t.length===0)return[Al?zu(e.pathname,r):e.pathname,"url"];if(!n)return[QM(e,r),"url"];let o="";for(let i of n){let a=i.route;if(!a)continue;if(a.index)return eY(o,i.pathname,r);let s=a.path;if(!s||XM(s,i))continue;let l=s[0]==="/"||o[o.length-1]==="/"?s:`/${s}`;if(o=Fu(o)+db(l),Fu(e.pathname)===Fu(r+i.pathname))return JM(o)!==JM(i.pathname)&&!nO(o)?[(Al?"":r)+l,"route"]:(XM(o,i)&&(o=o.slice(0,-1)),[(Al?"":r)+o,"route"])}return[QM(e,r),"url"]}function vp(t,e,n,r,o="",i,a){if(a&&i&&i.length>0){let d=WM(t.pathname,i,o);if(d)return[(Al?"":o)+d,"route"]}let s,l="url",c=nY(t,n);return c&&(s=db(rO(n,t)),l="route"),(!c||!s)&&([s,l]=rY(e,t,r,o)),[s||t.pathname,l]}function uo(){let t=Ot(),e=t?Bt(t):void 0;if(!e)return;let n=et(e).op;return n==="navigation"||n==="pageload"?e:void 0}function oY(){let t=cT();if(t)return t.targetPath?{pathname:t.targetPath,search:"",hash:"",state:null,key:"default"}:null;if(typeof q<"u")try{let e=q.location;if(e)return{pathname:e.pathname,search:e.search||"",hash:e.hash||"",state:null,key:"default"}}catch{Be&&w.warn("[React Router] Could not access window.location")}return null}function iY(){let t=cT();return t?t.span:uo()}function aY(t,e,n,r){let o=new Proxy(t,{apply(i,a,s){let l=oY(),c=iY(),d=i.apply(a,s);return sY(d,e,n,r,l,c),d}});return Gt(o,"__sentry_proxied__",!0),o}function sY(t,e,n,r,o,i){Nn(t)?t.then(a=>{Array.isArray(a)&&r(a,e,o??void 0,i)}).catch(a=>{Be&&w.warn(`Error resolving async handler '${n}' for route`,e,a)}):Array.isArray(t)&&r(t,e,o??void 0,i)}function Sp(t,e){if(t.handle&&typeof t.handle=="object")for(let n of Object.keys(t.handle)){let r=t.handle[n];typeof r=="function"&&!r.__sentry_proxied__&&(t.handle[n]=aY(r,t,n,e))}if(Array.isArray(t.children))for(let n of t.children)Sp(n,e)}var Hu,es,ns,fb,fo,rs=!1,kl=3e3,Ep,mT="",aO=new WeakSet,sO=q?.document?Ei.useLayoutEffect:Ei.useEffect,Il=new WeakMap,An=new Set,pb=new WeakMap,dT=new WeakMap;function lY(t){return q?.requestAnimationFrame?q.requestAnimationFrame(t):setTimeout(t,0)}function oO(t){q?.cancelAnimationFrame?q.cancelAnimationFrame(t):clearTimeout(t)}function lO(t){return`${t.pathname}${t.search||""}${t.hash||""}`}function iO(t){return t.includes(":")||t.includes("*")}function cY(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&&iO(t.routeName),l=iO(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 cO(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 uO(t,e){let n=pb.get(t);n||(n=new Set,pb.set(t,n)),n.add(e),e.finally(()=>{let r=pb.get(t);r&&r.delete(e)})}function dO(t){let e=new Promise(n=>{dT.set(t,n)});uO(t,e)}function uY(t){let e=dT.get(t);e&&(e(),dT.delete(t),t.__sentry_may_have_lazy_routes__&&(t.__sentry_may_have_lazy_routes__=!1))}function gT(t,e,n=null,r){t.forEach(i=>{An.add(i),rs&&Sp(i,gT)}),e&&cO(t,e);let o=r??uo();if(o){let i=et(o);if(i.timestamp){Be&&w.warn("[React Router] Lazy handler resolved after span ended - skipping update");return}let a=i.op,s=n;if(!s&&!r&&typeof q<"u"){let l=q.location;l?.pathname&&(s={pathname:l.pathname})}s&&(a==="pageload"?wp({activeRootSpan:o,location:{pathname:s.pathname},routes:Array.from(An),allRoutes:Array.from(An)}):a==="navigation"&&fT(o,s,Array.from(An),!1,fo))}}function fT(t,e,n,r=!1,o){let i=et(t),a=i.description,s=t?.__sentry_navigation_name_set__,l=a&&Qi(a);if((!s||r||l)&&!i.timestamp){let d=o(n,e),[u,p]=vp(e,n,n,d||[],mT,Ep,rs),f=i.data?.[Mt];u&&(!a||!s&&(f!=="route"||p==="route")||f!=="route"&&p==="route"||f==="route"&&p==="route"&&l)&&(t.updateName(u),t.setAttribute(Mt,p),!Qi(u)&&p==="route"&&Gt(t,"__sentry_navigation_name_set__",!0))}}function fO(t,e,n,r,o){let i=!1,a=!!o&&et(o).op==="pageload",s=!1,l=null,c=null;t.subscribe(d=>{if(!i){let p=uo();p&&et(p).op==="pageload"?a=!0:a&&(d.historyAction==="POP"&&!s?s=!0:i=!0)}if(d.historyAction==="PUSH"||d.historyAction==="POP"&&i){let p=lO(d.location),f=()=>{c!==p&&(c=p,l=null,hT({location:d.location,routes:e,navigationType:d.historyAction,version:n,basename:r,allRoutes:Array.from(An)}))};d.navigation.state!=="idle"?(c!==p&&(c=null),l!==null&&oO(l),l=lY(f)):(l!==null&&(oO(l),l=null),f())}})}function Gu(t,e){return!Hu||!es||!ns||!fo?(Be&&w.warn(`reactRouter${e?`V${e}`:""}Instrumentation was unable to wrap the \`createRouter\` function because of one or more missing parameters.`),t):function(n,r){if(Tp(n),rs)for(let c of n)Sp(c,gT);let o=uo();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Gt(o,"__sentry_may_have_lazy_routes__",!0),dO(o));let a=pO(r,!1,o),s=t(n,a),l=r?.basename;return s.state.historyAction==="POP"&&o&&wp({activeRootSpan:o,location:s.state.location,routes:n,basename:l,allRoutes:Array.from(An)}),mT=l||"",fO(s,n,e,l,o),s}}function $u(t,e){return!Hu||!es||!ns||!fo?(Be&&w.warn(`reactRouter${e?`V${e}`:""}Instrumentation was unable to wrap the \`createMemoryRouter\` function because of one or more missing parameters.`),t):function(n,r){if(Tp(n),rs)for(let v of n)Sp(v,gT);let o=uo();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Gt(o,"__sentry_may_have_lazy_routes__",!0),dO(o));let a=pO(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,_=uo();return s.state.historyAction==="POP"&&_&&wp({activeRootSpan:_,location:m,routes:n,basename:l,allRoutes:Array.from(An)}),mT=l||"",fO(s,n,e,l,_),s}}function ju(t,e){let n=Ur({...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=_,Be&&w.log("[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:",_,"ms to prevent indefinite hangs")):Number.isNaN(h)?(Be&&w.warn("[React Router] lazyRouteTimeout must be a number, falling back to default:",v),kl=v):h<0?(Be&&w.warn("[React Router] lazyRouteTimeout must be non-negative or Infinity, got:",h,"falling back to:",v),kl=v):kl=h,Hu=r,es=o,ns=i,fo=s,fb=a,rs=c,Ep=f,eO(s,l||!1)},afterAllSetup(m){n.afterAllSetup(m);let _=q.location?.pathname;d&&_&&Yo(m,{name:_,attributes:{[Mt]:"url",[ht]:"pageload",[at]:`auto.pageload.react.reactrouter${e?`_v${e}`:""}`}}),u&&aO.add(m)}}}function qu(t,e){if(!Hu||!es||!ns||!fo)return Be&&w.warn("reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters."),t;let n=r=>{let o=Ei.useRef(!0),{routes:i,locationArg:a}=r,s=t(i,a),l=es(),c=ns(),d=typeof a=="string"||a?.pathname?a:l;return sO(()=>{let u=typeof d=="string"?{pathname:d}:d;o.current?(Tp(i),wp({activeRootSpan:uo(),location:u,routes:i,allRoutes:Array.from(An)}),o.current=!1):hT({location:u,routes:i,navigationType:c,version:e,allRoutes:Array.from(An)})},[c,d]),s};return(r,o)=>Ei.createElement(n,{routes:r,locationArg:o})}function pO(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=uo()??n;if(!e){let l=o?.patch,c=o?.matches;l&&(o.patch=(d,u)=>{if(Tp(u),c&&c.length>0){let m=c[c.length-1]?.route;if(m){let _=Array.from(An).find(v=>{let h=v.id!==void 0&&v.id===d,b=v===m,S=v.path!==void 0&&m.path!==void 0&&v.path===m.path;return h||b||S});_&&cO(u,_)}}let p=a?et(a):void 0;return i&&a&&p&&!p.timestamp&&p.op==="navigation"&&fT(a,{pathname:i,search:"",hash:"",state:null,key:"default"},Array.from(An),!0,fo),l(d,u)})}let s=(async()=>{let l=ZM(i,a),c;try{c=await r(o)}finally{tO(l),a&&uY(a)}let d=a?et(a):void 0;if(a&&d&&!d.timestamp&&d.op==="navigation"){let u=i;u&&fT(a,{pathname:u,search:"",hash:"",state:null,key:"default"},Array.from(An),!1,fo)}return c})();return a&&uO(a,s),s}}}function hT(t){let{location:e,routes:n,navigationType:r,version:o,matches:i,basename:a,allRoutes:s}=t,l=Array.isArray(i)?i:fo(s||n,e,a),c=P();if(!c||!aO.has(c))return;let d=uo();if(!(d&&et(d).op==="pageload"&&r==="POP")&&(r==="PUSH"||r==="POP")&&l){let[u,p]=vp(e,s||n,s||n,l,a,Ep,rs),f=lO(e),m=Il.get(c),_=m&&!m.isPlaceholder?!!et(m.span).timestamp:!1,{skip:v,shouldUpdate:h}=cY(m,f,u,_);if(v){if(h&&m){let R=m.routeName;m.isPlaceholder?(m.routeName=u,Be&&w.log(`[Tracing] Updated placeholder navigation name from "${R}" to "${u}" (will apply to real span)`)):(m.span.updateName(u),m.span.setAttribute(Mt,p),Gt(m.span,"__sentry_navigation_name_set__",!0),m.routeName=u,Be&&w.log(`[Tracing] Updated navigation span name from "${R}" to "${u}"`))}else Be&&w.log(`[Tracing] Skipping duplicate navigation for location: ${f}`);return}let S={span:{end:()=>{}},routeName:u,pathname:e.pathname,locationKey:f,isPlaceholder:!0};Il.set(c,S);let E;try{E=Wo(c,{name:S.routeName,attributes:{[Mt]:p,[ht]:"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}),pT(E,e,n,a,"navigation")):Il.delete(c)}}function Tp(t){t.forEach(e=>{mO(e).forEach(r=>{An.add(r)})})}function mO(t,e=new Set){return e.has(t)||(e.add(t),t.children&&!t.index&&t.children.forEach(n=>{mO(n,e).forEach(o=>{e.add(o)})})),e}function wp({activeRootSpan:t,location:e,routes:n,matches:r,basename:o,allRoutes:i}){let a=Array.isArray(r)?r:fo(i||n,e,o);if(a){let[s,l]=vp(e,i||n,i||n,a,o,Ep,rs);rt().setTransactionName(s||"/"),t&&(t.updateName(s),t.setAttribute(Mt,l),pT(t,e,n,o,"pageload"))}else t&&pT(t,e,n,o,"pageload")}function dY(t,e,n,r,o=!1){return n?!!(!t&&o||t&&Qi(t)&&r==="route"&&!Qi(n)||e!=="route"&&r==="route"):!1}function uT(t,e,n,r,o,i,a,s){try{let l=e.data?.[Mt];if(l==="route"&&n&&!Qi(n))return;let c=Array.from(s),d=c.length>0?c:o,u=fo(d,r,i);if(!u)return;let[p,f]=vp(r,d,d,u,i,Ep,rs),m=dY(n,l,p,f,!0),_=a==="pageload"||!e.timestamp;m&&_&&(t.updateName(p),t.setAttribute(Mt,f))}catch(l){Be&&w.warn(`Error updating span details before ending: ${l}`)}}function pT(t,e,n,r,o){let i=`__sentry_${o}_end_patched__`;if(t?.[i]||!t.end)return;let s=t.end.bind(t),l=!1;t.end=function(...d){if(l)return;l=!0;let u=d.length>0?d[0]:Date.now()/1e3,p=et(t),f=p.description,m=p.data?.[Mt],_=()=>{let E=P();if(E&&o==="navigation"){let R=Il.get(E);R&&R.span===t&&Il.delete(E)}},v=pb.get(t),h=t.__sentry_may_have_lazy_routes__;if((v&&v.size>0||h)&&f&&(Qi(f)||m!=="route")){if(kl===0){uT(t,p,f,e,n,r,o,An),_(),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=et(t);uT(t,C,C.description,e,n,r,o,An),_(),s(u)}).catch(()=>{_(),s(u)});return}uT(t,p,f,e,n,r,o,An),_(),s(u)},Gt(t,i,!0)}function Vu(t,e){if(!Hu||!es||!ns||!fb||!fo)return Be&&w.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.
508
+ useEffect: ${Hu}. useLocation: ${es}. useNavigationType: ${ns}.
509
+ createRoutesFromChildren: ${fb}. matchRoutes: ${fo}.`),t;let n=r=>{let o=Ei.useRef(!0),i=es(),a=ns();return sO(()=>{let s=fb(r.children);o.current?(Tp(s),wp({activeRootSpan:uo(),location:i,routes:s,allRoutes:Array.from(An)}),o.current=!1):hT({location:i,routes:s,navigationType:a,version:e,allRoutes:Array.from(An)})},[i,a]),Ei.createElement(t,{...r})};return Xi(n,t),n}function gO(t){return ju(t,"6")}function hO(t){return qu(t,"6")}function yO(t){return Gu(t,"6")}function bO(t){return $u(t,"6")}function _O(t){return Vu(t,"6")}function vO(t){return ju(t,"7")}function SO(t){return Vu(t,"7")}function EO(t){return Gu(t,"7")}function TO(t){return $u(t,"7")}function wO(t){return qu(t,"7")}function xO(t){return ju(t,"")}function AO(t){return Vu(t,"")}function IO(t){return Gu(t,"")}function kO(t){return $u(t,"")}function RO(t){return qu(t,"")}function yT(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,bT=Zi?.dsn?.trim()||"";if(bT&&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)));ub({dsn:bT,environment:t,release:Zi?.release?.trim()||void 0,integrations:[Ur(),Xy({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:yT(Zi?.tracesSampleRate,e),tracePropagationTargets:o,replaysSessionSampleRate:yT(Zi?.replaysSessionSampleRate,n),replaysOnErrorSampleRate:yT(Zi?.replaysOnErrorSampleRate,1),enableLogs:Zi?.enableLogs??!0,sendDefaultPii:Zi?.sendDefaultPii??!0}),Oc("vidfarm.bundle","hyperframes-editor")}function NO(){return!!bT&&typeof window<"u"&&window.__vidfarmSentryInitialized===!0}function ta(t,e){if(NO())try{Et(t,e?{extra:e}:void 0)}catch{}}function CO(t,e){if(NO())try{Da(t,e?{level:"error",extra:e}:{level:"error"})}catch{}}var e6=Wr(oU(),1);var PK="[vidfarm-demo]",iU=1e3;function zK(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 Jx(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>iU&&window.__VIDFARM_DEBUG_LOGS__.splice(0,window.__VIDFARM_DEBUG_LOGS__.length-iU)),zK(t)&&console[t](PK,e,n??"")}function xt(t,e){Jx("debug",t,e)}function Ar(t,e){Jx("warn",t,e)}function wo(t,e){Jx("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}):CO(`vidfarm-demo:${t}`,{detail:e})}function aU(){typeof window>"u"||window.__VIDFARM_DEBUG_HOOKS__||(window.__VIDFARM_DEBUG_HOOKS__=!0,xt("boot.hooks-installed",{href:window.location.href,readyState:document.readyState,userAgent:navigator.userAgent}),window.addEventListener("error",t=>{let e=t.error instanceof Error?t.error:null;wo("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;wo("window.unhandledrejection",{reason:e?e.stack:t.reason}),e&&ta(e,{source:"window.unhandledrejection"})}))}var A=Wr(Ea(),1);var g=Wr(Jm(),1),MU="rgba(60, 60, 60, 0.78)",l1=class extends A.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e.message:String(e)}}componentDidCatch(e,n){wo("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 Om({label:t="Loading"}){return(0,g.jsx)("span",{className:"vf-inline-spinner",role:"status","aria-label":t})}function FK(t,e){return t==="SUCCEEDED"?"succeeded":e||t==="FAILED"||t==="TIMED_OUT"||t==="ABORTED"?"failed":"running"}function sU(t,e){return{phase:FK(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 HK(t){return Math.max(0,Math.min(100,Math.round((t.progress??0)*100)))}var Dm="/media/inspiration-posts/simple-video/best-at-what-cost.mp4",km=54.533333,GK={shellBackground:"#0d100c",shellBorder:"#252c23",clipBackground:"#78C25E",clipBackgroundActive:"#F2CD46",clipBorderActive:"#F2CD46",textPrimary:"#f5f1e8",textSecondary:"#a7aea2"},lU=32,cU=24,uU=48,OU=["TikTok Sans","Montserrat","Source Code Pro","Yesteryear","Georgia","Abel"],DU=[{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"}],$K='@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");',Qx=null,Zx=null;function Y_(){return Qx=Qx??import("./chunks/dist-ADSJKBVE.js"),Qx}function jK(){if(typeof window>"u")return Y_(),()=>{};let t=window;if(t.requestIdleCallback){let n=t.requestIdleCallback(()=>{Y_()},{timeout:1200});return()=>t.cancelIdleCallback?.(n)}let e=window.setTimeout(()=>{Y_()},80);return()=>window.clearTimeout(e)}function qK(){if(typeof window>"u"||typeof document>"u")return()=>{};let t=()=>{if(Zx)return;let n=document.createElement("video");n.preload="auto",n.muted=!0,n.playsInline=!0,n.src=Dm,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),Zx=n;try{n.load()}catch{n.remove(),Zx=null}},e=window.setTimeout(t,120);return()=>window.clearTimeout(e)}function W_(t){let e=(t??"").split(",")[0].replaceAll('"',"").replaceAll("'","").trim();return OU.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 VK(t,e){let n=Number.parseInt(t??"",10);return Number.isFinite(n)?Math.max(100,Math.min(900,n)):e}function YK(t){return t==="Georgia"?"Georgia Bold":t==="Montserrat"?"Montserrat Semibold":t==="Source Code Pro"?"Source Code Pro Bold":t}function LU(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 WK(t){return DU.some(e=>e.id===t)?t:"highlight-solid"}function UU(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 BU(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:${UU(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 PU(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:${MU}`),e.join(";")}function J_(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=PU(n);let l=t.ownerDocument.createElement("span");l.setAttribute("data-vf-text-inline","true"),i&&l.setAttribute("data-font-family",i),l.style.cssText=BU(n,r,o,i,a),l.textContent=e,s.append(l),t.append(s)}function K_(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 dU(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 Dt(t,e,n){return Math.max(e,Math.min(n,t))}var Lm=[{id:"source-video",label:"best-at-what-cost.mp4",kind:"video",mode:"both",start:0,duration:km,track:0,z:0,viralNote:"Dominant source footage is the proof layer. It makes the cost feel physically real.",src:Dm},{id:"source-audio",label:"Original audio",kind:"audio",mode:"both",start:0,duration:km,track:1,z:1,viralNote:"Native source audio stays separate from the visual layer so it can be muted, replaced, or timed independently.",src:Dm,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:km-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}],Pd={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."]},Um=[{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:km,width:576,height:1024,summary:Pd.hook,media:{type:"video",src:Dm},viralDna:{hook:Pd.hook,retention:Pd.retention,payoff:Pd.payoff,preserve:Pd.preserve,avoid:Pd.avoid},layers:Lm.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 KK(){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 zU(t){return decodeURIComponent(t.split("/").pop()??t)}function d1(t,e,n=[]){if(t.media.type!=="video")return[];let r=zU(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 XK(t){return t.media.type!=="video"?[]:[...d1(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 JK(t){return t.media.type!=="video"?[]:[...d1(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 QK(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 ZK(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[...d1(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 tX(t){if(t.media.type!=="video")return[];let e=zU(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 f1(t){return t.id==="slides"?KK():t.id==="simple-video"?Lm.filter(e=>e.mode==="both"||e.mode==="publish"):t.id==="hard-video"?XK(t):t.id==="medium-easy-video"?QK(t):t.id==="medium-video-loop-split"?JK(t):t.id==="medium-video"?ZK(t):tX(t)}function FU(t){return f1(t).reduce((e,n)=>Math.max(e,n.start+n.duration),t.duration)}function eX(t){let e=t.filter(n=>n.duration>0);for(let n=0;n<e.length;n+=1){let r=e[n];for(let o of e.slice(n+1))if(Fd(r,o))throw new Error(`Track collision: ${r.id} overlaps ${o.id} on track ${r.track}.`)}}function HU(t){return t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function Fe(t){return HU(String(t))}function Kt(t){return Number(t.toFixed(3)).toString()}function xm(t){let e=t.fontSize??18,n=t.fontFamily??"TikTok Sans",r=t.fontWeight??Os(n),o=["position:absolute",`left:${t.x??0}%`,`top:${t.y??0}%`,`width:${t.width??100}%`,`height:${t.height??100}%`,`z-index:${t.z}`,"opacity:1",`border-radius:${t.radius??0}px`,"overflow:hidden"];return(t.kind==="video"||t.kind==="image")&&o.push("object-fit:cover"),(t.kind==="text"||t.kind==="caption"||t.kind==="shape")&&o.push("display:flex","align-items:center","justify-content:center","padding:3px",`font-family:${Jl(n)}, 'TikTok Sans', Montserrat, Abel`,`font-weight:${r}`,"line-height:1.48","text-align:center","text-transform:none",`font-size:${e}px`,`color:${t.color??"#ffffff"}`,"background:transparent"),o.join(";")}function nX(t){let e=[`id="${Fe(t.id)}"`,`data-hf-id="${Fe(t.id)}"`,`data-layer-mode="${Fe(t.mode)}"`,`data-layer-kind="${Fe(t.kind)}"`,`data-viral-note="${Fe(t.viralNote)}"`,`data-start="${Kt(t.start)}"`,`data-duration="${Kt(t.duration)}"`,`data-track-index="${t.track}"`,`data-label="${Fe(t.label)}"`];return(t.kind==="text"||t.kind==="caption"||t.kind==="shape")&&e.push(`data-text-background-style="${Fe(t.textBackgroundStyle??"highlight-solid")}"`,`data-text-background-color="${Fe(t.background??"#000000")}"`,`data-font-family="${Fe(t.fontFamily??"TikTok Sans")}"`),t.customHtml&&e.push('data-layer-format="html"'),(t.kind==="video"||t.kind==="audio")&&t.playbackStart!==void 0&&e.push(`data-media-start="${Kt(t.playbackStart)}"`,`data-playback-start="${Kt(t.playbackStart)}"`),e.join(" ")}function rX(t){let e=nX(t);if(t.kind==="video")return t.playbackStart!==void 0?`<div ${e} data-vf-timeline-proxy="video" data-src="${Fe(t.src??"")}" style="${Fe(xm({...t,x:0,y:0,width:1,height:1}))};display:none;pointer-events:none;"></div>`:`<video ${e} src="${Fe(t.src??"")}" muted playsinline preload="auto" style="${Fe(xm(t))}"></video>`;if(t.kind==="audio")return`<audio ${e} src="${Fe(t.src??"")}" data-timeline-role="music" data-volume="${Kt(t.volume??1)}" ${t.muted?"muted":""} preload="metadata"></audio>`;if(t.kind==="image")return`<img ${e} src="${Fe(t.src??"")}" alt="" style="${Fe(xm(t))}" />`;if(t.customHtml)return`<div ${e} style="${Fe(xm(t))}">${t.customHtml}</div>`;let n=t.text??t.label,r=BU(t.textBackgroundStyle??"highlight-solid",t.color??"#ffffff",t.background??"#000000",t.fontFamily??"TikTok Sans",t.fontWeight??Os(t.fontFamily??"TikTok Sans")),o=PU(t.textBackgroundStyle??"highlight-solid");return`<div ${e} style="${Fe(xm(t))}"><span data-vf-text-lines="true" style="${Fe(o)}"><span data-vf-text-inline="true" style="${Fe(r)}">${HU(n)}</span></span></div>`}function oX(t,e){return t==="shape"&&e?"HTML":t}function iX(t,e){return t==="shape"&&e?"HTML":t.slice(0,3).toUpperCase()}function aX(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="${Fe(t.media.src)}" muted playsinline preload="auto" style="${Fe(r)}"></video>`}function GU(){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 sX(t){if(/window\.__player\s*=/.test(t))return t;let e=GU();return/<\/body>/i.test(t)?t.replace(/<\/body>/i,`${e}
1115
+ </body>`):`${t}
1116
+ ${e}`}function $U(t=Um[0]){let e=f1(t);eX(e);let n=FU(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
+ ${$K}
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="${Fe(t.id)}" data-source-video="${Fe(t.title)}" data-width="${r}" data-height="${o}" data-duration="${Kt(n)}">
1136
+ ${aX(t,e)}
1137
+ ${e.map(rX).join(`
1138
+ `)}
1139
+ </div>
1140
+ ${GU()}
1141
+ </body>
1142
+ </html>`}function Nt(t){return t.key??t.id}function p1(t){return Array.from(new Set(t.filter(e=>!!e)))}function lX(t){let e=[];for(let n of p1([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 Q_(t){return`<!doctype html>
1143
+ ${t.documentElement.outerHTML}`}function re(t){return!!(t&&typeof t=="object"&&t.nodeType===1&&"style"in t)}function jU(t,e){return re(t)&&t.tagName.toLowerCase()===e.toLowerCase()}function Zo(t,e,n){let r=new DOMParser().parseFromString(t,"text/html"),o=Bn(r,e);return re(o)?(n(o),Q_(r)):t}function Im(t,e,n){try{let r=t?.contentDocument,o=r?Bn(r,e):null;return re(o)?(n(o),!0):!1}catch{return!1}}function t1(t,e){try{let n=t?.contentDocument;if(!n)return 0;let r=new DOMParser().parseFromString(e,"text/html"),o=new Map;for(let a of Array.from(n.querySelectorAll("[data-start]"))){if(!re(a))continue;let s=Ci(a);s&&o.set(s,a)}let i=0;for(let a of Array.from(r.querySelectorAll("[data-start]"))){if(!re(a))continue;let s=Ci(a),l=s?o.get(s):null;if(!l)continue;for(let d of["data-start","data-duration","data-track-index","data-media-start","data-playback-start"]){let u=a.getAttribute(d);u===null?l.removeAttribute(d):l.setAttribute(d,u)}let c=Number(a.getAttribute("data-track-index")??Number.NaN);Number.isFinite(c)&&!jU(l,"audio")&&(l.style.zIndex=String(c)),i+=1}return i}catch{return 0}}var fU=new WeakSet;function cX(t){return t.hasAttribute("data-vf-selection-ring")||t.hasAttribute("data-vf-frame-handle")}function pU(t){return t.hasAttribute("data-vf-playback-source")?"@playback-source":t.getAttribute("data-hf-id")||t.id||null}function qU(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 uX(t,e){qU(t,e),t.innerHTML!==e.innerHTML&&(t.innerHTML=e.innerHTML)}function mU(t,e){try{let n=t?.contentDocument,r=n?.querySelector("[data-composition-id]");if(!n||!re(r))return!1;let i=new DOMParser().parseFromString(e,"text/html").querySelector("[data-composition-id]");if(!re(i))return!1;let a=r.querySelector("[data-vf-playback-source]"),s=i.querySelector("[data-vf-playback-source]");if(!!a!=!!s)return!1;qU(r,i);let l=new Set,c=new Map;for(let m of Array.from(r.children)){if(cX(m)){l.add(m);continue}let _=pU(m);_!==null&&re(m)&&!c.has(_)&&c.set(_,m)}let d=new Set,u=[];for(let m of Array.from(i.children)){if(!re(m))continue;let _=pU(m),v=_!==null?c.get(_):void 0;v&&!d.has(v)&&v.tagName===m.tagName?(d.add(v),uX(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 gU(t,e){try{let n=t?.contentDocument;return n?(n.open(),n.write(e),n.close(),!0):!1}catch{return!1}}function Am(t,e){for(let n of e){let r=t.getAttribute(n);if(r!==null){let o=Number(r);if(Number.isFinite(o))return o}}}function hU(t){let e=Z_(t),n=e.querySelector("[data-composition-id]"),r=[];for(let i of Array.from(e.querySelectorAll("[data-start]")))i===n||!re(i)||r.push(i);let o=n?Number(n.getAttribute("data-duration")||0):0;return{nodes:r,duration:o}}function yU(t){return p1([t.getAttribute("data-hf-id")??void 0,t.id||void 0])}function bU(t){return p1([t.key,t.hfId,t.domId,t.id])}function e1(t,e,n){let r=t.getState(),o=r.elements,i=hU(e),a=hU(n),s=new Set(i.nodes.flatMap(yU)),l=new Set,c=[];for(let u of a.nodes){let p=yU(u);if(p.length===0)continue;let f=Am(u,["data-start"])??0,m=Am(u,["data-duration"])??0,_=Am(u,["data-track-index"])??0,v=Am(u,["data-playback-start","data-media-start"]),h=Am(u,["data-volume"]),b=o.findIndex((S,E)=>!l.has(E)&&bU(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;bU(u).some(m=>s.has(m))||c.push(u)});let d=c.length!==o.length||c.some((u,p)=>u!==o[p]);return d&&r.setElements(c),a.duration>0&&Math.abs(a.duration-r.duration)>.001&&r.setDuration?.(a.duration),d}function Ni(t,e){try{let a=function(){re(i)&&(i.style.display="none")};var n=a;let r=t?.contentDocument;if(!r)return!1;let o=r.querySelector("[data-composition-id]"),i=r.querySelector("[data-vf-selection-ring='true']");for(let l of Array.from(r.querySelectorAll("[data-vf-selected='true']")))l.removeAttribute("data-vf-selected");if(!e)return a(),!0;let s=Bn(r,e);return!s||jU(s,"audio")?(a(),!1):(!re(i)&&re(o)&&(i=r.createElement("div"),i.setAttribute("data-vf-selection-ring","true"),o.append(i)),re(i)&&OX(i,s,e),s.setAttribute("data-vf-selected","true"),!0)}catch{return!1}}function Ci(t){return t.getAttribute("data-hf-id")||t.id}function Ql(t){let e=Number(t.getAttribute("data-start")??0),n=Number(t.getAttribute("data-duration")??0),r=Number(t.getAttribute("data-track-index")??0);return{start:e,duration:n,track:r}}function Fd(t,e){if(t.track!==e.track)return!1;let n=t.start+t.duration,r=e.start+e.duration;return t.start<r-.001&&e.start<n-.001}function dX(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 n1(t){return Array.from(new Set(t.map(e=>e.track))).sort((e,n)=>n-e)}function _U(t,e,n){let r=new Set([Nt(e),e.hfId,e.domId,e.id].filter(o=>!!o));return t.filter(o=>![Nt(o),o.hfId,o.domId,o.id].some(a=>a&&r.has(a))).filter(o=>!n||X_(n,o)!=="track-placeholder").map(o=>({start:o.start,duration:o.duration,track:o.track}))}function Bm(t){return Number.isFinite(t.duration)&&t.duration>0}function r1(t,e){return Bm(t)?e.some(n=>Bm(n)&&Fd(t,n)):!1}function fX(t,e,n,r,o){if(!Number.isFinite(n)||n<=0)return Math.max(0,r);let a=t.filter(f=>f.track===e&&Bm(f)).map(f=>({start:f.start,end:f.start+f.duration})).sort((f,m)=>f.start-m.start),s=[];for(let f of a){let m=s[s.length-1];m&&f.start<=m.end+.001?m.end=Math.max(m.end,f.end):s.push({...f})}let l=Math.max(0,o-n),c=[],d=0;for(let f of s)f.start-d>=n-.001&&c.push({lo:d,hi:f.start-n}),d=Math.max(d,f.end);d<=l+.001&&c.push({lo:d,hi:l});let u=null,p=1/0;for(let f of c){let m=Math.min(f.hi,l);if(m<f.lo-.001)continue;let _=Dt(r,f.lo,Math.max(f.lo,m)),v=Math.abs(_-r);v<p-.001&&(u=_,p=v)}return u}function Pm(t,e,n=new Set){if(!Number.isFinite(e.duration)||e.duration<=0)return e.track;let r=Array.from(t.querySelectorAll("[data-start]")).filter(a=>re(a)),o=new Set;for(let a of r){let s=Ci(a);if(s&&n.has(s))continue;let l=Ql(a);!Number.isFinite(l.duration)||l.duration<=0||Fd({...e},l)&&o.add(l.track)}let i=Math.max(0,Math.floor(e.track));for(let a=0;a<512&&o.has(i);a+=1)i+=1;return i}function Bn(t,e){let n=lX(e);for(let r of n){if(r===e.selector&&e.selectorIndex!==void 0){let i=t.querySelectorAll(r).item(e.selectorIndex);if(re(i))return i;continue}let o=t.querySelector(r);if(re(o))return o}return null}function vU(t,e){return Bn(t,e)?.getAttribute("data-vf-group")||null}function SU(t,e,n){return e?Array.from(t.querySelectorAll(`[data-vf-group="${CSS.escape(e)}"]`)).filter(r=>re(r)&&r.hasAttribute("data-start")):[n]}function pX(t,e,n){let r=new Set(e.map(Ci)),o=Array.from(t.querySelectorAll("[data-start]")).filter(a=>re(a));for(let a of e){let s=Ci(a),l=n.get(s);if(!(!s||!l))for(let c of o){let d=Ci(c);if(!(!d||r.has(d))&&Fd(l,Ql(c)))throw new Error("Track collision: only one clip can occupy a track at a time.")}}let i=Array.from(n.entries()).filter(([,a])=>a.duration>0);for(let a=0;a<i.length;a+=1){let[s,l]=i[a];for(let[c,d]of i.slice(a+1))if(Fd(l,d))throw new Error(`Track collision: ${s} overlaps ${c} on track ${l.track}.`)}}function mX(t){let e=Array.from(t.querySelectorAll("[data-start]")).filter(r=>{if(!re(r))return!1;let o=Number(r.getAttribute("data-duration")??0);return Number.isFinite(o)&&o>0});e.sort((r,o)=>{let i=Number(r.getAttribute("data-track-index")??0),a=Number(o.getAttribute("data-track-index")??0);if(i!==a)return i-a;let s=Number(r.getAttribute("data-start")??0),l=Number(o.getAttribute("data-start")??0);return s-l});let n=0;for(let r=0;r<e.length;r+=1){let o=e[r],i=Ql(o),a=!1;for(let d=0;d<r;d+=1)if(Fd(i,Ql(e[d]))){a=!0;break}if(!a)continue;let s=new Set,l=Ci(o);l&&s.add(l);let c=Pm(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 xo(t,e){let n=new DOMParser().parseFromString(t,"text/html");e(n);let r=mX(n);return{html:Q_(n),resolvedCollisions:r}}function VU(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(/&quot;/g,'"').replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/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 gX(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 EU=null,o1=null;function Z_(t){if(EU===t&&o1)return o1;let e=new DOMParser().parseFromString(t,"text/html");return EU=t,o1=e,e}function t0(t,e){return Bn(Z_(t),e)}function Qo(t,e,n){let r=t?.getPropertyValue(e)??"",o=Number.parseFloat(r);return Number.isFinite(o)?o:n}function TU(t,e){let n=t0(t,e),r=m1(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:W_(o?.style.fontFamily||n?.style.fontFamily),fontWeight:VK(o?.style.fontWeight||n?.style.fontWeight,Os(W_(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:WK(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:hX(n?.style.objectFit),objectPosition:yX(n?.style.objectPosition),slug:n?.getAttribute("data-hf-slug")??"",note:n?.getAttribute("data-hf-note")??""}}function e0(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,64)}function hX(t){let e=(t??"").trim().toLowerCase();return e==="contain"||e==="fill"||e==="none"||e==="scale-down"?e:"cover"}function yX(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 YU(t,e,n){let r=Bn(t,e);if(!r)return;let o=n.start??e.start,i=n.duration??e.duration,a=n.track??e.track;if(r.setAttribute("data-start",Kt(o)),r.setAttribute("data-duration",Kt(i)),r.setAttribute("data-end",Kt(o+i)),r.setAttribute("data-track-index",String(a)),n.playbackStart!==void 0){let s=Kt(n.playbackStart);r.setAttribute("data-media-start",s),r.setAttribute("data-playback-start",s)}}function WU(t,e,n){return xo(t,r=>YU(r,e,n))}function i1(t,e){return xo(t,n=>{for(let r of e)YU(n,r.element,r.updates)})}function m1(t){return Lm.find(e=>e.id===t.hfId||e.id===t.domId||e.id===t.id)}function X_(t,e){return t0(t,e)?.getAttribute("data-layer-kind")||null}function KU(t,e){return t0(t,e)?.getAttribute("data-layer-format")||null}function wU(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 G_(t){try{let e=Cs(t);return e?.refreshClips?.(),!!e?.refreshClips}catch{return!1}}function xU(t,e,n){try{t?.contentWindow?.postMessage({source:"hf-parent",type:"control",action:e,...n},"*")}catch{}}var bX=(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:km,E=_==="fit"?100:v,[R,C]=(0,A.useState)(()=>Ms(f)),[I,D]=(0,A.useState)(!1);(0,A.useEffect)(()=>{I||C(Ms(f))},[f,I]);function z(O){h("manual"),b(Math.max(25,Math.min(400,O)))}function U(){let O=dU(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:()=>{D(!0),C(Ms(Math.min(f,S)))},onChange:O=>{let N=O.target.value;C(N);let B=dU(N);B!==null&&i(Math.max(0,Math.min(S,B)))},onBlur:()=>{D(!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=>z(Number(O.target.value))}),(0,g.jsx)("b",{children:"%"})]})]})]})}),_X=(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,D=typeof I=="number",z=!!(e.element&&h>e.element.start&&h<e.element.start+e.element.duration),U=!!(e.element&&e.element.hfId!=="source-video");(0,A.useEffect)(()=>{function N(V){b.current?.contains(V.target)||i()}function B(V){V.key==="Escape"&&i()}return window.addEventListener("pointerdown",N),window.addEventListener("keydown",B),()=>{window.removeEventListener("pointerdown",N),window.removeEventListener("keydown",B)}},[i]);function O({children:N,disabled:B,danger:V,onClick:st}){return(0,g.jsx)("button",{type:"button",disabled:B,className:`timeline-menu-item ${V?"danger":""}`,onClick:()=>{B||(st(),i())},children:N})}return(0,g.jsx)("div",{ref: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:K_(h)})]}),(0,g.jsx)(O,{disabled:!z,onClick:()=>e.element&&s(e.element,h),children:"Split at playhead"}),(0,g.jsx)(O,{disabled:!D,onClick:()=>D&&l(I,"above"),children:"New layer above"}),(0,g.jsx)(O,{disabled:!D,onClick:()=>D&&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 ",K_(e.time)]}),(0,g.jsx)(O,{disabled:!D,onClick:()=>D&&l(I,"above"),children:"New layer above"}),(0,g.jsx)(O,{disabled:!D,onClick:()=>D&&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 vX({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 SX({state:t,onClose:e}){let n=HK(t),r=t.phase==="starting"||t.phase==="running",o=t.phase==="succeeded"?"Rendered":t.phase==="failed"?"Render failed":"Rendering...",i=t.status||(t.phase==="starting"?"STARTING":"RUNNING"),a=t.totalFrames?`${t.framesRendered??0} / ${t.totalFrames} frames`:`${t.framesRendered??0} frames`;return(0,g.jsx)("div",{className:"publish-modal-backdrop",role:"presentation",children:(0,g.jsxs)("section",{className:"publish-modal",role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:[(0,g.jsxs)("div",{className:"publish-modal-kicker",children:[(0,g.jsx)("span",{children:"Production AWS Lambda"}),!r&&(0,g.jsx)("button",{type:"button",className:"publish-modal-close","aria-label":"Close publish status",onClick:e,children:"x"})]}),(0,g.jsxs)("h2",{id:"publish-modal-title",children:[r&&(0,g.jsx)(Om,{label:"Rendering"}),o]}),(0,g.jsxs)("p",{className:"publish-modal-summary",children:["Rendering ",(0,g.jsx)("strong",{children:t.title})," on production infrastructure. The final output link will appear when the render succeeds."]}),r&&(0,g.jsx)("p",{className:"publish-modal-eta",children:"Estimated time: ~5 minutes. Feel free to open new tabs and keep working \u2014 this render continues in the background and the output link will appear here when it's ready."}),(0,g.jsx)("div",{className:"publish-progress-shell","aria-label":`Publish progress ${n}%`,children:(0,g.jsx)("span",{style:{width:`${n}%`}})}),(0,g.jsxs)("dl",{className:"publish-detail-grid",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Status"}),(0,g.jsx)("dd",{children:i})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Progress"}),(0,g.jsxs)("dd",{children:[n,"%"]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Frames"}),(0,g.jsx)("dd",{children:a})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Cost"}),(0,g.jsx)("dd",{children:t.cost||"$0.0000"})]}),t.renderId&&(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Render ID"}),(0,g.jsx)("dd",{children:t.renderId})]}),t.phase==="succeeded"&&t.outputS3Uri&&(0,g.jsxs)("div",{children:[(0,g.jsx)("dt",{children:"Output"}),(0,g.jsx)("dd",{children:t.outputS3Uri})]})]}),t.error||t.errors?.length?(0,g.jsxs)("div",{className:"publish-error-box",children:[(0,g.jsx)("strong",{children:t.error||t.errors?.[0]?.error||"Render failed"}),t.errors?.slice(0,2).map((s,l)=>(0,g.jsxs)("p",{children:[s.state?`${s.state}: `:"",s.cause||s.error]},`${s.state||"state"}-${l}`))]}):null,(0,g.jsx)("div",{className:"publish-modal-actions",children:t.outputUrl&&(0,g.jsx)("a",{href:t.outputUrl,target:"_blank",rel:"noreferrer",children:"Open output"})})]})})}function EX({action:t,composition:e=Um[0],onPublish:n,publishOptions:r=null,onPublishOption:o,publishDisabled:i=!1,publishLabel:a="Publish",templateId:s=null,forkId:l=null,publishVersion:c=null,originalUrl:d=null,songName:u=null,songUrl:p=null,onOpenShare:f,onOpenDecompose:m,onOpenHistory:_,decomposeDismissed:v=!1,decomposeBusy:h=!1,onResumeDecompose:b}){let S=e.viralDna,E=S.promotions??[],[R,C]=(0,A.useState)(!1),I=(0,A.useRef)(null),[D,z]=(0,A.useState)(!1),U=(0,A.useRef)(null),O=!!(r&&r.length>1&&o);(0,A.useEffect)(()=>{if(!D)return;let B=st=>{U.current&&(U.current.contains(st.target)||z(!1))},V=st=>{st.key==="Escape"&&z(!1)};return document.addEventListener("mousedown",B),document.addEventListener("keydown",V),()=>{document.removeEventListener("mousedown",B),document.removeEventListener("keydown",V)}},[D]),(0,A.useEffect)(()=>{if(!R)return;let B=st=>{I.current&&(I.current.contains(st.target)||C(!1))},V=st=>{st.key==="Escape"&&C(!1)};return document.addEventListener("mousedown",B),document.addEventListener("keydown",V),()=>{document.removeEventListener("mousedown",B),document.removeEventListener("keydown",V)}},[R]);let N=[{label:"New decompose\u2026",handler:m,disabled:!m},{label:"History\u2026",handler:_,disabled:!_||!l,hint:l?void 0:"Save first"}];return(0,g.jsxs)("section",{className:"dna-panel",children:[(0,g.jsxs)("div",{className:"panel-title",children:[(0,g.jsx)("span",{children:"Viral DNA"}),(0,g.jsxs)("div",{className:"panel-title-actions",children:[(0,g.jsx)(AX,{templateId:s,forkId:l,publishVersion:c,originalUrl:d,songName:u,songUrl:p,trendTagline:S.trendTagline??null}),(0,g.jsxs)("div",{className:"panel-menu-wrap",ref:I,children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button panel-menu-button","aria-haspopup":"menu","aria-expanded":R,"aria-label":"More actions",title:"More actions",onClick:()=>C(B=>!B),children:"\u22EF"}),R&&(0,g.jsx)("div",{className:"panel-menu-popover",role:"menu",children:N.map(B=>(0,g.jsx)("button",{type:"button",role:"menuitem",className:"panel-menu-item",disabled:B.disabled,title:B.hint,onClick:()=>{C(!1),B.handler?.()},children:B.label},B.label))})]}),(0,g.jsxs)("div",{className:"panel-menu-wrap",ref:U,children:[(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",disabled:i,"aria-busy":i?"true":void 0,"aria-haspopup":O?"menu":void 0,"aria-expanded":O?D:void 0,onClick:()=>{O?z(B=>!B):n?.()},children:[a==="Rendering"&&(0,g.jsx)(Om,{label:"Rendering"}),a]}),O&&D&&(0,g.jsx)("div",{className:"panel-menu-popover",role:"menu",children:r.map(B=>(0,g.jsx)("button",{type:"button",role:"menuitem",className:"panel-menu-item",title:B.hint,onClick:()=>{z(!1),o?.(B.key)},children:B.label},B.key))})]})]})]}),t,v&&b&&(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:b,disabled:h,"aria-busy":h?"true":void 0,children:[h&&(0,g.jsx)(Om,{label:"Decomposing"}),h?"Decomposing\u2026":"Decompose"]})]}),(0,g.jsxs)("article",{className:"source-card",children:[(0,g.jsx)("h2",{children:"Reference"}),(0,g.jsx)("p",{children:e.title})]}),(0,g.jsxs)("article",{className:"dna-card",children:[(0,g.jsx)("strong",{children:"Hook"}),(0,g.jsx)("p",{children:S.hook})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Retention"}),(0,g.jsx)("p",{children:S.retention})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Payoff"}),(0,g.jsx)("p",{children:S.payoff})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Preserve"}),(0,g.jsx)("ul",{children:S.preserve.map(B=>(0,g.jsx)("li",{children:B},B))})]}),(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Avoid"}),(0,g.jsx)("ul",{children:S.avoid.map(B=>(0,g.jsx)("li",{children:B},B))})]}),E.length>0&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Reuse for promotions"}),(0,g.jsx)("p",{className:"dna-panel-hint",children:"Same viral tactic, different pitch. Ideas for what this format can promote without breaking the hook:"}),(0,g.jsx)("ul",{children:E.map(B=>(0,g.jsx)("li",{children:B},B))})]})]})}function TX({value:t,onChange:e}){let n=W_(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(W_(r.target.value)),children:OU.map(r=>(0,g.jsx)("option",{value:r,style:{fontFamily:`${Jl(r)}, 'TikTok Sans'`,fontWeight:Os(r)},children:YK(r)},r))}),(0,g.jsx)("span",{"aria-hidden":"true",children:"v"})]})}function wX({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:DU.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"?UU(n,.34):o.id==="fullwidth"?MU:"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 xX({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 a1(t,e){return{...e,start:t.start,duration:t.duration,track:t.track}}function AU(t,e){return e?{...t,...e.updates}:t}function c1(t,e){let n=Bn(Z_(t),e);return n?{...e,...Ql(n)}:e}function $_(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 IU(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 j_({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 AX({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)(j_,{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)(j_,{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)(j_,{value:e??""})]}),(0,g.jsxs)("div",{className:"publish-info-row",children:[(0,g.jsx)("span",{className:"publish-info-label",children:"version"}),(0,g.jsx)(j_,{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 IX({mode:t,busy:e,finished:n,error:r,scenesCreated:o,ghostcutStatus:i,ghostcutProgress:a,userPrompt:s,onUserPromptChange:l,onDecompose:c,onFinish:d,onCancel:u,onDismiss:p}){let f=!!p&&!n;return(0,g.jsx)("div",{className:"decompose-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"decompose-modal-title",children:(0,g.jsxs)("div",{className:"decompose-modal",children:[f&&(0,g.jsx)("button",{type:"button",className:"decompose-modal-close","aria-label":"Dismiss \u2014 decompose later",title:"Later",onClick:p,disabled:e,children:"\u2715"}),n?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h2",{id:"decompose-modal-title",children:"Decomposed \u2713"}),(0,g.jsxs)("p",{children:[o!==null?`Split the video into ${o} editable scene${o===1?"":"s"}.`:"Split the video into editable scenes."," Click Finish to load the timeline."]}),i==="pending"&&(0,g.jsxs)("p",{className:"decompose-modal-note",children:["Removing hardcoded subtitles\u2026",a!==null&&` (${Math.round(a)}%)`," This usually takes about 5 minutes. You can leave this tab open, work in another tab, or come back later \u2014 Finish will unlock automatically once the cleaned video is ready."]}),i==="done"&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Hardcoded subtitles removed \u2713 \u2014 click Finish to load the cleaned video."}),i==="failed"&&(0,g.jsx)("p",{className:"decompose-modal-note",children:"Subtitle removal failed; original video retained."}),(0,g.jsx)("div",{className:"decompose-modal-actions",children:(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",onClick:d,disabled:i==="pending","aria-busy":i==="pending",children:[i==="pending"&&(0,g.jsx)(Om,{label:"Removing subtitles"}),i==="pending"?"Removing subtitles\u2026":"Finish"]})})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h2",{id:"decompose-modal-title",children:t==="redo"?"Re-decompose this composition":"Decompose this composition"}),(0,g.jsx)("p",{children:t==="redo"?"Runs the AI decomposer again from the current source video. Your existing timeline edits on this working copy will be replaced \u2014 publish or snapshot first if you want to keep them.":"Smart-decompose splits the source video into scenes, extracts on-screen captions, and generates viral DNA using your saved AI provider key (Gemini \u2192 OpenAI \u2192 OpenRouter). Requires an AI provider key in Settings. If you're the first user to decompose this inspiration, your decomposition becomes the default template fork for everyone else."}),(0,g.jsxs)("label",{className:"decompose-modal-prompt",children:[(0,g.jsx)("span",{children:"Guidance for the AI (optional)"}),(0,g.jsx)("textarea",{className:"decompose-modal-textarea",placeholder:"e.g. Pay attention to the pinned comment as the hook; the payoff is the dance-floor reveal at ~00:08; keep captions in lowercase to match the original TikTok voice.",value:s,rows:4,maxLength:4e3,onChange:m=>l(m.target.value),disabled:e}),(0,g.jsx)("span",{className:"decompose-modal-hint",children:"Tell the model what to focus on: which beats matter, which captions are the hook, tone, preferred scene granularity, etc. Left blank uses the default extraction prompt."})]}),r&&(0,g.jsx)("p",{className:"decompose-modal-error",children:r}),(0,g.jsxs)("div",{className:"decompose-modal-actions",children:[f&&(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:p,disabled:e,children:"Later"}),u&&(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:u,disabled:e,children:"Cancel"}),(0,g.jsxs)("button",{type:"button",className:"panel-action-button primary",onClick:c,disabled:e,"aria-busy":e,children:[e&&(0,g.jsx)(Om,{label:"Decomposing"}),e?"Decomposing\u2026":t==="redo"?"Re-decompose":"Decompose"]})]})]})]})})}function kX({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 RX({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 NX({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 q_({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 CX(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",Kt(e.volume))),r.isVisual&&(t.style.left=`${e.x}%`,t.style.top=`${e.y}%`,t.style.width=`${e.width}%`,t.style.height=`${e.height}%`),r.isTextLike&&(t.setAttribute("data-label",e.text.slice(0,48)||n.label||n.id),LU(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`,J_(t,e.text,e.textBackgroundStyle,e.color,e.background,e.fontFamily,e.fontWeight))}function V_(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",Kt(e.volume))),r.isVisual&&("x"in o&&(t.style.left=`${e.x}%`),"y"in o&&(t.style.top=`${e.y}%`),"width"in o&&(t.style.width=`${e.width}%`),"height"in o&&(t.style.height=`${e.height}%`)),"slug"in o){let s=e.slug.trim();s?t.setAttribute("data-hf-slug",s):t.removeAttribute("data-hf-slug")}if("note"in o){let s=e.note.trim();s?t.setAttribute("data-hf-note",s):t.removeAttribute("data-hf-note")}if(!r.isTextLike)return;let i=t.querySelector("[data-vf-text-inline]"),a=t.querySelector("[data-vf-text-lines]");"text"in o&&t.setAttribute("data-label",e.text.slice(0,48)||n.label||n.id),("fontFamily"in o||"fontWeight"in o)&&(t.setAttribute("data-font-family",e.fontFamily),LU(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",J_(t,e.text,e.textBackgroundStyle,e.color,e.background,e.fontFamily,e.fontWeight))}function MX(t){return t?t.tag!=="audio"&&t.tag!=="video"&&t.tag!=="img"&&t.tag!=="image":!1}function g1(t){return!t||t.tag==="audio"?!1:(t.hfId||t.domId||t.id||t.key)!=="source-video"}function XU(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 u1(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 OX(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=g1(n),o=e.getAttribute("data-hf-id")||e.id||Nt(n);r?(t.style.pointerEvents="auto",t.style.cursor="move",t.setAttribute("data-vf-frame-handle","move"),t.setAttribute("data-vf-target-id",o)):(t.style.pointerEvents="none",t.style.cursor="",t.removeAttribute("data-vf-frame-handle"),t.removeAttribute("data-vf-target-id")),t.style.border=r?"1px dashed #F2CD46":"3px solid #F2CD46",t.style.boxShadow=r?"0 0 0 2px #118df2":"inset 0 0 0 1px #000000, 0 0 0 7px rgba(242, 205, 70, 0.32)";for(let i of Array.from(t.querySelectorAll("[data-vf-frame-handle]")))i.remove();if(r)for(let[i,a]of[["top-left","left:-7px;top:-7px;cursor:nwse-resize;"],["top","top:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize;"],["top-right","right:-7px;top:-7px;cursor:nesw-resize;"],["right","right:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize;"],["bottom-right","right:-7px;bottom:-7px;cursor:nwse-resize;"],["bottom","bottom:-7px;left:50%;transform:translateX(-50%);cursor:ns-resize;"],["bottom-left","left:-7px;bottom:-7px;cursor:nesw-resize;"],["left","left:-7px;top:50%;transform:translateY(-50%);cursor:ew-resize;"]]){let s=t.ownerDocument.createElement("span");s.setAttribute("data-vf-frame-handle",i),s.setAttribute("data-vf-target-id",o),s.style.cssText=["position:absolute","display:block","width:14px","height:14px","box-sizing:border-box","border-radius:999px","border:2px solid #0b0d0a","background:#F2CD46","box-shadow:0 0 0 2px rgba(242,205,70,0.32),0 1px 4px rgba(0,0,0,0.38)","pointer-events:auto","touch-action:none",a].join(";"),t.append(s)}}var DX=(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||!g1(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||!re(S)||!re(E)){c(null);return}let R=v.getBoundingClientRect(),C=h.getBoundingClientRect(),I=r??XU(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();Im(h,e,R=>u1(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=Dt(h.draft.x+b,0,100-h.draft.width),E.y=Dt(h.draft.y+S,0,100-h.draft.height)),h.mode==="left"||h.mode==="top-left"||h.mode==="bottom-left"){let R=Dt(h.draft.x+b,0,h.draft.x+h.draft.width-1);E.x=R,E.width=Dt(h.draft.width+(h.draft.x-R),1,100-R)}if((h.mode==="right"||h.mode==="top-right"||h.mode==="bottom-right")&&(E.width=Dt(h.draft.width+b,1,100-h.draft.x)),h.mode==="top"||h.mode==="top-left"||h.mode==="top-right"){let R=Dt(h.draft.y+S,0,h.draft.y+h.draft.height-1);E.y=R,E.height=Dt(h.draft.height+(h.draft.y-R),1,100-R)}if((h.mode==="bottom"||h.mode==="bottom-left"||h.mode==="bottom-right")&&(E.height=Dt(h.draft.height+S,1,100-h.draft.y)),MX(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}),LX=(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,publishOptions:E=null,onPublishOption:R,publishDisabled:C,publishLabel:I,templateId:D,forkId:z,publishVersion:U,originalUrl:O,songName:N,songUrl:B,onOpenShare:V,onOpenDecompose:st,onOpenHistory:nt,decomposeDismissed:lt=!1,decomposeBusy:X=!1,onResumeDecompose:ct}){let F=n?Nt(n):null,gt=n?TU(r,n):null,Q=n?c1(r,n):null,dt=Q&&gt?a1(Q,gt):null,[Xt,Ce]=(0,A.useState)(dt),[bn,Pn]=(0,A.useState)(F),[Z,Vt]=(0,A.useState)(!1);(0,A.useEffect)(()=>{let j=dt?{...dt,...u?.updates,...p}:null;Ce(j),Pn(F);let jt=!$_(j,dt);Vt(!1),l({dirty:jt,commit:jt&&j?()=>tc(j):null})},[F,r,u,p,l]);let Lt=(0,A.useRef)(null);if((0,A.useEffect)(()=>{Lt.current=n&&F&&bn===F&&Xt&&!$_(Xt,dt)?{key:F,commit:()=>$d(Xt)}:null}),(0,A.useEffect)(()=>{let j=F;return()=>{let jt=Lt.current;Lt.current=null,jt&&j&&jt.key===j&&jt.commit()}},[F]),!n)return(0,g.jsx)(EX,{composition:e,onPublish:S,publishOptions:E,onPublishOption:R,publishDisabled:C,publishLabel:I,templateId:D,forkId:z,publishVersion:U,originalUrl:O,songName:N,songUrl:B,onOpenShare:V,onOpenDecompose:st,onOpenHistory:nt,decomposeDismissed:lt,decomposeBusy:X,onResumeDecompose:ct});let ft=Q??n,te=m1(ft),mt=X_(r,ft)??te?.kind,oe=KU(r,ft),Qt=ft.tag==="audio"||mt==="audio",cn=ft.tag==="video"||mt==="video",_n=ft.tag==="img"||ft.tag==="image"||mt==="image",He=Qt||cn||_n,un=ft.tag==="video",ut=Qt||un,Ft=oe==="html"||mt==="shape"&&!!te?.customHtml,bt=!Qt,It=!He&&!Ft,yt=gt??TU(r,ft),K=Xt??a1(ft,yt),vt=!$_(K,dt),Ht=K.volume;function dn(j,jt){let Ao={isAudio:Qt,isMedia:He,isTextLike:It,isVisual:bt,isVideoElement:un};a(ft,Io=>{V_(Io,j,ft,Ao,jt)})}function Ut(j){let jt={...Xt??a1(ft,yt),...j};if(("start"in j||"duration"in j||"track"in j)&&!c(ft,{start:jt.start,duration:jt.duration,track:jt.track}))return;if("x"in j||"y"in j||"width"in j||"height"in j){let Me={x:Dt(jt.x,0,Math.max(0,100-jt.width)),y:Dt(jt.y,0,Math.max(0,100-jt.height)),width:Dt(jt.width,1,100-jt.x),height:Dt(jt.height,1,100-jt.y)};jt.x=Me.x,jt.y=Me.y,jt.width=Me.width,jt.height=Me.height,d(ft,Me)}("src"in j||"volume"in j||"muted"in j||"x"in j||"y"in j||"width"in j||"height"in j||"fontFamily"in j||"fontWeight"in j||"fontSize"in j||"textBackgroundStyle"in j||"background"in j||"color"in j||"text"in j||"italic"in j||"underline"in j||"radius"in j)&&dn(jt,j);let Io=!$_(jt,dt);Ce(jt),l({dirty:Io,commit:Io?()=>tc(jt):null})}function Gd(j){i(ft,j)}function tc(j){let jt={isAudio:Qt,isMedia:He,isTextLike:It,isVisual:bt,isVideoElement:un},Ao=IU(j,dt),Io=j.start!==ft.start||j.duration!==ft.duration||j.track!==ft.track;try{if(Io){let{html:Me}=WU(r,ft,{start:j.start,duration:j.duration,track:j.track});o(Zo(Me,ft,n0=>{V_(n0,j,ft,jt,Ao)})),F&&f(F),F&&m(F);return}Gd(Me=>{V_(Me,j,ft,jt,Ao)}),F&&f(F),F&&m(F)}catch(Me){Ar("editor.inspector-update-rejected",Me instanceof Error?Me.message:Me)}}function zm(){vt&&tc(K)}function $d(j){if(bn!==F)return;let jt={isAudio:Qt,isMedia:He,isTextLike:It,isVisual:bt,isVideoElement:un},Ao=IU(j,dt),Io=["start","duration","track","x","y","width","height"];Number.isFinite(p?.fontSize)&&Io.push("fontSize");for(let Me of Io)delete Ao[Me];if(Object.keys(Ao).length!==0)try{Gd(Me=>{V_(Me,j,ft,jt,Ao)})}catch(Me){Ar("editor.inspector-switch-commit-rejected",Me instanceof Error?Me.message:Me)}}return(0,g.jsxs)("section",{className:"dna-panel",children:[(0,g.jsxs)("div",{className:"panel-title",children:[(0,g.jsx)("span",{children:"Native Inspector"}),(0,g.jsx)("strong",{children:ft.tag}),vt?(0,g.jsxs)("div",{className:"panel-action-pair",children:[(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>{if(dt){let j={isAudio:Qt,isMedia:He,isTextLike:It,isVisual:bt,isVideoElement:un};a(ft,jt=>{CX(jt,dt,ft,j)})}Ce(dt),F&&v(F),_(ft),l({dirty:!1,commit:null})},children:"Cancel"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button primary",onClick:()=>{zm(),l({dirty:!1,commit:null})},children:"Update"})]}):(0,g.jsx)("button",{type:"button",className:"panel-close-button","aria-label":"Unselect layer",onClick:s,children:"x"})]}),(0,g.jsxs)("article",{className:"dna-card selected-card",children:[(0,g.jsx)("strong",{children:ft.label??ft.id}),(0,g.jsx)("p",{children:te?.viralNote??"Native timeline element."})]}),(0,g.jsxs)("article",{className:"inspector-identity",children:[(0,g.jsx)(NX,{id:ft.hfId??ft.id??""}),(0,g.jsxs)("div",{className:"inspector-identity-fields",children:[(0,g.jsx)("input",{className:"inspector-identity-input",type:"text",placeholder:"slug (snake_case)",spellCheck:!1,value:K.slug,onChange:j=>Ut({slug:e0(j.target.value)})}),(0,g.jsx)("input",{className:"inspector-identity-input",type:"text",placeholder:"note \u2014 viral DNA reference",value:K.note,onChange:j=>Ut({note:j.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)(q_,{min:0,max:Math.max(0,b-K.duration),value:K.start,onCommit:j=>Ut({start:j})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"End"}),(0,g.jsx)(q_,{min:.05,max:b,value:K.start+K.duration,onCommit:j=>Ut({duration:Math.max(.05,j-K.start)})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Dur"}),(0,g.jsx)(q_,{min:.05,max:Math.max(.05,b-K.start),value:K.duration,onCommit:j=>Ut({duration:Math.max(.05,j)})})]}),(0,g.jsxs)("label",{className:"inspector-field compact",children:[(0,g.jsx)("span",{children:"Layer"}),(0,g.jsx)(q_,{min:0,step:1,value:K.track,onCommit:j=>Ut({track:Math.max(0,Math.round(j))})})]})]})]}),ut&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Audio"}),(0,g.jsxs)("label",{className:"switch-row",children:[(0,g.jsx)("span",{children:"Mute audio"}),(0,g.jsx)("input",{type:"checkbox",checked:K.muted,onChange:j=>Ut({muted:j.target.checked})})]}),(0,g.jsxs)("label",{className:"volume-row",children:[(0,g.jsxs)("span",{children:["Volume ",Math.round(Ht*100),"%"]}),(0,g.jsx)("input",{type:"range",min:"0",max:"1",step:"0.01",value:Ht,onChange:j=>Ut({volume:Number(j.target.value)})})]})]}),He&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:Qt?"Replace audio":cn?"Replace video":"Replace image"}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Source URL"}),(0,g.jsx)("input",{type:"text",value:K.src,onChange:j=>Ut({src:j.target.value})})]}),!Qt&&(0,g.jsxs)("div",{className:"inspector-grid",children:[(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Fit"}),(0,g.jsxs)("select",{value:K.objectFit,onChange:j=>Ut({objectFit:j.target.value}),children:[(0,g.jsx)("option",{value:"cover",children:"Cover (fill + crop)"}),(0,g.jsx)("option",{value:"contain",children:"Contain (letterbox)"}),(0,g.jsx)("option",{value:"fill",children:"Fill (stretch)"}),(0,g.jsx)("option",{value:"none",children:"None (native)"}),(0,g.jsx)("option",{value:"scale-down",children:"Scale-down"})]})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Position"}),(0,g.jsxs)("select",{value:K.objectPosition,onChange:j=>Ut({objectPosition:j.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"})]})]})]})]}),It&&(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)(xX,{value:K.text,onChange:j=>Ut({text:j}),onCommit:()=>$d(K)})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Font"}),(0,g.jsx)(TX,{value:K.fontFamily,onChange:j=>Ut({fontFamily:j,fontWeight:K.fontWeight>=600?Os(j):400})})]}),(0,g.jsx)("div",{className:"inspector-grid",children:(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Size"}),(0,g.jsx)("input",{type:"number",min:"8",max:"120",step:"1",value:K.fontSize,onChange:j=>Ut({fontSize:Number(j.target.value)})})]})}),(0,g.jsxs)("div",{className:"text-style-toggles",children:[(0,g.jsxs)("label",{className:"style-toggle bold",title:"Bold",children:[(0,g.jsx)("input",{type:"checkbox","aria-label":"Bold",checked:K.fontWeight>=600,onChange:j=>Ut({fontWeight:j.target.checked?Os(K.fontFamily):400})}),(0,g.jsx)("span",{"aria-hidden":"true",children:"B"})]}),(0,g.jsxs)("label",{className:"style-toggle italic",title:"Italic",children:[(0,g.jsx)("input",{type:"checkbox","aria-label":"Italic",checked:K.italic,onChange:j=>Ut({italic:j.target.checked})}),(0,g.jsx)("span",{"aria-hidden":"true",children:"I"})]}),(0,g.jsxs)("label",{className:"style-toggle underline",title:"Underline",children:[(0,g.jsx)("input",{type:"checkbox","aria-label":"Underline",checked:K.underline,onChange:j=>Ut({underline:j.target.checked})}),(0,g.jsx)("span",{"aria-hidden":"true",children:"U"})]})]}),(0,g.jsxs)("div",{className:"inspector-grid",children:[(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Text"}),(0,g.jsx)("input",{type:"color",value:K.color.startsWith("#")?K.color:"#ffffff",onChange:j=>Ut({color:j.target.value})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Effect color"}),(0,g.jsx)("input",{type:"color",value:K.background.startsWith("#")?K.background:"#000000",onChange:j=>Ut({background:j.target.value})})]})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Background"}),(0,g.jsx)(wX,{value:K.textBackgroundStyle,color:K.color,background:K.background,onChange:j=>Ut({textBackgroundStyle:j})})]})]}),bt&&(0,g.jsxs)("article",{children:[(0,g.jsx)("h2",{children:"Frame"}),(0,g.jsxs)("div",{className:"inspector-grid",children:[(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"X %"}),(0,g.jsx)("input",{type:"number",min:"0",max:"100",step:"0.5",value:K.x,onChange:j=>Ut({x:Number(j.target.value)})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Y %"}),(0,g.jsx)("input",{type:"number",min:"0",max:"100",step:"0.5",value:K.y,onChange:j=>Ut({y:Number(j.target.value)})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"W %"}),(0,g.jsx)("input",{type:"number",min:"1",max:"100",step:"0.5",value:K.width,onChange:j=>Ut({width:Number(j.target.value)})})]}),(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"H %"}),(0,g.jsx)("input",{type:"number",min:"1",max:"100",step:"0.5",value:K.height,onChange:j=>Ut({height:Number(j.target.value)})})]}),It&&(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("label",{className:"inspector-field",children:[(0,g.jsx)("span",{children:"Radius"}),(0,g.jsx)("input",{type:"number",min:"0",max:"999",step:"1",value:K.radius,onChange:j=>Ut({radius:Number(j.target.value)})})]})})]})]}),(0,g.jsx)("div",{className:"inspector-danger-zone",children:Z?(0,g.jsxs)("div",{className:"delete-confirm",children:[(0,g.jsx)("span",{children:"Delete this layer?"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button secondary",onClick:()=>Vt(!1),children:"Cancel"}),(0,g.jsx)("button",{type:"button",className:"panel-action-button danger",onClick:()=>{h(ft),s()},children:"Delete"})]}):(0,g.jsx)("button",{type:"button",className:"inspector-delete-button",disabled:ft.hfId==="source-video",onClick:()=>Vt(!0),children:"Delete layer"})})]})}),Rm={current:null},Nm={current:null},Cm={current:[]};function UX(t){if(Nm.current){Nm.current.onExportComplete(t);return}Cm.current.some(n=>n.url===t.url&&n.renderId===t.renderId)||Cm.current.push(t)}function Kl(t){let e=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`;return`${t}-${e}`}async function BX(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 JU(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 PX(t){let n=zd()?.vidfarmApiKey??null;if(!n)throw new Error("Sign in required to upload media from your computer.");let r=await JU({file:t,apiKey:n});return{url:r.viewUrl,contentType:r.contentType,fileName:r.fileName}}function zX(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 FX(t){return t.replace(/\/$/,"")}function kU(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 HX({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",D=FX(I),z=t?.compositionId??e.templateId;(0,A.useEffect)(()=>{if(!C)return;let Z=!1;return(async()=>{try{let Vt=new URLSearchParams({template_id:z??"",include_messages:"true",limit:"50"}),Lt=await fetch(`${D}/threads?${Vt.toString()}`,{headers:{"vidfarm-api-key":C}});if(!Lt.ok)return;let ft=await Lt.json().catch(()=>null);if(Z||!Array.isArray(ft?.threads))return;let te=ft.threads.filter(mt=>!!mt&&typeof mt=="object").map(mt=>({id:String(mt.id??""),title:String(mt.title??"Chat"),templateId:String(mt.templateId??z),updatedAt:String(mt.updatedAt??""),lastMessageAt:typeof mt.lastMessageAt=="string"?mt.lastMessageAt:null,messageCount:typeof mt.messageCount=="number"?mt.messageCount:0,messages:Array.isArray(mt.messages)?mt.messages:[]})).filter(mt=>mt.id);if(Z)return;if(h(te),te.length>0){let mt=te[0];b.current=mt.id,r(kU(mt.messages))}}catch{}})(),()=>{Z=!0}},[C,D,z]);let U=(0,A.useCallback)(Z=>{b.current=Z.id,r(kU(Z.messages)),_(!1),c(null)},[]),O=(0,A.useCallback)(()=>{b.current=Kl("thread"),r([]),_(!1),c(null)},[]);(0,A.useEffect)(()=>{let Z=S.current;Z&&(Z.scrollTop=Z.scrollHeight)},[n]),(0,A.useEffect)(()=>{let Z={onExportComplete:Vt=>{r(Lt=>{if(Lt.some(oe=>oe.role==="assistant"&&oe.status==="complete"&&typeof oe.text=="string"&&oe.text.includes(Vt.url)))return Lt;let te=Vt.title?`"${Vt.title}" `:"",mt={id:Kl("assistant"),role:"assistant",text:`Render ${te}finished. Rendered MP4: ${Vt.url}
1147
+
1148
+ Say "approve it" to publish this MP4 as an approved post.`,toolExchanges:[],status:"complete"};return[...Lt,mt]})}};if(Nm.current=Z,Cm.current.length>0){let Vt=Cm.current.slice();Cm.current=[];for(let Lt of Vt)Z.onExportComplete(Lt)}return()=>{Nm.current===Z&&(Nm.current=null)}},[]);let N=(0,A.useCallback)((Z,Vt)=>{r(Lt=>Lt.map(ft=>ft.id===Z?Vt(ft):ft))},[]),B=(0,A.useCallback)(async Z=>{if(!C||Z.length===0)return;let Vt=Z.map(Lt=>({id:Kl("user").replace("user-","att-"),fileName:Lt.name,contentType:Lt.type||"application/octet-stream",viewUrl:"",sizeBytes:Lt.size,status:"uploading"}));u(Lt=>[...Lt,...Vt]);for(let Lt=0;Lt<Z.length;Lt+=1){let ft=Z[Lt],te=Vt[Lt];try{let mt=await JU({file:ft,apiKey:C});u(oe=>oe.map(Qt=>Qt.id===te.id?{...mt,status:"ready"}:Qt))}catch(mt){let oe=mt instanceof Error?mt.message:String(mt);u(Qt=>Qt.map(cn=>cn.id===te.id?{...cn,status:"error",error:oe}:cn))}}},[C]),V=(0,A.useCallback)(()=>{E.current?.click()},[]),st=(0,A.useCallback)(Z=>{let Vt=Z.target.files?Array.from(Z.target.files):[];Z.target.value="",Vt.length>0&&B(Vt)},[B]),nt=(0,A.useCallback)(Z=>{u(Vt=>Vt.filter(Lt=>Lt.id!==Z))},[]),lt=(0,A.useCallback)(Z=>{if(!C)return;let Vt=Z.clipboardData?.items?Array.from(Z.clipboardData.items):[],Lt=[];for(let ft of Vt)if(ft.kind==="file"){let te=ft.getAsFile();te&&Lt.push(te)}Lt.length>0&&(Z.preventDefault(),B(Lt))},[C,B]),X=(0,A.useCallback)(Z=>{C&&Z.dataTransfer?.types?.includes("Files")&&(Z.preventDefault(),R.current+=1,f(!0))},[C]),ct=(0,A.useCallback)(Z=>{C&&Z.dataTransfer?.types?.includes("Files")&&(Z.preventDefault(),Z.dataTransfer.dropEffect="copy")},[C]),F=(0,A.useCallback)(Z=>{C&&(Z.preventDefault(),R.current=Math.max(0,R.current-1),R.current===0&&f(!1))},[C]),gt=(0,A.useCallback)(Z=>{if(!C)return;Z.preventDefault(),R.current=0,f(!1);let Vt=Z.dataTransfer?.files?Array.from(Z.dataTransfer.files):[];Vt.length>0&&B(Vt)},[C,B]),Q=(0,A.useCallback)(async()=>{let Z=o.trim(),Vt=d.filter(K=>K.status==="ready");if(d.filter(K=>K.status==="uploading").length>0){c("Waiting for uploads to finish...");return}if(!Z&&Vt.length===0||a)return;if(!C){c("Sign in required to chat.");return}let ft=Vt.map(({status:K,error:vt,...Ht})=>Ht),te={id:Kl("user"),role:"user",text:Z,attachments:ft,toolExchanges:[],status:"complete"},mt={id:Kl("assistant"),role:"assistant",text:"",toolExchanges:[],status:"pending"},oe=n;r(K=>[...K,te,mt]),i(""),u(K=>K.filter(vt=>vt.status!=="ready")),s(!0),c("Sending...");let Qt=t?.compositionId??e.id,cn=t?.slugId??e.id,_n=t?.title??e.title,He=e.summary??"",un=Rm.current?.getSnapshot(),ut=ft.length>0?[`
1149
+
1150
+ <attachments>`,...ft.map(K=>`- ${K.fileName} (${K.contentType}): ${K.viewUrl}`),"</attachments>"].join(`
1151
+ `):"",Ft=un?`${Z}${ut}
1152
+
1153
+ <editor_context>
1154
+ ${JSON.stringify(un,null,2)}
1155
+ </editor_context>`:`${Z}${ut}`,bt=K=>{let vt=[];K.text.trim()&&vt.push({type:"text",text:K.text});for(let Ht of K.attachments??[])vt.push({type:"file",data:Ht.viewUrl,mediaType:Ht.contentType});return vt},It=[...oe.filter(K=>K.text.trim().length>0||(K.attachments?.length??0)>0).map(K=>({role:K.role,content:bt(K)})),{role:"user",content:[{type:"text",text:Ft},...ft.map(K=>({type:"file",data:K.viewUrl,mediaType:K.contentType}))]}],yt={template:{page:"docs",tracerId:null,tracers:[],defaultRequestTracer:null,templateId:Qt,templateSlug:cn,templateTitle:_n,templateDescription:He,docsRoutes:[]},messages:It,thread_id:b.current,thread_template_id:Qt,thread_title:_n,thread_tracers:[],user_message:{id:te.id,role:"user",text:Ft,attachments:ft.map(K=>({id:K.id,fileName:K.fileName,contentType:K.contentType,viewUrl:K.viewUrl}))},assistant_message:{id:mt.id}};try{let K=await fetch(I,{method:"POST",headers:{"content-type":"application/json","vidfarm-api-key":C},body:JSON.stringify(yt)});if(!K.ok){let vt=await K.text().catch(()=>K.statusText);throw new Error(vt||`HTTP ${K.status}`)}N(mt.id,vt=>({...vt,status:"streaming"})),await BX(K,{onDelta:vt=>{N(mt.id,Ht=>({...Ht,text:Ht.text+vt}))},onStatus:vt=>c(vt),onToolCall:vt=>{N(mt.id,Ht=>({...Ht,toolExchanges:[...Ht.toolExchanges,{toolCallId:vt.toolCallId,toolName:vt.toolName,args:vt.args,status:"pending"}]}))},onToolResult:vt=>{let Ht=null;if(vt.toolName==="editor_action"){let dn=sJ(vt.result);if(dn&&Rm.current)try{Ht=Rm.current.applyAction(dn)}catch(Ut){Ht={ok:!1,error:Ut instanceof Error?Ut.message:String(Ut)}}else dn&&(Ht={ok:!1,error:"Editor not ready to apply action."})}N(mt.id,dn=>({...dn,toolExchanges:dn.toolExchanges.map(Ut=>Ut.toolCallId===vt.toolCallId?{...Ut,result:vt.result,status:"complete",appliedSummary:Ht?.ok?Ht.summary:void 0,appliedError:Ht&&!Ht.ok?Ht.error:void 0}:Ut)}))},onError:vt=>{N(mt.id,Ht=>({...Ht,status:"error",error:vt}))}}),N(mt.id,vt=>vt.status==="error"?vt:{...vt,status:"complete"}),c(null)}catch(K){let vt=K instanceof Error?K.message:String(K);N(mt.id,Ht=>({...Ht,status:"error",error:vt})),c(`Error: ${vt}`)}finally{s(!1)}},[C,t,e,o,a,n,d,N]),dt=(0,A.useCallback)(Z=>{Z.preventDefault(),Q()},[Q]),Xt=(0,A.useCallback)(Z=>{Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),Q())},[Q]),Ce=d.filter(Z=>Z.status==="uploading").length,bn=d.filter(Z=>Z.status==="ready").length,Pn=!!C&&!a&&Ce===0&&(o.trim().length>0||bn>0);return(0,g.jsxs)("aside",{className:`chat-workspace${p?" chat-workspace--drag":""}`,"aria-label":"Creative chat",onDragEnter:X,onDragOver:ct,onDragLeave:F,onDrop:gt,children:[(0,g.jsxs)("div",{className:"chat-header chat-header-row",children:[(0,g.jsx)("button",{type:"button",className:"chat-header-history","aria-label":m?"Back to chat":"Open chat history","aria-pressed":m,onClick:()=>_(Z=>!Z),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(Z=>(0,g.jsx)("li",{children:(0,g.jsxs)("button",{type:"button",className:"chat-thread-history-item","data-active":Z.id===b.current?"true":"false",onClick:()=>U(Z),children:[(0,g.jsx)("span",{className:"chat-thread-history-title",children:Z.title||"Untitled chat"}),(0,g.jsxs)("span",{className:"chat-thread-history-meta",children:[Z.messageCount," message",Z.messageCount===1?"":"s"]})]})},Z.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(Z=>(0,g.jsx)(jX,{message:Z},Z.id)),l&&!m&&(0,g.jsx)("div",{className:"chat-status",children:l})]}),(0,g.jsxs)("form",{className:"chat-composer",onSubmit:dt,hidden:m,children:[d.length>0&&(0,g.jsx)("div",{className:"chat-composer-attachments",children:d.map(Z=>(0,g.jsx)(GX,{attachment:Z,onRemove:()=>nt(Z.id)},Z.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:Z=>i(Z.target.value),onKeyDown:Xt,onPaste:lt,disabled:!C||a}),(0,g.jsxs)("div",{className:"chat-composer-actions",children:[(0,g.jsx)("button",{type:"button",className:"chat-composer-icon",onClick:V,disabled:!C||a,"aria-label":"Attach files",title:"Attach files (or paste / drop)",children:(0,g.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,g.jsx)("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),(0,g.jsx)("button",{type:"submit",className:"chat-composer-send",disabled:!Pn,"aria-label":"Send",title:"Send (Enter)",children:a?(0,g.jsx)("span",{className:"chat-composer-send-label",children:"\u2026"}):(0,g.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,g.jsx)("path",{d:"M5 12h14"}),(0,g.jsx)("path",{d:"M13 5l7 7-7 7"})]})})]})]}),(0,g.jsx)("input",{ref:E,type:"file",multiple:!0,hidden:!0,onChange:st}),p&&(0,g.jsx)("div",{className:"chat-composer-drop-hint","aria-hidden":"true",children:"Drop files to attach"})]})]})}function GX({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 QU(t){return t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function s1(t){let e=QU(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 $X(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>${QU(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>${s1(c)}</li>`).join("")}</ul>`:i.every(l=>/^\d+\.\s+/.test(l.trim()))?`<ol>${i.map(c=>c.trim().replace(/^\d+\.\s+/,"")).map(c=>`<li>${s1(c)}</li>`).join("")}</ol>`:`<p>${i.map(l=>s1(l.trim())).join("<br />")}</p>`}).filter(Boolean).join(""):""}function jX({message:t}){let e=t.text.trim().length>0,n=e?$X(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)(qX,{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 qX({exchange:t}){let e=t.args?VX(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:lJ(t.result)})]})}function VX(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 ZU(t,e,n){let r=n.trim();if(!r)return null;let o=h=>h.key===r||h.id===r||h.hfId===r||h.domId===r||Nt(h)===r,i=t.draftedElements.find(o);if(i)return i;if(!e)return null;let a=new DOMParser().parseFromString(e,"text/html"),s=r.replace(/["\\]/g,"\\$&"),l=a.querySelector(`[data-hf-slug="${s}"]`),c=a.querySelector(`[data-hf-id="${s}"]`)??a.getElementById(r),d=(l instanceof Element?l:null)??(c instanceof Element?c:null);if(!d)return null;let u=d.getAttribute("data-hf-id")||d.id;if(!u)return null;let p=t.draftedElements.find(h=>h.hfId===u||h.domId===u||h.id===u||h.key===u);if(p)return p;let f=Number(d.getAttribute("data-start")??0),m=Number(d.getAttribute("data-duration")??0),_=Number(d.getAttribute("data-track-index")??0),v=d instanceof HTMLElement&&d.id?d.id:void 0;return{id:u,key:u,hfId:u,domId:v,tag:d.tagName.toLowerCase(),start:Number.isFinite(f)?f:0,duration:Number.isFinite(m)?m:0,track:Number.isFinite(_)?_:0}}function YX(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 WX(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 KX(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=F=>{if(!F)return;let gt=F.match(/(-?\d+(?:\.\d+)?)\s*%/);return gt?Number(gt[1]):void 0},C=R(b?.left),I=R(b?.top),D=R(b?.width),z=R(b?.height),U=E||C!==void 0&&I!==void 0&&D!==void 0&&z!==void 0&&C<=.5&&I<=.5&&D>=99.5&&z>=99.5,O=h?.getAttribute("src")??void 0,N=h?.getAttribute("data-volume"),B=N&&Number.isFinite(Number(N))?Number(N):void 0,V=b?.color||void 0,st=b?.background||void 0,nt=h?.getAttribute("data-hf-id")??v.hfId??v.id,lt=h?.getAttribute("data-hf-slug")??void 0,X=h?.getAttribute("data-hf-note")??void 0,ct=(S??"").toLowerCase();return(E||["video","image","html","shape"].includes(ct))&&Number.isFinite(v.duration)&&v.duration>0&&i.push({start:v.start,end:v.start+v.duration}),{key:Nt(v),element_id:nt??void 0,slug:lt,note:X,label:v.label,kind:S,tag:v.tag,is_timeline_proxy:E||void 0,is_full_canvas:U||void 0,src:O,start:v.start,duration:v.duration,track:v.track,playback_start:v.playbackStart,x:C,y:I,width:D,height:z,volume:B,color:V,background:st}}),s=t.composition.width,l=t.composition.height,c=Number.isFinite(t.activeCompositionDuration)?t.activeCompositionDuration:0,d=WX(i,c),u=[];if(n)for(let v of Array.from(n.querySelectorAll("[data-vf-gen-media]"))){if(!re(v))continue;let h=v.getAttribute("data-vf-gen-media"),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=VU(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:YX(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 RU(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 XX(t,e,n);if(t.action_type==="generate_layer")return JX(t,e,n);if(t.action_type==="group_layers")return iJ(t,e,n);if(t.action_type==="ungroup_layers")return aJ(t,e,n);let r=t.layer_key;if(!r)return{ok:!1,error:`layer_key required for ${t.action_type}.`};let o=ZU(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=e0(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}=xo(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=Pm(d,{start:a,duration:s,track:l},new Set(c?[c]:[]));u!==l&&(i.track=u)}try{let{html:a,resolvedCollisions:s}=WU(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 eJ(t,e,n,o);if(t.action_type==="set_layer_style")return nJ(t,e,n,o);if(t.action_type==="duplicate_layer")return rJ(t,e,n,o);if(t.action_type==="split_layer")return oJ(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 XX(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=Dt(t.x??d.x,0,100),p=Dt(t.y??d.y,0,100),f=Dt(t.width??d.width,0,100),m=Dt(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}=xo(n,R=>{let C=R.querySelector("[data-composition-id]");if(!re(C))throw new Error("Composition root not found.");let I=Array.from(R.querySelectorAll("[data-start]")).filter(V=>re(V)),D=t.track,z=I.reduce((V,st)=>{let nt=Number(st.getAttribute("data-track-index")??0);return Number.isFinite(nt)?Math.max(V,nt+1):V},0),U=Number.isFinite(D)&&D!==void 0?Math.max(0,Math.floor(D)):z,O=Pm(R,{start:a,duration:c,track:U},new Set([h])),N;r==="video"?N=R.createElement("video"):r==="image"?N=R.createElement("img"):r==="audio"?N=R.createElement("audio"):N=R.createElement("div"),N.id=h,N.setAttribute("data-hf-id",h),N.setAttribute("data-layer-mode","publish");let B=r==="text"?"caption":r;if(N.setAttribute("data-layer-kind",B),N.setAttribute("data-viral-note",`AI inserted ${r} layer.`),N.setAttribute("data-start",Kt(a)),N.setAttribute("data-duration",Kt(c)),N.setAttribute("data-end",Kt(a+c)),N.setAttribute("data-track-index",String(O)),N.setAttribute("data-label",b),N.classList.add("clip"),t.slug){let V=e0(t.slug);V&&N.setAttribute("data-hf-slug",V)}if(t.note&&t.note.trim()&&N.setAttribute("data-hf-note",t.note.trim()),r!=="audio"?(N.style.position="absolute",N.style.left=`${u}%`,N.style.top=`${p}%`,N.style.width=`${f}%`,N.style.height=`${m}%`,N.style.zIndex=String(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 st=Kt(t.playback_start??0);N.setAttribute("data-media-start",st),N.setAttribute("data-playback-start",st),N.style.objectFit=t.object_fit??"cover",t.object_position&&(N.style.objectPosition=t.object_position),N.style.background="#050604"}else if(r==="image"&&t.src)N.setAttribute("src",t.src),N.style.objectFit=t.object_fit??"cover",t.object_position&&(N.style.objectPosition=t.object_position);else if(r==="audio"&&t.src){if(N.setAttribute("src",t.src),N.setAttribute("preload","auto"),t.volume!==void 0&&N.setAttribute("data-volume",String(t.volume)),t.playback_start!==void 0){let V=Kt(t.playback_start);N.setAttribute("data-media-start",V),N.setAttribute("data-playback-start",V)}}else r==="text"?(N.setAttribute("data-text-background-style","plain"),N.setAttribute("data-text-background-color",t.background??"#000000"),N.setAttribute("data-font-family","Montserrat"),N.style.display="flex",N.style.alignItems="center",N.style.justifyContent="center",N.style.padding="3px",N.style.boxSizing="border-box",N.style.textAlign="center",N.style.color=t.color??"#ffffff",N.style.background="transparent",N.style.fontFamily="Montserrat, 'TikTok Sans', sans-serif",N.style.fontWeight="600",N.style.fontSize=`${t.font_size??22}px`,N.style.lineHeight="1.2",J_(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 NU="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 JX(t,e,n){let r=t.media_type==="image"?"image":t.media_type==="video"?"video":null;if(!r)return{ok:!1,error:"generate_layer requires media_type 'video' or 'image'."};let o=t.prompt?.trim();if(!o)return{ok:!1,error:"generate_layer requires a non-empty prompt."};let i=t.intent??(t.replace_layer_key?"replace_layer":"add"),a=t.start,s=t.duration,l=t.track,c=t.x,d=t.y,u=t.width,p=t.height,f=null;if(i==="replace_layer"){let B=(t.replace_layer_key||t.layer_key||"").trim();if(!B)return{ok:!1,error:"generate_layer intent=replace_layer requires replace_layer_key (the layer to replace)."};let V=ZU(e,n,B);if(!V)return{ok:!1,error:`generate_layer: layer to replace not found: ${B}`};f=V;let st=new DOMParser().parseFromString(n,"text/html"),nt=Bn(st,V),lt=nt?nt.getAttribute("data-vf-timeline-proxy")!==null||nt.getAttribute("data-vf-full-canvas")==="true"||nt.style.width==="100%"&&nt.style.height==="100%":!1;if(a===void 0&&(a=V.start),s===void 0&&(s=V.duration>0?V.duration:void 0),l===void 0&&(l=V.track),lt)c=0,d=0,u=100,p=100;else if(nt){let X=ct=>{let F=Number.parseFloat(ct);return Number.isFinite(F)?F:void 0};c===void 0&&(c=X(nt.style.left)),d===void 0&&(d=X(nt.style.top)),u===void 0&&(u=X(nt.style.width)),p===void 0&&(p=X(nt.style.height))}}let m=f?f.hfId||f.id:null,_=t.layer_key?.trim(),v=_&&_!==m&&/^[A-Za-z][\w-]{0,63}$/.test(_)?_:`vf-gen-${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,h=v.startsWith("element_")?v:`element_${v}`,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),D=Dt(c??0,0,100),z=Dt(d??0,0,100),U=Dt(u??100,0,100),O=Dt(p??100,0,100),N=o.length>140?`${o.slice(0,137)}\u2026`:o;try{let{html:B,resolvedCollisions:V}=xo(n,nt=>{let lt=nt.querySelector("[data-composition-id]");if(!re(lt))throw new Error("Composition root not found.");if(f){let dt=Bn(nt,f);dt?.parentNode&&dt.parentNode.removeChild(dt)}let X=l,ct=Array.from(nt.querySelectorAll("[data-start]")).reduce((dt,Xt)=>{let Ce=Number(Xt.getAttribute("data-track-index")??0);return Number.isFinite(Ce)?Math.max(dt,Ce+1):dt},0),F=Number.isFinite(X)&&X!==void 0?Math.max(0,Math.floor(X)):ct,gt=Pm(nt,{start:E,duration:I,track:F},new Set([h])),Q=r==="video"?nt.createElement("video"):nt.createElement("img");if(Q.id=h,Q.setAttribute("data-hf-id",h),Q.setAttribute("data-layer-mode","publish"),Q.setAttribute("data-layer-kind",r),Q.setAttribute("data-viral-note",`AI generating ${r}: ${N}`),Q.setAttribute("data-start",Kt(E)),Q.setAttribute("data-duration",Kt(I)),Q.setAttribute("data-end",Kt(E+I)),Q.setAttribute("data-track-index",String(gt)),Q.setAttribute("data-label",`Generating ${r}\u2026`),Q.classList.add("clip"),t.slug){let dt=e0(t.slug);dt&&Q.setAttribute("data-hf-slug",dt)}Q.setAttribute("data-vf-gen","1"),Q.setAttribute("data-vf-gen-media",r),Q.setAttribute("data-vf-gen-status","submitting"),Q.setAttribute("data-vf-gen-prompt",N),Q.style.position="absolute",Q.style.left=`${D}%`,Q.style.top=`${z}%`,Q.style.width=`${U}%`,Q.style.height=`${O}%`,Q.style.zIndex=String(gt),Q.style.overflow="hidden",Q.style.objectFit=t.object_fit??"cover",Q.style.background="#0c0f0a",r==="video"?(Q.setAttribute("poster",NU),Q.setAttribute("playsinline",""),Q.setAttribute("preload","auto"),Q.setAttribute("muted",""),Q.setAttribute("data-volume","1"),Q.setAttribute("data-media-start","0"),Q.setAttribute("data-playback-start","0")):Q.setAttribute("src",NU),lt.append(Q)});e.patchCompositionHtml(B),QX({deps:e,genId:h,mediaType:r,prompt:o,action:t});let st=i==="replace_layer"?`replacing ${m}`:`at ${E.toFixed(2)}s`;return{ok:!0,summary:Zl(`Started ${r} generation (${st}). A placeholder is on the timeline as ${v}; it will swap to the finished media automatically. Watch editor_context.pending_generations.`,V)}}catch(B){return{ok:!1,error:B instanceof Error?B.message:String(B)}}}function Mm(t,e,n){let r=t.compositionHtmlRef.current;if(!r)return!1;let o=e.replace(/["\\]/g,"\\$&"),i=new DOMParser().parseFromString(r,"text/html"),a=i.querySelector(`[data-hf-id="${o}"]`);return re(a)?(n(a),t.patchCompositionHtml(Q_(i)),!0):!1}async function QX(t){let{deps:e,genId:n,mediaType:r,prompt:o,action:i}=t,a=r==="video"?"/api/v1/primitives/videos/generate":"/api/v1/primitives/images/generate",s=i.aspect_ratio?.trim(),l=i.provider?.trim(),c=i.model?.trim(),d=(i.input_references??[]).filter(m=>typeof m=="string"&&/^https?:\/\//i.test(m)),u=(i.prompt_attachments??[]).filter(m=>typeof m=="string"&&/^https?:\/\//i.test(m)),p={prompt:o};s&&(p.aspect_ratio=s),l&&(p.provider=l),c&&(p.model=c),r==="video"?(i.gen_duration&&Number.isFinite(i.gen_duration)&&(p.duration=Math.round(i.gen_duration)),i.resolution&&(p.resolution=i.resolution),i.generate_audio!==void 0&&(p.generate_audio=i.generate_audio),d.length&&(p.input_references=d.slice(0,8))):u.length&&(p.prompt_attachments=u.slice(0,16));let f=`editor-gen-${Date.now().toString(36)}`;try{let m=await fetch(a,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tracer:f,payload:p})}),_=await m.json().catch(()=>({}));if(!m.ok||!_.job_id){let v=_.error||`generation request failed (${m.status})`;Mm(e,n,h=>{h.setAttribute("data-vf-gen-status","error"),h.setAttribute("data-vf-gen-error",v.slice(0,200))});return}Mm(e,n,v=>{v.setAttribute("data-vf-gen-job",_.job_id),v.setAttribute("data-vf-gen-tracer",f),v.setAttribute("data-vf-gen-status","generating")})}catch(m){Mm(e,n,_=>{_.setAttribute("data-vf-gen-status","error"),_.setAttribute("data-vf-gen-error",(m instanceof Error?m.message:String(m)).slice(0,200))})}}function ZX(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 tJ(t,e,n){return Mm(t,e,r=>{let o=r.getAttribute("data-vf-gen-media");r.setAttribute("src",n),r.removeAttribute("poster"),r.removeAttribute("data-vf-gen"),r.removeAttribute("data-vf-gen-media"),r.removeAttribute("data-vf-gen-prompt"),r.removeAttribute("data-vf-gen-job"),r.removeAttribute("data-vf-gen-tracer"),r.removeAttribute("data-vf-gen-error"),r.removeAttribute("data-vf-gen-status");let i=r.getAttribute("data-label");i&&/generating/i.test(i)&&r.setAttribute("data-label",o==="image"?"AI image":"AI video"),r.setAttribute("data-viral-note",`AI generated ${o==="image"?"image":"video"}.`)})}function eJ(t,e,n,r){let o=[],i=Zo(n,r,a=>{if(t.src!==void 0&&(a.setAttribute("src",t.src),o.push(`src=${t.src.slice(0,60)}`)),t.volume!==void 0&&(a.setAttribute("data-volume",String(t.volume)),o.push(`volume=${t.volume}`)),t.muted!==void 0&&(t.muted?a.setAttribute("muted",""):a.removeAttribute("muted"),o.push(`muted=${t.muted}`)),t.playback_start!==void 0){let s=Kt(t.playback_start);a.setAttribute("data-media-start",s),a.setAttribute("data-playback-start",s),o.push(`playback_start=${s}`)}t.object_fit&&(a.style.objectFit=t.object_fit,o.push(`object_fit=${t.object_fit}`)),t.object_position&&(a.style.objectPosition=t.object_position,o.push(`object_position=${t.object_position}`))});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 nJ(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 rJ(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}=xo(n,c=>{let d=Bn(c,r);if(!d)throw new Error(`Layer node not found: ${r.id}`);let u=d.cloneNode(!0);u.id=a,u.setAttribute("data-hf-id",a),t.start!==void 0&&u.setAttribute("data-start",Kt(t.start)),t.duration!==void 0&&u.setAttribute("data-duration",Kt(t.duration)),t.label&&u.setAttribute("data-label",t.label);let p=Number(u.getAttribute("data-start")??r.start),f=Number(u.getAttribute("data-duration")??r.duration),m=t.track!==void 0?Math.max(0,Math.floor(t.track)):r.track,_=Pm(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 oJ(t,e,n,r){let o=t.split_time;if(o===void 0)return{ok:!1,error:"split_layer requires split_time."};if(o<=r.start||o>=r.start+r.duration)return{ok:!1,error:"split_time must fall inside the layer's [start, start+duration] range."};let i=`element_split_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`;try{let a=Zo(n,r,s=>{let l=Number(s.getAttribute("data-start")??r.start),c=Number(s.getAttribute("data-duration")??r.duration),d=o-l,u=l+c-o,p=Number(s.getAttribute("data-playback-start")??s.getAttribute("data-media-start")??r.playbackStart??0),f=Kt(p+d),m=s.getAttribute("data-layer-kind")??"layer";s.setAttribute("data-duration",Kt(d));let _=s.cloneNode(!0);_.id=i,_.setAttribute("data-hf-id",i),_.setAttribute("data-start",Kt(o)),_.setAttribute("data-duration",Kt(u)),_.setAttribute("data-media-start",f),_.setAttribute("data-playback-start",f),_.setAttribute("data-layer-kind",m),_.setAttribute("data-label",`${r.label??r.id} split`),s.after(_)});return a===n?{ok:!1,error:"No change applied \u2014 element selector did not match the composition HTML."}:(e.patchCompositionHtml(a),{ok:!0,summary:`Split ${r.id} at ${o}; new layer ${i}.`})}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}function iJ(t,e,n){let r=(t.layer_keys??[]).filter(c=>typeof c=="string"&&c.trim().length>0);if(r.length<2)return{ok:!1,error:"group_layers requires layer_keys with at least two entries."};let o=r.map(c=>e.draftedElements.find(d=>Nt(d)===c)).filter(c=>!!c);if(o.length!==r.length)return{ok:!1,error:"One or more layer_keys not found in the composition."};let i=`vf-group-${Date.now().toString(36)}`,a=t.group_label?.trim()||"Vidfarm group",{html:s,resolvedCollisions:l}=xo(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 aJ(t,e,n){let r=(t.layer_keys??[]).filter(s=>typeof s=="string"&&s.trim().length>0);if(r.length===0)return{ok:!1,error:"ungroup_layers requires layer_keys."};let o=r.map(s=>e.draftedElements.find(l=>Nt(l)===s)).filter(s=>!!s);if(o.length===0)return{ok:!1,error:"No matching layers found for ungroup_layers."};let{html:i,resolvedCollisions:a}=xo(n,s=>{let l=new Set;for(let c of o){let u=Bn(s,c)?.getAttribute("data-vf-group");u&&l.add(u)}for(let c of l)for(let d of Array.from(s.querySelectorAll(`[data-vf-group="${CSS.escape(c)}"]`)))re(d)&&(d.removeAttribute("data-vf-group"),d.removeAttribute("data-vf-group-label"))});return i===n?{ok:!1,error:"No change applied \u2014 layers were not grouped."}:(e.patchCompositionHtml(i),{ok:!0,summary:Zl(`Ungrouped ${o.length} layers.`,a)})}function sJ(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 lJ(t){try{return JSON.stringify(t,null,2)}catch{return String(t)}}function cJ({item:t}){let[e,n]=(0,A.useState)(0);if(t.media.type==="slideshow"){let r=t.media.slides.length,o=i=>{n((i+r)%r)};return(0,g.jsx)("div",{className:"document-video-block slideshow-preview-block",children:(0,g.jsxs)("div",{className:"document-video-stage slideshow-preview-stage",children:[(0,g.jsxs)("div",{className:"slideshow-preview-stack",children:[(0,g.jsx)("button",{type:"button",className:"carousel-nav previous","aria-label":"Previous slide",onClick:()=>o(e-1),children:"\u2039"}),(0,g.jsx)("img",{src:t.media.slides[e],alt:`Slide ${e+1}`}),(0,g.jsx)("button",{type:"button",className:"carousel-nav next","aria-label":"Next slide",onClick:()=>o(e+1),children:"\u203A"}),(0,g.jsxs)("span",{className:"carousel-count",children:[e+1," / ",r]})]}),(0,g.jsx)("div",{className:"slideshow-thumb-strip","aria-label":"Slides",children:t.media.slides.map((i,a)=>(0,g.jsx)("button",{type:"button",className:e===a?"active":"","aria-label":`Show slide ${a+1}`,onClick:()=>n(a),children:(0,g.jsx)("img",{src:i,alt:""})},i))})]})})}return(0,g.jsx)("div",{className:"document-video-block repeated-video-block",children:(0,g.jsx)("div",{className:"document-video-stage",children:(0,g.jsx)("video",{src:t.media.src,controls:!0,playsInline:!0,preload:"metadata",onLoadedMetadata:r=>{let o=r.currentTarget;xt("preview.video.loaded-metadata",{id:t.id,currentSrc:o.currentSrc,duration:o.duration,videoWidth:o.videoWidth,videoHeight:o.videoHeight})},onError:r=>{let o=r.currentTarget;wo("preview.video.error",{id:t.id,currentSrc:o.currentSrc,errorCode:o.error?.code,errorMessage:o.error?.message})}})})})}function uJ({onEdit:t}){return(0,g.jsx)("div",{className:"preview-feed","aria-label":"Preview output",children:Um.map(e=>{let n=[["Hook",e.viralDna.hook],["Retention",e.viralDna.retention],["Payoff",e.viralDna.payoff]];return(0,g.jsxs)("article",{className:"preview-feed-card",children:[(0,g.jsxs)("header",{className:"markdown-preview-header",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{children:e.eyebrow}),(0,g.jsx)("h1",{children:e.title})]}),(0,g.jsx)("div",{className:"markdown-preview-actions",children:(0,g.jsx)("button",{type:"button",className:"main-action-button",title:"Edit composition",onClick:()=>{xt("preview.edit-click",{id:e.id}),t(e)},children:"Edit"})})]}),(0,g.jsxs)("div",{className:"preview-feed-body",children:[(0,g.jsx)("div",{className:"preview-feed-spacer","aria-hidden":"true"}),(0,g.jsx)("section",{className:"preview-video-column","aria-label":"Reference render",children:(0,g.jsx)(cJ,{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:f1(e).map(r=>(0,g.jsxs)("article",{className:"markdown-layer-row",children:[(0,g.jsx)("span",{children:oX(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:[K_(r.start)," - ",K_(r.start+r.duration)]})]},r.id))})]})]})]})]},e.id)})})}function dJ({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)(()=>$U(e),[e]),u=(0,A.useRef)(null);(0,A.useEffect)(()=>{let f=!0;return xt("editor.studio-import-start"),Y_().then(m=>{xt("editor.studio-import-success",{exports:Object.keys(m).sort()}),f&&r(m)}).catch(m=>{wo("editor.studio-import-error",m instanceof Error?m.stack:m),f&&i(m instanceof Error?m.message:String(m))}),()=>{f=!1,xt("editor.studio-import-cleanup")}},[]),(0,A.useEffect)(()=>{let f=!0,m=a?`/api/v1/compositions/${encodeURIComponent(a)}/composition.html`:`/editor/${encodeURIComponent(e.id)}/composition`;return fetch(m,{cache:"default"}).then(_=>_.ok?_.text():null).then(_=>{f&&c(Xl(_??d))}).catch(()=>{f&&c(Xl(d))}),()=>{f=!1}},[e.id,d,a]),(0,A.useEffect)(()=>{!n||!l||n.usePlayerStore.getState().reset()},[l,n]);let p=(0,A.useCallback)(async()=>{if(a)return a;if(u.current)return u.current;let f=(async()=>{let m=await fetch("/api/v1/compositions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:e.id,title:e.title})}),_=await m.json().catch(()=>({}));if(!m.ok||!_?.fork_id)throw new Error(_?.error||`Fork creation failed (${m.status})`);if(s(_.fork_id),typeof window<"u"){let v=new URL(window.location.href);v.searchParams.set("fork",_.fork_id),window.history.replaceState(null,"",v)}return _.fork_id})();u.current=f;try{return await f}finally{u.current=null}},[e.id,e.title,a]);return o?(0,g.jsxs)("section",{className:"editor-loading-shell","aria-label":"Editor load failed",children:[(0,g.jsx)("span",{children:"Editor failed to load"}),(0,g.jsx)("small",{children:o})]}):!n||!l?(0,g.jsx)("section",{className:"editor-loading-shell","aria-label":"Loading video editor",children:(0,g.jsx)("span",{children:"Loading editor"})}):(0,g.jsx)(fJ,{studio:n,onPreview:t,composition:e,initialCompositionHtml:l,forkId:a,ensureFork:p,replaceForkId:s})}function fJ({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=FU(n),[m,_]=(0,A.useState)(()=>r),v=(0,A.useMemo)(()=>{let y=VU(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"),[D,z]=(0,A.useState)(null),[U,O]=(0,A.useState)(null),N=(0,A.useRef)(null),B=(0,A.useRef)(null),[V,st]=(0,A.useState)(null),[nt,lt]=(0,A.useState)(()=>new Map),[X,ct]=(0,A.useState)(()=>new Map),[F,gt]=(0,A.useState)(null),[Q,dt]=(0,A.useState)(null),[Xt,Ce]=(0,A.useState)(!1),[bn,Pn]=(0,A.useState)(!1),[Z,Vt]=(0,A.useState)(null);(0,A.useEffect)(()=>{if(!o){Vt(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)&&Vt(x)}).catch(()=>{}),()=>{y=!1}},[o,F?.version]);let[Lt,ft]=(0,A.useState)(0),[te,mt]=(0,A.useState)(!1),oe=(0,A.useRef)(null),Qt=(0,A.useRef)(null),cn=(0,A.useRef)(null),_n=(0,A.useRef)(null),He=(0,A.useRef)(null),un=(0,A.useRef)(null),ut=(0,A.useRef)(0),Ft=(0,A.useRef)(0),bt=(0,A.useRef)(-1),It=(0,A.useRef)(null),yt=(0,A.useRef)(!1),K=(0,A.useRef)([]),vt=(0,A.useRef)([]),Ht=(0,A.useRef)(null),dn=(0,A.useRef)({timing:()=>{},visual:()=>{},flushAll:()=>{}}),Ut=(0,A.useRef)(null),Gd=(0,A.useRef)(!1),tc=(0,A.useRef)(!1),zm=(0,A.useRef)(null),$d=(0,A.useRef)({active:!1,pendingBody:null,pendingRevBump:!1});(0,A.useEffect)(()=>{let y=`comp:${n.id}`;zm.current!==y&&gX(m)&&(zm.current=y,dt({mode:"initial",dismissed:!1,busy:!1,finished:!1,error:null,scenesCreated:null,ghostcutStatus:null,ghostcutProgress:null,userPrompt:""}))},[n.id,m]);let j=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||j.current===o)return;j.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)}/remove-video-captions-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),L=await k.json().catch(()=>({}));if(!k.ok||L?.ok===!1){await new Promise($=>setTimeout($,8e3));continue}let M=L.status??"none";if(M==="none"||M==="failed")return;if(M==="pending"&&dt($=>$&&{...$,ghostcutStatus:"pending"}),M==="done"){L.swap_applied&&typeof window<"u"&&window.location.reload();return}}catch{}await new Promise(k=>setTimeout(k,2e4))}})(),()=>{y=!0,j.current=null}},[o]);let jt=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||jt.current===o)return;jt.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)&&(m0.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 L=await T();if(!(L==="none"||L==="done"||L==="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({})}),$=await M.json().catch(()=>({}));if(!M.ok||$?.ok===!1){await new Promise(it=>setTimeout(it,6e3));continue}await T();let Y=$.status??"none";if(Y==="none"||Y==="done"||Y==="failed")return}catch{}await new Promise(M=>setTimeout(M,4e3))}})(),()=>{y=!0,jt.current=null}},[o]);let Ao=(0,A.useCallback)(async()=>{dt(k=>k&&{...k,busy:!0,error:null});let y=Q?.userPrompt?.trim()??"",T=async k=>{let L=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 L.json().catch(()=>({}));return{response:L,data:M}},x=async k=>{let L=Date.now(),M=600*1e3;for(;Date.now()-L<M;){await new Promise($=>setTimeout($,2e4));try{let $=await fetch(`/api/v1/compositions/${encodeURIComponent(k)}/remove-video-captions-poll`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),Y=await $.json().catch(()=>({}));if(!$.ok||Y?.ok===!1)continue;let it=Y.status??"none",J=typeof Y.progress=="number"?Y.progress:null;if(dt(_t=>_t&&{..._t,ghostcutStatus:it,ghostcutProgress:J}),it==="done"||it==="failed"||it==="none")return}catch{}}};try{let k=o??await i(),{response:L,data:M}=await T(k);if(L.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})}),_t=await J.json().catch(()=>({}));if(!J.ok||!_t?.fork_id)throw new Error(_t?.error||`Fork creation failed (${J.status})`);if(k=_t.fork_id,a(k),typeof window<"u"){let St=new URL(window.location.href);St.searchParams.set("fork",k),window.history.replaceState(null,"",St)}({response:L,data:M}=await T(k))}if(!L.ok||!M?.ok)throw new Error(M?.error||`Decompose failed (${L.status})`);let Y=typeof M.scene_count=="number"&&Number.isFinite(M.scene_count)?M.scene_count:null,it=M.ghostcut_pending?"pending":"none";dt(J=>J&&{...J,busy:!1,finished:!0,error:null,scenesCreated:Y,ghostcutStatus:it,ghostcutProgress:null}),M.ghostcut_pending&&x(k)}catch(k){let L=k instanceof Error?k.message:String(k);dt(M=>M&&{...M,busy:!1,error:L})}},[i,o,n.id,n.title,a,Q?.userPrompt]),Io=(0,A.useCallback)(()=>{dt(null),typeof window<"u"&&window.location.reload()},[]),Me=(0,A.useCallback)(()=>{dt(null)},[]),n0=(0,A.useCallback)(()=>{dt(y=>y&&{...y,dismissed:!0})},[]),n6=(0,A.useCallback)(()=>{dt(y=>y&&{...y,dismissed:!1})},[]),r6=(0,A.useCallback)(async()=>{try{o||await i()}catch{}dt({mode:"redo",dismissed:!1,busy:!1,finished:!1,error:null,scenesCreated:null,ghostcutStatus:null,ghostcutProgress:null,userPrompt:""})},[i,o]),o6=(0,A.useCallback)(async()=>{if(!o)try{await i()}catch{}Ce(!0)},[i,o]),i6=(0,A.useCallback)(()=>{o&&Pn(!0)},[o]),a6=(0,A.useCallback)(()=>{Pn(!1),typeof window<"u"&&window.location.reload()},[]),y1=o?`/composition/current.html?fork=${encodeURIComponent(o)}&rev=${b}`:`/composition/current.html?composition=${encodeURIComponent(n.id)}&rev=${b}`,{iframeRef:Fm,onIframeLoad:s6,resetPlayer:b1}=p(),ec=u(y=>y.selectedElementId),r0=u(y=>y.selectedElementIds),nc=u(y=>y.elements),_1=u(y=>y.timelineReady),l6=u(y=>y.isPlaying),ko=(0,A.useMemo)(()=>nc.map(y=>{let T=Nt(y);return AU(y,nt.get(T))}),[nc,nt]),v1=(0,A.useMemo)(()=>n1(ko),[ko]),o0=v1.length>0&&_1,[c6,u6]=(0,A.useState)(0),[d6,f6]=(0,A.useState)(0);(0,A.useEffect)(()=>{if(!o0)return;let y=cn.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)},[o0]);let vn=ko.find(y=>Nt(y)===ec)??null,p6=vn?nt.get(Nt(vn)):void 0,S1=vn?X.get(Nt(vn))?.frame:void 0,m6=Lt>=0&&K.current.length>0,g6=Lt>=0&&vt.current.length>0,rc=F?.phase==="starting"||F?.phase==="running",h6=rc?"Rendering":"Render",y6=(0,A.useMemo)(()=>{let y=zd();return y?.localRender&&y?.cloudRenderAvailable?[{key:"local",label:"Render Local (Free)",hint:"Render in-process on this machine \u2014 no cloud charge"},{key:"cloud",label:"Render in Cloud",hint:"Render on the cloud account \u2014 billed to its wallet"}]:null},[]),Hm=(0,A.useMemo)(()=>new Set([...ec?[ec]:[],...Array.from(r0)]),[ec,r0]),b6=(0,A.useMemo)(()=>{if(Hm.size===0)return!1;let y=Z_(m);return nc.some(T=>Hm.has(Nt(T))&&vU(y,T))},[m,nc,Hm]),Sn=(0,A.useCallback)(()=>{cancelAnimationFrame(ut.current),ut.current=0,Ft.current=0,bt.current=-1},[]);(0,A.useEffect)(()=>{if(!Gd.current){Gd.current=!0;return}b1(),Sn(),R(!0),I("1"),z(null),O(null),lt(new Map),ct(new Map),gt(null),mt(!1),K.current=[],vt.current=[],Ht.current=null,It.current=null,yt.current=!1,_n.current=null,He.current=null;let y=$U(n);h.current=y,_(y),S(T=>T+1),ft(T=>T+1)},[n.id,n,b1,Sn]);let oc=(0,A.useCallback)(()=>{ft(y=>y+1)},[]),ic=(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=K.current,x=Date.now(),k=Ht.current;Ht.current=y?{key:y,at:x}:null;let L=ic();!!!(y&&k&&k.key===y&&x-k.at<1200&&T.length>0)&&T[T.length-1]?.html!==L.html&&(K.current=[...T.slice(-49),L]),vt.current=[],oc()},[oc,ic]),kt=(0,A.useCallback)(()=>{let y=d(un.current);return y?(Fm.current=y,y):Fm.current},[Fm,d]),E1=(0,A.useCallback)(y=>{if(!y)return kt();for(let T of Array.from(document.querySelectorAll("iframe")))if(T.contentWindow===y)return T;return kt()},[kt]),T1=(0,A.useCallback)((y,T)=>{let x=kt()?.getBoundingClientRect(),k=Qt.current?.getBoundingClientRect(),L=x&&x.width>1&&x.height>1?x:k;if(!L)return{x:12,y:70,width:42,height:12};let M=(y-L.left)/Math.max(1,L.width)*100,$=(T-L.top)/Math.max(1,L.height)*100,Y=Dt(M,0,95),it=Dt($,0,95);return{x:Y,y:it,width:Dt(42,1,100-Y),height:Dt(12,1,100-it)}},[kt]),Gm=(0,A.useCallback)(y=>{z(null),O(y)},[]),_6=(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),Gm({x:y.clientX,y:y.clientY,time:x.currentTime,frame:T1(y.clientX,y.clientY),elementId:null}),xt("editor.preview-stage-context-menu",{x:y.clientX,y:y.clientY,time:x.currentTime})},[T1,Gm,u]),v6=(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),xt("editor.preview-blank-unselect")},[u]),i0=(0,A.useCallback)(()=>{let y=Cs(kt());if(!y)return;let T=y.getTime(),x=y.getDuration(),k=x>0&&T>=x,L=y.isPlaying()&&!k,M=performance.now();if((!L||M-Ft.current>=66||Math.abs(T-bt.current)>=.25)&&(Ft.current=M,bt.current=T,u.getState().setCurrentTime(T)),!L){u.getState().setIsPlaying(!1),Sn();return}ut.current=requestAnimationFrame(i0)},[kt,Sn]),ac=(0,A.useCallback)(()=>{Sn(),ut.current=requestAnimationFrame(i0)},[Sn,i0]),jd=(0,A.useCallback)(y=>{let T=wU(y);I(String(Number(T.toFixed(2))));let x=kt(),k=Cs(x);return k?.setPlaybackRate?.(T),u.getState().audioMuted||(k?.setMuted?.(!1),xU(x,"set-muted",{muted:!1})),xU(x,"set-playback-rate",{playbackRate:T}),T},[kt]),Ir=(0,A.useCallback)(y=>{let T=kt(),x=Cs(T),k=u.getState(),L=x?.getDuration()||u.getState().duration||f,M=Math.max(0,Math.min(L,Number.isFinite(y)?y:0)),$=!!(x?.isPlaying()||k.isPlaying);if(Sn(),x){x.seek(M);let Y=x.getTime();c.notify(Y),k.setCurrentTime(Y),k.setIsPlaying(!!x.isPlaying())}else c.notify(M),k.setCurrentTime(M),k.requestSeek(M);return $&&x?.isPlaying()&&ac(),!0},[f,kt,c,ac,Sn,u]),$m=(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=cn.current?.querySelector('[aria-label="Timeline"]'),k=x?.firstElementChild instanceof HTMLElement?x.firstElementChild:null,L=u.getState().duration||f;if(!k||L<=0)return null;let M=k.getBoundingClientRect(),Y=Math.max(1,k.scrollWidth-lU)/L,it=y-M.left+k.scrollLeft-lU;if(it<0)return null;let J=Math.max(0,Math.min(L,it/Y)),_t=T-M.top+k.scrollTop-cU,St=He.current?.rowOrder??n1(ko),ot=Math.floor(_t/uU),ie=T-M.top,We=St.length>0&&ie>=0&&ie<=cU,Je=We?Math.max(...St)+1:ot>=0&&ot<St.length?St[ot]:null,gc=Je===null?null:ko.find(No=>No.track===Je&&J>=No.start&&J<=No.start+No.duration)??null;return{time:J,track:Je,syntheticTrack:We,element:gc,scrollLeft:k.scrollLeft,pixelsPerSecond:Y}},[f,ko,u]),w1=(0,A.useCallback)((y,T)=>{let x=Sa(y,0);if(!x)return!1;let{time:k,scrollLeft:L,pixelsPerSecond:M}=x;return Ir(k),xt("editor.timeline-capture-seek",{source:T,time:k,clientX:y,scrollLeft:L,pixelsPerSecond:M}),!0},[Ir,Sa]),S6=(0,A.useCallback)(y=>{if(y.button!==0||y.shiftKey||y.metaKey||y.ctrlKey||y.altKey){_n.current=null;return}_n.current={clientX:y.clientX,clientY:y.clientY,button:y.button,startedOnTimeline:$m(y.target)}},[$m]),E6=(0,A.useCallback)(y=>{let T=_n.current;_n.current=null,!(!T||T.button!==0||!T.startedOnTimeline||!$m(y.target)||Math.hypot(y.clientX-T.clientX,y.clientY-T.clientY)>5)&&w1(y.clientX,"click-capture")},[$m,w1]),T6=(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 L=Nt(x.element);new Set([...k.selectedElementId?[k.selectedElementId]:[],...Array.from(k.selectedElementIds)]).has(L)||(k.clearSelectedElementIds(),k.setSelectedElementId(L))}else k.clearSelectedElementIds(),k.setSelectedElementId(null);z({x:y.clientX,y:y.clientY,time:x.time,track:x.syntheticTrack?null:x.track,element:x.element}),O(null)},[Sa,u]),jm=(0,A.useCallback)(y=>{Ni(kt(),y)},[kt]),x1=(0,A.useCallback)(()=>oe.current?.querySelector(".dna-panel")?.scrollTop??0,[]),A1=(0,A.useCallback)(y=>{requestAnimationFrame(()=>{let T=oe.current?.querySelector(".dna-panel");T&&(T.scrollTop=y)})},[]),sc=(0,A.useCallback)(()=>{let y=u.getState(),T=Cs(kt());return{time:T?.getTime()??y.currentTime,selectedElementId:y.selectedElementId,selectedElementIds:Array.from(y.selectedElementIds),zoomMode:y.zoomMode,manualZoomPercent:y.manualZoomPercent,rightPanelScrollTop:x1(),playbackRate:wU(Number(C)),wasPlaying:!!(T?.isPlaying()||y.isPlaying)}},[kt,x1,C,u]),w6=(0,A.useCallback)(()=>{let y=It.current;if(!y){jm(vn);return}let T=0,x=()=>{let k=u.getState();if(!(k.timelineReady&&k.elements.length>0)&&T<12){T+=1,requestAnimationFrame(x);return}let M=Cs(kt());if(y.wasPlaying&&!M&&T<30){T+=1,requestAnimationFrame(x);return}It.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 Y of y.selectedElementIds)k.toggleSelectedElementId(Y);k.setSelectedElementId(y.selectedElementId);let $=y.selectedElementId?k.elements.find(Y=>Nt(Y)===y.selectedElementId)??null:null;Ni(kt(),$),A1(y.rightPanelScrollTop),jd(y.playbackRate),Ir(y.time),y.wasPlaying&&M?(M.play(),k.setIsPlaying(!0),ac()):k.setIsPlaying(!1),xt("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)},[jd,Ir,kt,A1,vn,ac,jm,u]);(0,A.useEffect)(()=>()=>Sn(),[Sn]),(0,A.useEffect)(()=>{h.current=m},[m]),(0,A.useEffect)(()=>{jm(vn)},[vn,jm]),(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=E1(T.source),$=M?.getBoundingClientRect(),Y=M?.contentWindow?.innerWidth||$?.width||1,it=M?.contentWindow?.innerHeight||$?.height||1,J=($?.width??1)/Math.max(1,Y),_t=($?.height??1)/Math.max(1,it),St=($?.left??0)+Number(x.clientX??0)*J,ot=($?.top??0)+Number(x.clientY??0)*_t,ie={x:Number(x.frame?.x??12),y:Number(x.frame?.y??70),width:Number(x.frame?.width??42),height:Number(x.frame?.height??12)},We={x:Dt(ie.x,0,95),y:Dt(ie.y,0,95),width:Dt(ie.width,1,100-Dt(ie.x,0,95)),height:Dt(ie.height,1,100-Dt(ie.y,0,95))};Gm({x:St,y:ot,time:Number.isFinite(Number(x.time))?Number(x.time):k.currentTime,frame:We,elementId:x.id??null}),xt("editor.preview-context-menu",{id:x.id??null,time:Number(x.time),frame:We});return}if(x.action!=="select-layer")return;if(k.clearSelectedElementIds(),!x.id){k.setSelectedElementId(null),O(null),xt("editor.canvas-empty-select");return}let L=k.elements.find(M=>M.hfId===x.id||M.domId===x.id||M.id===x.id||M.key===x.id);k.setSelectedElementId(L?Nt(L):null),O(null),xt("editor.canvas-layer-select",{id:x.id,elementKey:L?Nt(L):null})};return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[E1,Gm,u]);let a0=(0,A.useCallback)(()=>{let y=$d.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,a0()}})()},[i]),lc=(0,A.useCallback)((y,T)=>{let x=$d.current;x.pendingBody=Xl(y),T.bumpRev&&(x.pendingRevBump=!0),a0()},[a0]),Yr=(0,A.useCallback)((y,T)=>{xt("editor.composition-persist",{bytes:y.length,mode:T}),lc(y,{bumpRev:!1})},[lc]),cc=(0,A.useCallback)((y,T)=>{y=Xl(y);let x={...sc(),...T};yt.current&&(x.wasPlaying=!0,yt.current=!1),It.current=x,h.current=y,_(y),Sn(),u.getState().reset(),R(!1),xt("editor.composition-publish",{bytes:y.length}),lc(y,{bumpRev:!0})},[sc,lc,Sn,u]),Ro=(0,A.useCallback)(y=>{or(),cc(y)},[cc,or]),I1=(0,A.useCallback)((y,T)=>{or(),cc(y,{selectedElementId:T,selectedElementIds:[]})},[cc,or]),gJ=(0,A.useCallback)((y,T)=>{y=Xl(y),or(),h.current=y,_(y);let x=kt(),k=t1(x,y),L=u.getState(),M=L.selectedElementId?L.elements.find($=>Nt($)===L.selectedElementId)??null:null;Ni(x,M),Yr(y,"soft"),T!==void 0&&Ir(T),xt("editor.timeline-timing-soft-patch",{bytes:y.length,patchedCount:k,seekTime:T})},[Ir,kt,Yr,or,u]),x6=(0,A.useCallback)((y,T)=>{let x=h.current,k=Zo(x,y,T);if(k===x){xt("editor.live-patch-skipped-missing",{elementKey:Nt(y)});return}or(`live:${Nt(y)}`),h.current=k,_(k);let L=kt(),M=Im(L,y,T);Ni(L,y),xt("editor.live-patch",{elementKey:Nt(y),hfId:y.hfId,domId:y.domId,tag:y.tag,hasIframe:!!L,patched:M}),M?Yr(k,"soft"):cc(k)},[kt,Yr,cc,or]),A6=(0,A.useCallback)((y,T)=>{let x=kt(),k=Im(x,y,T);Ni(x,y),xt("editor.live-preview-patch",{elementKey:Nt(y),patched:k})},[kt]),qm=(0,A.useCallback)(y=>{let T=h.current;h.current=y.html,_(y.html);let x=kt(),k=mU(x,y.html),L=k?G_(x):!1;e1(u,T,y.html),Yr(y.html,"soft");let M=u.getState(),$=new Set(M.elements.map(J=>Nt(J))),Y=y.selectedElementId&&$.has(y.selectedElementId)?y.selectedElementId:null,it=y.selectedElementIds.filter(J=>$.has(J));if(k&&L){M.clearSelectedElementIds();for(let _t of it)M.toggleSelectedElementId(_t);M.setSelectedElementId(Y);let J=Y?M.elements.find(_t=>Nt(_t)===Y)??null:null;Ni(x,J),Ir(y.time),xt("editor.history-live-swap",{bytes:y.html.length});return}if(It.current={...sc(),time:y.time,selectedElementId:Y,selectedElementIds:it},Sn(),gU(x,y.html)){xt("editor.history-document-write",{bytes:y.html.length});return}lc(y.html,{bumpRev:!0}),xt("editor.history-reload-fallback",{bytes:y.html.length})},[sc,Ir,lc,kt,Yr,Sn,u]),s0=(0,A.useCallback)(y=>{let T=kt(),x=T?.contentDocument??null,k=x?Q_(x):h.current;h.current=y,_(y);let L=mU(T,y),M=L?G_(T):!1;if(e1(u,k,y),L&&M){Ir(u.getState().currentTime),xt("editor.dev-reload-live-swap",{bytes:y.length});return}if(It.current={...sc()},Sn(),gU(T,sX(y))){xt("editor.dev-reload-document-write",{bytes:y.length});return}Ar("editor.dev-reload-apply-failed",{bytes:y.length})},[sc,Ir,kt,Sn,u]);(0,A.useEffect)(()=>{if(!o||!zd()?.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(L=>L.ok?L.text():null).then(L=>{L!=null&&s0(Xl(L))}).catch(L=>Ar("editor.live-reload-fetch-failed",L instanceof Error?L.message:String(L)))};return y.addEventListener("reload",T),y.onerror=()=>Ar("editor.live-reload-sse-error"),()=>{y.removeEventListener("reload",T),y.close()}},[s0,o]);let qd=(0,A.useCallback)(()=>{dn.current.flushAll();let y=K.current.pop();y&&(vt.current=[ic(),...vt.current.slice(0,49)],Ht.current=null,oc(),qm(y))},[qm,oc,ic]),uc=(0,A.useCallback)(()=>{dn.current.flushAll();let y=vt.current.shift();y&&(K.current=[...K.current.slice(-49),ic()],Ht.current=null,oc(),qm(y))},[qm,oc,ic]),l0=(0,A.useRef)({undo:()=>{},redo:()=>{}});(0,A.useEffect)(()=>{l0.current={undo:qd,redo:uc}},[uc,qd]);let I6=(0,A.useCallback)(()=>{let y=kt()?.contentDocument;!y||fU.has(y)||(fU.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?l0.current.redo():l0.current.undo())},!0))},[kt]),k6=(0,A.useCallback)(y=>{Ut.current=y.commit,mt(y.dirty)},[]),c0=(0,A.useCallback)(y=>{ct(T=>{if(!T.has(y))return T;let x=new Map(T);return x.delete(y),x})},[]),R6=(0,A.useCallback)(y=>{let T=Nt(y),x=t0(h.current,y);if(x){let k=XU(x);Im(kt(),y,L=>u1(L,k)),Ni(kt(),y)}c0(T)},[c0,kt]),Vm=(0,A.useCallback)((y,T)=>{let x=Nt(y),k={x:Dt(T.x,0,Math.max(0,100-T.width)),y:Dt(T.y,0,Math.max(0,100-T.height)),width:Dt(T.width,1,100-T.x),height:Dt(T.height,1,100-T.y),...Number.isFinite(T.fontSize)?{fontSize:Math.max(8,Math.min(180,Number(T.fontSize)))}:{}};ct(L=>{let M=new Map(L);return M.set(x,{element:y,frame:k}),M}),Ni(kt(),y),mt(!0)},[kt]),N6=(0,A.useCallback)(()=>{window.setTimeout(()=>dn.current.visual(),0)},[]),dc=(0,A.useCallback)(()=>{let y=Array.from(X.values());if(y.length===0)return!1;or();let T=h.current;for(let x of y)T=Zo(T,x.element,k=>u1(k,x.frame));return h.current=T,_(T),ct(new Map),Yr(T,"soft"),Ni(kt(),vn),xt("editor.visual-frame-drafts-commit",{count:y.length}),!0},[kt,Yr,or,vn,X]);(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(),L=k.elements.find(Y=>Y.hfId===x.id||Y.domId===x.id||Y.id===x.id||Y.key===x.id);if(!L||!g1(L))return;let M=Number(x.frame.fontSize),$={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}:{}};[$.x,$.y,$.width,$.height].every(Number.isFinite)&&(k.clearSelectedElementIds(),k.setSelectedElementId(Nt(L)),Vm(L,$),x.phase==="end"&&window.setTimeout(()=>dn.current.visual(),0),xt("editor.iframe-visual-frame-draft",{elementKey:Nt(L),phase:x.phase,frame:$}))};return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[Vm,u]);let k1=(0,A.useCallback)(y=>{let T=Array.from(nt.entries()).filter(([x])=>x!==y).map(([,x])=>x);return T.length===0?h.current:i1(h.current,T).html},[nt]),u0=(0,A.useCallback)(y=>{lt(T=>{if(!T.has(y))return T;let x=new Map(T);return x.delete(y),x})},[]),C6=(0,A.useCallback)(y=>{let T=nt.get(y);if(T){let x=c1(h.current,T.element);u.getState().updateElement(y,{start:x.start,duration:x.duration,track:x.track,playbackStart:x.playbackStart})}u0(y)},[u0,nt,u]),Mi=(0,A.useCallback)((y,T,x)=>{let k=Nt(y),L=c1(h.current,y),$={...nt.get(k)?.updates??{},...T};if(!x?.bypassCollisionGuard){let St={start:$.start??L.start,duration:$.duration??L.duration,track:$.track??L.track},ot=_U(u.getState().elements,y,h.current),ie={start:L.start,duration:L.duration,track:L.track};if(r1(St,ot)&&!r1(ie,ot))return Ar("editor.timeline-stage-collision-rejected",{elementKey:k,proposed:St}),!1}let Y=h.current;try{let St=Array.from(nt.entries()).filter(([ot])=>ot!==k).map(([,ot])=>ot);Y=i1(h.current,[...St,{element:L,updates:$}]).html}catch(St){return Ar("editor.timeline-stage-rejected",St instanceof Error?St.message:St),!1}let it=u.getState();it.setSelectedElementId(k),it.updateElement(k,T),lt(St=>{let ot=new Map(St);return ot.set(k,{element:L,updates:$}),ot});let J=kt(),_t=t1(J,Y);return Ni(J,{...L,...$}),xt("editor.timeline-stage-applied",{elementKey:k,updates:$,patchedCount:_t}),!0},[kt,nt,u]),fc=(0,A.useCallback)((y=new Set)=>{let T=Array.from(nt.entries()).filter(([it])=>!y.has(it));if(T.length===0)return;or();let x=h.current,{html:k,resolvedCollisions:L}=i1(x,T.map(([,it])=>it)),M=Xl(k);lt(it=>{let J=new Map(it);for(let[_t]of T)J.delete(_t);return J}),h.current=M,_(M),u.getState().elements.length>0&&e1(u,x,M);let $=kt(),Y=t1($,M);G_($),Yr(M,"soft"),xt("editor.timeline-timing-commit",{count:T.length,patchedCount:Y,resolvedCollisions:L})},[kt,Yr,or,nt,u]),Ym=(0,A.useCallback)(()=>{let y=!1;te&&Ut.current&&(Ut.current(),Ut.current=null,mt(!1),y=!0);let T=vn?Nt(vn):null;return nt.size>0&&fc(y&&T?new Set([T]):new Set),X.size>0&&dc(),h.current},[fc,dc,te,vn,nt.size,X.size]);(0,A.useEffect)(()=>{dn.current={timing:()=>fc(),visual:()=>dc(),flushAll:()=>{Ym()}}},[Ym,fc,dc]);let Wm=(0,A.useCallback)(async y=>{if(rc)return;let T=n.title;gt({phase:"starting",title:T,status:"STARTING",progress:0,framesRendered:0,totalFrames:null,lambdasInvoked:0,cost:"$0.0000"});try{let x=Ym(),k=await i(),L=await fetch(`/api/v1/compositions/${encodeURIComponent(k)}/render`,{method:"POST",headers:{"content-type":"application/json; charset=utf-8"},body:JSON.stringify({title:T,html:x,...y==="cloud"?{render_target:"cloud"}:{}})}),M=await L.json().catch(()=>({}));if(!L.ok||M.ok===!1)throw new Error(M.error||`Publish failed with ${L.status}`);xt("editor.publish-started",{forkId:k,renderId:M.renderId}),gt(sU(M,T))}catch(x){wo("editor.publish-start-error",x instanceof Error?x.stack:x),gt({phase:"failed",title:T,status:"FAILED",progress:0,error:x instanceof Error?x.message:String(x)})}},[Ym,n.title,i,rc]);(0,A.useEffect)(()=>{if(F?.phase!=="running"||!F.renderId||!o)return;let y=o,T=!1,x=0,k=0,L=async()=>{try{let M=await fetch(`/api/v1/compositions/${encodeURIComponent(y)}/renders/${encodeURIComponent(F.renderId||"")}`),$=await M.json().catch(()=>({}));if(T)return;if(!M.ok||$.ok===!1)throw new Error($.error||`Publish progress failed with ${M.status}`);x=0,gt(sU($,n.title))}catch(M){if(T)return;if(wo("editor.publish-poll-error",M instanceof Error?M.stack:M),x+=1,x<5){k=window.setTimeout(()=>{L()},4500);return}gt($=>({...$??{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(()=>{L()},4500),()=>{T=!0,window.clearTimeout(k)}},[n.title,o,F]);let M6=(0,A.useCallback)(()=>{let y=kt(),T=Cs(y);if(!T)return;if(T.isPlaying()||u.getState().isPlaying){T.pause(),u.getState().setCurrentTime(T.getTime()),u.getState().setIsPlaying(!1),Sn();return}(te||nt.size>0||X.size>0)&&(yt.current=!0);let k=!1;te&&Ut.current&&(Ut.current(),Ut.current=null,mt(!1),k=!0);let L=vn?Nt(vn):null;nt.size>0&&fc(k&&L?new Set([L]):new Set),X.size>0&&dc(),yt.current&&(yt.current=!1);let M=jd(Number(C));T.getTime()>=T.getDuration()&&T.seek(0),T.setPlaybackRate?.(M),T.play(),u.getState().setIsPlaying(!0),ac()},[jd,dc,fc,kt,te,vn,C,ac,Sn,nt.size,u,X.size]),O6=(0,A.useCallback)((y,T)=>{try{let x=new DOMParser().parseFromString(k1(),"text/html"),k=Bn(x,y);if(!k)return;let L=k.getAttribute("data-vf-group"),M=SU(x,L,k),$=Ql(k),Y=T.start-$.start,it=T.track-$.track,J=new Map;for(let _t of M){let St=Ci(_t);if(!St)continue;let ot=Ql(_t);J.set(St,{start:Math.max(0,ot.start+Y),duration:ot.duration,track:Math.max(0,ot.track+it)})}pX(x,M,J);for(let _t of M){let St=Ci(_t),ot=St?J.get(St):null;if(!St||!ot)continue;let ie=nc.find(Je=>Nt(Je)===St||Je.hfId===St||Je.domId===St||Je.id===St)??(St===Ci(k)?y:null);if(!ie)continue;if(!Mi(ie,{start:ot.start,track:ot.track},{bypassCollisionGuard:!0}))throw new Error("Timeline move could not be staged.")}window.setTimeout(()=>dn.current.timing(),0)}catch(x){return Ar("editor.timeline-move-rejected",x instanceof Error?x.message:x),Promise.reject(x)}},[nc,k1,Mi]),D6=(0,A.useCallback)((y,T)=>{try{if(!Mi(y,T))throw new Error("Timeline resize could not be staged.");window.setTimeout(()=>dn.current.timing(),0)}catch(x){return Ar("editor.timeline-resize-rejected",x instanceof Error?x.message:x),Promise.reject(x)}},[Mi]),d0=(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=Nt(y),L=AU(y,nt.get(k)),M=Sa(x.clientX,x.clientY);if(!M)return;x.preventDefault(),x.stopPropagation();let $=u.getState();$.clearSelectedElementIds(),$.setSelectedElementId(k),_n.current=null;let Y=dX(ko.filter(it=>X_(h.current,it)!=="track-placeholder"));He.current={element:L,mode:T,originClientX:x.clientX,originClientY:x.clientY,originPointerTime:M.time,originStart:L.start,originDuration:L.duration,originTrack:L.track,originPlaybackStart:L.playbackStart,moved:!1,rowOrder:n1(ko),laneAudioFlags:Y},xt("editor.manual-timeline-drag-start",{elementKey:k,mode:T,start:L.start,duration:L.duration,track:L.track})},[ko,Sa,nt,u]);(0,A.useEffect)(()=>{function y(x){let k=He.current;if(!k)return;let L=Math.hypot(x.clientX-k.originClientX,x.clientY-k.originClientY);if(!k.moved&&L<2)return;k.moved=!0,x.preventDefault();let M=Sa(x.clientX,x.clientY);if(!M)return;let $=M.time-k.originPointerTime,Y=k.originStart+k.originDuration,it=_U(u.getState().elements,k.element,h.current),J=!1,_t=!1;if(k.mode==="move"){let St=Dt(k.originStart+$,0,Math.max(0,f-k.originDuration)),ot=M.track??k.originTrack,ie=it.reduce((No,Co)=>Math.max(No,Co.track),-1),We=M.syntheticTrack?Math.min(ot,Math.max(ie+1,k.originTrack)):ot,Je=k.element.tag==="audio",gc=k.laneAudioFlags.get(We);if(!M.syntheticTrack&&We!==k.originTrack&&gc!==void 0&&gc!==Je)_t=!0;else{let No={start:St,duration:k.originDuration,track:We},Co=r1(No,it)?fX(it,We,k.originDuration,St,f):St;Co===null?_t=!0:J=Mi(k.element,{start:Co,track:We})}}else if(k.mode==="trim-start"){let St=it.reduce((No,Co)=>Bm(Co)&&Co.track===k.originTrack&&Co.start+Co.duration<=k.originStart+.001?Math.max(No,Co.start+Co.duration):No,0),ot=Math.max(0,Y-.05),ie=Math.min(St,ot),We=Dt(k.originStart+$,ie,ot),Je=We-k.originStart,gc=k.originPlaybackStart===void 0?void 0:Math.max(0,k.originPlaybackStart+Je);J=Mi(k.element,{start:We,duration:Math.max(.05,Y-We),playbackStart:gc})}else{let St=it.reduce((We,Je)=>Bm(Je)&&Je.track===k.originTrack&&Je.start>=Y-.001?Math.min(We,Je.start):We,f),ot=Math.max(k.originStart+.05,St),ie=Dt(Y+$,k.originStart+.05,ot);J=Mi(k.element,{duration:Math.max(.05,ie-k.originStart)})}_t?xt("editor.manual-timeline-drag-lane-full",{elementKey:Nt(k.element),mode:k.mode,track:M.track??k.originTrack}):J||Ar("editor.manual-timeline-drag-rejected",{elementKey:Nt(k.element),mode:k.mode})}function T(){let x=He.current;x&&(xt("editor.manual-timeline-drag-end",{elementKey:Nt(x.element),mode:x.mode,moved:x.moved}),He.current=null,x.moved&&window.setTimeout(()=>dn.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 R1=(0,A.useCallback)((y,T)=>{let x=Zo(m,y,k=>{let L=Number(k.getAttribute("data-start")??y.start),M=Number(k.getAttribute("data-duration")??y.duration),$=L+M;if(T<=L||T>=$)return;let Y=T-L,it=$-T,J=k.cloneNode(!0),_t=`element_split_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,St=Number(k.getAttribute("data-playback-start")??k.getAttribute("data-media-start")??y.playbackStart??0),ot=k.getAttribute("data-layer-kind")||m1(y)?.kind||(y.tag==="audio"?"audio":y.tag==="video"?"video":"layer"),ie=Kt(St+Y);k.setAttribute("data-duration",Kt(Y)),k.setAttribute("data-layer-kind",ot),J.id=_t,J.setAttribute("data-hf-id",_t),J.setAttribute("data-start",Kt(T)),J.setAttribute("data-duration",Kt(it)),J.setAttribute("data-media-start",ie),J.setAttribute("data-playback-start",ie),J.setAttribute("data-layer-kind",ot),J.setAttribute("data-label",`${y.label??y.id} split`),k.after(J)});Ro(x)},[m,Ro]),L6=(0,A.useCallback)((y,T)=>{let x=Math.max(0,T==="above"?y+1:y),{html:k}=xo(m,L=>{for(let it of Array.from(L.querySelectorAll("[data-start]"))){if(!re(it))continue;let J=Number(it.getAttribute("data-track-index")??0);J>=x&&it.setAttribute("data-track-index",String(J+1))}let M=L.querySelector("[data-composition-id]");if(!re(M))return;let $=`element_track_${x}_${Date.now().toString(36)}`,Y=L.createElement("div");Y.id=$,Y.setAttribute("data-hf-id",$),Y.setAttribute("data-layer-mode","publish"),Y.setAttribute("data-layer-kind","track-placeholder"),Y.setAttribute("data-viral-note","Empty layer row."),Y.setAttribute("data-start","0"),Y.setAttribute("data-duration","0"),Y.setAttribute("data-track-index",String(x)),Y.setAttribute("data-label","Empty layer"),Y.setAttribute("data-timeline-locked","true"),Y.style.cssText="position:absolute;left:0%;top:0%;width:1%;height:1%;display:none;",M.append(Y)});Ro(k),xt("editor.timeline-layer-inserted",{anchorTrack:y,placement:T,insertAt:x})},[m,Ro,u]),Km=(0,A.useCallback)((y,T)=>{Ut.current?.();let x=`element_${y}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,k=u.getState().currentTime,L=Math.max(0,Math.min(f-.5,Number.isFinite(T.time)?T.time:k)),M=Math.max(.5,Math.min(4,f-L)),$=T.frame??{x:12,y:y==="text"?68:18,width:y==="text"?76:54,height:y==="text"?12:32},{html:Y}=xo(h.current,it=>{let J=it.querySelector("[data-composition-id]");if(!re(J))return;let St=Array.from(it.querySelectorAll("[data-start]")).filter(ie=>re(ie)).reduce((ie,We)=>{let Je=Number(We.getAttribute("data-track-index")??0);return Number.isFinite(Je)?Math.max(ie,Je+1):ie},0),ot=y==="media"?it.createElement("video"):it.createElement("div");ot.id=x,ot.setAttribute("data-hf-id",x),ot.setAttribute("data-layer-mode","publish"),ot.setAttribute("data-layer-kind",y==="media"?"video":"caption"),ot.setAttribute("data-viral-note",y==="media"?"Inserted media layer.":"Inserted caption layer."),ot.setAttribute("data-start",Kt(L)),ot.setAttribute("data-duration",Kt(M)),ot.setAttribute("data-track-index",String(St)),ot.setAttribute("data-label",y==="media"?"New media":"New text"),y==="text"&&(ot.setAttribute("data-text-background-style","plain"),ot.setAttribute("data-text-background-color","#000000"),ot.setAttribute("data-font-family","Montserrat")),ot.style.position="absolute",ot.style.left=`${Dt($.x,0,95)}%`,ot.style.top=`${Dt($.y,0,95)}%`,ot.style.width=`${Dt($.width,1,100-Dt($.x,0,95))}%`,ot.style.height=`${Dt($.height,1,100-Dt($.y,0,95))}%`,ot.style.zIndex=String(100+St),ot.style.overflow="hidden",y==="media"&&ot instanceof HTMLVideoElement?(ot.setAttribute("src",Dm),ot.setAttribute("playsinline",""),ot.setAttribute("muted",""),ot.setAttribute("preload","auto"),ot.setAttribute("data-media-start","0"),ot.setAttribute("data-playback-start","0"),ot.style.objectFit="cover",ot.style.background="#050604"):(ot.style.display="flex",ot.style.alignItems="center",ot.style.justifyContent="center",ot.style.padding="3px",ot.style.boxSizing="border-box",ot.style.textAlign="center",ot.style.color="#ffffff",ot.style.background="transparent",ot.style.fontFamily="Montserrat, 'TikTok Sans', sans-serif",ot.style.fontWeight="600",ot.style.fontSize="22px",ot.style.lineHeight="1.2",ot.style.textTransform="none",J_(ot,"New text","plain","#ffffff","#000000","Montserrat",600)),J.append(ot)});I1(Y,x),z(null),O(null),xt("editor.layer-inserted",{id:x,kind:y,start:L,duration:M})},[f,I1,u]),f0=(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(Nt(M)));if(x.length<2)return;let k=`vf-group-${Date.now().toString(36)}`,{html:L}=xo(m,M=>{for(let $ of x){let Y=Bn(M,$);Y&&(Y.setAttribute("data-vf-group",k),Y.setAttribute("data-vf-group-label","Vidfarm group"))}});Ro(L),xt("editor.group-created",{groupId:k,count:x.length})},[m,Ro,u]),p0=(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}=xo(m,k=>{let L=new Set;for(let M of y.elements){if(!T.has(Nt(M)))continue;let $=vU(k,M);$&&L.add($)}for(let M of L)for(let $ of SU(k,M,k.body))$.removeAttribute("data-vf-group"),$.removeAttribute("data-vf-group-label")});Ro(x),xt("editor.group-removed")},[m,Ro,u]),Vd=(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=kt(),k=Im(x,y,it=>{it instanceof HTMLMediaElement&&it.pause(),it.remove()}),L=G_(x),M=new Set([Nt(y),y.hfId,y.domId,y.id].filter(it=>!!it)),$=u.getState();$.setElements($.elements.filter(it=>![Nt(it),it.hfId,it.domId,it.id].some(_t=>_t&&M.has(_t)))),$.clearSelectedElementIds(),$.setSelectedElementId(null),lt(it=>{let J=new Map(it);for(let _t of M)J.delete(_t);return J}),ct(it=>{let J=new Map(it);for(let _t of M)J.delete(_t);return J}),Yr(T,"soft");let Y=Cs(x);if(Y){let it=Y.getTime();Y.seek(it),$.setCurrentTime(Y.getTime()),$.setIsPlaying(Y.isPlaying())}xt("editor.layer-delete-soft",{elementKey:Nt(y),patched:k,refreshed:L}),(!k||!L)&&S(it=>it+1)},[kt,Yr,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?uc():qd();return}if((T.metaKey||T.ctrlKey)&&!T.altKey&&!T.shiftKey&&T.key.toLowerCase()==="y"){T.preventDefault(),uc();return}if((T.metaKey||T.ctrlKey)&&T.key.toLowerCase()==="g"){T.preventDefault(),T.shiftKey?p0():f0();return}if(T.key==="Delete"||T.key==="Backspace"){let k=u.getState(),L=new Set([...k.selectedElementId?[k.selectedElementId]:[],...Array.from(k.selectedElementIds)]);if(L.size===0)return;let M=k.elements.filter($=>L.has(Nt($)));if(M.length===0)return;T.preventDefault();for(let $ of M)$.hfId!=="source-video"&&Vd($)}}};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Vd,f0,uc,qd,p0,u]);let pc=(0,A.useCallback)((y,T)=>{navigator.clipboard?.writeText(y).then(()=>{xt("editor.clipboard-copy",{label:T,value:y})}).catch(x=>{Ar("editor.clipboard-copy-failed",{label:T,error:x instanceof Error?x.message:x})})},[]),N1=(0,A.useCallback)(y=>{pc(Ms(y),"timestamp")},[pc]),U6=(0,A.useCallback)(y=>{pc(`time=${Ms(y.time)} track=${y.track??"none"}`,"timeline-coordinates")},[pc]),B6=(0,A.useCallback)(y=>{pc(`x=${Kt(y.x)} y=${Kt(y.y)} width=${Kt(y.width)} height=${Kt(y.height)}`,"preview-coordinates")},[pc]),P6=(0,A.useMemo)(()=>new Map(Lm.map(y=>[y.id,y])),[Lm]),z6=(0,A.useCallback)(()=>{let y=u.getState();y.setSelectedElementId(null),y.clearSelectedElementIds()},[u]);function F6(y,T){let x=P6.get(y.hfId??y.domId??y.id),k=X_(h.current,y),L=KU(h.current,y),M=k??x?.kind??(y.tag==="audio"?"audio":y.tag==="video"?"video":"layer"),$=y.label??x?.label??y.id,Y=Nt(y),it=r0.has(Y);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 _t=u.getState();_t.selectedElementId?(_t.selectedElementId,_t.toggleSelectedElementId(Y)):_t.setSelectedElementId(Y),xt("editor.timeline-multi-select",{elementKey:Y,selected:Array.from(u.getState().selectedElementIds)})},children:[(0,g.jsx)("span",{className:"native-clip-trim-hit start","aria-label":"Trim clip start",onPointerDown:J=>d0(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=>d0(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=>d0(y,"trim-end",J),onClick:J=>{J.preventDefault(),J.stopPropagation()}}),(0,g.jsx)("span",{className:`native-clip-thumb ${M}`,children:iX(M,L==="html"?"html":x?.customHtml)}),(0,g.jsx)("strong",{style:{color:T.label},children:$}),(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}),m0=(0,A.useRef)(null),g0=(0,A.useRef)(rc);g0.current=rc;let h0=(0,A.useRef)(Wm);h0.current=Wm,(0,A.useEffect)(()=>{if(F){if(F.phase==="succeeded"&&F.outputUrl){let y=ti.current,T={url:F.outputUrl,title:F.title??null,renderId:F.renderId??null};ti.current={url:F.outputUrl,title:F.title??null,status:F.status??"SUCCEEDED",renderId:F.renderId??null},(y.url!==T.url||y.renderId!==T.renderId)&&UX(T);return}ti.current={...ti.current,status:F.status??ti.current.status}}},[F]);let C1=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!o||C1.current===o)return;C1.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),L=(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,$)=>$.version-M.version).slice(0,5);for(let M of L){if(y)return;let $=await fetch(`/api/v1/compositions/${encodeURIComponent(o)}/renders/${encodeURIComponent(M.renderJobId)}`);if(!$.ok)continue;let Y=await $.json().catch(()=>({}));if(y)return;if(Y?.status==="SUCCEEDED"&&typeof Y.outputUrl=="string"&&Y.outputUrl){if(ti.current.url&&ti.current.renderId===Y.renderId)return;ti.current={url:Y.outputUrl,title:Y.title??n.title??null,status:Y.status,renderId:Y.renderId??M.renderJobId};return}}}catch{}})(),()=>{y=!0}},[o,n.title]);let mc=(0,A.useRef)({compositionHtmlRef:h,patchCompositionHtml:Ro,draftedElements:ko,selectedElementId:ec,composition:n,activeCompositionDuration:f,startExport:()=>{h0.current()},isExportInFlight:()=>g0.current,getLastExport:()=>ti.current,getCast:()=>m0.current});(0,A.useEffect)(()=>{mc.current={compositionHtmlRef:h,patchCompositionHtml:Ro,draftedElements:ko,selectedElementId:ec,composition:n,activeCompositionDuration:f,startExport:()=>{h0.current()},isExportInFlight:()=>g0.current,getLastExport:()=>ti.current,getCast:()=>m0.current}}),(0,A.useEffect)(()=>(Rm.current={getSnapshot:()=>KX(mc.current),applyAction:y=>RU(y,mc.current)},()=>{Rm.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"),L=Array.from(k.querySelectorAll('[data-vf-gen-status="generating"][data-vf-gen-job]'));for(let M of L){if(y)return;let $=M.getAttribute("data-hf-id")||M.id,Y=M.getAttribute("data-vf-gen-job");if(!(!$||!Y))try{let it=await fetch(`/api/v1/user/me/jobs/${encodeURIComponent(Y)}`);if(!it.ok)continue;let J=await it.json().catch(()=>null);if(!J)continue;let _t=ZX(J);if(_t){tJ(mc.current,$,_t);continue}let St=typeof J.status=="string"?J.status:"";if(St==="failed"||St==="cancelled"){let ot=typeof J.error=="string"&&J.error?J.error:`generation ${St}`;Mm(mc.current,$,ie=>{ie.setAttribute("data-vf-gen-status","error"),ie.setAttribute("data-vf-gen-error",ot.slice(0,200))})}}catch{}}};return(async()=>{for(;!y;){if(await new Promise(x=>setTimeout(x,6e3)),y)return;await T()}})(),()=>{y=!0}},[]);let H6=(0,A.useCallback)((y,T)=>{Ar("editor.timeline-edit-blocked",{elementKey:Nt(y),intent:T,tag:y.tag,timingSource:y.timingSource,timelineLocked:y.timelineLocked})},[]),G6=(0,A.useCallback)(y=>{let T=u.getState();T.setSelectedElementId(y?Nt(y):null),T.clearSelectedElementIds()},[u]),$6=(0,A.useCallback)(()=>z(null),[]),j6=(0,A.useCallback)(()=>O(null),[]),q6=(0,A.useCallback)(()=>gt(null),[]),M1=(0,A.useCallback)(y=>Km("text",y),[Km]),O1=(0,A.useCallback)(y=>Km("media",y),[Km]),D1=(0,A.useCallback)(y=>{B.current={time:Number.isFinite(y.time)?y.time:u.getState().currentTime,frame:y.frame};let T=N.current;T&&(T.value="",T.click())},[u]),V6=(0,A.useCallback)(async y=>{let T=y.target.files?.[0]??null;if(y.target.value="",!T)return;let x=B.current??{time:u.getState().currentTime};B.current=null;let k=zX(T);if(!k){st(`Unsupported file type: ${T.type||T.name}`),window.setTimeout(()=>st(null),4e3);return}Ut.current?.(),st(`Uploading ${T.name}\u2026`);try{let{url:L}=await PX(T),M=`element_${k}_${Date.now().toString(36)}${Math.floor(Math.random()*1e3).toString(36)}`,$=x.frame,Y={action_type:"add_layer",kind:k,src:L,start:x.time,layer_key:M,label:T.name,note:"Uploaded from computer"};if(k!=="audio"){let _t=$??{x:12,y:18,width:54,height:32};Y.x=_t.x,Y.y=_t.y,Y.width=_t.width,Y.height=_t.height}let it=RU(Y,mc.current);if(!it.ok){st(it.error??"Could not add the uploaded media."),window.setTimeout(()=>st(null),5e3);return}let J=u.getState();J.setSelectedElementId(M),J.clearSelectedElementIds(),st(null)}catch(L){st(L instanceof Error?L.message:"Upload failed."),window.setTimeout(()=>st(null),5e3)}},[u]),Y6=(0,g.jsxs)("div",{className:"preview-pane",children:[(0,g.jsxs)("div",{className:"player-stage",ref:Qt,onPointerDown:v6,onContextMenu:_6,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=>{un.current=y,Fm.current=d(y)},directUrl:y1,onLoad:()=>{s6(),w6(),I6(),zd()?.liveReload&&o&&!tc.current&&(tc.current=!0,s0(h.current))},portrait:!0,suppressLoadingOverlay:!0},y1):(0,g.jsx)("section",{className:"editor-loading-shell","aria-label":"Composition loading",children:(0,g.jsx)("span",{children:"Loading composition"})}),(0,g.jsx)(DX,{selected:vn,html:m,visualFrameDraft:S1,stageRef:Qt,getIframe:kt,onStageFrame:Vm,onCommitDrag:N6})]}),(0,g.jsx)(bX,{disabled:!_1,speedDraft:C,onSpeedDraftChange:I,onCommitSpeed:jd,onSeek:Ir,onTogglePlay:M6,onUndo:qd,onRedo:uc,canUndo:m6,canRedo:g6,usePlayerStore:u})]});return(0,g.jsxs)("section",{className:"studio-shell","aria-label":"Video editor output",children:[Q&&!Q.dismissed&&(0,g.jsx)(IX,{mode:Q.mode,busy:Q.busy,finished:Q.finished,error:Q.error,scenesCreated:Q.scenesCreated,ghostcutStatus:Q.ghostcutStatus,ghostcutProgress:Q.ghostcutProgress,userPrompt:Q.userPrompt,onUserPromptChange:y=>dt(T=>T&&{...T,userPrompt:y}),onDecompose:Ao,onFinish:Io,onCancel:Q.mode==="redo"?Me:void 0,onDismiss:Q.mode==="initial"?n0:void 0}),Xt&&o&&(0,g.jsx)(kX,{forkId:o,onClose:()=>Ce(!1)}),bn&&o&&(0,g.jsx)(RX,{forkId:o,currentVersion:Z,onClose:()=>Pn(!1),onReverted:a6}),(0,g.jsxs)("section",{className:"studio-main",ref:oe,children:[Y6,(0,g.jsx)(LX,{composition:v,selected:vn,html:m,onPatchHtml:Ro,onPatchLiveElement:x6,onPreviewLiveElement:A6,onUnselect:z6,onDraftStateChange:k6,onStageTimelineDraft:Mi,onStageVisualFrameDraft:Vm,timelineDraft:p6,visualFrameDraft:S1,onClearTimelineDraft:u0,onClearVisualFrameDraft:c0,onDiscardVisualFrameDraft:R6,onDiscardTimelineDraft:C6,onDelete:Vd,maxDuration:f,onPublish:()=>Wm(),publishOptions:y6,onPublishOption:y=>Wm(y==="cloud"?"cloud":"local"),publishDisabled:rc,publishLabel:h6,templateId:n.templateId??null,forkId:o,publishVersion:F?.version??Z,originalUrl:n.originalUrl??null,songName:n.songName??null,songUrl:n.songUrl??null,onOpenShare:o6,onOpenDecompose:r6,onOpenHistory:i6,decomposeDismissed:!!Q?.dismissed,decomposeBusy:!!Q?.busy,onResumeDecompose:n6})]}),(0,g.jsxs)("section",{className:"native-timeline",ref:cn,onPointerDownCapture:S6,onClickCapture:E6,onContextMenuCapture:T6,children:[(0,g.jsx)(l,{onSeek:Ir,onMoveElement:O6,onResizeElement:D6,onBlockedEditAttempt:H6,onSplitElement:R1,onDeleteElement:Vd,onSelectElement:G6,renderClipContent:F6,theme:GK}),o0&&(0,g.jsx)("div",{className:"timeline-layer-numbers","aria-hidden":"true",style:{left:-d6},children:v1.map((y,T)=>(0,g.jsxs)("span",{className:"timeline-layer-number",style:{top:T*uU+2-c6},children:["L",y]},y))}),D&&(0,g.jsx)(_X,{state:D,usePlayerStore:u,canGroup:Hm.size>=2,canUngroup:b6,onClose:$6,onSeek:Ir,onSplit:R1,onInsertLayer:L6,onInsertText:M1,onInsertMedia:O1,onUploadMedia:D1,onCopyTimestamp:N1,onCopyCoordinates:U6,onGroup:f0,onUngroup:p0,onDelete:Vd})]}),U&&(0,g.jsx)(vX,{state:U,onClose:j6,onInsertText:M1,onInsertMedia:O1,onUploadMedia:D1,onCopyTimestamp:N1,onCopyCoordinates:B6}),(0,g.jsx)("input",{ref:N,type:"file",accept:"video/*,image/*,audio/*",style:{display:"none"},onChange:V6}),V&&(0,g.jsx)("div",{className:"editor-upload-toast",role:"status",children:V}),F&&(0,g.jsx)(SX,{state:F,onClose:q6})]})}function zd(){if(typeof window>"u")return null;let t=window.__HF_BOOT__;if(t&&typeof t=="object"&&!Array.isArray(t))return CU(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 CU(n)}catch{}}return null}function CU(t){let e=typeof t.compositionId=="string"?t.compositionId:null;return e?{compositionId:e,draftPath:typeof t.draftPath=="string"?t.draftPath:void 0,slugId:typeof t.slugId=="string"?t.slugId:void 0,templateId:typeof t.templateId=="string"?t.templateId:null,title:typeof t.title=="string"?t.title:void 0,lambdaMemoryMb:typeof t.lambdaMemoryMb=="number"?t.lambdaMemoryMb:void 0,apiBase:typeof t.apiBase=="string"?t.apiBase:void 0,editorChatApiUrl:typeof t.editorChatApiUrl=="string"?t.editorChatApiUrl:null,vidfarmApiKey:typeof t.vidfarmApiKey=="string"?t.vidfarmApiKey:null,originalUrl:typeof t.originalUrl=="string"?t.originalUrl:null,songName:typeof t.songName=="string"?t.songName:null,songUrl:typeof t.songUrl=="string"?t.songUrl:null,localRender:t.localRender===!0,cloudRenderAvailable:t.cloudRenderAvailable===!0,initialThreadId:typeof t.initialThreadId=="string"?t.initialThreadId:null,liveReload:t.liveReload===!0}:null}function pJ(t){if(!t)return Um[0];let e=Um.find(n=>n.id===t.compositionId);return e?{...e,templateId:t.templateId??e.templateId??null,originalUrl:t.originalUrl??e.originalUrl??null,songName:t.songName??e.songName??null,songUrl:t.songUrl??e.songUrl??null}:{id:t.compositionId,eyebrow:"TEMPLATE",title:t.title??t.compositionId,sourceFolder:"",sourceType:"video",duration:12,width:720,height:1280,summary:"Template composition.",media:{type:"video",src:""},templateId:t.templateId??t.compositionId,originalUrl:t.originalUrl??null,songName:t.songName??null,songUrl:t.songUrl??null,viralDna:{hook:"",retention:"",payoff:"",preserve:[],avoid:[]},layers:[],editable:!0}}function t6({boot:t}={}){let e=(0,A.useMemo)(()=>pJ(t),[t]),n=!!t,[r,o]=(0,A.useState)(n?"edit":"preview"),[i,a]=(0,A.useState)(e);(0,A.useEffect)(()=>{let l=jK(),c=n?()=>{}:qK();return()=>{l(),c()}},[n]),(0,A.useEffect)(()=>{xt("app.view-mode",{viewMode:r})},[r]);let s=r==="preview"?(0,g.jsx)("section",{className:"markdown-preview-shell","aria-label":"Preview output",children:(0,g.jsx)(uJ,{onEdit:l=>{a(l),xt("app.mode-change-request",{from:"preview",to:"edit",id:l.id}),o("edit")}})}):(0,g.jsx)(dJ,{composition:i,onPreview:()=>{if(n){xt("app.mode-change-request",{from:"edit",to:"discover",boot:!0}),typeof window<"u"&&(window.location.href="/discover");return}xt("app.mode-change-request",{from:"edit",to:"preview"}),o("preview")}},i.id);return(0,g.jsxs)("main",{className:"vidfarm-workbench",children:[(0,g.jsx)(HX,{boot:t??null,composition:i}),(0,g.jsx)("section",{className:"editor-output",children:(0,g.jsx)(l1,{children:s})})]})}var Ds=Wr(Jm(),1);aU();xt("boot.entry-loaded");var h1=document.getElementById("root");if(!h1){wo("boot.root-missing");let t=new Error("Missing #root element");throw ta(t),t}var Hd=zd();xt("boot.config-resolved",Hd??{source:"none"});Hd?.templateId&&Yu.setTag("hyperframes.template_id",Hd.templateId);Hd?.compositionId&&Yu.setTag("hyperframes.composition_id",Hd.compositionId);function mJ(){return(0,Ds.jsxs)("section",{style:{display:"grid",placeItems:"center",height:"100vh",padding:"24px",textAlign:"center",gap:"12px",color:"#fffbe6",background:"#050604"},children:[(0,Ds.jsx)("strong",{style:{fontSize:"0.72rem",letterSpacing:"0.14em",textTransform:"uppercase"},children:"Editor crashed"}),(0,Ds.jsx)("span",{style:{fontSize:"0.92rem",opacity:.75},children:"Something went wrong loading the editor. Reload the page to try again."})]})}try{xt("boot.render-start",{rootChildren:h1.childNodes.length}),(0,e6.createRoot)(h1).render((0,Ds.jsx)(Yu.ErrorBoundary,{fallback:(0,Ds.jsx)(mJ,{}),onError:t=>wo("boot.render-error",t instanceof Error?t.stack:t),children:(0,Ds.jsx)(t6,{boot:Hd})})),xt("boot.render-called")}catch(t){throw wo("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
+ */